about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libks
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libks')
-rw-r--r--nixpkgs/pkgs/development/libraries/libks/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libks/default.nix b/nixpkgs/pkgs/development/libraries/libks/default.nix
new file mode 100644
index 000000000000..0b1135f8522b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libks/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, libuuid
+, openssl
+, libossp_uuid
+, freeswitch
+, nix-update-script
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libks";
+  version = "2.0.4";
+
+  src = fetchFromGitHub {
+    owner = "signalwire";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-G2ZsTm7qyEhkys+3lcuq1VsKTz3RpfodDekecRRk++w=";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/openwrt/telephony/5ced7ea4fc9bd746273d564bf3c102f253d2182e/libs/libks/patches/01-find-libm.patch";
+      sha256 = "1hyrsdxg69d08qzvf3mbrx2363lw52jcybw8i3ynzqcl228gcg8a";
+    })
+  ];
+
+  dontUseCmakeBuildDir = true;
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [ openssl ]
+    ++ lib.optional stdenv.isLinux libuuid
+    ++ lib.optional stdenv.isDarwin libossp_uuid;
+
+  passthru = {
+    tests.freeswitch = freeswitch;
+    updateScript = nix-update-script { };
+  };
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "Foundational support for signalwire C products";
+    homepage = "https://github.com/signalwire/libks";
+    maintainers = with lib.maintainers; [ misuzu ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}