Merge pull request #38961 from bachp/cryptsetup-generator

cryptsetup-generator: add postFixup
This commit is contained in:
xeji 2018-05-05 17:41:40 +02:00 committed by GitHub
commit e450d9fb90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,17 @@ stdenv.lib.overrideDerivation systemd (p: {
ninja systemd-cryptsetup systemd-cryptsetup-generator
'';
# As ninja install is not used here, the rpath needs to be manually fixed.
# Otherwise the resulting binary doesn't properly link against systemd-shared.so
postFixup = ''
sharedLib=libsystemd-shared-${p.version}.so
for prog in `find $out -type f -executable`; do
(patchelf --print-needed $prog | grep $sharedLib > /dev/null) && (
patchelf --set-rpath `patchelf --print-rpath $prog`:"$out/lib/systemd" $prog
) || true
done
'';
installPhase = ''
mkdir -p $out/lib/systemd/
cp systemd-cryptsetup $out/lib/systemd/systemd-cryptsetup