tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
cubeb: Add Darwin support
Zhaofeng Li
3 years ago
a23af657
a13bc3e8
+24
-12
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
audio
cubeb
default.nix
top-level
all-packages.nix
+21
-11
pkgs/development/libraries/audio/cubeb/default.nix
···
6
6
, libpulseaudio
7
7
, sndio
8
8
, speexdsp
9
9
-
, lazyLoad ? true
9
9
+
, AudioUnit
10
10
+
, CoreAudio
11
11
+
, CoreServices
12
12
+
, lazyLoad ? !stdenv.isDarwin
10
13
}:
11
14
12
12
-
stdenv.mkDerivation {
15
15
+
assert lib.assertMsg (stdenv.isDarwin -> !lazyLoad) "cubeb: lazyLoad is inert on Darwin";
16
16
+
17
17
+
let
18
18
+
backendLibs = [
19
19
+
alsa-lib
20
20
+
jack2
21
21
+
libpulseaudio
22
22
+
sndio
23
23
+
];
24
24
+
25
25
+
in stdenv.mkDerivation {
13
26
pname = "cubeb";
14
27
version = "unstable-2022-10-18";
15
28
···
25
38
pkg-config
26
39
];
27
40
28
28
-
buildInputs = [
29
29
-
alsa-lib
30
30
-
jack2
31
31
-
libpulseaudio
32
32
-
sndio
33
33
-
speexdsp
34
34
-
];
41
41
+
buildInputs = [ speexdsp ] ++ (
42
42
+
if stdenv.isDarwin then [ AudioUnit CoreAudio CoreServices ]
43
43
+
else backendLibs
44
44
+
);
35
45
36
46
cmakeFlags = [
37
47
"-DBUILD_SHARED_LIBS=ON"
···
45
55
46
56
passthru = {
47
57
# For downstream users when lazyLoad is true
48
48
-
backendLibs = [ alsa-lib jack2 libpulseaudio sndio ];
58
58
+
backendLibs = lib.optionals lazyLoad backendLibs;
49
59
};
50
60
51
61
meta = with lib; {
52
62
description = "Cross platform audio library";
53
63
homepage = "https://github.com/mozilla/cubeb";
54
64
license = licenses.isc;
55
55
-
platforms = platforms.linux;
65
65
+
platforms = platforms.linux ++ platforms.darwin;
56
66
maintainers = with maintainers; [ zhaofengli ];
57
67
};
58
68
}
+3
-1
pkgs/top-level/all-packages.nix
···
18309
18309
# justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990
18310
18310
cachix = haskell.lib.compose.justStaticExecutables haskellPackages.cachix;
18311
18311
18312
18312
-
cubeb = callPackage ../development/libraries/audio/cubeb { };
18312
18312
+
cubeb = callPackage ../development/libraries/audio/cubeb {
18313
18313
+
inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreServices;
18314
18314
+
};
18313
18315
18314
18316
hercules-ci-agent = callPackage ../development/tools/continuous-integration/hercules-ci-agent { };
18315
18317