67a465d495544cea0bcd77e89437fd4857ac53a6
[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.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
16 PKG_MD5SUM:=e5749151dbbaa7e928793f020bf1208b
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 = libtool
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 $(ICONV_DEPENDS) $(INTL_DEPENDS) \
34         @!UCLIBC_VERSION_0_9_30_1 @!UCLIBC_VERSION_0_9_30_2 \
35         @!UCLIBC_VERSION_0_9_30_3
36   TITLE:=Network sound server
37   URL:=http://www.pulseaudio.org
38 endef
39
40 define Package/pulseaudio-daemon
41   $(call Package/pulseaudio/Default)
42   VARIANT:=noavahi
43 endef
44
45 define Package/pulseaudio-daemon-avahi
46   $(call Package/pulseaudio/Default)
47   DEPENDS+=+dbus +libavahi-client +avahi-daemon-dbus
48   TITLE+= (avahi)
49   VARIANT:=avahi
50 endef
51
52 define Package/pulseaudio/Default/description
53   PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server.
54 endef
55
56 define Package/pulseaudio-daemon/description
57   $(call Package/pulseaudio/Default/description)
58 endef
59
60 define Package/pulseaudio-daemon-avahi/description
61   $(call Package/pulseaudio/Default/description)
62   This package is compiled against dbus and avahi.
63 endef
64
65 define Package/pulseaudio-daemon/conffiles
66 /etc/pulse/client.conf
67 /etc/pulse/daemon.conf
68 /etc/pulse/default.pa
69 /etc/pulse/system.pa
70 endef
71
72 define Package/pulseaudio-daemon-avahi/conffiles
73 /etc/pulse/client.conf
74 /etc/pulse/daemon.conf
75 /etc/pulse/default.pa
76 /etc/pulse/system.pa
77 endef
78
79 define Package/pulseaudio-tools
80   SECTION:=sound
81   CATEGORY:=Sound
82   DEPENDS:=+libsndfile @PACKAGE_pulseaudio-daemon||PACKAGE_pulseaudio-daemon-avahi #+libpulse
83   TITLE:=Tools for Pulseaudio
84   URL:=http://www.pulseaudio.org
85   VARIANT:=noavahi
86 endef
87
88 define Package/pulseaudio-profiles
89   SECTION:=sound
90   CATEGORY:=Sound
91   DEPENDS:=@PACKAGE_pulseaudio-daemon||PACKAGE_pulseaudio-daemon-avahi
92   TITLE:=Profiles for Pulseaudio
93   URL:=http://www.pulseaudio.org
94 endef
95
96 CONFIGURE_ARGS += \
97         --with-system-user=root \
98         --with-system-group=root \
99         --with-access-group=root \
100         --with-database=simple \
101         --enable-alsa \
102         --disable-hal \
103         --disable-gconf \
104         --disable-tcpwrap \
105         --disable-nls \
106         --disable-manpages \
107         --disable-oss-output \
108         --disable-oss-wrapper \
109         --disable-samplerate \
110         --disable-per-user-esound-socket \
111         --disable-solaris \
112         --disable-glib2 \
113         --disable-jack \
114         --disable-asyncns \
115         --disable-lirc \
116         --disable-bluez \
117         --without-caps
118
119 ifeq ($(BUILD_VARIANT),avahi)
120 CONFIGURE_ARGS += \
121         --enable-avahi \
122         --enable-dbus
123 endif
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 endef
184
185 define Package/pulseaudio-daemon-avahi/install
186         $(INSTALL_DIR) \
187                 $(1)/etc/pulse \
188                 $(1)/etc/init.d \
189                 $(1)/usr/bin \
190                 $(1)/usr/lib \
191                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \
192                 $(1)/etc/dbus-1/system.d 
193
194         $(INSTALL_BIN) \
195                 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
196                 $(1)/usr/bin/pulseaudio
197
198         $(INSTALL_BIN) \
199                 ./files/pulseaudio.init \
200                 $(1)/etc/init.d/pulseaudio
201
202         $(INSTALL_CONF) \
203                 $(PKG_INSTALL_DIR)/etc/pulse/* \
204                 $(1)/etc/pulse
205
206         $(CP) \
207                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
208                 $(1)/usr/lib/
209
210         $(CP) \
211                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
212                 $(1)/usr/lib/
213
214         $(CP) \
215                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
216                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
217
218         $(INSTALL_CONF) \
219                 $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \
220                 $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
221
222         $(SED) \
223                 's/user="pulse"/user="root"/' \
224                 $(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))