blob: 9500462d5cc498957de4b684ccad98575071f92b [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "ALSA Plugins"
2DESCRIPTION = "Used to create virtual devices that can be used like normal \
3hardware devices but cause extra processing of the sound stream to take place. \
4They are used while configuring ALSA in the .asoundrc file."
5HOMEPAGE = "http://alsa-project.org"
6BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
7SECTION = "multimedia"
8
Andrew Geissler9aee5002022-03-30 16:27:02 +00009# The primary license of alsa-plugins is LGPL-2.1-only.
Andrew Geissler595f6302022-01-24 19:11:47 +000010#
Andrew Geissler9aee5002022-03-30 16:27:02 +000011# m4/attributes.m4 is licensed under GPL-2.0-or-later. m4/attributes.m4 is part
12# of the build system, and doesn't affect the licensing of the build result.
Andrew Geissler595f6302022-01-24 19:11:47 +000013#
Andrew Geissler9aee5002022-03-30 16:27:02 +000014# The samplerate plugin source code is licensed under GPL-2.0-or-later to be
15# consistent with the libsamplerate license. However, if the licensee has a
16# commercial license for libsamplerate, the samplerate plugin may be used under
17# the terms of LGPL-2.1-only like the rest of the plugins.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000018LICENSE = "LGPL-2.1-only & GPL-2.0-or-later"
Andrew Geissler595f6302022-01-24 19:11:47 +000019LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
20 file://COPYING.GPL;md5=59530bdf33659b29e73d4adb9f9f6552 \
21 file://m4/attributes.m4;endline=33;md5=bb8c6b2a67ac15156961e242fec33e50 \
22 file://rate/rate_samplerate.c;endline=35;md5=fd77bce85f4a338c0e8ab18430b69fae \
23 "
24
Patrick Williams92b42cb2022-09-03 06:53:57 -050025SRC_URI = "https://www.alsa-project.org/files/pub/plugins/${BP}.tar.bz2 \
26 file://0001-arcam_av.c-Include-missing-string.h.patch \
27 "
Andrew Geissler615f2f12022-07-15 14:00:58 -050028SRC_URI[sha256sum] = "8c337814954bb7c167456733a6046142a2931f12eccba3ec2a4ae618a3432511"
Andrew Geissler595f6302022-01-24 19:11:47 +000029
30DEPENDS += "alsa-lib"
31
32inherit autotools pkgconfig
33
34PACKAGECONFIG ??= "\
35 samplerate \
36 speexdsp \
37 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
38"
Andrew Geissler78b72792022-06-14 06:47:25 -050039PACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,libavtp"
Andrew Geissler595f6302022-01-24 19:11:47 +000040PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
41PACKAGECONFIG[libav] = "--enable-libav,--disable-libav,libav"
42PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
43PACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
44PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
45PACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
46PACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
47
48PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
49
50PACKAGES_DYNAMIC = "^libasound-module-.*"
51
52# The alsa-plugins package doesn't itself contain anything, it just depends on
53# all built plugins.
54FILES:${PN} = ""
55ALLOW_EMPTY:${PN} = "1"
56
57do_install:append() {
58 rm -f ${D}${libdir}/alsa-lib/*.la
59
60 if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
61 # We use the example as is. Upstream installs the file under
62 # /etc, but we move it under /usr/share and add a symlink under
63 # /etc to be consistent with other installed configuration
64 # files.
65 mv ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
66 ln -s ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf
67 fi
68}
69
70python populate_packages:prepend() {
71 plugindir = d.expand('${libdir}/alsa-lib/')
72 packages = " ".join(do_split_packages(d, plugindir, r'^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
73 d.setVar("RDEPENDS:alsa-plugins", packages)
74}
75
76# Many plugins have a configuration file (plus a symlink in /etc) associated
77# with them. We put the plugin and it's configuration usually in the same
78# package, but that's problematic when the configuration file is related to
79# multiple plugins, as is the case with the pulse, oss and maemo plugins. In
80# case of the pulse plugins, we have a separate alsa-plugins-pulseaudio-conf
81# package that depends on all the pulse plugins, which ensures that all plugins
82# that the configuration references are installed. The oss and maemo
83# configuration files, on the other hand, are in the respective pcm plugin
84# packages. Therefore it's possible to install the configuration file without
85# the ctl plugin that the configuration file references. This is unlikely to
86# cause big problems, but some kind of improvement to the packaging could
87# probably be done here (at least it would be good to handle the different
88# plugins in a consistent way).
89FILES:${MLPREFIX}libasound-module-ctl-arcam-av += "\
90 ${datadir}/alsa/alsa.conf.d/50-arcam-av-ctl.conf \
91 ${sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf \
92"
93FILES:${MLPREFIX}libasound-module-pcm-a52 += "\
94 ${datadir}/alsa/alsa.conf.d/60-a52-encoder.conf \
95 ${sysconfdir}/alsa/conf.d/60-a52-encoder.conf \
96"
97FILES:${MLPREFIX}libasound-module-pcm-alsa-dsp += "\
98 ${datadir}/alsa/alsa.conf.d/98-maemo.conf \
99 ${sysconfdir}/alsa/conf.d/98-maemo.conf \
100"
101FILES:${MLPREFIX}libasound-module-pcm-jack += "\
102 ${datadir}/alsa/alsa.conf.d/50-jack.conf \
103 ${sysconfdir}/alsa/conf.d/50-jack.conf \
104"
105FILES:${MLPREFIX}libasound-module-pcm-oss += "\
106 ${datadir}/alsa/alsa.conf.d/50-oss.conf \
107 ${sysconfdir}/alsa/conf.d/50-oss.conf \
108"
109FILES:${MLPREFIX}libasound-module-pcm-speex += "\
110 ${datadir}/alsa/alsa.conf.d/60-speex.conf \
111 ${sysconfdir}/alsa/conf.d/60-speex.conf \
112"
113FILES:${MLPREFIX}libasound-module-pcm-upmix += "\
114 ${datadir}/alsa/alsa.conf.d/60-upmix.conf \
115 ${sysconfdir}/alsa/conf.d/60-upmix.conf \
116"
117FILES:${MLPREFIX}libasound-module-pcm-usb-stream += "\
118 ${datadir}/alsa/alsa.conf.d/98-usb-stream.conf \
119 ${sysconfdir}/alsa/conf.d/98-usb-stream.conf \
120"
121FILES:${MLPREFIX}libasound-module-pcm-vdownmix += "\
122 ${datadir}/alsa/alsa.conf.d/60-vdownmix.conf \
123 ${sysconfdir}/alsa/conf.d/60-vdownmix.conf \
124"
125FILES:${MLPREFIX}libasound-module-rate-lavrate += "\
126 ${datadir}/alsa/alsa.conf.d/10-rate-lav.conf \
127 ${sysconfdir}/alsa/conf.d/10-rate-lav.conf \
128"
129FILES:${MLPREFIX}libasound-module-rate-samplerate += "\
130 ${datadir}/alsa/alsa.conf.d/10-samplerate.conf \
131 ${sysconfdir}/alsa/conf.d/10-samplerate.conf \
132"
133FILES:${MLPREFIX}libasound-module-rate-speexrate += "\
134 ${datadir}/alsa/alsa.conf.d/10-speexrate.conf \
135 ${sysconfdir}/alsa/conf.d/10-speexrate.conf \
136"
137
138# The rate plugins create some symlinks. For example, the samplerate plugin
139# creates these links to the main plugin file:
140#
141# libasound_module_rate_samplerate_best.so
142# libasound_module_rate_samplerate_linear.so
143# libasound_module_rate_samplerate_medium.so
144# libasound_module_rate_samplerate_order.so
145#
146# The other rate plugins create similar links. We have to add the links to
147# FILES manually, because do_split_packages() skips the links (which is good,
148# because we wouldn't want do_split_packages() to create separate packages for
149# the symlinks).
150#
151# The symlinks cause QA errors, because usually it's a bug if a non
152# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
153# the errors are false positives, so we disable the QA checks.
154FILES:${MLPREFIX}libasound-module-rate-lavrate += "${libdir}/alsa-lib/*rate_lavrate_*.so"
155FILES:${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
156FILES:${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
157INSANE_SKIP:${MLPREFIX}libasound-module-rate-lavrate = "dev-so"
158INSANE_SKIP:${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
159INSANE_SKIP:${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
160
161# 50-pulseaudio.conf defines a device named "pulse" that applications can use
162# if they explicitly want to use the PulseAudio plugin.
163# 99-pulseaudio-default.conf configures the "default" device to use the
164# PulseAudio plugin.
165FILES:${PN}-pulseaudio-conf += "\
166 ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
167 ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
168 ${sysconfdir}/alsa/conf.d/50-pulseaudio.conf \
169 ${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf \
170"
171
172RDEPENDS:${PN}-pulseaudio-conf += "\
173 ${MLPREFIX}libasound-module-conf-pulse \
174 ${MLPREFIX}libasound-module-ctl-pulse \
175 ${MLPREFIX}libasound-module-pcm-pulse \
176"