2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, autoreconfHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, libsndfile, libtool, makeWrapper, perlPackages
|
2021-06-28 23:13:55 +00:00
|
|
|
, xorg, libcap, alsa-lib, glib, dconf
|
2020-04-24 23:36:52 +00:00
|
|
|
, avahi, libjack2, libasyncns, lirc, dbus
|
|
|
|
, sbc, bluez5, udev, openssl, fftwFloat
|
2020-06-18 07:06:33 +00:00
|
|
|
, soxr, speexdsp, systemd, webrtc-audio-processing
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, x11Support ? false
|
|
|
|
|
|
|
|
, useSystemd ? true
|
|
|
|
|
|
|
|
, # Whether to support the JACK sound system as a backend.
|
|
|
|
jackaudioSupport ? false
|
|
|
|
|
|
|
|
, # Whether to build the OSS wrapper ("padsp").
|
|
|
|
ossWrapper ? true
|
|
|
|
|
|
|
|
, airtunesSupport ? false
|
|
|
|
|
|
|
|
, bluetoothSupport ? true
|
|
|
|
|
|
|
|
, remoteControlSupport ? false
|
|
|
|
|
|
|
|
, zeroconfSupport ? false
|
|
|
|
|
|
|
|
, # Whether to build only the library.
|
|
|
|
libOnly ? false
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
, AudioUnit, Cocoa, CoreServices
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "${if libOnly then "lib" else ""}pulseaudio";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "14.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-ddP3dCwa5EkEmkyIkA5FS4s1DsqoxUTzSIolYqn/ZvE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper perlPackages.perl perlPackages.XMLParser ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ glib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs =
|
|
|
|
lib.optionals stdenv.isLinux [ libcap ];
|
|
|
|
|
|
|
|
buildInputs =
|
2020-06-18 07:06:33 +00:00
|
|
|
[ libtool libsndfile soxr speexdsp fftwFloat ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ glib dbus ]
|
2022-01-26 04:04:25 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreServices ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optionals (!libOnly) (
|
|
|
|
[ libasyncns webrtc-audio-processing ]
|
|
|
|
++ lib.optional jackaudioSupport libjack2
|
|
|
|
++ lib.optionals x11Support [ xorg.xlibsWrapper xorg.libXtst xorg.libXi ]
|
|
|
|
++ lib.optional useSystemd systemd
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ alsa-lib udev ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional airtunesSupport openssl
|
|
|
|
++ lib.optionals bluetoothSupport [ bluez5 sbc ]
|
|
|
|
++ lib.optional remoteControlSupport lirc
|
|
|
|
++ lib.optional zeroconfSupport avahi
|
|
|
|
);
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace bootstrap.sh \
|
|
|
|
--replace pkg-config $PKG_CONFIG
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
autoreconfPhase = ''
|
|
|
|
# Performs an autoreconf
|
|
|
|
patchShebangs bootstrap.sh
|
|
|
|
NOCONFIGURE=1 ./bootstrap.sh
|
|
|
|
|
|
|
|
# Move the udev rules under $(prefix).
|
|
|
|
sed -i "src/Makefile.in" \
|
|
|
|
-e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
|
|
|
|
|
|
|
|
# don't install proximity-helper as root and setuid
|
|
|
|
sed -i "src/Makefile.in" \
|
|
|
|
-e "s|chown root|true |" \
|
|
|
|
-e "s|chmod r+s |true |"
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[ "--disable-solaris"
|
|
|
|
"--disable-jack"
|
|
|
|
"--disable-oss-output"
|
|
|
|
] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
|
|
|
|
[ "--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-access-group=audio"
|
|
|
|
"--with-bash-completion-dir=${placeholder "out"}/share/bash-completions/completions"
|
|
|
|
]
|
|
|
|
++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack"
|
2021-08-05 21:33:18 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"--disable-neon-opt"
|
|
|
|
]
|
2021-01-05 17:05:55 +00:00
|
|
|
++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user"
|
|
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--disable-gsettings";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
installFlags =
|
|
|
|
[ "sysconfdir=${placeholder "out"}/etc"
|
|
|
|
"pulseconfdir=${placeholder "out"}/etc/pulse"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString libOnly ''
|
|
|
|
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
|
|
|
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $out/lib/pulseaudio/libpulsecore-${version}.la
|
|
|
|
''
|
|
|
|
+ ''
|
|
|
|
moveToOutput lib/cmake "$dev"
|
|
|
|
rm -f $out/bin/qpaeq # this is packaged by the "qpaeq" package now, because of missing deps
|
|
|
|
'';
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
preFixup = lib.optionalString (stdenv.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform)) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/libexec/pulse/gsettings-helper \
|
2022-01-13 20:06:32 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${pname}-${version}" \
|
2020-04-24 23:36:52 +00:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
|
|
|
|
'';
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
passthru = {
|
|
|
|
pulseDir = "lib/pulse-" + lib.versions.majorMinor version;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Sound server for POSIX and Win32 systems";
|
|
|
|
homepage = "http://www.pulseaudio.org/";
|
|
|
|
license = lib.licenses.lgpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ lovek323 ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
PulseAudio is a sound server for POSIX and Win32 systems. A
|
|
|
|
sound server is basically a proxy for your sound applications.
|
|
|
|
It allows you to do advanced operations on your sound data as it
|
|
|
|
passes between your application and your hardware. Things like
|
|
|
|
transferring the audio to a different machine, changing the
|
|
|
|
sample format or channel count and mixing several sounds into
|
|
|
|
one are easily achieved using a sound server.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|