From: Emil Velikov Date: Tue, 22 Oct 2024 20:28:27 +0000 (+0100) Subject: meson: always pass complete path to kmod-symlink.sh X-Git-Tag: v34~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=844835cd9a4e5f08e1a3eefb4928c5d769264894;p=thirdparty%2Fkmod.git meson: always pass complete path to kmod-symlink.sh The end-user can provide either relative (to prefix) or an absolute directory for bindir. Just fold the prefix and bindir with join_path() which handles this correctly and pass that to kmod-symlink.sh instead of relying on the MESON_INSTALL_DESTDIR_PREFIX environment variable. This was previously failing due to trying to create the symlink in the wrong location: $ meson setup --prefix /usr --bindir /bin build-gentoo $ DESTDIR=/tmp/install-gentoo meson install -C build-gentoo/ ... ln: failed to create symbolic link '/tmp/install-gentoo/usr//bin/depmod': No such file or directory FAILED: install script '/home/ldmartin/p/kmod/scripts/kmod-symlink.sh /bin/depmod' failed with exit code 1. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/205 [ fix typo, add repro ] Signed-off-by: Lucas De Marchi --- diff --git a/meson.build b/meson.build index c4eb57dd..58acf2ea 100644 --- a/meson.build +++ b/meson.build @@ -186,6 +186,7 @@ features = [] sysconfdir = get_option('sysconfdir') cdata.set_quoted('SYSCONFDIR', sysconfdir) +bindir = join_paths(get_option('prefix'), get_option('bindir')) libdir = join_paths(get_option('prefix'), get_option('libdir')) distconfdir = get_option('distconfdir') @@ -442,7 +443,7 @@ _tools = [ kmod_symlink = find_program('scripts/kmod-symlink.sh') foreach tool : _tools if get_option('tools') - symlink = join_paths(get_option('bindir'), tool) + symlink = join_paths(bindir, tool) meson.add_install_script(kmod_symlink, symlink) endif endforeach @@ -493,7 +494,7 @@ summary({ 'distconfdir' : distconfdir, 'libdir' : libdir, 'includedir' : join_paths(get_option('prefix'), get_option('includedir')), - 'bindir' : join_paths(get_option('prefix'), get_option('bindir')), + 'bindir' : bindir }, section : 'Directories') summary({ diff --git a/scripts/kmod-symlink.sh b/scripts/kmod-symlink.sh index 1f97bc51..6511284a 100755 --- a/scripts/kmod-symlink.sh +++ b/scripts/kmod-symlink.sh @@ -7,4 +7,4 @@ set -euo pipefail # # For context read through https://github.com/mesonbuild/meson/issues/9 -ln -sf kmod "$MESON_INSTALL_DESTDIR_PREFIX/$1" +ln -sf kmod "$DESTDIR/$1"