Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[staging] pulseaudio: 14.2 -> 15.0, switch to meson, enable tests #160097

Merged
merged 3 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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'))
Expand All @@ -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')
Expand All @@ -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]')
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions pkgs/servers/pulseaudio/correct-ldflags.patch

This file was deleted.

95 changes: 47 additions & 48 deletions pkgs/servers/pulseaudio/default.nix
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
r-burns marked this conversation as resolved.
Show resolved Hide resolved
];

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) (
Expand All @@ -62,53 +69,45 @@ stdenv.mkDerivation rec {
++ lib.optional zeroconfSupport avahi
);

prePatch = ''
substituteInPlace bootstrap.sh \
--replace pkg-config $PKG_CONFIG
'';

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 |"
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"}"
r-burns marked this conversation as resolved.
Show resolved Hide resolved
"-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)
'';

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"
Expand Down
Loading