[pacman-dev,2/2] meson: generate the autotools distribution files

Message ID 20190815235546.21922-3-eschwartz@archlinux.org
State Rejected, archived
Headers show
Series
  • Building a unified dist tarball for
Related show

Commit Message

Eli Schwartz Aug. 15, 2019, 11:55 p.m. UTC
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(-)

Comments

Allan McRae Oct. 4, 2019, 1:20 a.m. UTC | #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
Eli Schwartz Oct. 4, 2019, 1:31 a.m. UTC | #2
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.)

Patch

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')