diff --git a/pkgs/misc/cups/drivers/samsung/default.nix b/pkgs/misc/cups/drivers/samsung/default.nix index 26bd771e023a..556c408012d2 100644 --- a/pkgs/misc/cups/drivers/samsung/default.nix +++ b/pkgs/misc/cups/drivers/samsung/default.nix @@ -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