diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/czmq')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/czmq/3.x.nix | 26 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/czmq/4.x.nix | 21 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch | 26 |
3 files changed, 73 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/czmq/3.x.nix b/nixpkgs/pkgs/development/libraries/czmq/3.x.nix new file mode 100644 index 000000000000..73a51cd27310 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/czmq/3.x.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, zeromq }: + +stdenv.mkDerivation rec { + version = "3.0.2"; + pname = "czmq"; + + src = fetchurl { + url = "http://download.zeromq.org/${pname}-${version}.tar.gz"; + sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb"; + }; + + patches = [ ./czmq3-gcc7.patch ]; + + # Fix build on Glibc 2.24. + NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + + # Needs to be propagated for the .pc file to work + propagatedBuildInputs = [ zeromq ]; + + meta = with stdenv.lib; { + homepage = http://czmq.zeromq.org/; + description = "High-level C Binding for ZeroMQ"; + license = licenses.mpl20; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/czmq/4.x.nix b/nixpkgs/pkgs/development/libraries/czmq/4.x.nix new file mode 100644 index 000000000000..05e499c73d0c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/czmq/4.x.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl, zeromq }: + +stdenv.mkDerivation rec { + version = "4.2.0"; + pname = "czmq"; + + src = fetchurl { + url = "https://github.com/zeromq/czmq/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "1szciz62sk3fm4ga9qjpxz0n0lazvphm32km95bq92ncng12kayg"; + }; + + # Needs to be propagated for the .pc file to work + propagatedBuildInputs = [ zeromq ]; + + meta = with stdenv.lib; { + homepage = http://czmq.zeromq.org/; + description = "High-level C Binding for ZeroMQ"; + license = licenses.mpl20; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch new file mode 100644 index 000000000000..4ab14685a6c1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch @@ -0,0 +1,26 @@ +diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc +index 37dbb4eb..727aaa9b 100644 +--- a/src/zgossip_engine.inc ++++ b/src/zgossip_engine.inc +@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string) + { + if (client) { + s_client_t *self = (s_client_t *) client; +- snprintf (self->log_prefix, sizeof (self->log_prefix) - 1, ++ snprintf (self->log_prefix, sizeof (self->log_prefix), + "%6d:%-33s", self->unique_id, string); + } + } +diff --git a/src/zsys.c b/src/zsys.c +index 4d0bb8a1..f07db9c8 100644 +--- a/src/zsys.c ++++ b/src/zsys.c +@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user) + } + } + // We record the current process id in the lock file +- char pid_buffer [10]; ++ char pid_buffer [32]; + snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ()); + if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) { + zsys_error ("cannot write to lockfile: %s", strerror (errno)); |