summary refs log tree commit diff
path: root/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper
diff options
context:
space:
mode:
authorRam Kromberg <ramkromberg@mail.com>2016-10-12 10:52:49 +0300
committerRam Kromberg <ramkromberg@mail.com>2016-10-15 18:57:37 +0300
commit1e290ae75f09940a7d3a2a1ce166518f3b977e66 (patch)
tree6008aa0c08d2d0fb6da27c96d47c1fcc5f783a66 /pkgs/misc/cups/drivers/mfcj6510dwcupswrapper
parentaad01d583154dc2986ac69d59609e27d7bae515b (diff)
downloadnixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar.gz
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar.bz2
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar.lz
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar.xz
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.tar.zst
nixpkgs-1e290ae75f09940a7d3a2a1ce166518f3b977e66.zip
mfcj6510dw: init at 3.0.0-1
Diffstat (limited to 'pkgs/misc/cups/drivers/mfcj6510dwcupswrapper')
-rw-r--r--pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix
new file mode 100644
index 00000000000..fbb52340918
--- /dev/null
+++ b/pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchurl, mfcj6510dwlpr, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  name = "mfcj6510dw-cupswrapper-${version}";
+  version = "3.0.0-1";
+
+  src = fetchurl {
+    url = "http://download.brother.com/welcome/dlf006814/mfcj6510dw_cupswrapper_GPL_source_${version}.tar.gz";
+    sha256 = "0y5iffybxjin8injrdmc9n9hl4s6b8n6ck76m1z78bzi88vwmhai";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ mfcj6510dwlpr ];
+
+  buildPhase = ''
+    cd brcupsconfig
+    make all
+    cd ..
+    '';
+
+  installPhase = ''
+    TARGETFOLDER=$out/opt/brother/Printers/mfcj6510dw/cupswrapper
+    mkdir -p $TARGETFOLDER
+    cp PPD/brother_mfcj6510dw_printer_en.ppd $TARGETFOLDER
+    cp brcupsconfig/brcupsconfpt1 $TARGETFOLDER
+    cp scripts/cupswrappermfcj6510dw $TARGETFOLDER
+    sed -i -e '26,304d' $TARGETFOLDER/cupswrappermfcj6510dw
+    substituteInPlace $TARGETFOLDER/cupswrappermfcj6510dw \
+      --replace "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj6510dw_printer_en.ppd"
+
+    CPUSFILTERFOLDER=$out/lib/cups/filter
+    mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
+    ln -s ${mfcj6510dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj6510dw $out/lib/cups/filter/brother_lpdwrapper_mfcj6510dw
+    ##TODO: Use the cups filter instead of the LPR one.
+    #cp scripts/cupswrappermfcj6510dw $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
+    #sed -i -e '110,258!d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
+    #sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
+    #sed -i -e '34,35d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
+    #substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
+    #  --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/lpd/filter$``{printer_model``}" \
+    #    "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw" \
+    #  --replace "/opt/brother/Printers/$``{printer_model``}/inf/br$``{printer_model``}rc" \
+    #    "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \
+    #  --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/cupswrapper/brcupsconfpt1" \
+    #    "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brcupsconfpt1" \
+    #  --replace "/usr/share/cups/model/Brother/brother_" "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brother_"
+    #substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
+    #  --replace "$``{printer_model``}" "mfcj6510dw" \
+    #  --replace "$``{printer_name``}" "MFCJ6510DW"
+    '';
+
+  cleanPhase = ''
+    cd brcupsconfpt1
+    make clean
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.brother.com/;
+    description = "Brother MFC-J6510DW CUPS wrapper driver";
+    license = with licenses; gpl2;
+    platforms = with platforms; linux;
+    downloadPage = http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj6510dw_all&os=128;
+    maintainers = with maintainers; [ ramkromberg ];
+  };
+}