16 stdenv.mkDerivation rec {
17 pname = "ptouch-driver";
20 src = fetchFromGitHub {
22 repo = "printer-driver-ptouch";
24 hash = "sha256-3ZotSHn7lERp53hAzx47Ct/k565rEoensCcltwX/Xls=";
28 # Fixes some invalid XML file that otherwise causes a build failure
30 name = "fix-brother-ql-600.patch";
31 url = "https://github.com/philpem/printer-driver-ptouch/commit/b3c53b3bc4dd98ed172f2c79405c7c09b3b3836a.patch";
32 hash = "sha256-y5bHKFeRXx8Wdl1++l4QNGgiY41LY5uzrRdOlaZyF9I=";
36 buildInputs = [ cups cups-filters ghostscript libpng libxml2 ];
41 (perl.withPackages (pp: with pp; [ XMLLibXML ]))
45 patchShebangs ./foomaticalize
49 export FOOMATICDB="${placeholder "out"}/share/foomatic"
50 mkdir -p "${placeholder "out"}/share/cups/model"
51 foomatic-compiledb -j "$NIX_BUILD_CORES" -d "${placeholder "out"}/share/cups/model/ptouch-driver"
56 echo 'compressing ppd files'
57 find -H "${placeholder "out"}/share/cups/model/ptouch-driver" -type f -iname '*.ppd' -print0 \
58 | xargs -0r -n 4 -P "$NIX_BUILD_CORES" gzip -9n
61 # Comments indicate the respective
62 # package the command is contained in.
64 "rastertoptch" # ptouch-driver
66 "foomatic-rip" # cups-filters
70 changelog = "https://github.com/philpem/printer-driver-ptouch/releases/tag/v${version}";
71 description = "Printer Driver for Brother P-touch and QL Label Printers";
72 downloadPage = "https://github.com/philpem/printer-driver-ptouch";
73 homepage = "https://github.com/philpem/printer-driver-ptouch";
74 license = licenses.gpl2Plus;
75 maintainers = with maintainers; [ sascha8a ];
76 platforms = platforms.linux;
78 This is ptouch-driver, a printer driver based on CUPS and foomatic,
79 for the Brother P-touch and QL label printer families.