2019-06-08 13:56:47 +02:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, intltool, autoreconfHook
|
2018-05-09 20:21:55 +02:00
|
|
|
, libsndfile, libtool, makeWrapper
|
|
|
|
, xorg, libcap, alsaLib, glib, gnome3
|
2015-06-04 12:57:12 +02:00
|
|
|
, avahi, libjack2, libasyncns, lirc, dbus
|
|
|
|
, sbc, bluez5, udev, openssl, fftwFloat
|
2018-05-09 20:21:55 +02:00
|
|
|
, speexdsp, systemd, webrtc-audio-processing
|
2008-12-19 15:56:37 +01:00
|
|
|
|
2015-06-04 12:57:12 +02: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 ? false
|
|
|
|
|
|
|
|
, remoteControlSupport ? false
|
|
|
|
|
|
|
|
, zeroconfSupport ? false
|
|
|
|
|
|
|
|
, # Whether to build only the library.
|
|
|
|
libOnly ? false
|
2017-01-04 20:21:48 +01:00
|
|
|
|
|
|
|
, CoreServices, AudioUnit, Cocoa
|
2015-04-26 06:27:41 +02:00
|
|
|
}:
|
|
|
|
|
2008-12-19 15:56:37 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-04 12:57:12 +02:00
|
|
|
name = "${if libOnly then "lib" else ""}pulseaudio-${version}";
|
2018-05-09 20:21:55 +02:00
|
|
|
version = "12.2";
|
2008-12-19 15:56:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-26 06:27:41 +02:00
|
|
|
url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
|
2018-05-09 20:21:55 +02:00
|
|
|
sha256 = "0ma0p8iry7fil7qb4pm2nx2pm65kq9hk9xc4r5wkf14nqbzni5l0";
|
2008-12-19 15:56:37 +01:00
|
|
|
};
|
|
|
|
|
2016-08-29 02:30:01 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
2015-10-08 11:51:10 +02:00
|
|
|
|
2018-05-09 20:21:55 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig intltool autoreconfHook makeWrapper ];
|
2015-06-04 12:57:12 +02:00
|
|
|
|
2015-06-07 13:06:54 +02:00
|
|
|
propagatedBuildInputs =
|
|
|
|
lib.optionals stdenv.isLinux [ libcap ];
|
|
|
|
|
2015-06-04 12:57:12 +02:00
|
|
|
buildInputs =
|
2017-09-19 22:28:01 +02:00
|
|
|
[ libtool libsndfile speexdsp fftwFloat ]
|
2015-10-13 14:33:08 +02:00
|
|
|
++ lib.optionals stdenv.isLinux [ glib dbus ]
|
2017-01-04 20:21:48 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit Cocoa ]
|
2015-06-04 12:57:12 +02:00
|
|
|
++ lib.optionals (!libOnly) (
|
|
|
|
[ libasyncns webrtc-audio-processing ]
|
|
|
|
++ lib.optional jackaudioSupport libjack2
|
2015-09-15 11:26:18 +02:00
|
|
|
++ lib.optionals x11Support [ xorg.xlibsWrapper xorg.libXtst xorg.libXi ]
|
2015-06-04 12:57:12 +02:00
|
|
|
++ lib.optional useSystemd systemd
|
|
|
|
++ lib.optionals stdenv.isLinux [ alsaLib udev ]
|
|
|
|
++ lib.optional airtunesSupport openssl
|
|
|
|
++ lib.optionals bluetoothSupport [ bluez5 sbc ]
|
|
|
|
++ lib.optional remoteControlSupport lirc
|
|
|
|
++ lib.optional zeroconfSupport avahi
|
2019-06-10 11:15:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# The following two patches fix alsalib headers move, remove after the next release
|
|
|
|
(fetchpatch {
|
|
|
|
name = "alsa-asoundlib-include.patch";
|
|
|
|
url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/993d3fd89e5611997f1e165bf03edefb0204b0a4.patch";
|
|
|
|
sha256 = "17icnf8026947j1dqw4k16f91vy6zyg7q41zv2j6pxh9fncb1s71";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "alsa-use-case-include.patch";
|
|
|
|
url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/b89d33bb182c42db5ad3987b0e91b7bf62f421e8.patch";
|
|
|
|
sha256 = "0jccpc0dgkb0v4xrkyca2pm2k4i6pvahs9bq4hbg34173p23g5nb";
|
|
|
|
})
|
|
|
|
];
|
2019-06-04 17:05:38 +02:00
|
|
|
|
2009-01-19 21:22:54 +01:00
|
|
|
preConfigure = ''
|
2015-04-26 21:09:52 +02:00
|
|
|
# Performs and autoreconf
|
|
|
|
export NOCONFIGURE="yes"
|
|
|
|
patchShebangs bootstrap.sh
|
|
|
|
./bootstrap.sh
|
|
|
|
|
2009-12-13 21:19:19 +01: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 21:03:07 +01:00
|
|
|
|
2015-06-04 12:57:12 +02: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 21:22:54 +01:00
|
|
|
'';
|
|
|
|
|
2015-06-04 12:57:12 +02:00
|
|
|
configureFlags =
|
|
|
|
[ "--disable-solaris"
|
|
|
|
"--disable-jack"
|
|
|
|
"--disable-oss-output"
|
|
|
|
] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
|
|
|
|
[ "--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-access-group=audio"
|
2015-09-25 01:33:57 +02:00
|
|
|
"--with-bash-completion-dir=\${out}/share/bash-completions/completions"
|
2015-06-04 12:57:12 +02:00
|
|
|
]
|
|
|
|
++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack"
|
|
|
|
++ lib.optional stdenv.isDarwin "--with-mac-sysroot=/"
|
|
|
|
++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=\${out}/lib/systemd/user";
|
2011-07-26 17:25:21 +02:00
|
|
|
|
2011-07-07 19:24:31 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2013-09-06 03:47:49 +02:00
|
|
|
# not sure what the best practices are here -- can't seem to find a way
|
|
|
|
# for the compiler to bring in stdlib and stdio (etc.) properly
|
|
|
|
# the alternative is to copy the files from /usr/include to src, but there are
|
|
|
|
# probably a large number of files that would need to be copied (I stopped
|
|
|
|
# after the seventh)
|
2015-06-04 12:57:12 +02:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include";
|
2013-09-06 03:47:49 +02:00
|
|
|
|
2015-06-04 12:57:12 +02:00
|
|
|
installFlags =
|
|
|
|
[ "sysconfdir=$(out)/etc"
|
|
|
|
"pulseconfdir=$(out)/etc/pulse"
|
|
|
|
];
|
2015-04-26 06:27:41 +02:00
|
|
|
|
2015-06-04 12:57:12 +02:00
|
|
|
postInstall = lib.optionalString libOnly ''
|
2015-04-26 06:27:41 +02:00
|
|
|
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
2016-02-14 08:33:51 +01:00
|
|
|
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $out/lib/pulseaudio/libpulsecore-${version}.la
|
2015-10-08 11:51:10 +02:00
|
|
|
''
|
2015-12-02 10:03:23 +01:00
|
|
|
+ ''moveToOutput lib/cmake "$dev" '';
|
2013-09-06 03:47:49 +02:00
|
|
|
|
2018-05-09 20:21:55 +02:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
wrapProgram $out/libexec/pulse/gsettings-helper \
|
|
|
|
--prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${name}" \
|
|
|
|
--prefix GIO_EXTRA_MODULES : "${lib.getLib gnome3.dconf}/lib/gio/modules"
|
|
|
|
'';
|
|
|
|
|
2015-06-04 12:57:12 +02:00
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Sound server for POSIX and Win32 systems";
|
2013-09-06 03:47:49 +02:00
|
|
|
homepage = http://www.pulseaudio.org/;
|
2017-04-29 06:24:34 +02:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
2019-01-26 11:01:09 +01:00
|
|
|
maintainers = with lib.maintainers; [ lovek323 ];
|
2015-06-04 12:57:12 +02:00
|
|
|
platforms = lib.platforms.unix;
|
2008-12-19 15:56:37 +01: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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|