about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libnats-c
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libnats-c')
-rw-r--r--nixpkgs/pkgs/development/libraries/libnats-c/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libnats-c/default.nix b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
new file mode 100644
index 000000000000..5569fdf9025e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, protobuf, protobufc
+, libsodium, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "libnats";
+  version = "3.6.1";
+
+  src = fetchFromGitHub {
+    owner  = "nats-io";
+    repo   = "nats.c";
+    rev    = "v${version}";
+    sha256 = "sha256-zqtPBxjTJ+/XxVpfVpyFIwvlj5xCcnTrUv2RGzP8UQc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libsodium openssl protobuf protobufc ];
+
+  separateDebugInfo = true;
+  outputs = [ "out" "dev" ];
+
+  # https://github.com/nats-io/nats.c/issues/542
+  postPatch = ''
+    substituteInPlace src/libnats.pc.in \
+      --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
+  '';
+
+  meta = with lib; {
+    description = "C API for the NATS messaging system";
+    homepage    = "https://github.com/nats-io/nats.c";
+    license     = licenses.asl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}