nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, fftw, speexdsp }:
2
3stdenv.mkDerivation rec {
4 pname = "speex";
5 version = "1.2.0";
6
7 src = fetchurl {
8 url = "http://downloads.us.xiph.org/releases/speex/speex-${version}.tar.gz";
9 sha256 = "150047wnllz4r94whb9r73l5qf0z5z3rlhy98bawfbblmkq8mbpa";
10 };
11
12 postPatch = ''
13 sed -i '/AC_CONFIG_MACRO_DIR/i PKG_PROG_PKG_CONFIG' configure.ac
14 '';
15
16 patches = [
17 (fetchpatch {
18 name = "CVE-2020-23903.patch";
19 url = "https://github.com/xiph/speex/commit/870ff845b32f314aec0036641ffe18aba4916887.patch";
20 sha256 = "sha256-uEMDhDTw/LIWNPPCXW6kF+udBmNO88G/jJTojAA9fs8=";
21 })
22 ];
23
24 outputs = [ "out" "dev" "doc" ];
25
26 nativeBuildInputs = [ autoreconfHook pkg-config ];
27 buildInputs = [ fftw speexdsp ];
28
29 # TODO: Remove this will help with immediate backward compatability
30 propagatedBuildInputs = [ speexdsp ];
31
32 configureFlags = [
33 "--with-fft=gpl-fftw3"
34 ];
35
36 meta = with lib; {
37 homepage = "https://www.speex.org/";
38 description = "An Open Source/Free Software patent-free audio compression format designed for speech";
39 license = licenses.bsd3;
40 platforms = platforms.unix;
41 };
42}