about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/spandsp
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/spandsp
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/spandsp')
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/3.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/common.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/default.nix43
3 files changed, 80 insertions, 47 deletions
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/3.nix b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
index ceb53e05744e..24cfc3fc83b6 100644
--- a/nixpkgs/pkgs/development/libraries/spandsp/3.nix
+++ b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
@@ -1,24 +1,20 @@
-{ lib, stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }:
-stdenv.mkDerivation rec {
+{ lib
+, stdenv
+, fetchFromGitHub
+, audiofile
+, libtiff
+, autoreconfHook
+, fetchpatch
+, buildPackages
+, callPackage
+}:
+
+(callPackage ./common.nix {}).overrideAttrs(finalAttrs: {
   version = "3.0.0";
-  pname = "spandsp";
   src = fetchFromGitHub {
     owner = "freeswitch";
-    repo = pname;
+    repo = finalAttrs.pname;
     rev = "6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6"; # upstream does not seem to believe in tags
     sha256 = "03w0s99y3zibi5fnvn8lk92dggfgrr0mz5255745jfbz28b2d5y7";
   };
-
-  outputs = [ "out" "dev" ];
-
-  nativeBuildInputs = [ autoreconfHook ];
-  propagatedBuildInputs = [ audiofile libtiff ];
-
-  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;
-  };
-}
+})
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
index f2bc63d4f6d6..cf5e53c3f911 100644
--- a/nixpkgs/pkgs/development/libraries/spandsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
@@ -1,33 +1,18 @@
-{ lib, stdenv, fetchurl, audiofile, libtiff, buildPackages }:
-stdenv.mkDerivation rec {
+{ lib
+, stdenv
+, fetchurl
+, audiofile
+, libtiff
+, buildPackages
+, fetchpatch
+, autoreconfHook
+, callPackage
+}:
+
+(callPackage ./common.nix {}).overrideAttrs(_: rec {
   version = "0.0.6";
-  pname = "spandsp";
-  src=fetchurl {
+  src = fetchurl {
     url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz";
     sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc";
   };
-
-  outputs = [ "out" "dev" ];
-  makeFlags = [
-    "CC=${stdenv.cc.targetPrefix}cc"
-  ];
-
-  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"
-  ];
-
-  strictDeps = true;
-  depsBuildBuild = [ buildPackages.stdenv.cc ];
-  propagatedBuildInputs = [audiofile libtiff];
-  meta = {
-    description = "A portable and modular SIP User-Agent with audio and video support";
-    homepage = "http://www.creytiv.com/baresip.html";
-    platforms = with lib.platforms; linux;
-    maintainers = with lib.maintainers; [raskin];
-    license = lib.licenses.gpl2;
-    downloadPage = "http://www.soft-switch.org/downloads/spandsp/";
-  };
-}
+})