From daf25010cb5b6ca448e4e01b0deb67b9c8b10819 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Tue, 1 Oct 2024 13:16:36 +0000 Subject: [PATCH] meson/muon: consolidate scripts & sanitise dist Move some of the build-system scripts into a top-level meson-scripts directly, and add a script (meson-scripts/dist-tarball.sh) to clean up the dist tarball before it's created. --- runme.sh => meson-scripts/conf-cmd.sh | 0 meson-scripts/dist-tarball.sh | 21 +++++++++++++++++++++ meson.build | 8 ++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) rename runme.sh => meson-scripts/conf-cmd.sh (100%) create mode 100755 meson-scripts/dist-tarball.sh diff --git a/runme.sh b/meson-scripts/conf-cmd.sh similarity index 100% rename from runme.sh rename to meson-scripts/conf-cmd.sh diff --git a/meson-scripts/dist-tarball.sh b/meson-scripts/dist-tarball.sh new file mode 100755 index 000000000..a67bb4029 --- /dev/null +++ b/meson-scripts/dist-tarball.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Script to sanitise the tarball when calling "meson dist". By default, +# "meson dist" calls git-archive, which includes more files than the autotools +# version of "make dist". + +# TODO: ".*" as a glob might be too much in the future; expand this out... +FILES_TO_IGNORE=".* +mkrelease.sh +dev-docs" + +( + cd "$MESON_DIST_ROOT" && { + IFS=$'\n' + for f in $FILES_TO_IGNORE + do + echo "Removing $f from tarball..." + rm -r "./$f" + done + } +) \ No newline at end of file diff --git a/meson.build b/meson.build index bffc1779a..bf376e6ca 100644 --- a/meson.build +++ b/meson.build @@ -22,6 +22,10 @@ add_project_arguments( language: 'c', ) +# This script is used to clean up the release tarball when calling +# "meson dist". +meson.add_dist_script('meson-scripts/dist-tarball.sh') + cc = meson.get_compiler('c') # Undefine _FOTIFY_SOURCE explicitly. fvwm3 needs work to support this. @@ -374,7 +378,7 @@ conf_out = configure_file( configuration: conf, ) -conf_cmd = '@0@/runme.sh'.format(meson.current_source_dir()) +conf_cmd = '@0@/meson-scripts/conf-cmd.sh'.format(meson.current_source_dir()) build_dir = '@0@/config.h'.format(meson.current_build_dir()) configure_file( output: 'config.h', @@ -566,4 +570,4 @@ summary( summary_depvals, bool_yn: true, section: 'Dependencies', -) +) \ No newline at end of file