tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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
reviewed
···
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
···
38
25
pkg-config
39
26
];
40
27
41
41
-
buildInputs = [
42
42
-
alsa-lib
43
43
-
jack2
44
44
-
libpulseaudio
45
45
-
sndio
46
46
-
speexdsp
47
47
-
];
28
28
+
buildInputs = [ speexdsp ] ++ (
29
29
+
if stdenv.isDarwin then [ AudioUnit CoreAudio CoreServices ]
30
30
+
else backendLibs
31
31
+
);
48
32
49
33
cmakeFlags = [
50
34
"-DBUILD_SHARED_LIBS=ON"
···
55
45
56
46
passthru = {
57
47
# For downstream users when lazyLoad is true
58
58
-
backendLibs = [ alsa-lib jack2 libpulseaudio sndio ];
48
48
+
backendLibs = lib.optionals lazyLoad backendLibs;
59
49
};
60
50
61
51
meta = with lib; {
62
52
description = "Cross platform audio library";
63
53
homepage = "https://github.com/mozilla/cubeb";
64
54
license = licenses.isc;
65
65
-
platforms = platforms.linux;
55
55
+
platforms = platforms.linux ++ platforms.darwin;
66
56
maintainers = with maintainers; [ zhaofengli ];
67
57
};
68
58
}
+3
-1
pkgs/top-level/all-packages.nix
reviewed
···
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