From 02c8888784f54704d9b6896e944144044db3f91a Mon Sep 17 00:00:00 2001 From: Phil R Date: Sat, 12 Nov 2022 23:23:43 +0100 Subject: [PATCH 1/2] added myself as a maintainer --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index bda7211ec2ff..fccde8a3e9db 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -10751,6 +10751,12 @@ githubId = 301903; name = "Chip Collier"; }; + phrogg = { + name = "Phil Roggenbuck"; + email = "nixpkgs@phrogg.de"; + github = "phrogg"; + githubId = 1367949; + }; phryneas = { email = "mail@lenzw.de"; github = "phryneas"; From b79483b619f9fb77fa3544d7c83bac9ff80bee1d Mon Sep 17 00:00:00 2001 From: Phil R Date: Wed, 30 Nov 2022 12:29:16 +0100 Subject: [PATCH 2/2] mfc465cn{lpr,cupswrapper}: init at 1.0.1-1 --- .../brother/mfc465cncupswrapper/default.nix | 82 +++++++++++++++++++ .../drivers/brother/mfc465cnlpr/default.nix | 67 +++++++++++++++ pkgs/top-level/all-packages.nix | 3 + 3 files changed, 152 insertions(+) create mode 100644 pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix create mode 100644 pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix diff --git a/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix b/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix new file mode 100644 index 000000000000..c64e48a86ce8 --- /dev/null +++ b/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix @@ -0,0 +1,82 @@ +{ lib +, stdenv +, fetchurl +, dpkg +, makeWrapper +, coreutils +, gnugrep +, gnused +, mfc465cnlpr +, pkgsi686Linux +, psutils +}: + +stdenv.mkDerivation rec { + pname = "mfc465cncupswrapper"; + version = "1.0.1-1"; + + src = fetchurl { + url = "https://download.brother.com/welcome/dlf006134/${pname}-${version}.i386.deb"; + sha256 = "59a62ed3cf10f1565c08ace55832bd48bd5034f7067662870edf7ff3bf0cb76a"; + }; + + unpackPhase = '' + dpkg-deb -x $src $out + ''; + + nativeBuildInputs = [ + dpkg + makeWrapper + ]; + + dontBuild = true; + + installPhase = '' + lpr=${mfc465cnlpr}/usr/local/Brother/Printer/mfc465cn + dir=$out/usr/local/Brother/Printer/mfc465cn + interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 + patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1" + substituteInPlace $dir/cupswrapper/cupswrappermfc465cn \ + --replace "mkdir -p /usr" ": # mkdir -p /usr" \ + --replace '/''${printer_model}' "/mfc465cn" \ + --replace 'br''${printer_model}' "brmfc465cn" \ + --replace 'brlpdwrapper''${printer_model}' "brlpdwrappermfc465cn" \ + --replace 'filter''${printer_model}' "filtermfc465cn" \ + --replace ' ''${printer_name}' " MFC465CN" \ + --replace ' ''${device_name}' " MFC-465CN" \ + --replace '(''${device_name}' "(MFC-465CN" \ + --replace ':''${device_name}' ":MFC-465CN" \ + --replace '/''${device_name}' "/MFC-465CN" \ + --replace 'BR''${pcfilename}' "BR465" \ + --replace '/''${device_model}' "/Printer" \ + --replace '/usr/lib64/cups/filter/brlpdwrappermfc465cn' "$out/lib/cups/filter/brlpdwrappermfc465cn" \ + --replace '/usr/local/Brother/Printer/mfc465cn/lpd/filtermfc465cn' "$lpr/lpd/filtermfc465cn" \ + --replace '/usr/share/ppd/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \ + --replace '/usr/share/cups/model/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \ + --replace '/usr/lib/cups/filter/brlpdwrappermfc465cn' "$out/usr/lib/cups/filter/brlpdwrappermfc465cn" \ + --replace 'nup="psnup' "nup=\"${psutils}/bin/psnup" \ + --replace '/usr/bin/psnup' "${psutils}/bin/psnup" \ + --replace '/usr/local/Brother/Printer/mfc465cn/cupswrapper/brcupsconfpt1' "$dir/cupswrapper/brcupsconfpt1" \ + --replace '/usr/local/Brother/Printer/mfc465cn/inf' "$lpr/inf" + # Create the PPD file from the cupswrapper file + sed -n '/ENDOFPPDFILE1/,/ENDOFPPDFILE1/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 > $dir/cupswrapper/brmfc465.ppd + sed -n '/ENDOFPPDFILE_END/,/ENDOFPPDFILE_END/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 >> $dir/cupswrapper/brmfc465.ppd + chmod 644 $dir/cupswrapper/brmfc465.ppd + mkdir -p $out/lib/cups/filter + mkdir -p $out/share/cups/model + ln $dir/cupswrapper/cupswrappermfc465cn $out/lib/cups/filter + ln $dir/cupswrapper/brmfc465.ppd $out/share/cups/model + sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc465cn" | sed '1 br; b; :r s/.*/printer_model=mfc465cn; cat < $out/lib/cups/filter/brlpdwrappermfc465cn + sed -i "/#! \/bin\/sh/a PATH=${lib.makeBinPath [ coreutils gnused gnugrep ]}:\$PATH" $out/lib/cups/filter/brlpdwrappermfc465cn + chmod 755 $out/lib/cups/filter/brlpdwrappermfc465cn + ''; + + meta = with lib; { + description = "Brother MFC-465CN CUPS wrapper driver"; + homepage = "http://www.brother.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ phrogg ]; + }; +} diff --git a/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix new file mode 100644 index 000000000000..dc0be00a6932 --- /dev/null +++ b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix @@ -0,0 +1,67 @@ +{ stdenv +, lib +, fetchurl +, dpkg +, makeWrapper +, coreutils +, file +, gawk +, ghostscript +, gnused +, pkgsi686Linux +}: + +stdenv.mkDerivation rec { + pname = "mfc465cnlpr"; + version = "1.0.1-1"; + + src = fetchurl { + url = "https://download.brother.com/welcome/dlf006132/${pname}-${version}.i386.deb"; + sha256 = "cfe0289510bf36bee6014286ea78b1ebc6bbb948dbfd3aee02f0664a7743f99b"; + }; + + unpackPhase = '' + dpkg-deb -x $src $out + ''; + + nativeBuildInputs = [ + dpkg + makeWrapper + ]; + + dontBuild = true; + + installPhase = '' + dir=$out/usr/local/Brother/Printer/mfc465cn + patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc465cnfilter + wrapProgram $dir/inf/setupPrintcapij \ + --prefix PATH : ${lib.makeBinPath [ + coreutils + ]} + substituteInPlace $dir/lpd/filtermfc465cn \ + --replace "BR_PRT_PATH=" "BR_PRT_PATH=\"$dir/\" #" + wrapProgram $dir/lpd/filtermfc465cn \ + --prefix PATH : ${lib.makeBinPath [ + coreutils + file + ghostscript + gnused + ]} + substituteInPlace $dir/lpd/psconvertij2 \ + --replace '`which gs`' "${ghostscript}/bin/gs" + wrapProgram $dir/lpd/psconvertij2 \ + --prefix PATH : ${lib.makeBinPath [ + gnused + gawk + ]} + chmod -R a+w $dir/inf/ + ''; + + meta = with lib; { + description = "Brother MFC-465CN LPR printer driver"; + homepage = "http://www.brother.com/"; + license = licenses.unfree; + maintainers = with maintainers; [ phrogg ]; + platforms = [ "i686-linux" "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0d69ac96bc7e..12101a0f24a1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37116,6 +37116,9 @@ with pkgs; hll2390dw-cups = callPackage ../misc/cups/drivers/hll2390dw-cups { }; + mfc465cncupswrapper = callPackage ../misc/cups/drivers/brother/mfc465cncupswrapper { }; + mfc465cnlpr = callPackage ../misc/cups/drivers/brother/mfc465cnlpr { }; + mfcj470dw-cupswrapper = callPackage ../misc/cups/drivers/mfcj470dwcupswrapper { }; mfcj470dwlpr = pkgsi686Linux.callPackage ../misc/cups/drivers/mfcj470dwlpr { };