git.iko.soy/typeable/nixpkgs
on master help sign in
samsung-unified-linux-driver: add 1.00.37

Very experimental. Probably very broken. Adds support for newer models but removes it for some older ones. Hence not the default yet, if ever.

commitaf911744fdbb10cc21d3267c09adc9a06c53d9f3 authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> dateTue 26 Jan 2016, 04:05 (11 years ago) parentcb6beb1
4 files changed+118−27
pkgs/misc/cups/drivers/samsung/builder.sh → pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh pkgs/misc/cups/drivers/samsung/4.00.39/default.nix+40 pkgs/misc/cups/drivers/samsung/default.nix+76−26 pkgs/top-level/all-packages.nix+2−1
pkgs/misc/cups/drivers/samsung/builder.sh → pkgs/misc/cups/drivers/samsung/4.00.39/builder.shrenamed

The content is the same.

pkgs/misc/cups/drivers/samsung/4.00.39/default.nixnew file+40
@@ -0,0 +1,40 @@
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.samsungUnifiedLinuxDriver ];
9+# };
10+# (more stuff)
11+# }
12+# (This advice was tested on 2010 August 2.)
13+
14+{ stdenv, fetchurl, cups, gcc, ghostscript, glibc, patchelf }:
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+stdenv.mkDerivation rec {
19+ name = "samsung-UnifiedLinuxDriver-${version}";
20+ version = "4.00.39";
21+
22+ src = fetchurl {
23+ url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
24+ sha256 = "144b4xggbzjfq7ga5nza7nra2cf6qn63z5ls7ba1jybkx1vm369k";
25+ };
26+
27+ buildInputs = [ cups gcc ghostscript glibc patchelf ];
28+
29+ inherit cups gcc ghostscript glibc;
30+
31+ builder = ./builder.sh;
32+
33+ meta = with stdenv.lib; {
34+ description = "Samsung's Linux printing drivers; includes binaries without source code";
35+ homepage = http://www.samsung.com/;
36+ license = licenses.unfree;
37+ platforms = platforms.linux;
38+ maintainers = with maintainers; [ nckx ];
39+ };
40+}
pkgs/misc/cups/drivers/samsung/default.nix+76−26
@@ -1,39 +1,89 @@
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.samsungUnifiedLinuxDriver ];
9−# };
10−# (more stuff)
11−# }
12−# (This advice was tested on 2010 August 2.)
13−
14−{ stdenv, fetchurl, cups, gcc, ghostscript, glibc, patchelf }:
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−stdenv.mkDerivation rec {
19− name = "samsung-UnifiedLinuxDriver-${version}";
20− version = "4.00.39";
1+{ stdenv, fetchurl, patchelf, cups, libusb, libxml2 }:
2+
3+let
4+
5+ arch = if stdenv.system == "x86_64-linux"
6+ then "x86_64"
7+ else "i386";
8+
9+in stdenv.mkDerivation rec {
10+ name = "samsung-unified-linux-driver-${version}";
11+ version = "1.00.37";
2112
2213 src = fetchurl {
14+ sha256 = "0r66l9zp0p1qgakh4j08hynwsr4lsgq5yrpxyr0x4ldvl0z2b1bb";
2315 url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
24− sha256 = "144b4xggbzjfq7ga5nza7nra2cf6qn63z5ls7ba1jybkx1vm369k";
2516 };
2617
27− buildInputs = [ cups gcc ghostscript glibc patchelf ];
18+ nativeBuildInputs = [ patchelf ];
19+
20+ phases = [ "unpackPhase" "installPhase" ];
21+
22+ installPhase = ''
23+ my_patchelf() {
24+ opts=(); while [[ "$1" != - ]]; do opts+=( "$1" ); shift; done; shift
25+ for binary in "$@"; do
26+ echo "Patching ELF file: $binary"
27+ patchelf "''${opts[@]}" $binary
28+ ldd $binary | grep "not found" && exit 1
29+ done; true
30+ }
31+
32+ my_patchelf \
33+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
34+ --set-rpath ${cups}/lib:$(cat $NIX_CC/nix-support/orig-cc)/lib:${stdenv.glibc}/lib \
35+ - ${arch}/{pstosecps,rastertospl,smfpnetdiscovery}
36+
37+ mkdir -p $out/etc/sane.d/dll.d/
38+ install -m644 noarch/etc/smfp.conf $out/etc/sane.d
39+ echo smfp >> $out/etc/sane.d/dll.d/smfp-scanner
2840
29− inherit cups gcc ghostscript glibc;
41+ mkdir -p $out/lib
42+ my_patchelf \
43+ --set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib:${stdenv.glibc}/lib \
44+ - ${arch}/libscmssc.so*
45+ install -m755 ${arch}/libscmssc.so* $out/lib
3046
31− builder = ./builder.sh;
47+ mkdir -p $out/lib/cups/backend
48+ install -m755 ${arch}/smfpnetdiscovery $out/lib/cups/backend
49+
50+ mkdir -p $out/lib/cups/filter
51+ install -m755 ${arch}/{pstosecps,rastertospl} $out/lib/cups/filter
52+
53+ mkdir -p $out/lib/sane
54+ my_patchelf \
55+ --set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib:${stdenv.glibc}/lib:${libusb}/lib:${libxml2}/lib \
56+ - ${arch}/libsane-smfp.so*
57+ install -m755 ${arch}/libsane-smfp.so* $out/lib/sane
58+ ln -s libsane-smfp.so.1.0.1 $out/lib/sane/libsane-smfp.so.1
59+ ln -s libsane-smfp.so.1 $out/lib/sane/libsane-smfp.so
60+
61+ mkdir -p $out/lib/udev/rules.d
62+ (
63+ OEM_FILE=noarch/oem.conf
64+ INSTALL_LOG_FILE=/dev/null
65+ . noarch/scripting_utils
66+ . noarch/package_utils
67+ . noarch/scanner-script.pkg
68+ fill_full_template noarch/etc/smfp.rules.in $out/lib/udev/rules.d/60_smfp_samsung.rules
69+ )
70+
71+ mkdir -p $out/share/ppd
72+ gzip -9 noarch/share/ppd/*.ppd
73+ cp -R noarch/share/ppd $out/share/ppd/suld
74+
75+ cp -R noarch/share/locale $out/share
76+ rm -r $out/share/locale/*/*/install.mo
77+ '';
3278
3379 meta = with stdenv.lib; {
34− description = "Samsung's Linux printing drivers; includes binaries without source code";
35− homepage = http://www.samsung.com/;
80+ description = "Unified Linux Driver for Samsung printers and scanners";
81+ homepage = http://www.bchemnet.com/suldr;
82+ downloadPage = http://www.bchemnet.com/suldr/driver/;
3683 license = licenses.unfree;
84+
85+ # Tested on linux-x86_64. Might work on linux-i386.
86+ # Probably won't work on anything else.
3787 platforms = platforms.linux;
3888 maintainers = with maintainers; [ nckx ];
3989 };
pkgs/top-level/all-packages.nix+2−1
@@ -15628,7 +15628,8 @@ let
1562815628
1562915629 mfcj470dw = callPackage_i686 ../misc/cups/drivers/mfcj470dw { };
1563015630
15631− samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung { };
15631+ samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };
15632+ samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung/4.00.39 { };
1563215633
1563315634 sane-backends = callPackage ../applications/graphics/sane/backends {
1563415635 gt68xxFirmware = config.sane.gt68xxFirmware or null;