Unverified Commit a1205b94 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #263297 from wegank/pulseaudio-meson-flags

pulseaudio: refactor meson flags
parents d9d2af68 ddacaab6
Loading
Loading
Loading
Loading
+33 −31
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, fetchpatch, pkg-config
{ lib, stdenv, fetchurl, pkg-config
, libsndfile, libtool, makeWrapper, perlPackages
, xorg, libcap, alsa-lib, glib, dconf
, avahi, libjack2, libasyncns, lirc, dbus
@@ -88,45 +88,47 @@ stdenv.mkDerivation rec {
  );

  mesonFlags = [
    "-Dalsa=${if !libOnly && alsaSupport then "enabled" else "disabled"}"
    "-Dasyncns=${if !libOnly then "enabled" else "disabled"}"
    "-Davahi=${if zeroconfSupport then "enabled" else "disabled"}"
    "-Dbluez5=${if !libOnly && bluetoothSupport then "enabled" else "disabled"}"
    (lib.mesonEnable "alsa" (!libOnly && alsaSupport))
    (lib.mesonEnable "asyncns" (!libOnly))
    (lib.mesonEnable "avahi" zeroconfSupport)
    (lib.mesonEnable "bluez5" (!libOnly && bluetoothSupport))
    # advanced bluetooth audio codecs are provided by gstreamer
    "-Dbluez5-gstreamer=${if (!libOnly && bluetoothSupport && advancedBluetoothCodecs) then "enabled" else "disabled"}"
    "-Ddatabase=simple"
    "-Ddoxygen=false"
    "-Delogind=disabled"
    (lib.mesonEnable "bluez5-gstreamer" (!libOnly && bluetoothSupport && advancedBluetoothCodecs))
    (lib.mesonOption "database" "simple")
    (lib.mesonBool "doxygen" false)
    (lib.mesonEnable "elogind" false)
    # gsettings does not support cross-compilation
    "-Dgsettings=${if stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}"
    "-Dgstreamer=disabled"
    "-Dgtk=disabled"
    "-Djack=${if jackaudioSupport && !libOnly then "enabled" else "disabled"}"
    "-Dlirc=${if remoteControlSupport then "enabled" else "disabled"}"
    "-Dopenssl=${if airtunesSupport then "enabled" else "disabled"}"
    "-Dorc=disabled"
    "-Dsystemd=${if useSystemd && !libOnly then "enabled" else "disabled"}"
    "-Dtcpwrap=disabled"
    "-Dudev=${if !libOnly && udevSupport then "enabled" else "disabled"}"
    "-Dvalgrind=disabled"
    "-Dwebrtc-aec=${if !libOnly then "enabled" else "disabled"}"
    "-Dx11=${if x11Support then "enabled" else "disabled"}"

    "-Dlocalstatedir=/var"
    "-Dsysconfdir=/etc"
    "-Dsysconfdir_install=${placeholder "out"}/etc"
    "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
    (lib.mesonEnable "gsettings" (stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform)))
    (lib.mesonEnable "gstreamer" false)
    (lib.mesonEnable "gtk" false)
    (lib.mesonEnable "jack" (jackaudioSupport && !libOnly))
    (lib.mesonEnable "lirc" remoteControlSupport)
    (lib.mesonEnable "openssl" airtunesSupport)
    (lib.mesonEnable "orc" false)
    (lib.mesonEnable "systemd" (useSystemd && !libOnly))
    (lib.mesonEnable "tcpwrap" false)
    (lib.mesonEnable "udev" (!libOnly && udevSupport))
    (lib.mesonEnable "valgrind" false)
    (lib.mesonEnable "webrtc-aec" (!libOnly))
    (lib.mesonEnable "x11" x11Support)

    (lib.mesonOption "localstatedir" "/var")
    (lib.mesonOption "sysconfdir" "/etc")
    (lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc")
    (lib.mesonOption "udevrulesdir" "${placeholder "out"}/lib/udev/rules.d")

    # pulseaudio complains if its binary is moved after installation;
    # this is needed so that wrapGApp can operate *without*
    # renaming the unwrapped binaries (see below)
    "--bindir=${placeholder "out"}/.bin-unwrapped"
  ]
  ++ lib.optional (stdenv.isLinux && useSystemd) "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
  ++ lib.optionals (stdenv.isLinux && useSystemd) [
    (lib.mesonOption "systemduserunitdir" "${placeholder "out"}/lib/systemd/user")
  ]
  ++ lib.optionals stdenv.isDarwin [
    "-Ddbus=disabled"
    "-Dglib=disabled"
    "-Doss-output=disabled"
    (lib.mesonEnable "dbus" false)
    (lib.mesonEnable "glib" false)
    (lib.mesonEnable "oss-output" false)
  ];

  # tests fail on Darwin because of timeouts