about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2016-09-27 12:56:05 +0200
committerGitHub <noreply@github.com>2016-09-27 12:56:05 +0200
commit81f47f7982f7609cbd701e7cf77361831f258892 (patch)
tree488efb9c5bb4dd8f5e33ff069674d94beee255b9
parentb92a367bede265f779d93560cae0d3c2cb0f7191 (diff)
parent3b548dacf4a9ad1969881593f47ddf6c9417e4bc (diff)
downloadnixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar.gz
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar.bz2
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar.lz
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar.xz
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.tar.zst
nixlib-81f47f7982f7609cbd701e7cf77361831f258892.zip
Merge pull request #18700 from yochai/master
mfcj470dw: split into mfcj470dwlpr and mfcj470dwcupswrapper
-rw-r--r--lib/maintainers.nix1
-rw-r--r--pkgs/misc/cups/drivers/mfcj470dw/default.nix61
-rw-r--r--pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix56
-rw-r--r--pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix45
-rw-r--r--pkgs/top-level/all-packages.nix3
5 files changed, 104 insertions, 62 deletions
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index d90557cf7d21..a410db6f02a9 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -458,4 +458,5 @@
   zohl = "Al Zohali <zohl@fmap.me>";
   zoomulator = "Kim Simmons <zoomulator@gmail.com>";
   amiloradovsky = "Andrew Miloradovsky <miloradovsky@gmail.com>";
+  yochai = "Yochai <yochai@titat.info>";
 }
diff --git a/pkgs/misc/cups/drivers/mfcj470dw/default.nix b/pkgs/misc/cups/drivers/mfcj470dw/default.nix
deleted file mode 100644
index b8458ae0af32..000000000000
--- a/pkgs/misc/cups/drivers/mfcj470dw/default.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file }:
-
-stdenv.mkDerivation rec {
-  name = "mfcj470dw-cupswrapper-${version}";
-  version = "3.0.0-1";
-
-  srcs =
-    [ (fetchurl {
-        url = "http://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
-        sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
-      })
-      (fetchurl {
-        url = "http://download.brother.com/welcome/dlf006845/mfcj470dwcupswrapper-${version}.i386.deb";
-        sha256 = "92af9024e821159eccd78a8925fc77fb92b4f247f2d2c824ca303004077076a7";
-      })
-    ];
-
-    buildInputs = [ cups ghostscript dpkg a2ps ];
-
-  unpackPhase = "true";
-
-  installPhase = ''
-    for s in $srcs; do dpkg-deb -x $s $out; done
-
-    substituteInPlace $out/opt/brother/Printers/mfcj470dw/cupswrapper/cupswrappermfcj470dw \
-      --replace /opt "$out/opt" \
-      --replace /usr "$out/usr" \
-      --replace /etc "$out/etc"
-
-    substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
-      --replace /opt "$out/opt" \
-      --replace file "${file}/bin/file" \
-      --replace sed "${gnused}/bin/sed" \
-      --replace mktemp "${coreutils}/bin/mktemp" \
-      --replace cat "${coreutils}/bin/cat" \
-      --replace rm "${coreutils}/bin/rm"
-
-    sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
-    substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
-      --replace awk "${gawk}/bin/awk" \
-      --replace cat "${coreutils}/bin/cat" \
-      --replace mktemp "${coreutils}/bin/mktemp" \
-      --replace sed "${gnused}/bin/sed" \
-      --replace expr "${coreutils}/bin/expr" \
-      --replace rm "${coreutils}/bin/rm"
-
-    patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
-    patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/cupswrapper/brcupsconfpt1
-
-    mkdir -p $out/lib/cups/filter/
-    ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
-  '';
-
-  meta = {
-    homepage = http://www.brother.com/;
-    description = "A driver for brother mfcj470dw printers to print over WiFi and USB";
-    license = stdenv.lib.licenses.unfree;
-    platforms = stdenv.lib.platforms.linux;
-    downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
-  };
-}
diff --git a/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix
new file mode 100644
index 000000000000..5a828c265b55
--- /dev/null
+++ b/pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, mfcj470dwlpr, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  name = "mfcj470dw-cupswrapper-${version}";
+  version = "3.0.0-1";
+
+  src = fetchurl {
+    url = "http://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
+    sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ mfcj470dwlpr ];
+
+  patchPhase = ''
+    WRAPPER=cupswrapper/cupswrappermfcj470dw
+
+    substituteInPlace $WRAPPER \
+    --replace /opt "${mfcj470dwlpr}/opt" \
+    --replace /usr "${mfcj470dwlpr}/usr" \
+    --replace /etc "$out/etc"
+
+    substituteInPlace $WRAPPER \
+    --replace "\`cp " "\`cp -p " \
+    --replace "\`mv " "\`cp -p "
+    '';
+
+  buildPhase = ''
+    cd brcupsconfpt1
+    make all
+    cd ..
+    '';
+
+  installPhase = ''
+    TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
+    mkdir -p $out/opt/brother/Printers/mfcj470dw/cupswrapper/
+
+    cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
+    cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER/
+    cp PPD/brother_mfcj470dw_printer_en.ppd $TARGETFOLDER/
+    '';
+
+  cleanPhase = ''
+    cd brcupsconfpt1
+    make clean
+    '';
+
+  meta = {
+    homepage = http://www.brother.com/;
+    description = "Brother MFC-J470DW CUPS wrapper driver";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
+    maintainers = [ stdenv.lib.maintainers.yochai ];
+  };
+}
diff --git a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix
new file mode 100644
index 000000000000..c80009bd8444
--- /dev/null
+++ b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "mfcj470dw-cupswrapper-${version}";
+  version = "3.0.0-1";
+
+  src = fetchurl {
+    url = "http://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
+    sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ cups ghostscript dpkg a2ps ];
+
+  unpackPhase = "true";
+
+  installPhase = ''
+    dpkg-deb -x $src $out
+
+    substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
+    --replace /opt "$out/opt" \
+
+    sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
+
+    patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
+
+    mkdir -p $out/lib/cups/filter/
+    ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
+
+    wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
+    --prefix PATH ":" ${ stdenv.lib.makeBinPath [ gnused coreutils gawk ] }
+
+    wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
+    --prefix PATH ":" ${ stdenv.lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
+    '';
+
+  meta = {
+    homepage = http://www.brother.com/;
+    description = "Brother MFC-J470DW LPR driver";
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128;
+    maintainers = [ stdenv.lib.maintainers.yochai ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f91959deb309..f74d9b9c44da 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16872,7 +16872,8 @@ in
 
   canon-cups-ufr2 = callPackage ../misc/cups/drivers/canon { };
 
-  mfcj470dw = callPackage_i686 ../misc/cups/drivers/mfcj470dw { };
+  mfcj470dw-cupswrapper = callPackage ../misc/cups/drivers/mfcj470dwcupswrapper { };
+  mfcj470dwlpr = callPackage_i686 ../misc/cups/drivers/mfcj470dwlpr { };
 
   samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung { };
   samsung-unified-linux-driver = callPackage ../misc/cups/drivers/samsung/4.00.39 { };