summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@nextrem.ch>2018-04-11 20:51:39 +0200
committerPascal Bach <pascal.bach@nextrem.ch>2018-04-29 22:16:27 +0200
commitcaed1877ebf7a84f16ac1eb6af641af155e47b5b (patch)
tree0f5f84e92f20d5efd24c4c36128ae8a3d9f6ab0b /pkgs/os-specific/linux/systemd
parente8672c8b3751622c5d603bc7bb144377d1d3498c (diff)
downloadnixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar.gz
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar.bz2
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar.lz
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar.xz
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.tar.zst
nixlib-caed1877ebf7a84f16ac1eb6af641af155e47b5b.zip
cryptsetup-generator: add postFixup
This makes cryptsetup-generator link correctly
to the shared systemd library.
Diffstat (limited to 'pkgs/os-specific/linux/systemd')
-rw-r--r--pkgs/os-specific/linux/systemd/cryptsetup-generator.nix11
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 f69269347e37..5c6efb440133 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