12 arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64" else "i386";
15 stdenv.mkDerivation rec {
16 pname = "samsung-unified-linux-driver";
20 sha256 = "0r66l9zp0p1qgakh4j08hynwsr4lsgq5yrpxyr0x4ldvl0z2b1bb";
21 url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
34 cp -R ${arch}/{gettext,pstosecps,rastertospl,smfpnetdiscovery,usbresetter} $out/bin
36 mkdir -p $out/etc/sane.d/dll.d/
37 install -m644 noarch/etc/smfp.conf $out/etc/sane.d
38 echo smfp >> $out/etc/sane.d/dll.d/smfp-scanner.conf
41 install -m755 ${arch}/libscmssc.so* $out/lib
43 mkdir -p $out/lib/cups/backend
44 ln -s $out/bin/smfpnetdiscovery $out/lib/cups/backend
46 mkdir -p $out/lib/cups/filter
47 ln -s $out/bin/{pstosecps,rastertospl} $out/lib/cups/filter
48 ln -s $ghostscript/bin/gs $out/lib/cups/filter
50 mkdir -p $out/lib/sane
51 install -m755 ${arch}/libsane-smfp.so* $out/lib/sane
52 ln -s libsane-smfp.so.1.0.1 $out/lib/sane/libsane-smfp.so.1
53 ln -s libsane-smfp.so.1 $out/lib/sane/libsane-smfp.so
55 mkdir -p $out/lib/udev/rules.d
57 OEM_FILE=noarch/oem.conf
58 INSTALL_LOG_FILE=/dev/null
59 . noarch/scripting_utils
60 . noarch/package_utils
61 . noarch/scanner-script.pkg
62 fill_full_template noarch/etc/smfp.rules.in $out/lib/udev/rules.d/60_smfp_samsung.rules
63 chmod -x $out/lib/udev/rules.d/60_smfp_samsung.rules
67 cp -R noarch/share/* $out/share
68 gzip -9 $out/share/ppd/*.ppd
69 rm -r $out/share/locale/*/*/install.mo
71 mkdir -p $out/share/cups
80 for bin in "$out/bin/"*; do
81 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
82 patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$bin"
85 patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$out/lib/libscmssc.so"
86 patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb-compat-0_1.out}/lib" "$out/lib/sane/libsane-smfp.so.1.0.1"
88 ln -s ${lib.getLib stdenv.cc.cc}/lib/libstdc++.so.6 $out/lib/
91 # all binaries are already stripped
94 # we did this in prefixup already
98 description = "Unified Linux Driver for Samsung printers and scanners";
99 homepage = "http://www.bchemnet.com/suldr";
100 downloadPage = "http://www.bchemnet.com/suldr/driver/";
101 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
102 license = licenses.unfree;
104 # Tested on linux-x86_64. Might work on linux-i386.
105 # Probably won't work on anything else.
106 platforms = platforms.linux;