commit:     b74715adc6f5577229fdaa6b6c9a2537ff42771b
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 15 13:10:01 2026 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Thu Jan 15 14:40:51 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b74715ad

net-im/synapse: add 1.145.0

- Upstream switched from poetry to maturin.
- Upstream added transitive dependencies to pyproject.toml, which causes
  runtime failures if they are not present as the synapse actively
  checks for them. However, they are not present because they are not
  needed due to dependency changes in more recent versions of direct
  dependencies. The problematic ones are removed from pyproject.toml in
  prepare phase.

Link: https://github.com/element-hq/synapse/pull/19234
Link: https://github.com/element-hq/synapse/pull/19289
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 net-im/synapse/Manifest               |   4 +
 net-im/synapse/synapse-1.145.0.ebuild | 364 ++++++++++++++++++++++++++++++++++
 2 files changed, 368 insertions(+)

diff --git a/net-im/synapse/Manifest b/net-im/synapse/Manifest
index 8faba045a30e..fa7aae2a5e1c 100644
--- a/net-im/synapse/Manifest
+++ b/net-im/synapse/Manifest
@@ -80,6 +80,7 @@ DIST libc-0.2.174.crate 779933 BLAKE2B 
20ffcbbcad6961e732521940f0595039dc0576d85
 DIST libm-0.2.15.crate 156108 BLAKE2B 
0bf4cf92e877f3f7e0bdcd79a3d26a3802f1ba38d0da08e750d2e6107d5dde49cc626a63d55910e8d597175483b1cb55ccbe866059e06c2cb51519ac5402655d
 SHA512 
abee4d8d50a9d25f8d5cbada78877d53ea50d82434b888d170bd83a532bc0534190abbf877e38aba78c370c8cfdf9dc9955c8a8ba4640732e8e6deee3992ab41
 DIST litemap-0.8.0.crate 34344 BLAKE2B 
0f083fa9ecb78ef6de4c094db8a7cebe2ff47af6e46414c06cc0dd0e92ecca06c941dca6ea0ac1b4982f14f6027cad979fd37d19db6631e3952dffb6e33c8798
 SHA512 
61162bd55b28540ec2d61262698045a78efbfadc7e2fa248d9e0215fd7d3ce53a8c50ea0487f2f7df41149e41c0131849e507737e3bbae29cb69ea41dcb8e2d9
 DIST log-0.4.28.crate 51131 BLAKE2B 
2911509cabe6a69b60945e798f2afee934d865d21efa22d150288de6a27a797fe00ee4f249fc6f6d7a02e2efb7377d2a7188a8ed8cb692f76b94a0df56d74d83
 SHA512 
cea74c92c80f291360a7cdf022e3ce2f509b9051b415840ab2a159585384f3fe606289da00a6def0c3d666416c5fcda865e2ae4ad48df07618818e8486cd0209
+DIST log-0.4.29.crate 51515 BLAKE2B 
3f5dc889e895428f27ef107a63004c1b321793b865c29b20293adca81db4e25443e24354af37018c9a60dff1d54897c3b7b2c014a64280523f4a3586a7eeed24
 SHA512 
31bcf1669c27980f0a8500082c4d0cc500f6cc943518a3dacacc3ad4d8a0c238517f23c2c1969e5a22dbb5d25614adbf4e914c0557e45e1ebc8e7385b2ed14b3
 DIST lru-slab-0.1.2.crate 9090 BLAKE2B 
00b36c830cfbe3dc004106aaca3c66dcc780ca0e07af6e1f1b2b8d125d88fdcd0b0f3a9b01299279f09fba7c81b1a87178ee86385af1ee8f648e6f307d26dc2f
 SHA512 
eb93796ffaccafd2e2530efeaf60dab1eeb17fe61652a9299c220cea4dd9099239eb549ae1259ac272c5aa807eebfaec6db4dc5efc95ee59365d3fd1d413f60f
 DIST memchr-2.7.5.crate 97603 BLAKE2B 
ee41ef722d90265064db3ffe22d52eff8f7627ac1ae9b0bad6ca9fa06c1027dca8d67e594e03b03c944dbf85930d2dbf030c5aaed369020ca1a1ba00f153d91a
 SHA512 
2606ee16a7dc02db95dac17cebd2cac9deb2e23d7ea62972cdb19145c06eaf75631347a49c4e6ceeff89fb6e90e992f9bca0a9c955eb5130f89ba2bd865936e1
 DIST memoffset-0.9.1.crate 9032 BLAKE2B 
0aab55fe084134bb599c52d77c96400db40949b1013e7037747ada4fcec8dc4a124b6f3755f04b36e057eb2fb4a6bd6f07d6eebcf166f8a71405ef434d802fbf
 SHA512 
3a236c0f481e36973b9f805e454c2efe4dd375e6b4ee406b57145136c70d5fbf4e1183d563ebf3b5fbde7363bbf5f08f0d88e507aae5bda4cc75664ecd0e33aa
@@ -126,6 +127,7 @@ DIST regex-automata-0.4.13.crate 625250 BLAKE2B 
e8682eff5df93737430a783cd913265d
 DIST regex-syntax-0.8.5.crate 357541 BLAKE2B 
fc6d125f7a8574c37d81c75cbfd447cbcff736f2d9991b19814ffc1a414ebc5b76e84fb8fd36c983b38e8e391d165cdd9047832b0d9100f0e1ba7085484b7db5
 SHA512 
549d8d130fea9ec0d5806126f57f31d433f50e9328c5532ad417c44bb5488ec0d20acb0983dbe54dabaa0b453cbea4533cf7baac7144df119e8f78dfe55c5ab8
 DIST reqwest-0.12.23.crate 161307 BLAKE2B 
918ba48abce356d8af02b3bc5a3c47ae148455c4ae6b49afd8c90793fe97b861203939e0d8edf6fd2ccbfe23e65a2c4cbb155df3d7b1e3111ec1b834bac38d87
 SHA512 
c0998b4ddcc08ab31b358f8a56efcd6ce12951bf58ea2922828229ce270fad8bdf27e7c26dfc74e70a870921fe8b059329a251b67b63a3a45cb9044f28b4d6cb
 DIST reqwest-0.12.24.crate 159974 BLAKE2B 
bc331cb57bb28b9c40dadc32d488d6d77605497cfd6f41e246e07198ce83c254eb6e4818baf97fd31b83c94fb78c795d60ab9c4cf4c479799c23c37f57325004
 SHA512 
fa029c0f9acdd1511ea8b65e1b1c83d9c1de8f9495a587b5b143666902a1ec4f2a8f28b28b535ef12c5e92c12e540f7cdb23f7cc253b1574c4a88dd695c004e8
+DIST reqwest-0.12.26.crate 156458 BLAKE2B 
3f004931954009776e8f1c13654db4003163ca8fca5f1261d00da358545d134709cf76632bd0a5e4e661f053d6396c186eb5c9e5cdd50c6f3098fe4029bb596b
 SHA512 
9b563b177131f7a97a47a7e05b09e0f9291b1222a1719ea10b158f52daf5a4f01da830876821cb4deb00dec3207d0dd76514087bcb9b623deb33b37ed0b62780
 DIST ring-0.17.14.crate 1502610 BLAKE2B 
b33efb6d21931ab94f044373f24428e87015029a0e065071bfd901f8679d30944f6b27bf0325c77fc4bea7fcd935209087a349e5c279677bea73af6205725371
 SHA512 
88d38205dc1a1f89bd4ae887ec5c168e68a4b749b3ac0612674092331e99d14a9b8d0f4a98d72c1a3853bcc9da420402336da3ee053bedcfd598da8de93afa14
 DIST rustc-demangle-0.1.26.crate 30340 BLAKE2B 
aa4d90be1dc313db5777e7b47fd6e6d9ce7a96df3296060e0e062508fdb9a68adda2bfcaa18d501e33e41f08c2beeb0721901458aceb072fd5116d67003fd56f
 SHA512 
a3b32cdd685ee6f2112bb9d3a2d09dbf84efc5961a468adf1d784688f3f9761d9bab066be8969ea29d2251a08d4ae3ada872fb19b02f2aef8652ad50ec963348
 DIST rustc-hash-2.1.1.crate 14154 BLAKE2B 
7a1b3b82bbbf6a123512815c3e8f068a17890cbbb8b68e88a5a492f62469942fadd776207eebd913052a1c06e1fd37a549e86526b9fc8f08b9ca7cb0044ac16b
 SHA512 
87097d98d47f327d000041ab13acddc366f1500d9c3e5c82169c3358112c7a7c03701c9b3c2c81d9f9da65b7ebac1c479b179dfaf7c059cd0b929b4673e51084
@@ -157,6 +159,7 @@ DIST synapse-1.141.0.gh.tar.gz 9184982 BLAKE2B 
9e53cae480adbaf368c4d5a5b2a25828c
 DIST synapse-1.142.1.gh.tar.gz 9190189 BLAKE2B 
d0691d5ec468145ac53337bffcb8d9d067c7cd16b9f570a7fcb3c19c7e5618189ce1db3718c530c5baf6f44d6012036fca6e713b75e807d56227867d12719833
 SHA512 
f436ecb04c7925ee79229e4c885552747c311882d592e075ce304853ad64eea594db3e04fca3ea395a8384c9c6e6171d088fcad6de569f6ed91511c00bc1967e
 DIST synapse-1.143.0.gh.tar.gz 9191731 BLAKE2B 
4ef1ba787f613ac3a4998ef81c99d119f8992f5652472c4192c3e35f46d5a7e526625c783c864440fc1ee5304231b697682980aeaa8e71fe2123bc982efb9809
 SHA512 
e804e5845e65a8c37d517b30d1649c52cc4b5355c2c76633df55fd08f7da44d3ac935b196935b59eec81d16701ca4bc0567c0ce4de0d12f122bacca10c914bcf
 DIST synapse-1.144.0.gh.tar.gz 9204917 BLAKE2B 
c68c0bad9f1469d353be67d05dcf789b39035f5b885cef99e83a9de0a03fb06f6c08ec31e4f1867901f2e6b35d0374ac1b19d58b5393d50235b47d31b948524c
 SHA512 
87961796797ee1bba68b70c9e4dc04bd07ceab82f02a5c503adb34a66963b385081e30be68eb7f0ca218e66b1f350edd1b0650b19a481c3bc5e8503fe238ec8b
+DIST synapse-1.145.0.gh.tar.gz 9233987 BLAKE2B 
2cf1e6ca322e3b940da8f6213dae8949b81e1bf4f493e6efb74c1d80786ff73951b90aa6f5ae02e3f350a046f87f3ef5c9e0c3481ab2f988889d7d9d2ad46fb2
 SHA512 
698943dbdc3a64ef46e2758f33e8e326aeed43b79b5d1b37439c382695ec03308f1b9c865965f2e18d0530eab617578892ed9e673d80b067e9fc7ee8ba25fbbe
 DIST sync_wrapper-1.0.2.crate 6958 BLAKE2B 
b2e162f982ea827229dcff468bcf31c6286c57ea3491a909784cdb50b0ba36c3a1a6fbdc7b34fc2aa9a7df1d174393d61ea9dc7ab3439a5e1a1884e2473a70f8
 SHA512 
aa314a6ab3ba028d2a169ea55a50eecf3b73b475a81c91330430ece9f1734296562627a8c32fad51b5a26796931f364e2803b3a13075ccd9a0aa614d5220903c
 DIST synstructure-0.13.2.crate 18950 BLAKE2B 
c475f370d901a371262f466dd98e3914dd6f36aa473a33362866c0f781d27b1813233f96b02208f3463a825e8012cab0f8872eed848d9aa0eac88b581a0d261e
 SHA512 
2698f4e80b93f7cf1d8ae97c4c42a7f61e7b7081f7f1bbb94d7f48ab7ae813a666d73c49ba3812cda9155e0138b55cc246fb96e5858e411a8d32bafb3e2b2afb
 DIST target-lexicon-0.13.2.crate 27923 BLAKE2B 
0761f0ffdc23b9c9df86b384d59611c7b8b5e29ff068f03367ad2fe84cfb6d11e1af149b9338236978e9566fedc51387db9f239d2a602db41045ac3db907faec
 SHA512 
d25e3cc3d679cb6b6f24c03e0c24db9d6ca31b8ed42ac9531bd7637557fbba225a6c8ac4f68a8eaf3569195814d599e668a968afbc73b940a77cbc27552cc90a
@@ -171,6 +174,7 @@ DIST tokio-rustls-0.26.2.crate 31655 BLAKE2B 
44a569a4aa8c13f2153a18ac56e6ce6b5b9
 DIST tokio-util-0.7.15.crate 124255 BLAKE2B 
f24525a3ec474921cc5d8d1dc12355f8ea5e7747be5299eeff00664ec0f6f6edbc33bb1613f64dc47ee6117c0d32cb6f770bec72f3b0bd549aff392969097622
 SHA512 
032158c36673c589ba09c52fe37bd0c700956fc4f89a7991f3cf93b04c8a12d51d1e05b8c6f493c7ebae7985e653bc3fb8bad590cefe329a1b1fa94182649520
 DIST tower-0.5.2.crate 109417 BLAKE2B 
414f17e97102224f1fdf23a03e6aa958e0a2d6cfcfce93ac3f2e911d68267aee33aa079c94540626ec3fa895e1780e6e5d18b4831f9f05cdf3e8c26ff73b7279
 SHA512 
e89c4ffd83fec3566334a4c4e9151ddeabfd3437269afc8bffb46201391bc1cdc82cbb97c69643a30f8873e87c511ad9aefc6c081241a4419fe315c99c61ffce
 DIST tower-http-0.6.6.crate 133515 BLAKE2B 
ae9db0b0860a4f7dbec94d9053dc2d6f539700226e46f901187cffd47f04b013e8e241338edd4a47bd009419b508315855e3ec7bc0bc68e0228f6058c3b697d6
 SHA512 
30352ffd99f5679c858ca2ce518035ad1fda674040e1fdc09e3d4df3db4caef3a4d1a917574b3c1b5181a41955414d2a87d3bc14ff169b244006430af47dbea2
+DIST tower-http-0.6.8.crate 135827 BLAKE2B 
1f3e5a012eae5a83a2ce7831f95a501b35fda648617d297283c43f7796960d039df95397a9179eb47458974e5ca843f72fb73a905e58aaaacf3d94718adbde51
 SHA512 
6ed83fe61b74a6e168710200a0c01f98f0b559afae6d98b77aaec8b4e8c737d2d18b534d4e1dde5efb78f53854521a759770521cebe56adb863d76f4ba34a5c5
 DIST tower-layer-0.3.3.crate 6180 BLAKE2B 
20435102dd62113c3e961bb28d7b18ac6f8ec6d5f0051f511e6f5eb044b20016f247ddd1b8eae9dc9f1ee259d8cc31e0bbddd26f5a22fadeea4007a3011b8500
 SHA512 
edf36671076cd29bb32c29351b648afbf3e7134316988a697c7807db62de7a63cb0339e4db7c0f36ed60d8aced7f3e493318cccc272070c037b01e2dd189b934
 DIST tower-service-0.3.3.crate 6950 BLAKE2B 
32ca66bff783eeb015af982b539acb63c9d426b931832b27aa45088382712df3894132a9e6e96fe1ed9d0f9e582b7a25b33e0ab73711acb06b4e134e69158452
 SHA512 
770cbca46d8500ff36fe84a9a420beb84a0e893dbeaccdd93a3970e746c893b5d32580182ef3017662f421e4b2d71f079ed2cf1727dcd5fc3443a4484f9b43fd
 DIST tracing-0.1.41.crate 82448 BLAKE2B 
c056d938e001654e03efaec7a11eb8ecfbdfe9af2099271fcefa43f4f4683b40c59f7111fdf7f27df4da38bcbe94f1b2ac0abb6ec3d6e6a0d165b9fbb14da3a3
 SHA512 
dffb8d3a1375f1b9d5418550a46cb7b1d92b2cc8ffbccb430a38f7731547960775bb42798074186711847d256eee30fb3e74078b69cb36f28c07d9f231dbf96c

diff --git a/net-im/synapse/synapse-1.145.0.ebuild 
b/net-im/synapse/synapse-1.145.0.ebuild
new file mode 100644
index 000000000000..baf4187b703e
--- /dev/null
+++ b/net-im/synapse/synapse-1.145.0.ebuild
@@ -0,0 +1,364 @@
+# Copyright 2022-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=maturin
+PYTHON_COMPAT=( python3_{11..14} )
+
+RUST_MIN_VER="1.82.0"
+CRATES="
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]+wasi-snapshot-preview1
+       [email protected]+wasi-0.2.4
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+"
+
+inherit cargo distutils-r1 multiprocessing optfeature systemd
+
+DESCRIPTION="Reference implementation of Matrix homeserver"
+HOMEPAGE="
+       https://matrix.org/
+       https://github.com/element-hq/synapse
+"
+SRC_URI="
+       https://github.com/element-hq/${PN}/archive/v${PV}.tar.gz
+               -> ${P}.gh.tar.gz
+       ${CARGO_CRATE_URIS}
+"
+
+LICENSE="|| ( AGPL-3+ Element-Commercial )"
+# Dependent crate licenses
+LICENSE+="
+       Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD ISC MIT Unicode-3.0
+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+IUSE="postgres selinux systemd test"
+RESTRICT="!test? ( test )"
+
+# Fails to run with =prometheus-client-0.24, see upstream issue
+# https://github.com/element-hq/synapse/issues/19375
+RDEPEND="
+       acct-user/synapse
+       acct-group/synapse
+       dev-python/attrs[${PYTHON_USEDEP}]
+       dev-python/bcrypt[${PYTHON_USEDEP}]
+       dev-python/bleach[${PYTHON_USEDEP}]
+       >=dev-python/canonicaljson-2[${PYTHON_USEDEP}]
+       dev-python/cryptography[${PYTHON_USEDEP}]
+       dev-python/ijson[${PYTHON_USEDEP}]
+       dev-python/immutabledict[${PYTHON_USEDEP}]
+       >=dev-python/jinja2-3.0[${PYTHON_USEDEP}]
+       dev-python/jsonschema[${PYTHON_USEDEP}]
+       >=dev-python/matrix-common-1.3.0[${PYTHON_USEDEP}]
+       dev-python/msgpack[${PYTHON_USEDEP}]
+       dev-python/netaddr[${PYTHON_USEDEP}]
+       dev-python/packaging[${PYTHON_USEDEP}]
+       dev-python/phonenumbers[${PYTHON_USEDEP}]
+       >=dev-python/pillow-10.0.1[${PYTHON_USEDEP},webp]
+       <dev-python/prometheus-client-0.24[${PYTHON_USEDEP}]
+       dev-python/pyasn1-modules[${PYTHON_USEDEP}]
+       dev-python/pyasn1[${PYTHON_USEDEP}]
+       dev-python/pydantic[${PYTHON_USEDEP}]
+       dev-python/pymacaroons[${PYTHON_USEDEP}]
+       dev-python/pyopenssl[${PYTHON_USEDEP}]
+       >=dev-python/python-multipart-0.0.12-r100[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/service-identity[${PYTHON_USEDEP}]
+       dev-python/signedjson[${PYTHON_USEDEP}]
+       dev-python/sortedcontainers[${PYTHON_USEDEP}]
+       dev-python/treq[${PYTHON_USEDEP}]
+       dev-python/twisted[${PYTHON_USEDEP}]
+       dev-python/typing-extensions[${PYTHON_USEDEP}]
+       dev-python/unpaddedbase64[${PYTHON_USEDEP}]
+       postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
+       selinux? ( sec-policy/selinux-matrixd )
+       systemd? ( dev-python/python-systemd[${PYTHON_USEDEP}] )
+"
+BDEPEND="
+       acct-user/synapse
+       acct-group/synapse
+       dev-python/setuptools-rust[${PYTHON_USEDEP}]
+       test? (
+               ${RDEPEND}
+               dev-python/hiredis[${PYTHON_USEDEP}]
+               dev-python/idna[${PYTHON_USEDEP}]
+               dev-python/parameterized[${PYTHON_USEDEP}]
+               dev-python/txredisapi[${PYTHON_USEDEP}]
+               postgres? ( dev-db/postgresql[server] )
+       )
+"
+
+# Rust extension
+QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so"
+
+src_prepare() {
+       # Upstream added transitive dependencies to pyproject.toml in PR [1]. 
Some
+       # of them are no longer depencencies of direct dependencies, but synapse
+       # checks for them anyway, and throws an error if they are not present.
+       # Following sed removes the those causing failures.
+       #
+       # [1] https://github.com/element-hq/synapse/pull/19289
+       sed -i -e '/pyrsistent/d' -e '/pyparsing/d' pyproject.toml || die
+
+       distutils-r1_src_prepare
+}
+
+src_test() {
+       if use postgres; then
+               einfo "Preparing postgres test instance"
+               initdb --pgdata="${T}/pgsql" || die
+               pg_ctl --wait --pgdata="${T}/pgsql" start \
+                       --options="-h '' -k '${T}'" || die
+               createdb --host="${T}" synapse_test || die
+
+               # See 
https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#running-tests-under-postgresql
+               local -x SYNAPSE_POSTGRES=1
+               local -x SYNAPSE_POSTGRES_HOST="${T}"
+       fi
+
+       # This remove is necessary otherwise python is not able to locate
+       # synapse_rust.abi3.so.
+       rm -rf synapse || die
+
+       nonfatal distutils-r1_src_test
+       local ret=${?}
+
+       if use postgres; then
+               einfo "Stopping postgres test instance"
+               pg_ctl --wait --pgdata="${T}/pgsql" stop || die
+       fi
+
+       [[ ${ret} -ne 0 ]] && die
+}
+
+python_test() {
+       "${EPYTHON}" -m twisted.trial -j "$(makeopts_jobs)" tests
+}
+
+src_install() {
+       distutils-r1_src_install
+       keepdir /var/{lib,log}/synapse /etc/synapse
+       fowners synapse:synapse /var/{lib,log}/synapse /etc/synapse
+       fperms 0750 /var/{lib,log}/synapse /etc/synapse
+       newinitd "${FILESDIR}/${PN}.initd-r1" "${PN}"
+       systemd_dounit "${FILESDIR}/synapse.service"
+}
+
+pkg_postinst() {
+       optfeature "Redis support" dev-python/txredisapi
+       optfeature "VoIP relaying on your homeserver with turn" net-im/coturn
+
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               einfo
+               elog "In order to generate initial configuration run:"
+               elog "sudo -u synapse synapse_homeserver \\"
+               elog "    --server-name matrix.domain.tld \\"
+               elog "    --config-path /etc/synapse/homeserver.yaml \\"
+               elog "    --generate-config \\"
+               elog "    --data-directory /var/lib/synapse \\"
+               elog "    --report-stats=no"
+               einfo
+       else
+               einfo
+               elog "Please refer to upgrade notes if any special steps are 
required"
+               elog "to upgrade from the version you currently have installed:"
+               elog
+               elog "  
https://github.com/element-hq/synapse/blob/develop/docs/upgrade.md";
+               einfo
+       fi
+}

Reply via email to