tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
pulseaudio: refactor meson flags
Weijia Wang
2 years ago
ddacaab6
5655c7f0
+32
-30
1 changed file
expand all
collapse all
unified
split
pkgs
servers
pulseaudio
default.nix
+32
-30
pkgs/servers/pulseaudio/default.nix
···
1
1
-
{ lib, stdenv, fetchurl, fetchpatch, pkg-config
1
1
+
{ lib, stdenv, fetchurl, pkg-config
2
2
, libsndfile, libtool, makeWrapper, perlPackages
3
3
, xorg, libcap, alsa-lib, glib, dconf
4
4
, avahi, libjack2, libasyncns, lirc, dbus
···
88
88
);
89
89
90
90
mesonFlags = [
91
91
-
"-Dalsa=${if !libOnly && alsaSupport then "enabled" else "disabled"}"
92
92
-
"-Dasyncns=${if !libOnly then "enabled" else "disabled"}"
93
93
-
"-Davahi=${if zeroconfSupport then "enabled" else "disabled"}"
94
94
-
"-Dbluez5=${if !libOnly && bluetoothSupport then "enabled" else "disabled"}"
91
91
+
(lib.mesonEnable "alsa" (!libOnly && alsaSupport))
92
92
+
(lib.mesonEnable "asyncns" (!libOnly))
93
93
+
(lib.mesonEnable "avahi" zeroconfSupport)
94
94
+
(lib.mesonEnable "bluez5" (!libOnly && bluetoothSupport))
95
95
# advanced bluetooth audio codecs are provided by gstreamer
96
96
-
"-Dbluez5-gstreamer=${if (!libOnly && bluetoothSupport && advancedBluetoothCodecs) then "enabled" else "disabled"}"
97
97
-
"-Ddatabase=simple"
98
98
-
"-Ddoxygen=false"
99
99
-
"-Delogind=disabled"
96
96
+
(lib.mesonEnable "bluez5-gstreamer" (!libOnly && bluetoothSupport && advancedBluetoothCodecs))
97
97
+
(lib.mesonOption "database" "simple")
98
98
+
(lib.mesonBool "doxygen" false)
99
99
+
(lib.mesonEnable "elogind" false)
100
100
# gsettings does not support cross-compilation
101
101
-
"-Dgsettings=${if stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}"
102
102
-
"-Dgstreamer=disabled"
103
103
-
"-Dgtk=disabled"
104
104
-
"-Djack=${if jackaudioSupport && !libOnly then "enabled" else "disabled"}"
105
105
-
"-Dlirc=${if remoteControlSupport then "enabled" else "disabled"}"
106
106
-
"-Dopenssl=${if airtunesSupport then "enabled" else "disabled"}"
107
107
-
"-Dorc=disabled"
108
108
-
"-Dsystemd=${if useSystemd && !libOnly then "enabled" else "disabled"}"
109
109
-
"-Dtcpwrap=disabled"
110
110
-
"-Dudev=${if !libOnly && udevSupport then "enabled" else "disabled"}"
111
111
-
"-Dvalgrind=disabled"
112
112
-
"-Dwebrtc-aec=${if !libOnly then "enabled" else "disabled"}"
113
113
-
"-Dx11=${if x11Support then "enabled" else "disabled"}"
101
101
+
(lib.mesonEnable "gsettings" (stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform)))
102
102
+
(lib.mesonEnable "gstreamer" false)
103
103
+
(lib.mesonEnable "gtk" false)
104
104
+
(lib.mesonEnable "jack" (jackaudioSupport && !libOnly))
105
105
+
(lib.mesonEnable "lirc" remoteControlSupport)
106
106
+
(lib.mesonEnable "openssl" airtunesSupport)
107
107
+
(lib.mesonEnable "orc" false)
108
108
+
(lib.mesonEnable "systemd" (useSystemd && !libOnly))
109
109
+
(lib.mesonEnable "tcpwrap" false)
110
110
+
(lib.mesonEnable "udev" (!libOnly && udevSupport))
111
111
+
(lib.mesonEnable "valgrind" false)
112
112
+
(lib.mesonEnable "webrtc-aec" (!libOnly))
113
113
+
(lib.mesonEnable "x11" x11Support)
114
114
115
115
-
"-Dlocalstatedir=/var"
116
116
-
"-Dsysconfdir=/etc"
117
117
-
"-Dsysconfdir_install=${placeholder "out"}/etc"
118
118
-
"-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
115
115
+
(lib.mesonOption "localstatedir" "/var")
116
116
+
(lib.mesonOption "sysconfdir" "/etc")
117
117
+
(lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc")
118
118
+
(lib.mesonOption "udevrulesdir" "${placeholder "out"}/lib/udev/rules.d")
119
119
120
120
# pulseaudio complains if its binary is moved after installation;
121
121
# this is needed so that wrapGApp can operate *without*
122
122
# renaming the unwrapped binaries (see below)
123
123
"--bindir=${placeholder "out"}/.bin-unwrapped"
124
124
]
125
125
-
++ lib.optional (stdenv.isLinux && useSystemd) "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
125
125
+
++ lib.optionals (stdenv.isLinux && useSystemd) [
126
126
+
(lib.mesonOption "systemduserunitdir" "${placeholder "out"}/lib/systemd/user")
127
127
+
]
126
128
++ lib.optionals stdenv.isDarwin [
127
127
-
"-Ddbus=disabled"
128
128
-
"-Dglib=disabled"
129
129
-
"-Doss-output=disabled"
129
129
+
(lib.mesonEnable "dbus" false)
130
130
+
(lib.mesonEnable "glib" false)
131
131
+
(lib.mesonEnable "oss-output" false)
130
132
];
131
133
132
134
# tests fail on Darwin because of timeouts