diff options
author | Corentin Noël <corentin@elementary.io> | 2019-01-24 15:00:29 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2020-01-10 09:06:26 +0000 |
commit | f144fbc20df1aa21e666ef2256adbbc63ffcf131 (patch) | |
tree | 0acebe2d5fd962166732d4bf52a2a0baf9327e70 /contrib | |
parent | 3de80c8eb0dca0b57a5dbdca20e754a7de7c053a (diff) |
Port to the meson build system
With much help from Martin Blanchard <tchaik@gmx.com> too, thanks to all.
https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/Makefile.am | 32 | ||||
-rw-r--r-- | contrib/PackageKit.spec.in | 39 | ||||
-rw-r--r-- | contrib/command-not-found/Makefile.am | 52 | ||||
-rw-r--r-- | contrib/command-not-found/meson.build | 29 | ||||
-rw-r--r-- | contrib/cron/Makefile.am | 13 | ||||
-rw-r--r-- | contrib/cron/meson.build | 9 | ||||
-rw-r--r-- | contrib/gstreamer-plugin/Makefile.am | 53 | ||||
-rw-r--r-- | contrib/gstreamer-plugin/meson.build | 18 | ||||
-rw-r--r-- | contrib/gtk-module/Makefile.am | 35 | ||||
-rw-r--r-- | contrib/gtk-module/gtk2/Makefile.am | 10 | ||||
-rw-r--r-- | contrib/gtk-module/gtk2/meson.build | 18 | ||||
-rw-r--r-- | contrib/gtk-module/meson.build | 27 | ||||
-rw-r--r-- | contrib/meson.build | 27 | ||||
-rw-r--r-- | contrib/yum-packagekit/Makefile.am | 7 | ||||
-rw-r--r-- | contrib/yum-packagekit/meson.build | 9 |
15 files changed, 153 insertions, 225 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am deleted file mode 100644 index cfc252b0f..000000000 --- a/contrib/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -SUBDIRS = - -if BACKEND_TYPE_YUM -SUBDIRS += yum-packagekit -endif - -if PK_BUILD_GSTREAMER_PLUGIN -SUBDIRS += gstreamer-plugin -endif - -if PK_BUILD_GTK_MODULE -SUBDIRS += gtk-module -endif - -if PK_BUILD_COMMAND_NOT_FOUND -SUBDIRS += command-not-found -endif - -if PK_BUILD_CRON -SUBDIRS += cron -endif - -if HAVE_BASH_COMPLETION -bashcompletiondir = $(BASH_COMPLETIONS_DIR) -dist_bashcompletion_DATA = pkcon -endif - -EXTRA_DIST = generate-md-archive.sh - -CLEANFILES = cached-metadata.tar - --include $(top_srcdir)/git.mk diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in index 18d0346f4..283db9571 100644 --- a/contrib/PackageKit.spec.in +++ b/contrib/PackageKit.spec.in @@ -22,7 +22,7 @@ BuildRequires: gtk2-devel BuildRequires: gtk3-devel BuildRequires: docbook-utils BuildRequires: gnome-doc-utils -BuildRequires: intltool +BuildRequires: meson BuildRequires: gettext BuildRequires: vala BuildRequires: gstreamer1-devel @@ -134,31 +134,27 @@ using PackageKit. %setup -q %build -%configure \ - --disable-static \ +%meson \ + -Dgtk_doc=true \ + -Dpython_backend=false \ %if 0%{?rhel} == 0 - --enable-dnf \ - --enable-introspection \ - --enable-bash-completion \ + -Dpackaging_backend=dnf \ + -Dbash_completion=true \ %else - --disable-bash-completion \ + -Dbash_completion=false \ %endif - --disable-local \ - --disable-silent-rules - -make %{?_smp_mflags} V=1 + -Dlocal_checkout=false +%meson_build %install -make install DESTDIR=$RPM_BUILD_ROOT +%meson_install -rm -f $RPM_BUILD_ROOT%{_libdir}/libpackagekit*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/packagekit-backend/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/packagekit-plugin.la -rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/modules/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/modules/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/polkit-1/extensions/libpackagekit-action-lookup.la +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/PackageKit/downloads +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/PackageKit/metadata -touch $RPM_BUILD_ROOT%{_localstatedir}/cache/PackageKit/groups.sqlite +mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system/system-update.target.wants +ln -sf /usr/lib/systemd/system/packagekit-offline-update.service \ + $RPM_BUILD_ROOT/usr/lib/systemd/system/system-update.target.wants/packagekit-offline-update.service # create a link that GStreamer will recognise pushd ${RPM_BUILD_ROOT}%{_libexecdir} > /dev/null @@ -183,11 +179,9 @@ popd > /dev/null %license COPYING %doc README AUTHORS NEWS %dir %{_datadir}/PackageKit -%dir %{_datadir}/PackageKit/helpers %dir %{_sysconfdir}/PackageKit %dir %{_localstatedir}/lib/PackageKit %dir %{_localstatedir}/cache/PackageKit -%ghost %verify(not md5 size mtime) %{_localstatedir}/cache/PackageKit/groups.sqlite %dir %{_localstatedir}/cache/PackageKit/downloads %dir %{_localstatedir}/cache/PackageKit/metadata %if !0%{?rhel} @@ -197,9 +191,7 @@ popd > /dev/null %config(noreplace) %{_sysconfdir}/PackageKit/PackageKit.conf %config(noreplace) %{_sysconfdir}/PackageKit/Vendor.conf %config %{_sysconfdir}/dbus-1/system.d/* -%dir %{_datadir}/PackageKit/helpers/test_spawn %{_datadir}/PackageKit/icons -%{_datadir}/PackageKit/helpers/test_spawn/* %{_datadir}/man/man1/pkcon.1.gz %{_datadir}/man/man1/pkmon.1.gz %{_datadir}/polkit-1/actions/*.policy @@ -254,6 +246,7 @@ popd > /dev/null %{_datadir}/gir-1.0/PackageKitGlib-1.0.gir %{_datadir}/gtk-doc/html/PackageKit %{_datadir}/vala/vapi/packagekit-glib2.vapi +%{_datadir}/vala/vapi/packagekit-glib2.deps %changelog * #LONGDATE# Richard Hughes <richard@hughsie.com> #VERSION#-0.#BUILD##ALPHATAG# diff --git a/contrib/command-not-found/Makefile.am b/contrib/command-not-found/Makefile.am deleted file mode 100644 index f92e73fb9..000000000 --- a/contrib/command-not-found/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -AM_CPPFLAGS = \ - $(PIE_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(SQLITE_CFLAGS) \ - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DG_LOG_DOMAIN=\"PackageKit\" \ - -DPK_COMPILATION \ - -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -I$(top_builddir) \ - -I$(top_builddir)/lib \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib - -libexec_PROGRAMS = pk-command-not-found - -PK_GLIB2_LIBS = \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la \ - $(top_builddir)/lib/packagekit-glib2/libpackagekitprivate.a - -pk_command_not_found_SOURCES = \ - pk-command-not-found.c - -pk_command_not_found_LDADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(PK_GLIB2_LIBS) - -pk_command_not_found_LDFLAGS = \ - $(PIE_LDFLAGS) - -pk_command_not_found_CFLAGS = \ - $(WARNINGFLAGS_C) - -bashprofiledir = ${SYSCONFDIR}/profile.d -dist_bashprofile_DATA = PackageKit.sh - -PackageKit.sh: PackageKit.sh.in Makefile - sed -e s!\@LIBEXECDIR\@!$(libexecdir)! < $< > $@ - -confdir = $(sysconfdir)/PackageKit -dist_conf_DATA = CommandNotFound.conf - -EXTRA_DIST = PackageKit.sh.in - -CLEANFILES = PackageKit.sh - --include $(top_srcdir)/git.mk diff --git a/contrib/command-not-found/meson.build b/contrib/command-not-found/meson.build new file mode 100644 index 000000000..0d3477009 --- /dev/null +++ b/contrib/command-not-found/meson.build @@ -0,0 +1,29 @@ +executable( + 'pk-command-not-found', + 'pk-command-not-found.c', + dependencies: packagekit_glib2_dep, + install: true, + install_dir: get_option('libexecdir'), + c_args: [ + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DG_LOG_DOMAIN="PackageKit"', + '-DPACKAGE_LOCALE_DIR="@0@"'.format(get_option('localedir')), + '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')), + ] +) + +bashprofile_config_data = configuration_data() +bashprofile_config_data.set('LIBEXECDIR', get_option('libexecdir')) +configure_file( + input: 'PackageKit.sh.in', + output: 'PackageKit.sh', + configuration: bashprofile_config_data, + install: true, + install_dir: join_paths(get_option('sysconfdir'), 'profile.d'), +) + +install_data( + 'CommandNotFound.conf', + install_dir: join_paths(get_option('sysconfdir'), 'PackageKit'), +) diff --git a/contrib/cron/Makefile.am b/contrib/cron/Makefile.am deleted file mode 100644 index 43a1e7341..000000000 --- a/contrib/cron/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -cronfiledir = ${SYSCONFDIR}/cron.daily -cronfile_SCRIPTS = packagekit-background.cron - -crondatadir = ${SYSCONFDIR}/sysconfig -crondata_DATA = packagekit-background - -EXTRA_DIST = \ - packagekit-background \ - packagekit-background.cron \ - $(NULL) - - --include $(top_srcdir)/git.mk diff --git a/contrib/cron/meson.build b/contrib/cron/meson.build new file mode 100644 index 000000000..bff5eec27 --- /dev/null +++ b/contrib/cron/meson.build @@ -0,0 +1,9 @@ +install_data( + 'packagekit-background.cron', + install_dir: join_paths(get_option('sysconfdir'), 'cron.daily') +) + +install_data( + 'packagekit-background', + install_dir: join_paths(get_option('sysconfdir'), 'sysconfig') +) diff --git a/contrib/gstreamer-plugin/Makefile.am b/contrib/gstreamer-plugin/Makefile.am deleted file mode 100644 index e1f7a894a..000000000 --- a/contrib/gstreamer-plugin/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -NULL = - -AM_CPPFLAGS = \ - $(PIE_CFLAGS) \ - $(PK_GSTREAMER_PLUGIN_CFLAGS) \ - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DBINDIR=\"$(bindir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DPREFIX=\""$(prefix)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DVERSION="\"$(VERSION)\"" \ - -DPK_DATA=\"$(pkgdatadir)\" \ - -DPK_DB_DIR=\""$(PK_DB_DIR)"\" \ - -I$(top_builddir) \ - -I$(top_builddir)/lib \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib - -PK_GLIB2_LIBS = \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la - -libexec_PROGRAMS = \ - pk-gstreamer-install - -pk_gstreamer_install_SOURCES = \ - pk-gstreamer-install.c - -pk_gstreamer_install_LDADD = \ - $(PK_GSTREAMER_PLUGIN_LIBS) \ - $(PK_GLIB2_LIBS) - -pk_gstreamer_install_LDFLAGS = \ - $(PIE_LDFLAGS) - -pk_gstreamer_install_CFLAGS = \ - $(WARNINGFLAGS_C) - -clean-local: - rm -f *~ - -EXTRA_DIST = \ - README - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in - - --include $(top_srcdir)/git.mk diff --git a/contrib/gstreamer-plugin/meson.build b/contrib/gstreamer-plugin/meson.build new file mode 100644 index 000000000..59a04f327 --- /dev/null +++ b/contrib/gstreamer-plugin/meson.build @@ -0,0 +1,18 @@ +gstreamer_dep = dependency('gstreamer-1.0') +gstreamer_plugins_base_dep = dependency('gstreamer-plugins-base-1.0') + +executable( + 'pk-gstreamer-install', + 'pk-gstreamer-install.c', + dependencies: [ + packagekit_glib2_dep, + gstreamer_dep, + gstreamer_plugins_base_dep, + ], + install: true, + install_dir: get_option('libexecdir'), + c_args: [ + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DVERSION="@0@"'.format(meson.project_version()), + ] +) diff --git a/contrib/gtk-module/Makefile.am b/contrib/gtk-module/Makefile.am deleted file mode 100644 index 32874f02c..000000000 --- a/contrib/gtk-module/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -SUBDIRS = gtk2 - -if PK_BUILD_GTK_MODULE -APP = gedit --new-window GLASS.txt - -AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_builddir)/lib \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib - -moduledir = $(LIBDIR)/gtk-3.0/modules -module_LTLIBRARIES = libpk-gtk-module.la -libpk_gtk_module_la_SOURCES = pk-gtk-module.c -libpk_gtk_module_la_LIBADD = $(PK_GTK_MODULE_LIBS) -libpk_gtk_module_la_LDFLAGS = -module -avoid-version -libpk_gtk_module_la_CFLAGS = $(PK_GTK_MODULE_CFLAGS) $(WARNINGFLAGS_C) - -gtkmoduledir = $(libdir)/gnome-settings-daemon-3.0/gtk-modules -dist_gtkmodule_DATA = pk-gtk-module.desktop - -clean-local: - rm -f *~ - -local: all - GTK_MODULES="$$GTK_MODULES:$$PWD/.libs/libpk-gtk-module.so" $(APP) -endif - -EXTRA_DIST = \ - $(gsettings_SCHEMAS) \ - README \ - GLASS.txt - - --include $(top_srcdir)/git.mk diff --git a/contrib/gtk-module/gtk2/Makefile.am b/contrib/gtk-module/gtk2/Makefile.am deleted file mode 100644 index 1fac2a94b..000000000 --- a/contrib/gtk-module/gtk2/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -if PK_BUILD_GTK_MODULE -moduledir = $(LIBDIR)/gtk-2.0/modules -module_LTLIBRARIES = libpk-gtk-module.la -libpk_gtk_module_la_SOURCES = pk-gtk-module-gtk2.c -libpk_gtk_module_la_LIBADD = $(PK_GTK_MODULE_GTK2_LIBS) -libpk_gtk_module_la_LDFLAGS = -module -avoid-version -libpk_gtk_module_la_CFLAGS = $(PK_GTK_MODULE_GTK2_CFLAGS) $(WARNINGFLAGS_C) -endif - --include $(top_srcdir)/git.mk diff --git a/contrib/gtk-module/gtk2/meson.build b/contrib/gtk-module/gtk2/meson.build new file mode 100644 index 000000000..41a70dbc2 --- /dev/null +++ b/contrib/gtk-module/gtk2/meson.build @@ -0,0 +1,18 @@ +gtk2_dep = dependency('gtk+-2.0', required: false) + +if gtk2_dep.found() + shared_module( + 'pk-gtk2-module', + 'pk-gtk-module-gtk2.c', + dependencies: [ + packagekit_glib2_dep, + gtk2_dep, + ], + install: true, + install_dir: join_paths(get_option('libdir'), 'gtk-2.0', 'modules'), + c_args: [ + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DVERSION="@0@"'.format(meson.project_version()), + ] + ) +endif diff --git a/contrib/gtk-module/meson.build b/contrib/gtk-module/meson.build new file mode 100644 index 000000000..8792e6920 --- /dev/null +++ b/contrib/gtk-module/meson.build @@ -0,0 +1,27 @@ +gtk3_dep = dependency('gtk+-3.0', version: '>=3.0.0') +pangoft2_dep = dependency('pangoft2') +fontconfig_dep = dependency('fontconfig') + +shared_module( + 'pk-gtk-module', + 'pk-gtk-module.c', + dependencies: [ + packagekit_glib2_dep, + gtk3_dep, + pangoft2_dep, + fontconfig_dep, + ], + install: true, + install_dir: join_paths(get_option('libdir'), 'gtk-3.0', 'modules'), + c_args: [ + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DVERSION="@0@"'.format(meson.project_version()), + ] +) + +install_data( + 'pk-gtk-module.desktop', + install_dir: join_paths(get_option('libdir'), 'gnome-settings-daemon-3.0', 'gtk-modules') +) + +subdir('gtk2') diff --git a/contrib/meson.build b/contrib/meson.build new file mode 100644 index 000000000..df8b393f6 --- /dev/null +++ b/contrib/meson.build @@ -0,0 +1,27 @@ +if get_option('packaging_backend') == 'yum' + subdir('yum-packagekit') +endif + +if get_option('gstreamer_plugin') + subdir('gstreamer-plugin') +endif + +if get_option('gtk_module') + subdir('gtk-module') +endif + +if get_option('bash_command_not_found') + subdir('command-not-found') +endif + +if get_option('bash_completion') + bash_completion_dep = dependency('bash-completion', version: '>=2.0') + install_data( + 'pkcon', + install_dir: bash_completion_dep.get_pkgconfig_variable('completionsdir', define_variable: ['prefix', get_option('prefix')]) + ) +endif + +if get_option('cron') + subdir('cron') +endif diff --git a/contrib/yum-packagekit/Makefile.am b/contrib/yum-packagekit/Makefile.am deleted file mode 100644 index 8686a59d7..000000000 --- a/contrib/yum-packagekit/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -yumconfdir = $(sysconfdir)/yum/pluginconf.d -dist_yumconf_DATA = refresh-packagekit.conf - -yumplugindir = $(prefix)/lib/yum-plugins -dist_yumplugin_DATA = refresh-packagekit.py - --include $(top_srcdir)/git.mk diff --git a/contrib/yum-packagekit/meson.build b/contrib/yum-packagekit/meson.build new file mode 100644 index 000000000..c3b210ab7 --- /dev/null +++ b/contrib/yum-packagekit/meson.build @@ -0,0 +1,9 @@ +install_data( + 'refresh-packagekit.conf', + install_dir: join_paths(get_option('sysconfdir'), 'yum', 'pluginconf.d') +) + +install_data( + 'refresh-packagekit.py', + install_dir: join_paths(get_option('libdir'), 'yum-plugins') +) |