git.iko.soy/typeable/nixpkgs
on master help sign in
samsung-unified-linux-driver: add 4.01.17
commit270365a1ee513a0d3d274c7426a153ab8e971036 authorIoannis Koutras <ioannis.koutras@gmail.com> dateTue 1 Nov 2016, 19:14 (10 years ago) parent0607fa1
2 files changed+83
pkgs/misc/cups/drivers/samsung/4.01.17.nix+82 pkgs/top-level/all-packages.nix+1
pkgs/misc/cups/drivers/samsung/4.01.17.nixnew file+82
@@ -0,0 +1,82 @@
1+# Tested on linux-x86_64. Might work on linux-i386. Probably won't work on anything else.
2+
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:
5+# { pkgs, ... }: {
6+# printing = {
7+# enable = true;
8+# drivers = [ pkgs.samsung-unified-linux-driver_4_01_17 ];
9+# };
10+# (more stuff)
11+# }
12+# (This advice was tested on the 1st November 2016.)
13+
14+{ stdenv, fetchurl, cups, libusb }:
15+
16+# Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
17+# to see what will break when upgrading. Consider a new versioned attribute.
18+let
19+ installationPath = if stdenv.system == "x86_64-linux" then "x86_64" else "i386";
20+ appendPath = if stdenv.system == "x86_64-linux" then "64" else "";
21+ libPath = stdenv.lib.makeLibraryPath [ cups libusb ] + ":$out/lib:${stdenv.cc.cc.lib}/lib${appendPath}";
22+in stdenv.mkDerivation rec {
23+ name = "samsung-UnifiedLinuxDriver-${version}";
24+ version = "4.01.17";
25+
26+ src = fetchurl {
27+ url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
28+ sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
29+ };
30+
31+ dontPatchELF = true;
32+ dontStrip = true;
33+
34+ installPhase = ''
35+ cd Linux/${installationPath}
36+ mkdir -p $out/lib/cups/{backend,filter}
37+ install -Dm755 mfp $out/lib/cups/backend/
38+ install -Dm755 pstosecps pstospl pstosplc rastertospl rastertosplc $out/lib/cups/filter/
39+ install -Dm755 libscmssc.so $out/lib/
40+
41+ GLOBIGNORE=*.so
42+ for exe in $out/lib/cups/**/*; do
43+ echo "Patching $exe"
44+ patchelf \
45+ --set-rpath ${libPath} \
46+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
47+ $exe
48+ done
49+ unset GLOBIGNORE
50+
51+ install -v at_root/usr/lib${appendPath}/libmfp.so.1.0.1 $out/lib
52+ cd $out/lib
53+ ln -s -f libmfp.so.1.0.1 libmfp.so.1
54+ ln -s -f libmfp.so.1 libmfp.so
55+
56+ for lib in $out/lib/*.so; do
57+ echo "Patching $lib"
58+ patchelf \
59+ --set-rpath ${libPath} \
60+ $lib
61+ done
62+
63+ mkdir -p $out/share/cups/model/samsung
64+ cd -
65+ cd ../noarch/at_opt/share/ppd
66+ for i in *.ppd; do
67+ sed -i $i -e \
68+ "s,pstosecps,$out/lib/cups/filter/pstosecps,g; \
69+ s,pstospl,$out/lib/cups/filter/pstospl,g; \
70+ s,rastertospl,$out/lib/cups/filter/rastertospl,g"
71+ done;
72+ cp -r ./* $out/share/cups/model/samsung
73+ '';
74+
75+ meta = with stdenv.lib; {
76+ description = "Samsung's Linux printing drivers; includes binaries without source code";
77+ homepage = http://www.samsung.com/;
78+ license = licenses.unfree;
79+ platforms = platforms.linux;
80+ maintainers = with maintainers; [ joko ];
81+ };
82+}
pkgs/top-level/all-packages.nix+1
@@ -17166,6 +17166,7 @@ in
1716617166 mfcj6510dwlpr = callPackage_i686 ../misc/cups/drivers/mfcj6510dwlpr { };
1716717167
1716817168 samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };
17169+ samsung-unified-linux-driver_4_01_17 = callPackage ../misc/cups/drivers/samsung/4.01.17.nix { };
1716917170 samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung/4.00.39 { };
1717017171
1717117172 sane-backends = callPackage ../applications/graphics/sane/backends {