From f65a718a12a4757399f1abae6cf403d27e63762d Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sat, 29 Oct 2022 23:37:09 +0200 Subject: [PATCH] pulseaudio: simplify and rework Makefile There were two conffiles sections and both of them were same, but for different variants. We can have just one conffile section and use it also for the other variant. The same applies for the install section for different variants. - We have two install sections, but we call the first one with the same files and then add something more for the second variant. - While at it to make it easier, let's change those three rows for copying packages into the single one to make sure that I did not miss anything. Also, we create a directory first and then move files. Signed-off-by: Josef Schlehofer (cherry picked from commit 60ac7dd751240fa096a85794023b18f26a8317da) --- sound/pulseaudio/Makefile | 183 ++++++++++---------------------------- 1 file changed, 48 insertions(+), 135 deletions(-) diff --git a/sound/pulseaudio/Makefile b/sound/pulseaudio/Makefile index 7613193e0b..26da76fc80 100644 --- a/sound/pulseaudio/Makefile +++ b/sound/pulseaudio/Makefile @@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk include ../../devel/meson/meson.mk -define Package/pulseaudio/Default +define Package/pulseaudio-daemon/Default SECTION:=sound CATEGORY:=Sound DEPENDS:=+libsndfile +libltdl +libpthread +librt +alsa-lib \ @@ -40,27 +40,23 @@ define Package/pulseaudio/Default endef define Package/pulseaudio-daemon - $(call Package/pulseaudio/Default) + $(call Package/pulseaudio-daemon/Default) VARIANT:=noavahi endef define Package/pulseaudio-daemon-avahi - $(call Package/pulseaudio/Default) + $(call Package/pulseaudio-daemon/Default) DEPENDS+=+dbus +libavahi-client +sbc TITLE+= (avahi/bluez) VARIANT:=avahi endef -define Package/pulseaudio/Default/description - PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server. -endef - define Package/pulseaudio-daemon/description - $(call Package/pulseaudio/Default/description) + PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server. endef define Package/pulseaudio-daemon-avahi/description - $(call Package/pulseaudio/Default/description) + $(call Package/pulseaudio-daemon/description) This package enables avahi,bluez and is compiled against dbus, sbc, and avahi. endef @@ -71,12 +67,7 @@ define Package/pulseaudio-daemon/conffiles /etc/pulse/system.pa endef -define Package/pulseaudio-daemon-avahi/conffiles -/etc/pulse/client.conf -/etc/pulse/daemon.conf -/etc/pulse/default.pa -/etc/pulse/system.pa -endef +Package/pulseaudio-daemon/conffiles = $(Package/pulseaudio-daemon-avahi/conffiles) define Package/pulseaudio-tools SECTION:=sound @@ -159,140 +150,62 @@ endif endef define Build/InstallDev - $(INSTALL_DIR) \ - $(1)/usr/lib/pkgconfig \ - $(1)/usr/include/pulse \ - $(1)/usr/lib \ - $(1)/usr/lib/pulseaudio - $(CP) \ - $(PKG_INSTALL_DIR)/usr/include/pulse/* \ - $(1)/usr/include/pulse - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ - $(1)/usr/lib/pkgconfig - $(SED) \ - 's,/usr/include,$$$${prefix}/include,g' \ - $(1)/usr/lib/pkgconfig/libpulse.pc - $(SED) \ - 's,/usr/lib,$$$${exec_prefix}/lib,g' \ - $(1)/usr/lib/pkgconfig/libpulse.pc - $(SED) \ - 's,/usr/include,$$$${prefix}/include,g' \ - $(1)/usr/lib/pkgconfig/libpulse-simple.pc - $(SED) \ - 's,/usr/lib,$$$${exec_prefix}/lib,g' \ - $(1)/usr/lib/pkgconfig/libpulse-simple.pc - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/*.so* \ - $(1)/usr/lib/ - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \ - $(1)/usr/lib/pulseaudio/ + $(INSTALL_DIR) $(1)/usr/include/pulse + $(CP) $(PKG_INSTALL_DIR)/usr/include/pulse/* $(1)/usr/include/pulse + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpulse.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpulse.pc + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpulse-simple.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpulse-simple.pc + + $(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/ endef define Package/pulseaudio-daemon/install - $(INSTALL_DIR) \ - $(1)/etc/pulse \ - $(1)/etc/init.d \ - $(1)/usr/bin \ - $(1)/usr/lib \ - $(1)/usr/lib/pulseaudio \ - $(1)/usr/lib/pulse-$(PKG_VERSION)/modules - - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \ - $(1)/usr/bin/pulseaudio - - $(INSTALL_BIN) \ - ./files/pulseaudio.init \ - $(1)/etc/init.d/pulseaudio - - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/etc/pulse/* \ - $(1)/etc/pulse - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/*.so* \ - $(1)/usr/lib/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \ - $(1)/usr/lib/pulseaudio/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \ - $(1)/usr/lib/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \ - $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pulseaudio $(1)/usr/bin/pulseaudio + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/pulseaudio.init $(1)/etc/init.d/pulseaudio + + $(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 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/ endef define Package/pulseaudio-daemon-avahi/install - $(INSTALL_DIR) \ - $(1)/etc/pulse \ - $(1)/etc/init.d \ - $(1)/usr/bin \ - $(1)/usr/lib \ - $(1)/usr/lib/pulseaudio \ - $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \ - $(1)/etc/dbus-1/system.d - - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \ - $(1)/usr/bin/pulseaudio - - $(INSTALL_BIN) \ - ./files/pulseaudio.init \ - $(1)/etc/init.d/pulseaudio - - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/etc/pulse/* \ - $(1)/etc/pulse - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/*.so* \ - $(1)/usr/lib/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \ - $(1)/usr/lib/pulseaudio/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \ - $(1)/usr/lib/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \ - $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/ - - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \ - $(1)/etc/dbus-1/system.d/pulseaudio-system.conf + $(call Package/pulseaudio-daemon/install,$1) + + $(INSTALL_DIR) $(1)/etc/dbus-1/system.d + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf $(1)/etc/dbus-1/system.d/pulseaudio-system.conf endef define Package/pulseaudio-tools/install - $(INSTALL_DIR) \ - $(1)/usr/bin - - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/bin/pa* \ - $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pa* $(1)/usr/bin/ endef define Package/pulseaudio-profiles/install - $(INSTALL_DIR) \ - $(1)/usr/share/pulseaudio/alsa-mixer/paths \ - $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets - - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \ - $(1)/usr/share/pulseaudio/alsa-mixer/paths + $(INSTALL_DIR) $(1)/usr/share/pulseaudio/alsa-mixer/paths + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* $(1)/usr/share/pulseaudio/alsa-mixer/paths - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \ - $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets + $(INSTALL_DIR) $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets endef $(eval $(call BuildPackage,pulseaudio-daemon)) -- 2.30.2