Hello community, here is the log from the commit of package flatpak-builder for openSUSE:Factory checked in at 2017-12-04 12:16:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/flatpak-builder (Old) and /work/SRC/openSUSE:Factory/.flatpak-builder.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "flatpak-builder" Mon Dec 4 12:16:11 2017 rev:2 rq:547565 version:0.10.5 Changes: -------- --- /work/SRC/openSUSE:Factory/flatpak-builder/flatpak-builder.changes 2017-12-01 15:53:25.616493071 +0100 +++ /work/SRC/openSUSE:Factory/.flatpak-builder.new/flatpak-builder.changes 2017-12-04 12:16:12.940939926 +0100 @@ -1,0 +2,20 @@ +Mon Nov 27 09:16:01 UTC 2017 - adrien.plazas@suse.com + +- Update to version 0.10.5: + + Add support for running tests during the build (disable with + --disable-tests). + + New build-option append-pkg-config to append to + PKG_CONFIG_PATH. + + --state-dir option lets you reuse a single directory instead of + scattered .flatpak-builder dirs for builds, downloads and cache + data. + + git: Allow updates with non-fastforwarded branched. + + Don't fail if app ships both appdata and metainfo file. + + Support --log-system/session-bus in --run. + +------------------------------------------------------------------- +Mon Nov 13 20:34:43 UTC 2017 - jengelh@inai.de + +- Adjust RPM groups. + +------------------------------------------------------------------- Old: ---- flatpak-builder-0.10.4.tar.xz New: ---- flatpak-builder-0.10.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ flatpak-builder.spec ++++++ --- /var/tmp/diff_new_pack.FSq37L/_old 2017-12-04 12:16:13.852906814 +0100 +++ /var/tmp/diff_new_pack.FSq37L/_new 2017-12-04 12:16:13.864906378 +0100 @@ -17,11 +17,11 @@ Name: flatpak-builder -Version: 0.10.4 +Version: 0.10.5 Release: 0 Summary: Tool to build flatpaks from source License: LGPL-2.1+ -Group: System/Packages +Group: Development/Tools/Building Url: http://flatpak.org/ Source: https://github.com/flatpak/flatpak-builder/releases/download/%{version}/%{name}-%{version}.tar.xz BuildRequires: docbook-xsl-stylesheets @@ -32,7 +32,7 @@ BuildRequires: pkgconfig BuildRequires: xmlto BuildRequires: xsltproc -BuildRequires: pkgconfig(flatpak) >= 0.10.0 +BuildRequires: pkgconfig(flatpak) >= 0.10.1 BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(json-glib-1.0) ++++++ flatpak-builder-0.10.4.tar.xz -> flatpak-builder-0.10.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/Makefile.in new/flatpak-builder-0.10.5/Makefile.in --- old/flatpak-builder-0.10.4/Makefile.in 2017-11-06 15:18:21.000000000 +0100 +++ new/flatpak-builder-0.10.5/Makefile.in 2017-11-24 14:58:41.000000000 +0100 @@ -676,6 +676,8 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OSTREE_CFLAGS = @OSTREE_CFLAGS@ +OSTREE_LIBS = @OSTREE_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ @@ -2706,7 +2708,8 @@ @ENABLE_INSTALLED_TESTS_TRUE@%.test: %$(EXEEXT) Makefile -@ENABLE_INSTALLED_TESTS_TRUE@ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(AM_V_GEN) (mkdir -p $(@D); \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo '[Test]' > $@.tmp; \ @ENABLE_INSTALLED_TESTS_TRUE@ echo 'Type=session' >> $@.tmp; \ @ENABLE_INSTALLED_TESTS_TRUE@ echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \ @ENABLE_INSTALLED_TESTS_TRUE@ echo 'Output=TAP' >> $@.tmp; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/NEWS new/flatpak-builder-0.10.5/NEWS --- old/flatpak-builder-0.10.4/NEWS 2017-11-06 15:17:45.000000000 +0100 +++ new/flatpak-builder-0.10.5/NEWS 2017-11-24 14:57:53.000000000 +0100 @@ -1,3 +1,14 @@ +Major changes in 0.10.5 +======================= + + * Add support for running tests during the build (disable with --disable-tests). + * New build-option append-pkg-config to append to PKG_CONFIG_PATH + * --state-dir option lets you reuse a single directory instead of scattered + .flatpak-builder dirs for builds, downloads and cache data. + * git: Allow updates with non-fastforwarded branched + * Don't fail if app ships both appdata and metainfo file + * Support --log-system/session-bus in --run + Major changes in 0.10.4 ======================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/buildutil/glib-tap.mk new/flatpak-builder-0.10.5/buildutil/glib-tap.mk --- old/flatpak-builder-0.10.4/buildutil/glib-tap.mk 2017-08-24 15:19:14.000000000 +0200 +++ new/flatpak-builder-0.10.5/buildutil/glib-tap.mk 2017-11-24 14:49:17.000000000 +0100 @@ -118,7 +118,8 @@ installed_test_meta_DATA = $(installed_testcases:=.test) %.test: %$(EXEEXT) Makefile - $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ + $(AM_V_GEN) (mkdir -p $(@D); \ + echo '[Test]' > $@.tmp; \ echo 'Type=session' >> $@.tmp; \ echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \ echo 'Output=TAP' >> $@.tmp; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/config.h.in new/flatpak-builder-0.10.5/config.h.in --- old/flatpak-builder-0.10.4/config.h.in 2017-11-06 15:18:23.000000000 +0100 +++ new/flatpak-builder-0.10.5/config.h.in 2017-11-24 15:02:59.000000000 +0100 @@ -4,6 +4,9 @@ language is requested. */ #undef ENABLE_NLS +/* Define if peer to peer support should be enabled */ +#undef FLATPAK_ENABLE_P2P + /* gettext domain */ #undef GETTEXT_PACKAGE @@ -61,6 +64,9 @@ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR +/* Define if libostree experimental API should be enabled */ +#undef OSTREE_ENABLE_EXPERIMENTAL_API + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/configure new/flatpak-builder-0.10.5/configure --- old/flatpak-builder-0.10.4/configure 2017-11-06 15:18:21.000000000 +0100 +++ new/flatpak-builder-0.10.5/configure 2017-11-24 14:58:41.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for flatpak-builder 0.10.4. +# Generated by GNU Autoconf 2.69 for flatpak-builder 0.10.5. # # Report bugs to https://github.com/flatpak/flatpak-builder/issues. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='flatpak-builder' PACKAGE_TARNAME='flatpak-builder' -PACKAGE_VERSION='0.10.4' -PACKAGE_STRING='flatpak-builder 0.10.4' +PACKAGE_VERSION='0.10.5' +PACKAGE_STRING='flatpak-builder 0.10.5' PACKAGE_BUGREPORT='https://github.com/flatpak/flatpak-builder/issues' PACKAGE_URL='http://flatpak.org/' @@ -653,6 +653,10 @@ XMLCATALOG XML_CATALOG_FILE XSLTPROC +ENABLE_P2P_FALSE +ENABLE_P2P_TRUE +OSTREE_LIBS +OSTREE_CFLAGS LIBELF_LIBS LIBELF_CFLAGS BASE_LIBS @@ -822,6 +826,7 @@ enable_maintainer_mode enable_valgrind with_dwarf_header +enable_p2p enable_documentation with_xml_catalog enable_docbook_docs @@ -845,6 +850,8 @@ BASE_LIBS LIBELF_CFLAGS LIBELF_LIBS +OSTREE_CFLAGS +OSTREE_LIBS XMLTO XMLTO_FLAGS' @@ -1387,7 +1394,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures flatpak-builder 0.10.4 to adapt to many kinds of systems. +\`configure' configures flatpak-builder 0.10.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1457,7 +1464,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of flatpak-builder 0.10.4:";; + short | recursive ) echo "Configuration of flatpak-builder 0.10.5:";; esac cat <<\_ACEOF @@ -1483,6 +1490,7 @@ disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-valgrind Whether to enable Valgrind on the unit tests + --enable-p2p Enable unstable peer to peer support [default=no] --enable-documentation Build documentation --enable-docbook-docs build documentation (requires xmlto) --enable-installed-tests @@ -1531,6 +1539,9 @@ LIBELF_CFLAGS C compiler flags for LIBELF, overriding pkg-config LIBELF_LIBS linker flags for LIBELF, overriding pkg-config + OSTREE_CFLAGS + C compiler flags for OSTREE, overriding pkg-config + OSTREE_LIBS linker flags for OSTREE, overriding pkg-config XMLTO Define/override the 'xmlto' location. XMLTO_FLAGS Define/override 'xmlto' options, like '--skip-validation'. @@ -1601,7 +1612,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -flatpak-builder configure 0.10.4 +flatpak-builder configure 0.10.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1970,7 +1981,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by flatpak-builder $as_me 0.10.4, which was +It was created by flatpak-builder $as_me 0.10.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2322,7 +2333,7 @@ GLIB_REQS=2.44 OSTREE_REQS=2017.12 -FLATPAK_REQS=0.10.0 +FLATPAK_REQS=0.10.1 ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -12798,7 +12809,7 @@ # Define the identity of the package. PACKAGE='flatpak-builder' - VERSION='0.10.4' + VERSION='0.10.5' # Some tools Automake needs. @@ -16082,6 +16093,139 @@ fi fi +# Do we enable building peer to peer support using libostree’s experimental (non-stable) API? +# If so, OSTREE_ENABLE_EXPERIMENTAL_API needs to be #defined before ostree.h is +# included. +# Check whether --enable-p2p was given. +if test "${enable_p2p+set}" = set; then : + enableval=$enable_p2p; +else + enable_p2p=no +fi + +if test x$enable_p2p = xyes; then : + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSTREE" >&5 +$as_echo_n "checking for OSTREE... " >&6; } + +if test -n "$OSTREE_CFLAGS"; then + pkg_cv_OSTREE_CFLAGS="$OSTREE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ostree-1 >= \$OSTREE_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ostree-1 >= $OSTREE_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OSTREE_CFLAGS=`$PKG_CONFIG --cflags "ostree-1 >= $OSTREE_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OSTREE_LIBS"; then + pkg_cv_OSTREE_LIBS="$OSTREE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ostree-1 >= \$OSTREE_REQS\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ostree-1 >= $OSTREE_REQS") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OSTREE_LIBS=`$PKG_CONFIG --libs "ostree-1 >= $OSTREE_REQS" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OSTREE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ostree-1 >= $OSTREE_REQS" 2>&1` + else + OSTREE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ostree-1 >= $OSTREE_REQS" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OSTREE_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (ostree-1 >= $OSTREE_REQS) were not met: + +$OSTREE_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables OSTREE_CFLAGS +and OSTREE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables OSTREE_CFLAGS +and OSTREE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see http://pkg-config.freedesktop.org/. +See \`config.log' for more details" "$LINENO" 5; } +else + OSTREE_CFLAGS=$pkg_cv_OSTREE_CFLAGS + OSTREE_LIBS=$pkg_cv_OSTREE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + ostree_features=$($PKG_CONFIG --variable=features ostree-1) + case "$ostree_features" in #( + *experimental*) : + have_ostree_experimental=yes ;; #( + *) : + ;; +esac + + if test "x$have_ostree_experimental" != "xyes"; then : + as_fn_error $? "Experimental API not found in ostree-1, which is needed for --enable-p2p. OSTree must be compiled with --enable-experimental-api." "$LINENO" 5 +fi + + +$as_echo "#define OSTREE_ENABLE_EXPERIMENTAL_API 1" >>confdefs.h + + +$as_echo "#define FLATPAK_ENABLE_P2P 1" >>confdefs.h + + +fi + if test x$enable_p2p = xyes; then + ENABLE_P2P_TRUE= + ENABLE_P2P_FALSE='#' +else + ENABLE_P2P_TRUE='#' + ENABLE_P2P_FALSE= +fi + + # Check whether --enable-documentation was given. if test "${enable_documentation+set}" = set; then : enableval=$enable_documentation; @@ -16389,7 +16533,7 @@ fi -FLATPAK_BUILDER_VERSION=0.10.4 +FLATPAK_BUILDER_VERSION=0.10.5 ac_config_files="$ac_config_files Makefile doc/Makefile doc/flatpak-builder-docs.xml" @@ -16535,6 +16679,10 @@ as_fn_error $? "conditional \"VALGRIND_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_P2P_TRUE}" && test -z "${ENABLE_P2P_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_P2P\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_DOCUMENTATION_TRUE}" && test -z "${BUILD_DOCUMENTATION_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOCUMENTATION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16948,7 +17096,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by flatpak-builder $as_me 0.10.4, which was +This file was extended by flatpak-builder $as_me 0.10.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17015,7 +17163,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -flatpak-builder config.status 0.10.4 +flatpak-builder config.status 0.10.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/configure.ac new/flatpak-builder-0.10.5/configure.ac --- old/flatpak-builder-0.10.4/configure.ac 2017-11-06 15:16:36.000000000 +0100 +++ new/flatpak-builder-0.10.5/configure.ac 2017-11-24 14:54:50.000000000 +0100 @@ -15,7 +15,7 @@ m4_define([flatpak_builder_major_version], [0]) m4_define([flatpak_builder_minor_version], [10]) -m4_define([flatpak_builder_micro_version], [4]) +m4_define([flatpak_builder_micro_version], [5]) m4_define([flatpak_builder_version], [flatpak_builder_major_version.flatpak_builder_minor_version.flatpak_builder_micro_version]) @@ -27,7 +27,7 @@ GLIB_REQS=2.44 OSTREE_REQS=2017.12 -FLATPAK_REQS=0.10.0 +FLATPAK_REQS=0.10.1 AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE @@ -145,6 +145,28 @@ AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"], [AC_MSG_ERROR([dwarf.h is required but was not found])])]) +# Do we enable building peer to peer support using libostree’s experimental (non-stable) API? +# If so, OSTREE_ENABLE_EXPERIMENTAL_API needs to be #defined before ostree.h is +# included. +AC_ARG_ENABLE([p2p], + [AS_HELP_STRING([--enable-p2p], + [Enable unstable peer to peer support [default=no]])],, + [enable_p2p=no]) +AS_IF([test x$enable_p2p = xyes],[ + PKG_CHECK_MODULES(OSTREE, [ostree-1 >= $OSTREE_REQS]) + + ostree_features=$($PKG_CONFIG --variable=features ostree-1) + AS_CASE(["$ostree_features"], + [*experimental*],[have_ostree_experimental=yes]) + + AS_IF([test "x$have_ostree_experimental" != "xyes"], + [AC_MSG_ERROR([Experimental API not found in ostree-1, which is needed for --enable-p2p. OSTree must be compiled with --enable-experimental-api.])]) + + AC_DEFINE([OSTREE_ENABLE_EXPERIMENTAL_API],[1],[Define if libostree experimental API should be enabled]) + AC_DEFINE([FLATPAK_ENABLE_P2P],[1],[Define if peer to peer support should be enabled]) +]) +AM_CONDITIONAL([ENABLE_P2P],[test x$enable_p2p = xyes]) + AC_ARG_ENABLE(documentation, AC_HELP_STRING([--enable-documentation], [Build documentation]),, enable_documentation=yes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/doc/Makefile.in new/flatpak-builder-0.10.5/doc/Makefile.in --- old/flatpak-builder-0.10.4/doc/Makefile.in 2017-11-06 15:18:21.000000000 +0100 +++ new/flatpak-builder-0.10.5/doc/Makefile.in 2017-11-24 14:58:41.000000000 +0100 @@ -231,6 +231,8 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OSTREE_CFLAGS = @OSTREE_CFLAGS@ +OSTREE_LIBS = @OSTREE_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/doc/flatpak-builder.xml new/flatpak-builder-0.10.5/doc/flatpak-builder.xml --- old/flatpak-builder-0.10.4/doc/flatpak-builder.xml 2017-10-30 15:11:05.000000000 +0100 +++ new/flatpak-builder-0.10.5/doc/flatpak-builder.xml 2017-11-24 14:49:17.000000000 +0100 @@ -204,6 +204,14 @@ </varlistentry> <varlistentry> + <term><option>--disable-tests</option></term> + + <listitem><para> + Don't run any of the tests. + </para></listitem> + </varlistentry> + + <varlistentry> <term><option>--run</option></term> <listitem><para> @@ -306,6 +314,16 @@ </varlistentry> <varlistentry> + <term><option>--state-dir=PATH</option></term> + + <listitem><para> + Use this directory for storing state (downloads, build dirs, build cache, etc) rather than + .flatpak-builder. This can be an absolute or relative path, but must be on the + same filesystem as the specified target <arg choice="plain">DIRECTORY</arg>. + </para></listitem> + </varlistentry> + + <varlistentry> <term><option>--keep-build-dirs</option></term> <listitem><para> @@ -563,15 +581,15 @@ <title>Caching</title> <para> - flatpak-builder caches sources and partial build results in - the .flatpak-builder subdirectory of the current directory. If you - use <option>--keep-build-dirs</option>, build directories for each - module are also stored here. + flatpak-builder caches sources and partial build results + in the state directory (defaulting to the .flatpak-builder + subdirectory of the current directory). If you use + <option>--keep-build-dirs</option>, build directories for + each module are also stored here. </para> <para> - It is safe to remove the contents of the .flatpak-builder - directory. This will force a full build the next time you build. + It is safe to remove the state directory. This will force a full build the next time you build. </para> </refsect1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/doc/flatpak-manifest.xml new/flatpak-builder-0.10.5/doc/flatpak-manifest.xml --- old/flatpak-builder-0.10.4/doc/flatpak-manifest.xml 2017-10-30 11:28:42.000000000 +0100 +++ new/flatpak-builder-0.10.5/doc/flatpak-manifest.xml 2017-11-24 14:49:17.000000000 +0100 @@ -277,6 +277,11 @@ needed).</para></listitem> </varlistentry> <varlistentry> + <term><option>append-pkg-config-path</option> (string)</term> + <listitem><para>This will get appended to PKG_CONFIG_PATH in the build environment (with an leading colon if + needed).</para></listitem> + </varlistentry> + <varlistentry> <term><option>env</option> (object)</term> <listitem><para>This is a dictionary defining environment variables to be set during the build. Elements in this override the properties that set the environment, like cflags and ldflags.</para></listitem> </varlistentry> @@ -285,6 +290,10 @@ <listitem><para>This is an array containing extra options to pass to flatpak build.</para></listitem> </varlistentry> <varlistentry> + <term><option>test-args</option> (array of strings)</term> + <listitem><para>Similar to build-args but affects the tests, not the normal build.</para></listitem> + </varlistentry> + <varlistentry> <term><option>config-opts</option> (array of strings)</term> <listitem><para>This is an array containing extra options to pass to configure.</para></listitem> </varlistentry> @@ -466,6 +475,18 @@ <listitem><para>Extra files to clean up in the platform.</para></listitem> </varlistentry> <varlistentry> + <term><option>run-tests</option> (boolean)</term> + <listitem><para>If true this will run the tests after installing.</para></listitem> + </varlistentry> + <varlistentry> + <term><option>test-rule</option> (string)</term> + <listitem><para>The target to build when running the tests. Defaults to "check" for make and "test" for ninja. Set to empty to disable.</para></listitem> + </varlistentry> + <varlistentry> + <term><option>test-commands</option> (arrya of string)</term> + <listitem><para>Array of commands to run during the tests.</para></listitem> + </varlistentry> + <varlistentry> <term><option>modules</option> (array of objects or strings)</term> <listitem><para>An array of objects specifying nested modules to be built before this one. String members in the array are interpreted as names of a separate json file that contains a module.</para></listitem> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-context.c new/flatpak-builder-0.10.5/src/builder-context.c --- old/flatpak-builder-0.10.4/src/builder-context.c 2017-09-06 19:46:50.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-context.c 2017-11-24 14:49:17.000000000 +0100 @@ -44,6 +44,7 @@ GFile *app_dir; GFile *run_dir; /* directory flatpak-builder was started from */ GFile *base_dir; /* directory with json manifest, origin for source files */ + char *state_subdir; SoupSession *soup_session; char *arch; char *stop_at; @@ -75,6 +76,7 @@ gboolean rebuild_on_sdk_change; gboolean use_rofiles; gboolean have_rofiles; + gboolean run_tests; }; typedef struct @@ -88,6 +90,7 @@ PROP_0, PROP_APP_DIR, PROP_RUN_DIR, + PROP_STATE_SUBDIR, LAST_PROP }; @@ -110,6 +113,7 @@ g_clear_object (&self->soup_session); g_clear_object (&self->options); g_free (self->arch); + g_free (self->state_subdir); g_free (self->stop_at); g_strfreev (self->cleanup); g_strfreev (self->cleanup_platform); @@ -139,6 +143,10 @@ g_value_set_object (value, self->app_dir); break; + case PROP_STATE_SUBDIR: + g_value_set_string (value, self->state_subdir); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -162,6 +170,11 @@ g_set_object (&self->app_dir, g_value_get_object (value)); break; + case PROP_STATE_SUBDIR: + g_free (self->state_subdir); + self->state_subdir = g_value_dup_string (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -172,7 +185,7 @@ { BuilderContext *self = BUILDER_CONTEXT (object); - self->state_dir = g_file_get_child (self->run_dir, ".flatpak-builder"); + self->state_dir = g_file_resolve_relative_path (self->run_dir, self->state_subdir ? self->state_subdir : ".flatpak-builder"); self->download_dir = g_file_get_child (self->state_dir, "downloads"); self->build_dir = g_file_get_child (self->state_dir, "build"); self->cache_dir = g_file_get_child (self->state_dir, "cache"); @@ -204,6 +217,13 @@ "", G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_object_class_install_property (object_class, + PROP_STATE_SUBDIR, + g_param_spec_string ("state-subdir", + "", + "", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } static void @@ -827,6 +847,19 @@ } gboolean +builder_context_get_run_tests (BuilderContext *self) +{ + return self->run_tests; +} + +void +builder_context_set_run_tests (BuilderContext *self, + gboolean run_tests) +{ + self->run_tests = run_tests; +} + +gboolean builder_context_get_rebuild_on_sdk_change (BuilderContext *self) { return self->rebuild_on_sdk_change; @@ -899,10 +932,12 @@ BuilderContext * builder_context_new (GFile *run_dir, - GFile *app_dir) + GFile *app_dir, + const char *state_subdir) { return g_object_new (BUILDER_TYPE_CONTEXT, "run-dir", run_dir, "app-dir", app_dir, + "state-subdir", state_subdir, NULL); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-context.h new/flatpak-builder-0.10.5/src/builder-context.h --- old/flatpak-builder-0.10.4/src/builder-context.h 2017-08-24 15:19:14.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-context.h 2017-11-24 14:49:17.000000000 +0100 @@ -114,7 +114,8 @@ const char *checksum); BuilderContext *builder_context_new (GFile *run_dir, - GFile *app_dir); + GFile *app_dir, + const char *state_subdir); gboolean builder_context_enable_ccache (BuilderContext *self, GError **error); gboolean builder_context_enable_rofiles (BuilderContext *self, @@ -125,6 +126,9 @@ gboolean builder_context_get_use_rofiles (BuilderContext *self); void builder_context_set_use_rofiles (BuilderContext *self, gboolean use_rofiles); +gboolean builder_context_get_run_tests (BuilderContext *self); +void builder_context_set_run_tests (BuilderContext *self, + gboolean run_tests); char ** builder_context_extend_env (BuilderContext *self, char **envp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-git.c new/flatpak-builder-0.10.5/src/builder-git.c --- old/flatpak-builder-0.10.4/src/builder-git.c 2017-11-06 14:25:45.000000000 +0100 +++ new/flatpak-builder-0.10.5/src/builder-git.c 2017-11-07 10:20:02.000000000 +0100 @@ -578,7 +578,7 @@ { g_print ("Fetching full git repo %s\n", repo_location); if (!git (mirror_dir, NULL, 0, error, - "fetch", "-p", "--no-recurse-submodules", "--tags", origin, "*:*", + "fetch", "-f", "-p", "--no-recurse-submodules", "--tags", origin, "*:*", was_shallow ? "--unshallow" : NULL, NULL)) return FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-main.c new/flatpak-builder-0.10.5/src/builder-main.c --- old/flatpak-builder-0.10.4/src/builder-main.c 2017-11-06 13:46:11.000000000 +0100 +++ new/flatpak-builder-0.10.5/src/builder-main.c 2017-11-24 14:49:17.000000000 +0100 @@ -38,6 +38,7 @@ static gboolean opt_version; static gboolean opt_run; static gboolean opt_disable_cache; +static gboolean opt_disable_tests; static gboolean opt_disable_rofiles; static gboolean opt_download_only; static gboolean opt_bundle_sources; @@ -56,6 +57,7 @@ static gboolean opt_sandboxed; static gboolean opt_rebuild_on_sdk_change; static gboolean opt_skip_if_unchanged; +static char *opt_state_dir; static char *opt_from_git; static char *opt_from_git_branch; static char *opt_stop_at; @@ -76,6 +78,8 @@ static gboolean opt_install_deps_only; static gboolean opt_user; static char *opt_installation; +static gboolean opt_log_session_bus; +static gboolean opt_log_system_bus; static GOptionEntry entries[] = { { "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL }, @@ -85,6 +89,7 @@ { "run", 0, 0, G_OPTION_ARG_NONE, &opt_run, "Run a command in the build directory (see --run --help)", NULL }, { "ccache", 0, 0, G_OPTION_ARG_NONE, &opt_ccache, "Use ccache", NULL }, { "disable-cache", 0, 0, G_OPTION_ARG_NONE, &opt_disable_cache, "Disable cache lookups", NULL }, + { "disable-tests", 0, 0, G_OPTION_ARG_NONE, &opt_disable_tests, "Don't run tests", NULL }, { "disable-rofiles-fuse", 0, 0, G_OPTION_ARG_NONE, &opt_disable_rofiles, "Disable rofiles-fuse use", NULL }, { "disable-download", 0, 0, G_OPTION_ARG_NONE, &opt_disable_download, "Don't download any new sources", NULL }, { "disable-updates", 0, 0, G_OPTION_ARG_NONE, &opt_disable_updates, "Only download missing sources, never update to latest vcs version", NULL }, @@ -123,6 +128,7 @@ { "user", 0, 0, G_OPTION_ARG_NONE, &opt_user, "Install dependencies in user installations", NULL }, { "system", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_user, "Install dependencies in system-wide installations (default)", NULL }, { "installation", 0, 0, G_OPTION_ARG_STRING, &opt_installation, "Install dependencies in a specific system-wide installation", "NAME" }, + { "state-dir", 0, 0, G_OPTION_ARG_FILENAME, &opt_state_dir, "Use this directory for state instead of .flatpak-builder", "PATH" }, { NULL } }; @@ -130,6 +136,8 @@ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL }, { "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, "Architecture to build for (must be host compatible)", "ARCH" }, { "run", 0, 0, G_OPTION_ARG_NONE, &opt_run, "Run a command in the build directory", NULL }, + { "log-session-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_session_bus, N_("Log session bus calls"), NULL }, + { "log-system-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_system_bus, N_("Log system bus calls"), NULL }, { "ccache", 0, 0, G_OPTION_ARG_NONE, &opt_ccache, "Use ccache", NULL }, { NULL } }; @@ -149,7 +157,7 @@ { /* Make this look like normal console output */ if (log_level & G_LOG_LEVEL_DEBUG) - g_printerr ("XAB: %s\n", message); + g_printerr ("FB: %s\n", message); else g_printerr ("%s: %s\n", g_get_prgname (), message); } @@ -260,6 +268,7 @@ g_autoptr(GFile) app_dir = NULL; g_autoptr(BuilderCache) cache = NULL; g_autofree char *cache_branch = NULL; + g_autofree char *escaped_cache_branch = NULL; g_autoptr(GFileEnumerator) dir_enum = NULL; g_autoptr(GFileEnumerator) dir_enum2 = NULL; g_autofree char *cwd = NULL; @@ -275,6 +284,7 @@ g_autofree char *manifest_basename = NULL; int i, first_non_arg, orig_argc; int argnr; + char *p; setlocale (LC_ALL, ""); @@ -370,9 +380,10 @@ cwd = g_get_current_dir (); cwd_dir = g_file_new_for_path (cwd); - build_context = builder_context_new (cwd_dir, app_dir); + build_context = builder_context_new (cwd_dir, app_dir, opt_state_dir); builder_context_set_use_rofiles (build_context, !opt_disable_rofiles); + builder_context_set_run_tests (build_context, !opt_disable_tests); builder_context_set_keep_build_dirs (build_context, opt_keep_build_dirs); builder_context_set_delete_build_dirs (build_context, opt_delete_build_dirs); builder_context_set_sandboxed (build_context, opt_sandboxed); @@ -555,7 +566,9 @@ if (!builder_manifest_run (manifest, build_context, arg_context, orig_argv + first_non_arg + 2, - orig_argc - first_non_arg - 2, &error)) + orig_argc - first_non_arg - 2, + opt_log_session_bus, opt_log_system_bus, + &error)) { g_printerr ("Error running %s: %s\n", argv[3], error->message); return 1; @@ -598,6 +611,22 @@ } } + /* Verify that cache and build dir is on same filesystem */ + { + g_autofree char *state_path = g_file_get_path (builder_context_get_state_dir (build_context)); + g_autoptr(GFile) app_parent = g_file_get_parent (builder_context_get_app_dir (build_context)); + g_autofree char *app_parent_path = g_file_get_path (app_parent); + struct stat buf1, buf2; + + if (stat (app_parent_path, &buf1) == 0 && stat (state_path, &buf2) == 0 && + buf1.st_dev != buf2.st_dev) + { + g_printerr ("The state dir (%s) is not on the same filesystem as the target dir (%s)\n", + state_path, app_parent_path); + return 1; + } + } + builder_context_set_checksum_for (build_context, manifest_basename, json_sha256); if (!builder_manifest_start (manifest, opt_allow_missing_runtimes, build_context, &error)) @@ -629,9 +658,23 @@ return 0; } - cache_branch = g_strconcat (builder_context_get_arch (build_context), "-", manifest_basename, NULL); + if (opt_state_dir) + { + /* If the state dir can be shared we need to use a global identifier for the key */ + g_autofree char *manifest_path = g_file_get_path (manifest_file); + cache_branch = g_strconcat (builder_context_get_arch (build_context), "-", manifest_path + 1, NULL); + } + else + cache_branch = g_strconcat (builder_context_get_arch (build_context), "-", manifest_basename, NULL); + + escaped_cache_branch = g_uri_escape_string (cache_branch, "", TRUE); + for (p = escaped_cache_branch; *p; p++) + { + if (*p == '%') + *p = '_'; + } - cache = builder_cache_new (build_context, app_dir, cache_branch); + cache = builder_cache_new (build_context, app_dir, escaped_cache_branch); if (!builder_cache_open (cache, &error)) { g_printerr ("Error opening cache: %s\n", error->message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-manifest.c new/flatpak-builder-0.10.5/src/builder-manifest.c --- old/flatpak-builder-0.10.4/src/builder-manifest.c 2017-10-27 12:33:41.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-manifest.c 2017-11-15 13:33:22.000000000 +0100 @@ -2131,13 +2131,16 @@ builder_manifest_find_appdata_file (BuilderManifest *self, GFile *app_root) { + /* We order these so that share/appdata/XXX.appdata.xml if found + first, as this is the target name, and apps may have both, which will + cause issues with the rename. */ const char *extensions[] = { - ".metainfo.xml", ".appdata.xml", + ".metainfo.xml", }; const char *dirs[] = { - "share/metainfo", "share/appdata", + "share/metainfo", }; g_autoptr(GFile) source = NULL; @@ -3407,6 +3410,8 @@ FlatpakContext *arg_context, char **argv, int argc, + gboolean log_session_bus, + gboolean log_system_bus, GError **error) { g_autoptr(GPtrArray) args = NULL; @@ -3457,6 +3462,12 @@ /* Just add something so that we get the default rules (own our own id) */ g_ptr_array_add (args, g_strdup ("--talk-name=org.freedesktop.DBus")); + if (log_session_bus) + g_ptr_array_add (args, g_strdup ("--log-session-bus")); + + if (log_system_bus) + g_ptr_array_add (args, g_strdup ("--log-system-bus")); + /* Inherit all finish args except --filesystem and some that * build doesn't understand so the command gets the same access * as the final app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-manifest.h new/flatpak-builder-0.10.5/src/builder-manifest.h --- old/flatpak-builder-0.10.4/src/builder-manifest.h 2017-08-25 09:32:10.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-manifest.h 2017-11-15 13:33:22.000000000 +0100 @@ -100,6 +100,8 @@ FlatpakContext *arg_context, char **argv, int argc, + gboolean log_session_bus, + gboolean log_system_bus, GError **error); gboolean builder_manifest_show_deps (BuilderManifest *self, BuilderContext *context, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-module.c new/flatpak-builder-0.10.5/src/builder-module.c --- old/flatpak-builder-0.10.4/src/builder-module.c 2017-10-09 13:29:19.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-module.c 2017-11-24 14:49:17.000000000 +0100 @@ -49,6 +49,7 @@ char **make_args; char **make_install_args; char *install_rule; + char *test_rule; char *buildsystem; char **ensure_writable; char **only_arches; @@ -61,6 +62,7 @@ gboolean no_python_timestamp_fix; gboolean cmake; gboolean builddir; + gboolean run_tests; BuilderOptions *build_options; GPtrArray *changes; char **cleanup; @@ -68,6 +70,7 @@ GList *sources; GList *modules; char **build_commands; + char **test_commands; }; typedef struct @@ -92,6 +95,7 @@ PROP_NO_PYTHON_TIMESTAMP_FIX, PROP_CMAKE, PROP_INSTALL_RULE, + PROP_TEST_RULE, PROP_BUILDSYSTEM, PROP_BUILDDIR, PROP_CONFIG_OPTS, @@ -99,6 +103,7 @@ PROP_MAKE_INSTALL_ARGS, PROP_ENSURE_WRITABLE, PROP_ONLY_ARCHES, + PROP_RUN_TESTS, PROP_SKIP_ARCHES, PROP_SOURCES, PROP_BUILD_OPTIONS, @@ -107,6 +112,7 @@ PROP_POST_INSTALL, PROP_MODULES, PROP_BUILD_COMMANDS, + PROP_TEST_COMMANDS, LAST_PROP }; @@ -134,6 +140,7 @@ g_free (self->name); g_free (self->subdir); g_free (self->install_rule); + g_free (self->test_rule); g_free (self->buildsystem); g_strfreev (self->post_install); g_strfreev (self->config_opts); @@ -148,6 +155,7 @@ g_strfreev (self->cleanup_platform); g_list_free_full (self->modules, g_object_unref); g_strfreev (self->build_commands); + g_strfreev (self->test_commands); if (self->changes) g_ptr_array_unref (self->changes); @@ -209,6 +217,10 @@ g_value_set_string (value, self->install_rule); break; + case PROP_TEST_RULE: + g_value_set_string (value, self->test_rule); + break; + case PROP_BUILDDIR: g_value_set_boolean (value, self->builddir); break; @@ -265,6 +277,14 @@ g_value_set_boxed (value, self->build_commands); break; + case PROP_TEST_COMMANDS: + g_value_set_boxed (value, self->test_commands); + break; + + case PROP_RUN_TESTS: + g_value_set_boolean (value, self->run_tests); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -333,6 +353,11 @@ self->install_rule = g_value_dup_string (value); break; + case PROP_TEST_RULE: + g_free (self->test_rule); + self->test_rule = g_value_dup_string (value); + break; + case PROP_BUILDDIR: self->builddir = g_value_get_boolean (value); break; @@ -413,6 +438,16 @@ g_strfreev (tmp); break; + case PROP_TEST_COMMANDS: + tmp = self->test_commands; + self->test_commands = g_strdupv (g_value_get_boxed (value)); + g_strfreev (tmp); + break; + + case PROP_RUN_TESTS: + self->run_tests = g_value_get_boolean (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -505,6 +540,13 @@ NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, + PROP_TEST_RULE, + g_param_spec_string ("test-rule", + "", + "", + NULL, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_BUILDDIR, g_param_spec_boolean ("builddir", "", @@ -600,6 +642,20 @@ "", G_TYPE_STRV, G_PARAM_READWRITE)); + g_object_class_install_property (object_class, + PROP_TEST_COMMANDS, + g_param_spec_boxed ("test-commands", + "", + "", + G_TYPE_STRV, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, + PROP_RUN_TESTS, + g_param_spec_boolean ("run-tests", + "", + "", + FALSE, + G_PARAM_READWRITE)); } static void @@ -1256,6 +1312,7 @@ g_autofree char *make_j = NULL; g_autofree char *make_l = NULL; const char *make_cmd = NULL; + const char *test_arg = NULL; gboolean autotools = FALSE, cmake = FALSE, cmake_ninja = FALSE, meson = FALSE, simple = FALSE, qmake = FALSE; g_autoptr(GFile) configure_file = NULL; @@ -1583,11 +1640,20 @@ builder_set_term_title (_("Installing %s"), self->name); if (meson || cmake_ninja) - make_cmd = "ninja"; + { + make_cmd = "ninja"; + test_arg = "test"; + } else if (simple) make_cmd = NULL; else - make_cmd = "make"; + { + make_cmd = "make"; + test_arg = "check"; + } + + if (self->test_rule) + test_arg = self->test_rule; if (make_cmd) { @@ -1645,6 +1711,41 @@ } } + /* Run unit tests */ + + if (self->run_tests && builder_context_get_run_tests (context)) + { + g_auto(GStrv) test_args = NULL; + + builder_set_term_title (_("Testing %s"), self->name); + g_print ("Running tests\n"); + + test_args = builder_options_get_test_args (self->build_options, context, error); + if (test_args == NULL) + return FALSE; + + if (make_cmd && test_arg && *test_arg != 0) + { + if (!build (app_dir, self->name, context, source_dir, build_dir_relative, test_args, env, error, + make_cmd, test_arg, NULL)) + { + g_prefix_error (error, "Running %s %s failed: ", make_cmd, test_arg); + return FALSE; + } + } + + for (i = 0; self->test_commands != NULL && self->test_commands[i] != NULL; i++) + { + g_print ("Running: %s\n", self->test_commands[i]); + if (!build (app_dir, self->name, context, source_dir, build_dir_relative, test_args, env, error, + "/bin/sh", "-c", self->test_commands[i], NULL)) + { + g_prefix_error (error, "Running test command '%s' failed: ", self->test_commands[i]); + return FALSE; + } + } + } + if (!self->no_python_timestamp_fix) post_process_flags |= BUILDER_POST_PROCESS_FLAGS_PYTHON_TIMESTAMPS; @@ -1793,6 +1894,7 @@ builder_cache_checksum_strv (cache, self->build_commands); builder_cache_checksum_str (cache, self->buildsystem); builder_cache_checksum_str (cache, self->install_rule); + builder_cache_checksum_compat_boolean (cache, self->run_tests); if (self->build_options) builder_options_checksum (self->build_options, cache, context); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-options.c new/flatpak-builder-0.10.5/src/builder-options.c --- old/flatpak-builder-0.10.4/src/builder-options.c 2017-10-09 13:32:29.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-options.c 2017-11-24 14:49:17.000000000 +0100 @@ -45,9 +45,11 @@ char *ldflags; char *append_path; char *append_ld_library_path; + char *append_pkg_config_path; char *prefix; char **env; char **build_args; + char **test_args; char **config_opts; char **make_args; char **make_install_args; @@ -77,11 +79,13 @@ PROP_NO_DEBUGINFO_COMPRESSION, PROP_ARCH, PROP_BUILD_ARGS, + PROP_TEST_ARGS, PROP_CONFIG_OPTS, PROP_MAKE_ARGS, PROP_MAKE_INSTALL_ARGS, PROP_APPEND_PATH, PROP_APPEND_LD_LIBRARY_PATH, + PROP_APPEND_PKG_CONFIG_PATH, LAST_PROP }; @@ -97,9 +101,11 @@ g_free (self->ldflags); g_free (self->append_path); g_free (self->append_ld_library_path); + g_free (self->append_pkg_config_path); g_free (self->prefix); g_strfreev (self->env); g_strfreev (self->build_args); + g_strfreev (self->test_args); g_strfreev (self->config_opts); g_strfreev (self->make_args); g_strfreev (self->make_install_args); @@ -142,6 +148,10 @@ g_value_set_string (value, self->append_ld_library_path); break; + case PROP_APPEND_PKG_CONFIG_PATH: + g_value_set_string (value, self->append_pkg_config_path); + break; + case PROP_PREFIX: g_value_set_string (value, self->prefix); break; @@ -158,6 +168,10 @@ g_value_set_boxed (value, self->build_args); break; + case PROP_TEST_ARGS: + g_value_set_boxed (value, self->test_args); + break; + case PROP_CONFIG_OPTS: g_value_set_boxed (value, self->config_opts); break; @@ -228,6 +242,11 @@ self->append_ld_library_path = g_value_dup_string (value); break; + case PROP_APPEND_PKG_CONFIG_PATH: + g_clear_pointer (&self->append_pkg_config_path, g_free); + self->append_pkg_config_path = g_value_dup_string (value); + break; + case PROP_PREFIX: g_clear_pointer (&self->prefix, g_free); self->prefix = g_value_dup_string (value); @@ -251,6 +270,12 @@ g_strfreev (tmp); break; + case PROP_TEST_ARGS: + tmp = self->test_args; + self->test_args = g_strdupv (g_value_get_boxed (value)); + g_strfreev (tmp); + break; + case PROP_CONFIG_OPTS: tmp = self->config_opts; self->config_opts = g_strdupv (g_value_get_boxed (value)); @@ -338,6 +363,13 @@ NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, + PROP_APPEND_PKG_CONFIG_PATH, + g_param_spec_string ("append-pkg-config-path", + "", + "", + NULL, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_PREFIX, g_param_spec_string ("prefix", "", @@ -366,6 +398,13 @@ G_TYPE_STRV, G_PARAM_READWRITE)); g_object_class_install_property (object_class, + PROP_TEST_ARGS, + g_param_spec_boxed ("test-args", + "", + "", + G_TYPE_STRV, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_CONFIG_OPTS, g_param_spec_boxed ("config-opts", "", @@ -730,6 +769,24 @@ } static char ** +builder_options_update_pkg_config_path (BuilderOptions *self, BuilderContext *context, char **envp) +{ + g_autofree char *path = NULL; + const char *old = NULL; + + old = g_environ_getenv (envp, "PKG_CONFIG_PATH"); + if (old == NULL) + old = "/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"; + + path = builder_options_get_appended_path (self, context, old, + G_STRUCT_OFFSET (BuilderOptions, append_pkg_config_path)); + if (path) + envp = g_environ_setenv (envp, "PKG_CONFIG_PATH", path, TRUE); + + return envp; +} + +static char ** builder_options_update_path (BuilderOptions *self, BuilderContext *context, char **envp) { g_autofree char *path = NULL; @@ -865,6 +922,7 @@ envp = builder_options_update_path (self, context, envp); envp = builder_options_update_ld_path (self, context, envp); + envp = builder_options_update_pkg_config_path (self, context, envp); return envp; } @@ -904,6 +962,44 @@ return (char **) g_ptr_array_free (g_steal_pointer (&array), FALSE); } +char ** +builder_options_get_test_args (BuilderOptions *self, + BuilderContext *context, + GError **error) +{ + g_autoptr(GList) options = get_all_options (self, context); + GList *l; + int i; + g_autoptr(GPtrArray) array = g_ptr_array_new_with_free_func (g_free); + + /* Last argument wins, so reverse the list for per-module to win */ + options = g_list_reverse (options); + + /* Always run tests readonly */ + g_ptr_array_add (array, g_strdup ("--readonly")); + + for (l = options; l != NULL; l = l->next) + { + BuilderOptions *o = l->data; + + if (o->test_args) + { + for (i = 0; o->test_args[i] != NULL; i++) + g_ptr_array_add (array, g_strdup (o->test_args[i])); + } + } + + if (array->len > 0 && builder_context_get_sandboxed (context)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Can't specify test-args in sandboxed build"); + return NULL; + } + + g_ptr_array_add (array, NULL); + + return (char **) g_ptr_array_free (g_steal_pointer (&array), FALSE); +} + static char ** builder_options_get_strv (BuilderOptions *self, BuilderContext *context, @@ -981,6 +1077,7 @@ builder_cache_checksum_str (cache, self->prefix); builder_cache_checksum_strv (cache, self->env); builder_cache_checksum_strv (cache, self->build_args); + builder_cache_checksum_compat_strv (cache, self->test_args); builder_cache_checksum_strv (cache, self->config_opts); builder_cache_checksum_strv (cache, self->make_args); builder_cache_checksum_strv (cache, self->make_install_args); @@ -988,6 +1085,10 @@ builder_cache_checksum_boolean (cache, self->no_debuginfo); builder_cache_checksum_boolean (cache, self->no_debuginfo_compression); + builder_cache_checksum_compat_str (cache, self->append_path); + builder_cache_checksum_compat_str (cache, self->append_ld_library_path); + builder_cache_checksum_compat_str (cache, self->append_pkg_config_path); + arch_options = g_hash_table_lookup (self->arch, builder_context_get_arch (context)); if (arch_options) builder_options_checksum (arch_options, cache, context); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flatpak-builder-0.10.4/src/builder-options.h new/flatpak-builder-0.10.5/src/builder-options.h --- old/flatpak-builder-0.10.4/src/builder-options.h 2017-10-09 13:29:19.000000000 +0200 +++ new/flatpak-builder-0.10.5/src/builder-options.h 2017-11-24 14:49:17.000000000 +0100 @@ -52,6 +52,9 @@ char ** builder_options_get_build_args (BuilderOptions *self, BuilderContext *context, GError **error); +char ** builder_options_get_test_args (BuilderOptions *self, + BuilderContext *context, + GError **error); char ** builder_options_get_config_opts (BuilderOptions *self, BuilderContext *context, char **base_opts);