summary refs log tree commit diff
diff options
context:
space:
mode:
authorcaadar <v88m@posteo.net>2020-10-14 20:57:10 +0300
committerscr <v88m@posteo.net>2021-02-27 19:06:47 +0300
commit1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c (patch)
tree2c9a62eb7152c62d1e027b7540102639cb185b27
parentb19efccaf1fa2140e0093a16ce816b3a4113cde6 (diff)
downloadnixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar.gz
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar.bz2
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar.lz
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar.xz
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.tar.zst
nixpkgs-1a4033b73c9d1a30ea68419c7fe0c8382ae76e0c.zip
gtklp: init at 1.3.4
-rw-r--r--pkgs/tools/misc/gtklp/default.nix52
-rw-r--r--pkgs/tools/misc/gtklp/patches/autoconf.patch23
-rw-r--r--pkgs/tools/misc/gtklp/patches/mdv-fix-str-fmt.patch22
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 99 insertions, 0 deletions
diff --git a/pkgs/tools/misc/gtklp/default.nix b/pkgs/tools/misc/gtklp/default.nix
new file mode 100644
index 00000000000..43f67b6b795
--- /dev/null
+++ b/pkgs/tools/misc/gtklp/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, lib, fetchurl
+, autoreconfHook, libtool, pkg-config
+, gtk2, glib, cups, gettext, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtklp";
+  version = "1.3.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.src.tar.gz";
+    sha256 = "1arvnnvar22ipgnzqqq8xh0kkwyf71q2sfsf0crajpsr8a8601xy";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+  ];
+
+  buildInputs = [
+    cups
+    gettext
+    glib
+    gtk2
+    libtool
+    openssl
+  ];
+
+  patches = [
+    ./patches/mdv-fix-str-fmt.patch
+    ./patches/autoconf.patch
+  ];
+
+  preConfigure = ''
+    substituteInPlace include/defaults.h --replace "netscape" "firefox"
+    substituteInPlace include/defaults.h --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
+  '';
+
+  meta = with lib; {
+    description = "A graphical frontend for CUPS";
+    homepage = "https://gtklp.sirtobi.com";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ caadar ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/pkgs/tools/misc/gtklp/patches/autoconf.patch b/pkgs/tools/misc/gtklp/patches/autoconf.patch
new file mode 100644
index 00000000000..c1698bee1fd
--- /dev/null
+++ b/pkgs/tools/misc/gtklp/patches/autoconf.patch
@@ -0,0 +1,23 @@
+Patch origin: http://sophie.zarb.org/rpms/68e90a72e0052022f558148d97c9ea2a/files/3
+
+diff --git a/configure.ac b/configure.ac
+index b7a30e9..3768ae9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -8,6 +8,7 @@ AC_CONFIG_HEADERS([config.h])
+ 
+ AC_CONFIG_MACRO_DIR([m4])
+ AM_GNU_GETTEXT([external])
++AM_GNU_GETTEXT_REQUIRE_VERSION([0.21])
+ 
+ dnl Extra params
+ CUPSCONFIGPATH=""
+@@ -30,8 +31,6 @@ AC_SUBST(XLIBS)
+ 
+ dnl Checks for header files
+ 
+-dnl internationalization macros
+-AM_GNU_GETTEXT
+ 
+ 
+ # Forte Compiler ############################################################
diff --git a/pkgs/tools/misc/gtklp/patches/mdv-fix-str-fmt.patch b/pkgs/tools/misc/gtklp/patches/mdv-fix-str-fmt.patch
new file mode 100644
index 00000000000..6cfc90beb02
--- /dev/null
+++ b/pkgs/tools/misc/gtklp/patches/mdv-fix-str-fmt.patch
@@ -0,0 +1,22 @@
+Patch source: http://sophie.zarb.org/rpms/68e90a72e0052022f558148d97c9ea2a/files/1
+
+--- a/libgtklp/libgtklp.c	2020-08-25 17:31:52.427298559 +0100
++++ b/libgtklp/libgtklp.c	2020-08-25 17:36:37.728154682 +0100
+@@ -939,7 +939,7 @@
+ 		gtk_widget_show(pixmapwid);
+ 
+ 		if (strlen(gerror2) == 0)
+-			snprintf(tmplabel, (size_t) MAXLINE, gerror1);
++			snprintf(tmplabel, (size_t) MAXLINE, "%s", gerror1);
+ 		else
+ 			snprintf(tmplabel, (size_t) MAXLINE, gerror1, gerror2);
+ 		label = gtk_label_new(tmplabel);
+@@ -973,7 +973,7 @@
+ #endif
+ 	} else {
+ 		if (strlen(gerror2) == 0)
+-			g_warning(gerror1);
++			g_warning("%s", gerror1);
+ 		else
+ 			g_warning(gerror1, gerror2);
+ 	}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index baf5394c66e..22ad8d12885 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1104,6 +1104,8 @@ in
 
   glyr = callPackage ../tools/audio/glyr { };
 
+  gtklp = callPackage ../tools/misc/gtklp { };
+
   google-amber = callPackage ../tools/graphics/amber { };
 
   hpe-ltfs = callPackage ../tools/backup/hpe-ltfs { };