diff options
author | Pascal Bach <pascal.bach@nextrem.ch> | 2018-04-11 20:51:39 +0200 |
---|---|---|
committer | Pascal Bach <pascal.bach@nextrem.ch> | 2018-04-29 22:16:27 +0200 |
commit | caed1877ebf7a84f16ac1eb6af641af155e47b5b (patch) | |
tree | 0f5f84e92f20d5efd24c4c36128ae8a3d9f6ab0b | |
parent | e8672c8b3751622c5d603bc7bb144377d1d3498c (diff) |
cryptsetup-generator: add postFixup
This makes cryptsetup-generator link correctly to the shared systemd library.
-rw-r--r-- | pkgs/os-specific/linux/systemd/cryptsetup-generator.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix b/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix index f69269347e373..5c6efb4401339 100644 --- a/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix +++ b/pkgs/os-specific/linux/systemd/cryptsetup-generator.nix @@ -13,6 +13,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 |