From 4970328d9c1de1d24df2c5cc91df693dd2e752e7 Mon Sep 17 00:00:00 2001 From: Alexander Lampalzer Date: Sat, 10 Feb 2024 13:10:12 +0100 Subject: [PATCH 1/2] maintainers: add sascha8a --- maintainers/maintainer-list.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e14b96b067d8..070c4bbe9ebd 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -16821,6 +16821,15 @@ githubId = 178904; name = "Daniel Ehlers"; }; + sascha8a = { + email = "sascha@localhost.systems"; + github = "sascha8a"; + githubId = 6937965; + name = "Alexander Lampalzer"; + keys = [{ + fingerprint = "0350 3136 E22C C561 30E3 A4AE 2087 9CCA CD5C D670"; + }]; + }; saschagrunert = { email = "mail@saschagrunert.de"; github = "saschagrunert"; From c7639264630ef87794e03dfb720ed7531e506b27 Mon Sep 17 00:00:00 2001 From: Alexander Lampalzer Date: Thu, 15 Feb 2024 18:56:32 +0100 Subject: [PATCH 2/2] ptouch-driver: init at 1.7.0 --- pkgs/by-name/pt/ptouch-driver/package.nix | 82 +++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 pkgs/by-name/pt/ptouch-driver/package.nix diff --git a/pkgs/by-name/pt/ptouch-driver/package.nix b/pkgs/by-name/pt/ptouch-driver/package.nix new file mode 100644 index 000000000000..851fb0862aa3 --- /dev/null +++ b/pkgs/by-name/pt/ptouch-driver/package.nix @@ -0,0 +1,82 @@ +{ lib +, stdenv +, fetchFromGitHub +, cups +, cups-filters +, foomatic-db-engine +, fetchpatch +, ghostscript +, libpng +, libxml2 +, autoreconfHook +, perl +, patchPpdFilesHook +}: + +stdenv.mkDerivation rec { + pname = "ptouch-driver"; + version = "1.7"; + + src = fetchFromGitHub { + owner = "philpem"; + repo = "printer-driver-ptouch"; + rev = "v${version}"; + hash = "sha256-3ZotSHn7lERp53hAzx47Ct/k565rEoensCcltwX/Xls="; + }; + + patches = [ + # Fixes some invalid XML file that otherwise causes a build failure + (fetchpatch { + name = "fix-brother-ql-600.patch"; + url = "https://github.com/philpem/printer-driver-ptouch/commit/b3c53b3bc4dd98ed172f2c79405c7c09b3b3836a.patch"; + hash = "sha256-y5bHKFeRXx8Wdl1++l4QNGgiY41LY5uzrRdOlaZyF9I="; + }) + ]; + + buildInputs = [ cups cups-filters ghostscript libpng libxml2 ]; + nativeBuildInputs = [ + autoreconfHook + foomatic-db-engine + patchPpdFilesHook + (perl.withPackages (pp: with pp; [ XMLLibXML ])) + ]; + + postPatch = '' + patchShebangs ./foomaticalize + ''; + + postInstall = '' + export FOOMATICDB="${placeholder "out"}/share/foomatic" + mkdir -p "${placeholder "out"}/share/cups/model" + foomatic-compiledb -j "$NIX_BUILD_CORES" -d "${placeholder "out"}/share/cups/model/ptouch-driver" + ''; + + # compress ppd files + postFixup = '' + echo 'compressing ppd files' + find -H "${placeholder "out"}/share/cups/model/ptouch-driver" -type f -iname '*.ppd' -print0 \ + | xargs -0r -n 4 -P "$NIX_BUILD_CORES" gzip -9n + ''; + + # Comments indicate the respective + # package the command is contained in. + ppdFileCommands = [ + "rastertoptch" # ptouch-driver + "gs" # ghostscript + "foomatic-rip" # cups-filters + ]; + + meta = with lib; { + changelog = "https://github.com/philpem/printer-driver-ptouch/releases/tag/v${version}"; + description = "Printer Driver for Brother P-touch and QL Label Printers"; + downloadPage = "https://github.com/philpem/printer-driver-ptouch"; + homepage = "https://github.com/philpem/printer-driver-ptouch"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ sascha8a ]; + platforms = platforms.linux; + longDescription = '' + This is ptouch-driver, a printer driver based on CUPS and foomatic, + for the Brother P-touch and QL label printer families. + ''; + }; +}