From 6b58973b393bdcdbb2d4b7e9ad093dfb17686fb2 Mon Sep 17 00:00:00 2001 From: Austin Lund Date: Tue, 28 Mar 2023 14:45:14 +1000 Subject: [PATCH 1/2] maintainers: add aplund as maintainer --- maintainers/maintainer-list.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e9ecf0a3ea01..13ca73982656 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1118,6 +1118,16 @@ githubId = 73002165; name = "apfelkuchen6"; }; + aplund = { + email = "austin.lund@gmail.com"; + matrix = "@aplund:matrix.org"; + github = "aplund"; + githubId = 1369436; + name = "Austin Lund"; + keys = [{ + fingerprint = "7083 E268 4BFD 845F 2B84 9E74 B695 8918 ED23 32CE"; + }]; + }; applePrincess = { email = "appleprincess@appleprincess.io"; github = "applePrincess"; From 90e2c6f57031509e84a5dab38578a78499af5223 Mon Sep 17 00:00:00 2001 From: Austin Lund Date: Tue, 28 Mar 2023 14:30:56 +1000 Subject: [PATCH 2/2] cups-brother-hll3230cdw: init at version 1.0.2 Brother HL-L3230CDW driver for CUPS. --- pkgs/misc/cups/drivers/hll3230cdw/default.nix | 76 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 78 insertions(+) create mode 100644 pkgs/misc/cups/drivers/hll3230cdw/default.nix diff --git a/pkgs/misc/cups/drivers/hll3230cdw/default.nix b/pkgs/misc/cups/drivers/hll3230cdw/default.nix new file mode 100644 index 000000000000..aff134d7a33a --- /dev/null +++ b/pkgs/misc/cups/drivers/hll3230cdw/default.nix @@ -0,0 +1,76 @@ +{ stdenv, lib, fetchurl, perl, gnused, dpkg, makeWrapper, autoPatchelfHook, libredirect }: + +stdenv.mkDerivation rec { + pname = "cups-brother-hll3230cdw"; + version = "1.0.2"; + src = fetchurl { + url = "https://download.brother.com/welcome/dlf103925/hll3230cdwpdrv-${version}-0.i386.deb"; + sha256 = "9d49abc584bf22bc381510618a34107ead6ab14562b51831fefd6009947aa5a9"; + }; + + nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ]; + + buildInputs = [ perl gnused libredirect ]; + + unpackPhase = "dpkg-deb -x $src ."; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + cp -pr opt "$out" + cp -pr usr/bin "$out/bin" + rm "$out/opt/brother/Printers/hll3230cdw/cupswrapper/cupswrapperhll3230cdw" + + mkdir -p "$out/lib/cups/filter" "$out/share/cups/model" + + ln -s "$out/opt/brother/Printers/hll3230cdw/cupswrapper/brother_lpdwrapper_hll3230cdw" \ + "$out/lib/cups/filter/brother_lpdwrapper_hll3230cdw" + ln -s "$out/opt/brother/Printers/hll3230cdw/cupswrapper/brother_hll3230cdw_printer_en.ppd" \ + "$out/share/cups/model/brother_hll3230cdw_printer_en.ppd" + + runHook postInstall + ''; + + # Fix global references and replace auto discovery mechanism + # with hardcoded values. + # + # The configuration binary 'brprintconf_hll3230cdw' and lpd filter + # 'brhll3230cdwfilter' has hardcoded /opt format strings. There isn't + # sufficient space in the binaries to substitute a path in the store, so use + # libredirect to get it to see the correct path. The configuration binary + # also uses this format string to print configuration locations. Here the + # wrapper output is processed to point into the correct location in the + # store. + + postFixup = '' + substituteInPlace $out/opt/brother/Printers/hll3230cdw/lpd/filter_hll3230cdw \ + --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/hll3230cdw/\"; #" \ + --replace "PRINTER =~" "PRINTER = \"hll3230cdw\"; #" + + substituteInPlace $out/opt/brother/Printers/hll3230cdw/cupswrapper/brother_lpdwrapper_hll3230cdw \ + --replace "PRINTER =~" "PRINTER = \"hll3230cdw\"; #" \ + --replace "my \$basedir = \`readlink \$0\`" "my \$basedir = \"$out/opt/brother/Printers/hll3230cdw/\"" + + wrapProgram $out/bin/brprintconf_hll3230cdw \ + --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ + --set NIX_REDIRECTS /opt=$out/opt + + wrapProgram $out/opt/brother/Printers/hll3230cdw/lpd/brhll3230cdwfilter \ + --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ + --set NIX_REDIRECTS /opt=$out/opt + + substituteInPlace $out/bin/brprintconf_hll3230cdw \ + --replace \"\$"@"\" \"\$"@\" | LD_PRELOAD= ${gnused}/bin/sed -E '/^(function list :|resource file :).*/{s#/opt#$out/opt#}'" + ''; + + meta = with lib; { + description = "Brother HL-L3230CDW printer driver"; + license = licenses.unfree; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + maintainers = with maintainers; [ aplund ]; + platforms = [ "x86_64-linux" "i686-linux" ]; + homepage = "http://www.brother.com/"; + downloadPage = "https://support.brother.com/g/b/downloadend.aspx?c=us&lang=en&prod=hll3230cdw_us_eu_as&os=128&dlid=dlf103925_000&flang=4&type3=10283"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d7bf9420b3d6..3209888d937d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37960,6 +37960,8 @@ with pkgs; cups-brother-hll2340dw = pkgsi686Linux.callPackage ../misc/cups/drivers/hll2340dw { }; + cups-brother-hll3230cdw = pkgsi686Linux.callPackage ../misc/cups/drivers/hll3230cdw { }; + cups-brother-hll2350dw = callPackage ../misc/cups/drivers/hll2350dw { }; cups-brother-mfcl2750dw = callPackage ../misc/cups/drivers/mfcl2750dw { };