summary refs log tree commit diff
path: root/pkgs/development/libraries/libunique
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-02-18 10:35:46 +0100
committerVladimír Čunát <vcunat@gmail.com>2018-02-18 10:35:46 +0100
commit64db4f7a57315f6be9b8bcc03fb549a85a11c9b7 (patch)
tree1e40b89516a37e4d35d27148d56f7eeabc800fa6 /pkgs/development/libraries/libunique
parente202018d1fee2222bccd6099f9f9ac0998609360 (diff)
downloadnixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar.gz
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar.bz2
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar.lz
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar.xz
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.tar.zst
nixpkgs-64db4f7a57315f6be9b8bcc03fb549a85a11c9b7.zip
libunique: fix build with gcc-7 by fixing a bug
Diffstat (limited to 'pkgs/development/libraries/libunique')
-rw-r--r--pkgs/development/libraries/libunique/default.nix5
-rw-r--r--pkgs/development/libraries/libunique/gcc7-bug.patch18
2 files changed, 21 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix
index a5adaa9ac17..1bef7683654 100644
--- a/pkgs/development/libraries/libunique/default.nix
+++ b/pkgs/development/libraries/libunique/default.nix
@@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
     ./1.1.6-fix-test.patch
     ./1.1.6-G_CONST_RETURN.patch
     ./1.1.6-include-terminator.patch
-  ];
+  ]
+    ++ [ ./gcc7-bug.patch ];
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ glib gtk2 dbus_glib ];
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
-    homepage = http://live.gnome.org/LibUnique;
+    homepage = https://wiki.gnome.org/Attic/LibUnique;
     description = "A library for writing single instance applications";
     license = stdenv.lib.licenses.lgpl21;
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/libunique/gcc7-bug.patch b/pkgs/development/libraries/libunique/gcc7-bug.patch
new file mode 100644
index 00000000000..2b0587510bc
--- /dev/null
+++ b/pkgs/development/libraries/libunique/gcc7-bug.patch
@@ -0,0 +1,18 @@
+gcc-7 newly detects this class of bugs.
+In this particular case it's clear that the inention was
+to detect if the string is non-NULL *and* non-empty.
+
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..66a7226 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -176,7 +176,7 @@ set_startup_id (UniqueBackend *backend,
+ {
+   gchar *id;
+ 
+-  if (startup_id && startup_id != '\0')
++  if (startup_id && *startup_id != '\0')
+     id = g_strdup (startup_id);
+   else
+     {