pulseaudio: refactor meson flags

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