From 958b1a7fb4f384b17b23a68ecd7f90ef4bbef4ab Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sun, 21 Nov 2021 09:49:39 -0800 Subject: Make the generated reproducible .cmake files reproducible. Whilst working on the Reproducible Builds effort [0], I noticed that meson did not generate reproducible .cmake files: they include the full path name. This commit not only makes the build reproducible, but it also matches CMake's own behaviour. Specifically, CMakePackageConfigHelpers.cmake does the equivalent transformation using: get_filename_component(inputFileName "${_inputFile}" NAME) I originally filed this in Debian as bug #1000327 [1]. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/1000327 --- mesonbuild/modules/cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/modules/cmake.py') diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 76a7b9b..67fdd0c 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -299,7 +299,7 @@ class CmakeModule(ExtensionModule): def create_package_file(self, infile, outfile, PACKAGE_RELATIVE_PATH, extra, confdata): package_init = PACKAGE_INIT_BASE.replace('@PACKAGE_RELATIVE_PATH@', PACKAGE_RELATIVE_PATH) - package_init = package_init.replace('@inputFileName@', infile) + package_init = package_init.replace('@inputFileName@', os.path.basename(infile)) package_init += extra package_init += PACKAGE_INIT_SET_AND_CHECK -- cgit v1.1