about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/gt
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/gt')
-rw-r--r--nixpkgs/pkgs/by-name/gt/gtkclipblock/package.nix51
-rw-r--r--nixpkgs/pkgs/by-name/gt/gtklp/000-autoconf.patch23
-rw-r--r--nixpkgs/pkgs/by-name/gt/gtklp/001-format-parameter.patch22
-rw-r--r--nixpkgs/pkgs/by-name/gt/gtklp/package.nix71
4 files changed, 167 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/gt/gtkclipblock/package.nix b/nixpkgs/pkgs/by-name/gt/gtkclipblock/package.nix
new file mode 100644
index 000000000000..a4d5400af6fe
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/gt/gtkclipblock/package.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, cmake
+, ninja
+, pkg-config
+, gtk2
+, gtk3
+, gtk4
+}:
+
+let
+  distorm-src = fetchFromGitHub {
+    owner = "gdabah";
+    repo = "distorm";
+    rev = "3.5.2b";
+    hash = "sha256-2ftEV3TMS3HT7f96k+Pwt3Mm31fVEXcHpcbbz05jycU=";
+  };
+  pname = "gtkclipblock";
+  version = "0.2.2";
+
+  src = fetchFromGitHub {
+    owner = "notpeelz";
+    repo = "gtkclipblock";
+    rev = "v${version}";
+    hash = "sha256-ok/D7M0KekN8zf8AzhcOLtedbYVRHHv3m9zEHsJfcPM=";
+    fetchSubmodules = true;
+  };
+in
+stdenv.mkDerivation {
+  inherit pname version src;
+
+  nativeBuildInputs = [ meson cmake ninja pkg-config ];
+
+  buildInputs = [ gtk2 gtk3 gtk4 ];
+
+  postPatch = ''
+    substituteInPlace subprojects/funchook-helper/subprojects/funchook/CMakeLists.txt \
+      --replace "GIT_REPOSITORY https://github.com/gdabah/distorm.git" "SOURCE_DIR ${distorm-src}"
+  '';
+
+  dontUseCmakeConfigure = true;
+
+  meta = with lib; {
+    description = "A LD_PRELOAD hack to prevent GTK programs from interacting with the primary clipboard";
+    license = licenses.lgpl3Only;
+    maintainers = with maintainers; [ uartman ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/gt/gtklp/000-autoconf.patch b/nixpkgs/pkgs/by-name/gt/gtklp/000-autoconf.patch
new file mode 100644
index 000000000000..c1698bee1fdc
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/gt/gtklp/000-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/nixpkgs/pkgs/by-name/gt/gtklp/001-format-parameter.patch b/nixpkgs/pkgs/by-name/gt/gtklp/001-format-parameter.patch
new file mode 100644
index 000000000000..6cfc90beb02a
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/gt/gtklp/001-format-parameter.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/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;
+  };
+})