summaryrefslogtreecommitdiff
path: root/media-sound/pulseaudio-daemon
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /media-sound/pulseaudio-daemon
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'media-sound/pulseaudio-daemon')
-rw-r--r--media-sound/pulseaudio-daemon/Manifest15
-rw-r--r--media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch72
-rw-r--r--media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch43
-rw-r--r--media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch42
-rw-r--r--media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch26
-rw-r--r--media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch76
-rw-r--r--media-sound/pulseaudio-daemon/metadata.xml28
-rw-r--r--media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r1.ebuild (renamed from media-sound/pulseaudio-daemon/pulseaudio-daemon-15.99.1-r2.ebuild)87
-rw-r--r--media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild388
-rw-r--r--media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild396
-rw-r--r--media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1.ebuild392
11 files changed, 1532 insertions, 33 deletions
diff --git a/media-sound/pulseaudio-daemon/Manifest b/media-sound/pulseaudio-daemon/Manifest
index 4fa3b852b47e..0703aa356d9d 100644
--- a/media-sound/pulseaudio-daemon/Manifest
+++ b/media-sound/pulseaudio-daemon/Manifest
@@ -1,8 +1,17 @@
AUX enable-autospawn.conf 65 BLAKE2B 47e57076b19000ca3c57f0368e453198131c41a5a9c2d0cc8632f0a7ed4e5c992cf93e3c7651c4f3b59ceaf177d4d811bd6774676a2b005ec12259e56d99b4d2 SHA512 61f90b0d19e807a672bd39d190c1102db0b8c46284cf09d4a19b4b96d566633e56a60d21a3a1374e447e8e06496a3aef56bf5ae574337c081e7cf18842458e59
+AUX pulseaudio-16.0-fix-combine-sink-underrun-crash.patch 3707 BLAKE2B 798774fd8c290aaea996e3caee0faca591ae7ec691d485ee365b908e45e6ad596277d34d10090be9366b7bf077a51e7e9f7dbeab362853d419a96fd0ab65af07 SHA512 b604cd1e04832c617e1575bddf237abf6896b340f80c0616736d055892b42aa9665ad5bd2796869bc1eedcfc0d632aa4956fcaed4b4e89bee7eeb5ce60ad1cf1
+AUX pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch 1448 BLAKE2B 63ddbc36e3ac2ee553f6f30975886c2488e7d9889c3969b7110a75c24edc92eedf5c8c7be01130546fd67e7d71aaf7cf6b8b3842d2003b968d062fbe12b61f7b SHA512 7ff462e32e3218df28733af1abfab1f38173d48b458c0cab8b1f6aba0b7c5cd8479aaca52f0e25a1e4c71340e378c5a4b8bbd1c6613b979057d3dab035b5708f
+AUX pulseaudio-16.0-fix-pacmd-play-file-crash.patch 1625 BLAKE2B 5dbe6d24e0faf0152d6088244571c63d51392ab488e0b2ac47ad9a0a2fdb8f0c342824315b7be0916bde69af0911a6be02ad43e6369b5fcf1ad5cb3cb2fe88f6 SHA512 3cdbf444245229be7cb643c03d555cf7d7d5f8ba3bb608a72f27b660dc90413478681258d6226063c946cc783f48863994cc77709cb0f82b61a27dd01cb15305
+AUX pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch 1025 BLAKE2B 33b8aa51c966a0716fd9c15c51903e74b760bc72eaf511e9a86182155c6e9e5e6e1b8eb9af40cf7da023de25e1f74a2428d74954c230c53bc61c42e53033a9c2 SHA512 9e573806494b0e8d3aa51db205457e5c63326cb81fe5a2801b0e66b2b49c3133b30c85feafd0b58a64b5949cbc9e29e599459b76cbf5f479281ad8aa5c5bbb5e
+AUX pulseaudio-16.0-optional-module-console-kit.patch 3077 BLAKE2B 3b8abc67478f6c8848a24788bdceeb5bce868bf5214a092c3abbd39a3102679e4b390e56231de0559c8389730a2a75ba21bf4d9f9d942792589c6db66d6eb04d SHA512 bec1a747593d9130bb8cfb05b0894e467c953264879f2a856a420b07ee688640ec2279c136daa825b21e0e7e3bfc3aa1e333487a776d1c7ffb9a6d0293a0502b
AUX pulseaudio.conf.d 151 BLAKE2B 99b185b9353259f37f3396c6f2bb56b80cac0159c9c5d06af4b298ad71d9c577dd6b3f0d9097fc95184b14193d0d55252987465ebd93bd0005849a68ce9b428d SHA512 f97ed431e371e43d297b099952bf1e897b243a822183524b8e3ea17e888c08590bb3793e195bc22e3254eae7f2e1fa00204a752638746c4dde825a423f08c24b
AUX pulseaudio.init.d-5 2224 BLAKE2B d7710b77b209391016e9f84b574cdf70636904d7f54caf9297357ebee97e8ae10c54119521ecad99fbef5f1ad341128b06816f8c733faa29d9c44fa8c435008b SHA512 a11d02fd1c6672a7f022e6ef3e3ad8e3a7f2bf50257c38573db0823415c990021a7bf29b1e194d3d9c8a59464673958604086ef519313a4e3a6bd79071397f29
AUX pulseaudio.service 227 BLAKE2B f58fa701152e84f4d52426f6f76b5a01a1a315d09e5fb8e9e57860b44dc63b78b3f1c1629380b4345c53b003c677f729b3959419e8488e37607c56d6a700626a SHA512 567663b231fe7c2682b08b1059cdad1fcb3c4cb01c1b24aed9afb6fb767b30f250b78bbbed48aadfb06c6d1a4963a6db24877d79a1d36c4be2a128b479c086d6
AUX pulseaudio.tmpfiles 36 BLAKE2B 4fe7c88fb35f561b0eb756146db17e37201126b5d7f906c88cdc778c6191f17c799f1db072f09d5a384485830e4d33266c224955bad22081255544642399b2f6 SHA512 f040850d81030ef04e1aa368d333a1ae1b7238adef5772280fc344c3068262d5ab8c9f3edb92db9c443f9d7d21abb27583ea1efc51ed733bbfa43e2edc68dde1
-DIST pulseaudio-15.99.1.tar.xz 1546536 BLAKE2B d77b7f9d05c1ffe1490b72dbf58b479962798d6e961d4efc935cbab0a6ad7fcd6ecb99de5efa5b85658b58e59024087cfd446ac4e7eeef1cd38fa7e579b5fb3c SHA512 3eb7cdc9795204513d43336836d12709e78ebb001a97e9bab81969a4981a10df2d68a5fad34aef2660f37b72d269cb01e4c6e76c42a5c5742ac56c0f575778d5
-EBUILD pulseaudio-daemon-15.99.1-r2.ebuild 10309 BLAKE2B a0c724825e6a88bbcd459b82ecc1d85eb3375648bd7b1e69be30a892c6c8c28cc6a309a11d44b9df20d62380ede6b79b15a1444236a58469610936b5b7454bfd SHA512 f09b09b8db9109fe9a2ab9ad33accc1598ed84b2336ce44eb10650a1e0ed2c46a114dbbae34e3887254bfbd6581db35c9a86c45b13a965acb569e7252d561345
-MISC metadata.xml 3219 BLAKE2B fd8c28b21c9fc9d2185d2f92481b5cdf1b344dbd95a7d668f5fa14320f90698654ae68cca14789fd9f83fe9fe9b46f906988acdbce36c5e0102846baaf10e7e0 SHA512 9b1c4d4a5077d6e7dae69c4f54d82586d77d32dca078ae39f63995b2b2320ec9804be24688657ed47823ee034ce8b54a8f9e0229e9b35849778b0204ef97352c
+DIST pulseaudio-16.0.tar.xz 1551276 BLAKE2B 54ba5d446bc02246bf842280f577851eb66ff9fed1e1b0d2d03e238796d9d04bc1fc27215b02fdded37441da1747be23d1e03d5a00b79ee3b91eb35c0f76a470 SHA512 42d4968c2dc88f5e39a5358d124e399e40a5abdf815eff387087141bc9dddd217012acb35649a8e0e24a44e8a402d90eb193ce2eef186f7d59550f757a6cc26d
+DIST pulseaudio-16.1.tar.xz 1545596 BLAKE2B 535706abcea2cae39834b23c8bdc37f71b0e633de2d8e43ea4425da97a850b57c2f980c318681cbc86cf1e746200609dad41f8b96ecf4568f86d94aa6831c9a1 SHA512 33b0b4292f05e0882f3ec822cf5720414bb34c523d80fe287b9740d6be219787c562e8024c9b0d9e2ee010771ca72c7ae4f27df1bbef9c9cb6bb6a23cbcc412f
+EBUILD pulseaudio-daemon-16.0-r1.ebuild 11998 BLAKE2B eae74c6cef4adc800de9d0f444c93ab95ad0c6943b5be4f18b46e530c8df0c33353442df9101a4ba51cc139262e03a0783d26b13cb6b94b8385f92dfd5e0d939 SHA512 a5d155ccaeb75414954dcabc4e539035dd188144c46d1e0818bd8014d505aeaaf4d4798a243eaf722372c305f4c1933420f43e138049e8175885ae304fa7d8f1
+EBUILD pulseaudio-daemon-16.0-r4.ebuild 11991 BLAKE2B a0cad25d3b04a7b7059c1c27b3b10e0917548643ca5fa3ef74e59b9c5cd75c48f66a5213b3ea608184ac35e2fa6deefb5de51bf6568ccbb257b43572975103d5 SHA512 1c1df7772101c0ec87496292f143239523400b2bf84cbdbdb464ca2c9fc340656dfed124725510274c87fa742d5d862001746bf666fa519782dd1d3f04f9996b
+EBUILD pulseaudio-daemon-16.0-r5.ebuild 12412 BLAKE2B e5f67f67e9c58a8c67f967f03ea842c244c7346edc056e57cec4ab603330741f7f824118127fa19aa5b911a2edb4eff138809e41829c4b468ba368f5b1a60807 SHA512 02d3977e39b6d66e68d42d9129c21434c98aea0ce8ef337dc886d900e494d77e0a70f855ea2832f42188163eabb6975b9a7469cb44a860a08eb08f5ffe0a7a15
+EBUILD pulseaudio-daemon-16.1.ebuild 12144 BLAKE2B 1a857785cb70eabd9409fddcb64540bfd1ae686b5a076095afb875d614f36a2c96c9a010766e4c85837739f4f84b5c9628699a65d09a9e709bb9f4791ef856c5 SHA512 e9a5bc1d12ca955f935c672898f5a7be40b92e896e8bbbe1d3582e39789573caf4a9432eb9c2740c4996cf42408e12e94915bf5992b9179da3d5ef5efec7840b
+MISC metadata.xml 3570 BLAKE2B 24d7b24a68f5e832708d9879769f55ec4cf146c47a41b5fa0ff33f63a5a9945736e227c6a6afa106f964fd91eb3b0ee441203c92f312ed835ef2197979b6fda9 SHA512 34aa5503ad5483eeff2f7c4713d96322dedbdd56b7d52a17ba0658aba24aef58239d5ee1943a276555c2508fd3d5e18639ec6417044adad512693fa6c673c5df
diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
new file mode 100644
index 000000000000..d66d75afdfda
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
@@ -0,0 +1,72 @@
+https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/ee8bfb49adddd271d8a8cafa796c6f9fa84de48a
+
+From ee8bfb49adddd271d8a8cafa796c6f9fa84de48a Mon Sep 17 00:00:00 2001
+From: Georg Chini <georg@chini.tk>
+Date: Fri, 17 Jun 2022 13:11:11 +0200
+Subject: [PATCH] combine-sink: Fix threading issue during underrun
+
+A recent commit added i->origin sink for the sink inputs of the combine sinks.
+Therefore pa_sink_process_input_underruns() treated the combine sink like
+filter sinks. pa_sink_process_input_underruns() calls itself with the
+origin sink, which is only correct for filter sinks because they run in the
+thread context of the origin sink. The combine sink however has its own
+thread context, so pa_sink_process_input_underruns() was executed in the
+wrong context.
+This patch fixes the issue by skipping the section for module-combine-sink.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/722>
+---
+ src/pulsecore/sink.c | 37 +++++++++++++++++++++++--------------
+ 1 file changed, 23 insertions(+), 14 deletions(-)
+
+diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
+index 3108ae765..0f0dc56fc 100644
+--- a/src/pulsecore/sink.c
++++ b/src/pulsecore/sink.c
+@@ -1016,20 +1016,29 @@ size_t pa_sink_process_input_underruns(pa_sink *s, size_t left_to_play) {
+ if (i->origin_sink) {
+ size_t filter_result, left_to_play_origin;
+
+- /* The recursive call works in the origin sink domain ... */
+- left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
+-
+- /* .. and returns the time to sleep before waking up. We need the
+- * underrun duration for comparisons, so we undo the subtraction on
+- * the return value... */
+- filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
+-
+- /* ... and convert it back to the master sink domain */
+- filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
+-
+- /* Remember the longest underrun so far */
+- if (filter_result > result)
+- result = filter_result;
++ /* The combine sink sets i->origin sink but has a different threading model
++ * than the filter sinks. Therefore the recursion below may not be executed
++ * because pa_sink_process_input_underruns() was not called in the thread
++ * context of the origin sink.
++ * FIXME: It is unclear if some other kind of recursion would be necessary
++ * for the combine sink. */
++ if (!i->module || !pa_safe_streq(i->module->name, "module-combine-sink")) {
++
++ /* The recursive call works in the origin sink domain ... */
++ left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
++
++ /* .. and returns the time to sleep before waking up. We need the
++ * underrun duration for comparisons, so we undo the subtraction on
++ * the return value... */
++ filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
++
++ /* ... and convert it back to the master sink domain */
++ filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
++
++ /* Remember the longest underrun so far */
++ if (filter_result > result)
++ result = filter_result;
++ }
+ }
+
+ if (uf == 0) {
+--
+GitLab
+
diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
new file mode 100644
index 000000000000..a2efaf37b381
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
@@ -0,0 +1,43 @@
+https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dd4dc5e8bce2c03631c3613dbddee1a691bdd17d
+
+From dd4dc5e8bce2c03631c3613dbddee1a691bdd17d Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@fastmail.com>
+Date: Fri, 17 Jun 2022 14:36:36 +0200
+Subject: [PATCH] bluetooth/gst: Correct var type for GST_TYPE_BITMASK
+
+GST_TYPE_BITMASK is 64-bit bit mask while corresponding channel_mask in
+pulseaudio is int therefore usually 32-bit. Switch to uint64_t instead
+to match internal representation in gstreamer.
+
+Fixes pulseaudio crash on ARM 32-bit when pulseaudio is compiled with
+gstreamer and either LDAC or aptX support is available.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/723>
+---
+ src/modules/bluetooth/a2dp-codec-gst.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/modules/bluetooth/a2dp-codec-gst.c b/src/modules/bluetooth/a2dp-codec-gst.c
+index 8ef74be9c..11839c580 100644
+--- a/src/modules/bluetooth/a2dp-codec-gst.c
++++ b/src/modules/bluetooth/a2dp-codec-gst.c
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <arpa/inet.h>
++#include <stdint.h>
+
+ #include <pulsecore/log.h>
+ #include <pulsecore/macro.h>
+@@ -82,7 +83,7 @@ fail:
+ static GstCaps *gst_create_caps_from_sample_spec(const pa_sample_spec *ss) {
+ gchar *sample_format;
+ GstCaps *caps;
+- int channel_mask;
++ uint64_t channel_mask;
+
+ switch (ss->format) {
+ case PA_SAMPLE_S16LE:
+--
+GitLab
+
diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
new file mode 100644
index 000000000000..f9c044dbb2be
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
@@ -0,0 +1,42 @@
+https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/a8a2a31408c4acf54530d65922d235d3e590ce05
+
+From a8a2a31408c4acf54530d65922d235d3e590ce05 Mon Sep 17 00:00:00 2001
+From: Jaechul Lee <jcsing.lee@samsung.com>
+Date: Thu, 2 Jun 2022 15:07:09 +0900
+Subject: [PATCH] sound-file-stream: Fix crash when playing a file which is not
+ aligned
+
+pulseaudio crash occurred when I play a file using pacmd play-file command.
+The file is not aligned with its frame size and the last rendering size
+is also not aligned. Thus, an assertion was generated at the end of the
+file as the following.
+
+memblockq.c: Assertion 'uchunk->length % bq->base == 0' failed at
+../src/pulsecore/memblockq.c:288, function pa_memblockq_push(). Aborting.
+
+When I play the file using paplay, it works good. So, I changed to
+pa_memblockq_push_align instead of pa_memblockq_push to prevent the
+assertion.
+
+Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/717>
+---
+ src/pulsecore/sound-file-stream.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
+index 147aa2288..255f4b61a 100644
+--- a/src/pulsecore/sound-file-stream.c
++++ b/src/pulsecore/sound-file-stream.c
+@@ -185,7 +185,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
+
+ tchunk.length = (size_t) n * fs;
+
+- pa_memblockq_push(u->memblockq, &tchunk);
++ pa_memblockq_push_align(u->memblockq, &tchunk);
+ pa_memblock_unref(tchunk.memblock);
+ }
+
+--
+GitLab
+
diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
new file mode 100644
index 000000000000..3d72b9a009c4
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
@@ -0,0 +1,26 @@
+commit d7a633df899dda8738a30df318269e28c902e815
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date: Mon Jun 13 21:38:08 2022 +0300
+
+ rtp: Initialize SDP info struct field added for OPUS
+
+ Turned out that pa_sdp_info::enable_opus is never initialized, which seldom
+ makes module-rtp-recv believe it will be playing OPUS-encoded stream even though
+ discovered SDP record does not indicate OPUS codec in metadata.
+
+ Fix this by adding missing initializer.
+
+ Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/720>
+
+diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
+index 4e6a442f8..bf131a27e 100644
+--- a/src/modules/rtp/sdp.c
++++ b/src/modules/rtp/sdp.c
+@@ -129,6 +129,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
+ i->origin = i->session_name = NULL;
+ i->salen = 0;
+ i->payload = 255;
++ i->enable_opus = false;
+
+ if (pa_startswith(t, PA_SDP_HEADER)) {
+ t += sizeof(PA_SDP_HEADER) - 1;
diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch
new file mode 100644
index 000000000000..4ffdb82f4901
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch
@@ -0,0 +1,76 @@
+commit 823e46fba0742605f557b68cd591f61624b93966
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date: Sun Jun 12 21:49:32 2022 +0300
+
+ build-sys: meson: Make module-console-kit optional
+
+ Default build configuration would fail to run on a system without systemd-logind
+ (or elogind) and without ConsoleKit daemon responding on dbus interface. Here,
+ module-console-kit would fail to initialize, preventing daemon from starting.
+
+ Make module-console-kit an optional build feature to allow opt-out.
+
+ Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/719>
+
+diff --git a/meson.build b/meson.build
+index d4cdbd6a5..c6db7e670 100644
+--- a/meson.build
++++ b/meson.build
+@@ -732,6 +732,10 @@ if get_option('daemon')
+ cdata.set('HAVE_SYSTEMD_LOGIN', 1)
+ endif
+
++ if get_option('consolekit').enabled()
++ assert(dbus_dep.found(), 'ConsoleKit requires D-Bus support')
++ endif
++
+ tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
+ if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
+ cdata.set('HAVE_LIBWRAP', 1)
+@@ -1001,6 +1005,7 @@ summary += [
+ ' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')),
+ 'Enable systemd units: @0@'.format(systemd_dep.found()),
+ 'Enable elogind: @0@'.format(libelogind_dep.found()),
++ 'Enable ConsoleKit: @0@'.format(not get_option('consolekit').disabled() and dbus_dep.found()),
+ 'Enable TCP Wrappers: @0@'.format(tcpwrap_dep.found()),
+ 'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
+ 'Database: @0@'.format(get_option('database')),
+diff --git a/meson_options.txt b/meson_options.txt
+index b23210072..e7160a3a7 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -99,6 +99,9 @@ option('bluez5-native-headset',
+ option('bluez5-ofono-headset',
+ type : 'boolean',
+ description : 'Optional oFono headset backend support (BlueZ 5)')
++option('consolekit',
++ type : 'feature', value : 'auto',
++ description : 'Optional ConsoleKit support')
+ option('dbus',
+ type : 'feature', value : 'auto',
+ description : 'Optional D-Bus support')
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index cdf372c8e..1d8004300 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -130,7 +130,6 @@ endif
+
+ if dbus_dep.found()
+ all_modules += [
+- [ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
+ [ 'module-dbus-protocol',
+ [ 'dbus/iface-card.c', 'dbus/iface-card.h',
+ 'dbus/iface-card-profile.c', 'dbus/iface-card-profile.h',
+@@ -147,6 +146,12 @@ if dbus_dep.found()
+ [], [], [dbus_dep] ],
+ [ 'module-rygel-media-server', 'module-rygel-media-server.c', [], [], [dbus_dep], libprotocol_http ],
+ ]
++
++ if not get_option('consolekit').disabled()
++ all_modules += [
++ [ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
++ ]
++ endif
+ endif
+
+ if fftw_dep.found()
diff --git a/media-sound/pulseaudio-daemon/metadata.xml b/media-sound/pulseaudio-daemon/metadata.xml
index 0a4437e23510..5d81f9170193 100644
--- a/media-sound/pulseaudio-daemon/metadata.xml
+++ b/media-sound/pulseaudio-daemon/metadata.xml
@@ -1,9 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>gnome@gentoo.org</email>
- <name>Gentoo GNOME Desktop</name>
+ <maintainer type="person" proxied="yes">
+ <email>igor.v.kovalenko@gmail.com</email>
+ <name>Igor V. Kovalenko</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>leio@gentoo.org</email>
+ <name>Mart Raudsepp</name>
</maintainer>
<use>
<flag name="X">
@@ -36,7 +44,10 @@
</flag>
<flag name="asyncns">Use libasyncns for asynchronous name resolution.</flag>
<flag name="equalizer">
- Enable the equalizer module (requires <pkg>sci-libs/fftw</pkg>).
+ Enable the equalizer module (requires <pkg>sci-libs/fftw</pkg> and <pkg>sys-apps/dbus</pkg>).
+ </flag>
+ <flag name="fftw">
+ Enable the virtual surround sink module (requires <pkg>sci-libs/fftw</pkg>).
</flag>
<flag name="ssl">
Use <pkg>dev-libs/openssl</pkg> to provide support for RAOP
@@ -56,15 +67,12 @@
Build with <pkg>sys-apps/systemd</pkg> support to replace standalone
ConsoleKit.
</flag>
- <flag name="native-headset">
- Build with native HSP backend for bluez 5.
- </flag>
+ <flag name="valgrind">Compile in valgrind memory hints</flag>
<flag name="ofono-headset">
- Build with oFono HFP backend for bluez 5, requires <pkg>net-misc/ofono</pkg>.
+ Build with optional oFono HFP backend for bluez 5, requires <pkg>net-misc/ofono</pkg>.
</flag>
<flag name="gstreamer">
- Build with support for gstreamer including ability to use bluetooth codecs.
- For bluetooth codecs see USE ldac and aptx.
+ Build GStreamer-based RTP protocol module which supports more advanced RTP features like OPUS payload encoding.
</flag>
<flag name="aptx">
aptX (HD) over Bluetooth (many Android compatible headphones), requires <pkg>media-plugins/gst-plugins-openaptx</pkg>.
diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.99.1-r2.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r1.ebuild
index 61a9f133cb5f..b6489354786a 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.99.1-r2.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r1.ebuild
@@ -16,7 +16,7 @@ if [[ ${PV} = 9999 ]]; then
EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
else
SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux"
fi
S="${WORKDIR}/${MY_P}"
@@ -32,8 +32,8 @@ SLOT="0"
# +alsa-plugin as discussed in bug #519530
# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
-IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer +gdbm gstreamer +glib gtk ipv6 jack ldac lirc
-native-headset ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev +webrtc-aec +X zeroconf"
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer gtk ipv6 jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
RESTRICT="!test? ( test )"
@@ -41,11 +41,12 @@ RESTRICT="!test? ( test )"
# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
REQUIRED_USE="
+ ?? ( elogind systemd )
alsa-plugin? ( alsa )
+ aptx? ( bluetooth )
bluetooth? ( dbus )
- ?? ( elogind systemd )
equalizer? ( dbus )
- native-headset? ( bluetooth )
+ ldac? ( bluetooth )
ofono-headset? ( bluetooth )
udev? ( || ( alsa oss ) )
zeroconf? ( dbus )
@@ -55,8 +56,12 @@ REQUIRED_USE="
# - libpcre needed in some cases, bug #472228
# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+ media-libs/gst-plugins-base
+ >=media-libs/gstreamer-1.14
+"
COMMON_DEPEND="
- >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,tcpd?,X?]
+ >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,tcpd(+)?,valgrind?,X?]
dev-libs/libatomic_ops
>=media-libs/libsndfile-1.0.20
>=media-libs/speexdsp-1.2
@@ -65,6 +70,7 @@ COMMON_DEPEND="
dev-libs/libpcre:3
)
alsa? ( >=media-libs/alsa-lib-1.0.24 )
+ aptx? ( ${gstreamer_deps} )
asyncns? ( >=net-libs/libasyncns-0.1 )
bluetooth? (
>=net-wireless/bluez-5
@@ -76,16 +82,17 @@ COMMON_DEPEND="
dbus? ( >=sys-apps/dbus-1.4.12 )
elogind? ( sys-auth/elogind )
equalizer? (
- sci-libs/fftw:3.0
+ sci-libs/fftw:3.0=
+ )
+ fftw? (
+ sci-libs/fftw:3.0=
)
gdbm? ( sys-libs/gdbm:= )
glib? ( >=dev-libs/glib-2.28.0:2 )
- gstreamer? (
- media-libs/gst-plugins-base
- >=media-libs/gstreamer-1.14
- )
+ gstreamer? ( ${gstreamer_deps} )
gtk? ( x11-libs/gtk+:3 )
jack? ( virtual/jack )
+ ldac? ( ${gstreamer_deps} )
lirc? ( app-misc/lirc )
ofono-headset? ( >=net-misc/ofono-1.13 )
orc? ( >=dev-lang/orc-0.4.15 )
@@ -95,6 +102,7 @@ COMMON_DEPEND="
systemd? ( sys-apps/systemd:= )
tcpd? ( sys-apps/tcp-wrappers )
udev? ( >=virtual/udev-143[hwdb(+)] )
+ valgrind? ( dev-util/valgrind )
webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
X? (
>=x11-libs/libxcb-1.6
@@ -125,12 +133,11 @@ RDEPEND="
acct-group/pulse-access
)
bluetooth? (
- gstreamer? (
- ldac? ( media-plugins/gst-plugins-ldac )
- aptx? ( media-plugins/gst-plugins-openaptx )
- )
+ ldac? ( media-plugins/gst-plugins-ldac )
+ aptx? ( media-plugins/gst-plugins-openaptx )
)
"
+unset gstreamer_deps
# This is a PDEPEND to avoid a circular dep
PDEPEND="
@@ -163,6 +170,16 @@ src_prepare() {
}
src_configure() {
+ local enable_bluez5_gstreamer="disabled"
+ if use aptx || use ldac ; then
+ enable_bluez5_gstreamer="enabled"
+ fi
+
+ local enable_fftw="disabled"
+ if use equalizer || use fftw ; then
+ enable_fftw="enabled"
+ fi
+
local emesonargs=(
--localstatedir="${EPREFIX}"/var
@@ -188,12 +205,12 @@ src_configure() {
$(meson_feature asyncns)
$(meson_feature zeroconf avahi)
$(meson_feature bluetooth bluez5)
- $(meson_feature gstreamer bluez5-gstreamer)
- $(meson_use native-headset bluez5-native-headset)
+ -Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+ $(meson_use bluetooth bluez5-native-headset)
$(meson_use ofono-headset bluez5-ofono-headset)
$(meson_feature dbus)
$(meson_feature elogind)
- $(meson_feature equalizer fftw)
+ -Dfftw=${enable_fftw}
$(meson_feature glib) # WARNING: toggling this likely changes ABI
$(meson_feature glib gsettings) # Supposedly correct?
$(meson_feature gstreamer)
@@ -211,7 +228,7 @@ src_configure() {
$(meson_feature systemd)
$(meson_feature tcpd tcpwrap) # TODO: This should technically be enabled for 32bit too, but at runtime it probably is never used without daemon?
$(meson_feature udev)
- -Dvalgrind=auto
+ $(meson_feature valgrind)
$(meson_feature X x11)
# Echo cancellation
@@ -311,17 +328,46 @@ pkg_postinst() {
elog ""
fi
- if use native-headset && use ofono-headset; then
+ if use bluetooth; then
+ elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+ elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+ elog "native headset backend by default. This can be selectively disabled"
+ elog "via runtime configuration arguments to module-bluetooth-discover"
+ elog "in /etc/pulse/default.pa"
+ elog "To disable HFP HF append enable_native_hfp_hf=false"
+ elog "To disable HSP HS append enable_native_hsp_hs=false"
+ elog "To disable HSP AG append headset=auto or headset=ofono"
+ elog "(note this does NOT require enabling USE ofono)"
+ elog ""
+ fi
+
+ if use ofono-headset; then
elog "You have enabled both native and ofono headset profiles. The runtime decision"
elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
elog ""
fi
+ if use gstreamer; then
+ elog "GStreamer-based RTP implementation modile enabled."
+ elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+ elog "and add enable_opus=1 argument to module-rtp-send"
+ elog ""
+ fi
+
if use systemd; then
+ elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
elog "It's recommended to start pulseaudio via its systemd user units:"
elog ""
elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
elog ""
+ elog "Root user can change system default configuration for all users:"
+ elog ""
+ elog " systemctl --global enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+ elog ""
+ elog " autospawn = yes"
+ elog ""
elog "The change from autospawn to user units will take effect after restarting."
elog ""
fi
@@ -333,4 +379,5 @@ pkg_postinst() {
pkg_postrm() {
gnome2_schemas_update
+ use udev && udev_reload
}
diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild
new file mode 100644
index 000000000000..3ec78e0ac672
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild
@@ -0,0 +1,388 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="A networked sound server with an advanced plugin system"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+ inherit git-r3
+ EGIT_BRANCH="master"
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+ SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+ ?? ( elogind systemd )
+ alsa-plugin? ( alsa )
+ aptx? ( bluetooth )
+ bluetooth? ( dbus )
+ equalizer? ( dbus )
+ ldac? ( bluetooth )
+ ofono-headset? ( bluetooth )
+ udev? ( || ( alsa oss ) )
+ zeroconf? ( dbus )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+ media-libs/gst-plugins-base
+ >=media-libs/gstreamer-1.14
+"
+COMMON_DEPEND="
+ >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
+ dev-libs/libatomic_ops
+ >=media-libs/libsndfile-1.0.20
+ >=media-libs/speexdsp-1.2
+ || (
+ elibc_glibc? ( virtual/libc )
+ dev-libs/libpcre:3
+ )
+ alsa? ( >=media-libs/alsa-lib-1.0.24 )
+ aptx? ( ${gstreamer_deps} )
+ asyncns? ( >=net-libs/libasyncns-0.1 )
+ bluetooth? (
+ >=net-wireless/bluez-5
+ media-libs/sbc
+ )
+ dev-libs/libltdl
+ sys-kernel/linux-headers
+ >=sys-libs/libcap-2.22-r2
+ dbus? ( >=sys-apps/dbus-1.4.12 )
+ elogind? ( sys-auth/elogind )
+ equalizer? (
+ sci-libs/fftw:3.0=
+ )
+ fftw? (
+ sci-libs/fftw:3.0=
+ )
+ gdbm? ( sys-libs/gdbm:= )
+ glib? ( >=dev-libs/glib-2.28.0:2 )
+ gstreamer? (
+ ${gstreamer_deps}
+ >=dev-libs/glib-2.26.0:2
+ )
+ jack? ( virtual/jack )
+ ldac? ( ${gstreamer_deps} )
+ lirc? ( app-misc/lirc )
+ ofono-headset? ( >=net-misc/ofono-1.13 )
+ orc? ( >=dev-lang/orc-0.4.15 )
+ selinux? ( sec-policy/selinux-pulseaudio )
+ sox? ( >=media-libs/soxr-0.1.1 )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd:= )
+ tcpd? ( sys-apps/tcp-wrappers )
+ udev? ( >=virtual/udev-143[hwdb(+)] )
+ valgrind? ( dev-util/valgrind )
+ webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+ X? (
+ >=x11-libs/libxcb-1.6
+ x11-libs/libICE
+ x11-libs/libSM
+ >=x11-libs/libX11-1.4.0
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+ !<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+ ${COMMON_DEPEND}
+ test? ( >=dev-libs/check-0.9.10 )
+ X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+ ${COMMON_DEPEND}
+ system-wide? (
+ alsa? ( media-sound/alsa-utils )
+ acct-user/pulse
+ acct-group/audio
+ acct-group/pulse-access
+ )
+ bluetooth? (
+ ldac? ( media-plugins/gst-plugins-ldac )
+ aptx? ( media-plugins/gst-plugins-openaptx )
+ )
+"
+unset gstreamer_deps
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+ alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+BDEPEND="
+ dev-lang/perl
+ dev-perl/XML-Parser
+ sys-devel/gettext
+ virtual/libiconv
+ virtual/libintl
+ virtual/pkgconfig
+ orc? ( >=dev-lang/orc-0.4.15 )
+ system-wide? ( dev-util/unifdef )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+# patches merged upstream, to be removed with 16.1 or later bump
+PATCHES=(
+ "${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
+ "${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
+)
+
+src_prepare() {
+ default
+
+ gnome2_environment_reset
+}
+
+src_configure() {
+ local enable_bluez5_gstreamer="disabled"
+ if use aptx || use ldac ; then
+ enable_bluez5_gstreamer="enabled"
+ fi
+
+ local enable_fftw="disabled"
+ if use equalizer || use fftw ; then
+ enable_fftw="enabled"
+ fi
+
+ local emesonargs=(
+ --localstatedir="${EPREFIX}"/var
+
+ -Ddaemon=true
+ -Dclient=false
+ -Ddoxygen=false
+ -Dgcov=false
+ -Dman=true
+ # tests involve random modules, so just do them for the native # TODO: tests should run always
+ $(meson_use test tests)
+ -Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+ -Dstream-restore-clear-old-devices=true
+ -Drunning-from-build-tree=false
+
+ # Paths
+ -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+ -Dsystemduserunitdir=$(systemd_get_userunitdir)
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+ # Optional features
+ $(meson_feature alsa)
+ $(meson_feature asyncns)
+ $(meson_feature zeroconf avahi)
+ $(meson_feature bluetooth bluez5)
+ -Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+ $(meson_use bluetooth bluez5-native-headset)
+ $(meson_use ofono-headset bluez5-ofono-headset)
+ -Dconsolekit=disabled
+ $(meson_feature dbus)
+ $(meson_feature elogind)
+ -Dfftw=${enable_fftw}
+ $(meson_feature glib) # WARNING: toggling this likely changes ABI
+ $(meson_feature glib gsettings) # Supposedly correct?
+ $(meson_feature gstreamer)
+ -Dgtk=disabled
+ -Dhal-compat=false
+ -Dipv6=true
+ $(meson_feature jack)
+ $(meson_feature lirc)
+ $(meson_feature ssl openssl)
+ $(meson_feature orc)
+ $(meson_feature oss oss-output)
+ -Dsamplerate=disabled # Matches upstream
+ $(meson_feature sox soxr)
+ -Dspeex=enabled
+ $(meson_feature systemd)
+ $(meson_feature tcpd tcpwrap)
+ $(meson_feature udev)
+ $(meson_feature valgrind)
+ $(meson_feature X x11)
+
+ # Echo cancellation
+ -Dadrian-aec=false # Not packaged?
+ $(meson_feature webrtc-aec)
+ )
+
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+
+ # Upstream installs 'pactl' if client is built, with all symlinks except for
+ # 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+ # This trips QA warning, workaround:
+ # - install missing aliases in media-libs/libpulse (client build)
+ # - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+ rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+ rm "${D}/$(get_bashcompdir)"/pacmd || die
+ rm "${D}/$(get_bashcompdir)"/pasuspender || die
+
+ if use system-wide; then
+ newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+ use_define() {
+ local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+ use "${1}" && echo "-D${define}" || echo "-U${define}"
+ }
+
+ unifdef -x 1 \
+ $(use_define zeroconf AVAHI) \
+ $(use_define alsa) \
+ $(use_define bluetooth) \
+ $(use_define udev) \
+ "${FILESDIR}"/pulseaudio.init.d-5 \
+ > "${T}"/pulseaudio \
+ || die
+
+ doinitd "${T}"/pulseaudio
+
+ systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+ # We need /var/run/pulse, bug 442852
+ newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+ else
+ # Prevent warnings when system-wide is not used, bug 447694
+ if use dbus; then
+ rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+ fi
+ fi
+
+ if use zeroconf; then
+ sed -i \
+ -e '/module-zeroconf-publish/s:^#::' \
+ "${ED}/etc/pulse/default.pa" \
+ || die
+ fi
+
+ # Only enable autospawning pulseaudio daemon on systems without systemd
+ if ! use systemd; then
+ insinto /etc/pulse/client.conf.d
+ newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
+ fi
+
+ find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+ gnome2_schemas_update
+
+ use udev && udev_reload
+
+ if use system-wide; then
+ tmpfiles_process "pulseaudio.conf"
+
+ elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+ elog "This mode should only be used on headless servers, embedded systems,"
+ elog "or thin clients. It will usually require manual configuration, and is"
+ elog "incompatible with many expected pulseaudio features."
+ elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+ elog ""
+ elog "For more information, see"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+ elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+ elog ""
+ fi
+
+ if use equalizer; then
+ elog "You will need to load some extra modules to make qpaeq work."
+ elog "You can do that by adding the following two lines in"
+ elog "/etc/pulse/default.pa and restarting pulseaudio:"
+ elog "load-module module-equalizer-sink"
+ elog "load-module module-dbus-protocol"
+ elog ""
+ fi
+
+ if use bluetooth; then
+ elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+ elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+ elog "native headset backend by default. This can be selectively disabled"
+ elog "via runtime configuration arguments to module-bluetooth-discover"
+ elog "in /etc/pulse/default.pa"
+ elog "To disable HFP HF append enable_native_hfp_hf=false"
+ elog "To disable HSP HS append enable_native_hsp_hs=false"
+ elog "To disable HSP AG append headset=auto or headset=ofono"
+ elog "(note this does NOT require enabling USE ofono)"
+ elog ""
+ fi
+
+ if use ofono-headset; then
+ elog "You have enabled both native and ofono headset profiles. The runtime decision"
+ elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+ elog ""
+ fi
+
+ if use gstreamer; then
+ elog "GStreamer-based RTP implementation modile enabled."
+ elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+ elog "and add enable_opus=1 argument to module-rtp-send"
+ elog ""
+ fi
+
+ if use systemd; then
+ elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
+ elog "It's recommended to start pulseaudio via its systemd user units:"
+ elog ""
+ elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "Root user can change system default configuration for all users:"
+ elog ""
+ elog " systemctl --global enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+ elog ""
+ elog " autospawn = yes"
+ elog ""
+ elog "The change from autospawn to user units will take effect after restarting."
+ elog ""
+ fi
+
+ optfeature_header "PulseAudio can be enhanced by installing the following:"
+ use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+ use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+ gnome2_schemas_update
+ use udev && udev_reload
+}
diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
new file mode 100644
index 000000000000..f9980628eb08
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
@@ -0,0 +1,396 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="Daemon component of PulseAudio (networked sound server)"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+ inherit git-r3
+ EGIT_BRANCH="master"
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+ SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+ ?? ( elogind systemd )
+ alsa-plugin? ( alsa )
+ aptx? ( bluetooth )
+ bluetooth? ( dbus )
+ equalizer? ( dbus )
+ ldac? ( bluetooth )
+ ofono-headset? ( bluetooth )
+ udev? ( || ( alsa oss ) )
+ zeroconf? ( dbus )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+ media-libs/gst-plugins-base
+ >=media-libs/gstreamer-1.14
+"
+COMMON_DEPEND="
+ >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
+ dev-libs/libatomic_ops
+ >=media-libs/libsndfile-1.0.20
+ >=media-libs/speexdsp-1.2
+ || (
+ elibc_glibc? ( virtual/libc )
+ dev-libs/libpcre:3
+ )
+ alsa? ( >=media-libs/alsa-lib-1.0.24 )
+ aptx? ( ${gstreamer_deps} )
+ asyncns? ( >=net-libs/libasyncns-0.1 )
+ bluetooth? (
+ >=net-wireless/bluez-5
+ media-libs/sbc
+ )
+ dev-libs/libltdl
+ sys-kernel/linux-headers
+ >=sys-libs/libcap-2.22-r2
+ dbus? ( >=sys-apps/dbus-1.4.12 )
+ elogind? ( sys-auth/elogind )
+ equalizer? (
+ sci-libs/fftw:3.0=
+ )
+ fftw? (
+ sci-libs/fftw:3.0=
+ )
+ gdbm? ( sys-libs/gdbm:= )
+ glib? ( >=dev-libs/glib-2.28.0:2 )
+ gstreamer? (
+ ${gstreamer_deps}
+ >=dev-libs/glib-2.26.0:2
+ )
+ jack? ( virtual/jack )
+ ldac? ( ${gstreamer_deps} )
+ lirc? ( app-misc/lirc )
+ ofono-headset? ( >=net-misc/ofono-1.13 )
+ orc? ( >=dev-lang/orc-0.4.15 )
+ selinux? ( sec-policy/selinux-pulseaudio )
+ sox? ( >=media-libs/soxr-0.1.1 )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd:= )
+ tcpd? ( sys-apps/tcp-wrappers )
+ udev? ( >=virtual/udev-143[hwdb(+)] )
+ valgrind? ( dev-util/valgrind )
+ webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+ X? (
+ >=x11-libs/libxcb-1.6
+ x11-libs/libICE
+ x11-libs/libSM
+ >=x11-libs/libX11-1.4.0
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+ !<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+ ${COMMON_DEPEND}
+ test? ( >=dev-libs/check-0.9.10 )
+ X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+ ${COMMON_DEPEND}
+ system-wide? (
+ alsa? ( media-sound/alsa-utils )
+ acct-user/pulse
+ acct-group/audio
+ acct-group/pulse-access
+ )
+ bluetooth? (
+ ldac? ( media-plugins/gst-plugins-ldac )
+ aptx? ( media-plugins/gst-plugins-openaptx )
+ )
+"
+unset gstreamer_deps
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+ alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+BDEPEND="
+ dev-lang/perl
+ dev-perl/XML-Parser
+ sys-devel/gettext
+ virtual/libiconv
+ virtual/libintl
+ virtual/pkgconfig
+ orc? ( >=dev-lang/orc-0.4.15 )
+ system-wide? ( dev-util/unifdef )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+# patches merged upstream, to be removed with 16.1 or later bump
+PATCHES=(
+ "${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
+ "${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
+ "${FILESDIR}"/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
+ "${FILESDIR}"/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
+ "${FILESDIR}"/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
+)
+
+src_prepare() {
+ default
+
+ gnome2_environment_reset
+}
+
+src_configure() {
+ local enable_bluez5_gstreamer="disabled"
+ if use aptx || use ldac ; then
+ enable_bluez5_gstreamer="enabled"
+ fi
+
+ local enable_fftw="disabled"
+ if use equalizer || use fftw ; then
+ enable_fftw="enabled"
+ fi
+
+ local emesonargs=(
+ --localstatedir="${EPREFIX}"/var
+
+ -Ddaemon=true
+ -Dclient=false
+ -Ddoxygen=false
+ -Dgcov=false
+ -Dman=true
+ # tests involve random modules, so just do them for the native # TODO: tests should run always
+ $(meson_use test tests)
+ -Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+ -Dstream-restore-clear-old-devices=true
+ -Drunning-from-build-tree=false
+
+ # Paths
+ -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+ -Dsystemduserunitdir=$(systemd_get_userunitdir)
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+ # Optional features
+ $(meson_feature alsa)
+ $(meson_feature asyncns)
+ $(meson_feature zeroconf avahi)
+ $(meson_feature bluetooth bluez5)
+ -Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+ $(meson_use bluetooth bluez5-native-headset)
+ $(meson_use ofono-headset bluez5-ofono-headset)
+ -Dconsolekit=disabled
+ $(meson_feature dbus)
+ $(meson_feature elogind)
+ -Dfftw=${enable_fftw}
+ $(meson_feature glib) # WARNING: toggling this likely changes ABI
+ $(meson_feature glib gsettings) # Supposedly correct?
+ $(meson_feature gstreamer)
+ -Dgtk=disabled
+ -Dhal-compat=false
+ -Dipv6=true
+ $(meson_feature jack)
+ $(meson_feature lirc)
+ $(meson_feature ssl openssl)
+ $(meson_feature orc)
+ $(meson_feature oss oss-output)
+ -Dsamplerate=disabled # Matches upstream
+ $(meson_feature sox soxr)
+ -Dspeex=enabled
+ $(meson_feature systemd)
+ $(meson_feature tcpd tcpwrap)
+ $(meson_feature udev)
+ $(meson_feature valgrind)
+ $(meson_feature X x11)
+
+ # Echo cancellation
+ -Dadrian-aec=false # Not packaged?
+ $(meson_feature webrtc-aec)
+ )
+
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+
+ # Upstream installs 'pactl' if client is built, with all symlinks except for
+ # 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+ # This trips QA warning, workaround:
+ # - install missing aliases in media-libs/libpulse (client build)
+ # - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+ rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+ rm "${D}/$(get_bashcompdir)"/pacmd || die
+ rm "${D}/$(get_bashcompdir)"/pasuspender || die
+
+ # Daemon configuration scripts will try to load snippets from corresponding '.d' dirs.
+ # Install these dirs to silence a warning if they are missing.
+ keepdir /etc/pulse/default.pa.d
+ keepdir /etc/pulse/system.pa.d
+
+ if use system-wide; then
+ newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+ use_define() {
+ local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+ use "${1}" && echo "-D${define}" || echo "-U${define}"
+ }
+
+ unifdef -x 1 \
+ $(use_define zeroconf AVAHI) \
+ $(use_define alsa) \
+ $(use_define bluetooth) \
+ $(use_define udev) \
+ "${FILESDIR}"/pulseaudio.init.d-5 \
+ > "${T}"/pulseaudio \
+ || die
+
+ doinitd "${T}"/pulseaudio
+
+ systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+ # We need /var/run/pulse, bug 442852
+ newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+ else
+ # Prevent warnings when system-wide is not used, bug 447694
+ if use dbus; then
+ rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+ fi
+ fi
+
+ if use zeroconf; then
+ sed -i \
+ -e '/module-zeroconf-publish/s:^#::' \
+ "${ED}/etc/pulse/default.pa" \
+ || die
+ fi
+
+ # Only enable autospawning pulseaudio daemon on systems without systemd
+ if ! use systemd; then
+ insinto /etc/pulse/client.conf.d
+ newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
+ fi
+
+ find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+ gnome2_schemas_update
+
+ use udev && udev_reload
+
+ if use system-wide; then
+ tmpfiles_process "pulseaudio.conf"
+
+ elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+ elog "This mode should only be used on headless servers, embedded systems,"
+ elog "or thin clients. It will usually require manual configuration, and is"
+ elog "incompatible with many expected pulseaudio features."
+ elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+ elog ""
+ elog "For more information, see"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+ elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+ elog ""
+ fi
+
+ if use equalizer; then
+ elog "You will need to load some extra modules to make qpaeq work."
+ elog "You can do that by adding the following two lines in"
+ elog "/etc/pulse/default.pa and restarting pulseaudio:"
+ elog "load-module module-equalizer-sink"
+ elog "load-module module-dbus-protocol"
+ elog ""
+ fi
+
+ if use bluetooth; then
+ elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+ elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+ elog "native headset backend by default. This can be selectively disabled"
+ elog "via runtime configuration arguments to module-bluetooth-discover"
+ elog "in /etc/pulse/default.pa"
+ elog "To disable HFP HF append enable_native_hfp_hf=false"
+ elog "To disable HSP HS append enable_native_hsp_hs=false"
+ elog "To disable HSP AG append headset=auto or headset=ofono"
+ elog "(note this does NOT require enabling USE ofono)"
+ elog ""
+ fi
+
+ if use ofono-headset; then
+ elog "You have enabled both native and ofono headset profiles. The runtime decision"
+ elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+ elog ""
+ fi
+
+ if use gstreamer; then
+ elog "GStreamer-based RTP implementation modile enabled."
+ elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+ elog "and add enable_opus=1 argument to module-rtp-send"
+ elog ""
+ fi
+
+ if use systemd; then
+ elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
+ elog "It's recommended to start pulseaudio via its systemd user units:"
+ elog ""
+ elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "Root user can change system default configuration for all users:"
+ elog ""
+ elog " systemctl --global enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+ elog ""
+ elog " autospawn = yes"
+ elog ""
+ elog "The change from autospawn to user units will take effect after restarting."
+ elog ""
+ fi
+
+ optfeature_header "PulseAudio can be enhanced by installing the following:"
+ use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+ use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+ gnome2_schemas_update
+ use udev && udev_reload
+}
diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1.ebuild
new file mode 100644
index 000000000000..eddb6f54e7b5
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1.ebuild
@@ -0,0 +1,392 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="Daemon component of PulseAudio (networked sound server)"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+ inherit git-r3
+ EGIT_BRANCH="master"
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+ SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+ ?? ( elogind systemd )
+ alsa-plugin? ( alsa )
+ aptx? ( bluetooth )
+ bluetooth? ( dbus )
+ equalizer? ( dbus )
+ ldac? ( bluetooth )
+ ofono-headset? ( bluetooth )
+ udev? ( || ( alsa oss ) )
+ zeroconf? ( dbus )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+ media-libs/gst-plugins-base
+ >=media-libs/gstreamer-1.14
+"
+COMMON_DEPEND="
+ >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
+ dev-libs/libatomic_ops
+ >=media-libs/libsndfile-1.0.20
+ >=media-libs/speexdsp-1.2
+ || (
+ elibc_glibc? ( virtual/libc )
+ dev-libs/libpcre:3
+ )
+ alsa? ( >=media-libs/alsa-lib-1.0.24 )
+ aptx? ( ${gstreamer_deps} )
+ asyncns? ( >=net-libs/libasyncns-0.1 )
+ bluetooth? (
+ >=net-wireless/bluez-5
+ media-libs/sbc
+ )
+ dev-libs/libltdl
+ sys-kernel/linux-headers
+ >=sys-libs/libcap-2.22-r2
+ dbus? ( >=sys-apps/dbus-1.4.12 )
+ elogind? ( sys-auth/elogind )
+ equalizer? (
+ sci-libs/fftw:3.0=
+ )
+ fftw? (
+ sci-libs/fftw:3.0=
+ )
+ gdbm? ( sys-libs/gdbm:= )
+ glib? ( >=dev-libs/glib-2.28.0:2 )
+ gstreamer? (
+ ${gstreamer_deps}
+ >=dev-libs/glib-2.26.0:2
+ )
+ jack? ( virtual/jack )
+ ldac? ( ${gstreamer_deps} )
+ lirc? ( app-misc/lirc )
+ ofono-headset? ( >=net-misc/ofono-1.13 )
+ orc? ( >=dev-lang/orc-0.4.15 )
+ selinux? ( sec-policy/selinux-pulseaudio )
+ sox? ( >=media-libs/soxr-0.1.1 )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd:= )
+ tcpd? ( sys-apps/tcp-wrappers )
+ udev? ( >=virtual/udev-143[hwdb(+)] )
+ valgrind? ( dev-util/valgrind )
+ webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+ X? (
+ >=x11-libs/libxcb-1.6
+ x11-libs/libICE
+ x11-libs/libSM
+ >=x11-libs/libX11-1.4.0
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+ !<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+ ${COMMON_DEPEND}
+ test? ( >=dev-libs/check-0.9.10 )
+ X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+ ${COMMON_DEPEND}
+ system-wide? (
+ alsa? ( media-sound/alsa-utils )
+ acct-user/pulse
+ acct-group/audio
+ acct-group/pulse-access
+ )
+ bluetooth? (
+ ldac? ( media-plugins/gst-plugins-ldac )
+ aptx? ( media-plugins/gst-plugins-openaptx )
+ )
+"
+unset gstreamer_deps
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+ alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+BDEPEND="
+ dev-lang/perl
+ dev-perl/XML-Parser
+ sys-devel/gettext
+ virtual/libiconv
+ virtual/libintl
+ virtual/pkgconfig
+ orc? ( >=dev-lang/orc-0.4.15 )
+ system-wide? ( dev-util/unifdef )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+# patches merged upstream, to be removed with 16.2 or later bump
+PATCHES=(
+ "${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
+)
+
+src_prepare() {
+ default
+
+ gnome2_environment_reset
+}
+
+src_configure() {
+ local enable_bluez5_gstreamer="disabled"
+ if use aptx || use ldac ; then
+ enable_bluez5_gstreamer="enabled"
+ fi
+
+ local enable_fftw="disabled"
+ if use equalizer || use fftw ; then
+ enable_fftw="enabled"
+ fi
+
+ local emesonargs=(
+ --localstatedir="${EPREFIX}"/var
+
+ -Ddaemon=true
+ -Dclient=false
+ -Ddoxygen=false
+ -Dgcov=false
+ -Dman=true
+ # tests involve random modules, so just do them for the native # TODO: tests should run always
+ $(meson_use test tests)
+ -Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+ -Dstream-restore-clear-old-devices=true
+ -Drunning-from-build-tree=false
+
+ # Paths
+ -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+ -Dsystemduserunitdir=$(systemd_get_userunitdir)
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+ # Optional features
+ $(meson_feature alsa)
+ $(meson_feature asyncns)
+ $(meson_feature zeroconf avahi)
+ $(meson_feature bluetooth bluez5)
+ -Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+ $(meson_use bluetooth bluez5-native-headset)
+ $(meson_use ofono-headset bluez5-ofono-headset)
+ -Dconsolekit=disabled
+ $(meson_feature dbus)
+ $(meson_feature elogind)
+ -Dfftw=${enable_fftw}
+ $(meson_feature glib) # WARNING: toggling this likely changes ABI
+ $(meson_feature glib gsettings) # Supposedly correct?
+ $(meson_feature gstreamer)
+ -Dgtk=disabled
+ -Dhal-compat=false
+ -Dipv6=true
+ $(meson_feature jack)
+ $(meson_feature lirc)
+ $(meson_feature ssl openssl)
+ $(meson_feature orc)
+ $(meson_feature oss oss-output)
+ -Dsamplerate=disabled # Matches upstream
+ $(meson_feature sox soxr)
+ -Dspeex=enabled
+ $(meson_feature systemd)
+ $(meson_feature tcpd tcpwrap)
+ $(meson_feature udev)
+ $(meson_feature valgrind)
+ $(meson_feature X x11)
+
+ # Echo cancellation
+ -Dadrian-aec=false # Not packaged?
+ $(meson_feature webrtc-aec)
+ )
+
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+
+ # Upstream installs 'pactl' if client is built, with all symlinks except for
+ # 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+ # This trips QA warning, workaround:
+ # - install missing aliases in media-libs/libpulse (client build)
+ # - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+ rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+ rm "${D}/$(get_bashcompdir)"/pacmd || die
+ rm "${D}/$(get_bashcompdir)"/pasuspender || die
+
+ # Daemon configuration scripts will try to load snippets from corresponding '.d' dirs.
+ # Install these dirs to silence a warning if they are missing.
+ keepdir /etc/pulse/default.pa.d
+ keepdir /etc/pulse/system.pa.d
+
+ if use system-wide; then
+ newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+ use_define() {
+ local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+ use "${1}" && echo "-D${define}" || echo "-U${define}"
+ }
+
+ unifdef -x 1 \
+ $(use_define zeroconf AVAHI) \
+ $(use_define alsa) \
+ $(use_define bluetooth) \
+ $(use_define udev) \
+ "${FILESDIR}"/pulseaudio.init.d-5 \
+ > "${T}"/pulseaudio \
+ || die
+
+ doinitd "${T}"/pulseaudio
+
+ systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+ # We need /var/run/pulse, bug 442852
+ newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+ else
+ # Prevent warnings when system-wide is not used, bug 447694
+ if use dbus; then
+ rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+ fi
+ fi
+
+ if use zeroconf; then
+ sed -i \
+ -e '/module-zeroconf-publish/s:^#::' \
+ "${ED}/etc/pulse/default.pa" \
+ || die
+ fi
+
+ # Only enable autospawning pulseaudio daemon on systems without systemd
+ if ! use systemd; then
+ insinto /etc/pulse/client.conf.d
+ newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
+ fi
+
+ find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+ gnome2_schemas_update
+
+ use udev && udev_reload
+
+ if use system-wide; then
+ tmpfiles_process "pulseaudio.conf"
+
+ elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+ elog "This mode should only be used on headless servers, embedded systems,"
+ elog "or thin clients. It will usually require manual configuration, and is"
+ elog "incompatible with many expected pulseaudio features."
+ elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+ elog ""
+ elog "For more information, see"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+ elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+ elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+ elog ""
+ fi
+
+ if use equalizer; then
+ elog "You will need to load some extra modules to make qpaeq work."
+ elog "You can do that by adding the following two lines in"
+ elog "/etc/pulse/default.pa and restarting pulseaudio:"
+ elog "load-module module-equalizer-sink"
+ elog "load-module module-dbus-protocol"
+ elog ""
+ fi
+
+ if use bluetooth; then
+ elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+ elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+ elog "native headset backend by default. This can be selectively disabled"
+ elog "via runtime configuration arguments to module-bluetooth-discover"
+ elog "in /etc/pulse/default.pa"
+ elog "To disable HFP HF append enable_native_hfp_hf=false"
+ elog "To disable HSP HS append enable_native_hsp_hs=false"
+ elog "To disable HSP AG append headset=auto or headset=ofono"
+ elog "(note this does NOT require enabling USE ofono)"
+ elog ""
+ fi
+
+ if use ofono-headset; then
+ elog "You have enabled both native and ofono headset profiles. The runtime decision"
+ elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+ elog ""
+ fi
+
+ if use gstreamer; then
+ elog "GStreamer-based RTP implementation modile enabled."
+ elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+ elog "and add enable_opus=1 argument to module-rtp-send"
+ elog ""
+ fi
+
+ if use systemd; then
+ elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
+ elog "It's recommended to start pulseaudio via its systemd user units:"
+ elog ""
+ elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "Root user can change system default configuration for all users:"
+ elog ""
+ elog " systemctl --global enable pulseaudio.service pulseaudio.socket"
+ elog ""
+ elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+ elog ""
+ elog " autospawn = yes"
+ elog ""
+ elog "The change from autospawn to user units will take effect after restarting."
+ elog ""
+ fi
+
+ optfeature_header "PulseAudio can be enhanced by installing the following:"
+ use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+ use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+ gnome2_schemas_update
+ use udev && udev_reload
+}