Skip to content

Commit

Permalink
samsung-unified-linux-drive: Fix sane driver by patching rpaths
Browse files Browse the repository at this point in the history
fixes #25779
  • Loading branch information
waern authored and Mic92 committed May 20, 2017

Verified

This commit was signed with the committer’s verified signature.
Mic92 Jörg Thalheim
1 parent 9694567 commit 3a084a8
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions pkgs/misc/cups/drivers/samsung/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, glibc, cups, libusb, ghostscript }:
{ stdenv, fetchurl, glibc, cups, libusb, libxml2, ghostscript }:

let

@@ -18,10 +18,9 @@ in stdenv.mkDerivation rec {
buildInputs = [
cups
libusb
libxml2
];

phases = [ "unpackPhase" "installPhase" "fixupPhase" ];

installPhase = ''
mkdir -p $out/bin
@@ -69,16 +68,15 @@ in stdenv.mkDerivation rec {
'';

preFixup = ''
for bin in "$out/bin/"*; do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$bin"
done
for bin in $out/bin/*; do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$bin"
done
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb.out}/lib" "$out/lib/sane/libsane-smfp.so.1.0.1"
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
'';

# all binaries are already stripped

0 comments on commit 3a084a8

Please sign in to comment.