samsung-unified-linux-drive: Fix sane driver by patching rpaths

fixes #25779
This commit is contained in:
David Waern 2017-03-09 11:05:52 +01:00 committed by Jörg Thalheim
parent 9694567ac9
commit 3a084a80e7
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA

View File

@ -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