git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31765 from adisbladis/czmq-gcc7

czmq: Fix build with gcc-7

commit1352789cfc2edd57a26d50ea1eb248b2c0cc3dd3 authorOrivej Desh <orivej@gmx.fr> dateFri 17 Nov 2017, 20:47 (9 years ago) parent88105eef9cb7a0
3 files changed+36−1
pkgs/development/libraries/czmq/3.x.nix+2 pkgs/development/libraries/czmq/4.x.nix+8−1 pkgs/development/libraries/czmq/czmq3-gcc7.patch+26
pkgs/development/libraries/czmq/3.x.nix+2
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
99 sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
1010 };
1111
12+ patches = [ ./czmq3-gcc7.patch ];
13+
1214 # Fix build on Glibc 2.24.
1315 NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
1416
pkgs/development/libraries/czmq/4.x.nix+8−1
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, zeromq }:
1+{ stdenv, fetchurl, fetchpatch, zeromq }:
22
33stdenv.mkDerivation rec {
44 version = "4.0.2";
@@ -9,6 +9,13 @@ stdenv.mkDerivation rec {
99 sha256 = "12gbh57xnz2v82x1g80gv4bwapmyzl00lbin5ix3swyac8i7m340";
1010 };
1111
12+ patches = [
13+ (fetchpatch {
14+ url = https://patch-diff.githubusercontent.com/raw/zeromq/czmq/pull/1618.patch;
15+ sha256 = "1dssy7k0fni6djail8rz0lk8p777158jvrqhgn500i636gkxaxhp";
16+ })
17+ ];
18+
1219 # Needs to be propagated for the .pc file to work
1320 propagatedBuildInputs = [ zeromq ];
1421
pkgs/development/libraries/czmq/czmq3-gcc7.patchnew file+26
@@ -0,0 +1,26 @@
1+diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
2+index 37dbb4eb..727aaa9b 100644
3+--- a/src/zgossip_engine.inc
4++++ b/src/zgossip_engine.inc
5+@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
6+ {
7+ if (client) {
8+ s_client_t *self = (s_client_t *) client;
9+- snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
10++ snprintf (self->log_prefix, sizeof (self->log_prefix),
11+ "%6d:%-33s", self->unique_id, string);
12+ }
13+ }
14+diff --git a/src/zsys.c b/src/zsys.c
15+index 4d0bb8a1..f07db9c8 100644
16+--- a/src/zsys.c
17++++ b/src/zsys.c
18+@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
19+ }
20+ }
21+ // We record the current process id in the lock file
22+- char pid_buffer [10];
23++ char pid_buffer [32];
24+ snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
25+ if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
26+ zsys_error ("cannot write to lockfile: %s", strerror (errno));