Commit 95256079 authored by Iñigo Martínez's avatar Iñigo Martínez Committed by Bastien Nocera

build: Port to meson build system

With additional testing and patches from Bastien Nocera
<hadess@hadess.net>

https://bugzilla.gnome.org/show_bug.cgi?id=783205
parent a1da1b32
[submodule "libgd"]
path = libgd
url = git://git.gnome.org/libgd
[submodule "subprojects/libgd"]
path = subprojects/libgd
url = https://git.gnome.org/browse/libgd
ACLOCAL_AMFLAGS = -I m4 -I libgd ${ACLOCAL_FLAGS}
ACLOCAL_AMFLAGS = -I m4 -I subprojects/libgd ${ACLOCAL_FLAGS}
SUBDIRS = libgd po data help src docs
SUBDIRS = subprojects po data help src docs
EXTRA_DIST = \
license_change \
......
......@@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=.
olddir=`pwd`
PKG_NAME="totem"
ACLOCAL_FLAGS="-I libgd $ACLOCAL_FLAGS"
ACLOCAL_FLAGS="-I subprojects/libgd $ACLOCAL_FLAGS"
(test -f $srcdir/configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
......
......@@ -247,8 +247,10 @@ PKG_CHECK_MODULES(PROPERTIES, gtk+-3.0 >= $GTK_REQS)
LIBGD_INIT([
tagged-entry
main-view
gtk-hacks
view-common
static
])
][subprojects/libgd])
dnl ================================================================
......@@ -536,7 +538,8 @@ AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([
Makefile
totem.spec
libgd/Makefile
subprojects/Makefile
subprojects/libgd/Makefile
src/Makefile
src/gst/Makefile
src/properties/Makefile
......
info_name = 'org.gnome.Totem.metainfo.xml'
custom_target(
info_name,
input: 'org.gnome.Totem.appdata.xml.in',
output: info_name,
command: intltool_xml_cmd,
install: true,
install_dir: join_paths(totem_datadir, 'metainfo')
)
icon_sizes = [
'16x16',
'22x22',
'24x24',
'32x32',
'48x48',
'256x256'
]
foreach icon_size: icon_sizes
install_data(
join_paths(icon_size, 'org.gnome.Totem.png'),
install_dir: join_paths(totem_datadir, 'icons', 'hicolor', icon_size, 'apps')
)
endforeach
install_data(
'symbolic/org.gnome.Totem-symbolic.svg',
install_dir: join_paths(totem_datadir, 'icons', 'hicolor', 'symbolic', 'apps')
)
subdir('appdata')
subdir('icons')
desktop_sh = find_program('desktop.sh')
thumbnailer_sh = find_program('thumbnailer.sh')
mime_type_include_sh = find_program('mime-type-include.sh')
mime_type_imports_sh = find_program('mime-type-imports.sh')
uri_scheme_include_sh = find_program('uri-scheme-include.sh')
mime_type_list = files('mime-type-list.txt')
uri_schemes_list = files('uri-schemes-list.txt')
pod2man = find_program('pod2man', required: false)
if pod2man.found()
thumbnailer_name = 'totem-video-thumbnailer'
pod2man_opts = [
'-c', '""',
'-s', '1',
'-q', 'none',
'-n', thumbnailer_name,
'-r', 'GNOME'
]
custom_target(
thumbnailer_name + '.1',
input: thumbnailer_name + '.pod',
output: thumbnailer_name + '.1',
command: [pod2man, pod2man_opts, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: join_paths(totem_mandir, 'man1')
)
install_data(
'totem.1',
install_dir: join_paths(totem_mandir, 'man1')
)
else
message('Man page generation disabled')
endif
ui_files = files(
'controls.ui',
'playlist.ui',
'preferences.ui',
'properties.ui',
'shortcuts.ui',
'totem.ui',
'uri.ui'
)
install_data(
ui_files,
install_dir: totem_pkgdatadir
)
r = run_command(desktop_sh, mime_type_list, uri_schemes_list)
desktop_conf = configuration_data()
desktop_conf.set('VERSION', totem_version)
desktop_conf.set('MIME_TYPE', r.stdout().strip())
desktop = 'org.gnome.Totem.desktop'
desktop_in = configure_file(
input: desktop + '.meson',
output: desktop + '.in',
configuration: desktop_conf
)
custom_target(
desktop,
input: desktop_in,
output: desktop,
command: intltool_desktop_cmd,
install: true,
install_dir: join_paths(totem_datadir, 'applications')
)
service_conf = configuration_data()
service_conf.set('bindir', totem_bindir)
service = 'org.gnome.Totem.service'
configure_file(
input: service + '.in',
output: service,
install: true,
install_dir: join_paths(totem_datadir, 'dbus-1', 'services'),
configuration: service_conf
)
r = run_command(thumbnailer_sh, mime_type_list)
thumbnailer_conf = configuration_data()
thumbnailer_conf.set('BINDIR', totem_bindir)
thumbnailer_conf.set('MIME_TYPE', r.stdout().strip())
thumbnailer = 'totem.thumbnailer'
configure_file(
input: thumbnailer + '.meson',
output: thumbnailer,
install: true,
install_dir: join_paths(totem_datadir, 'thumbnailers'),
configuration: thumbnailer_conf
)
gen_sources = []
totem_mime_header = 'totem-mime-types.h'
gen_sources += custom_target(
totem_mime_header,
output: totem_mime_header,
capture: true,
command: [mime_type_include_sh, mime_type_list]
)
nautilus_mime_header = 'nautilus-video-mime-types.h'
custom_target(
nautilus_mime_header,
output: nautilus_mime_header,
capture: true,
command: [mime_type_include_sh, '--nautilus', mime_type_list]
)
totem_mime_js = 'totemMimeTypes.js'
custom_target(
totem_mime_js,
output: totem_mime_js,
capture: true,
command: [mime_type_imports_sh, mime_type_list]
)
totem_uri_header = 'totem-uri-schemes.h'
gen_sources += custom_target(
totem_uri_header,
output: totem_uri_header,
capture: true,
command: [uri_scheme_include_sh, uri_schemes_list],
)
schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', meson.project_name())
schema = 'org.gnome.totem.gschema.xml'
configure_file(
input: schema + '.in',
output: schema,
install: true,
install_dir: totem_schemadir,
configuration: schema_conf
)
install_data(
'totem.convert',
install_dir: join_paths(totem_datadir, 'GConf', 'gsettings')
)
[Desktop Entry]
_Name=Videos
_Comment=Play movies
_Keywords=Video;Movie;Film;Clip;Series;Player;DVD;TV;Disc;
Exec=totem %U
Icon=org.gnome.Totem
DBusActivatable=true
Terminal=false
Type=Application
Categories=GTK;GNOME;AudioVideo;Player;Video;
X-GNOME-DocPath=totem/totem.xml
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=totem
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=@VERSION@
X-GNOME-Bugzilla-OtherBinaries=totem-video-thumbnailer;
StartupNotify=true
@MIME_TYPE@
[Thumbnailer Entry]
TryExec=@BINDIR@/totem-video-thumbnailer
Exec=@BINDIR@/totem-video-thumbnailer -s %s %u %o
@MIME_TYPE@
subdir('reference')
......@@ -137,8 +137,8 @@ GTKDOC_CFLAGS = \
-I$(top_srcdir)/src/plugins \
$(PLAYER_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/src/libtotem.la \
$(top_builddir)/libgd/libgd.la \
$(top_builddir)/src/libtotem.la \
$(top_builddir)/subprojects/libgd/libgd.la \
$(PLAYER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
......
private_headers = [
'bacon-resize.h',
'bacon-time-label.h',
'bacon-video-controls-actor.h',
'bacon-video-spinner-actor.h',
'bacon-video-widget-common.h',
'bacon-video-widget-gst-missing-plugins.h',
'bacon-video-widget-properties.h',
'clock.h',
'debug.h',
'gd-fullscreen-filter.h',
'gd-tagged-entry.h',
'gnome-screenshot-widget.h',
'gsd-media-keys-window.h',
'gstscreenshot.h',
'icon-helpers.h',
'screenshot-filename-builder.h',
'totem-aspect-frame.h',
'totem-chapters-utils.h',
'totem-cmml-parser.h',
'totem-dnd-menu.h',
'totem-dvb-setup.h',
'totem-edit-chapter.h',
'totem-fullscreen.h',
'totem-gallery-progress.h',
'totem-gallery.h',
'totem-grilo.h',
'totem-gst-helpers.h',
'totem-gst-pixbuf-helpers.h',
'totem-main-toolbar.h',
'totem-menu.h',
'totem-module.h',
'totem-open-location.h',
'totem-options.h',
'totem-playlist.h',
'totem-plugins-engine.h',
'totem-plugin-manager.h',
'totem-preferences.h',
'totem-private.h',
'totem-profile.h',
'totem-properties-view.h',
'totem-python-plugin.h',
'totem-resources.h',
'totem-sample-vala-plugin.h',
'totem-screenshot-plugin.h',
'totem-screenshot.h',
'totem-search-entry.h',
'totem-selection-toolbar.h',
'totem-session.h',
'totem-skipto-plugin.h',
'totem-skipto.h',
'totem-statusbar.h',
'totem-subtitle-encoding.h',
'totem-time-entry.h',
'totem-time-helpers.h',
'totem-time-label.h',
'totem-tracker-widget.h',
'totem-uri.h',
'video-utils.h'
]
version_conf = configuration_data()
version_conf.set('TOTEM_VERSION_MAJOR', totem_major_version)
version_conf.set('TOTEM_VERSION_MINOR', totem_minor_version)
version_conf.set('TOTEM_VERSION_MICRO', totem_micro_version)
version_xml = 'version.xml'
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
doc_path = join_paths(totem_datadir, 'gtk-doc', 'html', meson.project_name())
gnome.gtkdoc(
meson.project_name(),
main_xml: meson.project_name() + '-docs.xml',
src_dir: [
top_inc,
src_inc,
plugins_inc,
backend_inc
],
dependencies: libtotem_dep,
scan_args: [
'--rebuild-types',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--sgml-mode',
'--output-format=xml',
'--name-space=' + meson.project_name()
],
install: true,
install_dir: doc_path
)
sources = [
'index.docbook',
'legal.xml'
]
media = [
'figures/totem_next_button.png',
'figures/totem_pause_button.png',
'figures/totem_play_button.png',
'figures/totem_previous_button.png',
'figures/totem_show_playlist_button.png',
'figures/totem_start_window.png',
'figures/totem_volume_maximum_button.png',
'figures/totem_volume_mute_button.png'
]
linguas = [
'bg',
'ca',
'cs',
'da',
'de',
'el',
'en_GB',
'es',
'eu',
'fi',
'fr',
'gl',
'id',
'it',
'ja',
'oc',
'pa',
'pl',
'pt_BR',
'ro',
'ru',
'sl',
'sv',
'te',
'uk',
'zh_CN',
'zh_HK',
'zh_TW'
]
gnome.yelp(
meson.project_name(),
sources: sources,
media: media,
symlink_media: true,
languages: linguas
)
libgd @ 56a19ad9
Subproject commit 56a19ad9b056332ef07e508f1bdb6f03c6cb2590
project(
'totem', 'c',
version: '3.24.0',
license: 'GPL2+',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu99',
'warning_level=1'
],
meson_version: '>= 0.41.0'
)
totem_version = meson.project_version()
version_array = totem_version.split('.')
totem_major_version = version_array[0].to_int()
totem_minor_version = version_array[1].to_int()
totem_micro_version = version_array[2].to_int()
totem_api_version = '1.0'
api_version_array = totem_version.split('.')
totem_api_major_version = api_version_array[0].to_int()
totem_api_minor_version = api_version_array[1].to_int()
totem_api_path = join_paths(meson.project_name(), totem_api_version)
totem_gir_ns = 'Totem'
totem_prefix = get_option('prefix')
totem_bindir = join_paths(totem_prefix, get_option('bindir'))
totem_datadir = join_paths(totem_prefix, get_option('datadir'))
totem_includedir = join_paths(totem_prefix, get_option('includedir'))
totem_libdir = join_paths(totem_prefix, get_option('libdir'))
totem_libexecdir = join_paths(totem_prefix, get_option('libexecdir'))
totem_localedir = join_paths(totem_prefix, get_option('localedir'))
totem_mandir = join_paths(totem_prefix, get_option('mandir'))
totem_pkglibdir = join_paths(totem_libdir, meson.project_name())
totem_pkgdatadir = join_paths(totem_datadir, meson.project_name())
totem_pkgincludedir = join_paths(totem_includedir, meson.project_name())
totem_pluginsdir = join_paths(totem_pkglibdir, 'plugins')
totem_schemadir = join_paths(totem_datadir, 'glib-2.0', 'schemas')
soversion = 0
current = 0
revision = 0
libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
totem_buildtype = get_option('buildtype')
cc = meson.get_compiler('c')
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
# debug options
config_h.set('GNOME_ENABLE_DEBUG', totem_buildtype != 'release',
description: 'Define if debugging is enabled')
config_h.set('NDEBUG', totem_buildtype == 'release',
description: 'Define if debugging is disabled')
# package
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=totem')
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), totem_version))
config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
config_h.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Videos')
config_h.set_quoted('PACKAGE_VERSION', totem_version)
config_h.set_quoted('TOTEM_API_VERSION', totem_api_version)
config_h.set_quoted('VERSION', totem_version)
# headers
config_h.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
config_h.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
config_h.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
config_h.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
config_h.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
config_h.set('HAVE_STRING_H', cc.has_header('string.h'))
config_h.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
config_h.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
config_h.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
# Compiler flags
common_flags = [
'-DHAVE_CONFIG_H',
'-D_REENTRANT',
'-DGCONF_DISABLE_DEPRECATED',
'-DGCONF_DISABLE_SINGLE_INCLUDES',
'-DBONOBO_DISABLE_DEPRECATED',
'-DBONOBO_DISABLE_SINGLE_INCLUDES',
'-DBONOBO_UI_DISABLE_DEPRECATED',
'-DBONOBO_UI_DISABLE_SINGLE_INCLUDES',
'-DGNOME_DISABLE_DEPRECATED',
'-DGNOME_DISABLE_SINGLE_INCLUDES',
'-DLIBGLADE_DISABLE_DEPRECATED',
'-DLIBGLADE_DISABLE_SINGLE_INCLUDES',
'-DGNOME_VFS_DISABLE_DEPRECATED',
'-DGNOME_VFS_DISABLE_SINGLE_INCLUDES',
'-DWNCK_DISABLE_DEPRECATED',
'-DWNCK_DISABLE_SINGLE_INCLUDES',
'-DLIBSOUP_DISABLE_DEPRECATED',
'-DLIBSOUP_DISABLE_SINGLE_INCLUDES'
]
if totem_buildtype == 'debug' or totem_buildtype == 'debugoptimized'
test_cflags = [
'-fno-strict-aliasing',
'-Wcast-align',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith'
]
foreach cflag: test_cflags
if cc.has_argument(cflag)
common_flags += [cflag]
endif
endforeach
test_cflags = [
'-Werror=format=2',
'-Werror=implicit-function-declaration',
'-Werror=init-self',
'-Werror=missing-include-dirs',
'-Werror=missing-prototypes',
'-Werror=pointer-arith',
'-Werror=return-type',
'-Wstrict-prototypes'
]
warn_flags = []
foreach cflag: test_cflags
if cc.has_argument(cflag)
warn_flags += [cflag]
endif
endforeach
add_project_arguments(common_flags, language: 'c')
endif
glib_req_version = '>= 2.35.0'
gtk_req_version = '>= 3.19.4'
gst_req_version = '>= 1.6.0'
grilo_req_version = '>= 0.3.0'
peas_req_version = '>= 1.1.0'
totem_plparser_req_version = '>= 3.10.1'
glib_dep = dependency('glib-2.0', version: glib_req_version)
gobject_dep = dependency('gobject-2.0', version: glib_req_version)
gio_dep = dependency('gio-2.0', version: '>= 2.43.4')
gtk_dep = dependency('gtk+-3.0', version: gtk_req_version)
gdk_x11_dep = dependency('gdk-x11-3.0', version: gtk_req_version)
gst_dep = dependency('gstreamer-1.0', version: gst_req_version)
gst_tag_dep = dependency('gstreamer-tag-1.0', version: '>= 0.11.93')
gst_video_dep = dependency('gstreamer-video-1.0')
peas_dep = dependency('libpeas-1.0', version: peas_req_version)
peas_gtk_dep = dependency('libpeas-gtk-1.0', version: peas_req_version)
totem_plparser_dep = dependency('totem-plparser', version: totem_plparser_req_version)
clutter_gtk_dep = dependency('clutter-gtk-1.0', version: '>= 1.8.1')
m_dep = cc.find_library('m', required: true)
libgd = subproject(
'libgd',
default_options: [
'static=true',
'with-gtk-hacks=true',
'with-main-view=true',
'with-tagged-entry=true',
'with-view-common=true'
]
)
libgd_dep = libgd.get_variable('libgd_dep')
# introspection support
have_gir = false
introspection_option = get_option('enable-introspection')
if introspection_option != 'no'
gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false)
if gir_dep.found()
have_gir = true
endif
endif
# missing plugins support
missing_plugins_deps = []
easy_codec_option = get_option('enable-easy-codec-installation')
if easy_codec_option != 'no'
have_easy_codec = false
gst_pbutils_dep = dependency('gstreamer-pbutils-1.0', required: (easy_codec_option == 'yes'))
if gst_pbutils_dep.found()
have_easy_codec = true
endif
missing_plugins_deps += gst_pbutils_dep
config_h.set('ENABLE_MISSING_PLUGIN_INSTALLATION', have_easy_codec,
description: 'Whether we can and want to do installation of missing plugins')
endif
# python support
have_python = false
python_deps = []
python_option = get_option('enable-python')
if python_option != 'no'
python = find_program('python', required: false)
if python.found()
python_req_version = '>= 2.3'
r = run_command(python, '--version')
python_version = r.stderr().split(' ')[1]
pygobject_dep = dependency('pygobject-3.0', version: '>= 2.90.3', required: false)
pylint = find_program('pylint', required: false)
if python_version.version_compare(python_req_version) and pygobject_dep.found() and pylint.found()
have_python = true