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 | |
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
123 files changed, 1789 insertions, 3354 deletions
diff --git a/.travis.yml b/.travis.yml index 581f2e3cd..f885dc691 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,5 @@ before_script: - docker build -t packagekit-fedora -f tests/ci/Dockerfile-fedora . script: - - docker run -t -v `pwd`:/build packagekit-debian ./tests/ci/build_and_test.sh --enable-aptcc - - docker run -t -v `pwd`:/build packagekit-fedora ./tests/ci/build_and_test.sh --enable-dnf + - docker run -t -v `pwd`:/build packagekit-debian ./tests/ci/build_and_test.sh -Dpackaging_backend=aptcc + - docker run -t -v `pwd`:/build packagekit-fedora ./tests/ci/build_and_test.sh -Dpackaging_backend=dnf diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index e8173a0b2..000000000 --- a/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -AUTOMAKE_OPTIONS = 1.7 - -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -SUBDIRS = \ - po \ - policy \ - etc \ - data \ - lib \ - src \ - client \ - backends \ - contrib \ - docs - -clean-local : - rm -f *~ - -snapshot: - $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"` - -DISTCLEANFILES = \ - PackageKit-*.tar.* - -MAINTAINERCLEANFILES = \ - $(srcdir)/INSTALL \ - $(srcdir)/ABOUT-NLS \ - $(srcdir)/aclocal.m4 \ - $(srcdir)/autoscan.log \ - $(srcdir)/build-aux \ - $(srcdir)/config.rpath \ - $(srcdir)/config.h.in \ - $(srcdir)/configure.scan \ - $(srcdir)/mkinstalldirs \ - $(srcdir)/omf.make \ - $(srcdir)/xmldocs.make \ - $(srcdir)/gtk-doc.make \ - $(srcdir)/ChangeLog \ - `find "$(srcdir)" -type f -name Makefile -print` \ - `find "$(srcdir)" -type f -name Makefile.in -print` \ - `find "$(srcdir)" -type f -name *.pyc -print` - -EXTRA_DIST = \ - COPYING \ - MAINTAINERS \ - AUTHORS \ - INSTALL \ - README \ - HACKING \ - NEWS \ - autogen.sh \ - config.h \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in - -DISTCHECK_CONFIGURE_FLAGS = \ - --disable-bash-completion \ - --enable-gtk-doc \ - --disable-daemon-tests \ - --with-systemdsystemunitdir=/tmp - -distclean-local: - if test $(srdcir) = .; then :; else \ - rm -f ChangeLog; \ - fi - -ChangeLog: - @echo Creating $@ - @if test -d "$(srcdir)/.git"; then \ - (GIT_DIR=$(top_srcdir)/.git ./missing --run git log PACKAGEKIT_0_7_X.. --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \ - && mv -f $@.tmp $@ \ - || ($(RM) $@.tmp; \ - echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ - (test -f $@ || echo git-log is required to generate this file >> $@)); \ - else \ - test -f $@ || \ - (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ - echo A git checkout and git-log is required to generate this file >> $@); \ - fi - -.PHONY: ChangeLog - --include $(top_srcdir)/git.mk diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 58f310e69..000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl Macros to help with configuring Python extensions via autoconf. -dnl Copyright (C) 1998, James Henstridge <james@daa.com.au> -dnl -dnl Distribute under the same rules as Autoconf itself. -dnl -dnl Used similar to AC_CHECK_LIB and associates. -dnl Swiped from http://www.initd.org/svn/psycopg/psycopg1/trunk/aclocal.m4 - -dnl PY_CHECK_MOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) -dnl Check if a module containing a given symbol is visible to python. -AC_DEFUN([PY_CHECK_MOD], -[AC_REQUIRE([AM_PATH_PYTHON]) -py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` -AC_MSG_CHECKING(for ifelse([$3],[],,[$2 in ])python module $1) -AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ -if $PYTHON -c 'import $1 ifelse([$2],[],,[; $1.$2])' 1>&AC_FD_CC 2>&AC_FD_CC; then - eval "py_cv_mod_$py_mod_var=yes" -else - eval "py_cv_mod_$py_mod_var=no" -fi -]) -py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` -if test "x$py_val" != xno; then - AC_MSG_RESULT(yes) - ifelse([$3], [],, [$3 -])dnl -else - AC_MSG_RESULT(no) - ifelse([$4], [],, [$4 -])dnl -fi -]) - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 41481400f..000000000 --- a/autogen.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# Copyright (C) 2008 Richard Hughes <richard@hughsie.com> -# -# Run this to generate all the initial makefiles, etc. -# -# Licensed under the GNU General Public License Version 2 -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -(test -f $srcdir/configure.ac) || { - echo -n "**Error**: Directory \"\'$srcdir\'\" does not look like the" - echo " top-level package directory" - exit 1 -} - -if ([ -z "$*" ] && [ "x$NOCONFIGURE" = "x" ]) ; then - echo "**Warning**: I am going to run 'configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo "'$0' command line." - echo -fi - -# check for gobject-introspection-devel -(which g-ir-scanner &> /dev/null) || { - echo "**Error**: you don't have gobject-introspection installed" - exit 1 -} - -(cd $srcdir && gtkdocize) || exit 1 -(cd $srcdir && autoreconf --force --install) || exit 1 -(cd $srcdir && intltoolize) || exit 1 - -conf_flags="--enable-gtk-doc" - -if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ - && echo Now type \`make\' to compile. || exit 1 -else - echo Skipping configure process. -fi diff --git a/backends/Makefile.am b/backends/Makefile.am deleted file mode 100644 index 462a43aeb..000000000 --- a/backends/Makefile.am +++ /dev/null @@ -1,63 +0,0 @@ -SUBDIRS = test - -if BACKEND_TYPE_ALPM -SUBDIRS += alpm -endif - -if BACKEND_TYPE_APTCC -SUBDIRS += aptcc -endif - -if BACKEND_TYPE_DNF -SUBDIRS += dnf -endif - -if BACKEND_TYPE_DUMMY -SUBDIRS += dummy -endif - -if BACKEND_TYPE_ENTROPY -SUBDIRS += entropy -endif - -if BACKEND_TYPE_SLACK -SUBDIRS += slack -endif - -if BACKEND_TYPE_URPMI -SUBDIRS += urpmi -endif - -if BACKEND_TYPE_YUM -SUBDIRS += yum -endif - -if BACKEND_TYPE_PISI -SUBDIRS += pisi -endif - -if BACKEND_TYPE_ZYPP -SUBDIRS += zypp -endif - -if BACKEND_TYPE_POLDEK -SUBDIRS += poldek -endif - -if BACKEND_TYPE_PORTAGE -SUBDIRS += portage -endif - -if BACKEND_TYPE_PORTS -SUBDIRS += ports -endif - -if BACKEND_TYPE_NIX -SUBDIRS += nix -endif - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/alpm/Makefile.am b/backends/alpm/Makefile.am deleted file mode 100644 index 94fcf5af7..000000000 --- a/backends/alpm/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -PK_BACKEND_CONFIG_FILE = $(confdir)/pacman.conf -PK_BACKEND_GROUP_FILE = $(confdir)/groups.list -PK_BACKEND_REPO_FILE = $(confdir)/repos.list - -PK_BACKEND_DEFAULT_PATH = "/bin:/usr/bin:/sbin:/usr/sbin" - -DEFS = -DPK_BACKEND_CONFIG_FILE=\"$(PK_BACKEND_CONFIG_FILE)\" \ - -DPK_BACKEND_GROUP_FILE=\"$(PK_BACKEND_GROUP_FILE)\" \ - -DPK_BACKEND_REPO_FILE=\"$(PK_BACKEND_REPO_FILE)\" \ - -DPK_BACKEND_DEFAULT_PATH=\"$(PK_BACKEND_DEFAULT_PATH)\" \ - -DPK_LOG_PREFIX=\"PACKAGEKIT\" \ - -DG_LOG_DOMAIN=\"PackageKit-alpm\" - -confdir = $(sysconfdir)/PackageKit/alpm.d -conf_DATA = \ - groups.list \ - pacman.conf \ - repos.list - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_alpm.la - -libpk_backend_alpm_la_SOURCES = \ - pk-backend-alpm.c \ - pk-backend-alpm.h \ - pk-alpm-config.c \ - pk-alpm-config.h \ - pk-alpm-databases.c \ - pk-alpm-databases.h \ - pk-alpm-depends.c \ - pk-alpm-environment.c \ - pk-alpm-environment.h \ - pk-alpm-error.c \ - pk-alpm-error.h \ - pk-alpm-groups.c \ - pk-alpm-groups.h \ - pk-alpm-install.c \ - pk-alpm-packages.c \ - pk-alpm-packages.h \ - pk-alpm-remove.c \ - pk-alpm-search.c \ - pk-alpm-sync.c \ - pk-alpm-transaction.c \ - pk-alpm-transaction.h \ - pk-alpm-update.c -libpk_backend_alpm_la_LIBADD = $(PK_PLUGIN_LIBS) $(ALPM_LIBS) -libpk_backend_alpm_la_LDFLAGS = -module -avoid-version -libpk_backend_alpm_la_CFLAGS = \ - $(PK_PLUGIN_CFLAGS) \ - $(ALPM_CFLAGS) \ - $(WARNINGFLAGS_C) - -EXTRA_DIST = $(conf_DATA) - --include $(top_srcdir)/git.mk diff --git a/backends/alpm/meson.build b/backends/alpm/meson.build new file mode 100644 index 000000000..0f21c3c88 --- /dev/null +++ b/backends/alpm/meson.build @@ -0,0 +1,50 @@ +alpm_dep = dependency('libalpm', version: '>=10.0.0') + +shared_module( + 'pk_backend_alpm', + 'pk-backend-alpm.c', + 'pk-backend-alpm.h', + 'pk-alpm-config.c', + 'pk-alpm-config.h', + 'pk-alpm-databases.c', + 'pk-alpm-databases.h', + 'pk-alpm-depends.c', + 'pk-alpm-environment.c', + 'pk-alpm-environment.h', + 'pk-alpm-error.c', + 'pk-alpm-error.h', + 'pk-alpm-groups.c', + 'pk-alpm-groups.h', + 'pk-alpm-install.c', + 'pk-alpm-packages.c', + 'pk-alpm-packages.h', + 'pk-alpm-remove.c', + 'pk-alpm-search.c', + 'pk-alpm-sync.c', + 'pk-alpm-transaction.c', + 'pk-alpm-transaction.h', + 'pk-alpm-update.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + alpm_dep, + gmodule_dep, + ], + c_args: [ + '-DPK_LOG_PREFIX="PACKAGEKIT"' + '-DG_LOG_DOMAIN="PackageKit-alpm"', + '-DPK_BACKEND_CONFIG_FILE="@0@"'.format(join_paths(get_option('confdir'), 'pacman.conf')), + '-DPK_BACKEND_GROUP_FILE="@0@"'.format(join_paths(get_option('confdir'), 'groups.list')), + '-DPK_BACKEND_REPO_FILE="@0@"'.format(join_paths(get_option('confdir'), 'repos.list')), + '-DPK_BACKEND_DEFAULT_PATH="/bin:/usr/bin:/sbin:/usr/sbin"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'groups.list' + 'pacman.conf' + 'repos.list', + install_dir: join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d') +) diff --git a/backends/aptcc/Makefile.am b/backends/aptcc/Makefile.am deleted file mode 100644 index 70792a52d..000000000 --- a/backends/aptcc/Makefile.am +++ /dev/null @@ -1,109 +0,0 @@ -AM_CPPFLAGS = \ - -DDATADIR=\"$(datadir)\" \ - -DG_LOG_DOMAIN=\"PackageKit-APTcc\" - -PK_GLIB2_LIBS = \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la \ - $(top_builddir)/lib/packagekit-glib2/libpackagekitprivate.a - - -%: %.in Makefile - $(AM_V_GEN)sed -e 's|\@libexecdir\@|$(libexecdir)|' \ - -e 's|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|' $< > $@.tmp && mv $@.tmp $@ - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_aptcc.la -libpk_backend_aptcc_la_SOURCES = pkg-list.cpp \ - acqpkitstatus.cpp \ - gst-matcher.cpp \ - apt-messages.cpp \ - apt-utils.cpp \ - apt-sourceslist.cpp \ - apt-cache-file.cpp \ - apt-intf.cpp \ - deb-file.cpp \ - pk-backend-aptcc.cpp -libpk_backend_aptcc_la_LIBADD = -lcrypt \ - -lapt-pkg \ - $(APTINST_LIBS) \ - -lutil \ - $(PK_PLUGIN_LIBS) -libpk_backend_aptcc_la_LDFLAGS = -module \ - -avoid-version \ - $(APTCC_LIBS) \ - $(APPSTREAM_LIBS) \ - $(GSTREAMER_LIBS) -libpk_backend_aptcc_la_CFLAGS = $(PK_PLUGIN_CFLAGS) \ - $(AM_CPPFLAGS) \ - $(APPSTREAM_CFLAGS) -libpk_backend_aptcc_la_CPPFLAGS = $(PK_PLUGIN_CFLAGS) \ - $(APTCC_CFLAGS) \ - $(APPSTREAM_CFLAGS) \ - $(GSTREAMER_CFLAGS) \ - $(AM_CPPFLAGS) - -aptconfdir = ${SYSCONFDIR}/apt/apt.conf.d -aptconf_DATA = 20packagekit - -if HAVE_SYSTEMD -libexec_PROGRAMS = pk-debconf-helper -pk_debconf_helper_SOURCES = \ - pk-debconf-helper.c - -pk_debconf_helper_LDADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(SYSTEMD_LIBS) \ - $(PK_GLIB2_LIBS) - -pk_debconf_helper_LDFLAGS = \ - $(PIE_LDFLAGS) - -pk_debconf_helper_CFLAGS = \ - $(WARNINGFLAGS_C) -pk_debconf_helper_CPPFLAGS = \ - $(PIE_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(SYSTEMD_CFLAGS) \ - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DPK_COMPILATION \ - -DG_LOG_DOMAIN=\"PackageKit\" \ - -I$(top_builddir)/lib \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib -systemdservice_in_files = \ - pk-debconf-helper.service.in \ - pk-debconf-helper.socket.in - -systemduserservicedir = $(systemduserunitdir) -systemduserservice_DATA = pk-debconf-helper.socket \ - pk-debconf-helper.service -endif - -EXTRA_DIST = 20packagekit \ - pkg-list.h \ - apt-intf.h \ - apt-utils.h \ - apt-sourceslist.h \ - apt-messages.h \ - apt-cache-file.h \ - gst-matcher.h \ - deb-file.h \ - acqpkitstatus.h \ - pk-debconf-helper.socket.in \ - pk-debconf-helper.service.in - -helperdir = $(datadir)/PackageKit/helpers/aptcc -dist_helper_DATA = \ - pkconffile \ - pkconffile.nodiff \ - $(NULL) - -install-data-hook: - chmod +x $(DESTDIR)$(helperdir)/pkconffile - -clean-local : - rm -f *~ - --include $(top_srcdir)/git.mk diff --git a/backends/aptcc/meson.build b/backends/aptcc/meson.build new file mode 100644 index 000000000..d94d52d00 --- /dev/null +++ b/backends/aptcc/meson.build @@ -0,0 +1,114 @@ +add_languages('cpp') + +cpp_compiler = meson.get_compiler('cpp') + +gstreamer_dep = dependency('gstreamer-1.0') +gstreamer_base_dep = dependency('gstreamer-base-1.0') +gstreamer_plugins_base_dep = dependency('gstreamer-plugins-base-1.0') +appstream_dep = dependency('appstream', version: '>=0.11') + +apt_pkg_dep = cpp_compiler.find_library('apt-pkg') +apt_inst_dep = cpp_compiler.find_library('apt-inst') + +if not cpp_compiler.compiles( + ''' + #include <apt-pkg/pkgsystem.h> + int main () { + _system->ArchitecturesSupported(); + return 0; + } + ''', + dependencies: [ + apt_pkg_dep, + apt_inst_dep + ] +) + error ('libapt-pkg 1.1 or later is required') +endif + +if not cpp_compiler.compiles( + ''' + #include <apt-pkg/pkgsystem.h> + int main () { + _system->LockInner(); + return 0; + } + ''', + dependencies: [ + apt_pkg_dep, + apt_inst_dep + ] +) + error ('libapt-pkg 1.7 or later is required - or backported frontend locking') +endif + +# Check whether apt supports ddtp +ddtp_flag = [] +if cpp_compiler.compiles( + ''' + #include <apt-pkg/pkgcache.h> + int main () { + pkgCache::DescIterator d; + return 0; + } + ''', + dependencies: [ + apt_pkg_dep, + apt_inst_dep + ] +) + ddtp_flag = ['-DHAVE_DDTP'] +endif + +shared_module( + 'pk_backend_aptcc', + 'acqpkitstatus.cpp', + 'acqpkitstatus.h', + 'gst-matcher.cpp', + 'gst-matcher.h', + 'apt-messages.cpp', + 'apt-messages.h', + 'apt-utils.cpp', + 'apt-utils.h', + 'apt-sourceslist.cpp', + 'apt-sourceslist.h', + 'apt-cache-file.cpp', + 'apt-cache-file.h', + 'apt-intf.cpp', + 'apt-intf.h', + 'pkg-list.cpp', + 'pkg-list.h', + 'deb-file.cpp', + 'deb-file.h', + 'pk-backend-aptcc.cpp', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + apt_pkg_dep, + apt_inst_dep, + gstreamer_dep, + gstreamer_base_dep, + gstreamer_plugins_base_dep, + appstream_dep, + ], + cpp_args: [ + '-DG_LOG_DOMAIN="PackageKit-APTcc"', + '-DPK_COMPILATION=1', + '-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))), + ddtp_flag, + ], + override_options: ['c_std=c11', 'cpp_std=c++11'], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + '20packagekit', + install_dir: join_paths(get_option('sysconfdir'), 'apt', 'apt.conf.d'), +) + +install_data( + 'pkconffile.nodiff', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'aptcc'), +) diff --git a/backends/dnf/Makefile.am b/backends/dnf/Makefile.am deleted file mode 100644 index 7b12328bd..000000000 --- a/backends/dnf/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_dnf.la -EXTRA_DIST = \ - dnf-backend-vendor-fedora.c \ - dnf-backend-vendor-mageia.c \ - dnf-backend-vendor-openmandriva.c \ - dnf-backend-vendor-rosa.c -libpk_backend_dnf_la_SOURCES = \ - dnf-backend-vendor.h \ - dnf-backend.c \ - dnf-backend.h \ - pk-backend-dnf.c -nodist_libpk_backend_dnf_la_SOURCES = dnf-backend-vendor-@DNF_VENDOR@.c -libpk_backend_dnf_la_LIBADD = $(PK_PLUGIN_LIBS) $(DNF_LIBS) -libpk_backend_dnf_la_CPPFLAGS = \ - $(DNF_CFLAGS) \ - -DG_LOG_DOMAIN=\"PackageKit-DNF\" -libpk_backend_dnf_la_LDFLAGS = -module -avoid-version -libpk_backend_dnf_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - --include $(top_srcdir)/git.mk diff --git a/backends/dnf/meson.build b/backends/dnf/meson.build new file mode 100644 index 000000000..bf390fdc5 --- /dev/null +++ b/backends/dnf/meson.build @@ -0,0 +1,25 @@ +appstream_dep = dependency('appstream-glib') +dnf_dep = dependency('libdnf', version: '>=0.22.0') +rpm_dep = dependency('rpm') + +shared_module( + 'pk_backend_dnf', + 'dnf-backend-vendor-@0@.c'.format(get_option('dnf_vendor')), + 'dnf-backend-vendor.h', + 'dnf-backend.c', + 'dnf-backend.h', + 'pk-backend-dnf.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + appstream_dep, + dnf_dep, + rpm_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-DNF"', + ], + install: true, + install_dir: pk_plugin_dir, +) diff --git a/backends/dummy/Makefile.am b/backends/dummy/Makefile.am deleted file mode 100644 index 32a285704..000000000 --- a/backends/dummy/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Dummy\" - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_dummy.la -libpk_backend_dummy_la_SOURCES = pk-backend-dummy.c -libpk_backend_dummy_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_dummy_la_LDFLAGS = -module -avoid-version -libpk_backend_dummy_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - - --include $(top_srcdir)/git.mk diff --git a/backends/dummy/meson.build b/backends/dummy/meson.build new file mode 100644 index 000000000..b68a55659 --- /dev/null +++ b/backends/dummy/meson.build @@ -0,0 +1,15 @@ +shared_module( + 'pk_backend_dummy', + 'pk-backend-dummy.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Dummy"', + ], + override_options: ['cpp_std=c++0x'], + install: true, + install_dir: pk_plugin_dir, +) diff --git a/backends/entropy/Makefile.am b/backends/entropy/Makefile.am deleted file mode 100644 index 0e61d434a..000000000 --- a/backends/entropy/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Entropy\" - -helperdir = $(datadir)/PackageKit/helpers/entropy -dist_helper_DATA = entropyBackend.py - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_entropy.la -libpk_backend_entropy_la_SOURCES = pk-backend-entropy.c -libpk_backend_entropy_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_entropy_la_LDFLAGS = -module -avoid-version -libpk_backend_entropy_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.py - -clean-local : - rm -f *~ - rm -f *.pyc - --include $(top_srcdir)/git.mk diff --git a/backends/entropy/meson.build b/backends/entropy/meson.build new file mode 100644 index 000000000..b80002bf6 --- /dev/null +++ b/backends/entropy/meson.build @@ -0,0 +1,20 @@ +shared_module( + 'pk_backend_entropy', + 'pk-backend-entropy.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Entropy"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'entropyBackend.py', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'entropy') + install_mode: 'rwxr--r--' +) diff --git a/backends/meson.build b/backends/meson.build new file mode 100644 index 000000000..8c5733044 --- /dev/null +++ b/backends/meson.build @@ -0,0 +1,6 @@ +subdir('test') +subdir(get_option('packaging_backend')) + +if get_option('daemon_tests') and get_option('packaging_backend') != 'dummy' + subdir('dummy') +endif diff --git a/backends/nix/Makefile.am b/backends/nix/Makefile.am deleted file mode 100644 index 34719dc70..000000000 --- a/backends/nix/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_nix.la - -libpk_backend_nix_la_SOURCES = \ - pk-backend-nix.cc \ - nix-helpers.cc \ - nix-lib-plus.cc -libpk_backend_nix_la_LIBADD = -lnixmain $(PK_PLUGIN_LIBS) $(NIX_LIBS) -libpk_backend_nix_la_LDFLAGS = -module -avoid-version -libpk_backend_nix_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(AM_CPPFLAGS) -libpk_backend_nix_la_CPPFLAGS = $(PK_PLUGIN_CFLAGS) $(NIX_CFLAGS) $(AM_CPPFLAGS) - --include $(top_srcdir)/git.mk diff --git a/backends/nix/meson.build b/backends/nix/meson.build new file mode 100644 index 000000000..2213ce991 --- /dev/null +++ b/backends/nix/meson.build @@ -0,0 +1,26 @@ +add_languages('cpp') + +nix_expr_dep = dependency('nix-expr', version: '>=1.12') +nix_main_dep = dependency('nix-main', version: '>=1.12') +nix_store_dep = dependency('nix-store', version: '>=1.12') + +shared_module( + 'pk_backend_nix', + 'pk-backend-nix.cc', + 'nix-helpers.cc', + 'nix-lib-plus.cc', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + nix_expr_dep, + nix_main_dep, + nix_store_dep, + gmodule_dep, + ], + c_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit-Nix"', + ], + install: true, + install_dir: pk_plugin_dir, +) diff --git a/backends/pisi/Makefile.am b/backends/pisi/Makefile.am deleted file mode 100644 index 7026d98dc..000000000 --- a/backends/pisi/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Pisi\" - -helperdir = $(datadir)/PackageKit/helpers/pisi -dist_helper_DATA = \ - pisiBackend.py - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_pisi.la -libpk_backend_pisi_la_SOURCES = pk-backend-pisi.c -libpk_backend_pisi_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_pisi_la_LDFLAGS = -module -avoid-version -libpk_backend_pisi_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.py - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/pisi/meson.build b/backends/pisi/meson.build new file mode 100644 index 000000000..71236ad11 --- /dev/null +++ b/backends/pisi/meson.build @@ -0,0 +1,21 @@ +shared_module( + 'pk_backend_pisi', + 'pk-backend-pisi.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DPK_COMPILATION', + '-DG_LOG_DOMAIN="PackageKit-Pisi"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'pisiBackend.py', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'pisi'), + install_mode: 'rwxr--r--', +) diff --git a/backends/pisi/packagekit b/backends/pisi/packagekit deleted file mode 120000 index 2e8d94955..000000000 --- a/backends/pisi/packagekit +++ /dev/null @@ -1 +0,0 @@ -../../lib/python/packagekit
\ No newline at end of file diff --git a/backends/poldek/Makefile.am b/backends/poldek/Makefile.am deleted file mode 100644 index 5b18a3b34..000000000 --- a/backends/poldek/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Poldek\" - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_poldek.la -libpk_backend_poldek_la_SOURCES = pk-backend-poldek.c -libpk_backend_poldek_la_LIBADD = $(PK_PLUGIN_LIBS) $(POLDEK_LIBS) -libpk_backend_poldek_la_LDFLAGS = -module -avoid-version -libpk_backend_poldek_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(POLDEK_CFLAGS) $(WARNINGFLAGS_C) - --include $(top_srcdir)/git.mk diff --git a/backends/poldek/meson.build b/backends/poldek/meson.build new file mode 100644 index 000000000..3394d1ffe --- /dev/null +++ b/backends/poldek/meson.build @@ -0,0 +1,22 @@ +cc = meson.get_compiler('c') + +poldek_dep = cc.find_library('poldek') +poclidek_dep = cc.find_library('poclidek') + +shared_module( + 'pk_backend_poldek', + 'pk-backend-poldek.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + poldek_dep, + poclidek_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Poldek"', + '-I/usr/include/poldek' + ], + install: true, + install_dir: pk_plugin_dir, +) diff --git a/backends/portage/Makefile.am b/backends/portage/Makefile.am deleted file mode 100644 index 056d6bc3c..000000000 --- a/backends/portage/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Portage\" - -helperdir = $(datadir)/PackageKit/helpers/portage -dist_helper_DATA = portageBackend.py - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_portage.la -libpk_backend_portage_la_SOURCES = pk-backend-portage.c -libpk_backend_portage_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_portage_la_LDFLAGS = -module -avoid-version -libpk_backend_portage_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.py - -clean-local : - rm -f *~ - rm -f *.pyc - --include $(top_srcdir)/git.mk diff --git a/backends/portage/meson.build b/backends/portage/meson.build new file mode 100644 index 000000000..1b5a0a393 --- /dev/null +++ b/backends/portage/meson.build @@ -0,0 +1,20 @@ +shared_module( + 'pk_backend_portage', + 'pk-backend-portage.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Portage"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'portageBackend.py', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'portage') + install_mode: 'rwxr--r--' +) diff --git a/backends/ports/Makefile.am b/backends/ports/Makefile.am deleted file mode 100644 index acd9de48d..000000000 --- a/backends/ports/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Ports\" - -SUBDIRS=ruby_packagekit - -helperdir = $(datadir)/PackageKit/helpers/ports -dist_helper_DATA = portsBackend.rb - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_ports.la -libpk_backend_ports_la_SOURCES = pk-backend-ports.c -libpk_backend_ports_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_ports_la_LDFLAGS = -module -avoid-version -libpk_backend_ports_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.rb - -clean-local : - rm -f *~ - --include $(top_srcdir)/git.mk diff --git a/backends/ports/helpers/Makefile.am b/backends/ports/helpers/Makefile.am deleted file mode 100644 index 829314c60..000000000 --- a/backends/ports/helpers/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -helperdir = $(datadir)/PackageKit/helpers/ports - -NULL = - -dist_helper_DATA = \ - default-dialog \ - $(NULL) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/default-dialog - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/ports/meson.build b/backends/ports/meson.build new file mode 100644 index 000000000..4d648da2f --- /dev/null +++ b/backends/ports/meson.build @@ -0,0 +1,22 @@ +subdir('ruby_packagekit') + +shared_module( + 'pk_backend_ports', + 'pk-backend-ports.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Ports"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'portsBackend.rb', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'ports'), + install_mode: 'rwxr--r--', +) diff --git a/backends/ports/ruby_packagekit/Makefile.am b/backends/ports/ruby_packagekit/Makefile.am deleted file mode 100644 index ef6660440..000000000 --- a/backends/ports/ruby_packagekit/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -helperdir = $(datadir)/PackageKit/helpers/ports/ruby_packagekit/ - -NULL = - -dist_helper_DATA = \ - backend.rb \ - enums.rb \ - prints.rb \ - $(NULL) - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/ports/ruby_packagekit/meson.build b/backends/ports/ruby_packagekit/meson.build new file mode 100644 index 000000000..07fd60137 --- /dev/null +++ b/backends/ports/ruby_packagekit/meson.build @@ -0,0 +1,6 @@ +install_data( + 'backend.rb', + 'enums.rb', + 'prints.rb', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'ports', 'ruby_packagekit') +) diff --git a/backends/slack/Makefile.am b/backends/slack/Makefile.am deleted file mode 100644 index 3b7fb3f92..000000000 --- a/backends/slack/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -SUBDIRS = tests - -AM_CFLAGS = \ - $(PK_PLUGIN_CFLAGS) \ - $(SLACK_CFLAGS) \ - $(WARNINGFLAGS_C) \ - -DG_LOG_DOMAIN=\"PackageKit-Slackware\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DLIBDIR=\""$(libdir)"\" - -AM_CPPFLAGS = \ - $(PK_PLUGIN_CFLAGS) \ - $(SLACK_CFLAGS) \ - $(WARNINGFLAGS_CPP) \ - -DG_LOG_DOMAIN=\"PackageKit-Slackware\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DLIBDIR=\""$(libdir)"\" - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_slack.la -libpk_backend_slack_la_SOURCES = \ - pk-backend-slack.cc \ - utils.cc \ - pkgtools.cc \ - slackpkg.cc \ - dl.cc \ - job.cc -libpk_backend_slack_la_LIBADD = \ - -lbz2 \ - $(PK_PLUGIN_LIBS) \ - ${SLACK_LIBS} -libpk_backend_slack_la_LDFLAGS = -module -avoid-version -libpk_backend_slack_la_CFLAGS = $(AM_CFLAGS) -libpk_backend_slack_la_CPPFLAGS = $(AM_CPPFLAGS) - -noinst_LIBRARIES = libpk-backend-slack.a -libpk_backend_slack_a_SOURCES = \ - pk-backend-slack.cc \ - utils.cc \ - pkgtools.cc \ - slackpkg.cc \ - dl.cc \ - job.cc -libpk_backend_slack_a_CPPFLAGS = $(AM_CPPFLAGS) - -confdir = $(sysconfdir)/PackageKit -conf_in_files = Slackware.conf.in -conf_DATA = $(conf_in_files:.conf.in=.conf) - -$(conf_DATA): $(conf_in_files) Makefile - @sed -e "s|\@pkgmain\@|$(SLACK_PKGMAIN)|" $< > $@ - -databasedir = $(localstatedir)/cache/PackageKit/metadata -database_DATA = metadata.db - -EXTRA_DIST = \ - $(conf_in_files) \ - $(database_DATA) - -CLEANFILES = *.a - -clean-local: - rm -f *~ - rm -f $(CLEANFILES) - --include $(top_srcdir)/git.mk diff --git a/backends/slack/meson.build b/backends/slack/meson.build new file mode 100644 index 000000000..258907f77 --- /dev/null +++ b/backends/slack/meson.build @@ -0,0 +1,51 @@ +add_languages('cpp') + +subdir('test') + +curl_dep = meson.get_compiler('c').find_library('curl') + +shared_module( + 'pk_backend_slack', + 'pk-backend-slack.cc', + 'utils.cc', + 'pkgtools.cc', + 'slackpkg.cc', + 'dl.cc', + 'job.cc', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + curl_dep, + gmodule_dep, + ], + cpp_args: [ + '-DG_LOG_DOMAIN="PackageKit-Slackware"', + '-DPK_COMPILATION=1', + '-DLOCALSTATEDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localstatedir'))), + '-DLIBDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))), + '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')), + ], + override_options: ['c_std=c14', 'cpp_std=c++14'], + install: true, + install_dir: pk_plugin_dir, +) + +slackware_config_data = configuration_data() +if (target_machine.cpu_family() == 'x86_64') + slackware_config_data.set('pkgmain', 'slackware64') +else + slackware_config_data.set('pkgmain', 'slackware') +endif + +configure_file( + input: 'Slackware.conf.in', + output: 'Slackware.conf', + configuration: slackware_config_data, + install: true, + install_dir: join_paths(get_option('sysconfdir'), 'PackageKit'), +) + +install_data( + 'metadata.db', + install_dir: join_paths(get_option('localstatedir'), 'cache', 'PackageKit', 'metadata'), +) diff --git a/backends/slack/tests/Makefile.am b/backends/slack/tests/Makefile.am deleted file mode 100644 index 71347c32c..000000000 --- a/backends/slack/tests/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -AM_CPPFLAGS = \ - $(PK_PLUGIN_CFLAGS) \ - $(filter-out -std=c11,$(SLACK_CFLAGS)) \ - $(WARNINGFLAGS_CPP) \ - -DG_LOG_DOMAIN=\"PackageKit-Slackware\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -I../ - -PK_BACKEND_SLACK_LIBS = \ - -lbz2 -lcurl \ - $(SQLITE_LIBS) \ - $(GLIB_LIBS) \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la \ - $(top_builddir)/backends/slack/libpk-backend-slack.a - -check_PROGRAMS = \ - slack-slackpkg-test \ - slack-dl-test \ - job-test - -slack_slackpkg_test_SOURCES = \ - definitions.cc \ - slackpkg-test.cc -slack_slackpkg_test_LDADD = $(PK_BACKEND_SLACK_LIBS) -slack_slackpkg_test_CPPFLAGS = $(AM_CPPFLAGS) - -slack_dl_test_SOURCES = \ - definitions.cc \ - dl-test.cc -slack_dl_test_LDADD = $(PK_BACKEND_SLACK_LIBS) -slack_dl_test_CPPFLAGS = $(AM_CPPFLAGS) - -job_test_SOURCES = \ - definitions.cc \ - job-test.cc -job_test_LDADD = $(PK_BACKEND_SLACK_LIBS) -job_test_CPPFLAGS = $(AM_CPPFLAGS) - -TESTS = $(check_PROGRAMS) - --include $(top_srcdir)/git.mk diff --git a/backends/slack/tests/meson.build b/backends/slack/tests/meson.build new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/backends/slack/tests/meson.build diff --git a/backends/test/Makefile.am b/backends/test/Makefile.am deleted file mode 100644 index b41693446..000000000 --- a/backends/test/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Test\" - -SUBDIRS = helpers -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = \ - libpk_backend_test_nop.la \ - libpk_backend_test_fail.la \ - libpk_backend_test_spawn.la \ - libpk_backend_test_succeed.la \ - libpk_backend_test_thread.la - -libpk_backend_test_nop_la_SOURCES = pk-backend-test-nop.c -libpk_backend_test_nop_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_test_nop_la_LDFLAGS = -module -avoid-version -libpk_backend_test_nop_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -libpk_backend_test_fail_la_SOURCES = pk-backend-test-fail.c -libpk_backend_test_fail_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_test_fail_la_LDFLAGS = -module -avoid-version -libpk_backend_test_fail_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -libpk_backend_test_spawn_la_SOURCES = pk-backend-test-spawn.c -libpk_backend_test_spawn_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_test_spawn_la_LDFLAGS = -module -avoid-version -libpk_backend_test_spawn_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -libpk_backend_test_succeed_la_SOURCES = pk-backend-test-succeed.c -libpk_backend_test_succeed_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_test_succeed_la_LDFLAGS = -module -avoid-version -libpk_backend_test_succeed_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -libpk_backend_test_thread_la_SOURCES = pk-backend-test-thread.c -libpk_backend_test_thread_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_test_thread_la_LDFLAGS = -module -avoid-version -libpk_backend_test_thread_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - - --include $(top_srcdir)/git.mk diff --git a/backends/test/helpers/Makefile.am b/backends/test/helpers/Makefile.am deleted file mode 100644 index bb7fd81b8..000000000 --- a/backends/test/helpers/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -helperdir = $(datadir)/PackageKit/helpers/test_spawn - -NULL = - -dist_helper_DATA = \ - search-name.sh \ - $(NULL) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.sh - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/test/helpers/packagekit b/backends/test/helpers/packagekit deleted file mode 120000 index af2698b5d..000000000 --- a/backends/test/helpers/packagekit +++ /dev/null @@ -1 +0,0 @@ -../../../lib/python/packagekit/
\ No newline at end of file diff --git a/backends/test/meson.build b/backends/test/meson.build new file mode 100644 index 000000000..eba7dcdaa --- /dev/null +++ b/backends/test/meson.build @@ -0,0 +1,74 @@ +shared_module( + 'pk_backend_test_fail', + 'pk-backend-test-fail.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Test"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +shared_module( + 'pk_backend_test_nop', + 'pk-backend-test-nop.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Test"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +shared_module( + 'pk_backend_test_spawn', + 'pk-backend-test-spawn.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Test"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +shared_module( + 'pk_backend_test_succeed', + 'pk-backend-test-succeed.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Test"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +shared_module( + 'pk_backend_test_thread', + 'pk-backend-test-thread.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Test"', + ], + install: true, + install_dir: pk_plugin_dir, +) diff --git a/backends/urpmi/Makefile.am b/backends/urpmi/Makefile.am deleted file mode 100644 index 6f98fb019..000000000 --- a/backends/urpmi/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Urpmi\" - -SUBDIRS = helpers -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_urpmi.la -libpk_backend_urpmi_la_SOURCES = pk-backend-urpmi.c -libpk_backend_urpmi_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_urpmi_la_LDFLAGS = -module -avoid-version -libpk_backend_urpmi_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -clean-local: - rm -f *.gcno - - --include $(top_srcdir)/git.mk diff --git a/backends/urpmi/helpers/Makefile.am b/backends/urpmi/helpers/Makefile.am deleted file mode 100644 index 6c3e4d716..000000000 --- a/backends/urpmi/helpers/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -SUBDIRS = perl_packagekit urpmi_backend - -helperdir = $(datadir)/PackageKit/helpers/urpmi - -NULL = - -dist_helper_DATA = \ - urpmi-dispatched-backend.pl \ - $(NULL) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.pl - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/urpmi/helpers/meson.build b/backends/urpmi/helpers/meson.build new file mode 100644 index 000000000..15204406b --- /dev/null +++ b/backends/urpmi/helpers/meson.build @@ -0,0 +1,8 @@ +subdir('perl_packagekit') +subdir('urpmi_backend') + +install_data( + 'urpmi-dispatched-backend.pl', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'urpmi'), + install_mode: 'rwxr--r--', +) diff --git a/backends/urpmi/helpers/perl_packagekit/Makefile.am b/backends/urpmi/helpers/perl_packagekit/Makefile.am deleted file mode 100644 index e6e26cb6c..000000000 --- a/backends/urpmi/helpers/perl_packagekit/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -helperdir = $(datadir)/PackageKit/helpers/urpmi/perl_packagekit/ - -NULL = - -dist_helper_DATA = \ - enums.pm \ - prints.pm \ - $(NULL) - -clean-local : - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/urpmi/helpers/perl_packagekit/meson.build b/backends/urpmi/helpers/perl_packagekit/meson.build new file mode 100644 index 000000000..c9d4dc269 --- /dev/null +++ b/backends/urpmi/helpers/perl_packagekit/meson.build @@ -0,0 +1,5 @@ +install_data( + 'enums.pm', + 'prints.pm', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'urpmi', 'perl_packagekit'), +) diff --git a/backends/urpmi/helpers/urpmi_backend/Makefile.am b/backends/urpmi/helpers/urpmi_backend/Makefile.am deleted file mode 100644 index 334f8e1b7..000000000 --- a/backends/urpmi/helpers/urpmi_backend/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -helperdir = $(datadir)/PackageKit/helpers/urpmi/urpmi_backend/ - -NULL = - -dist_helper_DATA = \ - actions.pm \ - filters.pm \ - groups.pm \ - open_db.pm \ - tools.pm \ - $(NULL) - -clean-local : - rm -f *~ - --include $(top_srcdir)/git.mk diff --git a/backends/urpmi/helpers/urpmi_backend/meson.build b/backends/urpmi/helpers/urpmi_backend/meson.build new file mode 100644 index 000000000..7e8454652 --- /dev/null +++ b/backends/urpmi/helpers/urpmi_backend/meson.build @@ -0,0 +1,8 @@ +install_data( + 'actions.pm', + 'filters.pm', + 'groups.pm', + 'open_db.pm', + 'tools.pm', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'urpmi', 'urpmi_backend'), +) diff --git a/backends/urpmi/meson.build b/backends/urpmi/meson.build new file mode 100644 index 000000000..c3a175050 --- /dev/null +++ b/backends/urpmi/meson.build @@ -0,0 +1,17 @@ +shared_module( + 'pk_backend_urpmi', + 'pk-backend-urpmi.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DPK_COMPILATION', + '-DG_LOG_DOMAIN="PackageKit-Urpmi"', + ], + install: true, + install_dir: pk_plugin_dir, +) + +subdir('helpers') diff --git a/backends/yum/Makefile.am b/backends/yum/Makefile.am deleted file mode 100644 index 47b4060b6..000000000 --- a/backends/yum/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -helperdir = $(datadir)/PackageKit/helpers/yum -dist_helper_DATA = \ - yum-comps-groups.conf \ - licenses.txt \ - yumBackend.py \ - yumComps.py \ - yumFilter.py - -AM_CPPFLAGS = \ - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DG_LOG_DOMAIN=\"PackageKit-Yum\" \ - -DPK_COMPILATION \ - -DSYSCONFDIR=\""$(sysconfdir)"\" - -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_yum.la -libpk_backend_yum_la_SOURCES = pk-backend-yum.c -libpk_backend_yum_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_yum_la_LDFLAGS = -module -avoid-version -libpk_backend_yum_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_C) - -confdir = $(sysconfdir)/PackageKit -conf_DATA = Yum.conf - -EXTRA_DIST = \ - $(conf_DATA) - -install-data-hook: - chmod a+rx $(DESTDIR)$(helperdir)/*.py - -clean-local: - rm -f *.gcno - rm -f *~ - - --include $(top_srcdir)/git.mk diff --git a/backends/yum/meson.build b/backends/yum/meson.build new file mode 100644 index 000000000..c63d46c80 --- /dev/null +++ b/backends/yum/meson.build @@ -0,0 +1,34 @@ +shared_module( + 'pk_backend_yum', + 'pk-backend-yum.c', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + gmodule_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="PackageKit-Yum"', + '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')), + ], + install: true, + install_dir: pk_plugin_dir, +) + +install_data( + 'Yum.conf', + install_dir: join_paths(get_option('sysconfdir'), 'PackageKit'), +) + +install_data( + 'yum-comps-groups.conf', + 'licenses.txt', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'yum'), +) + +install_data( + 'yumBackend.py', + 'yumComps.py', + 'yumFilter.py', + install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'yum'), + install_mode: 'rwxr--r--', +) diff --git a/backends/yum/packagekit b/backends/yum/packagekit deleted file mode 120000 index 571b05c0c..000000000 --- a/backends/yum/packagekit +++ /dev/null @@ -1 +0,0 @@ -../../lib/python/packagekit/
\ No newline at end of file diff --git a/backends/zypp/Makefile.am b/backends/zypp/Makefile.am deleted file mode 100644 index 18d1d864e..000000000 --- a/backends/zypp/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"PackageKit-Zypp\" - -#SUBDIRS = helpers -plugindir = $(PK_PLUGIN_DIR) -plugin_LTLIBRARIES = libpk_backend_zypp.la -libpk_backend_zypp_la_SOURCES = pk-backend-zypp.cpp -libpk_backend_zypp_la_LIBADD = $(PK_PLUGIN_LIBS) -libpk_backend_zypp_la_LDFLAGS = -module -avoid-version $(ZYPP_LIBS) -libpk_backend_zypp_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(WARNINGFLAGS_CPP) -libpk_backend_zypp_la_CXXFLAGS = $(PK_PLUGIN_CXXFLAGS) --std=c++0x -Wall -Woverloaded-virtual -Wnon-virtual-dtor -libpk_backend_zypp_la_CPPFLAGS = $(PK_PLUGIN_CFLAGS) $(ZYPP_CFLAGS) -Wno-deprecated -D_FILE_OFFSET_BITS=64 - --include $(top_srcdir)/git.mk diff --git a/backends/zypp/meson.build b/backends/zypp/meson.build new file mode 100644 index 000000000..cc1c313a5 --- /dev/null +++ b/backends/zypp/meson.build @@ -0,0 +1,33 @@ +add_languages('cpp') + +zypp_dep = dependency('libzypp', version: '>=6.16.0') + +# define if libzypp returns package size in bytes +zypp_args = [] +if zypp_dep.version().compare_version('>=11.4.0') + zypp_args = ['-DZYPP_RETURN_BYTES=1'] +endif + +shared_module( + 'pk_backend_zypp', + 'pk-backend-zypp.cpp', + include_directories: packagekit_src_include, + dependencies: [ + packagekit_glib2_dep, + zypp_dep, + gmodule_dep, + ], + cpp_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit-Zypp"', + '-Wall', + '-Woverloaded-virtual', + '-Wnon-virtual-dtor' + ], + c_args: [ + '-Wno-deprecated', + '-D_FILE_OFFSET_BITS=64', + ] + install: true, + install_dir: pk_plugin_dir, +) diff --git a/client/Makefile.am b/client/Makefile.am deleted file mode 100644 index fe31b7406..000000000 --- a/client/Makefile.am +++ /dev/null @@ -1,122 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -EXTRA_DIST = \ - pkcon.xml \ - pkmon.xml - -if HAVE_XSLTPROC -man_MANS = \ - pkcon.1 \ - pkmon.1 -endif - -if HAVE_XSLTPROC -pkcon.1: pkcon.xml - $(AM_V_GEN) \ - xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null - -pkmon.1: pkmon.xml - $(AM_V_GEN) \ - xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null -endif - -AM_CPPFLAGS = \ - $(PIE_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(SQLITE_CFLAGS) \ - $(SYSTEMD_CFLAGS) \ - -DBINDIR=\"$(bindir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DPREFIX=\""$(prefix)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DLIBEXECDIR=\""$(libexecdir)"\" \ - -DVERSION="\"$(VERSION)\"" \ - -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ - -DPK_DATA=\"$(pkgdatadir)\" \ - -DPK_DB_DIR=\""$(PK_DB_DIR)"\" \ - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DPK_COMPILATION \ - -DG_LOG_DOMAIN=\"PackageKit\" \ - -I$(top_builddir)/lib \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib - -bin_PROGRAMS = \ - pkcon \ - pkmon - -PK_GLIB2_LIBS = \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la \ - $(top_builddir)/lib/packagekit-glib2/libpackagekitprivate.a - -pkcon_SOURCES = \ - pk-console.c - -pkcon_LDADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(DBUS_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) - -pkcon_LDFLAGS = \ - $(PIE_LDFLAGS) - -pkcon_CFLAGS = \ - $(WARNINGFLAGS_C) - -pkmon_SOURCES = \ - pk-monitor.c - -pkmon_LDADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(DBUS_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) - -pkmon_LDFLAGS = \ - $(PIE_LDFLAGS) - -pkmon_CFLAGS = \ - $(WARNINGFLAGS_C) - -if ENABLE_OFFLINE_UPDATE - -libexec_PROGRAMS = \ - pk-offline-update - -pk_offline_update_SOURCES = \ - pk-offline-update.c - -pk_offline_update_LDADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(SYSTEMD_LIBS) \ - $(PK_GLIB2_LIBS) - -pk_offline_update_LDFLAGS = \ - $(PIE_LDFLAGS) - -pk_offline_update_CFLAGS = \ - $(WARNINGFLAGS_C) -endif - -clean-local: - rm -f *~ - rm -f *.1 - rm -f manpage.* - rm -f *.out - -CLEANFILES = $(BUILT_SOURCES) $(man_MANS) - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in - - --include $(top_srcdir)/git.mk diff --git a/client/meson.build b/client/meson.build new file mode 100644 index 000000000..b1ecb760a --- /dev/null +++ b/client/meson.build @@ -0,0 +1,76 @@ +executable( + 'pkcon', + 'pk-console.c', + dependencies: packagekit_glib2_dep, + install: true, + c_args: [ + '-DPK_COMPILATION=1', + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + '-DVERSION="@0@"'.format(meson.project_version()), + ] +) + +executable( + 'pkmon', + 'pk-monitor.c', + dependencies: packagekit_glib2_dep, + install: true, + c_args: [ + '-DPK_COMPILATION=1', + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + '-DVERSION="@0@"'.format(meson.project_version()), + ] +) + +if get_option('offline_update') + executable( + 'pk-offline-update', + 'pk-offline-update.c', + dependencies: [ + packagekit_glib2_dep, + libsystemd, + ], + install: true, + install_dir: get_option('libexecdir'), + c_args: [ + '-DPK_COMPILATION=1', + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE=1', + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + ] + ) +endif + +if get_option('man_pages') + xsltproc = find_program('xsltproc') + pkcon_man = custom_target( + 'pkcon.1', + input: 'pkcon.xml', + output: 'pkcon.1', + command: [ + xsltproc, + '--output', '@OUTPUT@', + 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', + '@INPUT@', + ], + install: true, + install_dir: join_paths(get_option('datadir'), 'man', 'man1'), + ) + pkmon_man = custom_target( + 'pkmon.1', + input: 'pkmon.xml', + output: 'pkmon.1', + command: [ + xsltproc, + '--output', '@OUTPUT@', + 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', + '@INPUT@', + ], + install: true, + install_dir: join_paths(get_option('datadir'), 'man', 'man1'), + ) +endif diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 3da547561..000000000 --- a/configure.ac +++ /dev/null @@ -1,662 +0,0 @@ -# Copyright (C) 2007-2012 Richard Hughes <richard@hughsie.com> - -m4_define([pk_major_version], [1]) -m4_define([pk_minor_version], [1]) -m4_define([pk_micro_version], [14]) -m4_define([pk_version], - [pk_major_version.pk_minor_version.pk_micro_version]) - -AC_PREREQ(2.63) -AC_INIT([PackageKit], - [pk_version], - [richard@hughsie.com], - [PackageKit], - [http://www.packagekit.org/]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_SRCDIR([src]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_AUX_DIR([build-aux]) - -AM_INIT_AUTOMAKE([1.11 -Wno-portability no-dist-gzip dist-xz tar-ustar]) -AM_MAINTAINER_MODE([enable]) - -# enable nice build output on automake1.11 -AM_SILENT_RULES([yes]) - -GOBJECT_INTROSPECTION_CHECK([0.9.9]) - -# Vala bindings -VAPIGEN_CHECK([0.16]) - -PK_MAJOR_VERSION=pk_major_version -PK_MINOR_VERSION=pk_minor_version -PK_MICRO_VERSION=pk_micro_version -PK_VERSION=pk_version -AC_SUBST(PK_MAJOR_VERSION) -AC_SUBST(PK_MINOR_VERSION) -AC_SUBST(PK_MICRO_VERSION) -AC_SUBST(PK_VERSION) - -# libtool versioning - this applies to libpackagekit -# -# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details -# -# - If interfaces have been changed or added, but binary compatibility -# has been preserved, change: -# CURRENT += 1 -# REVISION = 0 -# AGE += 1 -# - If binary compatibility has been broken (eg removed or changed -# interfaces), change: -# CURRENT += 1 -# REVISION = 0 -# AGE = 0 -# - If the interface is the same as the previous version, but bugs are -# fixed, change: -# REVISION += 1 -LT_CURRENT=19 -LT_REVISION=3 -LT_AGE=1 -AC_SUBST(LT_CURRENT) -AC_SUBST(LT_REVISION) -AC_SUBST(LT_AGE) - -AS_ALL_LINGUAS -AC_PROG_CC -AC_PROG_CXX -AC_PROG_INSTALL -AC_SEARCH_LIBS([strerror],[cposix]) -AC_HEADER_STDC -AM_PROG_CC_C_O - -# Initialize libtool -LT_INIT - -# Internationalisation -IT_PROG_INTLTOOL([0.35.0]) -GETTEXT_PACKAGE=PackageKit -AC_SUBST([GETTEXT_PACKAGE]) -AM_GLIB_GNU_GETTEXT -AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain]) - -# set up gtk-doc -GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) - -AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) -AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) - -# Python2/3 stuff -AC_ARG_ENABLE(python3, AS_HELP_STRING([--enable-python3],[Use Python3 for PackageKit]), enable_python3=$enableval, - enable_python3=$default_strict) -if test x$enable_python3 = xyes; then - AM_PATH_PYTHON([3.2]) -else - AM_PATH_PYTHON([2.7]) -fi -AC_ARG_WITH([python_package_dir], - AS_HELP_STRING([--with-python-package-dir=<location>], - [Location for python modules])) -if test -z "$with_python_package_dir" ; then - PYTHON_PACKAGE_DIR=${pythondir}/packagekit -else - PYTHON_PACKAGE_DIR=${with_python_package_dir}/packagekit -fi -AC_SUBST(PYTHON_PACKAGE_DIR) - -if test "$GCC" = "yes"; then - # work both in C and C++ - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wall" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wcast-align -Wno-uninitialized" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wmissing-declarations" -# WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wredundant-decls" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wpointer-arith" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wcast-align" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wwrite-strings" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Winit-self" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wreturn-type" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wformat-nonliteral" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wformat-security" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wmissing-include-dirs" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wmissing-format-attribute" -# WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wclobbered" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wempty-body" -# WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wignored-qualifiers" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wsign-compare" -# WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wtype-limits" - WARNINGFLAGS_CPP="$WARNINGFLAGS_CPP -Wuninitialized" - - # work only in C - WARNINGFLAGS_C="$WARNINGFLAGS_CPP" - WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return" - WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement" - WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow" - WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing" - WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline" -# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type" -# WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init" -else - WARNINGFLAGS_C="" - WARNINGFLAGS_CPP="" -fi -AC_SUBST(WARNINGFLAGS_C) -AC_SUBST(WARNINGFLAGS_CPP) - -# check for PIE (position independent executable) support -AX_CHECK_COMPILE_FLAG([-fPIE], - [AX_CHECK_LINK_FLAG([-fPIE -pie], - [PIE_CFLAGS="-fPIE" PIE_LDFLAGS="-pie"])]) -AC_SUBST(PIE_CFLAGS) -AC_SUBST(PIE_LDFLAGS) - -# check for full RELRO (relocation read-only) support -AX_CHECK_LINK_FLAG([-Wl,-z,relro,-z,now], - [RELRO_LDFLAGS="-Wl,-z,relro,-z,now"]) -AC_SUBST([RELRO_LDFLAGS]) - -dnl --------------------------------------------------------------------------- -dnl - gettext stuff -dnl --------------------------------------------------------------------------- -GETTEXT_PACKAGE=PackageKit -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain]) - -AM_GLIB_GNU_GETTEXT - -dnl --------------------------------------------------------------------------- -dnl - Library dependencies -dnl --------------------------------------------------------------------------- -GLIB_REQUIRED=2.54.0 -GIO_REQUIRED=2.16.1 -POLKIT_GOBJECT_REQUIRED=0.98 - -dnl --------------------------------------------------------------------------- -dnl - Check library dependencies -dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0) -PKG_CHECK_MODULES(GMODULE, gmodule-2.0) -PKG_CHECK_MODULES(SQLITE, sqlite3) -PKG_CHECK_MODULES(GIO, \ - gio-2.0 >= $GIO_REQUIRED \ - gio-unix-2.0 >= $GIO_REQUIRED) -PKG_CHECK_MODULES(POLKIT, \ - polkit-gobject-1 >= $POLKIT_GOBJECT_REQUIRED) - -# 0.114 introduced autocleanup functions for its types. -PKG_CHECK_MODULES([POLKIT_0_114], [polkit-gobject-1 >= 0.114], - [have_polkit_0_114=yes], [have_polkit_0_114=no]) -AS_IF([test "$have_polkit_0_114" = "yes"], [ - AC_DEFINE([HAVE_POLKIT_0_114],[1], - [Define as 1 if you have polkit >= 0.114]) -]) - -# 0.9.5 introduced new boot splash modes -PKG_CHECK_MODULES([PLYMOUTH_0_9_5], [ply-boot-client >= 0.9.5], - [have_plymouth_0_9_5=yes], [have_plymouth_0_9_5=no]) -AS_IF([test "$have_plymouth_0_9_5" = "yes"], [ - AC_DEFINE([PLYMOUTH_0_9_5],[1], - [Define as 1 if you have plymouth >= 0.9.5]) -]) - -# Avoid g_simple_async_result deprecation warnings in glib 2.46+ -AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_44, [minimum glib version]) - -dnl --------------------------------------------------------------------------- -dnl - FreeBSD compatibility -dnl --------------------------------------------------------------------------- -AC_CHECK_HEADERS([execinfo.h]) -AC_CHECK_FUNCS(clearenv) -AC_PATH_PROG(GMSGFMT, msgfmt, msgfmt) - -dnl --------------------------------------------------------------------------- -dnl - Haiku compatibility -dnl --------------------------------------------------------------------------- -AC_CHECK_FUNCS(setpriority) - -dnl --------------------------------------------------------------------------- -dnl - Use systemd and logind rather than ConsoleKit -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[enable systemd and logind code]), - enable_systemd=$enableval,enable_systemd=yes) -if test x$enable_systemd = xyes; then - PKG_CHECK_MODULES(SYSTEMD, libsystemd >= 213) - AC_ARG_WITH([systemdsystemunitdir], - AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), - [has_systemdsystemunitdir=$with_systemdsystemunitdir], - [has_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) - AC_SUBST([systemdsystemunitdir], [$has_systemdsystemunitdir]) - AC_ARG_WITH([systemduserunitdir], - AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]), - [has_systemduserunitdir=$with_systemduserunitdir], - [has_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)]) - AC_SUBST([systemduserunitdir], [$has_systemduserunitdir]) - AC_DEFINE(HAVE_SYSTEMD,1,[Build systemd code]) -fi -AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$has_systemdsystemunitdir"]) -AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$has_systemduserunitdir"]) - -dnl --------------------------------------------------------------------------- -dnl - Use systemd offline update -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(offline-update, AS_HELP_STRING([--enable-offline-update],[enable offline update via systemd]), - enable_offline_update=$enableval,enable_offline_update=yes) -AM_CONDITIONAL(ENABLE_OFFLINE_UPDATE, [test x$enable_systemd = xyes -a x$enable_offline_update = xyes]) - -dnl --------------------------------------------------------------------------- -dnl - Use elogind instead of systemd-login -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind],[enable elogind session tracker]), - enable_elogind=$enableval,enable_elogind=no) -if test x$enable_elogind = xyes; then - PKG_CHECK_MODULES(ELOGIND, [libelogind >= 229.4], [have_elogind=yes], [have_elogind=no]) -else - have_elogind=no -fi - -dnl --------------------------------------------------------------------------- -dnl --- Is systemd/sd-login.h, either from systemd or elogind, available? -dnl --------------------------------------------------------------------------- -if test -n "$has_systemdsystemunitdir" -o "x$have_elogind" != "xno" ; then - AC_DEFINE(HAVE_SYSTEMD_SD_LOGIN_H,1,[Build systemd-login code]) -fi - -dnl --------------------------------------------------------------------------- -dnl - Generate man pages ? (default enabled) -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],[Disable man pages generation]), enable_man_pages=$enableval) -if test x$enable_man_pages != xno; then - AC_PATH_PROG(XSLTPROC, xsltproc, no) - if test x$enable_man_pages = xyes; then - if test "$XSLTPROC" = "no" ; then - AC_MSG_ERROR([xsltproc not found, it is needed to build man pages]) - fi - fi -else - XSLTPROC=no -fi -AM_CONDITIONAL(HAVE_XSLTPROC, [test "$XSLTPROC" != "no"]) - -dnl **** Bash completion **** -AC_ARG_ENABLE(bash_completion, AS_HELP_STRING([--enable-bash-completion],[Enable bash completion]), - enable_bash_completion=$enableval, enable_bash_completion=yes) -if test x$enable_bash_completion != xno; then - PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0]) - BASH_COMPLETIONS_DIR="`pkg-config --variable=completionsdir bash-completion`" - AC_SUBST([BASH_COMPLETIONS_DIR]) -fi -AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$enable_bash_completion" = "xyes"]) - -dnl --------------------------------------------------------------------------- -dnl - Make paths available for source files -dnl --------------------------------------------------------------------------- -AC_SUBST(SYSCONFDIR, $sysconfdir) -AC_SUBST(LIBDIR, $libdir) -AC_SUBST(LIBEXECDIR, $libexecdir) -AC_SUBST(DATADIR, $datadir) -AC_SUBST(BINDIR, $bindir) -AC_SUBST(SBINDIR, $sbindir) -AC_SUBST(LOCALSTATEDIR, $localstatedir) - -AC_ARG_WITH([packagekit_user], - AS_HELP_STRING([--with-packagekit-user=<user>], - [User for running the PackageKit daemon (root)])) -if test -z "$with_packagekit_user" ; then - PACKAGEKIT_USER=root -else - PACKAGEKIT_USER=$with_packagekit_user -fi -AC_SUBST(PACKAGEKIT_USER) -AC_DEFINE_UNQUOTED(PACKAGEKIT_USER,"$PACKAGEKIT_USER", [User for running the PackageKit daemon]) - -dnl --------------------------------------------------------------------------- -dnl - Able to run from a checkout? -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(local, AS_HELP_STRING([--enable-local],[enable running in local checkout]), - enable_local=$enableval,enable_local=no) -AM_CONDITIONAL(PK_BUILD_LOCAL, test x$enable_local = xyes) -if test x$enable_local = xyes; then - AC_DEFINE(PK_BUILD_LOCAL,1,[Build local code]) -fi - -dnl --------------------------------------------------------------------------- -dnl - Able to build gstreamer plugin -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(gstreamer_plugin, AS_HELP_STRING([--enable-gstreamer-plugin],[Build gstreamer plugin functionality]), - enable_gstreamer_plugin=$enableval,enable_gstreamer_plugin=yes) -if test x$enable_gstreamer_plugin = xyes; then - PKG_CHECK_MODULES(PK_GSTREAMER_PLUGIN, gstreamer-1.0 gstreamer-plugins-base-1.0 glib-2.0 gio-2.0, - build_gstreamer_plugin=yes, build_gstreamer_plugin=no) -else - build_gstreamer_plugin=no -fi -AM_CONDITIONAL(PK_BUILD_GSTREAMER_PLUGIN, test $build_gstreamer_plugin = "yes") - -dnl --------------------------------------------------------------------------- -dnl - Able to build GTK module -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(gtk_module, AS_HELP_STRING([--enable-gtk-module],[Build GTK+-3 module functionality]), - enable_gtk_module=$enableval,enable_gtk_module=yes) -if test x$enable_gtk_module = xyes; then - PKG_CHECK_MODULES(PK_GTK_MODULE, gtk+-3.0 >= 3.0.0 pangoft2 fontconfig gio-2.0, - build_gtk_module=yes, build_gtk_module=no) -else - build_gtk_module=no -fi -if test x$build_gtk_module = xyes; then - # this is needed to avoid the GTK2 warning - PKG_CHECK_MODULES(PK_GTK_MODULE_GTK2, gtk+-2.0 gio-2.0) - GLIB_GSETTINGS -fi -AM_CONDITIONAL(PK_BUILD_GTK_MODULE, test $build_gtk_module = "yes") - -dnl --------------------------------------------------------------------------- -dnl - Able to build BASH command-not-found functionality -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(command_not_found, AS_HELP_STRING([--enable-command-not-found],[Build BASH command-not-found functionality]), - build_command_not_found=$enableval,build_command_not_found=yes) -AM_CONDITIONAL(PK_BUILD_COMMAND_NOT_FOUND, test $build_command_not_found = "yes") - -dnl --------------------------------------------------------------------------- -dnl - Able to build cron background functionality -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(cron, AS_HELP_STRING([--enable-cron],[Build cron background functionality]), - build_cron=$enableval,build_cron=yes) -AM_CONDITIONAL(PK_BUILD_CRON, test $build_cron = "yes") - -# don't do daemon checks when running make distcheck -AC_ARG_ENABLE(daemon-tests, AS_HELP_STRING([--enable-daemon-tests], - [Test the daemon using the dummy backend]), - enable_daemon_tests=$enableval,enable_daemon_tests=yes) -if test x$enable_daemon_tests = xyes; then - AC_DEFINE(PK_ENABLE_DAEMON_TESTS,1,[Enable the daemon tests]) -fi - -# backends -AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[use the ALPM backend]),enable_alpm=$enableval,enable_alpm=no) -AC_ARG_ENABLE(aptcc, AS_HELP_STRING([--enable-aptcc],[use the APTcc backend]),enable_aptcc=$enableval,enable_aptcc=no) -AC_ARG_ENABLE(dnf, AS_HELP_STRING([--enable-dnf],[use the DNF backend]),enable_dnf=$enableval,enable_dnf=no) -AC_ARG_ENABLE(dummy, AS_HELP_STRING([--enable-dummy],[use the dummy backend]),enable_dummy=$enableval,enable_dummy=yes) -AC_ARG_ENABLE(entropy, AS_HELP_STRING([--enable-entropy],[use the entropy backend]),enable_entropy=$enableval,enable_entropy=no) -AC_ARG_ENABLE(pisi, AS_HELP_STRING([--enable-pisi],[use the PiSi backend]),enable_pisi=$enableval,enable_pisi=no) -AC_ARG_ENABLE(poldek, AS_HELP_STRING([--enable-poldek],[use the poldek backend]),enable_poldek=$enableval,enable_poldek=no) -AC_ARG_ENABLE(portage, AS_HELP_STRING([--enable-portage],[use the portage backend]),enable_portage=$enableval,enable_portage=no) -AC_ARG_ENABLE(ports, AS_HELP_STRING([--enable-ports],[use the ports backend]),enable_ports=$enableval,enable_ports=no) -AC_ARG_ENABLE(slack, AS_HELP_STRING([--enable-slack],[use the Slackware backend]),enable_slack=$enableval,enable_slack=no) -AC_ARG_ENABLE(urpmi, AS_HELP_STRING([--enable-urpmi],[use the URPMI backend]),enable_urpmi=$enableval,enable_urpmi=no) -AC_ARG_ENABLE(yum, AS_HELP_STRING([--enable-yum],[use the YUM backend]),enable_yum=$enableval,enable_yum=no) -AC_ARG_ENABLE(zypp, AS_HELP_STRING([--enable-zypp],[use the Zypp backend]),enable_zypp=$enableval,enable_zypp=no) -AC_ARG_ENABLE(nix, AS_HELP_STRING([--enable-nix],[use the Nix backend]),enable_nix=$enableval,enable_nix=no) - -# export to Makefile.am's -AM_CONDITIONAL(BACKEND_TYPE_ALPM, [test x$enable_alpm = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_APTCC, [test x$enable_aptcc = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_DNF, [test x$enable_dnf = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$enable_dummy = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_ENTROPY, [test x$enable_entropy = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_PISI, [test x$enable_pisi = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_POLDEK, [test x$enable_poldek = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_PORTAGE, [test x$enable_portage = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_PORTS, [test x$enable_ports = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_SLACK, [test x$enable_slack = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_URPMI, [test x$enable_urpmi = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$enable_yum = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_ZYPP, [test x$enable_zypp = xyes]) -AM_CONDITIONAL(BACKEND_TYPE_NIX, [test x$enable_nix = xyes]) - -dnl --------------------------------------------------------------------------- -dnl - Are we specifying a different dbus root ? -dnl --------------------------------------------------------------------------- -AC_ARG_WITH(dbus-sys, - [AS_HELP_STRING([--with-dbus-sys=<dir>],[where D-BUS system.d directory is])]) -AC_ARG_WITH(dbus-services, - [AS_HELP_STRING([--with-dbus-services=<dir>],[where D-BUS system-services directory is])]) -if ! test -z "$with_dbus_sys" ; then - DBUS_SYS_DIR="$with_dbus_sys" -else - DBUS_SYS_DIR="$SYSCONFDIR/dbus-1/system.d" -fi -if ! test -z "$with_dbus_services" ; then - DBUS_SERVICES_DIR="$with_dbus_services" -else - DBUS_SERVICES_DIR="$DATADIR/dbus-1/system-services" -fi -AC_SUBST(DBUS_SYS_DIR) -AC_SUBST(DBUS_SERVICES_DIR) - -if test x$enable_dnf = xyes; then - PKG_CHECK_MODULES(DNF, appstream-glib libdnf >= 0.22.0 rpm) - AC_ARG_WITH(dnf-vendor, - [AS_HELP_STRING([--with-dnf-vendor=<vendor>],[select a vendor configuration (fedora, mageia, openmandriva, rosa; default is fedora)])]) - if test "$with_dnf_vendor" = "fedora" -o "$with_dnf_vendor" = "mageia" -o "$with_dnf_vendor" = "openmandriva" -o "$with_dnf_vendor" = "rosa"; then - with_dnf_vendor="$with_dnf_vendor" - else - with_dnf_vendor="fedora" - fi - AC_SUBST(DNF_VENDOR, [$with_dnf_vendor]) -fi - -have_python_backend="no" -if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o x$enable_portage = xyes -o x$enable_yum = xyes; then - have_python_backend="yes" -fi -AM_CONDITIONAL(HAVE_PYTHON_BACKEND, test x$have_python_backend = xyes) - -if test x$enable_aptcc = xyes; then - dnl Use C++ - AC_LANG([C++]) - - # Require C++11 support - AX_CXX_COMPILE_STDCXX_11([ext], [mandatory]) - - # check we have apt and gstreamer headers - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - save_CFLAGS="$CFLAGS" - save_LIBS="$LIBS" - - AC_CHECK_LIB(apt-pkg, main, , [AC_MSG_ERROR([Can't find the APT libraries -- please install libapt-pkg-dev])]) - AC_CHECK_HEADER(apt-pkg/init.h, , [AC_MSG_ERROR([Can't find the APT header files -- please install libapt-pkg-dev])]) - - AC_SUBST(APTCC_CFLAGS) - AC_SUBST(APTCC_LIBS) - - AC_CHECK_LIB(apt-inst, main, [APTINST_LIBS=-lapt-inst], [APTINST_LIBS=]) - AC_SUBST(APTCC_CFLAGS) - AC_SUBST(APTCC_LIBS) - AC_SUBST(APTINST_LIBS) - - PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 gstreamer-base-1.0 gstreamer-plugins-base-1.0,, - [AC_MSG_ERROR([Can't find the gstreamer libraries -- please install libgstreamer-plugins-base1.0-dev])]) - AC_SUBST(GSTREAMER_CFLAGS) - AC_SUBST(GSTREAMER_LIBS) - - PKG_CHECK_MODULES(APPSTREAM, appstream >= 0.11) - - AC_MSG_CHECKING([whether apt is at least at version 1.1]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <apt-pkg/pkgsystem.h>]], - [[_system->ArchitecturesSupported();]])], - AC_MSG_RESULT([yes]), - AC_MSG_FAILURE([need libapt-pkg 1.1 or later])) - - AC_MSG_CHECKING([whether apt has frontend locking / is at least version 1.7]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <apt-pkg/pkgsystem.h>]], - [[_system->LockInner();]])], - AC_MSG_RESULT([yes]), - AC_MSG_FAILURE([need libapt-pkg 1.7 or later - or backported frontend locking])) - - AC_MSG_CHECKING([whether apt supports ddtp]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <apt-pkg/pkgcache.h>]], - [[pkgCache::DescIterator d;]])], - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_DDTP], [], [Set to true if apt is DDTP-enabled]), - AC_MSG_RESULT([no])) - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - CFLAGS="$save_CFLAGS" - LIBS="$save_LIBS" -fi - -if test x$enable_alpm = xyes; then - PKG_CHECK_MODULES(ALPM, libalpm >= 12.0.0) -fi - -if test x$enable_poldek = xyes; then - POLDEK_CFLAGS="-I/usr/include/poldek" - POLDEK_LIBS="-lpoclidek -lpoldek" - AC_SUBST(POLDEK_CFLAGS) - AC_SUBST(POLDEK_LIBS) -fi - -if test x$enable_zypp = xyes; then - PKG_CHECK_MODULES(ZYPP, libzypp >= 6.16.0) - PKG_CHECK_EXISTS(libzypp >= 11.4.0, [ ZYPP_RETURN_BYTES="yes" ], [ ZYPP_RETURN_BYTES="no" ]) - if test "x$ZYPP_RETURN_BYTES" = "xyes"; then - AC_DEFINE(ZYPP_RETURN_BYTES, 1, [define if libzypp returns package size in bytes]) - fi -fi - -if test x$enable_slack = xyes; then - AC_LANG([C++]) - AX_CXX_COMPILE_STDCXX_14([ext], [mandatory]) - - AC_CHECK_LIB(curl, curl_version, [ - CURL_CFLAGS="`curl-config --cflags`" - CURL_LIBS="`curl-config --libs`" - ], [AC_MSG_ERROR([Cant find curl])]) - case "`uname -m`" in - x86-64|x86_64|X86-64|X86_64) - SLACK_PKGMAIN="slackware64" - ;; - *) - SLACK_PKGMAIN="slackware" - esac - - SLACK_CFLAGS="$CURL_CFLAGS" - SLACK_LIBS="$CURL_LIBS" - - AC_SUBST(SLACK_PKGMAIN) - AC_SUBST(SLACK_CFLAGS) - AC_SUBST(SLACK_LIBS) -fi - -if test x$enable_nix = xyes; then - dnl Use C++ - AC_LANG([C++]) - - # Require C++11 support - AX_CXX_COMPILE_STDCXX_11([ext], [mandatory]) - - PKG_CHECK_MODULES(NIX, nix-expr >= 1.12) - PKG_CHECK_MODULES(NIX, nix-main >= 1.12) - PKG_CHECK_MODULES(NIX, nix-store >= 1.12) -fi - -AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend") -AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/lib -DPK_COMPILATION $GLIB_CFLAGS $GMODULE_CFLAGS $GIO_CFLAGS") -AC_SUBST(PK_PLUGIN_LIBS, "$GLIB_LIBS $GMODULE_LIBS $GIO_LIBS") - -dnl --------------------------------------------------------------------------- -dnl - Makefiles, etc. -dnl --------------------------------------------------------------------------- -AC_CONFIG_FILES([ -Makefile -etc/Makefile -docs/Makefile -docs/api/Makefile -docs/api/dbus/Makefile -docs/api/version.xml -contrib/Makefile -contrib/gstreamer-plugin/Makefile -contrib/gtk-module/Makefile -contrib/gtk-module/gtk2/Makefile -contrib/yum-packagekit/Makefile -contrib/command-not-found/Makefile -contrib/cron/Makefile -backends/Makefile -backends/alpm/Makefile -backends/aptcc/Makefile -backends/dnf/Makefile -backends/dummy/Makefile -backends/entropy/Makefile -backends/slack/Makefile -backends/slack/tests/Makefile -backends/test/Makefile -backends/test/helpers/Makefile -backends/urpmi/Makefile -backends/urpmi/helpers/Makefile -backends/urpmi/helpers/perl_packagekit/Makefile -backends/urpmi/helpers/urpmi_backend/Makefile -backends/yum/Makefile -backends/pisi/Makefile -backends/poldek/Makefile -backends/portage/Makefile -backends/ports/Makefile -backends/ports/ruby_packagekit/Makefile -backends/zypp/Makefile -backends/nix/Makefile -data/Makefile -data/org.freedesktop.PackageKit.conf -data/tests/Makefile -data/tests/pk-client-helper-test.py -data/tests/pk-spawn-dispatcher.py -data/tests/pk-spawn-test-sigquit.py -lib/Makefile -lib/packagekit-glib2/pk-version.h -lib/packagekit-glib2/Makefile -lib/packagekit-glib2/packagekit-glib2.pc -lib/python/Makefile -lib/python/packagekit/Makefile -policy/Makefile -src/Makefile -client/Makefile -po/Makefile.in -],[ -chmod +x data/tests/pk-client-helper-test.py -chmod +x data/tests/pk-spawn-dispatcher.py -chmod +x data/tests/pk-spawn-test-sigquit.py -]) -AC_OUTPUT - -dnl ========================================================================== -echo " - PackageKit $VERSION - ==================== - - prefix: ${prefix} - datadir: ${datadir} - compiler: ${CC} - cflags: ${CFLAGS} - cppflags: ${CPPFLAGS} - Able to run locally: ${enable_local} - Use elogind: ${enable_elogind} - Use systemd: ${enable_systemd} - Enable offline update: ${enable_offline_update} - GStreamer plugin: ${build_gstreamer_plugin} - Pango module (GTK+3): ${build_gtk_module} - gobject-introspection: ${found_introspection} - BASH Command not found: ${build_command_not_found} - Cron scripts: ${build_cron} - python3: ${enable_python3} - systemd system unit dir: ${has_systemdsystemunitdir} - systemd user unit dir: ${has_systemduserunitdir} - Installing python backend: ${have_python_backend} - python package dir: ${with_python_package_dir} - - Backends: - ALPM backend: ${enable_alpm} - APTcc backend: ${enable_aptcc} - DNF backend: ${enable_dnf} - DNF backend vendor: ${with_dnf_vendor} - dummy backend: ${enable_dummy} - Entropy backend: ${enable_entropy} - PiSi backend: ${enable_pisi} - poldek backend: ${enable_poldek} - Portage backend: ${enable_portage} - Ports backend: ${enable_ports} - Slackware backend: ${enable_slack} - URPMI backend: ${enable_urpmi} - YUM backend: ${enable_yum} - Zypp backend: ${enable_zypp} - Nix backend: ${enable_nix} -" 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') +) diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index 02c257f2e..000000000 --- a/data/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -NULL = - -SUBDIRS = \ - tests - -upgradescriptdir = $(datadir)/PackageKit -upgradescript_SCRIPTS = pk-upgrade-distro.sh - -dbusdir = ${DBUS_SYS_DIR} -dist_dbus_DATA = \ - org.freedesktop.PackageKit.conf - -%.service: %.service.in Makefile - $(AM_V_GEN)sed -e 's|\@libexecdir\@|$(libexecdir)|' \ - -e 's|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|' $< > $@.tmp && mv $@.tmp $@ - -servicemaindir = $(DBUS_SERVICES_DIR) -servicemain_in_files = org.freedesktop.PackageKit.service.in -servicemain_DATA = $(servicemain_in_files:.service.in=.service) - -systemdservice_in_files = \ - packagekit.service.in \ - packagekit-offline-update.service.in - -if HAVE_SYSTEMD -systemdservicedir = $(systemdsystemunitdir) -systemdservice_DATA = packagekit.service -if ENABLE_OFFLINE_UPDATE -systemdservice_DATA += packagekit-offline-update.service -endif -endif - - -databasedir = $(localstatedir)/lib/PackageKit -database_DATA = \ - transactions.db - -install-data-hook: - @for file in $(database_DATA); do \ - echo "Remove global read access for: $(DESTDIR)$(localstatedir)/lib/PackageKit/$$file"; \ - chmod o-r $(DESTDIR)$(localstatedir)/lib/PackageKit/$$file; \ - done -if ENABLE_OFFLINE_UPDATE - mkdir -p $(DESTDIR)$(systemdservicedir)/system-update.target.wants - ln -sf ../packagekit-offline-update.service $(DESTDIR)$(systemdservicedir)/system-update.target.wants/packagekit-offline-update.service -endif - -EXTRA_DIST = \ - org.freedesktop.PackageKit.conf.in \ - $(servicemain_in_files) \ - $(servicetest_in_files) \ - $(serviceapt_in_files) \ - $(systemdservice_in_files) \ - $(localcache_DATA) \ - $(database_DATA) \ - $(upgradescript_SCRIPTS) - -clean-local: - rm -f *~ - -DISTCLEANFILES = \ - $(systemdservice_DATA) \ - org.freedesktop.PackageKit.service - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in - --include $(top_srcdir)/git.mk diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 000000000..7fc41144c --- /dev/null +++ b/data/meson.build @@ -0,0 +1,60 @@ +install_data( + 'pk-upgrade-distro.sh', + install_dir: join_paths(get_option('datadir'), 'PackageKit'), +) + +dbus_config_data = configuration_data() +dbus_config_data.set('PACKAGEKIT_USER', get_option('packagekit_user')) +dbus_config_data.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir'))) + +dbus_sys_dir = get_option('dbus_sys') +if dbus_sys_dir == '' + dbus_sys_dir = join_paths(get_option('sysconfdir'), 'dbus-1', 'system.d') +endif + +configure_file( + input: 'org.freedesktop.PackageKit.conf.in', + output: 'org.freedesktop.PackageKit.conf', + configuration: dbus_config_data, + install: true, + install_dir: dbus_sys_dir, +) + +dbus_services_dir = get_option('dbus_services') +if dbus_services_dir == '' + dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1', 'system-services') +endif + +configure_file( + input: 'org.freedesktop.PackageKit.service.in', + output: 'org.freedesktop.PackageKit.service', + configuration: dbus_config_data, + install: true, + install_dir: dbus_services_dir, +) + + +if get_option('systemd') + configure_file( + input: 'packagekit.service.in', + output: 'packagekit.service', + configuration: dbus_config_data, + install: true, + install_dir: systemd_system_unit_dir, + ) + + if get_option('offline_update') + configure_file( + input: 'packagekit-offline-update.service.in', + output: 'packagekit-offline-update.service', + configuration: dbus_config_data, + install: true, + install_dir: systemd_system_unit_dir, + ) + endif +endif + +install_data( + 'transactions.db', + install_dir: join_paths(get_option('localstatedir'), 'lib', 'PackageKit'), +) diff --git a/data/tests/Makefile.am b/data/tests/Makefile.am deleted file mode 100644 index 8787d80ec..000000000 --- a/data/tests/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -NULL = - -TEST_FILES = \ - pk-client-helper-test.py.in \ - pk-spawn-test.sh \ - pk-spawn-proxy.sh \ - pk-spawn-test-sigquit.sh \ - pk-spawn-test-sigquit.py.in \ - pk-spawn-test-profiling.sh \ - pk-spawn-dispatcher.py.in \ - $(NULL) - -DISTCLEANFILES = \ - pk-client-helper-test.py \ - pk-spawn-test-sigquit.py \ - pk-spawn-dispatcher.py \ - $(NULL) - -EXTRA_DIST = \ - $(TEST_FILES) \ - $(NULL) - -clean-local: - rm -f *~ - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in \ - $(NULL) - - --include $(top_srcdir)/git.mk diff --git a/data/tests/packagekit b/data/tests/packagekit index 2e8d94955..571b05c0c 120000 --- a/data/tests/packagekit +++ b/data/tests/packagekit @@ -1 +1 @@ -../../lib/python/packagekit
\ No newline at end of file +../../lib/python/packagekit/
\ No newline at end of file diff --git a/data/tests/pk-client-helper-test.py.in b/data/tests/pk-client-helper-test.py index 9fa693817..159008eaa 100755 --- a/data/tests/pk-client-helper-test.py.in +++ b/data/tests/pk-client-helper-test.py @@ -1,4 +1,4 @@ -#!@PYTHON@ +#!/usr/bin/python3 # Licensed under the GNU General Public License Version 2 # # This program is free software; you can redistribute it and/or modify @@ -23,19 +23,19 @@ def main(): while True: try: line = sys.stdin.readline().strip('\n') - except IOError, e: - print "could not read from stdin: %s", str(e) + except IOError as e: + print("could not read from stdin: %s", str(e)) + break + except KeyboardInterrupt as e: + print("process was killed by ctrl-c", str(e)) break - except KeyboardInterrupt, e: - print "process was killed by ctrl-c", str(e) - break; if not line or line == 'exit': break if line == 'ping': - sys.stdout.write ('pong\n') + sys.stdout.write('pong\n') sys.stdout.flush() else: - sys.stdout.write ("you said to me: %s\n" % line) + sys.stdout.write("you said to me: %s\n" % line) sys.stdout.flush() if __name__ == "__main__": diff --git a/data/tests/pk-spawn-dispatcher.py.in b/data/tests/pk-spawn-dispatcher.py index fe47e0789..2fa36d57e 100755 --- a/data/tests/pk-spawn-dispatcher.py.in +++ b/data/tests/pk-spawn-dispatcher.py @@ -1,4 +1,4 @@ -#!@PYTHON@ +#!/usr/bin/python3 # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,11 +16,15 @@ import sys import time +import os + +sys.path.insert(0,os.path.join(os.getcwd(), 'lib', 'python')) + from packagekit.backend import * class PackageKitYumBackend(PackageKitBaseBackend): - def __init__(self,args,lock=True): - PackageKitBaseBackend.__init__(self,args) + def __init__(self, args, lock=True): + PackageKitBaseBackend.__init__(self, args) PackageKitBaseBackend.doLock(self) # simulate doing something time.sleep(2) @@ -30,13 +34,13 @@ class PackageKitYumBackend(PackageKitBaseBackend): # simulate doing something time.sleep(0.5) - def search_name(self,filters,key): + def search_name(self, filters, key): # check we escape spaces properly if key == ['power manager']: - self.package("polkit;0.0.1;i386;data",INFO_AVAILABLE,"PolicyKit daemon") + self.package("polkit;0.0.1;i386;data", INFO_AVAILABLE, "PolicyKit daemon") def main(): - backend = PackageKitYumBackend('',lock=True) + backend = PackageKitYumBackend('', lock=True) backend.dispatcher(sys.argv[1:]) if __name__ == "__main__": diff --git a/data/tests/pk-spawn-test-sigquit.py.in b/data/tests/pk-spawn-test-sigquit.py index 2f8d08262..b15e7a47e 100755 --- a/data/tests/pk-spawn-test-sigquit.py.in +++ b/data/tests/pk-spawn-test-sigquit.py @@ -1,4 +1,4 @@ -#!@PYTHON@ +#!/usr/bin/python3 # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,7 +21,7 @@ def process_quit(signum, frame): def main(): signal(SIGQUIT, process_quit) - for i in [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: + for i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: stdout.write("percentage\t%i\n" % (i * 10)) stdout.flush() sleep(0.3) diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index bab850222..000000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -NULL = - -SUBDIRS = \ - api - --include $(top_srcdir)/git.mk diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am deleted file mode 100644 index 2b81e9753..000000000 --- a/docs/api/Makefile.am +++ /dev/null @@ -1,129 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = dbus - -NULL = - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# The name of the module, e.g. 'glib'. -DOC_MODULE=PackageKit - -# The top-level SGML file. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml - -# The directory containing the source code. -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -DOC_SOURCE_DIR=$(top_srcdir)/lib/packagekit-glib2 - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS= - -# Extra options to supply to gtkdoc-scan. -SCAN_OPTIONS= - -# Extra options to supply to gtkdoc-mkdb. -MKDB_OPTIONS=--sgml-mode --output-format=xml - -# Extra options to supply to gtkdoc-mktmpl -MKTMPL_OPTIONS= - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -FIXXREF_OPTIONS= - -# Used for dependencies. The docs will be rebuilt if any of these change. -HFILE_GLOB=$(top_srcdir)/lib/packagekit-glib2/pk-*.h -CFILE_GLOB=$(top_srcdir)/lib/packagekit-glib2/pk-*.c - -# Header files to ignore when scanning. -IGNORE_HFILES = \ - config.h \ - pk-marshal.h \ - pk-common-private.h \ - pk-debug.h \ - pk-offline-private.h \ - pk-spawn-polkit-agent.h \ - $(NULL) - -# Images to copy into HTML directory. -HTML_IMAGES = \ - spec/pk-structure.png \ - spec/pk-structure.svg \ - spec/pk-transactions.svg \ - spec/pk-transactions-set-locale.png \ - spec/pk-transactions-repair-required.png \ - spec/pk-transactions-failure.png \ - spec/pk-transactions-download.png \ - spec/pk-transactions-sig-install.png \ - spec/pk-transactions-success.png \ - spec/pk-transactions-auto-untrusted.png \ - spec/pk-transactions-trusted.png - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -content_files = \ - version.xml \ - dbus/org.freedesktop.PackageKit.ref.xml \ - dbus/org.freedesktop.PackageKit.Transaction.ref.xml \ - spec/pk-backend-compiled.xml \ - spec/pk-backend-spawn.xml \ - spec/pk-concepts.xml \ - spec/pk-introduction.xml - - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -expand_content_files= - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -AM_CPPFLAGS = \ - $(POLKIT_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) \ - -I$(top_builddir)/lib/packagekit-glib2 \ - -I$(top_srcdir)/lib/packagekit-glib2 \ - $(NULL) - -PK_GLIB2_LIBS = \ - $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la \ - $(top_builddir)/lib/packagekit-glib2/libpackagekitprivate.a \ - $(NULL) - -GTKDOC_LIBS = \ - $(GLIB_LIBS) \ - $(DBUS_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) \ - $(POLKIT_LIBS) \ - $(NULL) - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -EXTRA_DIST += version.xml.in - -CLEANFILES += \ - *-decl.txt \ - *-decl-list.txt \ - *-overrides.txt \ - *-undeclared.txt \ - *-undocumented.txt \ - *-unused.txt \ - *.types \ - *.args \ - *.hierarchy \ - *.interfaces \ - *.prerequisites \ - *.signals \ - *.stamp \ - tmpl - -DISTCLEANFILES = \ - org.freedesktop.PackageKit.ref.xml \ - org.freedesktop.PackageKit.Transaction.ref.xml - --include $(top_srcdir)/git.mk diff --git a/docs/api/clean.sh b/docs/api/clean.sh deleted file mode 100755 index 0f79e1c37..000000000 --- a/docs/api/clean.sh +++ /dev/null @@ -1,12 +0,0 @@ -rm -f *-decl.txt -rm -f *-decl-list.txt -rm -f *-overrides.txt -rm -f *-undeclared.txt -rm -f *-undocumented.txt -rm -f *-unused.txt -rm -f PackageKit-scan.* -rm -f PackageKit.types -rm -f html/*.html -rm -f html/*.png -rm -f tmpl/* - diff --git a/docs/api/dbus/Makefile.am b/docs/api/dbus/Makefile.am deleted file mode 100644 index 36e4b5634..000000000 --- a/docs/api/dbus/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ - -if ENABLE_GTK_DOC - -all : org.freedesktop.PackageKit.ref.xml org.freedesktop.PackageKit.Transaction.ref.xml - -org.freedesktop.PackageKit.ref.xml : $(top_srcdir)/src/org.freedesktop.PackageKit.xml $(top_srcdir)/docs/api/dbus/spec-to-docbook.xsl - echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@ - $(XSLTPROC) $(top_srcdir)/docs/api/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ - -org.freedesktop.PackageKit.Transaction.ref.xml : $(top_srcdir)/src/org.freedesktop.PackageKit.Transaction.xml $(top_srcdir)/docs/api/dbus/spec-to-docbook.xsl - echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@ - $(XSLTPROC) $(top_srcdir)/docs/api/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ - -endif - -EXTRA_DIST = spec-to-docbook.xsl dbus-introspect-docs.dtd - -CLEANFILES = \ - org.freedesktop.PackageKit.Transaction.ref.xml \ - org.freedesktop.PackageKit.ref.xml - -clean-local : - rm -f *~ *.ref.xml - --include $(top_srcdir)/git.mk diff --git a/docs/api/dbus/meson.build b/docs/api/dbus/meson.build new file mode 100644 index 000000000..842389bd3 --- /dev/null +++ b/docs/api/dbus/meson.build @@ -0,0 +1,27 @@ +spec_to_docbook = find_program('spec-to-docbook.sh') + +packagekit_ref_xml = custom_target( + 'org.freedesktop.PackageKit.ref.xml', + input: join_paths(meson.source_root(), 'src', 'org.freedesktop.PackageKit.xml'), + output: 'org.freedesktop.PackageKit.ref.xml', + build_by_default: true, + command: [ + spec_to_docbook, + files('spec-to-docbook.xsl'), + '@INPUT@', + '@OUTPUT@', + ], +) + +packagekit_transaction_ref_xml = custom_target( + 'org.freedesktop.PackageKit.Transaction.ref.xml', + input: join_paths(meson.source_root(), 'src', 'org.freedesktop.PackageKit.Transaction.xml'), + output: 'org.freedesktop.PackageKit.Transaction.ref.xml', + build_by_default: true, + command: [ + spec_to_docbook, + files('spec-to-docbook.xsl'), + '@INPUT@', + '@OUTPUT@', + ], +) diff --git a/docs/api/dbus/spec-to-docbook.sh b/docs/api/dbus/spec-to-docbook.sh new file mode 100644 index 000000000..c5d7f82c4 --- /dev/null +++ b/docs/api/dbus/spec-to-docbook.sh @@ -0,0 +1,7 @@ +#!/bin/sh +spec_to_docbook_xsl="$1" +input_file="$2" +output_file="$3" + +echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > ${output_file} +xsltproc ${spec_to_docbook_xsl} ${input_file} | tail -n +2 >> ${output_file} diff --git a/docs/api/meson.build b/docs/api/meson.build new file mode 100644 index 000000000..c46940a63 --- /dev/null +++ b/docs/api/meson.build @@ -0,0 +1,54 @@ +subdir('dbus') + +version_xml_config_data = configuration_data() +version_xml_config_data.set('VERSION', meson.project_version()) +version_xml = configure_file( + input: 'version.xml.in', + output: 'version.xml', + configuration: version_xml_config_data, +) + +gnome.gtkdoc( + 'PackageKit', + main_sgml: 'PackageKit-docs.sgml', + src_dir: packagekit_glib2_src_include, + include_directories: packagekit_glib2_includes, + ignore_headers: [ + 'config.h', + 'pk-marshal.h', + 'pk-common-private.h', + 'pk-debug.h', + 'pk-offline-private.h', + 'pk-spawn-polkit-agent.h', + ], + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + html_assets: [ + 'spec/pk-structure.png', + 'spec/pk-structure.svg', + 'spec/pk-transactions.svg', + 'spec/pk-transactions-set-locale.png', + 'spec/pk-transactions-repair-required.png', + 'spec/pk-transactions-failure.png', + 'spec/pk-transactions-download.png', + 'spec/pk-transactions-sig-install.png', + 'spec/pk-transactions-success.png', + 'spec/pk-transactions-auto-untrusted.png', + 'spec/pk-transactions-trusted.png', + ], + content_files: [ + version_xml, + 'spec/pk-backend-compiled.xml', + 'spec/pk-backend-spawn.xml', + 'spec/pk-concepts.xml', + 'spec/pk-introduction.xml', + packagekit_ref_xml, + packagekit_transaction_ref_xml, + ], + install: true, +) diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 000000000..1a1d9bfe1 --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,3 @@ +if get_option('gtk_doc') + subdir('api') +endif diff --git a/etc/Makefile.am b/etc/Makefile.am deleted file mode 100644 index e00169422..000000000 --- a/etc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -confdir = $(sysconfdir)/PackageKit -conf_DATA = PackageKit.conf Vendor.conf - -EXTRA_DIST = \ - $(conf_DATA) \ - $(eventspostrans_DATA) - --include $(top_srcdir)/git.mk diff --git a/etc/meson.build b/etc/meson.build new file mode 100644 index 000000000..d3687f820 --- /dev/null +++ b/etc/meson.build @@ -0,0 +1,5 @@ +install_data( + 'PackageKit.conf', + 'Vendor.conf', + install_dir: join_paths(get_option('sysconfdir'), 'PackageKit') +) diff --git a/git.mk b/git.mk deleted file mode 100644 index abd6c0a28..000000000 --- a/git.mk +++ /dev/null @@ -1,200 +0,0 @@ -# git.mk -# -# Copyright 2009, Red Hat, Inc. -# Written by Behdad Esfahbod -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. -# -# The canonical source for this file is pango/git.mk, or whereever the -# header of pango/git.mk suggests in the future. -# -# To use in your project, import this file in your git repo's toplevel, -# then do "make -f git.mk". This modifies all Makefile.am files in -# your project to include git.mk. -# -# This enables automatic .gitignore generation. If you need to ignore -# more files, add them to the GITIGNOREFILES variable in your Makefile.am. -# But think twice before doing that. If a file has to be in .gitignore, -# chances are very high that it's a generated file and should be in one -# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES. -# -# The only case that you need to manually add a file to GITIGNOREFILES is -# when remove files in one of mostlyclean-local, clean-local, distclean-local, -# or maintainer-clean-local. -# -# Note that for files like editor backup, etc, there are better places to -# ignore them. See "man gitignore". -# -# If "make maintainer-clean" removes the files but they are not recognized -# by this script (that is, if "git status" shows untracked files still), send -# me the output of "git status" as well as your Makefile.am and Makefile for -# the directories involved. -# -# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see -# pango/Makefile.am. -# -# Don't EXTRA_DIST this file. It is supposed to only live in git clones, -# not tarballs. It serves no useful purpose in tarballs and clutters the -# build dir. -# -# This file knows how to handle autoconf, automake, libtool, gtk-doc, -# gnome-doc-utils, mallard, intltool, gsettings. -# -# -# KNOWN ISSUES: -# -# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the -# submodule doesn't find us. If you have configure.{in,ac} files in -# subdirs, add a proxy git.mk file in those dirs that simply does: -# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste. -# And add those files to git. See vte/gnome-pty-helper/git.mk for -# example. -# -# ChangeLog -# -# - 2010-12-06 Add support for Mallard docs -# - 2010-12-06 Start this change log - -git-all: git-mk-install - -git-mk-install: - @echo Installing git makefile - @any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \ - if grep 'include .*/git.mk' $$x >/dev/null; then \ - echo $$x already includes git.mk; \ - else \ - failed=; \ - echo "Updating $$x"; \ - { cat $$x; \ - echo ''; \ - echo '-include $$(top_srcdir)/git.mk'; \ - } > $$x.tmp || failed=1; \ - if test x$$failed = x; then \ - mv $$x.tmp $$x || failed=1; \ - fi; \ - if test x$$failed = x; then : else \ - echo Failed updating $$x; >&2 \ - any_failed=1; \ - fi; \ - fi; done; test -z "$$any_failed" - -.PHONY: git-all git-mk-install - - -### .gitignore generation - -$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk - $(AM_V_GEN) \ - { \ - if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \ - for x in \ - $(DOC_MODULE)-decl-list.txt \ - $(DOC_MODULE)-decl.txt \ - tmpl/$(DOC_MODULE)-unused.sgml \ - "tmpl/*.bak" \ - xml html \ - ; do echo /$$x; done; \ - fi; \ - if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \ - for x in \ - $(_DOC_C_DOCS) \ - $(_DOC_LC_DOCS) \ - $(_DOC_OMF_ALL) \ - $(_DOC_DSK_ALL) \ - $(_DOC_HTML_ALL) \ - $(_DOC_MOFILES) \ - $(_DOC_POFILES) \ - $(DOC_H_FILE) \ - "*/.xml2po.mo" \ - "*/*.omf.out" \ - ; do echo /$$x; done; \ - fi; \ - if test "x$(gsettings_SCHEMAS)" = x; then :; else \ - for x in \ - $(gsettings_SCHEMAS:.xml=.valid) \ - $(gsettings__enum_file) \ - ; do echo /$$x; done; \ - fi; \ - if test -f $(srcdir)/po/Makefile.in.in; then \ - for x in \ - po/Makefile.in.in \ - po/Makefile.in \ - po/Makefile \ - po/POTFILES \ - po/stamp-it \ - po/.intltool-merge-cache \ - "po/*.gmo" \ - "po/*.mo" \ - po/$(GETTEXT_PACKAGE).pot \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - ; do echo /$$x; done; \ - fi; \ - if test -f $(srcdir)/configure; then \ - for x in \ - autom4te.cache \ - configure \ - config.h \ - stamp-h1 \ - libtool \ - config.lt \ - ; do echo /$$x; done; \ - fi; \ - for x in \ - .gitignore \ - $(GITIGNOREFILES) \ - $(CLEANFILES) \ - $(PROGRAMS) \ - $(check_PROGRAMS) \ - $(EXTRA_PROGRAMS) \ - $(LTLIBRARIES) \ - so_locations \ - .libs _libs \ - $(MOSTLYCLEANFILES) \ - "*.$(OBJEXT)" \ - "*.lo" \ - $(DISTCLEANFILES) \ - $(am__CONFIG_DISTCLEAN_FILES) \ - $(CONFIG_CLEAN_FILES) \ - TAGS ID GTAGS GRTAGS GSYMS GPATH tags \ - "*.tab.c" \ - $(MAINTAINERCLEANFILES) \ - $(BUILT_SOURCES) \ - $(DEPDIR) \ - Makefile \ - Makefile.in \ - "*.orig" \ - "*.rej" \ - "*.bak" \ - "*~" \ - ".*.sw[nop]" \ - ".dirstamp" \ - ; do echo /$$x; done; \ - } | \ - sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \ - sed 's@/[.]/@/@g' | \ - LC_ALL=C sort | uniq > $@.tmp && \ - mv $@.tmp $@; - -all: $(srcdir)/.gitignore gitignore-recurse-maybe -gitignore-recurse-maybe: - @if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \ - $(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \ - fi; -gitignore-recurse: - @for subdir in $(DIST_SUBDIRS); do \ - case " $(SUBDIRS) " in \ - *" $$subdir "*) :;; \ - *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \ - esac; \ - done -gitignore: $(srcdir)/.gitignore gitignore-recurse - -maintainer-clean: gitignore-clean -gitignore-clean: - -rm -f $(srcdir)/.gitignore - -.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index 53a814aaf..000000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = python packagekit-glib2 - --include $(top_srcdir)/git.mk diff --git a/lib/meson.build b/lib/meson.build new file mode 100644 index 000000000..f15e9e638 --- /dev/null +++ b/lib/meson.build @@ -0,0 +1,2 @@ +subdir('packagekit-glib2') +subdir('python') diff --git a/lib/packagekit-glib2/Makefile.am b/lib/packagekit-glib2/Makefile.am deleted file mode 100644 index 2fe94bd7a..000000000 --- a/lib/packagekit-glib2/Makefile.am +++ /dev/null @@ -1,298 +0,0 @@ -if HAVE_INTROSPECTION --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) -endif - -AM_CPPFLAGS = \ - $(GLIB_CFLAGS) \ - $(GIO_CFLAGS) \ - $(POLKIT_CFLAGS) \ - $(SQLITE_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/lib \ - -I$(top_builddir)/lib \ - -I. \ - -DPK_COMPILATION \ - -DPK_DB_DIR=\""$(PK_DB_DIR)"\" \ - -DG_LOG_DOMAIN=\"PackageKit\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DTESTDATADIR=\""$(abs_top_srcdir)/data/tests"\" \ - -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ - -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = \ - packagekit-glib2.pc - -lib_LTLIBRARIES = \ - libpackagekit-glib2.la - -libpackagekit_glib2_includedir = $(includedir)/PackageKit/packagekit-glib2 - -HEADER_FILES = \ - packagekit.h \ - pk-bitfield.h \ - pk-category.h \ - pk-client.h \ - pk-client-helper.h \ - pk-client-sync.h \ - pk-common.h \ - pk-control.h \ - pk-control-sync.h \ - pk-desktop.h \ - pk-details.h \ - pk-distro-upgrade.h \ - pk-enum.h \ - pk-error.h \ - pk-eula-required.h \ - pk-files.h \ - pk-media-change-required.h \ - pk-item-progress.h \ - pk-offline.h \ - pk-package.h \ - pk-package-id.h \ - pk-package-ids.h \ - pk-package-sack.h \ - pk-package-sack-sync.h \ - pk-progress.h \ - pk-repo-detail.h \ - pk-repo-signature-required.h \ - pk-require-restart.h \ - pk-results.h \ - pk-source.h \ - pk-task.h \ - pk-task-sync.h \ - pk-transaction-past.h \ - pk-transaction-list.h \ - pk-update-detail.h \ - pk-version.h - -libpackagekit_glib2_include_HEADERS = \ - $(HEADER_FILES) \ - pk-enum-types.h - -libpackagekit_glib2_la_SOURCES = \ - packagekit.h \ - pk-bitfield.c \ - pk-bitfield.h \ - pk-category.c \ - pk-category.h \ - pk-client.c \ - pk-client.h \ - pk-client-helper.c \ - pk-client-helper.h \ - pk-client-sync.c \ - pk-client-sync.h \ - pk-common.c \ - pk-common.h \ - pk-control.c \ - pk-control.h \ - pk-control-sync.c \ - pk-control-sync.h \ - pk-debug.c \ - pk-debug.h \ - pk-desktop.c \ - pk-desktop.h \ - pk-details.c \ - pk-details.h \ - pk-distro-upgrade.c \ - pk-distro-upgrade.h \ - pk-enum.c \ - pk-enum.h \ - pk-enum-types.c \ - pk-enum-types.h \ - pk-error.c \ - pk-error.h \ - pk-eula-required.c \ - pk-eula-required.h \ - pk-files.c \ - pk-files.h \ - pk-media-change-required.c \ - pk-media-change-required.h \ - pk-item-progress.c \ - pk-item-progress.h \ - pk-offline.c \ - pk-offline.h \ - pk-offline-private.c \ - pk-offline-private.h \ - pk-package.c \ - pk-package.h \ - pk-package-id.c \ - pk-package-id.h \ - pk-package-ids.c \ - pk-package-ids.h \ - pk-package-sack.c \ - pk-package-sack.h \ - pk-package-sack-sync.c \ - pk-package-sack-sync.h \ - pk-progress.c \ - pk-progress.h \ - pk-repo-detail.c \ - pk-repo-detail.h \ - pk-repo-signature-required.c \ - pk-repo-signature-required.h \ - pk-require-restart.c \ - pk-require-restart.h \ - pk-results.c \ - pk-results.h \ - pk-source.c \ - pk-source.h \ - pk-task.c \ - pk-task.h \ - pk-task-sync.c \ - pk-task-sync.h \ - pk-transaction-past.c \ - pk-transaction-past.h \ - pk-transaction-list.c \ - pk-transaction-list.h \ - pk-update-detail.c \ - pk-update-detail.h \ - pk-spawn-polkit-agent.c \ - pk-spawn-polkit-agent.h \ - pk-version.h - -libpackagekit_glib2_la_LIBADD = \ - $(GLIB_LIBS) \ - $(GIO_LIBS) \ - $(ARCHIVE_LIBS) \ - $(SQLITE_LIBS) - -libpackagekit_glib2_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -export-dynamic \ - -no-undefined \ - -export-symbols-regex '^pk_.*' - -libpackagekit_glib2_la_CFLAGS = \ - $(PIE_CFLAGS) \ - $(WARNINGFLAGS_C) - -noinst_LIBRARIES = libpackagekitprivate.a -libpackagekitprivate_a_SOURCES = \ - packagekit-private.h \ - pk-common-private.h \ - pk-console-shared.c \ - pk-console-shared.h \ - pk-progress-bar.c \ - pk-progress-bar.h \ - pk-task-text.c \ - pk-task-text.h \ - pk-task-wrapper.c \ - pk-task-wrapper.h \ - pk-spawn-polkit-agent.h - -libpackagekitprivate_a_CFLAGS = \ - $(PIE_CFLAGS) \ - $(WARNINGFLAGS_C) - -noinst_PROGRAMS = pk-socket-example -pk_socket_example_SOURCES = pk-socket-example.c -pk_socket_example_LDADD = $(GIO_LIBS) $(GLIB_LIBS) -pk_socket_example_CFLAGS = $(WARNINGFLAGS_C) - -check_PROGRAMS = \ - pk-test-daemon \ - pk-test-private - -pk_test_private_SOURCES = \ - $(libpackagekit_glib2_la_SOURCES) \ - pk-test-private.c - -pk_test_private_LDADD = \ - libpackagekitprivate.a \ - $(GLIB_LIBS) \ - $(SELFTEST_LIBS) \ - $(POLKIT_LIBS) \ - $(SQLITE_LIBS) \ - $(ARCHIVE_LIBS) - -pk_test_private_CFLAGS = \ - -DPK_OFFLINE_DESTDIR=\"/tmp/PackageKit-self-test\" \ - $(AM_CFLAGS) \ - $(WARNINGFLAGS_C) - -pk_test_daemon_SOURCES = \ - $(libpackagekit_glib2_la_SOURCES) \ - pk-test-daemon.c - -pk_test_daemon_LDADD = \ - libpackagekitprivate.a \ - $(GLIB_LIBS) \ - $(SELFTEST_LIBS) \ - $(POLKIT_LIBS) \ - $(SQLITE_LIBS) \ - $(ARCHIVE_LIBS) - -pk_test_daemon_CFLAGS = \ - $(AM_CFLAGS) \ - $(WARNINGFLAGS_C) - -TESTS = $(check_PROGRAMS) - -EXTRA_DIST = \ - packagekit-glib2.pc.in \ - pk-version.h.in \ - pk-enum-types.h.template \ - pk-enum-types.c.template \ - PackageKitGlib-1.0.metadata - -BUILT_SOURCES = \ - pk-enum-types.h \ - pk-enum-types.c - -pk-enum-types.h: pk-enum-types.h.template $(HEADER_FILES) - $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@ - -pk-enum-types.c: pk-enum-types.c.template $(HEADER_FILES) - $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@ - -CLEANFILES = $(BUILT_SOURCES) *.a *.servicepack - -if HAVE_INTROSPECTION -introspection_sources = $(libpackagekit_glib2_la_SOURCES) - -PackageKitGlib-1.0.gir: libpackagekit-glib2.la -PackageKitGlib_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 -PackageKitGlib_1_0_gir_CFLAGS = $(AM_CPPFLAGS) -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE -PackageKitGlib_1_0_gir_SCANNERFLAGS = --identifier-prefix=Pk \ - --symbol-prefix=pk \ - --warn-all \ - --add-include-path=$(srcdir) \ - --c-include="packagekit-glib2/packagekit.h" -PackageKitGlib_1_0_gir_EXPORT_PACKAGES = packagekit-glib2 -PackageKitGlib_1_0_gir_LIBS = libpackagekit-glib2.la -PackageKitGlib_1_0_gir_FILES = $(introspection_sources) -INTROSPECTION_GIRS += PackageKitGlib-1.0.gir - -girdir = $(datadir)/gir-1.0 -gir_DATA = $(INTROSPECTION_GIRS) - -typelibdir = $(libdir)/girepository-1.0 -typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) - -if ENABLE_VAPIGEN -include $(VAPIGEN_MAKEFILE) - -packagekit-glib2.vapi: PackageKitGlib-1.0.gir PackageKitGlib-1.0.metadata - -VAPIGEN_VAPIS = packagekit-glib2.vapi - -packagekit_glib2_vapi_DEPS = gio-2.0 -packagekit_glib2_vapi_METADATADIRS = $(srcdir) -packagekit_glib2_vapi_FILES = PackageKitGlib-1.0.gir - -vapidir = $(datadir)/vala/vapi -vapi_DATA = $(VAPIGEN_VAPIS) -endif - -CLEANFILES += $(gir_DATA) $(typelib_DATA) $(VAPIGEN_VAPIS) -endif - -clean-local: - rm -f *~ - rm -f $(CLEANFILES) - - --include $(top_srcdir)/git.mk diff --git a/lib/packagekit-glib2/meson.build b/lib/packagekit-glib2/meson.build new file mode 100644 index 000000000..19ab550cd --- /dev/null +++ b/lib/packagekit-glib2/meson.build @@ -0,0 +1,294 @@ +packagekit_glib2_src_include = include_directories('.') +packagekit_glib2_includes = include_directories('.', '..') +packagekit_glib2_headers = files( + 'packagekit.h', + 'pk-bitfield.h', + 'pk-category.h', + 'pk-client.h', + 'pk-client-helper.h', + 'pk-client-sync.h', + 'pk-common.h', + 'pk-control.h', + 'pk-control-sync.h', + 'pk-desktop.h', + 'pk-details.h', + 'pk-distro-upgrade.h', + 'pk-enum.h', + 'pk-error.h', + 'pk-eula-required.h', + 'pk-files.h', + 'pk-media-change-required.h', + 'pk-item-progress.h', + 'pk-offline.h', + 'pk-package.h', + 'pk-package-id.h', + 'pk-package-ids.h', + 'pk-package-sack.h', + 'pk-package-sack-sync.h', + 'pk-progress.h', + 'pk-repo-detail.h', + 'pk-repo-signature-required.h', + 'pk-require-restart.h', + 'pk-results.h', + 'pk-source.h', + 'pk-task.h', + 'pk-task-sync.h', + 'pk-transaction-past.h', + 'pk-transaction-list.h', + 'pk-update-detail.h', +) + +install_headers(packagekit_glib2_headers, subdir : join_paths('PackageKit', 'packagekit-glib2')) + +version_parts = meson.project_version().split('.') +version_configuration = configuration_data() +version_configuration.set('PK_MAJOR_VERSION', version_parts[0]) +version_configuration.set('PK_MINOR_VERSION', version_parts[1]) +version_configuration.set('PK_MICRO_VERSION', version_parts[2]) + +pk_version_header = configure_file( + input: 'pk-version.h.in', + output: 'pk-version.h', + configuration: version_configuration, +) + +packagekit_glib2_sources = files( + 'pk-bitfield.c', + 'pk-category.c', + 'pk-client.c', + 'pk-client-helper.c', + 'pk-client-sync.c', + 'pk-common.c', + 'pk-control.c', + 'pk-control-sync.c', + 'pk-debug.c', + 'pk-debug.h', + 'pk-desktop.c', + 'pk-details.c', + 'pk-distro-upgrade.c', + 'pk-enum.c', + 'pk-error.c', + 'pk-eula-required.c', + 'pk-files.c', + 'pk-media-change-required.c', + 'pk-item-progress.c', + 'pk-offline.c', + 'pk-offline-private.c', + 'pk-offline-private.h', + 'pk-package.c', + 'pk-package-id.c', + 'pk-package-ids.c', + 'pk-package-sack.c', + 'pk-package-sack-sync.c', + 'pk-progress.c', + 'pk-repo-detail.c', + 'pk-repo-signature-required.c', + 'pk-require-restart.c', + 'pk-results.c', + 'pk-source.c', + 'pk-task.c', + 'pk-task-sync.c', + 'pk-transaction-past.c', + 'pk-transaction-list.c', + 'pk-update-detail.c', + 'pk-spawn-polkit-agent.c', + 'pk-spawn-polkit-agent.h', +) + +pk_enum_type = gnome.mkenums( + 'pk-enum-types', + c_template: 'pk-enum-types.c.template', + h_template: 'pk-enum-types.h.template', + sources: packagekit_glib2_headers, + install_header: true, + install_dir: join_paths(get_option('includedir'), 'PackageKit', 'packagekit-glib2') +) + +packagekitprivate_sources = files( + 'packagekit-private.h', + 'pk-common-private.h', + 'pk-console-shared.c', + 'pk-console-shared.h', + 'pk-progress-bar.c', + 'pk-progress-bar.h', + 'pk-task-text.c', + 'pk-task-text.h', + 'pk-task-wrapper.c', + 'pk-task-wrapper.h', + 'pk-spawn-polkit-agent.h', +) + +packagekitprivate_library = static_library( + 'packagekitprivate', + packagekitprivate_sources, + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + include_directories: packagekit_glib2_includes, + c_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit"', + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + '-DPACKAGE_DATA_DIR="@0@"'.format(package_data_dir), + '-DTESTDATADIR="@0@"'.format(test_data_dir), + '-DPK_DB_DIR="@0@"'.format(pk_db_dir), + '-DLOCALSTATEDIR="@0@"'.format(local_state_dir), + ], +) + +packagekit_glib2_library = shared_library( + 'packagekit-glib2', + pk_enum_type, + pk_version_header, + packagekit_glib2_sources, + link_whole: packagekitprivate_library, + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + include_directories: packagekit_glib2_includes, + version: '18.1.3', + c_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit"', + '-DPACKAGE_LOCALE_DIR="@0@"'.format (package_locale_dir), + '-DPACKAGE_DATA_DIR="@0@"'.format (package_data_dir), + '-DTESTDATADIR="@0@"'.format(test_data_dir), + '-DPK_DB_DIR="@0@"'.format(pk_db_dir), + '-DLOCALSTATEDIR="@0@"'.format(local_state_dir), + ], + install: true, +) + +packagekit_glib2_dep = declare_dependency( + link_with: packagekit_glib2_library, + include_directories: packagekit_glib2_includes, + sources: [ + packagekit_glib2_headers, + pk_enum_type[1], + ], + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], +) + +if get_option('gobject_introspection') + packagekit_glib2_gir = gnome.generate_gir( + packagekit_glib2_library, + sources: packagekit_glib2_sources, + namespace: 'PackageKitGlib', + nsversion: '1.0', + include_directories: packagekit_glib2_includes, + includes: ['GObject-2.0', 'Gio-2.0', 'GLib-2.0'], + header: 'packagekit-glib2/packagekit.h', + identifier_prefix: 'Pk', + symbol_prefix: 'pk', + extra_args: [ + '-DPK_COMPILATION=1', + '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE', + ], + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + install: true + ) + + gnome.generate_vapi( + 'packagekit-glib2', + packages: ['glib-2.0', 'gio-2.0', 'gobject-2.0'], + sources: packagekit_glib2_gir[0], + install: true + ) +endif + +pkg.generate( + packagekit_glib2_library, + filebase: 'packagekit-glib2', + name: 'packagekit-glib2', + description: 'PackageKit is a system daemon for installing stuff.', + version: meson.project_version(), + requires: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + ], + subdirs: 'PackageKit' +) + +executable( + 'pk-socket-example', + 'pk-socket-example.c', + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + ], + build_by_default: true, + install: false, +) + +pk_test_private = executable( + 'pk-test-private', + 'pk-test-private.c', + pk_enum_type, + packagekitprivate_sources, + packagekit_glib2_sources, + include_directories: packagekit_glib2_includes, + dependencies: [ + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + c_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit"', + '-DPK_OFFLINE_DESTDIR="/tmp/PackageKit-self-test"', + '-DTESTDATADIR="@0@"'.format(test_data_dir), + ], + build_by_default: true, + install: false, +) + +pk_test_daemon = executable( + 'pk-test-daemon', + 'pk-test-daemon.c', + dependencies: [ + packagekit_glib2_dep, + glib_dep, + gobject_dep, + gio_dep, + gio_unix_dep, + config_dep, + ], + c_args: [ + '-DPK_COMPILATION=1', + '-DG_LOG_DOMAIN="PackageKit"', + '-DTESTDATADIR="@0@"'.format(test_data_dir), + ], + build_by_default: true, + install: false, +) + +test( + 'pk-test-private', + pk_test_private +) diff --git a/lib/packagekit-glib2/packagekit-glib2.pc.in b/lib/packagekit-glib2/packagekit-glib2.pc.in deleted file mode 100644 index 11f3903a7..000000000 --- a/lib/packagekit-glib2/packagekit-glib2.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: packagekit-glib2 -Description: PackageKit is a system daemon for installing stuff. -Version: @VERSION@ -Requires.private: gthread-2.0 -Requires: glib-2.0, gobject-2.0, sqlite3 -Libs: -L${libdir} -lpackagekit-glib2 -Cflags: -I${includedir}/PackageKit diff --git a/lib/packagekit-glib2/pk-debug.c b/lib/packagekit-glib2/pk-debug.c index 0d75b7a82..688eca10b 100644 --- a/lib/packagekit-glib2/pk-debug.c +++ b/lib/packagekit-glib2/pk-debug.c @@ -81,8 +81,6 @@ pk_debug_handler_cb (const gchar *log_domain, GLogLevelFlags log_level, { gchar str_time[255]; time_t the_time; - guint len; - guint i; static GMutex mutex; /* lock */ @@ -112,9 +110,11 @@ pk_debug_handler_cb (const gchar *log_domain, GLogLevelFlags log_level, g_print ("%c[%dm%s%c[%dm", 0x1B, CONSOLE_CYAN, log_domain, 0x1B, CONSOLE_RESET); /* pad with spaces */ - len = strlen (log_domain); - for (i=len; i<PK_DEBUG_LOG_DOMAIN_LENGTH; i++) - g_print (" "); + if (log_domain != NULL) { + guint len = strlen (log_domain); + for (guint i = len; i < PK_DEBUG_LOG_DOMAIN_LENGTH; i++) + g_print (" "); + } /* critical is also in red */ if (log_level == G_LOG_LEVEL_CRITICAL || diff --git a/lib/python/Makefile.am b/lib/python/Makefile.am deleted file mode 100644 index 285f04b72..000000000 --- a/lib/python/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -SUBDIRS = packagekit -EXTRA_DIST = enum-convertor.py - --include $(top_srcdir)/git.mk diff --git a/lib/python/meson.build b/lib/python/meson.build new file mode 100644 index 000000000..df51630f8 --- /dev/null +++ b/lib/python/meson.build @@ -0,0 +1,12 @@ +python = import('python') +python_exec = python.find_installation() + +enum_convertor = files('enum-convertor.py') + +python_package_dir = get_option('pythonpackagedir') +if python_package_dir == '' + python_package_dir = python_exec.get_install_dir() +endif +python_package_dir = join_paths(python_package_dir, 'packagekit') + +subdir('packagekit') diff --git a/lib/python/packagekit/Makefile.am b/lib/python/packagekit/Makefile.am deleted file mode 100644 index a589cde17..000000000 --- a/lib/python/packagekit/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -BUILT_SOURCES = enums.py - -enums.py: $(top_srcdir)/lib/python/enum-convertor.py $(top_srcdir)/lib/packagekit-glib2/pk-enum.c - $(PYTHON) $(top_srcdir)/lib/python/enum-convertor.py $(top_srcdir)/lib/packagekit-glib2/pk-enum.c > enums.py - -if HAVE_PYTHON_BACKEND -packagekitpythondir = ${PYTHON_PACKAGE_DIR} -packagekitpython_PYTHON = \ - __init__.py \ - backend.py \ - enums.py \ - progress.py \ - package.py \ - filter.py \ - misc.py -endif - -MAINTAINERCLEANFILES = \ - *.pyc - -clean-local : - rm -f *.pyc - rm -f *~ - --include $(top_srcdir)/git.mk diff --git a/lib/python/packagekit/meson.build b/lib/python/packagekit/meson.build new file mode 100644 index 000000000..2300aa9cf --- /dev/null +++ b/lib/python/packagekit/meson.build @@ -0,0 +1,44 @@ +packagekit_py_sources = [ + '__init__.py', + 'backend.py', + 'progress.py', + 'package.py', + 'filter.py', + 'misc.py', +] + +if get_option('python_backend') +enums_py = custom_target( + 'enums.py', + input: join_paths(meson.source_root(), 'lib', 'packagekit-glib2', 'pk-enum.c'), + output: 'enums.py', + command: [ + python_exec, + enum_convertor, + '@INPUT@', + ], + capture: true, + install: true, + install_dir: python_package_dir, +) +endif + +if get_option('python_backend') +install_data( + packagekit_py_sources, + install_dir: python_package_dir, + install: true, +) +endif + +packagekit_test_py = custom_target( + 'packagekit.py', + input: packagekit_py_sources, + output: packagekit_py_sources, + command: [ + 'cp', + '@INPUT@', + '@OUTDIR@', + ], + install: false, +) diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index a73614a2e..000000000 --- a/m4/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -gtk-doc.m4 -intltool.m4 -libtool.m4 -ltoptions.m4 -ltsugar.m4 -ltversion.m4 -lt~obsolete.m4 diff --git a/m4/as-linguas.m4 b/m4/as-linguas.m4 deleted file mode 100644 index 92b28f717..000000000 --- a/m4/as-linguas.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# Set ALL_ALL_LINGUAS based on the .po files present. Optional argument is the -# name of the po directory. $podir/LINGUAS.ignore can be used to ignore a -# subset of the po files. - -AC_DEFUN([AS_ALL_LINGUAS], -[ - AC_MSG_CHECKING([for linguas]) - podir="m4_default([$1],[$srcdir/po])" - linguas=`cd $podir && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $[]1 }'` - if test -f "$podir/LINGUAS.ignore"; then - ALL_LINGUAS=""; - ignore_linguas=`sed -n -e 's/^\s\+\|\s\+$//g' -e '/^#/b' -e '/\S/!b' \ - -e 's/\s\+/\n/g' -e p "$podir/LINGUAS.ignore"`; - for lang in $linguas; do - if ! echo "$ignore_linguas" | grep -q "^${lang}$"; then - ALL_LINGUAS="$ALL_LINGUAS $lang"; - fi; - done; - else - ALL_LINGUAS="$linguas"; - fi; - AC_SUBST([ALL_LINGUAS]) - AC_MSG_RESULT($ALL_LINGUAS) -]) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 deleted file mode 100644 index c3a8d695a..000000000 --- a/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,72 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> -# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 2 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 deleted file mode 100644 index e2d0d363e..000000000 --- a/m4/ax_check_link_flag.m4 +++ /dev/null @@ -1,71 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the linker or gives an error. -# (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> -# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 2 - -AC_DEFUN([AX_CHECK_LINK_FLAG], -[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $4 $1" - AC_LINK_IFELSE([AC_LANG_PROGRAM()], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - LDFLAGS=$ax_check_save_flags]) -AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_LINK_FLAGS diff --git a/m4/introspection.m4 b/m4/introspection.m4 deleted file mode 100644 index d89c3d907..000000000 --- a/m4/introspection.m4 +++ /dev/null @@ -1,96 +0,0 @@ -dnl -*- mode: autoconf -*- -dnl Copyright 2009 Johan Dahlin -dnl -dnl This file is free software; the author(s) gives unlimited -dnl permission to copy and/or distribute it, with or without -dnl modifications, as long as this notice is preserved. -dnl - -# serial 1 - -m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], -[ - AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([LT_INIT],[$0])dnl setup libtool first - - dnl enable/disable introspection - m4_if([$2], [require], - [dnl - enable_introspection=yes - ],[dnl - AC_ARG_ENABLE(introspection, - AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], - [Enable introspection for this build]),, - [enable_introspection=auto]) - ])dnl - - AC_MSG_CHECKING([for gobject-introspection]) - - dnl presence/version checking - AS_CASE([$enable_introspection], - [no], [dnl - found_introspection="no (disabled, use --enable-introspection to enable)" - ],dnl - [yes],[dnl - PKG_CHECK_EXISTS([gobject-introspection-1.0],, - AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) - PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], - found_introspection=yes, - AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) - ],dnl - [auto],[dnl - PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) - dnl Canonicalize enable_introspection - enable_introspection=$found_introspection - ],dnl - [dnl - AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) - ])dnl - - AC_MSG_RESULT([$found_introspection]) - - INTROSPECTION_SCANNER= - INTROSPECTION_COMPILER= - INTROSPECTION_GENERATE= - INTROSPECTION_GIRDIR= - INTROSPECTION_TYPELIBDIR= - if test "x$found_introspection" = "xyes"; then - INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` - INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` - INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` - INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` - INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" - INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` - INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` - INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection - fi - AC_SUBST(INTROSPECTION_SCANNER) - AC_SUBST(INTROSPECTION_COMPILER) - AC_SUBST(INTROSPECTION_GENERATE) - AC_SUBST(INTROSPECTION_GIRDIR) - AC_SUBST(INTROSPECTION_TYPELIBDIR) - AC_SUBST(INTROSPECTION_CFLAGS) - AC_SUBST(INTROSPECTION_LIBS) - AC_SUBST(INTROSPECTION_MAKEFILE) - - AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") -]) - - -dnl Usage: -dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) - -AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], -[ - _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) -]) - -dnl Usage: -dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) - - -AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], -[ - _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) -]) diff --git a/m4/vapigen.m4 b/m4/vapigen.m4 deleted file mode 100644 index 2c435e74b..000000000 --- a/m4/vapigen.m4 +++ /dev/null @@ -1,101 +0,0 @@ -dnl vapigen.m4 -dnl -dnl Copyright 2012 Evan Nemerson -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND_INTROSPECTION], [DEFAULT]) -# -------------------------------------- -# Check vapigen existence and version -# -# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation -AC_DEFUN([VAPIGEN_CHECK], -[ - AS_IF([test "x$3" != "xyes"], [ - m4_provide_if([GOBJECT_INTROSPECTION_CHECK], [], [ - m4_provide_if([GOBJECT_INTROSPECTION_REQUIRE], [], [ - AC_MSG_ERROR([[You must call GOBJECT_INTROSPECTION_CHECK or GOBJECT_INTROSPECTION_REQUIRE before using VAPIGEN_CHECK unless using the FOUND_INTROSPECTION argument is "yes"]]) - ]) - ]) - ]) - - AC_ARG_ENABLE([vala], - [AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[ - AS_IF([test "x$4" = "x"], [ - enable_vala=auto - ], [ - enable_vala=$4 - ]) - ]) - - AS_CASE([$enable_vala], [no], [enable_vala=no], - [yes], [ - AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [ - AC_MSG_ERROR([Vala bindings require GObject Introspection]) - ]) - ], [auto], [ - AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [ - enable_vala=no - ]) - ], [ - AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@]) - ]) - - AS_IF([test "x$2" = "x"], [ - vapigen_pkg_name=vapigen - ], [ - vapigen_pkg_name=vapigen-$2 - ]) - AS_IF([test "x$1" = "x"], [ - vapigen_pkg="$vapigen_pkg_name" - ], [ - vapigen_pkg="$vapigen_pkg_name >= $1" - ]) - - PKG_PROG_PKG_CONFIG - - PKG_CHECK_EXISTS([$vapigen_pkg], [ - AS_IF([test "$enable_vala" = "auto"], [ - enable_vala=yes - ]) - ], [ - AS_CASE([$enable_vala], [yes], [ - AC_MSG_ERROR([$vapigen_pkg not found]) - ], [auto], [ - enable_vala=no - ]) - ]) - - AC_MSG_CHECKING([for vapigen]) - - AS_CASE([$enable_vala], - [yes], [ - VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name` - VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen - AS_IF([test "x$2" = "x"], [ - VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name` - ], [ - VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name` - ]) - ]) - - AC_MSG_RESULT([$enable_vala]) - - AC_SUBST([VAPIGEN]) - AC_SUBST([VAPIGEN_VAPIDIR]) - AC_SUBST([VAPIGEN_MAKEFILE]) - - AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes") -]) diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..fba47d9eb --- /dev/null +++ b/meson.build @@ -0,0 +1,142 @@ +project('PackageKit', 'c', + version : '1.2.0', + license : 'LGPL-2.1+', + meson_version : '>=0.47.0', + default_options : ['warning_level=2', 'c_std=c99'], +) + +gnome = import('gnome') +i18n = import('i18n') +pkg = import('pkgconfig') + +glib_dep = dependency('glib-2.0', version: '>=2.54.0') +gobject_dep = dependency('gobject-2.0') +gio_dep = dependency('gio-2.0') +gio_unix_dep = dependency('gio-unix-2.0', version: '>=2.16.1') +gmodule_dep = dependency('gmodule-2.0', version: '>=2.16.1') +sqlite3_dep = dependency('sqlite3') +polkit_dep = dependency('polkit-gobject-1', version: '>=0.98') +if polkit_dep.version().version_compare('>=0.114') + add_project_arguments ('-DHAVE_POLKIT_0_114=1', language: 'c') +endif + +libsystemd = [] +if get_option('systemd') + libsystemd = dependency('libsystemd', version: '>=213') + systemd_system_unit_dir = get_option('systemdsystemunitdir') + if systemd_system_unit_dir == '' + systemd = dependency('systemd') + systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir') + endif + + add_project_arguments ('-DHAVE_SYSTEMD_SD_LOGIN_H=1', language: 'c') +else + if get_option('offline_update') + error('Offline updates requires Systemd, use -Dsystemd=true to enable it or -Doffline_update=false to disable offline updates') + endif +endif + +elogind = [] +if get_option('elogind') + elogind = dependency('elogind', version: '>=229.4') + add_project_arguments ('-DHAVE_SYSTEMD_SD_LOGIN_H=1', language: 'c') +endif + +if get_option('local_checkout') + add_project_arguments ('-DPK_BUILD_LOCAL=1', language: 'c') +endif + +if get_option('daemon_tests') + add_project_arguments ('-DPK_ENABLE_DAEMON_TESTS=1', language: 'c') +endif + +if dependency('ply-boot-client', version: '>=0.9.5', required: false).found() + add_project_arguments ('-DPLYMOUTH_0_9_5=1', language: 'c') +endif + +# Avoid g_simple_async_result deprecation warnings in glib 2.46+ +add_project_arguments ('-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44', language: 'c') + +# allow the daemon to include library files directly +add_project_arguments ('-DPK_COMPILATION', language: 'c') + +conf = configuration_data() +conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir'))) +conf.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) +conf.set_quoted('SYSCONFDIR', get_option('sysconfdir')) + +cc = meson.get_compiler('c') +if cc.has_function('setpriority') + conf.set('HAVE_SETPRIORITY', '1') +endif +if cc.has_function('clearenv') + conf.set('HAVE_CLEARENV', '1') +endif +if cc.has_header('unistd.h') + conf.set('HAVE_UNISTD_H', '1') +endif + +config_header = configure_file( + output: 'config.h', + configuration: conf, +) + +config_dep = declare_dependency( + sources: config_header, + include_directories: include_directories('.') +) + +pk_db_dir = join_paths(get_option('localstatedir'), 'lib', 'PackageKit') +local_state_dir = get_option('localstatedir') +test_data_dir = join_paths(meson.source_root(), 'data', 'tests') +package_data_dir = get_option('datadir') +package_locale_dir = join_paths(get_option('prefix'), get_option('datadir'), 'locale') +pk_plugin_dir = join_paths(get_option('prefix'), get_option('libdir'), 'packagekit-backend') + +# work both in C and C++ +add_project_arguments( + '-Wall', + '-Wcast-align', '-Wno-uninitialized', + '-Wmissing-declarations', + '-Wredundant-decls', + '-Wpointer-arith', + '-Wcast-align', + '-Wwrite-strings', + '-Winit-self', + '-Wreturn-type', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wmissing-include-dirs', + '-Wmissing-format-attribute', + '-Wclobbered', + '-Wempty-body', + '-Wignored-qualifiers', + '-Wsign-compare', + '-Wtype-limits', + '-Wuninitialized', + '-Wno-unused-parameter', + language: ['c', 'cpp'] +) + +# work only in C +add_project_arguments( + '-Waggregate-return', + '-Wdeclaration-after-statement', + '-Wshadow', + '-Wno-strict-aliasing', + '-Winline', + '-Wmissing-parameter-type', + '-Woverride-init', + language: 'c' +) + +subdir('po') +subdir('policy') +subdir('etc') +subdir('data') +subdir('lib') +subdir('src') +subdir('client') +subdir('backends') +subdir('contrib') +subdir('docs') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..c23e92e81 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,21 @@ +option('packaging_backend', type : 'combo', choices : ['alpm', 'aptcc', 'dnf', 'dummy', 'entropy', 'pisi', 'poldek', 'portage', 'ports', 'slack', 'urpmi', 'yum', 'zypp', 'nix'], value : 'dummy', description : 'The name of the backend to use') +option('dnf_vendor', type : 'combo', choices : ['fedora', 'mageia', 'openmandriva', 'rosa'], value : 'fedora', description : 'Vendor configuration when using the dnf backend') +option('systemd', type : 'boolean', value : true, description : 'Use systemd and logind') +option('systemdsystemunitdir', type : 'string', value : '', description : 'Directory for systemd service files') +option('offline_update', type : 'boolean', value : true, description : 'Use systemd offline update') +option('elogind', type : 'boolean', value : false, description : 'Use elogind instead of systemd-login') +option('gobject_introspection', type : 'boolean', value : true, description : 'Build GObject Introspection data') +option('man_pages', type : 'boolean', value : true, description : 'Generate man pages') +option('gtk_doc', type : 'boolean', value : false, description : 'Generate API reference') +option('bash_completion', type : 'boolean', value : true, description : 'Bash completion') +option('bash_command_not_found', type : 'boolean', value : true, description : 'Build Bash command-not-found functionality') +option('packagekit_user', type : 'string', value : 'root', description : 'User for running the PackageKit daemon') +option('local_checkout', type : 'boolean', value : false, description : 'Allow running in local checkout') +option('gstreamer_plugin', type : 'boolean', value : true, description : 'Build gstreamer plugin functionality') +option('gtk_module', type : 'boolean', value : true, description : 'Build GTK+-3 module functionality') +option('cron', type : 'boolean', value : true, description : 'Build cron background functionality') +option('dbus_sys', type : 'string', value : '', description : 'D-BUS system.d directory') +option('dbus_services', type : 'string', value : '', description : 'D-BUS system-services directory') +option('python_backend', type : 'boolean', value : true, description : 'Provide a python backend') +option('pythonpackagedir', type : 'string', value : '', description : 'Location for python modules') +option('daemon_tests', type : 'boolean', value : true, description : 'Test the daemon using the dummy backend') diff --git a/po/.gitignore b/po/.gitignore deleted file mode 100644 index 2f3d7c1ce..000000000 --- a/po/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.intltool-merge-cache -POTFILES -stamp-it -Makefile.in.in -*.gmo -*.mo diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 000000000..0e046a56c --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,70 @@ +ar +as +ast +az +bg +bn_IN +br +ca +ca@valencia +cs +cy +da +de +el +en_GB +eo +es +eu +fa +fi +fo +fr +ga +gl +gu +he +hi +hr +hu +ia +id +it +ja +ka +kk +kn +ko +lt +lv +ml +mr +ms +nb +nl +nn +oc +or +pa +pl +pt_BR +pt +ro +ru +sk +sl +sq +sr@latin +sr +sv +ta +te +th +tr +uk +vi +wa +zh_CN +zh_HK +zh_TW + diff --git a/po/POTFILES.in b/po/POTFILES.in index f8087ff94..20600ffa6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,3 @@ -[encoding: UTF-8] # List of source files containing translatable strings. # Please keep this file sorted alphabetically. client/pk-console.c diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 000000000..f9f124c0d --- /dev/null +++ b/po/meson.build @@ -0,0 +1,5 @@ +i18n.gettext( + meson.project_name(), + preset: 'glib', + args: [ '--keyword=Description' ] +) diff --git a/policy/Makefile.am b/policy/Makefile.am deleted file mode 100644 index aeaef1118..000000000 --- a/policy/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -polkit_rulesdir = $(datadir)/polkit-1/rules.d -dist_polkit_rules_DATA = \ - org.freedesktop.packagekit.rules - -polkit_policydir = $(datadir)/polkit-1/actions -dist_polkit_policy_DATA = \ - org.freedesktop.packagekit.policy - -# You will need a recent intltool or the patch from this bug -# http://bugzilla.gnome.org/show_bug.cgi?id=462312 -@INTLTOOL_POLICY_RULE@ - -EXTRA_DIST = org.freedesktop.packagekit.policy.in -DISTCLEANFILES = org.freedesktop.packagekit.policy - -clean-local : - rm -f *~ - --include $(top_srcdir)/git.mk diff --git a/policy/meson.build b/policy/meson.build new file mode 100644 index 000000000..9fa328e70 --- /dev/null +++ b/policy/meson.build @@ -0,0 +1,21 @@ +intltool_merge = find_program('intltool-merge') +custom_target( + 'org.freedesktop.packagekit.policy', + input: 'org.freedesktop.packagekit.policy.in', + output: 'org.freedesktop.packagekit.policy', + command: [ + intltool_merge, + '--xml-style', + '--utf8', + join_paths(meson.source_root(), 'po'), + '@INPUT@', + '@OUTPUT@', + ], + install: true, + install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') +) + +install_data( + 'org.freedesktop.packagekit.rules', + install_dir: join_paths(get_option('datadir'), 'polkit-1', 'rules.d') +) diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in index 592b66538..59bf25a2c 100644 --- a/policy/org.freedesktop.packagekit.policy.in +++ b/policy/org.freedesktop.packagekit.policy.in @@ -19,8 +19,8 @@ authentication, but a different user id needs the admin password to cancel another users task. --> - <_description>Cancel foreign task</_description> - <_message>Authentication is required to cancel a task that was not started by yourself</_message> + <description>Cancel foreign task</description> + <message>Authentication is required to cancel a task that was not started by yourself</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -36,8 +36,8 @@ - Paranoid users (or parents!) can change this to 'auth_admin' or 'auth_admin_keep'. --> - <_description>Install signed package</_description> - <_message>Authentication is required to install software</_message> + <description>Install signed package</description> + <message>Authentication is required to install software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -53,8 +53,8 @@ password would be a massive security hole. - This is not retained as each package should be authenticated. --> - <_description>Install untrusted local file</_description> - <_message>Authentication is required to install untrusted software</_message> + <description>Install untrusted local file</description> + <message>Authentication is required to install untrusted software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -72,8 +72,8 @@ - If a package in question is not trusted, user's permission to install untrusted package will be checked as well. --> - <_description>Install already installed package again</_description> - <_message>Authentication is required to reinstall software</_message> + <description>Install already installed package again</description> + <message>Authentication is required to reinstall software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -90,8 +90,8 @@ - If a package in question is not trusted, user's permission to install untrusted package will be checked as well. --> - <_description>Install older version of installed package</_description> - <_message>Authentication is required to downgrade software</_message> + <description>Install older version of installed package</description> + <message>Authentication is required to downgrade software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -108,8 +108,8 @@ without a secure authentication. - This is not kept as each package should be authenticated. --> - <_description>Trust a key used for signing software</_description> - <_message>Authentication is required to consider a key used for signing software as trusted</_message> + <description>Trust a key used for signing software</description> + <message>Authentication is required to consider a key used for signing software as trusted</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -125,8 +125,8 @@ - Change this to 'auth_admin' for environments where users should not be given the option to make legal decisions. --> - <_description>Accept EULA</_description> - <_message>Authentication is required to accept a EULA</_message> + <description>Accept EULA</description> + <message>Authentication is required to accept a EULA</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -145,8 +145,8 @@ be removed. If this is not possible, change this authentication to 'auth_admin'. --> - <_description>Remove package</_description> - <_message>Authentication is required to remove software</_message> + <description>Remove package</description> + <message>Authentication is required to remove software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -164,8 +164,8 @@ - Changing this to anything other than 'yes' will break unattended updates. --> - <_description>Update software</_description> - <_message>Authentication is required to update software</_message> + <description>Update software</description> + <message>Authentication is required to update software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -180,8 +180,8 @@ software repositories as this can be used to enable new updates or install different versions of software. --> - <_description>Change software repository parameters</_description> - <_message>Authentication is required to change software repository parameters</_message> + <description>Change software repository parameters</description> + <message>Authentication is required to change software repository parameters</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -195,8 +195,8 @@ - Normal users do not require admin authentication to refresh the cache, as this doesn't actually install or remove software. --> - <_description>Refresh system repositories</_description> - <_message>Authentication is required to refresh the system repositories</_message> + <description>Refresh system repositories</description> + <message>Authentication is required to refresh the system repositories</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -210,8 +210,8 @@ - Normal users do not require admin authentication to set the proxy used for downloading packages. --> - <_description>Set network proxy</_description> - <_message>Authentication is required to set the network proxy used for downloading software</_message> + <description>Set network proxy</description> + <message>Authentication is required to set the network proxy used for downloading software</message> <icon_name>preferences-system-network-proxy</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -228,8 +228,8 @@ try to rebind drivers in use, for instance security authentication devices. --> - <_description>Reload a device</_description> - <_message>Authentication is required to reload the device with a new driver</_message> + <description>Reload a device</description> + <message>Authentication is required to reload the device with a new driver</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -245,8 +245,8 @@ this can make the system unbootable or stop other applications from working. --> - <_description>Upgrade System</_description> - <_message>Authentication is required to upgrade the operating system</_message> + <description>Upgrade System</description> + <message>Authentication is required to upgrade the operating system</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>no</allow_any> @@ -261,8 +261,8 @@ since this can make the system unbootable or stop other applications from working. --> - <_description>Repair System</_description> - <_message>Authentication is required to repair the installed software</_message> + <description>Repair System</description> + <message>Authentication is required to repair the installed software</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -276,8 +276,8 @@ - Normal users are able to ask updates to be installed at early boot time without a password. --> - <_description>Trigger offline updates</_description> - <_message>Authentication is required to trigger offline updates</_message> + <description>Trigger offline updates</description> + <message>Authentication is required to trigger offline updates</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -292,8 +292,8 @@ to a new distribution since this can make the system unbootable or stop other applications from working. --> - <_description>Trigger offline updates</_description> - <_message>Authentication is required to trigger offline updates</_message> + <description>Trigger offline updates</description> + <message>Authentication is required to trigger offline updates</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> @@ -307,8 +307,8 @@ - Normal users are able to clear the updates message that is shown after an updates are applied at boot time. --> - <_description>Clear offline update message</_description> - <_message>Authentication is required to clear the offline updates message</_message> + <description>Clear offline update message</description> + <message>Authentication is required to clear the offline updates message</message> <icon_name>package-x-generic</icon_name> <defaults> <allow_any>auth_admin</allow_any> diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 70e0b40ed..000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,194 +0,0 @@ -## We require new-style dependency handling. -AUTOMAKE_OPTIONS = 1.7 - -PK_GLIB2_LIBS = $(top_builddir)/lib/packagekit-glib2/libpackagekit-glib2.la - -AM_CPPFLAGS = \ - $(GIO_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(SQLITE_CFLAGS) \ - $(POLKIT_CFLAGS) \ - $(PYTHON_CFLAGS) \ - $(ELOGIND_CFLAGS) \ - $(SYSTEMD_CFLAGS) \ - -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ - -DBINDIR=\"$(bindir)\" \ - -DSBINDIR=\"$(sbindir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DPREFIX=\""$(prefix)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DLIBEXECDIR=\""$(libexecdir)"\" \ - -DVERSION="\"$(VERSION)\"" \ - -DPK_DATA=\"$(pkgdatadir)\" \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DTESTDATADIR=\""$(abs_top_srcdir)/data/tests"\" \ - -DPK_COMPILATION \ - -DPOLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE \ - -DG_LOG_DOMAIN=\"PackageKit\" \ - -I$(top_builddir)/lib \ - -I$(top_srcdir)/lib - -introspectiondir = $(datadir)/dbus-1/interfaces -dist_introspection_DATA = \ - org.freedesktop.PackageKit.xml \ - org.freedesktop.PackageKit.Transaction.xml - -pk-resources.c: packagekit.gresource.xml $(dist_introspection_DATA) - $(AM_V_GEN) \ - glib-compile-resources \ - --sourcedir=$(srcdir) \ - --sourcedir=$(top_builddir)/data \ - --target=$@ \ - --generate-source \ - --c-name pk \ - $(srcdir)/packagekit.gresource.xml -pk-resources.h: packagekit.gresource.xml - $(AM_V_GEN) \ - glib-compile-resources \ - --sourcedir=$(srcdir) \ - --sourcedir=$(top_builddir)/data \ - --target=$@ \ - --generate-header \ - --c-name pk \ - $(srcdir)/packagekit.gresource.xml - -shared_SOURCES = \ - pk-dbus.c \ - pk-dbus.h \ - pk-transaction.c \ - pk-transaction.h \ - pk-transaction-private.h \ - pk-backend.c \ - pk-backend.h \ - pk-backend-job.c \ - pk-backend-job.h \ - pk-shared.c \ - pk-shared.h \ - pk-resources.c \ - pk-resources.h \ - pk-spawn.c \ - pk-spawn.h \ - pk-engine.h \ - pk-engine.c \ - pk-backend-spawn.h \ - pk-backend-spawn.c \ - pk-scheduler.c \ - pk-scheduler.h \ - pk-transaction-db.c \ - pk-transaction-db.h - -libexec_PROGRAMS = packagekitd packagekit-direct - -packagekit_direct_SOURCES = \ - pk-backend.c \ - pk-backend.h \ - pk-backend-job.c \ - pk-backend-job.h \ - pk-direct.c \ - pk-shared.c \ - pk-shared.h - -packagekit_direct_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -DPK_DB_DIR=\""$(localstatedir)/lib/PackageKit"\" - -packagekit_direct_LDADD = \ - $(GLIB_LIBS) \ - $(GMODULE_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) \ - $(POLKIT_LIBS) \ - $(GIO_LIBS) \ - $(ARCHIVE_LIBS) \ - $(ELOGIND_LIBS) \ - $(SYSTEMD_LIBS) - -packagekit_direct_LDFLAGS = \ - $(PIE_LDFLAGS) \ - $(RELRO_LDFLAGS) - -packagekit_direct_CFLAGS = \ - $(PIE_CFLAGS) \ - $(WARNINGFLAGS_C) - -packagekitd_SOURCES = \ - pk-main.c \ - $(shared_SOURCES) - -packagekitd_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -DPK_BUILD_DAEMON=1 \ - -DPK_DB_DIR=\""$(localstatedir)/lib/PackageKit"\" - -packagekitd_LDADD = \ - $(GLIB_LIBS) \ - $(GMODULE_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) \ - $(PYTHON_LIBS) \ - $(POLKIT_LIBS) \ - $(GIO_LIBS) \ - $(ARCHIVE_LIBS) \ - $(ELOGIND_LIBS) \ - $(SYSTEMD_LIBS) - -packagekitd_LDFLAGS = \ - $(PIE_LDFLAGS) \ - $(RELRO_LDFLAGS) - -packagekitd_CFLAGS = \ - $(PIE_CFLAGS) \ - $(WARNINGFLAGS_C) - -check_PROGRAMS = \ - pk-self-test - -pk_self_test_SOURCES = \ - pk-self-test.c \ - $(shared_SOURCES) - -pk_self_test_LDADD = \ - $(GLIB_LIBS) \ - $(GMODULE_LIBS) \ - $(SQLITE_LIBS) \ - $(PK_GLIB2_LIBS) \ - $(POLKIT_LIBS) \ - $(GIO_LIBS) \ - $(ARCHIVE_LIBS) \ - $(ELOGIND_LIBS) \ - $(SYSTEMD_LIBS) - -pk_self_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -DPK_BUILD_DAEMON=1 \ - -DPK_DB_DIR=\""."\" - -pk_self_test_CFLAGS = \ - $(AM_CFLAGS) \ - $(WARNINGFLAGS_C) - -TESTS = pk-self-test - -install-data-hook: - if test -w $(DESTDIR)$(prefix)/; then \ - mkdir -p $(DESTDIR)$(localstatedir)/cache/PackageKit/downloads; \ - mkdir -p $(DESTDIR)$(localstatedir)/cache/PackageKit/metadata; \ - mkdir -p $(DESTDIR)$(localstatedir)/log; \ - fi - -clean-local: - rm -f *~ - -BUILT_SOURCES = \ - pk-resources.c \ - pk-resources.h - -CLEANFILES = \ - $(BUILT_SOURCES) \ - transactions.db - -EXTRA_DIST = \ - packagekit.gresource.xml - --include $(top_srcdir)/git.mk diff --git a/src/callgrind.sh b/src/callgrind.sh index 22f1f668c..d6cabc1bb 100755 --- a/src/callgrind.sh +++ b/src/callgrind.sh @@ -16,4 +16,4 @@ fi export G_DEBUG=fatal_criticals sudo touch /etc/PackageKit/PackageKit.conf -sudo valgrind --tool=callgrind --collect-systime=yes .libs/lt-packagekitd --backend=$BACKEND --disable-timer +sudo valgrind --tool=callgrind --collect-systime=yes src/packagekitd --backend=$BACKEND --disable-timer diff --git a/src/gdb.sh b/src/gdb.sh index 95d2e4974..116726752 100755 --- a/src/gdb.sh +++ b/src/gdb.sh @@ -16,5 +16,5 @@ fi export G_DEBUG=fatal_criticals sudo touch /etc/PackageKit/PackageKit.conf -sudo G_DEBUG=fatal_criticals gdb --args .libs/lt-packagekitd --verbose --backend=$BACKEND --disable-timer +sudo G_DEBUG=fatal_criticals gdb --args src/packagekitd --verbose --backend=$BACKEND --disable-timer diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 000000000..ab89df228 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,129 @@ +packagekit_src_include = include_directories('.') + +pk_resources = gnome.compile_resources( + 'pk-resources', 'packagekit.gresource.xml', + source_dir: join_paths(meson.source_root(), 'data'), + c_name: 'pk' +) + +shared_sources = files( + 'pk-dbus.c', + 'pk-dbus.h', + 'pk-transaction.c', + 'pk-transaction.h', + 'pk-transaction-private.h', + 'pk-backend.c', + 'pk-backend.h', + 'pk-backend-job.c', + 'pk-backend-job.h', + 'pk-shared.c', + 'pk-shared.h', + 'pk-spawn.c', + 'pk-spawn.h', + 'pk-engine.h', + 'pk-engine.c', + 'pk-backend-spawn.h', + 'pk-backend-spawn.c', + 'pk-scheduler.c', + 'pk-scheduler.h', + 'pk-transaction-db.c', + 'pk-transaction-db.h', +) + +packagekit_direct_exec = executable( + 'packagekit-direct', + 'pk-backend.c', + 'pk-backend.h', + 'pk-backend-job.c', + 'pk-backend-job.h', + 'pk-direct.c', + 'pk-shared.c', + 'pk-shared.h', + dependencies: [ + packagekit_glib2_dep, + libsystemd, + elogind, + gmodule_dep, + ], + install: true, + install_dir: get_option('libexecdir'), + c_args: [ + '-DG_LOG_DOMAIN="PackageKit"', + '-DLIBDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))), + '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')), + '-DVERSION="@0@"'.format(meson.project_version()), + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + ] +) + +packagekitd_exec = executable( + 'packagekitd', + 'pk-main.c', + shared_sources, + pk_resources, + dependencies: [ + packagekit_glib2_dep, + libsystemd, + elogind, + polkit_dep, + gmodule_dep, + sqlite3_dep, + ], + install: true, + install_dir: get_option('libexecdir'), + c_args: [ + '-DPK_BUILD_DAEMON=1', + '-DG_LOG_DOMAIN="PackageKit"', + '-DLIBDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))), + '-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))), + '-DLIBEXECDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libexecdir'))), + '-DVERSION="@0@"'.format(meson.project_version()), + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DPACKAGE_LOCALE_DIR="@0@"'.format(package_locale_dir), + '-DLOCALSTATEDIR="@0@"'.format(local_state_dir), + '-DPK_DB_DIR="@0@"'.format(pk_db_dir), + ] +) + +install_data( + 'org.freedesktop.PackageKit.xml', + 'org.freedesktop.PackageKit.Transaction.xml', + install_dir: join_paths(get_option('datadir'), 'dbus-1', 'interfaces') +) + +pk_self_test_exec = executable( + 'pk-self-test', + 'pk-self-test.c', + shared_sources, + pk_resources, + dependencies: [ + packagekit_glib2_dep, + libsystemd, + elogind, + polkit_dep, + gmodule_dep, + sqlite3_dep, + ], + c_args: [ + '-DPK_BUILD_DAEMON=1', + '-DPK_DB_DIR="."', + '-DLIBDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))), + '-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))), + '-DLIBEXECDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libexecdir'))), + '-DTESTDATADIR="@0@"'.format(test_data_dir), + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DLOCALSTATEDIR="@0@"'.format(local_state_dir), + '-DSOURCEROOTDIR="@0@"'.format(meson.source_root()), + ] +) + +test( + 'pk-self-test', + pk_self_test_exec, + depends: packagekit_test_py, + env: [ + 'PYTHONPATH=@0@'.format(join_paths(meson.build_root(), 'lib', 'python')), + ], + timeout: 360, +) diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c index a6f84223f..1561901d1 100644 --- a/src/pk-backend-spawn.c +++ b/src/pk-backend-spawn.c @@ -846,7 +846,7 @@ pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, gboolean background; PkBackendSpawnPrivate *priv = backend_spawn->priv; PkSpawnArgvFlags flags = PK_SPAWN_ARGV_FLAGS_NONE; -#if PK_BUILD_LOCAL +#ifdef SOURCEROOTDIR const gchar *directory; #endif g_autoptr(GError) error = NULL; @@ -863,18 +863,18 @@ pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, return FALSE; } -#if PK_BUILD_LOCAL +#ifdef SOURCEROOTDIR /* prefer the local version */ directory = priv->name; if (g_str_has_prefix (directory, "test_")) directory = "test"; - filename = g_build_filename ("..", "backends", directory, "helpers", + filename = g_build_filename (SOURCEROOTDIR, "backends", directory, "helpers", argv[PK_BACKEND_SPAWN_ARGV0], NULL); if (g_file_test (filename, G_FILE_TEST_EXISTS) == FALSE) { g_debug ("local helper not found '%s'", filename); g_free (filename); - filename = g_build_filename ("..", "backends", directory, + filename = g_build_filename (SOURCEROOTDIR, "backends", directory, argv[PK_BACKEND_SPAWN_ARGV0], NULL); } if (g_file_test (filename, G_FILE_TEST_EXISTS) == FALSE) { diff --git a/src/pk-backend.c b/src/pk-backend.c index c05f6c0cd..ad5dccb2e 100644 --- a/src/pk-backend.c +++ b/src/pk-backend.c @@ -421,7 +421,7 @@ pk_backend_build_library_path (PkBackend *backend, const gchar *name) directory = "test"; /* prefer the local version */ - path = g_build_filename ("..", "backends", directory, ".libs", filename, NULL); + path = g_build_filename ("backends", directory, filename, NULL); if (g_file_test (path, G_FILE_TEST_EXISTS) == FALSE) { g_debug ("local backend not found '%s'", path); g_free (path); diff --git a/src/pk-self-test.c b/src/pk-self-test.c index 5c2f8d9c3..082a70d22 100644 --- a/src/pk-self-test.c +++ b/src/pk-self-test.c @@ -645,7 +645,7 @@ pk_test_spawn_func (void) /* run the dispatcher */ mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN; argv = g_strsplit (TESTDATADIR "/pk-spawn-dispatcher.py\tsearch-name\tnone\tpower manager", "\t", 0); - envp = g_strsplit ("NETWORK=TRUE LANG=C BACKGROUND=TRUE INTERACTIVE=TRUE", " ", 0); + envp = g_strsplit ("NETWORK=TRUE LANG=C BACKGROUND=TRUE INTERACTIVE=TRUE UID=500", " ", 0); ret = pk_spawn_argv (spawn, argv, envp, PK_SPAWN_ARGV_FLAGS_NONE, &error); g_assert_no_error (error); g_assert (ret); @@ -826,7 +826,7 @@ pk_test_transaction_db_func (void) NULL, NULL, NULL); - g_assert (!ret); + g_assert (ret); g_assert_cmpstr (proxy_http, ==, NULL); g_assert_cmpstr (proxy_ftp, ==, NULL); @@ -838,7 +838,7 @@ pk_test_transaction_db_func (void) NULL, NULL, NULL); - g_assert (!ret); + g_assert (ret); g_assert_cmpstr (proxy_http, ==, NULL); g_assert_cmpstr (proxy_ftp, ==, NULL); @@ -1407,7 +1407,7 @@ main (int argc, char **argv) #endif #ifndef PK_BUILD_LOCAL - g_warning ("you need to compile with --enable-local for make check support"); + g_warning ("you need to compile with -Dlocal_checkout=true for ninja test support"); #endif /* components */ diff --git a/src/pk-spawn.c b/src/pk-spawn.c index 39c8045c9..dd2b04b8f 100644 --- a/src/pk-spawn.c +++ b/src/pk-spawn.c @@ -502,7 +502,9 @@ pk_spawn_argv (PkSpawn *spawn, gchar **argv, gchar **envp, gboolean ret = TRUE; guint i; guint len; +#if HAVE_SETPRIORITY gint nice_value = 0; +#endif gint rc; g_autoptr(GError) error_local = NULL; @@ -582,11 +584,11 @@ pk_spawn_argv (PkSpawn *spawn, gchar **argv, gchar **envp, goto out; } +#if HAVE_SETPRIORITY /* get the nice value and ensure we are in the valid range */ if (spawn->priv->background) nice_value = 10; -#if HAVE_SETPRIORITY /* don't completely bog the system down */ if (nice_value != 0) { g_debug ("renice to %i", nice_value); diff --git a/tests/ci/Dockerfile-debian b/tests/ci/Dockerfile-debian index 420a9cdf3..2cc5d0aa6 100644 --- a/tests/ci/Dockerfile-debian +++ b/tests/ci/Dockerfile-debian @@ -4,5 +4,6 @@ RUN echo "deb-src http://deb.debian.org/debian/ buster main" >> /etc/apt/sources RUN apt-get update -qq RUN apt-get install -yq build-essential RUN apt-get build-dep -yq packagekit +RUN apt-get install -yq meson RUN mkdir /build WORKDIR /build diff --git a/tests/ci/Dockerfile-fedora b/tests/ci/Dockerfile-fedora index c45a11217..28747b3dd 100644 --- a/tests/ci/Dockerfile-fedora +++ b/tests/ci/Dockerfile-fedora @@ -1,7 +1,7 @@ FROM fedora:29 RUN dnf -y update -RUN dnf -y install dnf-plugins-core libdnf-devel redhat-rpm-config autoconf-archive gcc make +RUN dnf -y install dnf-plugins-core libdnf-devel redhat-rpm-config meson gcc ninja-build RUN dnf -y builddep PackageKit RUN mkdir /build diff --git a/tests/ci/build_and_test.sh b/tests/ci/build_and_test.sh index 41b200adc..33aeca8c5 100755 --- a/tests/ci/build_and_test.sh +++ b/tests/ci/build_and_test.sh @@ -1,8 +1,12 @@ #!/bin/sh set -e -./autogen.sh $@ +if [ -d "build" ]; then + rm build -rf +fi +meson build -Dlocal_checkout=true -Ddaemon_tests=false $@ # Build, Test & Install -make -make install DEST=/tmp/install_root/ +ninja -C build +ninja -C build test +DEST=/tmp/install_root/ ninja -C build install |