2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, autoreconfHook
|
2019-09-13 16:20:36 +00:00
|
|
|
, libsndfile, libtool, makeWrapper, perlPackages
|
2021-06-10 02:57:09 +00:00
|
|
|
, xorg, libcap, alsa-lib, glib, dconf
|
2015-06-04 10:57:12 +00:00
|
|
|
, avahi, libjack2, libasyncns, lirc, dbus
|
|
|
|
, sbc, bluez5, udev, openssl, fftwFloat
|
2020-05-15 12:37:59 +00:00
|
|
|
, soxr, speexdsp, systemd, webrtc-audio-processing
|
2008-12-19 14:56:37 +00:00
|
|
|
|
2015-06-04 10:57:12 +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
|
|
|
|
|
2020-03-30 12:58:30 +00:00
|
|
|
, bluetoothSupport ? true
|
2015-06-04 10:57:12 +00:00
|
|
|
|
|
|
|
, remoteControlSupport ? false
|
|
|
|
|
|
|
|
, zeroconfSupport ? false
|
|
|
|
|
|
|
|
, # Whether to build only the library.
|
|
|
|
libOnly ? false
|
2017-01-04 19:21:48 +00:00
|
|
|
|
2021-12-27 18:32:48 +00:00
|
|
|
, AudioUnit, Cocoa, CoreServices
|
2015-04-26 04:27:41 +00:00
|
|
|
}:
|
|
|
|
|
2008-12-19 14:56:37 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-03 18:02:52 +00:00
|
|
|
pname = "${if libOnly then "lib" else ""}pulseaudio";
|
2021-01-21 00:02:48 +00:00
|
|
|
version = "14.2";
|
2008-12-19 14:56:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-26 04:27:41 +00:00
|
|
|
url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
|
2021-01-21 00:02:48 +00:00
|
|
|
sha256 = "sha256-ddP3dCwa5EkEmkyIkA5FS4s1DsqoxUTzSIolYqn/ZvE=";
|
2008-12-19 14:56:37 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 00:30:01 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2015-10-08 09:51:10 +00:00
|
|
|
|
2021-10-23 09:59:28 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper perlPackages.perl perlPackages.XMLParser ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ glib ];
|
2015-06-04 10:57:12 +00:00
|
|
|
|
2015-06-07 11:06:54 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
lib.optionals stdenv.isLinux [ libcap ];
|
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
buildInputs =
|
2020-05-15 12:37:59 +00:00
|
|
|
[ libtool libsndfile soxr speexdsp fftwFloat ]
|
2015-10-13 12:33:08 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ glib dbus ]
|
2021-12-27 18:32:48 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreServices ]
|
2015-06-04 10:57:12 +00:00
|
|
|
++ lib.optionals (!libOnly) (
|
|
|
|
[ libasyncns webrtc-audio-processing ]
|
|
|
|
++ lib.optional jackaudioSupport libjack2
|
2015-09-15 09:26:18 +00:00
|
|
|
++ lib.optionals x11Support [ xorg.xlibsWrapper xorg.libXtst xorg.libXi ]
|
2015-06-04 10:57:12 +00:00
|
|
|
++ lib.optional useSystemd systemd
|
2021-06-10 02:57:09 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ alsa-lib udev ]
|
2015-06-04 10:57:12 +00:00
|
|
|
++ lib.optional airtunesSupport openssl
|
|
|
|
++ lib.optionals bluetoothSupport [ bluez5 sbc ]
|
|
|
|
++ lib.optional remoteControlSupport lirc
|
|
|
|
++ lib.optional zeroconfSupport avahi
|
2019-06-10 09:15:40 +00:00
|
|
|
);
|
|
|
|
|
2020-06-25 00:37:22 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace bootstrap.sh \
|
|
|
|
--replace pkg-config $PKG_CONFIG
|
|
|
|
'';
|
|
|
|
|
2019-09-13 16:20:36 +00:00
|
|
|
autoreconfPhase = ''
|
|
|
|
# Performs an autoreconf
|
2015-04-26 19:09:52 +00:00
|
|
|
patchShebangs bootstrap.sh
|
2019-09-13 16:20:36 +00:00
|
|
|
NOCONFIGURE=1 ./bootstrap.sh
|
2015-04-26 19:09:52 +00:00
|
|
|
|
2009-12-13 20:19:19 +00:00
|
|
|
# Move the udev rules under $(prefix).
|
|
|
|
sed -i "src/Makefile.in" \
|
|
|
|
-e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
|
2011-11-06 20:03:07 +00:00
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
# 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 |"
|
2009-01-19 20:22:54 +00:00
|
|
|
'';
|
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
configureFlags =
|
|
|
|
[ "--disable-solaris"
|
|
|
|
"--disable-jack"
|
|
|
|
"--disable-oss-output"
|
|
|
|
] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
|
|
|
|
[ "--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-access-group=audio"
|
2019-09-13 16:20:36 +00:00
|
|
|
"--with-bash-completion-dir=${placeholder "out"}/share/bash-completions/completions"
|
2015-06-04 10:57:12 +00:00
|
|
|
]
|
|
|
|
++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack"
|
2021-07-31 11:38:12 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"--disable-neon-opt"
|
|
|
|
]
|
2021-01-01 21:11:29 +00:00
|
|
|
++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user"
|
|
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--disable-gsettings";
|
2011-07-26 15:25:21 +00:00
|
|
|
|
2011-07-07 17:24:31 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
installFlags =
|
2019-09-13 16:20:36 +00:00
|
|
|
[ "sysconfdir=${placeholder "out"}/etc"
|
|
|
|
"pulseconfdir=${placeholder "out"}/etc/pulse"
|
2015-06-04 10:57:12 +00:00
|
|
|
];
|
2015-04-26 04:27:41 +00:00
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
postInstall = lib.optionalString libOnly ''
|
2015-04-26 04:27:41 +00:00
|
|
|
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
2016-02-14 07:33:51 +00:00
|
|
|
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $out/lib/pulseaudio/libpulsecore-${version}.la
|
2015-10-08 09:51:10 +00:00
|
|
|
''
|
2019-12-27 03:51:28 +00:00
|
|
|
+ ''
|
|
|
|
moveToOutput lib/cmake "$dev"
|
|
|
|
rm -f $out/bin/qpaeq # this is packaged by the "qpaeq" package now, because of missing deps
|
|
|
|
'';
|
2013-09-06 01:47:49 +00:00
|
|
|
|
2021-01-01 21:11:29 +00:00
|
|
|
preFixup = lib.optionalString (stdenv.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform)) ''
|
2018-05-09 18:21:55 +00:00
|
|
|
wrapProgram $out/libexec/pulse/gsettings-helper \
|
2021-12-03 18:02:52 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${pname}-${version}" \
|
2019-11-30 23:11:47 +00:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
|
2018-05-09 18:21:55 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-26 01:18:26 +00:00
|
|
|
passthru = {
|
|
|
|
pulseDir = "lib/pulse-" + lib.versions.majorMinor version;
|
|
|
|
};
|
|
|
|
|
2015-06-04 10:57:12 +00:00
|
|
|
meta = {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Sound server for POSIX and Win32 systems";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.pulseaudio.org/";
|
2017-04-29 04:24:34 +00:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
2019-01-26 10:01:09 +00:00
|
|
|
maintainers = with lib.maintainers; [ lovek323 ];
|
2015-06-04 10:57:12 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2008-12-19 14:56:37 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|