pulseaudio: Revert to regular style
Also, the NixOS module uses pulseaudioLight in order to prevent excessive dependency bloat.
This commit is contained in:
parent
f08c8bc752
commit
f1d465f429
|
@ -89,12 +89,12 @@ in {
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pulseaudioFull;
|
default = pulseaudioLight;
|
||||||
example = literalExample "pkgs.pulseaudioFull";
|
example = literalExample "pkgs.pulseaudioFull";
|
||||||
description = ''
|
description = ''
|
||||||
The PulseAudio derivation to use. This can be used to disable
|
The PulseAudio derivation to use. This can be used to enable
|
||||||
features (such as JACK support, Bluetooth) that are enabled in the
|
features (such as JACK support, Bluetooth) via the
|
||||||
pulseaudioFull package in Nixpkgs.
|
<literal>pulseaudioFull</literal> package.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,73 +1,39 @@
|
||||||
{ stdenv, fetchurl, pkgconfig, intltool, automake, autoconf, libtool
|
{ lib, stdenv, fetchurl, pkgconfig, intltool, autoreconfHook
|
||||||
, json_c, libsndfile, gettext, check
|
, json_c, libsndfile
|
||||||
|
, xlibs, libcap, alsaLib, glib
|
||||||
# Optional Dependencies
|
, avahi, libjack2, libasyncns, lirc, dbus
|
||||||
, xlibs ? null, libcap ? null, valgrind ? null, oss ? null, coreaudio ? null
|
, sbc, bluez5, udev, openssl, fftwFloat
|
||||||
, alsaLib ? null, esound ? null, glib ? null, gtk3 ? null, gconf ? null
|
, speexdsp, systemd, webrtc-audio-processing, gconf ? null
|
||||||
, avahi ? null, libjack2 ? null, libasyncns ? null, lirc ? null, dbus ? null
|
|
||||||
, sbc ? null, bluez5 ? null, udev ? null, openssl ? null, fftw ? null
|
|
||||||
, speexdsp ? null, systemd ? null, webrtc-audio-processing ? null
|
|
||||||
|
|
||||||
# Database selection
|
# Database selection
|
||||||
, tdb ? null, gdbm ? null
|
, tdb ? null, gdbm ? null
|
||||||
|
|
||||||
# Extra options
|
, x11Support ? false
|
||||||
, prefix ? ""
|
|
||||||
|
, 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
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
mkFlag = trueStr: falseStr: cond: name: val:
|
|
||||||
if cond == null then null else
|
|
||||||
"--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
|
|
||||||
mkEnable = mkFlag "enable-" "disable-";
|
|
||||||
mkWith = mkFlag "with-" "without-";
|
|
||||||
mkOther = mkFlag "" "" true;
|
|
||||||
|
|
||||||
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
|
||||||
|
|
||||||
libOnly = prefix == "lib";
|
|
||||||
|
|
||||||
hasXlibs = xlibs != null;
|
|
||||||
|
|
||||||
optLibcap = shouldUsePkg libcap;
|
|
||||||
hasCaps = optLibcap != null || stdenv.isFreeBSD; # Built-in on FreeBSD
|
|
||||||
|
|
||||||
optOss = if libOnly then null else shouldUsePkg oss;
|
|
||||||
hasOss = optOss != null || stdenv.isFreeBSD; # Built-in on FreeBSD
|
|
||||||
|
|
||||||
optCoreaudio = if libOnly then null else shouldUsePkg coreaudio;
|
|
||||||
optAlsaLib = if libOnly then null else shouldUsePkg alsaLib;
|
|
||||||
optEsound = if libOnly then null else shouldUsePkg esound;
|
|
||||||
optGlib = shouldUsePkg glib;
|
|
||||||
optGtk3 = if libOnly || !hasXlibs then null else shouldUsePkg gtk3;
|
|
||||||
optGconf = if libOnly then null else shouldUsePkg gconf;
|
|
||||||
optAvahi = if libOnly then null else shouldUsePkg avahi;
|
|
||||||
optLibjack2 = if libOnly then null else shouldUsePkg libjack2;
|
|
||||||
optLibasyncns = shouldUsePkg libasyncns;
|
|
||||||
optLirc = if libOnly then null else shouldUsePkg lirc;
|
|
||||||
optDbus = shouldUsePkg dbus;
|
|
||||||
optSbc = if libOnly then null else shouldUsePkg sbc;
|
|
||||||
optBluez5 = if optDbus == null || optSbc == null then null
|
|
||||||
else shouldUsePkg bluez5;
|
|
||||||
optUdev = if libOnly then null else shouldUsePkg udev;
|
|
||||||
optOpenssl = if libOnly then null else shouldUsePkg openssl;
|
|
||||||
optFftw = shouldUsePkg fftw;
|
|
||||||
optSpeexdsp = shouldUsePkg speexdsp;
|
|
||||||
optSystemd = shouldUsePkg systemd;
|
|
||||||
optWebrtc-audio-processing = if libOnly then null else shouldUsePkg webrtc-audio-processing;
|
|
||||||
hasWebrtc = if libOnly then null else optWebrtc-audio-processing != null;
|
|
||||||
|
|
||||||
# Pick a database to use
|
|
||||||
databaseName = if tdb != null then "tdb" else
|
|
||||||
if gdbm != null then "gdbm" else "simple";
|
|
||||||
database = {
|
|
||||||
tdb = tdb;
|
|
||||||
gdbm = gdbm;
|
|
||||||
simple = null;
|
|
||||||
}.${databaseName};
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "${prefix}pulseaudio-${version}";
|
name = "${if libOnly then "lib" else ""}pulseaudio-${version}";
|
||||||
version = "6.0";
|
version = "6.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
@ -77,16 +43,23 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
patches = [ ./caps-fix.patch ];
|
patches = [ ./caps-fix.patch ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig intltool automake autoconf libtool ];
|
nativeBuildInputs = [ pkgconfig intltool autoreconfHook ];
|
||||||
buildInputs = [
|
|
||||||
json_c libsndfile gettext check database
|
|
||||||
|
|
||||||
optLibcap valgrind optOss optCoreaudio optAlsaLib optEsound optGlib
|
buildInputs =
|
||||||
optGtk3 optGconf optAvahi optLibjack2 optLibasyncns optLirc optDbus optUdev
|
[ json_c libsndfile speexdsp fftwFloat ]
|
||||||
optOpenssl optFftw optSpeexdsp optSystemd optWebrtc-audio-processing
|
++ lib.optionals stdenv.isLinux [ libcap glib dbus.libs ]
|
||||||
] ++ stdenv.lib.optionals hasXlibs (with xlibs; [
|
++ lib.optionals (!libOnly) (
|
||||||
libX11 libxcb libICE libSM libXtst xextproto libXi
|
[ libasyncns webrtc-audio-processing ]
|
||||||
]) ++ stdenv.lib.optionals (optBluez5 != null) [ optBluez5 optSbc ];
|
++ lib.optional jackaudioSupport libjack2
|
||||||
|
++ lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ]
|
||||||
|
++ 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
|
||||||
|
);
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
# Performs and autoreconf
|
# Performs and autoreconf
|
||||||
|
@ -98,62 +71,24 @@ stdenv.mkDerivation rec {
|
||||||
sed -i "src/Makefile.in" \
|
sed -i "src/Makefile.in" \
|
||||||
-e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
|
-e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
|
||||||
|
|
||||||
# don't install proximity-helper as root and setuid
|
# don't install proximity-helper as root and setuid
|
||||||
sed -i "src/Makefile.in" \
|
sed -i "src/Makefile.in" \
|
||||||
-e "s|chown root|true |" \
|
-e "s|chown root|true |" \
|
||||||
-e "s|chmod r+s |true |"
|
-e "s|chmod r+s |true |"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags =
|
||||||
(mkOther "localstatedir" "/var")
|
[ "--disable-solaris"
|
||||||
(mkOther "sysconfdir" "/etc")
|
"--disable-jack"
|
||||||
(mkEnable false "atomic-arm-memory-barrier" null) # TODO: Enable on armv8
|
"--disable-oss-output"
|
||||||
(mkEnable false "neon-opt" null) # TODO: Enable on armv8
|
] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
|
||||||
(mkEnable hasXlibs "x11" null)
|
[ "--localstatedir=/var"
|
||||||
(mkWith hasCaps "caps" optLibcap)
|
"--sysconfdir=/etc"
|
||||||
(mkEnable true "tests" null)
|
"--with-access-group=audio"
|
||||||
(mkEnable false "samplerate" null) # Deprecated
|
]
|
||||||
(mkWith true "database" databaseName)
|
++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack"
|
||||||
(mkEnable hasOss "oss-output" null)
|
++ lib.optional stdenv.isDarwin "--with-mac-sysroot=/"
|
||||||
(mkEnable true "oss-wrapper" null) # Does not use OSS
|
++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=\${out}/lib/systemd/user";
|
||||||
(mkEnable (optCoreaudio != null) "coreaudio-output" null)
|
|
||||||
(mkEnable (optAlsaLib != null) "alsa" null)
|
|
||||||
(mkEnable (optEsound != null) "esound" null)
|
|
||||||
(mkEnable false "solaris" null)
|
|
||||||
(mkEnable false "waveout" null) # Windows Only
|
|
||||||
(mkEnable (optGlib != null) "glib2" null)
|
|
||||||
(mkEnable (optGtk3 != null) "gtk3" null)
|
|
||||||
(mkEnable (optGconf != null) "gconf" null)
|
|
||||||
(mkEnable (optAvahi != null) "avahi" null)
|
|
||||||
(mkEnable (optLibjack2 != null) "jack" null)
|
|
||||||
(mkEnable (optLibasyncns != null) "asyncns" null)
|
|
||||||
(mkEnable false "tcpwrap" null)
|
|
||||||
(mkEnable (optLirc != null) "lirc" null)
|
|
||||||
(mkEnable (optDbus != null) "dbus" null)
|
|
||||||
(mkEnable false "bluez4" null)
|
|
||||||
(mkEnable (optBluez5 != null) "bluez5" null)
|
|
||||||
(mkEnable (optBluez5 != null) "bluez5-ofono-headset" null)
|
|
||||||
(mkEnable (optBluez5 != null) "bluez5-native-headset" null)
|
|
||||||
(mkEnable (optUdev != null) "udev" null)
|
|
||||||
(mkEnable false "hal-compat" null)
|
|
||||||
(mkEnable true "ipv6" null)
|
|
||||||
(mkEnable (optOpenssl != null) "openssl" null)
|
|
||||||
(mkWith (optFftw != null) "fftw" null)
|
|
||||||
(mkWith (optSpeexdsp != null) "speex" null)
|
|
||||||
(mkEnable false "xen" null)
|
|
||||||
(mkEnable false "gcov" null)
|
|
||||||
(mkEnable (optSystemd != null) "systemd-daemon" null)
|
|
||||||
(mkEnable (optSystemd != null) "systemd-login" null)
|
|
||||||
(mkEnable (optSystemd != null) "systemd-journal" null)
|
|
||||||
(mkEnable true "manpages" null)
|
|
||||||
(mkEnable hasWebrtc "webrtc-aec" null)
|
|
||||||
(mkEnable true "adrian-aec" null)
|
|
||||||
(mkWith true "system-user" "pulse")
|
|
||||||
(mkWith true "system-group" "pulse")
|
|
||||||
(mkWith true "access-group" "audio")
|
|
||||||
(mkWith true "systemduserunitdir" "\${out}/lib/systemd/user")
|
|
||||||
(mkWith stdenv.isDarwin "mac-sysroot" "/")
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -162,26 +97,23 @@ stdenv.mkDerivation rec {
|
||||||
# the alternative is to copy the files from /usr/include to src, but there are
|
# 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
|
# probably a large number of files that would need to be copied (I stopped
|
||||||
# after the seventh)
|
# after the seventh)
|
||||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include";
|
||||||
"-I/usr/include";
|
|
||||||
|
|
||||||
installFlags = [
|
installFlags =
|
||||||
"sysconfdir=$(out)/etc"
|
[ "sysconfdir=$(out)/etc"
|
||||||
"pulseconfdir=$(out)/etc/pulse"
|
"pulseconfdir=$(out)/etc/pulse"
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = stdenv.lib.optionalString libOnly ''
|
postInstall = lib.optionalString libOnly ''
|
||||||
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
description = "Sound server for POSIX and Win32 systems";
|
description = "Sound server for POSIX and Win32 systems";
|
||||||
homepage = http://www.pulseaudio.org/;
|
homepage = http://www.pulseaudio.org/;
|
||||||
# Note: Practically, the server is under the GPL due to the
|
licenses = lib.licenses.lgpl2Plus;
|
||||||
# dependency on `libsamplerate'. See `LICENSE' for details.
|
maintainers = with lib.maintainers; [ lovek323 wkennington ];
|
||||||
licenses = licenses.lgpl2Plus;
|
platforms = lib.platforms.unix;
|
||||||
maintainers = with maintainers; [ lovek323 wkennington ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
|
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
PulseAudio is a sound server for POSIX and Win32 systems. A
|
PulseAudio is a sound server for POSIX and Win32 systems. A
|
||||||
|
|
|
@ -8816,37 +8816,21 @@ let
|
||||||
|
|
||||||
pshs = callPackage ../servers/http/pshs { };
|
pshs = callPackage ../servers/http/pshs { };
|
||||||
|
|
||||||
libpulseaudio = pulseaudioFull.override {
|
libpulseaudio = callPackage ../servers/pulseaudio { libOnly = true; };
|
||||||
prefix = "lib";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Name is changed to prevent use in packages
|
# Name is changed to prevent use in packages;
|
||||||
# please use libpulseaudio instead
|
# please use libpulseaudio instead.
|
||||||
pulseaudioLight = pulseaudioFull.override {
|
pulseaudioLight = callPackage ../servers/pulseaudio { };
|
||||||
# The following are disabled in the default build, because if this
|
|
||||||
# functionality is desired, they are only needed in the PulseAudio
|
|
||||||
# server.
|
|
||||||
xlibs = null;
|
|
||||||
coreaudio = null;
|
|
||||||
esound = null;
|
|
||||||
libjack2 = null;
|
|
||||||
avahi = null;
|
|
||||||
lirc = null;
|
|
||||||
bluez5 = null;
|
|
||||||
tdb = null;
|
|
||||||
gdbm = null;
|
|
||||||
gtk3 = null;
|
|
||||||
webrtc-audio-processing = null;
|
|
||||||
gconf = null;
|
|
||||||
libasyncns = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
pulseaudioFull = callPackage ../servers/pulseaudio {
|
pulseaudioFull = callPackage ../servers/pulseaudio {
|
||||||
gconf = gnome3.gconf;
|
gconf = gnome3.gconf;
|
||||||
fftw = fftwFloat;
|
x11Support = true;
|
||||||
|
jackaudioSupport = true;
|
||||||
# Disabled unless debugging
|
airtunesSupport = true;
|
||||||
valgrind = null;
|
gconfSupport = true;
|
||||||
|
bluetoothSupport = true;
|
||||||
|
remoteControlSupport = true;
|
||||||
|
zeroconfSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
tomcat_connectors = callPackage ../servers/http/apache-modules/tomcat-connectors { };
|
tomcat_connectors = callPackage ../servers/http/apache-modules/tomcat-connectors { };
|
||||||
|
|
Loading…
Reference in New Issue