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 { };