Skip to content

Commit 3a084a8

Browse files
waernMic92
authored andcommittedMay 20, 2017
samsung-unified-linux-drive: Fix sane driver by patching rpaths
fixes #25779
1 parent 9694567 commit 3a084a8

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed
 

‎pkgs/misc/cups/drivers/samsung/default.nix

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, fetchurl, glibc, cups, libusb, ghostscript }:
1+
{ stdenv, fetchurl, glibc, cups, libusb, libxml2, ghostscript }:
22

33
let
44

@@ -18,10 +18,9 @@ in stdenv.mkDerivation rec {
1818
buildInputs = [
1919
cups
2020
libusb
21+
libxml2
2122
];
2223

23-
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
24-
2524
installPhase = ''
2625
2726
mkdir -p $out/bin
@@ -69,16 +68,15 @@ in stdenv.mkDerivation rec {
6968
'';
7069

7170
preFixup = ''
71+
for bin in "$out/bin/"*; do
72+
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
73+
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$bin"
74+
done
7275
73-
for bin in $out/bin/*; do
74-
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
75-
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$bin"
76-
done
77-
78-
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
79-
80-
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
76+
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
77+
patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb.out}/lib" "$out/lib/sane/libsane-smfp.so.1.0.1"
8178
79+
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
8280
'';
8381

8482
# all binaries are already stripped

0 commit comments

Comments
 (0)
Please sign in to comment.