Merge pull request #241283 from u2x1/master

cups-brother-hl2260d: init at 3.2.0-1

authored by Weijia Wang and committed by GitHub e2246cd1 7c25f289

+97
+6
maintainers/maintainer-list.nix
··· 18024 githubId = 1983821; 18025 name = "Eric Wolf"; 18026 }; 18027 uakci = { 18028 name = "uakci"; 18029 email = "uakci@uakci.pl";
··· 18024 githubId = 1983821; 18025 name = "Eric Wolf"; 18026 }; 18027 + u2x1 = { 18028 + email = "u2x1@outlook.com"; 18029 + github = "u2x1"; 18030 + githubId = 30677291; 18031 + name = "u2x1"; 18032 + }; 18033 uakci = { 18034 name = "uakci"; 18035 email = "uakci@uakci.pl";
+89
pkgs/misc/cups/drivers/hl2260d/default.nix
···
··· 1 + { lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, coreutils, perl, gnugrep, which 2 + , debugLvl ? "0" 3 + }: 4 + 5 + let 6 + version = "3.2.0-1"; 7 + lprdeb = fetchurl { 8 + url = "https://download.brother.com/welcome/dlf102692/hl2260dlpr-${version}.i386.deb"; 9 + hash = "sha256-R+cM2SKc/MP6keo3PUrKXPC6a2dEQQdBunrpNtAHlH0="; 10 + }; 11 + 12 + cupsdeb = fetchurl { 13 + url = "https://download.brother.com/welcome/dlf102693/hl2260dcupswrapper-${version}.i386.deb"; 14 + hash = "sha256-k6+ulZVoFTpEY6WJ9TO9Rzp2c4dwPqL3NY5/XYJpvOc="; 15 + }; 16 + in 17 + stdenv.mkDerivation { 18 + pname = "cups-brother-hl2260d"; 19 + inherit version; 20 + 21 + nativeBuildInputs = [ makeWrapper dpkg ]; 22 + buildInputs = [ cups ghostscript perl ]; 23 + 24 + dontPatchELF = true; 25 + dontBuild = true; 26 + 27 + unpackPhase = '' 28 + mkdir -p $out 29 + dpkg-deb -x ${cupsdeb} $out 30 + dpkg-deb -x ${lprdeb} $out 31 + ''; 32 + 33 + patchPhase = '' 34 + # Patch lpr 35 + INFDIR=$out/opt/brother/Printers/HL2260D/inf 36 + LPDDIR=$out/opt/brother/Printers/HL2260D/lpd 37 + 38 + substituteInPlace $LPDDIR/filter_HL2260D \ 39 + --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/HL2260D\"; #" \ 40 + --replace "PRINTER =~" "PRINTER = \"HL2260D\"; #" 41 + 42 + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 43 + $INFDIR/braddprinter 44 + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 45 + $LPDDIR/brprintconflsr3 46 + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 47 + $LPDDIR/rawtobr3 48 + 49 + # Patch cupswrapper 50 + WRAPPER=$out/opt/brother/Printers/HL2260D/cupswrapper/brother_lpdwrapper_HL2260D 51 + PAPER_CFG=$out/opt/brother/Printers/HL2260D/cupswrapper/paperconfigml1 52 + 53 + substituteInPlace $WRAPPER \ 54 + --replace "basedir =~" "basedir = \"$out/opt/brother/Printers/HL2260D\"; #" \ 55 + --replace "PRINTER =~" "PRINTER = \"HL2260D\"; #" \ 56 + --replace "\$DEBUG=0;" "\$DEBUG=${debugLvl};" 57 + substituteInPlace $WRAPPER \ 58 + --replace "\`cp " "\`cp -p " \ 59 + --replace "\$TEMPRC\`" "\$TEMPRC; chmod a+rw \$TEMPRC\`" \ 60 + --replace "\`mv " "\`cp -p " 61 + # This config script make this assumption that the *.ppd are found in a global location `/etc/cups/ppd`. 62 + substituteInPlace $PAPER_CFG \ 63 + --replace "/etc/cups/ppd" "$out/share/cups/model" 64 + ''; 65 + 66 + installPhase = '' 67 + mkdir -p $out/share/cups/model 68 + ln -s $out/opt/brother/Printers/HL2260D/cupswrapper/brother-HL2260D-cups-en.ppd $out/share/cups/model 69 + 70 + mkdir -p $out/lib/cups/filter/ 71 + makeWrapper \ 72 + $out/opt/brother/Printers/HL2260D/cupswrapper/brother_lpdwrapper_HL2260D \ 73 + $out/lib/cups/filter/brother_lpdwrapper_HL2260D \ 74 + --prefix PATH : ${lib.makeBinPath [coreutils gnugrep gnused]} 75 + 76 + wrapProgram $out/opt/brother/Printers/HL2260D/lpd/filter_HL2260D \ 77 + --prefix PATH ":" ${ lib.makeBinPath [ ghostscript which ] } 78 + ''; 79 + 80 + meta = with lib; { 81 + homepage = "http://www.brother.com/"; 82 + description = "Brother HL-2260D printer driver"; 83 + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 84 + license = licenses.unfree; 85 + platforms = [ "x86_64-linux" "i686-linux" ]; 86 + downloadPage = "https://support.brother.com/g/b/downloadtop.aspx?c=cn_ot&lang=en&prod=hl2260d_cn"; 87 + maintainers = with maintainers; [ u2x1 ]; 88 + }; 89 + }
+2
pkgs/top-level/all-packages.nix
··· 40184 40185 cups-brother-hl1210w = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1210w { }; 40186 40187 cups-brother-hl3140cw = pkgsi686Linux.callPackage ../misc/cups/drivers/hl3140cw { }; 40188 40189 cups-brother-hll2340dw = pkgsi686Linux.callPackage ../misc/cups/drivers/hll2340dw { };
··· 40184 40185 cups-brother-hl1210w = pkgsi686Linux.callPackage ../misc/cups/drivers/hl1210w { }; 40186 40187 + cups-brother-hl2260d = pkgsi686Linux.callPackage ../misc/cups/drivers/hl2260d { }; 40188 + 40189 cups-brother-hl3140cw = pkgsi686Linux.callPackage ../misc/cups/drivers/hl3140cw { }; 40190 40191 cups-brother-hll2340dw = pkgsi686Linux.callPackage ../misc/cups/drivers/hll2340dw { };