summaryrefslogtreecommitdiff
path: root/media-video/pipewire
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /media-video/pipewire
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'media-video/pipewire')
-rw-r--r--media-video/pipewire/Manifest15
-rw-r--r--media-video/pipewire/files/pipewire-0.3.36-non-systemd-integration.patch19
-rw-r--r--media-video/pipewire/files/pipewire-0.3.47-pulse-server-pending-sample-reply-crash.patch101
-rw-r--r--media-video/pipewire/files/pipewire-0.3.47-revert-loop-remove-destroy-list-mpd.patch187
-rw-r--r--media-video/pipewire/metadata.xml1
-rw-r--r--media-video/pipewire/pipewire-0.3.45_p20220205.ebuild (renamed from media-video/pipewire/pipewire-0.3.42-r1.ebuild)64
-rw-r--r--media-video/pipewire/pipewire-0.3.47-r1.ebuild353
-rw-r--r--media-video/pipewire/pipewire-0.3.48-r1.ebuild352
-rw-r--r--media-video/pipewire/pipewire-9999.ebuild43
9 files changed, 1100 insertions, 35 deletions
diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest
index ea82d1c0ba25..ad9e2567d144 100644
--- a/media-video/pipewire/Manifest
+++ b/media-video/pipewire/Manifest
@@ -6,21 +6,26 @@ AUX pipewire-0.3.35-non-systemd-integration.patch 820 BLAKE2B bbde90ab174a0101f7
AUX pipewire-0.3.36-fix-crash-uaf-media-session.patch 1295 BLAKE2B 7c32a70c48e2cdcaab5cba0315845026ce4feadd2531724e92aa0932f20783253aa00ff4c6f96eeb6124f4ac6011c22afee07fd4cc22488c6ad4619655972155 SHA512 a46341fa86b61f0bf8b80736b411b870d7ac809d556358f4994aaa876a7827811073f99591fb1269ee70dc3b62157d2f1f3d4db63c1cd7729c9f160bf0e621a9
AUX pipewire-0.3.36-fix-version.patch 716 BLAKE2B c447bd11291f809b7607f4094f2d5e3497996a3834e5d5d468dcc63f0e36c117a31158634c08b8acc724f0ce5b599594b05f79ef3e3128ac28843cc08df03fed SHA512 74c757edf20c911df9299b4322486a34746eec8c4aa212441082f954cebe7c7d9c836a757dd134d71b3c31a97abe1494c13dc470495846ffaf52f943ec397532
AUX pipewire-0.3.36-missing-limits-include.patch 452 BLAKE2B b498e4ec11ab3d5bc4cebdd0975802b68594678aa928dc85b5a7031276af9ec12edb1423714e3e96c7d658e574c679efa9c18afbee1b47b15f3ce582bc021fff SHA512 decd44a59152e4fdc64b79c2e330a09ca9b8f776e72ef7a0150dfe43d9c25f4e501d41c86a445a979137c412dc85e1ffa38fed91f976596500d2a28010d78407
-AUX pipewire-0.3.36-non-systemd-integration.patch 911 BLAKE2B 6c6df1080821cefa1786da4db762a78011672226836525413d10fed3a18d43457277b6b868dfe0ee8e189143f76c971dd9c53809794864bcc642c804bf962ab8 SHA512 08b4998a3129f824c68310d2fc87245311e1d4b85a09a57f1d9bab76f990aa5d95686f22f3835a1072b7e6c0b6eb0246cc9c81884588f0146d26f9c215d9c565
AUX pipewire-0.3.43-systemd-user-unit-dir.patch 1310 BLAKE2B 7068220b1581b73c2c63adc698d09cf9da16d084d189cb9d3d8ecb7d7d79fa4c55548688e2e3718ca48e38388688ae96d340316df850b506bf079fe6c466c24e SHA512 033d1c54447466c18a921060d62f1b8e21221d324862cbf643a777fa2f7386543a51aaf7fdbeb2d698779d7a342eceda069f05d5cc07d8d8813b96ce35a1fdef
AUX pipewire-0.3.44-musl-build.patch 802 BLAKE2B 906313a422d477f28e69bec2fb2e931999e9875dd595c7c040bccdd2a34223fffbc303861d215f618053b899a386af32dc7192271d3e3b8d4751ac16e0088eef SHA512 9290ae00017df0eec1c41e4528bc4f4fb53df5779e83086e4f1fdfaef5aaf27a20a5cedf92382a22304c9266b6c40997af811212d54fb65ddc188acc0d34d792
+AUX pipewire-0.3.47-pulse-server-pending-sample-reply-crash.patch 3595 BLAKE2B 9c76203afebdfd00465006751d8abb3ed6fae22d72a27e0e89e89b7fe5a72aa0701adc47de68c7e8f02070d4bca592b9c281e7df5b901e3ae1efa6b449fa3779 SHA512 639f766965186e17a2ae8cf8ec3202342a42ce0eccc1c8644bdd9dea8d281ede8b408c8d485def35671e29d26ce014ea986e0514f4f465b032c35273c26eec9b
+AUX pipewire-0.3.47-revert-loop-remove-destroy-list-mpd.patch 5719 BLAKE2B 4540fea92d596ac9e437559a64e98f3962e52d7c71aece9d189b3708b4e825e63c118ac90c4269f47043092ec3e0c3daec7a375bb52cbbda1818bca975610546 SHA512 739f22521b04303e436a64c0195ee238ad3980959a3f0c6098b4d5d67f522a23ff91b5db021f7bce6b7ae33260a9b13258470137e6b4fc3850dadcf60da7d5b8
AUX pipewire-launcher.sh 149 BLAKE2B 42a9fd174e8216f9941ec72bc50581d539453dd0430ac61712582039f1cfe17cafa050bd87fcb90b9c16ffd891fd9f9c5dfec99b2be8c66eaed0128af180508e SHA512 7f50287565fa44e2296a7b294e8fd3dd64938d2de15c6ff5674d85a6e7bbccbc334c0fb9e28321104aff5335894b3c5a21171f385465e37b422ef53988dbfe4b
AUX pipewire.desktop 322 BLAKE2B 0299b9054cf881a5cbbdb128a5e8a51308cf0b5a98260dca756e704504ef057e403b2fb4aa2d58f52dde4be59e416c95d8fce21bc3ca6b6447ecab58263a3f21 SHA512 c13ea531cfdd3798f8d6cd20f5fa8c0a5040c27a6ef3850fdd41102a3bf0bcb73176e3300845af77804a98842fb736841223bc9ac1c92eb2034e9d46e41fc344
AUX pipewire.desktop-r1 325 BLAKE2B 7d823a264e5147bf8669127df22f468518fd54375ed57910f0143821894b33cfee8925b1cf8b9c5b1d219453a5c62fffa50d111b78bc5e151e23aed84d0a577e SHA512 e51ba049484daba3e4cdc5890748267f0c23ea6e57f31f3bb8a49c011e1a61b47b68eea742e5e7bcd58bfeddb96dd4064079fd9787cb66c78bd5eff10799a7bf
DIST pipewire-0.3.30.tar.gz 1540950 BLAKE2B 69b35743e3ad9a8caf68d9bb16cf395203efed6c3046b3f4ea33bbcdd6649f5d425d813042c12396a7cd5ff4e8ed91dbc395a96fe55935ad50f9c3f3918b0407 SHA512 ec525e0fb7e5c5313245fcc745b971fd7d4a1caa7ab9fe1fa38dc20d50f03e5969197e86b60659971676bec0f79aa7b7951c8209bfe9565a3fd1dcac1b8535b3
DIST pipewire-0.3.36.tar.gz 1708209 BLAKE2B 20fce0d7f88347fe594491d4fae7b6a8edee67ff7749f1a40b807a5d5094d792e61e3efd05dca2221f781c263e34ff0a50ad3c162231911d4b1d87704df6c775 SHA512 f0fc68ea005018b420a4f65a24dc9c85eb6263c24e66852a7ce2b03f966990d62487b388c7d73ff5adfc10c80c439b1200ae876e41d78f91db190036a1799a14
-DIST pipewire-0.3.42.tar.gz 1705295 BLAKE2B afd397e75be4f776b9d3042258e8091d6e1722f374e62417274238e5017e268c986ac7624e1b91ec8a97fc9078e8aa6d46a22f30c0834f99e5cd3112a096aded SHA512 bbf00ad5cee8ac872d8c2ef6b9499233100dba04c127b435894cf16c349188ae11edf918479a58039becc1b493c6f53a318d8fb483043dde074dc21ec32984c1
DIST pipewire-0.3.43.tar.gz 1713131 BLAKE2B 3fa167d74e6104685760a9eac721bc359f1245897e1a5f9b09b4b9591fc459d19549e209990ca478a10ad6c2a4dfaecc3546d996ab7f7d64fe880fb0c1c1dfca SHA512 d3804cdb1d94977bb4e2757e46829e1e51fca52b018007afa3bbfabff4dc33538cedad015c91154e28b879fc2edeb4e1fadf633b0af9a0d3bfd930c53b1bc2c0
DIST pipewire-0.3.44.tar.gz 1731260 BLAKE2B 5dd4fbffa21c34984836d097028e48654e2c9005e2f167b964bba2a8a2b9a7aad658853f03acce2f7967f884cfbea740ca427e9d373f00bcea2f122337835e02 SHA512 9a356b1d63e996e3725b6d126d7f0a972f83d0db0a95e923d9a7ec5432ff04688d51332f5c83826069e593e021bf514937ae5daf9cc6ad7307fe8baab964a244
+DIST pipewire-0.3.45_p20220205.tar.bz2 1296767 BLAKE2B 2dbdb1db9ffdaa36579d7a6ee459fa001997ecd7b4ece006cf1265267ce956b65c752e8dd51affbff9c17b2934480e1fb86c6950c70ab5ecc8d61063c31a410b SHA512 eae64ccf484c051a10a7a7ac11522de6cd3760c87414febe4868b76f22a8651b1bf94c04cd305fbacd1c6e7233fedb8008933c0dbd6809d4507eb27e633c3930
+DIST pipewire-0.3.47.tar.gz 1746286 BLAKE2B a34e5378d99b2b3c98731baaabf695b7aab882e557635b1a7f1cf542a5012014685bcf4254e4a81d4aab2ec2c8dd804115d5a57eaf13cbb042db2d4232f4bdfc SHA512 2f188910b6a04ebc6ebf288e2f6eab8a227056fd9c5c97a8a279ebff0f88cd6b98b9bfc3bf6aff55104fa537ca04f2c89a8d45da7f2104e07e1b2e531f6cc21c
+DIST pipewire-0.3.48.tar.gz 1754730 BLAKE2B 2ba562cdfdb179ab7c36e1227405dd83cc2a9fda3b3496e8d9339a4efc607cfbc1866eb2a9b2be9d44a2e3e4412a2c8af593028086c7c6b81dd14aa7158f19a5 SHA512 67699015612dfafd12f8e0908fa028a1ae91f8ce3a6cd7aeaf313ce991c6cfa206ace24a559bf64631c0a690ea8aa03f878c7f73e3c123881f1b015cf6627c50
EBUILD pipewire-0.3.30-r2.ebuild 9675 BLAKE2B df43c7f1ef0622d96741266e53dc343d9697903571c723c73f5267a8083539fde110ea8f6420f2c86e296d275ab45e4b9abacbd6f0310825a6121336cf11215b SHA512 47cdcbd48311cee24b45c05b3283c4bbe1231c44f6d55136966f887aa43ad69b789bf642e003b17aa6f1a3b59963e68047e4f8c396431cb05f6dd4d3161f8c14
EBUILD pipewire-0.3.36.ebuild 10263 BLAKE2B 033b26477ad91c843e9307504ce8eddcad7977a386925a1960409767946a88ac539954c7647075bb48ac373b4e36fecf0bbdb5d50351213b51465ea298cad336 SHA512 38d6225ab02d31d1fe33723f7c14a385648853b5f4f84cfd13fcf7f91489dffc2c5fbac5f649bdf80bdd9a4bd1b19977bae59eba83beca9c3d9e34030f6f332b
-EBUILD pipewire-0.3.42-r1.ebuild 11066 BLAKE2B d61bdc505e7fd86172392d0e1e7f3fe3166883fd0c76260d92c4ef832de67ce9d1e8c12d2a66874153e8c255801d9c852084a297204cbf6939acbe969e9b920a SHA512 878f82b0046e3a92881e313083f2e245f9833c0b1852ed87b54c60b0eb5a1927c3f1f6d534f2d257176ecd685fde7c3c67a4e3caa95810b7ed58cf688f0a94a0
EBUILD pipewire-0.3.43-r3.ebuild 11620 BLAKE2B 64ff8aaaec2894008dfb32bbbcd6f8e6f9c0480089d3f19b5b1b2dec57b2ddf5880a11f9b4e383efd0ce05e1a4480671042947586deae5a849404dc7d9de17b7 SHA512 86e838d0792b78b46186e1645acc241e0bce35bae2ff58e3bf41c41f491cbf24e9cb82fa68f18adb1016d5df51659963e74c66578bdefe599f6f7c0f6ceade98
EBUILD pipewire-0.3.44-r1.ebuild 11766 BLAKE2B bbd2c2da083e950bc17440871c8d5120e6b375f5111d3b23387472b46769511958132c57aa7ff389c62f40dd7e925dc704c9f0df0a24f0476d27739246c606a6 SHA512 c93720c87b01a6fe777a5fbb88ec2f8c11dad853522a4d0cb3e2c27f8c6c00eb73d40231099350ebfc73a9c1c62db54df3b1e73d452aea34b6109bbb83aa5bbf
-EBUILD pipewire-9999.ebuild 11720 BLAKE2B 3c911f74804d2a954c871e3a38a1f0bf07026b788a23f47f73466dd1b2b4dccf8fb9d1f64d3c869a79d7af08db9336c1200f633877060501a3538e514e17b27c SHA512 103bf28f0b552a1b82a1d6612f123448f2f82279a20b6734b4c404d570fe359d9bdec8452e1c96ae6da182c178943204a5f41a5e399b9342364247f0b20ba2cc
-MISC metadata.xml 1503 BLAKE2B 83f04aa01f7843a0fc6173caab89e413f12ff93d28d21b30e8748ae4c08bd2df5040597fffb1b85c5cb5f9708c29f9da005e6a31070ae194f1a4d69f05f8dfe9 SHA512 65883678c5b762e0f998cbcd58532b441e5f092aa0ac560886851c4f3dd9d89cdec2f9bbecae35c2a4d03a8a8b7dd4413e14e0182d3da8ef41705436814cdfe2
+EBUILD pipewire-0.3.45_p20220205.ebuild 12746 BLAKE2B ea55e2256447631293e8cb5b509202d14c3ada1fe6589cfc0a75ce7028a3f3f5cf5d68bc7b6bca7c8059a56d1c1c0f5fb99a494170d9b8c2238b37da7e1ecd84 SHA512 eb0d8ad4df48c8265159ac75c340be3b20d665bcfb9610dbc45dc3ea0cfb6408e01b9ec6374ce53fb536075725b09a9d5381edfedad3c3ccab812db153c739b5
+EBUILD pipewire-0.3.47-r1.ebuild 12835 BLAKE2B 4276d587ae84c78692676853430541e454a252ce54d5909dcfa1c8e9bb69aefdc3178073618a91354865faf0b14b30651b2cedd95b079e138e6e32817d2de3d7 SHA512 46f43ace5ec82aac295e70b95904227961c2fbaf242d31809b1bc3f17b38c4943f62de29bcbfeea94d63cc545e2d05e2f3726562fa8f5931cf062065ad8acb98
+EBUILD pipewire-0.3.48-r1.ebuild 12781 BLAKE2B 41ee2277e1f8b823e0c1cafd66061596cc3228e048ed0d33711df3821ad3721960d87a762e1cac58097835fe7faf0164356136eba45412efc8dfb0174bca4d36 SHA512 21ec3b4a6698d040685cf97d67f7e09ccd20f8e1b7c4225300020ec703dfd6b7e58ba57d325e048b7504506baa108f5179f264c2f10231e839e7d0251e89af5c
+EBUILD pipewire-9999.ebuild 12781 BLAKE2B 41ee2277e1f8b823e0c1cafd66061596cc3228e048ed0d33711df3821ad3721960d87a762e1cac58097835fe7faf0164356136eba45412efc8dfb0174bca4d36 SHA512 21ec3b4a6698d040685cf97d67f7e09ccd20f8e1b7c4225300020ec703dfd6b7e58ba57d325e048b7504506baa108f5179f264c2f10231e839e7d0251e89af5c
+MISC metadata.xml 1617 BLAKE2B e24aeb1644a4fe0a9ca35ad078149c1736de01820ee78d78cd733b06313a82294913601ceab2f35eee98a608bc5c25d184d285810916c42902515058a57e13b4 SHA512 992b300e69e808ecd51c4e3073941d7e577889e4d8d8573b7643a49fb3bb7de1fb2c48d4f99c8e703c5cd7d03bd55f6cffa2c1ccca052f89d6a4cabccb09a76e
diff --git a/media-video/pipewire/files/pipewire-0.3.36-non-systemd-integration.patch b/media-video/pipewire/files/pipewire-0.3.36-non-systemd-integration.patch
deleted file mode 100644
index b8d3271eecdd..000000000000
--- a/media-video/pipewire/files/pipewire-0.3.36-non-systemd-integration.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in
-index 648e13069..d985208b4 100644
---- a/src/daemon/pipewire.conf.in
-+++ b/src/daemon/pipewire.conf.in
-@@ -235,12 +235,12 @@ context.exec = [
- # but it is better to start it as a systemd service.
- # Run the session manager with -h for options.
- #
-- @sm_comment@{ path = "@session_manager_path@" args = "@session_manager_args@" }
-+ { path = "@session_manager_path@" args = "@session_manager_args@" }
- #
- # You can optionally start the pulseaudio-server here as well
- # but it is better to start it as a systemd service.
- # It can be interesting to start another daemon here that listens
- # on another address with the -a option (eg. -a tcp:4713).
- #
-- @pulse_comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
-+ { path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
- ]
diff --git a/media-video/pipewire/files/pipewire-0.3.47-pulse-server-pending-sample-reply-crash.patch b/media-video/pipewire/files/pipewire-0.3.47-pulse-server-pending-sample-reply-crash.patch
new file mode 100644
index 000000000000..d4f74a5abcc5
--- /dev/null
+++ b/media-video/pipewire/files/pipewire-0.3.47-pulse-server-pending-sample-reply-crash.patch
@@ -0,0 +1,101 @@
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/d7793501fd012de37fcc8bf09003c60bc4624341.patch
+
+From d7793501fd012de37fcc8bf09003c60bc4624341 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Sun, 20 Feb 2022 21:34:53 +0100
+Subject: [PATCH] pulse-server: free pending sample reply
+
+If the sample finished playing before we finished the roundtrip to
+get the sink_index, it will be destroyed. When the roundtrip completes,
+it will try to use invalid memoryy and crash.
+
+Make sure we destroy all pending replies before destroying the sample
+to avoid this problem.
+
+Fixes #2151
+---
+ src/modules/module-protocol-pulse/operation.c | 10 ++++++++++
+ src/modules/module-protocol-pulse/operation.h | 1 +
+ src/modules/module-protocol-pulse/pending-sample.c | 5 +++++
+ src/modules/module-protocol-pulse/pulse-server.c | 4 ++++
+ 4 files changed, 20 insertions(+)
+
+diff --git a/src/modules/module-protocol-pulse/operation.c b/src/modules/module-protocol-pulse/operation.c
+index e0e67b374..b1e0eb08d 100644
+--- a/src/modules/module-protocol-pulse/operation.c
++++ b/src/modules/module-protocol-pulse/operation.c
+@@ -66,6 +66,16 @@ void operation_free(struct operation *o)
+ free(o);
+ }
+
++struct operation *operation_find(struct client *client, uint32_t tag)
++{
++ struct operation *o;
++ spa_list_for_each(o, &client->operations, link) {
++ if (o->tag == tag)
++ return o;
++ }
++ return NULL;
++}
++
+ void operation_complete(struct operation *o)
+ {
+ struct client *client = o->client;
+diff --git a/src/modules/module-protocol-pulse/operation.h b/src/modules/module-protocol-pulse/operation.h
+index d282ee5e5..1fa07cc7b 100644
+--- a/src/modules/module-protocol-pulse/operation.h
++++ b/src/modules/module-protocol-pulse/operation.h
+@@ -43,6 +43,7 @@ int operation_new(struct client *client, uint32_t tag);
+ int operation_new_cb(struct client *client, uint32_t tag,
+ void (*callback) (void *data, struct client *client, uint32_t tag),
+ void *data);
++struct operation *operation_find(struct client *client, uint32_t tag);
+ void operation_free(struct operation *o);
+ void operation_complete(struct operation *o);
+
+diff --git a/src/modules/module-protocol-pulse/pending-sample.c b/src/modules/module-protocol-pulse/pending-sample.c
+index 6e5d04fbb..399fc3b54 100644
+--- a/src/modules/module-protocol-pulse/pending-sample.c
++++ b/src/modules/module-protocol-pulse/pending-sample.c
+@@ -29,6 +29,7 @@
+ #include "client.h"
+ #include "internal.h"
+ #include "log.h"
++#include "operation.h"
+ #include "pending-sample.h"
+ #include "sample-play.h"
+
+@@ -36,10 +37,14 @@ void pending_sample_free(struct pending_sample *ps)
+ {
+ struct client * const client = ps->client;
+ struct impl * const impl = client->impl;
++ struct operation *o;
+
+ spa_list_remove(&ps->link);
+ spa_hook_remove(&ps->listener);
+ pw_work_queue_cancel(impl->work_queue, ps, SPA_ID_INVALID);
+
++ if ((o = operation_find(client, ps->tag)) != NULL)
++ operation_free(o);
++
+ sample_play_destroy(ps->play);
+ }
+diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
+index 182c3db99..c035840d1 100644
+--- a/src/modules/module-protocol-pulse/pulse-server.c
++++ b/src/modules/module-protocol-pulse/pulse-server.c
+@@ -2353,6 +2353,10 @@ static void on_sample_done(void *obj, void *data, int res, uint32_t id)
+ {
+ struct pending_sample *ps = obj;
+ struct client *client = ps->client;
++ struct operation *o;
++
++ if ((o = operation_find(client, ps->tag)) != NULL)
++ operation_complete(o);
+
+ pending_sample_free(ps);
+ client_unref(client);
+--
+GitLab
+
+
diff --git a/media-video/pipewire/files/pipewire-0.3.47-revert-loop-remove-destroy-list-mpd.patch b/media-video/pipewire/files/pipewire-0.3.47-revert-loop-remove-destroy-list-mpd.patch
new file mode 100644
index 000000000000..0e27d65fdb3a
--- /dev/null
+++ b/media-video/pipewire/files/pipewire-0.3.47-revert-loop-remove-destroy-list-mpd.patch
@@ -0,0 +1,187 @@
+Fixes mpd crash.
+
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/16f63a3c8fa227625bade5a9edea22354b347d18.patch
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/d1f7e96f821089224ddcacf8e8f506f99c54eb5c.patch
+
+From 16f63a3c8fa227625bade5a9edea22354b347d18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
+Date: Fri, 18 Feb 2022 18:36:36 +0100
+Subject: [PATCH] Revert "loop: remove destroy list"
+
+This reverts commit c474846c42967c44db069a23b76a29da6f496f33.
+In addition, `s->loop` is also checked before dispatching a source.
+
+The destroy list is needed in the presence of threads. The
+issue is that a source may be destroyed between `epoll_wait()`
+returning and thread loop lock being acquired. If this
+source is active, then a use-after-free will be triggered
+when the thread loop acquires the lock and starts dispatching
+the sources.
+
+ thread 1 thread 2
+ ---------- ----------
+ loop_iterate
+ spa_loop_control_hook_before
+ // release lock
+
+ pw_thread_loop_lock
+
+ spa_system_pollfd_wait
+ // assume it returns with source A
+
+ pw_loop_destroy_source(..., A)
+ // frees storage of A
+
+ pw_thread_loop_unlock
+ spa_loop_control_hook_after
+ // acquire the lock
+
+ for (...) {
+ struct spa_source *s = ep[i].data;
+ s->rmask = ep[i].events;
+ // use-after-free if `s` refers to
+ // the previously freed `A`
+
+Fixes #2147
+---
+ spa/plugins/support/loop.c | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c
+index 0588ce770..04739eb2a 100644
+--- a/spa/plugins/support/loop.c
++++ b/spa/plugins/support/loop.c
+@@ -75,6 +75,7 @@ struct impl {
+ struct spa_system *system;
+
+ struct spa_list source_list;
++ struct spa_list destroy_list;
+ struct spa_hook_list hooks_list;
+
+ int poll_fd;
+@@ -325,6 +326,14 @@ static void loop_leave(void *object)
+ impl->thread = 0;
+ }
+
++static inline void process_destroy(struct impl *impl)
++{
++ struct source_impl *source, *tmp;
++ spa_list_for_each_safe(source, tmp, &impl->destroy_list, link)
++ free(source);
++ spa_list_init(&impl->destroy_list);
++}
++
+ static int loop_iterate(void *object, int timeout)
+ {
+ struct impl *impl = object;
+@@ -354,11 +363,14 @@ static int loop_iterate(void *object, int timeout)
+ }
+ for (i = 0; i < nfds; i++) {
+ struct spa_source *s = ep[i].data;
+- if (SPA_LIKELY(s && s->rmask)) {
++ if (SPA_LIKELY(s && s->rmask && s->loop)) {
+ s->priv = NULL;
+ s->func(s);
+ }
+ }
++ if (SPA_UNLIKELY(!spa_list_is_empty(&impl->destroy_list)))
++ process_destroy(impl);
++
+ return nfds;
+ }
+
+@@ -712,7 +724,7 @@ static void loop_destroy_source(void *object, struct spa_source *source)
+ spa_system_close(impl->impl->system, source->fd);
+ source->fd = -1;
+ }
+- free(source);
++ spa_list_insert(&impl->impl->destroy_list, &impl->link);
+ }
+
+ static const struct spa_loop_methods impl_loop = {
+@@ -783,6 +795,8 @@ static int impl_clear(struct spa_handle *handle)
+ spa_list_consume(source, &impl->source_list, link)
+ loop_destroy_source(impl, &source->source);
+
++ process_destroy(impl);
++
+ spa_system_close(impl->system, impl->ack_fd);
+ spa_system_close(impl->system, impl->poll_fd);
+
+@@ -844,6 +858,7 @@ impl_init(const struct spa_handle_factory *factory,
+ impl->poll_fd = res;
+
+ spa_list_init(&impl->source_list);
++ spa_list_init(&impl->destroy_list);
+ spa_hook_list_init(&impl->hooks_list);
+
+ impl->buffer_data = SPA_PTR_ALIGN(impl->buffer_mem, MAX_ALIGN, uint8_t);
+--
+GitLab
+
+
+From d1f7e96f821089224ddcacf8e8f506f99c54eb5c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
+Date: Fri, 18 Feb 2022 19:27:13 +0100
+Subject: [PATCH] test: loop: add test for destroying source of thread loop
+
+Add test which tries to destroy an active source precisely
+after the loop has returned from polling but has not yet
+acquired the thread loop lock.
+---
+ test/test-loop.c | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+
+diff --git a/test/test-loop.c b/test/test-loop.c
+index 98b2add09..81f7a117c 100644
+--- a/test/test-loop.c
++++ b/test/test-loop.c
+@@ -227,11 +227,45 @@ PWTEST(pwtest_loop_recurse2)
+ return PWTEST_PASS;
+ }
+
++PWTEST(thread_loop_destroy_between_poll_and_lock)
++{
++ pw_init(NULL, NULL);
++
++ struct pw_thread_loop *thread_loop = pw_thread_loop_new("uaf", NULL);
++ pwtest_ptr_notnull(thread_loop);
++
++ struct pw_loop *loop = pw_thread_loop_get_loop(thread_loop);
++ pwtest_ptr_notnull(loop);
++
++ int evfd = eventfd(0, 0);
++ pwtest_errno_ok(evfd);
++
++ struct spa_source *source = pw_loop_add_io(loop, evfd, SPA_IO_IN, true, NULL, NULL);
++ pwtest_ptr_notnull(source);
++
++ pw_thread_loop_start(thread_loop);
++
++ pw_thread_loop_lock(thread_loop);
++ {
++ write(evfd, &(uint64_t){1}, sizeof(uint64_t));
++ sleep(1);
++ pw_loop_destroy_source(loop, source);
++ }
++ pw_thread_loop_unlock(thread_loop);
++
++ pw_thread_loop_destroy(thread_loop);
++
++ pw_deinit();
++
++ return PWTEST_PASS;
++}
++
+ PWTEST_SUITE(support)
+ {
+ pwtest_add(pwtest_loop_destroy2, PWTEST_NOARG);
+ pwtest_add(pwtest_loop_recurse1, PWTEST_NOARG);
+ pwtest_add(pwtest_loop_recurse2, PWTEST_NOARG);
++ pwtest_add(thread_loop_destroy_between_poll_and_lock, PWTEST_NOARG);
+
+ return PWTEST_PASS;
+ }
+--
+GitLab
+
diff --git a/media-video/pipewire/metadata.xml b/media-video/pipewire/metadata.xml
index a61d898b80e4..f88730b7d3ba 100644
--- a/media-video/pipewire/metadata.xml
+++ b/media-video/pipewire/metadata.xml
@@ -30,6 +30,7 @@
<flag name="lv2">Allow loading LV2 plugins via <pkg>media-libs/lv2</pkg></flag>
<flag name="pipewire-alsa">Replace PulseAudio's ALSA plugin with PipeWire's plugin</flag>
<flag name="ssl">Enable raop-sink support (needs <pkg>dev-libs/openssl</pkg>)</flag>
+ <flag name="system-service">Install systemd unit files for running as a system service. Not recommended.</flag>
<flag name="X">Enable audible bell for X11</flag>
</use>
</pkgmetadata>
diff --git a/media-video/pipewire/pipewire-0.3.42-r1.ebuild b/media-video/pipewire/pipewire-0.3.45_p20220205.ebuild
index 966cc0b8c14b..2e19306a378e 100644
--- a/media-video/pipewire/pipewire-0.3.42-r1.ebuild
+++ b/media-video/pipewire/pipewire-0.3.45_p20220205.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
@@ -11,7 +11,14 @@ if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
inherit git-r3
else
- SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT="d1784cfd861bb3179903b07ab87a16e929c0909f"
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+ else
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ fi
+
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
@@ -21,7 +28,7 @@ HOMEPAGE="https://pipewire.org/"
LICENSE="MIT LGPL-2.1+ GPL-2"
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
SLOT="0/0.4"
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk pipewire-alsa systemd test v4l"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
# Once replacing system JACK libraries is possible, it's likely that
# jack-client IUSE will need blocking to avoid users accidentally
@@ -29,7 +36,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk pipewire-al
# JACK's sink - doing so is likely to yield no audio, cause a CPU
# cycles consuming loop (and may even cause GUI crashes)!
-REQUIRED_USE="jack-sdk? ( !jack-client )"
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
RESTRICT="!test? ( test )"
@@ -57,6 +67,7 @@ RDEPEND="
media-libs/libfreeaptx
media-libs/sbc
>=net-wireless/bluez-4.101:=
+ virtual/libusb:1
)
echo-cancel? ( media-libs/webrtc-audio-processing:0 )
extra? (
@@ -72,13 +83,24 @@ RDEPEND="
!media-sound/jack-audio-connection-kit
!media-sound/jack2
)
+ lv2? ( media-libs/lilv )
pipewire-alsa? (
>=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}]
!media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio]
)
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
+ ssl? ( dev-libs/openssl:= )
systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
v4l? ( media-libs/libv4l )
+ X? (
+ media-libs/libcanberra
+ x11-libs/libX11
+ )
+ zeroconf? ( net-dns/avahi )
"
DEPEND="${RDEPEND}"
@@ -120,6 +142,12 @@ src_prepare() {
@audio - memlock 256
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
# End of ${limitsdfile} from ${P}
EOF
}
@@ -127,6 +155,8 @@ src_prepare() {
multilib_src_configure() {
local emesonargs=(
-Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ $(meson_native_use_feature zeroconf avahi)
$(meson_native_use_feature doc docs)
$(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone
$(meson_native_enabled man)
@@ -135,7 +165,11 @@ multilib_src_configure() {
$(meson_native_use_feature gstreamer)
$(meson_native_use_feature gstreamer gstreamer-device-provider)
$(meson_native_use_feature systemd)
- -Dsystemd-system-service=disabled # Matches upstream
+
+ $(meson_native_use_feature system-service systemd-system-service)
+ -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
+ -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+
$(meson_native_use_feature systemd systemd-user-service)
$(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
-Dspa-plugins=enabled
@@ -150,6 +184,7 @@ multilib_src_configure() {
$(meson_native_use_feature bluetooth bluez5-codec-aac)
$(meson_native_use_feature bluetooth bluez5-codec-aptx)
$(meson_native_use_feature bluetooth bluez5-codec-ldac)
+ $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters)
$(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889
-Dcontrol=enabled # Matches upstream
-Daudiotestsrc=enabled # Matches upstream
@@ -161,8 +196,10 @@ multilib_src_configure() {
-Dsupport=enabled # Miscellaneous/common plugins, such as null sink
-Devl=disabled # Matches upstream
-Dtest=disabled # fakesink and fakesource plugins
+ $(meson_native_use_feature lv2)
$(meson_native_use_feature v4l v4l2)
-Dlibcamera=disabled # libcamera is not in Portage tree
+ $(meson_native_use_feature ssl raop)
-Dvideoconvert=enabled # Matches upstream
-Dvideotestsrc=enabled # Matches upstream
-Dvolume=enabled # Matches upstream
@@ -173,6 +210,10 @@ multilib_src_configure() {
-Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
$(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
-Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build
+
+ # Just for bell sounds in X11 right now.
+ $(meson_native_use_feature X x11)
+ $(meson_native_use_feature X libcanberra)
)
meson_src_configure
@@ -295,4 +336,15 @@ pkg_postinst() {
fi
ewarn
fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
}
diff --git a/media-video/pipewire/pipewire-0.3.47-r1.ebuild b/media-video/pipewire/pipewire-0.3.47-r1.ebuild
new file mode 100644
index 000000000000..25c024b05e01
--- /dev/null
+++ b/media-video/pipewire/pipewire-0.3.47-r1.ebuild
@@ -0,0 +1,353 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit meson-multilib optfeature prefix python-any-r1 systemd udev
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
+ inherit git-r3
+else
+ if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT=""
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+ else
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ fi
+
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+DESCRIPTION="Multimedia processing graphs"
+HOMEPAGE="https://pipewire.org/"
+
+LICENSE="MIT LGPL-2.1+ GPL-2"
+# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
+SLOT="0/0.4"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
+
+# Once replacing system JACK libraries is possible, it's likely that
+# jack-client IUSE will need blocking to avoid users accidentally
+# configuring their systems to send PW sink output to the emulated
+# JACK's sink - doing so is likely to yield no audio, cause a CPU
+# cycles consuming loop (and may even cause GUI crashes)!
+
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-util/meson-0.59
+ virtual/pkgconfig
+ ${PYTHON_DEPS}
+ $(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]')
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz
+ )
+"
+RDEPEND="
+ acct-group/audio
+ media-libs/alsa-lib
+ sys-apps/dbus[${MULTILIB_USEDEP}]
+ sys-libs/readline:=
+ sys-libs/ncurses:=[unicode(+)]
+ virtual/libintl[${MULTILIB_USEDEP}]
+ virtual/libudev[${MULTILIB_USEDEP}]
+ bluetooth? (
+ media-libs/fdk-aac
+ media-libs/libldac
+ media-libs/libfreeaptx
+ media-libs/sbc
+ >=net-wireless/bluez-4.101:=
+ virtual/libusb:1
+ )
+ echo-cancel? ( media-libs/webrtc-audio-processing:0 )
+ extra? (
+ >=media-libs/libsndfile-1.0.20
+ )
+ gstreamer? (
+ >=dev-libs/glib-2.32.0:2
+ >=media-libs/gstreamer-1.10.0:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
+ jack-sdk? (
+ !media-sound/jack-audio-connection-kit
+ !media-sound/jack2
+ )
+ lv2? ( media-libs/lilv )
+ pipewire-alsa? (
+ >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}]
+ !media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio]
+ )
+ !pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
+ v4l? ( media-libs/libv4l )
+ X? (
+ media-libs/libcanberra
+ x11-libs/libX11
+ )
+ zeroconf? ( net-dns/avahi )
+"
+
+DEPEND="${RDEPEND}"
+
+# TODO: Consider use cases where pipewire is not used for driving audio
+# Doing so with WirePlumber currently involves editing Lua scripts
+PDEPEND="media-video/wireplumber"
+
+# Present RDEPEND that are currently always disabled due to the PW
+# code using them being required to be disabled by Gentoo guidelines
+# (i.e. developer binaries not meant for users) and unready code
+# media-video/ffmpeg:=
+# media-libs/libsdl2
+# >=media-libs/vulkan-loader-1.1.69
+#
+# Ditto for DEPEND
+# >=dev-util/vulkan-headers-1.1.69
+
+DOCS=( {README,INSTALL}.md NEWS )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
+
+ "${FILESDIR}"/${P}-revert-loop-remove-destroy-list-mpd.patch
+ "${FILESDIR}"/${P}-pulse-server-pending-sample-reply-crash.patch
+)
+
+# limitsdfile related code taken from =sys-auth/realtime-base-0.1
+# with changes as necessary.
+limitsdfile=40-${PN}.conf
+
+python_check_deps() {
+ has_version -b "dev-python/docutils[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ default
+
+ einfo "Generating ${limitsdfile}"
+ cat > ${limitsdfile} <<- EOF || die
+ # Start of ${limitsdfile} from ${P}
+
+ @audio - memlock 256
+
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
+ # End of ${limitsdfile} from ${P}
+ EOF
+}
+
+multilib_src_configure() {
+ local emesonargs=(
+ -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ $(meson_native_use_feature zeroconf avahi)
+ $(meson_native_use_feature doc docs)
+ $(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone
+ $(meson_native_enabled man)
+ $(meson_feature test tests)
+ -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests
+ $(meson_native_use_feature gstreamer)
+ $(meson_native_use_feature gstreamer gstreamer-device-provider)
+ $(meson_native_use_feature systemd)
+
+ $(meson_native_use_feature system-service systemd-system-service)
+ -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
+ -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+
+ $(meson_native_use_feature systemd systemd-user-service)
+ $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
+ -Dspa-plugins=enabled
+ -Dalsa=enabled # Allows using kernel ALSA for sound I/O (NOTE: media-session is gone so IUSE=alsa/spa_alsa/alsa-backend might be possible)
+ -Daudiomixer=enabled # Matches upstream
+ -Daudioconvert=enabled # Matches upstream
+ $(meson_native_use_feature bluetooth bluez5)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsp-native)
+ $(meson_native_use_feature bluetooth bluez5-backend-hfp-native)
+ $(meson_native_use_feature bluetooth bluez5-backend-ofono)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsphfpd)
+ $(meson_native_use_feature bluetooth bluez5-codec-aac)
+ $(meson_native_use_feature bluetooth bluez5-codec-aptx)
+ $(meson_native_use_feature bluetooth bluez5-codec-ldac)
+ $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters)
+ $(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889
+ -Dcontrol=enabled # Matches upstream
+ -Daudiotestsrc=enabled # Matches upstream
+ -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020
+ -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph
+ $(meson_native_use_feature jack-client jack) # Allows PW to act as a JACK client
+ $(meson_use jack-sdk jack-devel)
+ $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" '')
+ -Dsupport=enabled # Miscellaneous/common plugins, such as null sink
+ -Devl=disabled # Matches upstream
+ -Dtest=disabled # fakesink and fakesource plugins
+ $(meson_native_use_feature lv2)
+ $(meson_native_use_feature v4l v4l2)
+ -Dlibcamera=disabled # libcamera is not in Portage tree
+ $(meson_native_use_feature ssl raop)
+ -Dvideoconvert=enabled # Matches upstream
+ -Dvideotestsrc=enabled # Matches upstream
+ -Dvolume=enabled # Matches upstream
+ -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream)
+ $(meson_native_use_feature extra pw-cat)
+ -Dudev=enabled
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
+ $(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
+ -Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build
+
+ # Just for bell sounds in X11 right now.
+ $(meson_native_use_feature X x11)
+ $(meson_native_use_feature X libcanberra)
+ )
+
+ meson_src_configure
+}
+
+multilib_src_install() {
+ # Our custom DOCS do not exist in multilib source directory
+ DOCS= meson_src_install
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ insinto /etc/security/limits.d
+ doins ${limitsdfile}
+
+ if use pipewire-alsa; then
+ dodir /etc/alsa/conf.d
+ # These will break if someone has /etc that is a symbolic link to a subfolder! See #724222
+ # And the current dosym8 -r implementation is likely affected by the same issue, too.
+ dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf
+ dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/99-pipewire-default.conf
+ fi
+
+ if ! use systemd; then
+ insinto /etc/xdg/autostart
+ newins "${FILESDIR}"/pipewire.desktop-r1 pipewire.desktop
+
+ exeinto /usr/bin
+ newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher
+ eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
+ fi
+}
+
+pkg_postinst() {
+ elog "It is recommended to raise RLIMIT_MEMLOCK to 256 for users"
+ elog "using PipeWire. Do it either manually or add yourself"
+ elog "to the 'audio' group:"
+ elog
+ elog " usermod -aG audio <youruser>"
+ elog
+
+ if ! use jack-sdk; then
+ elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
+ elog "alternative libraries have been installed to a non-default location."
+ elog "To use them, put pw-jack <application> before every JACK application."
+ elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack"
+ elog "provider is still needed to compile the JACK applications themselves."
+ elog
+ fi
+
+ if use systemd; then
+ elog "When switching from PulseAudio, you may need to disable PulseAudio:"
+ elog
+ elog " systemctl --user disable pulseaudio.service pulseaudio.socket"
+ elog
+ elog "To use PipeWire, the user units must be manually enabled"
+ elog "by running this command as each user you use for desktop activities:"
+ elog
+ elog " systemctl --user enable pipewire.socket pipewire-pulse.socket"
+ elog
+ elog "A reboot is recommended to avoid interferences from still running"
+ elog "PulseAudio daemon."
+ elog
+ elog "Both new users and those upgrading need to enable WirePlumber"
+ elog "for relevant users:"
+ elog
+ elog " systemctl --user disable pipewire-media-session.service"
+ elog " systemctl --user --force enable wireplumber.service"
+ elog
+ elog "Root user may replace --user with --global to change system default"
+ elog "configuration for all of the above commands."
+ else
+ ewarn "PipeWire daemon startup has been moved to a launcher script!"
+ ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no"
+ ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all"
+ ewarn "lines similar to '{ path = /usr/bin/pipewire*' should be commented out)"
+ ewarn
+ ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from"
+ ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
+ ewarn "advised that a D-Bus user session is set up before starting the script."
+ ewarn
+ if has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon'; then
+ elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
+ elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable"
+ elog "autospawning of the original daemon by setting:"
+ elog
+ elog " autospawn = no"
+ elog
+ elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
+ elog
+ elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
+ elog "${EROOT}/usr/bin/gentoo-pipewire-launcher by commenting out the relevant"
+ elog "command:"
+ elog
+ elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &"
+ elog
+ fi
+ elog "NOTE:"
+ elog "Starting with PipeWire-0.3.30, this package is no longer installing its config"
+ elog "into ${EROOT}/etc/pipewire by default. In case you need to change"
+ elog "its config, please start by copying default config from ${EROOT}/usr/share/pipewire"
+ elog "and just override the sections you want to change."
+ fi
+ elog
+
+ elog "For latest tips and tricks, troubleshooting information and documentation"
+ elog "in general, please refer to https://wiki.gentoo.org/wiki/PipeWire"
+ elog
+
+ optfeature_header "The following can be installed for optional runtime features:"
+ optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+
+ if has_version 'net-misc/ofono' ; then
+ ewarn "Native backend has become default. Please disable oFono via:"
+ if systemd_is_booted ; then
+ ewarn "systemctl disable ofono"
+ else
+ ewarn "rc-update delete ofono"
+ fi
+ ewarn
+ fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
+}
diff --git a/media-video/pipewire/pipewire-0.3.48-r1.ebuild b/media-video/pipewire/pipewire-0.3.48-r1.ebuild
new file mode 100644
index 000000000000..0a674de08b12
--- /dev/null
+++ b/media-video/pipewire/pipewire-0.3.48-r1.ebuild
@@ -0,0 +1,352 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit meson-multilib optfeature prefix python-any-r1 systemd udev
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
+ inherit git-r3
+else
+ if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT=""
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+ else
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ fi
+
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+DESCRIPTION="Multimedia processing graphs"
+HOMEPAGE="https://pipewire.org/"
+
+LICENSE="MIT LGPL-2.1+ GPL-2"
+# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
+SLOT="0/0.4"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
+
+# Once replacing system JACK libraries is possible, it's likely that
+# jack-client IUSE will need blocking to avoid users accidentally
+# configuring their systems to send PW sink output to the emulated
+# JACK's sink - doing so is likely to yield no audio, cause a CPU
+# cycles consuming loop (and may even cause GUI crashes)!
+
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-util/meson-0.59
+ virtual/pkgconfig
+ ${PYTHON_DEPS}
+ $(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]')
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz
+ )
+"
+RDEPEND="
+ acct-group/audio
+ media-libs/alsa-lib
+ sys-apps/dbus[${MULTILIB_USEDEP}]
+ sys-libs/readline:=
+ sys-libs/ncurses:=[unicode(+)]
+ virtual/libintl[${MULTILIB_USEDEP}]
+ virtual/libudev[${MULTILIB_USEDEP}]
+ bluetooth? (
+ media-libs/fdk-aac
+ media-libs/libldac
+ media-libs/libfreeaptx
+ media-libs/sbc
+ >=net-wireless/bluez-4.101:=
+ virtual/libusb:1
+ )
+ echo-cancel? ( media-libs/webrtc-audio-processing:0 )
+ extra? (
+ >=media-libs/libsndfile-1.0.20
+ )
+ gstreamer? (
+ >=dev-libs/glib-2.32.0:2
+ >=media-libs/gstreamer-1.10.0:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
+ jack-sdk? (
+ !media-sound/jack-audio-connection-kit
+ !media-sound/jack2
+ )
+ lv2? ( media-libs/lilv )
+ pipewire-alsa? (
+ >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}]
+ !media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio]
+ )
+ !pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
+ v4l? ( media-libs/libv4l )
+ X? (
+ media-libs/libcanberra
+ x11-libs/libX11
+ x11-libs/libXfixes
+ )
+ zeroconf? ( net-dns/avahi )
+"
+
+DEPEND="${RDEPEND}"
+
+# TODO: Consider use cases where pipewire is not used for driving audio
+# Doing so with WirePlumber currently involves editing Lua scripts
+PDEPEND=">=media-video/wireplumber-0.4.8-r3"
+
+# Present RDEPEND that are currently always disabled due to the PW
+# code using them being required to be disabled by Gentoo guidelines
+# (i.e. developer binaries not meant for users) and unready code
+# media-video/ffmpeg:=
+# media-libs/libsdl2
+# >=media-libs/vulkan-loader-1.1.69
+#
+# Ditto for DEPEND
+# >=dev-util/vulkan-headers-1.1.69
+
+DOCS=( {README,INSTALL}.md NEWS )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
+)
+
+# limitsdfile related code taken from =sys-auth/realtime-base-0.1
+# with changes as necessary.
+limitsdfile=40-${PN}.conf
+
+python_check_deps() {
+ has_version -b "dev-python/docutils[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ default
+
+ einfo "Generating ${limitsdfile}"
+ cat > ${limitsdfile} <<- EOF || die
+ # Start of ${limitsdfile} from ${P}
+
+ @audio - memlock 256
+
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
+ # End of ${limitsdfile} from ${P}
+ EOF
+}
+
+multilib_src_configure() {
+ local emesonargs=(
+ -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ $(meson_native_use_feature zeroconf avahi)
+ $(meson_native_use_feature doc docs)
+ $(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone
+ $(meson_native_enabled man)
+ $(meson_feature test tests)
+ -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests
+ $(meson_native_use_feature gstreamer)
+ $(meson_native_use_feature gstreamer gstreamer-device-provider)
+ $(meson_native_use_feature systemd)
+
+ $(meson_native_use_feature system-service systemd-system-service)
+ -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
+ -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+
+ $(meson_native_use_feature systemd systemd-user-service)
+ $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
+ -Dspa-plugins=enabled
+ -Dalsa=enabled # Allows using kernel ALSA for sound I/O (NOTE: media-session is gone so IUSE=alsa/spa_alsa/alsa-backend might be possible)
+ -Daudiomixer=enabled # Matches upstream
+ -Daudioconvert=enabled # Matches upstream
+ $(meson_native_use_feature bluetooth bluez5)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsp-native)
+ $(meson_native_use_feature bluetooth bluez5-backend-hfp-native)
+ $(meson_native_use_feature bluetooth bluez5-backend-ofono)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsphfpd)
+ $(meson_native_use_feature bluetooth bluez5-codec-aac)
+ $(meson_native_use_feature bluetooth bluez5-codec-aptx)
+ $(meson_native_use_feature bluetooth bluez5-codec-ldac)
+ $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters)
+ $(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889
+ -Dcontrol=enabled # Matches upstream
+ -Daudiotestsrc=enabled # Matches upstream
+ -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020
+ -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph
+ $(meson_native_use_feature jack-client jack) # Allows PW to act as a JACK client
+ $(meson_use jack-sdk jack-devel)
+ $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" '')
+ -Dsupport=enabled # Miscellaneous/common plugins, such as null sink
+ -Devl=disabled # Matches upstream
+ -Dtest=disabled # fakesink and fakesource plugins
+ $(meson_native_use_feature lv2)
+ $(meson_native_use_feature v4l v4l2)
+ -Dlibcamera=disabled # libcamera is not in Portage tree
+ $(meson_native_use_feature ssl raop)
+ -Dvideoconvert=enabled # Matches upstream
+ -Dvideotestsrc=enabled # Matches upstream
+ -Dvolume=enabled # Matches upstream
+ -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream)
+ $(meson_native_use_feature extra pw-cat)
+ -Dudev=enabled
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
+ $(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
+ -Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build
+
+ # Just for bell sounds in X11 right now.
+ $(meson_native_use_feature X x11)
+ $(meson_native_use_feature X x11-xfixes)
+ $(meson_native_use_feature X libcanberra)
+ )
+
+ meson_src_configure
+}
+
+multilib_src_install() {
+ # Our custom DOCS do not exist in multilib source directory
+ DOCS= meson_src_install
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ insinto /etc/security/limits.d
+ doins ${limitsdfile}
+
+ if use pipewire-alsa; then
+ dodir /etc/alsa/conf.d
+ # These will break if someone has /etc that is a symbolic link to a subfolder! See #724222
+ # And the current dosym8 -r implementation is likely affected by the same issue, too.
+ dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf
+ dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/99-pipewire-default.conf
+ fi
+
+ if ! use systemd; then
+ insinto /etc/xdg/autostart
+ newins "${FILESDIR}"/pipewire.desktop-r1 pipewire.desktop
+
+ exeinto /usr/bin
+ newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher
+ eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
+ fi
+}
+
+pkg_postinst() {
+ elog "It is recommended to raise RLIMIT_MEMLOCK to 256 for users"
+ elog "using PipeWire. Do it either manually or add yourself"
+ elog "to the 'audio' group:"
+ elog
+ elog " usermod -aG audio <youruser>"
+ elog
+
+ if ! use jack-sdk; then
+ elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
+ elog "alternative libraries have been installed to a non-default location."
+ elog "To use them, put pw-jack <application> before every JACK application."
+ elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack"
+ elog "provider is still needed to compile the JACK applications themselves."
+ elog
+ fi
+
+ if use systemd; then
+ elog "When switching from PulseAudio, you may need to disable PulseAudio:"
+ elog
+ elog " systemctl --user disable pulseaudio.service pulseaudio.socket"
+ elog
+ elog "To use PipeWire, the user units must be manually enabled"
+ elog "by running this command as each user you use for desktop activities:"
+ elog
+ elog " systemctl --user enable pipewire.socket pipewire-pulse.socket"
+ elog
+ elog "A reboot is recommended to avoid interferences from still running"
+ elog "PulseAudio daemon."
+ elog
+ elog "Both new users and those upgrading need to enable WirePlumber"
+ elog "for relevant users:"
+ elog
+ elog " systemctl --user disable pipewire-media-session.service"
+ elog " systemctl --user --force enable wireplumber.service"
+ elog
+ elog "Root user may replace --user with --global to change system default"
+ elog "configuration for all of the above commands."
+ else
+ ewarn "PipeWire daemon startup has been moved to a launcher script!"
+ ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no"
+ ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all"
+ ewarn "lines similar to '{ path = /usr/bin/pipewire*' should be commented out)"
+ ewarn
+ ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from"
+ ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
+ ewarn "advised that a D-Bus user session is set up before starting the script."
+ ewarn
+ if has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon'; then
+ elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
+ elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable"
+ elog "autospawning of the original daemon by setting:"
+ elog
+ elog " autospawn = no"
+ elog
+ elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
+ elog
+ elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
+ elog "${EROOT}/usr/bin/gentoo-pipewire-launcher by commenting out the relevant"
+ elog "command:"
+ elog
+ elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &"
+ elog
+ fi
+ elog "NOTE:"
+ elog "Starting with PipeWire-0.3.30, this package is no longer installing its config"
+ elog "into ${EROOT}/etc/pipewire by default. In case you need to change"
+ elog "its config, please start by copying default config from ${EROOT}/usr/share/pipewire"
+ elog "and just override the sections you want to change."
+ fi
+ elog
+
+ elog "For latest tips and tricks, troubleshooting information and documentation"
+ elog "in general, please refer to https://wiki.gentoo.org/wiki/PipeWire"
+ elog
+
+ optfeature_header "The following can be installed for optional runtime features:"
+ optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+
+ if has_version 'net-misc/ofono' ; then
+ ewarn "Native backend has become default. Please disable oFono via:"
+ if systemd_is_booted ; then
+ ewarn "systemctl disable ofono"
+ else
+ ewarn "rc-update delete ofono"
+ fi
+ ewarn
+ fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
+}
diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild
index 033d3614a241..0a674de08b12 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -11,7 +11,14 @@ if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
inherit git-r3
else
- SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT=""
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+ else
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
+ fi
+
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
@@ -21,7 +28,7 @@ HOMEPAGE="https://pipewire.org/"
LICENSE="MIT LGPL-2.1+ GPL-2"
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
SLOT="0/0.4"
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl systemd test v4l X zeroconf"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
# Once replacing system JACK libraries is possible, it's likely that
# jack-client IUSE will need blocking to avoid users accidentally
@@ -29,7 +36,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir
# JACK's sink - doing so is likely to yield no audio, cause a CPU
# cycles consuming loop (and may even cause GUI crashes)!
-REQUIRED_USE="jack-sdk? ( !jack-client )"
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
RESTRICT="!test? ( test )"
@@ -81,10 +91,15 @@ RDEPEND="
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
ssl? ( dev-libs/openssl:= )
systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
v4l? ( media-libs/libv4l )
X? (
media-libs/libcanberra
x11-libs/libX11
+ x11-libs/libXfixes
)
zeroconf? ( net-dns/avahi )
"
@@ -93,7 +108,7 @@ DEPEND="${RDEPEND}"
# TODO: Consider use cases where pipewire is not used for driving audio
# Doing so with WirePlumber currently involves editing Lua scripts
-PDEPEND="media-video/wireplumber"
+PDEPEND=">=media-video/wireplumber-0.4.8-r3"
# Present RDEPEND that are currently always disabled due to the PW
# code using them being required to be disabled by Gentoo guidelines
@@ -128,6 +143,12 @@ src_prepare() {
@audio - memlock 256
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
# End of ${limitsdfile} from ${P}
EOF
}
@@ -146,7 +167,7 @@ multilib_src_configure() {
$(meson_native_use_feature gstreamer gstreamer-device-provider)
$(meson_native_use_feature systemd)
- -Dsystemd-system-service=disabled # Matches upstream
+ $(meson_native_use_feature system-service systemd-system-service)
-Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
@@ -193,6 +214,7 @@ multilib_src_configure() {
# Just for bell sounds in X11 right now.
$(meson_native_use_feature X x11)
+ $(meson_native_use_feature X x11-xfixes)
$(meson_native_use_feature X libcanberra)
)
@@ -316,4 +338,15 @@ pkg_postinst() {
fi
ewarn
fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
}