From 295bb3adf73ce721cd5b0a3ba0189731167c50b6 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 15 Sep 2016 17:23:45 -0400 Subject: [PATCH] czmqpp: init at 1.2.0 --- pkgs/development/libraries/czmqpp/default.nix | 28 +++++++++++++++++++ .../development/libraries/czmqpp/socket.patch | 17 +++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 pkgs/development/libraries/czmqpp/default.nix create mode 100644 pkgs/development/libraries/czmqpp/socket.patch diff --git a/pkgs/development/libraries/czmqpp/default.nix b/pkgs/development/libraries/czmqpp/default.nix new file mode 100644 index 000000000000..672a89cc3c02 --- /dev/null +++ b/pkgs/development/libraries/czmqpp/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, czmq }: + +stdenv.mkDerivation rec { + name = "czmqpp-${version}"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "zeromq"; + repo = "czmqpp"; + rev = "v${version}"; + sha256 = "0z8lwq53yk4h7pgibicx3q9idz15qb95r0pjpz0j5vql6qh46rja"; + }; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "C++ wrapper for czmq. Aims to be minimal, simple and consistent"; + license = licenses.lgpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ chris-martin ]; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + + propagatedBuildInputs = [ czmq ]; + + # https://github.com/zeromq/czmqpp/issues/42 + patches = [ ./socket.patch ]; +} diff --git a/pkgs/development/libraries/czmqpp/socket.patch b/pkgs/development/libraries/czmqpp/socket.patch new file mode 100644 index 000000000000..0464bcf77971 --- /dev/null +++ b/pkgs/development/libraries/czmqpp/socket.patch @@ -0,0 +1,17 @@ +--- /src/socket.cpp ++++ /src/socket.cpp +@@ -60,12 +60,12 @@ + int socket::bind(const std::string& address) + { + // format-security: format not a string literal and no format arguments. +- return zsocket_bind(self_, address.c_str()); ++ return zsocket_bind(self_, "%s", address.c_str()); + } + int socket::connect(const std::string& address) + { + // format-security: format not a string literal and no format arguments. +- return zsocket_connect(self_, address.c_str()); ++ return zsocket_connect(self_, "%s", address.c_str()); + } + + bool operator==(const socket& sock_a, const socket& sock_b) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2a2ba2c563a0..6613500793a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9951,6 +9951,8 @@ in czmq = callPackage ../development/libraries/czmq { }; + czmqpp = callPackage ../development/libraries/czmqpp { }; + zimlib = callPackage ../development/libraries/zimlib { }; zita-convolver = callPackage ../development/libraries/audio/zita-convolver { };