22dc6a780dcd3e820c1e146471ae0f6ca2101666
[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:=2.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
16 PKG_MD5SUM:=33e85023259d530f0a763d5204e8bad9
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         --without-fftw
118
119 ifeq ($(BUILD_VARIANT),avahi)
120 CONFIGURE_ARGS += \
121         --enable-avahi \
122         --enable-dbus
123 endif
124
125 ifeq ($(BUILD_VARIANT),noavahi)
126 CONFIGURE_ARGS += \
127         --disable-avahi \
128         --disable-dbus
129 endif
130
131 CONFIGURE_VARS += \
132         PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
133
134 #SUPP_LIBS:=-L$(INTL_PREFIX)/lib -L$(ICONV_PREFIX)/lib
135 TARGET_CFLAGS += -std=gnu99
136
137 define Build/InstallDev
138         $(INSTALL_DIR) \
139                 $(1)/usr/lib/pkgconfig \
140                 $(1)/usr/include/pulse \
141                 $(1)/usr/lib
142         $(CP) \
143                 $(PKG_INSTALL_DIR)/usr/include/pulse/* \
144                 $(1)/usr/include/pulse
145         $(CP) \
146                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
147                 $(1)/usr/lib/pkgconfig
148         $(CP) \
149                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
150                 $(1)/usr/lib/
151 endef
152
153 define Package/pulseaudio-daemon/install
154         $(INSTALL_DIR) \
155                 $(1)/etc/pulse \
156                 $(1)/etc/init.d \
157                 $(1)/usr/bin \
158                 $(1)/usr/lib \
159                 $(1)/usr/lib/pulseaudio \
160                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules 
161
162         $(INSTALL_BIN) \
163                 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
164                 $(1)/usr/bin/pulseaudio
165
166         $(INSTALL_BIN) \
167                 ./files/pulseaudio.init \
168                 $(1)/etc/init.d/pulseaudio
169
170         $(INSTALL_CONF) \
171                 $(PKG_INSTALL_DIR)/etc/pulse/* \
172                 $(1)/etc/pulse
173
174         $(CP) \
175                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
176                 $(1)/usr/lib/
177
178         $(CP) \
179                 $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \
180                 $(1)/usr/lib/pulseaudio/
181
182         $(CP) \
183                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
184                 $(1)/usr/lib/
185
186         $(CP) \
187                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
188                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
189
190         chmod -R 0644 $(1)/etc/pulse/*
191 endef
192
193 define Package/pulseaudio-daemon-avahi/install
194         $(INSTALL_DIR) \
195                 $(1)/etc/pulse \
196                 $(1)/etc/init.d \
197                 $(1)/usr/bin \
198                 $(1)/usr/lib \
199                 $(1)/usr/lib/pulseaudio \
200                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \
201                 $(1)/etc/dbus-1/system.d 
202
203         $(INSTALL_BIN) \
204                 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
205                 $(1)/usr/bin/pulseaudio
206
207         $(INSTALL_BIN) \
208                 ./files/pulseaudio.init \
209                 $(1)/etc/init.d/pulseaudio
210
211         $(INSTALL_CONF) \
212                 $(PKG_INSTALL_DIR)/etc/pulse/* \
213                 $(1)/etc/pulse
214
215         $(CP) \
216                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
217                 $(1)/usr/lib/
218
219         $(CP) \
220                 $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \
221                 $(1)/usr/lib/pulseaudio/
222
223         $(CP) \
224                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
225                 $(1)/usr/lib/
226
227         $(CP) \
228                 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
229                 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
230
231         $(INSTALL_CONF) \
232                 $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \
233                 $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
234
235         chmod -R 0644 $(1)/etc/pulse/* $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
236 endef
237
238 define Package/pulseaudio-tools/install
239         $(INSTALL_DIR) \
240                 $(1)/usr/bin
241
242         $(INSTALL_BIN) \
243                 $(PKG_INSTALL_DIR)/usr/bin/pa* \
244                 $(1)/usr/bin/
245 endef
246
247 define Package/pulseaudio-profiles/install
248         $(INSTALL_DIR) \
249                 $(1)/usr/share/pulseaudio/alsa-mixer/paths \
250                 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
251
252         $(INSTALL_CONF) \
253                 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \
254                 $(1)/usr/share/pulseaudio/alsa-mixer/paths
255
256         $(INSTALL_CONF) \
257                 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \
258                 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
259 endef
260
261 $(eval $(call BuildPackage,pulseaudio-daemon))
262 $(eval $(call BuildPackage,pulseaudio-daemon-avahi))
263 $(eval $(call BuildPackage,pulseaudio-tools))
264 $(eval $(call BuildPackage,pulseaudio-profiles))