[pacman-dev] [PATCH 0/2] Building a unified dist tarball for
We currently support both autotools and meson, and each one has a mechanism for generating a distribution tarball which we can upload and sign. But using one won't let you build with the other build system (at least currently). autotools simply doesn't distribute meson bits, and meson will distribute anything checked into git, but not the autogen'ed content that users may well rely on. Here is a patch for each build system, which teaches it how to distribute the other's files. Eli Schwartz (2): autotools: distribute meson files meson: generate the autotools distribution files Makefile.am | 9 ++++++++- autogen.sh | 6 +++++- doc/Makefile.am | 1 + lib/libalpm/Makefile.am | 2 ++ meson.build | 2 ++ scripts/Makefile.am | 2 ++ src/common/Makefile.am | 3 ++- src/pacman/Makefile.am | 2 ++ src/util/Makefile.am | 2 ++ test/pacman/Makefile.am | 1 + test/scripts/Makefile.am | 1 + test/util/Makefile.am | 1 + 12 files changed, 29 insertions(+), 3 deletions(-) -- 2.22.1
If we use make dist to create the official, signed release tarballs, those will not have meson build files by default since autotools doesn't know what they are. Also distribute all src/common/ files. We never strictly needed any of them to be distributed with autotools, because the dist tarball dereferences the symlinks (???), but only some of them were being distributed, and meson needs them to be in the right location as we only build libcommon from the primary files. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- Makefile.am | 9 ++++++++- doc/Makefile.am | 1 + lib/libalpm/Makefile.am | 2 ++ scripts/Makefile.am | 2 ++ src/common/Makefile.am | 3 ++- src/pacman/Makefile.am | 2 ++ src/util/Makefile.am | 2 ++ test/pacman/Makefile.am | 1 + test/scripts/Makefile.am | 1 + test/util/Makefile.am | 1 + 10 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 98ad8b62..c661f447 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,14 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version \ # Some files automatically included, so they aren't specified below: # AUTHORS, COPYING, NEWS, README -EXTRA_DIST = HACKING test/tap.sh +EXTRA_DIST = \ + HACKING test/tap.sh \ + meson.build meson_options.txt \ + build-aux/edit-script.sh.in \ + build-aux/meson-install-script.sh \ + build-aux/meson-make-symlink.sh \ + build-aux/script-wrapper.sh.in + # Sample makepkg prototype files pkgdatadir = ${datadir}/${PACKAGE} diff --git a/doc/Makefile.am b/doc/Makefile.am index 5c575832..a8dbbe05 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -33,6 +33,7 @@ HTML_DOCS = \ $(HTML_OTHER) EXTRA_DIST = \ + meson.build \ asciidoc.conf \ asciidoc-override.css \ alpm-hooks.5.asciidoc \ diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am index 1e01feeb..e4f83223 100644 --- a/lib/libalpm/Makefile.am +++ b/lib/libalpm/Makefile.am @@ -2,6 +2,8 @@ AUTOMAKE_OPTIONS = gnu SUBDIRS = po +EXTRA_DIST = meson.build po/meson.build + lib_LTLIBRARIES = libalpm.la include_HEADERS = alpm_list.h alpm.h diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1008fed3..7b6cd00c 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -22,6 +22,7 @@ OURSCRIPTS = \ repo-add EXTRA_DIST = \ + meson.build \ libmakepkg.pc.in \ makepkg.sh.in \ makepkg-template.pl.in \ @@ -135,6 +136,7 @@ LIBMAKEPKG_IN = \ libmakepkg/util/util.sh LIBMAKEPKG_DIST = \ + $(addprefix libmakepkg/, $(addsuffix /meson.build, $(LIBMAKEPKGDIRS))) \ $(addsuffix .in, $(LIBMAKEPKG_IN)) WRAPPER = \ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index c0e37273..05378712 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,2 +1,3 @@ EXTRA_DIST = \ - util-common.h util-common.c + meson.build \ + ini.h ini.c util-common.h util-common.c diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am index 2344daff..ac2f8e46 100644 --- a/src/pacman/Makefile.am +++ b/src/pacman/Makefile.am @@ -1,5 +1,7 @@ SUBDIRS = po +EXTRA_DIST = meson.build po/meson.build + # paths set at make time conffile = ${sysconfdir}/pacman.conf dbpath = ${localstatedir}/lib/pacman/ diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 8c6a5771..a454f224 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -1,3 +1,5 @@ +EXTRA_DIST = meson.build + # paths set at make time conffile = ${sysconfdir}/pacman.conf dbpath = ${localstatedir}/lib/pacman/ diff --git a/test/pacman/Makefile.am b/test/pacman/Makefile.am index a36908a7..d211215a 100644 --- a/test/pacman/Makefile.am +++ b/test/pacman/Makefile.am @@ -14,6 +14,7 @@ check_SCRIPTS = \ noinst_SCRIPTS = $(check_SCRIPTS) EXTRA_DIST = \ + meson.build \ README \ TODO \ ChangeLog \ diff --git a/test/scripts/Makefile.am b/test/scripts/Makefile.am index 450a278d..07fe63da 100644 --- a/test/scripts/Makefile.am +++ b/test/scripts/Makefile.am @@ -7,4 +7,5 @@ check_SCRIPTS = \ noinst_SCRIPTS = $(check_SCRIPTS) EXTRA_DIST = \ + meson.build \ $(check_SCRIPTS) diff --git a/test/util/Makefile.am b/test/util/Makefile.am index 92824e8c..a270079f 100644 --- a/test/util/Makefile.am +++ b/test/util/Makefile.am @@ -4,4 +4,5 @@ check_SCRIPTS = \ noinst_SCRIPTS = $(check_SCRIPTS) EXTRA_DIST = \ + meson.build \ $(check_SCRIPTS) -- 2.22.1
For cross-compatibility with autotools, a dist tarball created from either meson or autotools should have everything needed to build with either build system. This ensures that all the files which "make dist" would make available, are available. In order for this to work, autogen.sh needs to know how to enter the dist working directory, and fail if it cannot successfully cd or run autoreconf. (It's fine if patch fails because the patch was already applied.) Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- autogen.sh | 6 +++++- meson.build | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 18fa641d..3b0acec6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,10 @@ #!/bin/sh -x -autoreconf -i +if [ -n "$MESON_DIST_ROOT" ]; then + cd "$MESON_DIST_ROOT" || exit 1 +fi + +autoreconf -i || exit 1 patch -d build-aux -Np0 -i ltmain-asneeded.patch exit 0 diff --git a/meson.build b/meson.build index 7be2425c..389a95b7 100644 --- a/meson.build +++ b/meson.build @@ -414,6 +414,8 @@ TEST_ENV.set('PMTEST_LIBMAKEPKG_DIR', join_paths(meson.build_root(), 'scripts/li TEST_ENV.set('PMTEST_UTIL_DIR', meson.build_root() + '/') TEST_ENV.set('PMTEST_SCRIPT_DIR', join_paths(meson.build_root(), 'scripts/')) +meson.add_dist_script('./autogen.sh') + subdir('test/pacman') subdir('test/scripts') subdir('test/util') -- 2.22.1
On 16/8/19 9:55 am, Eli Schwartz wrote:
For cross-compatibility with autotools, a dist tarball created from either meson or autotools should have everything needed to build with either build system. This ensures that all the files which "make dist" would make available, are available.
In order for this to work, autogen.sh needs to know how to enter the dist working directory, and fail if it cannot successfully cd or run autoreconf. (It's fine if patch fails because the patch was already applied.)
I don't think this is necessary. The transition is from autotools to meson. We need to distribute meson files with autotools until a point comes where we swap to meson. Meson tarballs do not need to distribute autotools files. Allan
On 10/3/19 9:20 PM, Allan McRae wrote:
On 16/8/19 9:55 am, Eli Schwartz wrote:
For cross-compatibility with autotools, a dist tarball created from either meson or autotools should have everything needed to build with either build system. This ensures that all the files which "make dist" would make available, are available.
In order for this to work, autogen.sh needs to know how to enter the dist working directory, and fail if it cannot successfully cd or run autoreconf. (It's fine if patch fails because the patch was already applied.)
I don't think this is necessary. The transition is from autotools to meson. We need to distribute meson files with autotools until a point comes where we swap to meson. Meson tarballs do not need to distribute autotools files.
Fair enough. As long as while both build systems are supported, the dist tarballs which are only ever created by you, are built with the one that distributes both. :D So, "first patch only" it is, I guess. (I still wanted to submit both patches for the sake of completion, but I sort of expected the second to be rejected for this reason.) -- Eli Schwartz Bug Wrangler and Trusted User
participants (2)
-
Allan McRae
-
Eli Schwartz