diff --git a/pkgs/by-name/cp/cpp-redis/01-fix-sleep_for.patch b/pkgs/by-name/cp/cpp-redis/01-fix-sleep_for.patch new file mode 100644 index 0000000000000..54bc953f3a962 --- /dev/null +++ b/pkgs/by-name/cp/cpp-redis/01-fix-sleep_for.patch @@ -0,0 +1,12 @@ +diff --git a/sources/core/client.cpp b/sources/core/client.cpp +index 7ea20e2..c5d2c40 100644 +--- a/sources/core/client.cpp ++++ b/sources/core/client.cpp +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + namespace cpp_redis { + diff --git a/pkgs/by-name/cp/cpp-redis/package.nix b/pkgs/by-name/cp/cpp-redis/package.nix new file mode 100644 index 0000000000000..6fc1e5b7c1e33 --- /dev/null +++ b/pkgs/by-name/cp/cpp-redis/package.nix @@ -0,0 +1,38 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, +}: + +stdenv.mkDerivation rec { + pname = "cpp-redis"; + version = "4.3.1"; + + src = fetchFromGitHub { + owner = "cpp-redis"; + repo = "cpp_redis"; + rev = version; + hash = "sha256-dLAnxgldylWWKO3WIyx+F7ylOpRH+0nD7NZjWSOxuwQ="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + CFLAGS = "-D_GLIBCXX_USE_NANOSLEEP"; + patches = [ + ./01-fix-sleep_for.patch + ]; + + meta = with lib; { + description = "C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform"; + homepage = "https://github.com/cpp-redis/cpp_redis"; + changelog = "https://github.com/cpp-redis/cpp_redis/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ poelzi ]; + platforms = platforms.all; + }; +}