2020-12-27 14:24:52 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, avahi
|
|
|
|
, cups
|
|
|
|
, gnutls
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libusb1
|
|
|
|
, pkg-config
|
|
|
|
, withPAMSupport ? true, pam
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pappl";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "1.1.0";
|
2020-12-27 14:24:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "michaelrsweet";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "sha256-FsmR0fFb9bU9G3oUyJU1eDLcoZ6OQ2//TINlPrW6lU0=";
|
2020-12-27 14:24:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cups
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libusb1
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
# upstream mentions these are not needed for Mac
|
|
|
|
# see: https://github.com/michaelrsweet/pappl#requirements
|
|
|
|
avahi
|
|
|
|
gnutls
|
|
|
|
] ++ lib.optionals withPAMSupport [
|
|
|
|
pam
|
|
|
|
];
|
|
|
|
|
|
|
|
# testing requires some networking
|
|
|
|
# doCheck = true;
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/pappl-makeresheader --help
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C-based framework/library for developing CUPS Printer Applications";
|
|
|
|
homepage = "https://github.com/michaelrsweet/pappl";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux; # should also work for darwin, but requires additional work
|
|
|
|
maintainers = with maintainers; [ jonringer ];
|
|
|
|
};
|
|
|
|
}
|