lol
1{ lib, stdenv, fetchFromGitHub
2, avahi
3, cups
4, gnutls
5, libjpeg
6, libpng
7, libusb1
8, pkg-config
9, withPAMSupport ? true, pam
10, zlib
11}:
12
13stdenv.mkDerivation rec {
14 pname = "pappl";
15 version = "1.0.3";
16
17 src = fetchFromGitHub {
18 owner = "michaelrsweet";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "sha256-B3g6R0/li+5D4odFG21qj+SR3K4PFnzzxIGCwbk1buo=";
22 };
23
24 outputs = [ "out" "dev" ];
25
26 nativeBuildInputs = [
27 pkg-config
28 ];
29
30 buildInputs = [
31 cups
32 libjpeg
33 libpng
34 libusb1
35 zlib
36 ] ++ lib.optionals (!stdenv.isDarwin) [
37 # upstream mentions these are not needed for Mac
38 # see: https://github.com/michaelrsweet/pappl#requirements
39 avahi
40 gnutls
41 ] ++ lib.optionals withPAMSupport [
42 pam
43 ];
44
45 # testing requires some networking
46 # doCheck = true;
47
48 doInstallCheck = true;
49 installCheckPhase = ''
50 $out/bin/pappl-makeresheader --help
51 '';
52
53 enableParallelBuilding = true;
54
55 meta = with lib; {
56 description = "C-based framework/library for developing CUPS Printer Applications";
57 homepage = "https://github.com/michaelrsweet/pappl";
58 license = licenses.asl20;
59 platforms = platforms.linux; # should also work for darwin, but requires additional work
60 maintainers = with maintainers; [ jonringer ];
61 };
62}