nixpkgs/pkgs/by-name/gt/gtklp/package.nix
Anderson Torres 61031595bd gtklp: adopt
- finalAttrs design pattern
- split outputs
- strictDeps
- remove nested with
- set meta.mainProgram
2023-12-30 12:18:38 -03:00

71 lines
1.5 KiB
Nix

{ lib
, stdenv
, autoreconfHook
, cups
, fetchurl
, gettext
, glib
, gtk2
, libtool
, openssl
, pkg-config
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gtklp";
version = "1.3.4";
src = fetchurl {
url = "mirror://sourceforge/gtklp/gtklp-${finalAttrs.version}.src.tar.gz";
hash = "sha256-vgdgkEJZX6kyA047LXA4zvM5AewIY/ztu1GIrLa1O6s=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
cups
];
buildInputs = [
cups
gettext
glib
gtk2
libtool
openssl
];
outputs = [ "out" "doc" "man" ];
strictDeps = true;
patches = [
./000-autoconf.patch
./001-format-parameter.patch
];
# Workaround build failure on -fno-common toolchains:
# ld: libgtklp.a(libgtklp.o):libgtklp/libgtklp.h:83: multiple definition of `progressBar';
# file.o:libgtklp/libgtklp.h:83: first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
postPatch = ''
substituteInPlace include/defaults.h \
--replace "netscape" "firefox" \
--replace "http://localhost:631/sum.html#STANDARD_OPTIONS" \
"http://localhost:631/help/"
'';
preInstall = ''
install -D -m0644 -t $doc/share/doc AUTHORS BUGS ChangeLog README USAGE
'';
meta = {
homepage = "https://gtklp.sirtobi.com";
description = "A GTK-based graphical frontend for CUPS";
license = with lib.licenses; [ gpl2Only ];
mainProgram = "gtklp";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
})