1 # Tested on linux-x86_64. Might work on linux-i386. Probably won't work on anything else.
3 # To use this driver in NixOS, add it to printing.drivers in configuration.nix.
4 # configuration.nix might look like this when you're done:
8 # drivers = [ pkgs.samsung-unified-linux-driver_4_01_17 ];
12 # (This advice was tested on the 1st November 2016.)
22 # Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
23 # to see what will break when upgrading. Consider a new versioned attribute.
25 installationPath = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64" else "i386";
26 appendPath = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "64";
27 libPath = lib.makeLibraryPath [ cups libusb-compat-0_1 ] + ":$out/lib:${lib.getLib stdenv.cc.cc}/lib${appendPath}";
28 in stdenv.mkDerivation rec {
29 pname = "samsung-UnifiedLinuxDriver";
33 url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
34 sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
37 nativeBuildInputs = [ patchPpdFilesHook ];
45 cd Linux/${installationPath}
46 mkdir -p $out/lib/cups/{backend,filter}
47 install -Dm755 mfp $out/lib/cups/backend/
48 install -Dm755 pstosecps pstospl pstosplc rastertospl rastertosplc $out/lib/cups/filter/
49 install -Dm755 libscmssc.so $out/lib/
52 for exe in $out/lib/cups/**/*; do
55 --set-rpath ${libPath} \
56 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
61 install -v at_root/usr/lib${appendPath}/libmfp.so.1.0.1 $out/lib
63 ln -s -f libmfp.so.1.0.1 libmfp.so.1
64 ln -s -f libmfp.so.1 libmfp.so
66 for lib in $out/lib/*.so; do
69 --set-rpath ${libPath} \
73 mkdir -p $out/share/cups/model/samsung
75 cd ../noarch/at_opt/share/ppd
76 cp -r ./* $out/share/cups/model/samsung
89 description = "Samsung's Linux printing drivers; includes binaries without source code";
90 homepage = "http://www.samsung.com/";
91 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
92 license = licenses.unfree;
93 platforms = platforms.linux;
94 maintainers = with maintainers; [ joko ];