Skip to content

Commit

Permalink
spandsp: fix cross compilation
Browse files Browse the repository at this point in the history
This commit adds `autoreconfHook` and cherry-picks a patch submitted
upstream in order to fix cross compilation.

- freeswitch/spandsp#47
  • Loading branch information
Adam Joseph committed Mar 7, 2023
1 parent d3e9cbd commit af189bd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
17 changes: 16 additions & 1 deletion pkgs/development/libraries/spandsp/3.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand Down
14 changes: 13 additions & 1 deletion pkgs/development/libraries/spandsp/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -21,6 +32,7 @@ stdenv.mkDerivation rec {
];

strictDeps = true;
nativeBuildInputs = [ autoreconfHook ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
propagatedBuildInputs = [audiofile libtiff];
meta = {
Expand Down

0 comments on commit af189bd

Please sign in to comment.