pulseaudio: provide a virtual package for the two pulseaudio daemon variants to fix...
[packages.git] / sound / pulseaudio / Makefile
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=pulseaudio
11 PKG_VERSION:=1.1
12 PKG_RELEASE:=6
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
16 PKG_MD5SUM:=1b76932ca7c4b2aa992941e41ed4594b
17
18 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_BUILD_DEPENDS:=intltool/host
20
21 PKG_FIXUP:=autoreconf
22
23 PKG_INSTALL = 1
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 #TODO: split pulse into executable and library (or even better into several libraries since they're used as loadable modules, so not linked into)
29 define Package/pulseaudio/Default
30   SECTION:=sound
31   CATEGORY:=Sound
32   DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \
33         +librt +alsa-lib +libjson +libopenssl +udev $(ICONV_DEPENDS) $(INTL_DEPENDS)
34   TITLE:=Network sound server
35   URL:=http://www.pulseaudio.org
36   PROVIDES:=pulseaudio
37 endef
38
39 define Package/pulseaudio-daemon
40   $(call Package/pulseaudio/Default)
41   VARIANT:=noavahi
42 endef
43
44 define Package/pulseaudio-daemon-avahi
45   $(call Package/pulseaudio/Default)
46   DEPENDS+=+dbus +libavahi-client +avahi-daemon
47   TITLE+= (avahi)
48   VARIANT:=avahi
49 endef
50
51 define Package/pulseaudio/Default/description
52   PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server.
53 endef
54
55 define Package/pulseaudio-daemon/description
56   $(call Package/pulseaudio/Default/description)
57 endef
58
59 define Package/pulseaudio-daemon-avahi/description
60   $(call Package/pulseaudio/Default/description)
61   This package is compiled against dbus and avahi.
62 endef
63
64 define Package/pulseaudio-daemon/conffiles
65 /etc/pulse/client.conf
66 /etc/pulse/daemon.conf
67 /etc/pulse/default.pa
68 /etc/pulse/system.pa
69 endef
70
71 define Package/pulseaudio-daemon-avahi/conffiles
72 /etc/pulse/client.conf
73 /etc/pulse/daemon.conf
74 /etc/pulse/default.pa
75 /etc/pulse/system.pa
76 endef
77
78 define Package/pulseaudio-tools
79   SECTION:=sound
80   CATEGORY:=Sound
81   DEPENDS:=+libsndfile pulseaudio
82   TITLE:=Tools for Pulseaudio
83   URL:=http://www.pulseaudio.org
84   VARIANT:=noavahi
85 endef
86
87 define Package/pulseaudio-profiles
88   SECTION:=sound
89   CATEGORY:=Sound
90   DEPENDS:=pulseaudio
91   TITLE:=Profiles for Pulseaudio
92   URL:=http://www.pulseaudio.org
93 endef
94
95 CONFIGURE_ARGS += \
96         --with-system-user=pulse \
97         --with-system-group=pulse \
98         --with-access-group=audio \
99         --with-database=simple \
100         --enable-alsa \
101         --disable-hal \
102         --disable-gconf \
103         --disable-tcpwrap \
104         --disable-nls \
105         --disable-manpages \
106         --enable-oss-output \
107         --disable-oss-wrapper \
108         --disable-samplerate \
109         --disable-per-user-esound-socket \
110         --disable-solaris \
111         --disable-glib2 \
112         --disable-jack \
113         --disable-asyncns \
114         --disable-lirc \
115         --disable-bluez \
116         --without-caps
117
118 ifeq ($(BUILD_VARIANT),avahi)
119 CONFIGURE_ARGS += \
120         --enable-avahi \
121         --enable-dbus
122 endif
123
124 ifeq ($(BUILD_VARIANT),noavahi)
125 CONFIGURE_ARGS += \
126         --disable-avahi \
127         --disable-dbus
128 endif
129
130 CONFIGURE_VARS += \
131         PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
132
133 #SUPP_LIBS:=-L$(INTL_PREFIX)/lib -L$(ICONV_PREFIX)/lib
134 TARGET_CFLAGS += -std=gnu99
135
136 define Build/InstallDev
137         $(INSTALL_DIR) \
138                 $(1)/usr/lib/pkgconfig \
139                 $(1)/usr/include/pulse \
140                 $(1)/usr/lib
141         $(CP) \
142                 $(PKG_INSTALL_DIR)/usr/include/pulse/* \
143                 $(1)/usr/include/pulse
144         $(CP) \
145                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
146                 $(1)/usr/lib/pkgconfig
147         $(CP) \
148                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
149                 $(1)/usr/lib/
150 endef
151
152 define Package/pulseaudio-daemon/install
153         $(INSTALL_DIR) \
154                 $(1)/etc/pulse \
155                 $(1)/etc/init.d \
156                 $(1)/usr/bin \
157                 $(1)/usr/lib \
158                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules 
159
160         $(INSTALL_BIN) \
161                 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
162                 $(1)/usr/bin/pulseaudio
163
164         $(INSTALL_BIN) \
165                 ./files/pulseaudio.init \
166                 $(1)/etc/init.d/pulseaudio
167
168         $(INSTALL_CONF) \
169                 $(PKG_INSTALL_DIR)/etc/pulse/* \
170                 $(1)/etc/pulse
171
172         $(CP) \
173                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
174                 $(1)/usr/lib/
175
176         $(CP) \
177                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
178                 $(1)/usr/lib/
179
180         $(CP) \
181                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
182                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
183
184         chmod -R 0644 $(1)/etc/pulse/*
185 endef
186
187 define Package/pulseaudio-daemon-avahi/install
188         $(INSTALL_DIR) \
189                 $(1)/etc/pulse \
190                 $(1)/etc/init.d \
191                 $(1)/usr/bin \
192                 $(1)/usr/lib \
193                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \
194                 $(1)/etc/dbus-1/system.d 
195
196         $(INSTALL_BIN) \
197                 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
198                 $(1)/usr/bin/pulseaudio
199
200         $(INSTALL_BIN) \
201                 ./files/pulseaudio.init \
202                 $(1)/etc/init.d/pulseaudio
203
204         $(INSTALL_CONF) \
205                 $(PKG_INSTALL_DIR)/etc/pulse/* \
206                 $(1)/etc/pulse
207
208         $(CP) \
209                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
210                 $(1)/usr/lib/
211
212         $(CP) \
213                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
214                 $(1)/usr/lib/
215
216         $(CP) \
217                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
218                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
219
220         $(INSTALL_CONF) \
221                 $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \
222                 $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
223
224         chmod -R 0644 $(1)/etc/pulse/* $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
225 endef
226
227 define Package/pulseaudio-tools/install
228         $(INSTALL_DIR) \
229                 $(1)/usr/bin
230
231         $(INSTALL_BIN) \
232                 $(PKG_INSTALL_DIR)/usr/bin/pa* \
233                 $(1)/usr/bin/
234 endef
235
236 define Package/pulseaudio-profiles/install
237         $(INSTALL_DIR) \
238                 $(1)/usr/share/pulseaudio/alsa-mixer/paths \
239                 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
240
241         $(INSTALL_CONF) \
242                 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \
243                 $(1)/usr/share/pulseaudio/alsa-mixer/paths
244
245         $(INSTALL_CONF) \
246                 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \
247                 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
248 endef
249
250 $(eval $(call BuildPackage,pulseaudio-daemon))
251 $(eval $(call BuildPackage,pulseaudio-daemon-avahi))
252 $(eval $(call BuildPackage,pulseaudio-tools))
253 $(eval $(call BuildPackage,pulseaudio-profiles))