about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/gt/gtklp/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/gt/gtklp/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/gt/gtklp/package.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/gt/gtklp/package.nix b/nixpkgs/pkgs/by-name/gt/gtklp/package.nix
new file mode 100644
index 000000000000..c74b9f59644a
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/gt/gtklp/package.nix
@@ -0,0 +1,71 @@
+{ 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;
+  };
+})