summary refs log tree commit diff
path: root/pkgs/development/libraries/wlroots/default.nix
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2019-02-03 17:52:53 +0100
committerMichael Weiss <dev.primeos@gmail.com>2019-02-03 17:59:50 +0100
commitbda21694d1a8acd8ac06ec8f4ce3830051b42378 (patch)
tree193308b1314ac6f183954040f258724ac22b5a30 /pkgs/development/libraries/wlroots/default.nix
parent4bff986b927d81500f89cff7d82ab1a7a42fbb9c (diff)
downloadnixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar.gz
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar.bz2
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar.lz
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar.xz
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.tar.zst
nixpkgs-bda21694d1a8acd8ac06ec8f4ce3830051b42378.zip
wlroots: Fix the ELF binaries (rootston + examples)
Due to stdenv changes the binaries where broken during the fixup phase
(while stripping all binaries). The current solution isn't optimal but
there must not be any cyclic dependencies on $out.
Diffstat (limited to 'pkgs/development/libraries/wlroots/default.nix')
-rw-r--r--pkgs/development/libraries/wlroots/default.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/pkgs/development/libraries/wlroots/default.nix b/pkgs/development/libraries/wlroots/default.nix
index d25f1d0b4c8..6e7090a9c5b 100644
--- a/pkgs/development/libraries/wlroots/default.nix
+++ b/pkgs/development/libraries/wlroots/default.nix
@@ -40,14 +40,21 @@ in stdenv.mkDerivation rec {
   '';
 
   postInstall = ''
-    # Install rootston (the reference compositor) to $bin and $examples
+    # Copy the library to $bin and $examples
+    for output in "$bin" "$examples"; do
+      mkdir -p $output/lib
+      cp -P libwlroots* $output/lib/
+    done
+  '';
+
+  postFixup = ''
+    # Install rootston (the reference compositor) to $bin and $examples (this
+    # has to be done after the fixup phase to prevent broken binaries):
     for output in "$bin" "$examples"; do
       mkdir -p $output/bin
       cp rootston/rootston $output/bin/
-      mkdir $output/lib
-      cp libwlroots* $output/lib/
       patchelf \
-        --set-rpath "$output/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
+        --set-rpath "$(patchelf --print-rpath $output/bin/rootston | sed s,$out,$output,g)" \
         $output/bin/rootston
       mkdir $output/etc
       cp ../rootston/rootston.ini.example $output/etc/rootston.ini
@@ -59,10 +66,10 @@ in stdenv.mkDerivation rec {
     mkdir -p $examples/bin
     cd ./examples
     for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
-      patchelf \
-        --set-rpath "$examples/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
-        "$binary"
       cp "$binary" "$examples/bin/wlroots-$binary"
+      patchelf \
+        --set-rpath "$(patchelf --print-rpath $output/bin/rootston | sed s,$out,$examples,g)" \
+        "$examples/bin/wlroots-$binary"
     done
   '';