]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/pulseaudio/pulseaudio.mk
Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin
[coffee/buildroot.git] / package / pulseaudio / pulseaudio.mk
1 ################################################################################
2 #
3 # pulseaudio
4 #
5 ################################################################################
6
7 PULSEAUDIO_VERSION = 9.0
8 PULSEAUDIO_SOURCE = pulseaudio-$(PULSEAUDIO_VERSION).tar.xz
9 PULSEAUDIO_SITE = http://freedesktop.org/software/pulseaudio/releases
10 PULSEAUDIO_INSTALL_STAGING = YES
11 PULSEAUDIO_LICENSE = LGPL-2.1+ (specific license for modules, see LICENSE file)
12 PULSEAUDIO_LICENSE_FILES = LICENSE GPL LGPL
13 PULSEAUDIO_CONF_OPTS = \
14         --disable-default-build-tests \
15         --disable-legacy-database-entry-format \
16         --disable-manpages
17
18 # Make sure we don't detect libatomic_ops. Indeed, since pulseaudio
19 # requires json-c, which needs 4 bytes __sync builtins, there should
20 # be no need for pulseaudio to rely on libatomic_ops.
21 PULSEAUDIO_CONF_ENV += \
22         ac_cv_header_atomic_ops_h=no
23
24 # 0002-webrtc-C-11-is-only-required-for-WebRTC-support.patch
25 PULSEAUDIO_AUTORECONF = YES
26
27 PULSEAUDIO_DEPENDENCIES = \
28         host-pkgconf libtool json-c libsndfile speex host-intltool \
29         $(if $(BR2_PACKAGE_LIBSAMPLERATE),libsamplerate) \
30         $(if $(BR2_PACKAGE_ALSA_LIB),alsa-lib) \
31         $(if $(BR2_PACKAGE_LIBGLIB2),libglib2) \
32         $(if $(BR2_PACKAGE_AVAHI_DAEMON),avahi) \
33         $(if $(BR2_PACKAGE_DBUS),dbus) \
34         $(if $(BR2_PACKAGE_BLUEZ_UTILS),bluez_utils) \
35         $(if $(BR2_PACKAGE_OPENSSL),openssl) \
36         $(if $(BR2_PACKAGE_FFTW),fftw) \
37         $(if $(BR2_PACKAGE_SYSTEMD),systemd)
38
39 ifeq ($(BR2_PACKAGE_GDBM),y)
40 PULSEAUDIO_CONF_OPTS += --with-database=gdbm
41 PULSEAUDIO_DEPENDENCIES += gdbm
42 else
43 PULSEAUDIO_CONF_OPTS += --with-database=simple
44 endif
45
46 ifeq ($(BR2_PACKAGE_JACK2),y)
47 PULSEAUDIO_CONF_OPTS += --enable-jack
48 PULSEAUDIO_DEPENDENCIES += jack2
49 else
50 PULSEAUDIO_CONF_OPTS += --disable-jack
51 endif
52
53 ifeq ($(BR2_PACKAGE_ORC),y)
54 PULSEAUDIO_DEPENDENCIES += orc
55 PULSEAUDIO_CONF_ENV += ORCC=$(HOST_DIR)/bin/orcc
56 PULSEAUDIO_CONF_OPTS += --enable-orc
57 else
58 PULSEAUDIO_CONF_OPTS += --disable-orc
59 endif
60
61 ifeq ($(BR2_PACKAGE_LIBCAP),y)
62 PULSEAUDIO_DEPENDENCIES += libcap
63 PULSEAUDIO_CONF_OPTS += --with-caps
64 else
65 PULSEAUDIO_CONF_OPTS += --without-caps
66 endif
67
68 # gtk3 support needs X11 backend
69 ifeq ($(BR2_PACKAGE_LIBGTK3_X11),y)
70 PULSEAUDIO_DEPENDENCIES += libgtk3
71 PULSEAUDIO_CONF_OPTS += --enable-gtk3
72 else
73 PULSEAUDIO_CONF_OPTS += --disable-gtk3
74 endif
75
76 ifeq ($(BR2_PACKAGE_LIBSOXR),y)
77 PULSEAUDIO_CONF_OPTS += --with-soxr
78 PULSEAUDIO_DEPENDENCIES += libsoxr
79 else
80 PULSEAUDIO_CONF_OPTS += --without-soxr
81 endif
82
83 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
84 PULSEAUDIO_CONF_OPTS += --enable-udev
85 PULSEAUDIO_DEPENDENCIES += udev
86 else
87 PULSEAUDIO_CONF_OPTS += --disable-udev
88 endif
89
90 ifeq ($(BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING),y)
91 PULSEAUDIO_CONF_OPTS += --enable-webrtc-aec
92 PULSEAUDIO_DEPENDENCIES += webrtc-audio-processing
93 else
94 PULSEAUDIO_CONF_OPTS += --disable-webrtc-aec
95 endif
96
97 # neon intrinsics not available with float-abi=soft
98 ifeq ($(BR2_ARM_SOFT_FLOAT),)
99 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
100 PULSEAUDIO_USE_NEON = y
101 endif
102 endif
103
104 ifeq ($(PULSEAUDIO_USE_NEON),y)
105 PULSEAUDIO_CONF_OPTS += --enable-neon-opt=yes
106 else
107 PULSEAUDIO_CONF_OPTS += --enable-neon-opt=no
108 endif
109
110 # pulseaudio alsa backend needs pcm/mixer apis
111 ifneq ($(BR2_PACKAGE_ALSA_LIB_PCM)$(BR2_PACKAGE_ALSA_LIB_MIXER),yy)
112 PULSEAUDIO_CONF_OPTS += --disable-alsa
113 endif
114
115 ifeq ($(BR2_PACKAGE_LIBXCB)$(BR2_PACKAGE_XLIB_LIBSM)$(BR2_PACKAGE_XLIB_LIBXTST),yyy)
116 PULSEAUDIO_DEPENDENCIES += libxcb xlib_libSM xlib_libXtst
117
118 # .desktop file generation needs nls support, so fake it for !locale builds
119 # https://bugs.freedesktop.org/show_bug.cgi?id=54658
120 ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
121 define PULSEAUDIO_FIXUP_DESKTOP_FILES
122         cp $(@D)/src/daemon/pulseaudio.desktop.in \
123                 $(@D)/src/daemon/pulseaudio.desktop
124 endef
125 PULSEAUDIO_POST_PATCH_HOOKS += PULSEAUDIO_FIXUP_DESKTOP_FILES
126 endif
127
128 else
129 PULSEAUDIO_CONF_OPTS += --disable-x11
130 endif
131
132 define PULSEAUDIO_REMOVE_VALA
133         rm -rf $(TARGET_DIR)/usr/share/vala
134 endef
135
136 PULSEAUDIO_POST_INSTALL_TARGET_HOOKS += PULSEAUDIO_REMOVE_VALA
137
138 ifeq ($(BR2_PACKAGE_PULSEAUDIO_DAEMON),y)
139 define PULSEAUDIO_USERS
140         pulse -1 pulse -1 * /var/run/pulse - audio,pulse-access
141 endef
142
143 define PULSEAUDIO_INSTALL_INIT_SYSV
144         $(INSTALL) -D -m 755 package/pulseaudio/S50pulseaudio \
145                 $(TARGET_DIR)/etc/init.d/S50pulseaudio
146 endef
147
148 define PULSEAUDIO_INSTALL_INIT_SYSTEMD
149         $(INSTALL) -D -m 644 package/pulseaudio/pulseaudio.service \
150                 $(TARGET_DIR)/usr/lib/systemd/system/pulseaudio.service
151         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
152         ln -sf ../../../../usr/lib/systemd/system/pulseaudio.service \
153                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/pulseaudio.service
154 endef
155
156 endif
157
158 $(eval $(autotools-package))