2017-01-04 22:21:48 +03:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, intltool, autoreconfHook
|
2017-01-30 12:37:48 +03:00
|
|
|
, libsndfile, libtool
|
2015-09-15 12:26:18 +03:00
|
|
|
, xorg, libcap, alsaLib, glib
|
2015-06-04 13:57:12 +03:00
|
|
|
, avahi, libjack2, libasyncns, lirc, dbus
|
|
|
|
, sbc, bluez5, udev, openssl, fftwFloat
|
|
|
|
, speexdsp, systemd, webrtc-audio-processing, gconf ? null
|
2008-12-19 17:56:37 +03:00
|
|
|
|
2015-04-26 07:27:41 +03:00
|
|
|
# Database selection
|
|
|
|
, tdb ? null, gdbm ? null
|
|
|
|
|
2015-06-04 13:57:12 +03: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
|
|
|
|
|
|
|
|
, gconfSupport ? false
|
|
|
|
|
|
|
|
, bluetoothSupport ? false
|
|
|
|
|
|
|
|
, remoteControlSupport ? false
|
|
|
|
|
|
|
|
, zeroconfSupport ? false
|
|
|
|
|
|
|
|
, # Whether to build only the library.
|
|
|
|
libOnly ? false
|
2017-01-04 22:21:48 +03:00
|
|
|
|
|
|
|
, CoreServices, AudioUnit, Cocoa
|
2015-04-26 07:27:41 +03:00
|
|
|
}:
|
|
|
|
|
2008-12-19 17:56:37 +03:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-04 13:57:12 +03:00
|
|
|
name = "${if libOnly then "lib" else ""}pulseaudio-${version}";
|
2017-01-30 12:37:48 +03:00
|
|
|
version = "10.0";
|
2008-12-19 17:56:37 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-26 07:27:41 +03:00
|
|
|
url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
|
2017-01-30 12:37:48 +03:00
|
|
|
sha256 = "0mrg8qvpwm4ifarzphl3749p7p050kdx1l6mvsaj03czvqj6h653";
|
2008-12-19 17:56:37 +03:00
|
|
|
};
|
|
|
|
|
2017-01-04 22:21:48 +03:00
|
|
|
patches = [ ./caps-fix.patch ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
|
|
|
|
url = "https://bugs.freedesktop.org/attachment.cgi?id=127889";
|
|
|
|
sha256 = "063h5vmh4ykgxjbxyxjlj6qhyyxhazbh3p18p1ik69kq24nkny9m";
|
|
|
|
});
|
2015-04-26 22:09:52 +03:00
|
|
|
|
2016-08-29 03:30:01 +03:00
|
|
|
outputs = [ "out" "dev" ];
|
2015-10-08 12:51:10 +03:00
|
|
|
|
2015-06-04 13:57:12 +03:00
|
|
|
nativeBuildInputs = [ pkgconfig intltool autoreconfHook ];
|
|
|
|
|
2015-06-07 14:06:54 +03:00
|
|
|
propagatedBuildInputs =
|
|
|
|
lib.optionals stdenv.isLinux [ libcap ];
|
|
|
|
|
2015-06-04 13:57:12 +03:00
|
|
|
buildInputs =
|
2017-01-30 12:37:48 +03:00
|
|
|
[ libsndfile speexdsp fftwFloat ]
|
2015-10-13 15:33:08 +03:00
|
|
|
++ lib.optionals stdenv.isLinux [ glib dbus ]
|
2017-01-04 22:21:48 +03:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit Cocoa ]
|
2015-06-04 13:57:12 +03:00
|
|
|
++ lib.optionals (!libOnly) (
|
|
|
|
[ libasyncns webrtc-audio-processing ]
|
|
|
|
++ lib.optional jackaudioSupport libjack2
|
2015-09-15 12:26:18 +03:00
|
|
|
++ lib.optionals x11Support [ xorg.xlibsWrapper xorg.libXtst xorg.libXi ]
|
2015-06-04 13:57:12 +03:00
|
|
|
++ lib.optional useSystemd systemd
|
|
|
|
++ lib.optionals stdenv.isLinux [ alsaLib udev ]
|
|
|
|
++ lib.optional airtunesSupport openssl
|
|
|
|
++ lib.optional gconfSupport gconf
|
|
|
|
++ lib.optionals bluetoothSupport [ bluez5 sbc ]
|
|
|
|
++ lib.optional remoteControlSupport lirc
|
|
|
|
++ lib.optional zeroconfSupport avahi
|
|
|
|
);
|
2008-12-19 17:56:37 +03:00
|
|
|
|
2009-01-19 23:22:54 +03:00
|
|
|
preConfigure = ''
|
2015-04-26 22:09:52 +03:00
|
|
|
# Performs and autoreconf
|
|
|
|
export NOCONFIGURE="yes"
|
|
|
|
patchShebangs bootstrap.sh
|
|
|
|
./bootstrap.sh
|
|
|
|
|
2009-12-13 23:19:19 +03: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-07 00:03:07 +04:00
|
|
|
|
2015-06-04 13:57:12 +03: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 23:22:54 +03:00
|
|
|
'';
|
|
|
|
|
2015-06-04 13:57:12 +03: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 02:33:57 +03:00
|
|
|
"--with-bash-completion-dir=\${out}/share/bash-completions/completions"
|
2015-06-04 13:57:12 +03: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 19:25:21 +04:00
|
|
|
|
2011-07-07 21:24:31 +04:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2013-09-06 05:47:49 +04: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 13:57:12 +03:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include";
|
2013-09-06 05:47:49 +04:00
|
|
|
|
2015-06-04 13:57:12 +03:00
|
|
|
installFlags =
|
|
|
|
[ "sysconfdir=$(out)/etc"
|
|
|
|
"pulseconfdir=$(out)/etc/pulse"
|
|
|
|
];
|
2015-04-26 07:27:41 +03:00
|
|
|
|
2015-06-04 13:57:12 +03:00
|
|
|
postInstall = lib.optionalString libOnly ''
|
2015-04-26 07:27:41 +03:00
|
|
|
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
2016-02-14 10:33:51 +03:00
|
|
|
sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $out/lib/pulseaudio/libpulsecore-${version}.la
|
2015-10-08 12:51:10 +03:00
|
|
|
''
|
2015-12-02 12:03:23 +03:00
|
|
|
+ ''moveToOutput lib/cmake "$dev" '';
|
2013-09-06 05:47:49 +04:00
|
|
|
|
2015-06-04 13:57:12 +03:00
|
|
|
meta = {
|
2014-08-24 18:21:08 +04:00
|
|
|
description = "Sound server for POSIX and Win32 systems";
|
2013-09-06 05:47:49 +04:00
|
|
|
homepage = http://www.pulseaudio.org/;
|
2015-06-04 13:57:12 +03:00
|
|
|
licenses = lib.licenses.lgpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ lovek323 wkennington ];
|
|
|
|
platforms = lib.platforms.unix;
|
2008-12-19 17:56:37 +03: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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|