From e839c8e0cb4ab2ae08f9719692943ae00669152a Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Thu, 3 Feb 2022 20:54:00 -0800 Subject: [PATCH] pulseaudio: 14.2 -> 15.0, switch to meson, enable tests --- ...d-option-for-installation-sysconfdir.patch | 36 +++---- pkgs/servers/pulseaudio/default.nix | 95 +++++++++---------- pkgs/top-level/all-packages.nix | 4 - 3 files changed, 65 insertions(+), 70 deletions(-) diff --git a/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch b/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch index dd4de7321e9..bb56eb13e88 100644 --- a/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch +++ b/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch @@ -1,9 +1,6 @@ - -diff --git a/meson.build b/meson.build -index 86af7243e..e2d48ab94 100644 --- a/meson.build +++ b/meson.build -@@ -65,6 +65,11 @@ datadir = join_paths(prefix, get_option('datadir')) +@@ -67,6 +67,11 @@ datadir = join_paths(prefix, get_option('datadir')) localedir = join_paths(prefix, get_option('localedir')) localstatedir = join_paths(prefix, get_option('localstatedir')) sysconfdir = join_paths(prefix, get_option('sysconfdir')) @@ -14,8 +11,8 @@ index 86af7243e..e2d48ab94 100644 +endif privlibdir = join_paths(libdir, 'pulseaudio') - alsadatadir = get_option('alsadatadir') -@@ -75,6 +80,11 @@ endif + if host_machine.system() == 'windows' +@@ -82,6 +87,11 @@ endif pkgconfigdir = join_paths(libdir, 'pkgconfig') pulselibexecdir = join_paths(libexecdir, 'pulse') pulsesysconfdir = join_paths(sysconfdir, 'pulse') @@ -27,11 +24,9 @@ index 86af7243e..e2d48ab94 100644 modlibexecdir = get_option('modlibexecdir') if modlibexecdir == '' -diff --git a/meson_options.txt b/meson_options.txt -index 824f24e08..59a2b57ab 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -66,6 +66,9 @@ option('bashcompletiondir', +@@ -72,6 +72,9 @@ option('bashcompletiondir', option('zshcompletiondir', type : 'string', description : 'Directory for zsh completion scripts ["no" disables]') @@ -41,11 +36,18 @@ index 824f24e08..59a2b57ab 100644 # Optional features -diff --git a/src/daemon/meson.build b/src/daemon/meson.build -index 9c9f807e7..425cecb46 100644 --- a/src/daemon/meson.build +++ b/src/daemon/meson.build -@@ -53,7 +53,7 @@ if x11_dep.found() +@@ -52,7 +52,7 @@ if x11_dep.found() + output : '00-pulseaudio-x11', + configuration : conf, + install : true, +- install_dir : join_paths(sysconfdir, 'xdg', 'Xwayland-session.d'), ++ install_dir : join_paths(sysconfdir_install, 'xdg', 'Xwayland-session.d'), + ) + + desktop_file = i18n.merge_file( +@@ -61,7 +61,7 @@ if x11_dep.found() po_dir : po_dir, type : 'desktop', install : true, @@ -54,7 +56,7 @@ index 9c9f807e7..425cecb46 100644 ) desktop_utils = find_program('desktop-file-validate', required: false) -@@ -85,7 +85,7 @@ custom_target('daemon.conf', +@@ -93,7 +93,7 @@ custom_target('daemon.conf', command : [m4, '@INPUT@'], build_by_default : true, install : true, @@ -63,7 +65,7 @@ index 9c9f807e7..425cecb46 100644 ) default_conf = configuration_data() -@@ -111,7 +111,7 @@ custom_target('default.pa', +@@ -117,7 +117,7 @@ custom_target('default.pa', command : [m4, '@INPUT@'], build_by_default : true, install : true, @@ -72,7 +74,7 @@ index 9c9f807e7..425cecb46 100644 ) system_conf = configuration_data() -@@ -132,12 +132,12 @@ custom_target('system.pa', +@@ -136,12 +136,12 @@ custom_target('system.pa', command : [m4, '@INPUT@'], build_by_default : true, install : true, @@ -87,11 +89,9 @@ index 9c9f807e7..425cecb46 100644 ) endif -diff --git a/src/pulse/meson.build b/src/pulse/meson.build -index aaebff53e..05a29a0d0 100644 --- a/src/pulse/meson.build +++ b/src/pulse/meson.build -@@ -130,5 +130,5 @@ client_conf_file = configure_file( +@@ -134,5 +134,5 @@ client_conf_file = configure_file( input : 'client.conf.in', output : 'client.conf', configuration : client_conf, diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 664d9ef9f75..b0ccd5f7635 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -1,9 +1,10 @@ -{ lib, stdenv, fetchurl, pkg-config, autoreconfHook +{ lib, stdenv, fetchurl, fetchpatch, pkg-config , libsndfile, libtool, makeWrapper, perlPackages , xorg, libcap, alsa-lib, glib, dconf , avahi, libjack2, libasyncns, lirc, dbus , sbc, bluez5, udev, openssl, fftwFloat , soxr, speexdsp, systemd, webrtc-audio-processing +, check, meson, ninja, m4 , x11Support ? false @@ -31,23 +32,29 @@ stdenv.mkDerivation rec { pname = "${if libOnly then "lib" else ""}pulseaudio"; - version = "14.2"; + version = "15.0"; src = fetchurl { url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz"; - sha256 = "sha256-ddP3dCwa5EkEmkyIkA5FS4s1DsqoxUTzSIolYqn/ZvE="; + sha256 = "pAuIejupjMJpdusRvbZhOYjxRbGQJNG2VVxqA8nLoaA="; }; + patches = [ + # Install sysconfdir files inside of the nix store, + # but use a conventional runtime sysconfdir outside the store + ./add-option-for-installation-sysconfdir.patch + ]; + outputs = [ "out" "dev" ]; - nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper perlPackages.perl perlPackages.XMLParser ] + nativeBuildInputs = [ pkg-config meson ninja makeWrapper perlPackages.perl perlPackages.XMLParser m4 ] ++ lib.optionals stdenv.isLinux [ glib ]; propagatedBuildInputs = lib.optionals stdenv.isLinux [ libcap ]; buildInputs = - [ libtool libsndfile soxr speexdsp fftwFloat ] + [ libtool libsndfile soxr speexdsp fftwFloat check ] ++ lib.optionals stdenv.isLinux [ glib dbus ] ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreServices ] ++ lib.optionals (!libOnly) ( @@ -62,53 +69,45 @@ stdenv.mkDerivation rec { ++ lib.optional zeroconfSupport avahi ); - prePatch = '' - substituteInPlace bootstrap.sh \ - --replace pkg-config $PKG_CONFIG + mesonFlags = [ + "-Dalsa=${if !libOnly then "enabled" else "disabled"}" + "-Dasyncns=${if !libOnly then "enabled" else "disabled"}" + "-Davahi=${if zeroconfSupport then "enabled" else "disabled"}" + "-Dbluez5=${if !libOnly then "enabled" else "disabled"}" + "-Dbluez5-gstreamer=disabled" + "-Ddatabase=simple" + "-Ddoxygen=false" + "-Delogind=disabled" + # gsettings does not support cross-compilation + "-Dgsettings=${if stdenv.buildPlatform == stdenv.hostPlatform then "enabled" else "disabled"}" + "-Dgstreamer=disabled" + "-Dgtk=disabled" + "-Djack=${if jackaudioSupport && !libOnly then "enabled" else "disabled"}" + "-Dlirc=${if remoteControlSupport then "enabled" else "disabled"}" + "-Dopenssl=${if airtunesSupport then "enabled" else "disabled"}" + "-Dorc=disabled" + "-Dsystemd=${if useSystemd && !libOnly then "enabled" else "disabled"}" + "-Dtcpwrap=disabled" + "-Dudev=${if !libOnly then "enabled" else "disabled"}" + "-Dvalgrind=disabled" + "-Dwebrtc-aec=${if !libOnly then "enabled" else "disabled"}" + "-Dx11=${if x11Support then "enabled" else "disabled"}" + + "-Dlocalstatedir=/var" + "-Dsysconfdir=/etc" + "-Dsysconfdir_install=${placeholder "out"}/etc" + "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d" + ] + ++ lib.optional (stdenv.isLinux && useSystemd) "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user" + ; + + doCheck = true; + preCheck = '' + export HOME=$(mktemp -d) ''; - autoreconfPhase = '' - # Performs an autoreconf - patchShebangs bootstrap.sh - NOCONFIGURE=1 ./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 |" - ''; - - configureFlags = - [ "--disable-solaris" - "--disable-jack" - "--disable-oss-output" - ] ++ lib.optional (!ossWrapper) "--disable-oss-wrapper" ++ - [ "--localstatedir=/var" - "--sysconfdir=/etc" - "--with-access-group=audio" - "--with-bash-completion-dir=${placeholder "out"}/share/bash-completions/completions" - ] - ++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack" - ++ lib.optionals stdenv.isDarwin [ - "--disable-neon-opt" - ] - ++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--disable-gsettings"; - - enableParallelBuilding = true; - - installFlags = - [ "sysconfdir=${placeholder "out"}/etc" - "pulseconfdir=${placeholder "out"}/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" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f73c4907073..156a8c9d2cf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21829,10 +21829,6 @@ with pkgs; pulseaudio = callPackage ../servers/pulseaudio ({ inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; - } // lib.optionalAttrs stdenv.isDarwin { - # Default autoreconfHook (2.70) fails on darwin, - # with "configure: error: *** Compiler does not support -std=gnu11" - autoreconfHook = buildPackages.autoreconfHook269; }); qpaeq = libsForQt5.callPackage ../servers/pulseaudio/qpaeq.nix { };