about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/spandsp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/spandsp')
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/3.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/common.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/default.nix18
3 files changed, 90 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/3.nix b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
new file mode 100644
index 000000000000..24cfc3fc83b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
@@ -0,0 +1,20 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, audiofile
+, libtiff
+, autoreconfHook
+, fetchpatch
+, buildPackages
+, callPackage
+}:
+
+(callPackage ./common.nix {}).overrideAttrs(finalAttrs: {
+  version = "3.0.0";
+  src = fetchFromGitHub {
+    owner = "freeswitch";
+    repo = finalAttrs.pname;
+    rev = "6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6"; # upstream does not seem to believe in tags
+    sha256 = "03w0s99y3zibi5fnvn8lk92dggfgrr0mz5255745jfbz28b2d5y7";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/common.nix b/nixpkgs/pkgs/development/libraries/spandsp/common.nix
new file mode 100644
index 000000000000..73422ed57d65
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spandsp/common.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchurl
+, audiofile
+, libtiff
+, buildPackages
+, fetchpatch
+, autoreconfHook
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "spandsp";
+
+  patches = [
+    # submitted upstream: https://github.com/freeswitch/spandsp/pull/47
+    (fetchpatch {
+      url = "https://github.com/freeswitch/spandsp/commit/1f810894804d3fa61ab3fc2f3feb0599145a3436.patch";
+      hash = "sha256-Cf8aaoriAvchh5cMb75yP2gsZbZaOLha/j5mq3xlkVA=";
+    })
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  propagatedBuildInputs = [ audiofile libtiff ];
+
+  configureFlags = [
+    # This flag is required to prevent linking error in the cross-compilation case.
+    # I think it's fair to assume that realloc(NULL, size) will return a valid memory
+    # block for most libc implementation, so let's just assume that and hope for the best.
+    "ac_cv_func_malloc_0_nonnull=yes"
+  ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/cc"
+  ];
+
+  strictDeps = true;
+
+  meta = {
+    description = "A portable and modular SIP User-Agent with audio and video support";
+    homepage = "https://github.com/freeswitch/spandsp";
+    platforms = with lib.platforms; unix;
+    maintainers = with lib.maintainers; [ ajs124 misuzu ];
+    license = lib.licenses.gpl2;
+    downloadPage = "http://www.soft-switch.org/downloads/spandsp/";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/default.nix b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
new file mode 100644
index 000000000000..cf5e53c3f911
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
@@ -0,0 +1,18 @@
+{ lib
+, stdenv
+, fetchurl
+, audiofile
+, libtiff
+, buildPackages
+, fetchpatch
+, autoreconfHook
+, callPackage
+}:
+
+(callPackage ./common.nix {}).overrideAttrs(_: rec {
+  version = "0.0.6";
+  src = fetchurl {
+    url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz";
+    sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc";
+  };
+})