summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/cups-ptouch/default.nix
blob: be0dd1663cf2a7a3918bf280748bc1f1050d11e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib, stdenv
, fetchFromGitHub
, autoreconfHook
, gd
, libusb1
, cups
, libpng
, perl
, perlPackages
, libxml2
, callPackage
, foomatic-db-engine ? ( callPackage ../foomatic-db-engine {} )
}:

stdenv.mkDerivation rec {
  pname = "printer-driver-ptouch";
  version = "1.6";

  src = fetchFromGitHub {
    owner = "philpem";
    repo = "printer-driver-ptouch";
    rev = "v${version}";
    sha256 = "1c4hkncnr4qwkbz5dfvksngvq057j6xnbi1jjvchnlr7zgj7cndk";
  };

  postPatch = ''
    patchShebangs foomaticalize
    '';
  nativeBuildInputs = [
    autoreconfHook
    perl
    libxml2
    perlPackages.XMLLibXML
    foomatic-db-engine
  ];
  
  buildInputs = [
    cups
    libpng
  ];
  postInstall = ''
    mkdir -p $out/share/cups/model/
    echo "dummy dummy" > "$out/share/foomatic/db/oldprinterids"
    FOOMATICDB="$out/share/foomatic" foomatic-compiledb -t ppd -d "$out/share/cups/model/Brother/"
    rm -r $out/share/foomatic
  '';
  
  meta = with lib; {
    description = "Command line tool to print labels on Brother P-Touch printers on Linux";
    license = licenses.gpl3Plus;
    homepage = "https://mockmoon-cybernetics.ch/computer/p-touch2430pc/";
    maintainers = with maintainers; [ shamilton ];
    platforms = platforms.linux;
  };
}