pulseaudio: 16.1 -> 17.0

This commit is contained in:
Weijia Wang 2024-02-11 18:23:17 +01:00
parent 13ddc8c160
commit d470972117
9 changed files with 6 additions and 237 deletions

View File

@ -1,26 +0,0 @@
From 72f3fe059f031f24c5ad026cb2fc16318f227c09 Mon Sep 17 00:00:00 2001
From: Andrew Childs <andrew.childs@bibo.com.ph>
Date: Tue, 19 Apr 2022 16:29:58 +0900
Subject: [PATCH 1/8] Make gio-2.0 optional when gsettings is disabled
Derived from https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/654
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index c5135330f..340f58e17 100644
--- a/meson.build
+++ b/meson.build
@@ -683,7 +683,7 @@ if get_option('daemon')
cdata.set('HAVE_ALSA_UCM', 1)
endif
- gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
+ gio_dep = dependency('gio-2.0', version : '>= 2.26.0', required : false)
if get_option('gsettings').enabled()
assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
cdata.set('HAVE_GSETTINGS', 1)
--
2.35.1

View File

@ -1,27 +0,0 @@
From 39bef695f783614e6175477417298ddf37e2ac13 Mon Sep 17 00:00:00 2001
From: Andrew Childs <andrew.childs@bibo.com.ph>
Date: Tue, 19 Apr 2022 16:58:43 +0900
Subject: [PATCH 2/8] Ignore SCM_CREDS on macOS
It was added for FreeBSD support, but also enables the
unsupported[citation needed] feature on macOS.
---
src/pulsecore/creds.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pulsecore/creds.h b/src/pulsecore/creds.h
index b599b569c..b5b1c9f37 100644
--- a/src/pulsecore/creds.h
+++ b/src/pulsecore/creds.h
@@ -34,7 +34,7 @@
typedef struct pa_creds pa_creds;
typedef struct pa_cmsg_ancil_data pa_cmsg_ancil_data;
-#if defined(SCM_CREDENTIALS) || defined(SCM_CREDS)
+#if defined(SCM_CREDENTIALS) || (defined(SCM_CREDS) && !defined(__APPLE__))
#define HAVE_CREDS 1
--
2.35.1

View File

@ -1,26 +0,0 @@
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index c383a61c0..3d0a68c2e 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -110,7 +110,7 @@
#include <sys/personality.h>
#endif
-#ifdef HAVE_CPUID_H
+#if defined(HAVE_CPUID_H) && !(defined(__APPLE__) && defined(__aarch64__))
#include <cpuid.h>
#endif
diff --git a/src/pulsecore/cpu-x86.c b/src/pulsecore/cpu-x86.c
index 317a0101e..d1eb95d2b 100644
--- a/src/pulsecore/cpu-x86.c
+++ b/src/pulsecore/cpu-x86.c
@@ -24,7 +24,7 @@
#include <stdint.h>
-#ifdef HAVE_CPUID_H
+#if defined(HAVE_CPUID_H) && !(defined(__APPLE__) && defined(__aarch64__))
#include <cpuid.h>
#endif

View File

@ -1,13 +0,0 @@
diff --git a/src/pulsecore/core-rtclock.c b/src/pulsecore/core-rtclock.c
index 2c2e28631..b946a3fb1 100644
--- a/src/pulsecore/core-rtclock.c
+++ b/src/pulsecore/core-rtclock.c
@@ -65,7 +65,7 @@ pa_usec_t pa_rtclock_age(const struct timeval *tv) {
struct timeval *pa_rtclock_get(struct timeval *tv) {
-#if defined(OS_IS_DARWIN)
+#if defined(OS_IS_DARWIN) && !defined(HAVE_CLOCK_GETTIME)
uint64_t val, abs_time = mach_absolute_time();
Nanoseconds nanos;

View File

@ -1,31 +0,0 @@
diff --git a/meson.build b/meson.build
index c5135330f..055567479 100644
--- a/meson.build
+++ b/meson.build
@@ -185,6 +185,7 @@ endif
# rather than ending up in the config.h file?
if host_machine.system() == 'darwin'
cdata.set('OS_IS_DARWIN', 1)
+ cdata.set('HAVE_COREAUDIO', 1)
cdata.set('_DARWIN_C_SOURCE', '200112L') # Needed to get NSIG on Mac OS
elif host_machine.system() == 'windows'
cdata.set('OS_IS_WIN32', 1)
diff --git a/src/modules/meson.build b/src/modules/meson.build
index 1e12569dc..53a800927 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -63,6 +63,14 @@ all_modules = [
[ 'module-volume-restore', 'module-volume-restore.c' ],
]
+if host_machine.system() == 'darwin'
+ coreaudio_dep = dependency('appleframeworks', modules : ['AudioUnit', 'Cocoa', 'CoreServices', 'CoreAudio'])
+ all_modules += [
+ [ 'module-coreaudio-detect', 'macosx/module-coreaudio-detect.c', [], [], [coreaudio_dep] ],
+ [ 'module-coreaudio-device', 'macosx/module-coreaudio-device.c', [], [], [coreaudio_dep] ],
+ ]
+endif
+
if host_machine.system() == 'windows'
winmm_dep = meson.get_compiler('c').find_library('winmm')
ksuser_dep = meson.get_compiler('c').find_library('ksuser')

View File

@ -1,18 +0,0 @@
diff --git a/src/meson.build b/src/meson.build
index 9efb561d8..d181f4867 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -179,6 +179,13 @@ if host_machine.system() == 'windows'
'pulsecore/semaphore-win32.c',
'pulsecore/thread-win32.c',
]
+elif host_machine.system() == 'darwin'
+ libpulsecommon_sources += [
+ 'pulsecore/mutex-posix.c',
+ 'pulsecore/poll-posix.c',
+ 'pulsecore/semaphore-osx.c',
+ 'pulsecore/thread-posix.c'
+ ]
else
libpulsecommon_sources += [
'pulsecore/mutex-posix.c',

View File

@ -1,75 +0,0 @@
diff --git a/meson.build b/meson.build
index c5135330f..1b66a1fc4 100644
--- a/meson.build
+++ b/meson.build
@@ -424,7 +424,7 @@ cdata.set('MESON_BUILD', 1)
# so we request the nodelete flag to be enabled.
# On other systems, we don't really know how to do that, but it's welcome if somebody can tell.
# Windows doesn't support this flag.
-if host_machine.system() != 'windows'
+if host_machine.system() not in ['windows', 'darwin']
nodelete_link_args = ['-Wl,-z,nodelete']
else
nodelete_link_args = []
diff --git a/src/modules/echo-cancel/meson.build b/src/modules/echo-cancel/meson.build
index 641cd35e7..523bffac4 100644
--- a/src/modules/echo-cancel/meson.build
+++ b/src/modules/echo-cancel/meson.build
@@ -10,12 +10,17 @@ libwebrtc_util_sources = [
'webrtc.cc'
]
+ignore_unresolved_symbols_link_args = ['-Wl,--unresolved-symbols=ignore-in-object-files']
+if meson.get_compiler('c').get_linker_id() == 'ld64'
+ ignore_unresolved_symbols_link_args = [ '-Wl,-undefined,dynamic_lookup' ]
+endif
+
libwebrtc_util = shared_library('webrtc-util',
libwebrtc_util_sources,
cpp_args : [pa_c_args, server_c_args],
include_directories : [configinc, topinc],
dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libatomic_ops_dep, webrtc_dep, libintl_dep],
- link_args : [nodelete_link_args, '-Wl,--unresolved-symbols=ignore-in-object-files'],
+ link_args : [nodelete_link_args, ignore_unresolved_symbols_link_args],
install : true,
install_rpath : privlibdir,
install_dir : modlibexecdir,
diff --git a/src/modules/meson.build b/src/modules/meson.build
index 1e12569dc..66f3e46a4 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -298,6 +298,11 @@ all_modules += [
# FIXME: meson doesn't support multiple RPATH arguments currently
rpath_dirs = join_paths(privlibdir) + ':' + join_paths(modlibexecdir)
+no_undefined_link_args = ['-Wl,--no-undefined']
+if meson.get_compiler('c').get_linker_id() == 'ld64'
+ no_undefined_link_args = [ '-Wl,-undefined,error' ]
+endif
+
foreach m : all_modules
name = m[0]
sources = m[1]
@@ -315,7 +320,7 @@ foreach m : all_modules
install_rpath : rpath_dirs,
install_dir : modlibexecdir,
dependencies : [thread_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libintl_dep, platform_dep, platform_socket_dep] + extra_deps,
- link_args : [nodelete_link_args, '-Wl,--no-undefined' ],
+ link_args : [nodelete_link_args, no_undefined_link_args ],
link_with : extra_libs,
name_prefix : '',
implicit_include_directories : false)
diff --git a/src/pulse/meson.build b/src/pulse/meson.build
index 1b82c807c..938e4addd 100644
--- a/src/pulse/meson.build
+++ b/src/pulse/meson.build
@@ -75,6 +75,9 @@ run_target('update-map-file',
[ libpulse_headers, 'simple.h', join_paths(meson.build_root(), 'src', 'pulse', 'version.h') ] ])
versioning_link_args = '-Wl,-version-script=' + join_paths(meson.source_root(), 'src', 'pulse', 'map-file')
+if meson.get_compiler('c').get_linker_id() == 'ld64'
+ versioning_link_args = []
+endif
libpulse = shared_library('pulse',
libpulse_sources,

View File

@ -74,7 +74,7 @@
)
system_conf = configuration_data()
@@ -136,12 +136,12 @@ custom_target('system.pa',
@@ -136,6 +136,6 @@ custom_target('system.pa',
command : [m4, '@INPUT@'],
build_by_default : true,
install : true,
@ -82,13 +82,6 @@
+ install_dir : pulsesysconfdir_install,
)
if dbus_dep.found()
install_data('pulseaudio-system.conf',
- install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d')
+ install_dir : join_paths(sysconfdir_install, 'dbus-1', 'system.d')
)
endif
--- a/src/pulse/meson.build
+++ b/src/pulse/meson.build
@@ -134,5 +134,5 @@ client_conf_file = configure_file(

View File

@ -3,7 +3,7 @@
, xorg, libcap, alsa-lib, glib, dconf
, avahi, libjack2, libasyncns, lirc, dbus
, sbc, bluez5, udev, openssl, fftwFloat
, soxr, speexdsp, systemd, webrtc-audio-processing
, soxr, speexdsp, systemd, webrtc-audio-processing_1
, gst_all_1
, check, libintl, meson, ninja, m4, wrapGAppsHook
@ -37,26 +37,17 @@
stdenv.mkDerivation rec {
pname = "${lib.optionalString libOnly "lib"}pulseaudio";
version = "16.1";
version = "17.0";
src = fetchurl {
url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
sha256 = "sha256-ju8yzpHUeXn5X9mpNec4zX63RjQw2rxyhjJRdR5QSuQ=";
hash = "sha256-BTeU1mcaPjl9hJ5HioC4KmPLnYyilr01tzMXu1zrh7U=";
};
patches = [
# Install sysconfdir files inside of the nix store,
# but use a conventional runtime sysconfdir outside the store
./add-option-for-installation-sysconfdir.patch
# https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/654 (merged)
./0001-Make-gio-2.0-optional-16.patch
# https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/746 (merged)
./0002-Ignore-SCM_CREDS-on-darwin.patch
./0003-Ignore-HAVE_CPUID_H-on-aarch64-darwin.patch
./0004-Prefer-HAVE_CLOCK_GETTIME-on-darwin.patch
./0005-Enable-CoreAudio-on-darwin.patch
./0006-Fix-libpulsecommon-sources-on-darwin.patch
./0007-Fix-link-args-on-darwin.patch
];
outputs = [ "out" "dev" ];
@ -74,7 +65,7 @@ stdenv.mkDerivation rec {
++ lib.optionals stdenv.isLinux [ glib dbus ]
++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreServices CoreAudio libintl ]
++ lib.optionals (!libOnly) (
[ libasyncns webrtc-audio-processing ]
[ libasyncns webrtc-audio-processing_1 ]
++ lib.optional jackaudioSupport libjack2
++ lib.optionals x11Support [ xorg.libICE xorg.libSM xorg.libX11 xorg.libXi xorg.libXtst ]
++ lib.optional useSystemd systemd
@ -126,6 +117,7 @@ stdenv.mkDerivation rec {
(lib.mesonOption "systemduserunitdir" "${placeholder "out"}/lib/systemd/user")
]
++ lib.optionals stdenv.isDarwin [
(lib.mesonEnable "consolekit" false)
(lib.mesonEnable "dbus" false)
(lib.mesonEnable "glib" false)
(lib.mesonEnable "oss-output" false)