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.)
23 # Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
24 # to see what will break when upgrading. Consider a new versioned attribute.
26 installationPath = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64" else "i386";
27 appendPath = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "64";
33 + ":$out/lib:${lib.getLib stdenv.cc.cc}/lib${appendPath}";
35 stdenv.mkDerivation rec {
36 pname = "samsung-UnifiedLinuxDriver";
40 url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
41 sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
44 nativeBuildInputs = [ patchPpdFilesHook ];
52 cd Linux/${installationPath}
53 mkdir -p $out/lib/cups/{backend,filter}
54 install -Dm755 mfp $out/lib/cups/backend/
55 install -Dm755 pstosecps pstospl pstosplc rastertospl rastertosplc $out/lib/cups/filter/
56 install -Dm755 libscmssc.so $out/lib/
59 for exe in $out/lib/cups/**/*; do
62 --set-rpath ${libPath} \
63 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
68 install -v at_root/usr/lib${appendPath}/libmfp.so.1.0.1 $out/lib
70 ln -s -f libmfp.so.1.0.1 libmfp.so.1
71 ln -s -f libmfp.so.1 libmfp.so
73 for lib in $out/lib/*.so; do
76 --set-rpath ${libPath} \
80 mkdir -p $out/share/cups/model/samsung
82 cd ../noarch/at_opt/share/ppd
83 cp -r ./* $out/share/cups/model/samsung
96 description = "Samsung's Linux printing drivers; includes binaries without source code";
97 homepage = "http://www.samsung.com/";
98 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
99 license = licenses.unfree;
100 platforms = platforms.linux;
101 maintainers = with maintainers; [ joko ];