about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/librist
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/librist')
-rw-r--r--nixpkgs/pkgs/development/libraries/librist/darwin.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/librist/default.nix48
2 files changed, 64 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/librist/darwin.patch b/nixpkgs/pkgs/development/libraries/librist/darwin.patch
new file mode 100644
index 000000000000..6a5cc8459a36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librist/darwin.patch
@@ -0,0 +1,16 @@
+diff --git a/tools/srp_shared.c b/tools/srp_shared.c
+index f782126..23e82a5 100644
+--- a/tools/srp_shared.c
++++ b/tools/srp_shared.c
+@@ -173,7 +173,11 @@ void user_verifier_lookup(char * username,
+ 	if (stat(srpfile, &buf) != 0)
+ 		return;
+ 
++#if defined(__APPLE__)
++	*generation = ((uint64_t)buf.st_mtimespec.tv_sec << 32) | buf.st_mtimespec.tv_nsec;
++#else
+ 	*generation = ((uint64_t)buf.st_mtim.tv_sec << 32) | buf.st_mtim.tv_nsec;
++#endif
+ #endif
+ 
+ 	if (!lookup_data || !hashversion)
diff --git a/nixpkgs/pkgs/development/libraries/librist/default.nix b/nixpkgs/pkgs/development/libraries/librist/default.nix
new file mode 100644
index 000000000000..3f56ff324876
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librist/default.nix
@@ -0,0 +1,48 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, cjson
+, cmocka
+, mbedtls
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librist";
+  version = "0.2.10";
+
+  src = fetchFromGitLab {
+    domain = "code.videolan.org";
+    owner = "rist";
+    repo = "librist";
+    rev = "v${version}";
+    hash = "sha256-8N4wQXxjNZuNGx/c7WVAV5QS48Bff5G3t11UkihT+K0=";
+  };
+
+  patches = [
+    # https://github.com/NixOS/nixpkgs/pull/257020
+    ./darwin.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    cjson
+    cmocka
+    mbedtls
+  ];
+
+  meta = with lib; {
+    description = "A library that can be used to easily add the RIST protocol to your application.";
+    homepage = "https://code.videolan.org/rist/librist";
+    license = with licenses; [ bsd2 mit isc ];
+    maintainers = with maintainers; [ raphaelr sebtm ];
+    platforms = platforms.all;
+  };
+}