]> git.99rst.org Git - openwrt-packages.git/commitdiff
pulseaudio: split out libpulse client library
authorMirko Vogt <redacted>
Mon, 20 Jul 2026 19:23:50 +0000 (19:23 +0000)
committerMirko Vogt <redacted>
Mon, 14 Sep 2026 15:46:54 +0000 (17:46 +0200)
Move the PulseAudio client libraries into a separate libpulse package,
so a client can depend on just the client library instead of pulling
in the whole daemon. Upstream ships three libraries whose names do not
make the split obvious: libpulse and libpulse-simple are the client
API, libpulsecommon is a private library shared by client and server,
and libpulsecore is the server core used only by the daemon and its
modules. libpulse, libpulse-simple and libpulsecommon go into the new
package; libpulsecore, libpulsedsp and the module helper libraries stay
with pulseaudio-daemon, which now depends on libpulse. The iconv and
gettext users (pulse/utf8.c and pulsecore/i18n.c) are part of
libpulsecommon, so libpulse carries the ICONV_DEPENDS and INTL_DEPENDS
itself.

Enable D-Bus support in both variants, not just the avahi one. D-Bus
support adds the pa_dbus_* and rtkit helpers to libpulsecommon, which
the daemon and its modules link against and which now ships in
libpulse. Since a single libpulse package serves both variants, it has
to be built the same way in both, or the avahi daemon would end up with
a libpulsecommon lacking those symbols. Unconditional D-Bus support is
the simplest way to achieve that; the price is that pure clients now
pull in libdbus.

Two follow-on changes: the D-Bus policy file, previously installed by
the avahi variant only, is now installed by both daemon variants. The
daemon also declares its own libdbus dependency, independent of
libpulse, because libpulsecore links libdbus directly.

Signed-off-by: Mirko Vogt <redacted>
sound/pulseaudio/Makefile

index ecda2a9725010717ff990554fe5a21386b25ea52..91eb1ff45409b20e4795243644d73481201a9bf8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pulseaudio
 PKG_VERSION:=17.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://freedesktop.org/software/pulseaudio/releases
@@ -29,8 +29,8 @@ include $(INCLUDE_DIR)/meson.mk
 define Package/pulseaudio-daemon/Default
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libsndfile +libltdl +alsa-lib \
-       +libopenssl +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  DEPENDS:=+alsa-lib \
+       +libopenssl +libcap +libdbus +libpulse $(ICONV_DEPENDS) $(INTL_DEPENDS)
   TITLE:=Network sound server
   URL:=https://www.freedesktop.org/wiki/Software/PulseAudio/
   PROVIDES:=pulseaudio
@@ -68,6 +68,14 @@ endef
 
 Package/pulseaudio-daemon-avahi/conffiles = $(Package/pulseaudio-daemon/conffiles)
 
+define Package/libpulse
+  SECTION:=lib
+  CATEGORY:=Libraries
+  DEPENDS:=+libsndfile +libltdl +libdbus $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  TITLE:=Client library for PulseAudio
+  URL:=https://www.freedesktop.org/wiki/Software/PulseAudio/
+endef
+
 define Package/pulseaudio-tools
   SECTION:=sound
   CATEGORY:=Sound
@@ -103,6 +111,7 @@ MESON_ARGS += \
        -Dasyncns=disabled \
        -Dbluez5-native-headset=false \
        -Dbluez5-ofono-headset=false \
+       -Ddbus=enabled \
        -Dfftw=disabled \
        -Dglib=disabled \
        -Dgsettings=disabled \
@@ -129,15 +138,13 @@ MESON_ARGS += \
 ifeq ($(BUILD_VARIANT),avahi)
 MESON_ARGS += \
        -Davahi=enabled \
-       -Dbluez5=enabled \
-       -Ddbus=enabled
+       -Dbluez5=enabled
 endif
 
 ifeq ($(BUILD_VARIANT),noavahi)
 MESON_ARGS += \
        -Davahi=disabled \
-       -Dbluez5=disabled \
-       -Ddbus=disabled
+       -Dbluez5=disabled
 endif
 
 TARGET_LDFLAGS += -Wl,--gc-sections $(if $(INTL_FULL),-lintl)
@@ -169,6 +176,15 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* $(1)/usr/lib/pulseaudio/
 endef
 
+define Package/libpulse/install
+       $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/pulseaudio
+       # client libraries only; the server-only libpulsecore/libpulsedsp stay with
+       # the daemon so a pure client (depending on libpulse) does not pull them in
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpulse.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpulse-simple.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/libpulsecommon-*.so $(1)/usr/lib/pulseaudio/
+endef
+
 define Package/pulseaudio-daemon/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pulseaudio $(1)/usr/bin/pulseaudio
@@ -179,22 +195,21 @@ define Package/pulseaudio-daemon/install
        $(INSTALL_DIR) $(1)/etc/pulse
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/pulse/* $(1)/etc/pulse
 
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
-
-       $(INSTALL_DIR) $(1)/usr/lib/pulseaudio
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* $(1)/usr/lib/pulseaudio/
-
-       $(INSTALL_DIR) $(1)/usr/lib/pulse-$(PKG_VERSION)/modules
+       $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/pulseaudio/modules
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/libpulsecore-*.so $(1)/usr/lib/pulseaudio/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/libpulsedsp.so $(1)/usr/lib/pulseaudio/
+       # module helper libraries (libprotocol-*, libalsa-util, libcli, librtp, ...):
+       # the dlopened modules DT_NEEDED these and carry no RUNPATH, so they must be
+       # installed into a default library search path
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/modules/lib*.so $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/modules/module*.so $(1)/usr/lib/pulseaudio/modules/
+
+       $(INSTALL_DIR) $(1)/usr/share/dbus-1/system.d
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/dbus-1/system.d/pulseaudio-system.conf $(1)/usr/share/dbus-1/system.d/pulseaudio-system.conf
 endef
 
 define Package/pulseaudio-daemon-avahi/install
        $(call Package/pulseaudio-daemon/install,$1)
-
-       $(INSTALL_DIR) $(1)/usr/share/dbus-1/system.d
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/dbus-1/system.d/pulseaudio-system.conf $(1)/usr/share/dbus-1/system.d/pulseaudio-system.conf
 endef
 
 define Package/pulseaudio-tools/install
@@ -210,6 +225,7 @@ define Package/pulseaudio-profiles/install
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
 endef
 
+$(eval $(call BuildPackage,libpulse))
 $(eval $(call BuildPackage,pulseaudio-daemon))
 $(eval $(call BuildPackage,pulseaudio-daemon-avahi))
 $(eval $(call BuildPackage,pulseaudio-tools))
git clone https://git.99rst.org/PROJECT