diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix index a9c5fc75660d3..4e05c4a6d85ac 100644 --- a/nixos/modules/config/pulseaudio.nix +++ b/nixos/modules/config/pulseaudio.nix @@ -14,7 +14,8 @@ let overriddenPackage = cfg.package.override (optionalAttrs hasZeroconf { zeroconfSupport = true; }); - binary = "${getBin overriddenPackage}/bin/pulseaudio"; + getDaemon = getOutput "daemon"; + binary = "${getDaemon overriddenPackage}/bin/pulseaudio"; binaryNoDaemon = "${binary} --daemonize=no"; # Forces 32bit pulseaudio and alsaPlugins to be built/supported for apps @@ -144,9 +145,9 @@ in { package = mkOption { type = types.package; - default = pulseaudioLight; - defaultText = "pkgs.pulseaudioLight"; - example = literalExample "pkgs.pulseaudioFull"; + default = pulseaudio; + defaultText = "pkgs.pulseaudio"; + example = literalExample "pkgs.pulseaudio.override {};"; description = '' The PulseAudio derivation to use. This can be used to enable features (such as JACK support, Bluetooth) via the @@ -212,7 +213,9 @@ in { } (mkIf cfg.enable { - environment.systemPackages = [ overriddenPackage ]; + environment.systemPackages = [ overriddenPackage ] + # We won't pollute $PATH with server binaries, as long as we run it as system server + ++ optionals nonSystemWide [(getDaemon overridenPackage)]; environment.etc = [ { target = "asound.conf"; diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix index b72a00d242e9c..74e9264b79ea8 100644 --- a/pkgs/development/libraries/kerberos/heimdal.nix +++ b/pkgs/development/libraries/kerberos/heimdal.nix @@ -1,17 +1,11 @@ { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex , texinfo, perlPackages , openldap, libcap_ng, sqlite, openssl, db, libedit, pam - -# Extra Args -, type ? "" }: -let - libOnly = type == "lib"; -in with stdenv.lib; stdenv.mkDerivation rec { - name = "${type}heimdal-${version}"; + name = "heimdal-${version}"; version = "7.5.0"; src = fetchFromGitHub { @@ -21,14 +15,14 @@ stdenv.mkDerivation rec { sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d"; }; + outputs = [ "out" "bin" "dev" "man" ]; + patches = [ ./heimdal-make-missing-headers.patch ]; - nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex ] - ++ (with perlPackages; [ JSON ]) - ++ optional (!libOnly) texinfo; + nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ] + ++ (with perlPackages; [ JSON ]); buildInputs = optionals (!stdenv.isFreeBSD) [ libcap_ng db ] - ++ [ sqlite openssl libedit ] - ++ optionals (!libOnly) [ openldap pam ]; + ++ [ sqlite openssl libedit openldap pam ]; ## ugly, X should be made an option configureFlags = [ @@ -36,11 +30,13 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--enable-hdb-openldap-module" "--with-sqlite3=${sqlite.dev}" - "--with-libedit=${libedit}" + + # ugly, --with-libedit is not enought, it fall back to bundled libedit + "--with-libedit-include=${libedit.dev}/include" + "--with-libedit-lib=${libedit}/lib" "--with-openssl=${openssl.dev}" "--without-x" "--with-berkeley-db=${db}" - ] ++ optionals (!libOnly) [ "--with-openldap=${openldap.dev}" ] ++ optionals (!stdenv.isFreeBSD) [ "--with-capng" @@ -48,24 +44,17 @@ stdenv.mkDerivation rec { postUnpack = '' sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common + sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac ''; - buildPhase = optionalString libOnly '' - (cd include; make -j $NIX_BUILD_CORES) - (cd lib; make -j $NIX_BUILD_CORES) - (cd tools; make -j $NIX_BUILD_CORES) - (cd include/hcrypto; make -j $NIX_BUILD_CORES) - (cd lib/hcrypto; make -j $NIX_BUILD_CORES) - ''; - - installPhase = optionalString libOnly '' - (cd include; make -j $NIX_BUILD_CORES install) - (cd lib; make -j $NIX_BUILD_CORES install) - (cd tools; make -j $NIX_BUILD_CORES install) - (cd include/hcrypto; make -j $NIX_BUILD_CORES install) - (cd lib/hcrypto; make -j $NIX_BUILD_CORES install) - rm -rf $out/{libexec,sbin,share} - find $out/bin -type f | grep -v 'krb5-config' | xargs rm + preConfigure = '' + configureFlagsArray+=( + "--bindir=$out/bin" # Put binaries to $out, then move them to $bin, + # otherwise we go a cyclic dependecny + "--sbindir=$out/sbin" + "--mandir=$man/share/man" + "--infodir=$man/share/info" + "--includedir=$dev/include") ''; # We need to build hcrypt for applications like samba @@ -74,14 +63,27 @@ stdenv.mkDerivation rec { (cd lib/hcrypto; make -j $NIX_BUILD_CORES) ''; + # FIXME: share/info hits $bin, IDK why, but I decide is to minor to block postInstall = '' # Install hcrypto (cd include/hcrypto; make -j $NIX_BUILD_CORES install) (cd lib/hcrypto; make -j $NIX_BUILD_CORES install) + # Do we need it? + rm $out/bin/su + # Doesn't succeed with --libexec=$out/sbin, so - mv "$out/libexec/"* $out/sbin/ + mkdir -p $dev/bin + mkdir -p $bin/{,s}bin + mv "$out/libexec/heimdal/"* $dev/bin/ + rmdir $out/libexec/heimdal + mv "$out/libexec/"* $bin/sbin/ rmdir $out/libexec + + mkdir -p $dev/bin && mv $out/bin/krb5-config $dev/bin/ + + # Move remaining binaries to $bin + mv $out/bin/* $bin/bin/ ''; # Issues with hydra diff --git a/pkgs/misc/jackaudio/default.nix b/pkgs/misc/jackaudio/default.nix index 52b0abc48a7a5..5502e77a02cae 100644 --- a/pkgs/misc/jackaudio/default.nix +++ b/pkgs/misc/jackaudio/default.nix @@ -1,11 +1,10 @@ { stdenv, fetchFromGitHub, pkgconfig, python2Packages, makeWrapper , bash, libsamplerate, libsndfile, readline, eigen, celt +, dbus, libffado, alsaLib, libopus # Darwin Dependencies , aften, AudioToolbox, CoreAudio, CoreFoundation # Optional Dependencies -, dbus ? null, libffado ? null, alsaLib ? null -, libopus ? null , darwin # Extra options @@ -17,12 +16,10 @@ let inherit (python2Packages) python dbus-python; shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null; - libOnly = prefix == "lib"; - optDbus = if stdenv.isDarwin then null else shouldUsePkg dbus; - optPythonDBus = if libOnly then null else shouldUsePkg dbus-python; - optLibffado = if libOnly then null else shouldUsePkg libffado; - optAlsaLib = if libOnly then null else shouldUsePkg alsaLib; + optPythonDBus = shouldUsePkg dbus-python; + optLibffado = shouldUsePkg libffado; + optAlsaLib = shouldUsePkg alsaLib; optLibopus = shouldUsePkg libopus; in stdenv.mkDerivation rec { @@ -36,6 +33,8 @@ stdenv.mkDerivation rec { sha256 = "0ynpyn0l77m94b50g7ysl795nvam3ra65wx5zb46nxspgbf6wnkh"; }; + outputs = [ "out" "bin" "dev"]; + nativeBuildInputs = [ pkgconfig python makeWrapper ]; buildInputs = [ libsamplerate libsndfile readline eigen celt optDbus optPythonDBus optLibffado optAlsaLib optLibopus @@ -59,7 +58,8 @@ stdenv.mkDerivation rec { configurePhase = '' runHook preConfigure - python waf configure --prefix=$out \ + python waf configure --prefix=$bin \ + --libdir=$out/lib \ ${optionalString (optDbus != null) "--dbus"} \ --classic \ ${optionalString (optLibffado != null) "--firewire"} \ @@ -75,12 +75,13 @@ stdenv.mkDerivation rec { installPhase = '' python waf install - '' + (if libOnly then '' - rm -rf $out/{bin,share} - rm -rf $out/lib/{jack,libjacknet*,libjackserver*} - '' else '' - wrapProgram $out/bin/jack_control --set PYTHONPATH $PYTHONPATH - ''); + + # Move drivers from $out to $bin + mkdir -p $bin/lib/jack && mv $out/lib/jack $bin/lib/jack + wrapProgram $bin/bin/jackd --set JACK_DRIVER_DIR $bin/lib/jack + wrapProgram $bin/bin/jackdbus --set JACK_DRIVER_DIR $bin/lib/jack + wrapProgram $bin/bin/jack_control --set PYTHONPATH $PYTHONPATH + ''; meta = { description = "JACK audio connection kit, version 2 with jackdbus"; diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix index 4e3e373d244c7..dc6be48cabf66 100644 --- a/pkgs/os-specific/linux/ffado/default.nix +++ b/pkgs/os-specific/linux/ffado/default.nix @@ -1,30 +1,42 @@ { stdenv, fetchurl, scons, pkgconfig, which, makeWrapper, python -, expat, libraw1394, libconfig, libavc1394, libiec61883, libxmlxx, glibmm +, expat, libraw1394, libconfig, libavc1394, libiec61883, libxmlxx +, alsaLib, dbus, dbus_cplusplus # Optional dependencies -, libjack2 ? null, dbus ? null, dbus_cplusplus ? null, alsaLib ? null , pyqt4 ? null, dbus-python ? null, xdg_utils ? null # Other Flags -, prefix ? "" +, libOnly ? false }: let shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null; - libOnly = prefix == "lib"; - - optLibjack2 = shouldUsePkg libjack2; - optDbus = shouldUsePkg dbus; - optDbus_cplusplus = shouldUsePkg dbus_cplusplus; - optAlsaLib = shouldUsePkg alsaLib; +# Mixer/tools dependencies +# FIXME: can we build mixer separately? Then we can farewell `libOnly` mode +# (otherwise we have perfect loop via qt -> pulseaudio -> jack -> ffado -> qt) +# FIXME: it should work with pyqt5 as well (so we can farewell `qt4` sometimes) optPyqt4 = shouldUsePkg pyqt4; optPythonDBus = shouldUsePkg dbus-python; optXdg_utils = shouldUsePkg xdg_utils; + + PYDIR="$out/lib/${python.libPrefix}/site-packages"; + SCONS_OPTIONS = '' + PREFIX=$out \ + PYPKGDIR=${PYDIR} \ + DEBUG=False \ + ENABLE_ALL=True \ + SERIALIZE_USE_EXPAT=True \ + BUILD_TESTS=False \ + UDEVDIR=$out/lib/udev/rules.d \ + BINDIR=$bin/bin \ + INCLUDEDIR=$dev/include \ + BUILD_MIXER=${if libOnly then "False" else "True"} \ + ''; in stdenv.mkDerivation rec { - name = "${prefix}ffado-${version}"; + name = "ffado-${version}"; version = "2.4.0"; src = fetchurl { @@ -32,13 +44,14 @@ stdenv.mkDerivation rec { sha256 = "14rprlcd0gpvg9kljh0zzjzd2rc9hbqqpjidshxxjvvfh4r00f4f"; }; + outputs = [ "out" "bin" "dev" ]; + nativeBuildInputs = [ scons pkgconfig which makeWrapper python ]; buildInputs = [ - expat libraw1394 libconfig libavc1394 libiec61883 + expat libraw1394 libconfig libavc1394 libiec61883 dbus dbus_cplusplus libxmlxx ] ++ stdenv.lib.optionals (!libOnly) [ - optLibjack2 optDbus optDbus_cplusplus optAlsaLib optPyqt4 - optXdg_utils libxmlxx glibmm + optXdg_utils ]; postPatch = '' @@ -62,25 +75,18 @@ stdenv.mkDerivation rec { # TODO fix ffado-diag, it doesn't seem to use PYPKGDIR buildPhase = '' - export PYDIR=$out/lib/${python.libPrefix}/site-packages - - scons PYPKGDIR=$PYDIR DEBUG=False \ - ENABLE_ALL=True \ - SERIALIZE_USE_EXPAT=True \ + scons ${SCONS_OPTIONS} ''; - installPhase = if libOnly then '' - scons PREFIX=$TMPDIR UDEVDIR=$TMPDIR \ - LIBDIR=$out/lib INCLUDEDIR=$out/include install - '' else '' - scons PREFIX=$out PYPKGDIR=$PYDIR UDEVDIR=$out/lib/udev/rules.d install - '' + stdenv.lib.optionalString (optPyqt4 != null && optPythonDBus != null) '' + installPhase = '' + scons ${SCONS_OPTIONS} install + '' + stdenv.lib.optionalString (!libOnly && optPyqt4 != null && optPythonDBus != null) '' wrapProgram $out/bin/ffado-mixer --prefix PYTHONPATH : \ - $PYTHONPATH:$PYDIR:${optPyqt4}/$LIBSUFFIX:${optPythonDBus}/$LIBSUFFIX: + $PYTHONPATH:${PYDIR}:${optPyqt4}/$LIBSUFFIX:${optPythonDBus}/$LIBSUFFIX: wrapProgram $out/bin/ffado-diag --prefix PYTHONPATH : \ - $PYTHONPATH:$PYDIR:$out/share/libffado/python:${optPyqt4}/$LIBSUFFIX:${optPythonDBus}/$LIBSUFFIX: - ''; + $PYTHONPATH:${PYDIR}:$out/share/libffado/python:${optPyqt4}/$LIBSUFFIX:${optPythonDBus}/$LIBSUFFIX: + ''; meta = with stdenv.lib; { homepage = http://www.ffado.org; diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 6a65e8d032011..37fd8a947a052 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -2,7 +2,7 @@ , libsndfile, libtool , xorg, libcap, alsaLib, glib , avahi, libjack2, libasyncns, lirc, dbus -, sbc, bluez5, udev, openssl, fftwFloat +, orc, sbc, bluez5, udev, openssl, fftwFloat , speexdsp, systemd, webrtc-audio-processing, gconf ? null # Database selection @@ -28,14 +28,11 @@ , zeroconfSupport ? false -, # Whether to build only the library. - libOnly ? false - , CoreServices, AudioUnit, Cocoa }: stdenv.mkDerivation rec { - name = "${if libOnly then "lib" else ""}pulseaudio-${version}"; + name = "pulseaudio-${version}"; version = "11.1"; src = fetchurl { @@ -50,7 +47,7 @@ stdenv.mkDerivation rec { sha256 = "0gf4w25zi123ghk0njapysvrlljkc3hyanacgiswfnnm1i8sab1q"; }); - outputs = [ "out" "dev" ]; + outputs = [ "out" "dev" "bin" "daemon" ]; nativeBuildInputs = [ pkgconfig intltool autoreconfHook ]; @@ -58,51 +55,62 @@ stdenv.mkDerivation rec { lib.optionals stdenv.isLinux [ libcap ]; buildInputs = - [ libtool libsndfile speexdsp fftwFloat ] + [ libtool libsndfile speexdsp fftwFloat orc ] ++ lib.optionals stdenv.isLinux [ glib dbus ] ++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit Cocoa ] - ++ lib.optionals (!libOnly) ( - [ libasyncns webrtc-audio-processing ] - ++ lib.optional jackaudioSupport libjack2 - ++ lib.optionals x11Support [ xorg.xlibsWrapper xorg.libXtst xorg.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 = '' - # Performs and autoreconf - export NOCONFIGURE="yes" - patchShebangs bootstrap.sh - ./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 |" - ''; + ++ [ libasyncns webrtc-audio-processing ] + ++ lib.optional jackaudioSupport libjack2 + ++ lib.optionals x11Support [ xorg.libxcb xorg.libX11 xorg.libSM xorg.libICE xorg.libXtst xorg.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 + ; configureFlags = [ "--disable-solaris" "--disable-jack" "--disable-oss-output" - ] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++ - [ "--localstatedir=/var" + "--localstatedir=/var" "--sysconfdir=/etc" "--with-access-group=audio" - "--with-bash-completion-dir=\${out}/share/bash-completions/completions" ] - ++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack" + ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" + ++ lib.optional (jackaudioSupport) "--enable-jack" ++ lib.optional stdenv.isDarwin "--with-mac-sysroot=/" - ++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=\${out}/lib/systemd/user"; + ++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=\${daemon}/lib/systemd/user"; + + + preConfigure = '' + # We need "expanded" $daemon here, otherwise variable reference falls to .pc files + # FIXME: return all back to configureFlags, when placeholders would be landed. + configureFlagsArray+=( + "--with-bash-completion-dir=$bin/share/bash-completions/completions" + "--with-zsh-completion-dir=$bin/share/zsh/site-functions" + "--with-pulsedsp-location=$bin/lib/pulseaudio" + "--with-udev-rules-dir=$daemon/lib/udev/rules.d" + "--with-module-dir=$daemon/lib/pulseaudio" + "--libexecdir=$daemon/libexec" + "--datadir=$daemon/share" + ) + + # 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 |" + + # cut-off path from default autostartable. In nixos it usually set via + # user/system config, and I not sure if autostart still usable if pulseaudio + # daemon used from nixpkgs on non-nixos. + substituteInPlace src/pulse/client-conf.c --replace "PA_BINARY" "\"pulseaudio\"" + + # Fixes: error: po/Makefile.in.in was not created by intltoolize. + intltoolize --automake --copy --force + + ''; enableParallelBuilding = true; @@ -114,15 +122,21 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; installFlags = - [ "sysconfdir=$(out)/etc" - "pulseconfdir=$(out)/etc/pulse" + [ "sysconfdir=$(bin)/etc" + "pulseconfdir=$(daemon)/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" ''; + # FIXME: #out/share/pulse/alsa-mixer move to bin, or even to daemon (may require patch) + # FIXME: split qpaeq to own derivation, it python script depending qt indirectly + # (and w/o it fail with a message) + postInstall = '' + moveToOutput lib/cmake "$dev" + moveToOutput share/vala "$dev" + rm $daemon/lib/systemd/user/pulseaudio.service + for each in system.pa default.pa client.conf; do + substituteInPlace $daemon/etc/pulse/$each --replace $bin $daemon + done + ''; meta = { description = "Sound server for POSIX and Win32 systems"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 58ff40e508bef..deb661f9ce9c0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9302,7 +9302,7 @@ with pkgs; kerberos = libkrb5; heimdalFull = callPackage ../development/libraries/kerberos/heimdal.nix { }; - libheimdal = heimdalFull.override { type = "lib"; }; + libheimdal = heimdalFull; harfbuzz = callPackage ../development/libraries/harfbuzz { }; harfbuzz-icu = callPackage ../development/libraries/harfbuzz { @@ -12527,11 +12527,7 @@ with pkgs; # Name is changed to prevent use in packages; # please use libpulseaudio instead. - pulseaudioLight = callPackage ../servers/pulseaudio { - inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; - }; - - pulseaudioFull = callPackage ../servers/pulseaudio { + pulseaudio = callPackage ../servers/pulseaudio { gconf = gnome3.gconf; x11Support = true; jackaudioSupport = true; @@ -12545,10 +12541,7 @@ with pkgs; # libpulse implementations - libpulseaudio-vanilla = callPackage ../servers/pulseaudio { - libOnly = true; - inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; - }; + libpulseaudio-vanilla = pulseaudio; apulse = callPackage ../misc/apulse { }; @@ -13127,7 +13120,7 @@ with pkgs; ffadoFull = callPackage ../os-specific/linux/ffado { inherit (python2Packages) python pyqt4 dbus-python; }; - libffado = ffadoFull.override { prefix = "lib"; }; + libffado = ffadoFull.override { libOnly = true; }; fbterm = callPackage ../os-specific/linux/fbterm { }; @@ -20480,11 +20473,12 @@ with pkgs; # using the new configuration style proposal which is unstable jack1 = callPackage ../misc/jackaudio/jack1.nix { }; - jack2Full = callPackage ../misc/jackaudio { + jack2 = callPackage ../misc/jackaudio { libopus = libopus.override { withCustomModes = true; }; inherit (darwin.apple_sdk.frameworks) AudioToolbox CoreAudio CoreFoundation; }; - libjack2 = jack2Full.override { prefix = "lib"; }; + libjack2 = jack2; + jack2Full = jack2; keynav = callPackage ../tools/X11/keynav { };