git.iko.soy/typeable/nixpkgs
on master help sign in
mfcj470dw: split into mfcj470dwlpr and mfcj470dwcupswrapper
commit3b548dacf4a9ad1969881593f47ddf6c9417e4bc authorYochai <yochai@titat.info> dateSat 17 Sep 2016, 18:20 (10 years ago) parent5448271
5 files changed+104−62
lib/maintainers.nix+1 pkgs/misc/cups/drivers/mfcj470dw/default.nix−61 pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix+56 pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix+45 pkgs/top-level/all-packages.nix+2−1
lib/maintainers.nix+1
@@ -452,4 +452,5 @@
452452 zohl = "Al Zohali <zohl@fmap.me>";
453453 zoomulator = "Kim Simmons <zoomulator@gmail.com>";
454454 amiloradovsky = "Andrew Miloradovsky <miloradovsky@gmail.com>";
455+ yochai = "Yochai <yochai@titat.info>";
455456}
pkgs/misc/cups/drivers/mfcj470dw/default.nixdeleted−61
@@ -1,61 +0,0 @@
1−{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file }:
2−
3−stdenv.mkDerivation rec {
4− name = "mfcj470dw-cupswrapper-${version}";
5− version = "3.0.0-1";
6−
7− srcs =
8− [ (fetchurl {
9− url = "http://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
10− sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
11− })
12− (fetchurl {
13− url = "http://download.brother.com/welcome/dlf006845/mfcj470dwcupswrapper-${version}.i386.deb";
14− sha256 = "92af9024e821159eccd78a8925fc77fb92b4f247f2d2c824ca303004077076a7";
15− })
16− ];
17−
18− buildInputs = [ cups ghostscript dpkg a2ps ];
19−
20− unpackPhase = "true";
21−
22− installPhase = ''
23− for s in $srcs; do dpkg-deb -x $s $out; done
24−
25− substituteInPlace $out/opt/brother/Printers/mfcj470dw/cupswrapper/cupswrappermfcj470dw \
26− --replace /opt "$out/opt" \
27− --replace /usr "$out/usr" \
28− --replace /etc "$out/etc"
29−
30− substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
31− --replace /opt "$out/opt" \
32− --replace file "${file}/bin/file" \
33− --replace sed "${gnused}/bin/sed" \
34− --replace mktemp "${coreutils}/bin/mktemp" \
35− --replace cat "${coreutils}/bin/cat" \
36− --replace rm "${coreutils}/bin/rm"
37−
38− sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
39− substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
40− --replace awk "${gawk}/bin/awk" \
41− --replace cat "${coreutils}/bin/cat" \
42− --replace mktemp "${coreutils}/bin/mktemp" \
43− --replace sed "${gnused}/bin/sed" \
44− --replace expr "${coreutils}/bin/expr" \
45− --replace rm "${coreutils}/bin/rm"
46−
47− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
48− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/cupswrapper/brcupsconfpt1
49−
50− mkdir -p $out/lib/cups/filter/
51− ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
52− '';
53−
54− meta = {
55− homepage = http://www.brother.com/;
56− description = "A driver for brother mfcj470dw printers to print over WiFi and USB";
57− license = stdenv.lib.licenses.unfree;
58− platforms = stdenv.lib.platforms.linux;
59− downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
60− };
61−}
pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nixnew file+56
@@ -0,0 +1,56 @@
1+{ stdenv, fetchurl, mfcj470dwlpr, makeWrapper}:
2+
3+stdenv.mkDerivation rec {
4+ name = "mfcj470dw-cupswrapper-${version}";
5+ version = "3.0.0-1";
6+
7+ src = fetchurl {
8+ url = "http://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
9+ sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
10+ };
11+
12+ nativeBuildInputs = [ makeWrapper ];
13+ buildInputs = [ mfcj470dwlpr ];
14+
15+ patchPhase = ''
16+ WRAPPER=cupswrapper/cupswrappermfcj470dw
17+
18+ substituteInPlace $WRAPPER \
19+ --replace /opt "${mfcj470dwlpr}/opt" \
20+ --replace /usr "${mfcj470dwlpr}/usr" \
21+ --replace /etc "$out/etc"
22+
23+ substituteInPlace $WRAPPER \
24+ --replace "\`cp " "\`cp -p " \
25+ --replace "\`mv " "\`cp -p "
26+ '';
27+
28+ buildPhase = ''
29+ cd brcupsconfpt1
30+ make all
31+ cd ..
32+ '';
33+
34+ installPhase = ''
35+ TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
36+ mkdir -p $out/opt/brother/Printers/mfcj470dw/cupswrapper/
37+
38+ cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
39+ cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER/
40+ cp PPD/brother_mfcj470dw_printer_en.ppd $TARGETFOLDER/
41+ '';
42+
43+ cleanPhase = ''
44+ cd brcupsconfpt1
45+ make clean
46+ '';
47+
48+ meta = {
49+ homepage = http://www.brother.com/;
50+ description = "Brother MFC-J470DW CUPS wrapper driver";
51+ license = stdenv.lib.licenses.gpl2;
52+ platforms = stdenv.lib.platforms.linux;
53+ downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
54+ maintainers = [ stdenv.lib.maintainers.yochai ];
55+ };
56+}
pkgs/misc/cups/drivers/mfcj470dwlpr/default.nixnew file+45
@@ -0,0 +1,45 @@
1+{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file, makeWrapper }:
2+
3+stdenv.mkDerivation rec {
4+ name = "mfcj470dw-cupswrapper-${version}";
5+ version = "3.0.0-1";
6+
7+ src = fetchurl {
8+ url = "http://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
9+ sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
10+ };
11+
12+ nativeBuildInputs = [ makeWrapper ];
13+ buildInputs = [ cups ghostscript dpkg a2ps ];
14+
15+ unpackPhase = "true";
16+
17+ installPhase = ''
18+ dpkg-deb -x $src $out
19+
20+ substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
21+ --replace /opt "$out/opt" \
22+
23+ sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
24+
25+ patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
26+
27+ mkdir -p $out/lib/cups/filter/
28+ ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
29+
30+ wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
31+ --prefix PATH ":" ${ stdenv.lib.makeBinPath [ gnused coreutils gawk ] }
32+
33+ wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
34+ --prefix PATH ":" ${ stdenv.lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
35+ '';
36+
37+ meta = {
38+ homepage = http://www.brother.com/;
39+ description = "Brother MFC-J470DW LPR driver";
40+ license = stdenv.lib.licenses.unfree;
41+ platforms = stdenv.lib.platforms.linux;
42+ downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
43+ maintainers = [ stdenv.lib.maintainers.yochai ];
44+ };
45+}
pkgs/top-level/all-packages.nix+2−1
@@ -17448,7 +17448,8 @@ in
1744817448
1744917449 canon-cups-ufr2 = callPackage ../misc/cups/drivers/canon { };
1745017450
17451− mfcj470dw = callPackage_i686 ../misc/cups/drivers/mfcj470dw { };
17451+ mfcj470dw-cupswrapper = callPackage ../misc/cups/drivers/mfcj470dwcupswrapper { };
17452+ mfcj470dwlpr = callPackage_i686 ../misc/cups/drivers/mfcj470dwlpr { };
1745217453
1745317454 samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };
1745417455 samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung/4.00.39 { };