blob: 1381896f38e850701c4cdba995c9e0829c7b4d03 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "ALSA Plugins"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "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."
Andrew Geissler82c905d2020-04-13 13:39:40 -05005HOMEPAGE = "http://alsa-project.org"
6BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
7SECTION = "multimedia"
8
9# The primary license of alsa-plugins is LGPLv2.1.
10#
11# m4/attributes.m4 is licensed under GPLv2+. m4/attributes.m4 is part of the
12# build system, and doesn't affect the licensing of the build result.
13#
14# The samplerate plugin source code is licensed under GPLv2+ to be consistent
15# with the libsamplerate license. However, if the licensee has a commercial
16# license for libsamplerate, the samplerate plugin may be used under the terms
17# of LGPLv2.1 like the rest of the plugins.
18LICENSE = "LGPLv2.1 & GPLv2+"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050019LIC_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 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
25SRC_URI = "https://www.alsa-project.org/files/pub/plugins/${BP}.tar.bz2"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050026SRC_URI[md5sum] = "8455e3c6fbc47f62f070afabc14ba575"
27SRC_URI[sha256sum] = "1c0f06450c928d711719686c9dbece2d480184f36fab11b8f0534cb7b41e337d"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028
29DEPENDS += "alsa-lib"
30
31inherit autotools pkgconfig
32
33PACKAGECONFIG ??= "\
34 samplerate \
35 speexdsp \
36 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
37"
38PACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,avtp"
39PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
40PACKAGECONFIG[libav] = "--enable-libav,--disable-libav,libav"
41PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
42PACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
43PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
44PACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
45PACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
46
47PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
48
49PACKAGES_DYNAMIC = "^libasound-module-.*"
50
51# The alsa-plugins package doesn't itself contain anything, it just depends on
52# all built plugins.
53FILES_${PN} = ""
54ALLOW_EMPTY_${PN} = "1"
55
56do_install_append() {
Andrew Geisslerc9f78652020-09-18 14:11:35 -050057 rm -f ${D}${libdir}/alsa-lib/*.la
Andrew Geissler82c905d2020-04-13 13:39:40 -050058
59 if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
60 # We use the example as is. Upstream installs the file under
61 # /etc, but we move it under /usr/share and add a symlink under
62 # /etc to be consistent with other installed configuration
63 # files.
64 mv ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
65 ln -s ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf
66 fi
67}
68
69python populate_packages_prepend() {
70 plugindir = d.expand('${libdir}/alsa-lib/')
71 packages = " ".join(do_split_packages(d, plugindir, r'^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
72 d.setVar("RDEPENDS_alsa-plugins", packages)
73}
74
75# Many plugins have a configuration file (plus a symlink in /etc) associated
76# with them. We put the plugin and it's configuration usually in the same
77# package, but that's problematic when the configuration file is related to
78# multiple plugins, as is the case with the pulse, oss and maemo plugins. In
79# case of the pulse plugins, we have a separate alsa-plugins-pulseaudio-conf
80# package that depends on all the pulse plugins, which ensures that all plugins
81# that the configuration references are installed. The oss and maemo
82# configuration files, on the other hand, are in the respective pcm plugin
83# packages. Therefore it's possible to install the configuration file without
84# the ctl plugin that the configuration file references. This is unlikely to
85# cause big problems, but some kind of improvement to the packaging could
86# probably be done here (at least it would be good to handle the different
87# plugins in a consistent way).
88FILES_${MLPREFIX}libasound-module-ctl-arcam-av += "\
89 ${datadir}/alsa/alsa.conf.d/50-arcam-av-ctl.conf \
90 ${sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf \
91"
92FILES_${MLPREFIX}libasound-module-pcm-a52 += "\
93 ${datadir}/alsa/alsa.conf.d/60-a52-encoder.conf \
94 ${sysconfdir}/alsa/conf.d/60-a52-encoder.conf \
95"
96FILES_${MLPREFIX}libasound-module-pcm-alsa-dsp += "\
97 ${datadir}/alsa/alsa.conf.d/98-maemo.conf \
98 ${sysconfdir}/alsa/conf.d/98-maemo.conf \
99"
100FILES_${MLPREFIX}libasound-module-pcm-jack += "\
101 ${datadir}/alsa/alsa.conf.d/50-jack.conf \
102 ${sysconfdir}/alsa/conf.d/50-jack.conf \
103"
104FILES_${MLPREFIX}libasound-module-pcm-oss += "\
105 ${datadir}/alsa/alsa.conf.d/50-oss.conf \
106 ${sysconfdir}/alsa/conf.d/50-oss.conf \
107"
108FILES_${MLPREFIX}libasound-module-pcm-speex += "\
109 ${datadir}/alsa/alsa.conf.d/60-speex.conf \
110 ${sysconfdir}/alsa/conf.d/60-speex.conf \
111"
112FILES_${MLPREFIX}libasound-module-pcm-upmix += "\
113 ${datadir}/alsa/alsa.conf.d/60-upmix.conf \
114 ${sysconfdir}/alsa/conf.d/60-upmix.conf \
115"
116FILES_${MLPREFIX}libasound-module-pcm-usb-stream += "\
117 ${datadir}/alsa/alsa.conf.d/98-usb-stream.conf \
118 ${sysconfdir}/alsa/conf.d/98-usb-stream.conf \
119"
120FILES_${MLPREFIX}libasound-module-pcm-vdownmix += "\
121 ${datadir}/alsa/alsa.conf.d/60-vdownmix.conf \
122 ${sysconfdir}/alsa/conf.d/60-vdownmix.conf \
123"
124FILES_${MLPREFIX}libasound-module-rate-lavrate += "\
125 ${datadir}/alsa/alsa.conf.d/10-rate-lav.conf \
126 ${sysconfdir}/alsa/conf.d/10-rate-lav.conf \
127"
128FILES_${MLPREFIX}libasound-module-rate-samplerate += "\
129 ${datadir}/alsa/alsa.conf.d/10-samplerate.conf \
130 ${sysconfdir}/alsa/conf.d/10-samplerate.conf \
131"
132FILES_${MLPREFIX}libasound-module-rate-speexrate += "\
133 ${datadir}/alsa/alsa.conf.d/10-speexrate.conf \
134 ${sysconfdir}/alsa/conf.d/10-speexrate.conf \
135"
136
137# The rate plugins create some symlinks. For example, the samplerate plugin
138# creates these links to the main plugin file:
139#
140# libasound_module_rate_samplerate_best.so
141# libasound_module_rate_samplerate_linear.so
142# libasound_module_rate_samplerate_medium.so
143# libasound_module_rate_samplerate_order.so
144#
145# The other rate plugins create similar links. We have to add the links to
146# FILES manually, because do_split_packages() skips the links (which is good,
147# because we wouldn't want do_split_packages() to create separate packages for
148# the symlinks).
149#
150# The symlinks cause QA errors, because usually it's a bug if a non
151# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
152# the errors are false positives, so we disable the QA checks.
153FILES_${MLPREFIX}libasound-module-rate-lavrate += "${libdir}/alsa-lib/*rate_lavrate_*.so"
154FILES_${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
155FILES_${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
156INSANE_SKIP_${MLPREFIX}libasound-module-rate-lavrate = "dev-so"
157INSANE_SKIP_${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
158INSANE_SKIP_${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
159
160# 50-pulseaudio.conf defines a device named "pulse" that applications can use
161# if they explicitly want to use the PulseAudio plugin.
162# 99-pulseaudio-default.conf configures the "default" device to use the
163# PulseAudio plugin.
164FILES_${PN}-pulseaudio-conf += "\
165 ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
166 ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
167 ${sysconfdir}/alsa/conf.d/50-pulseaudio.conf \
168 ${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf \
169"
170
171RDEPENDS_${PN}-pulseaudio-conf += "\
Andrew Geissler1e34c2d2020-05-29 16:02:59 -0500172 ${MLPREFIX}libasound-module-conf-pulse \
173 ${MLPREFIX}libasound-module-ctl-pulse \
174 ${MLPREFIX}libasound-module-pcm-pulse \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500175"