blob: 9a76147371d52efa98e838cb18947e275d71ff75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
# Maintainer: Ivan Shapovalov <intelfx@intelfx.name>
# Contributor: Johannes Löthberg <johannes@kyriasis.com>
# Contributor: Alexander Epaneshnikov <alex19ep@archlinux.org>
pkgname=matrix-synapse-git
_pkgname=matrix-synapse
pkgver=1.145.0.r0.g27223a349c
pkgrel=1
pkgdesc="Matrix reference homeserver"
url="https://github.com/element-hq/synapse"
arch=('x86_64')
license=('AGPL-3.0-or-later')
depends=(
'gcc-libs'
'glibc'
'libwebp'
'python'
'python-jsonschema'
'python-immutabledict'
'python-unpaddedbase64'
'python-canonicaljson'
'python-signedjson'
'python-service-identity'
'python-twisted'
'python-treq'
'python-pyopenssl'
'python-yaml'
'python-pyasn1'
'python-pyasn1-modules'
'python-bcrypt'
'python-pillow'
'python-sortedcontainers'
'python-pymacaroons'
'python-msgpack'
'python-phonenumbers'
'python-prometheus_client'
'python-attrs'
'python-netaddr'
'python-jinja'
'python-bleach'
'python-typing_extensions'
'python-cryptography'
'python-ijson'
'python-matrix-common'
'python-packaging'
'python-importlib-metadata'
'python-pydantic'
'python-pyparsing'
'python-pyrsistent' # AUR
'python-python-multipart>=0.0.9'
'python-systemd'
'systemd'
)
makedepends=(
'git'
'python-build'
'python-installer'
'python-wheel'
'python-setuptools-rust'
'python-maturin'
)
checkdepends=(
'python-pip'
'python-authlib'
'python-lxml'
'python-pyjwt'
'python-txredisapi'
'python-hiredis'
'python-parameterized'
'python-idna'
'python-pyicu'
'postgresql'
)
optdepends=(
'perl: sync_room_to_group.pl'
'python-psycopg2: PostgreSQL support'
'python-pysaml2: SAML2 support'
'python-authlib: OIDC support'
'python-authlib: JWT support'
'python-lxml: URL previewing'
'python-sentry_sdk: Sentry support'
'python-opentracing: tracing support'
'python-jaeger-client: tracing support'
'python-txredisapi: worker communication via Redis'
'python-hiredis: faster worker communication via Redis'
'python-pympler: experimental `caches.track_memory_usage` config option'
'python-matrix-synapse-ldap3: LDAP provider'
'python-pyicu: Improve user search for international display names'
)
source=(
"$_pkgname::git+https://github.com/element-hq/synapse.git#branch=master"
'matrix-synapse-fix-worker-test-race.patch'
'matrix-synapse-fix-prometheus-client.patch'
'generic_worker.yaml.example'
'synapse.service'
'synapse.target'
'synapse-worker@.service'
'sysusers-synapse.conf'
'tmpfiles-synapse.conf'
'override-hardened.conf'
)
sha256sums=('SKIP'
'751d0cb122b3c17cb4a2142461ac99bbaec798f1e4b357dd41ec4041e5623d35'
'1be6f003004c720bfaf2f2589315127b20e1be4df87ebb1a260e622825064c90'
'f67334856609997eac26939d77cfc520e78e98d3755543ab730d83a0f362a35e'
'74af0bc2f57e5ced1a44f2438922d420cbb7defedae784cac02ef125f276a2ed'
'408527271e1250beb20531f140b91201ed464e42f7eb3f47f02967a2ac23a661'
'c9657c201ad89985c8c915bfa0ea7517a412071736b4d9545d8f6474fddc44e2'
'574175c27a4f07d4ce6a676d86b697c82c36b796442d0955881da588b6f4bb65'
'65588c8c64dfb84cab831cd8d028a295d753cf7322dd63053e8488466047b45f'
'086a7e95235afac128df9d2ea981e3c50d08e08c9132087063bb354bc9063d93')
backup=('etc/synapse/log_config.yaml')
install=synapse.install
validpgpkeys=('02450A9EDDFEE3E0C730B786A7E4A57880C3A4A9'
'053191DFF4670330465227F7A542E4ED1B0FAC09'
'283F86EA415D64E7D98E085BD5804497C6468FC1'
'58C4E75BC67C92169A7FDD11FBCE0ACE0732186F'
'9323BC4F687435CA8D0F03CB922F57ACB93AABF9'
'93B2970FB2FD8855AD6E0229CB2B33F7C23D44C6'
'D79D3CA0B61429A8A760525A903ECE108A39DEDD'
'F124520CEEE062448FE1C8442D2EFA2F32FBE047'
'177B595E4DFCB510C556750833FC58F6A7113048')
provides=('matrix-synapse')
conflicts=('matrix-synapse')
replaces=('matrix-synapse-py3-git')
pkgver() {
cd $_pkgname
git describe --long --tags | sed 's/^v//;s/-rc/rc/;s/-r/./;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd $_pkgname
git apply -3 "$srcdir/matrix-synapse-fix-worker-test-race.patch"
# fix incompatibility with prometheus-client==0.24.0
git apply -3 "$srcdir/matrix-synapse-fix-prometheus-client.patch"
# _Disable_ cross-toolchain LTO because we are using different toolchains
# for C/C++ and Rust code (i.e., LLVM LTO is incompatible with GCC LTO).
# In this project, C/C++ code is linked into Rust code. Therefore, apply
# a workaround to force generation of normal object code on C side:
CFLAGS+=" -ffat-lto-objects"
CXXFLAGS+=" -ffat-lto-objects"
}
build() {
cd $_pkgname
python -m build --wheel --no-isolation
}
check() {
cd $_pkgname
python -m venv --system-site-packages test-env
test-env/bin/python -m installer dist/*.whl
local site_packages=$(test-env/bin/python -c "import site; print(site.getsitepackages()[0])")
mkdir test-dir
cd test-dir
ln -sv "$site_packages/synapse" ../tests -t .
PYTHONPATH="$PWD" PATH="../test-env/bin:$PATH" ../test-env/bin/python -m twisted.trial -j$(nproc) tests
}
package() {
cd $_pkgname
python -m installer --destdir="$pkgdir" dist/*.whl
install -vdm755 -o 198 -g 198 "$pkgdir"/etc/synapse
install -vDm644 contrib/systemd/log_config.yaml "$pkgdir"/etc/synapse/log_config.yaml
install -vDm644 "$srcdir"/generic_worker.yaml.example "$pkgdir"/etc/synapse/workers/generic_worker.yaml.example
install -vDm644 "$srcdir/override-hardened.conf" -t "$pkgdir/usr/lib/systemd/system/synapse.service.d"
install -vDm644 "$srcdir/override-hardened.conf" -t "$pkgdir/usr/lib/systemd/system/synapse-worker@.service.d"
install -vDm644 -t "$pkgdir"/usr/lib/systemd/system/ "$srcdir"/synapse{,-worker@}.service "$srcdir"/synapse.target
install -vDm644 "$srcdir"/sysusers-synapse.conf "$pkgdir"/usr/lib/sysusers.d/synapse.conf
install -vDm644 "$srcdir"/tmpfiles-synapse.conf "$pkgdir"/usr/lib/tmpfiles.d/synapse.conf
}
|