1{ lib, stdenv, fetchurl, pkg-config, libsndfile }:
2
3stdenv.mkDerivation rec {
4 pname = "libbs2b";
5 version = "3.1.0";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/bs2b/${pname}-${version}.tar.bz2";
9 sha256 = "0vz442kkjn2h0dlxppzi4m5zx8qfyrivq581n06xzvnyxi5rg6a7";
10 };
11
12 nativeBuildInputs = [ pkg-config ];
13 buildInputs = [ libsndfile ];
14
15 configureFlags = [
16 # Required for cross-compilation.
17 # Prevents linking error with 'undefined reference to rpl_malloc'.
18 # I think it's safe to assume that most libcs will properly handle
19 # realloc(NULL, size) and treat it like malloc(size).
20 "ac_cv_func_malloc_0_nonnull=yes"
21 ];
22 hardeningDisable = [ "format" ];
23
24 meta = {
25 homepage = "https://bs2b.sourceforge.net/";
26 description = "Bauer stereophonic-to-binaural DSP library";
27 license = lib.licenses.mit;
28 platforms = lib.platforms.unix;
29 };
30}