Skip to content

Commit

Permalink
gtklp: adopt
Browse files Browse the repository at this point in the history
- finalAttrs design pattern
- split outputs
- strictDeps
- remove nested with
- set meta.mainProgram
  • Loading branch information
AndersonTorres committed Dec 30, 2023
1 parent d76236d commit 6103159
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
File renamed without changes.
56 changes: 35 additions & 21 deletions pkgs/by-name/gt/gtklp/package.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
{ stdenv, lib, fetchurl
, autoreconfHook, libtool, pkg-config
, gtk2, glib, cups, gettext, openssl
{ lib
, stdenv
, autoreconfHook
, cups
, fetchurl
, gettext
, glib
, gtk2
, libtool
, openssl
, pkg-config
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gtklp";
version = "1.3.4";

src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.src.tar.gz";
sha256 = "1arvnnvar22ipgnzqqq8xh0kkwyf71q2sfsf0crajpsr8a8601xy";
url = "mirror://sourceforge/gtklp/gtklp-${finalAttrs.version}.src.tar.gz";
hash = "sha256-vgdgkEJZX6kyA047LXA4zvM5AewIY/ztu1GIrLa1O6s=";
};

nativeBuildInputs = [
pkg-config
autoreconfHook
pkg-config
cups
];

buildInputs = [
Expand All @@ -26,32 +35,37 @@ stdenv.mkDerivation rec {
openssl
];

outputs = [ "out" "doc" "man" ];

strictDeps = true;

patches = [
./patches/mdv-fix-str-fmt.patch
./patches/autoconf.patch
./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";

preConfigure = ''
substituteInPlace include/defaults.h --replace "netscape" "firefox"
substituteInPlace include/defaults.h --replace "http://localhost:631/sum.html#STANDARD_OPTIONS" \
"http://localhost:631/help/"
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 $out/share/doc AUTHORS BUGS ChangeLog README USAGE
install -D -m0644 -t $doc/share/doc AUTHORS BUGS ChangeLog README USAGE
'';

meta = with lib; {
description = "A graphical frontend for CUPS";
meta = {
homepage = "https://gtklp.sirtobi.com";
license = licenses.gpl2Only;
maintainers = with maintainers; [ caadar ];
platforms = platforms.unix;
description = "A GTK-based graphical frontend for CUPS";
license = with lib.licenses; [ gpl2Only ];
mainProgram = "gtklp";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};

}
})

0 comments on commit 6103159

Please sign in to comment.