From af189bd3de5da15b5fc0baf23c84aacd7192a848 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 26 Feb 2023 09:21:48 -0800 Subject: [PATCH 1/2] spandsp: fix cross compilation This commit adds `autoreconfHook` and cherry-picks a patch submitted upstream in order to fix cross compilation. - https://github.com/freeswitch/spandsp/pull/47 --- pkgs/development/libraries/spandsp/3.nix | 17 ++++++++++++++++- pkgs/development/libraries/spandsp/default.nix | 14 +++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/spandsp/3.nix b/pkgs/development/libraries/spandsp/3.nix index ceb53e05744e6..92af122386fb3 100644 --- a/pkgs/development/libraries/spandsp/3.nix +++ b/pkgs/development/libraries/spandsp/3.nix @@ -1,4 +1,6 @@ -{ lib, stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }: +{ lib, stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook +, fetchpatch +, buildPackages }: stdenv.mkDerivation rec { version = "3.0.0"; pname = "spandsp"; @@ -9,11 +11,24 @@ stdenv.mkDerivation rec { sha256 = "03w0s99y3zibi5fnvn8lk92dggfgrr0mz5255745jfbz28b2d5y7"; }; + 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 ]; propagatedBuildInputs = [ audiofile libtiff ]; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/cc" + ]; + meta = { description = "A portable and modular SIP User-Agent with audio and video support"; homepage = "https://github.com/freeswitch/spandsp"; diff --git a/pkgs/development/libraries/spandsp/default.nix b/pkgs/development/libraries/spandsp/default.nix index 2c96e60c6d376..c4ba98275aaa4 100644 --- a/pkgs/development/libraries/spandsp/default.nix +++ b/pkgs/development/libraries/spandsp/default.nix @@ -1,7 +1,18 @@ -{ lib, stdenv, fetchurl, audiofile, libtiff, buildPackages }: +{ lib, stdenv, fetchurl, audiofile, libtiff, buildPackages +, fetchpatch +, autoreconfHook }: stdenv.mkDerivation rec { version = "0.0.6"; 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="; + }) + ]; + src=fetchurl { url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz"; sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"; @@ -21,6 +32,7 @@ stdenv.mkDerivation rec { ]; strictDeps = true; + nativeBuildInputs = [ autoreconfHook ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; propagatedBuildInputs = [audiofile libtiff]; meta = { From 6b0e09670d4b0edb7ac3d24503a2a9a5a081dc5a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 26 Feb 2023 10:10:22 -0800 Subject: [PATCH 2/2] https://github.com/NixOS/nixpkgs/pull/218477#discussion_r1118125573 --- pkgs/development/libraries/spandsp/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/spandsp/default.nix b/pkgs/development/libraries/spandsp/default.nix index c4ba98275aaa4..b7fa9388e75c2 100644 --- a/pkgs/development/libraries/spandsp/default.nix +++ b/pkgs/development/libraries/spandsp/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchurl, audiofile, libtiff, buildPackages , fetchpatch , autoreconfHook }: + stdenv.mkDerivation rec { version = "0.0.6"; pname = "spandsp";