matrix-synapse: Prune deps, add missing deps, expose extras

Drops extra arguments on the package, as they will be moved over into
the module in a more discoverable way next.

Also reduces overly broad `with`-scoping.
This commit is contained in:
Martin Weinelt 2023-03-15 13:12:37 +01:00
parent 446b09fd3d
commit fd429f5bac
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1,7 +1,12 @@
{ lib, stdenv, fetchFromGitHub, python3, openssl, cargo, rustPlatform, rustc
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform python3.pkgs.systemd
{ lib
, stdenv
, fetchFromGitHub
, python3
, openssl
, cargo
, rustPlatform
, rustc
, nixosTests
, enableRedis ? true
, callPackage
}:
@ -9,8 +14,7 @@ let
plugins = python3.pkgs.callPackage ./plugins { };
tools = callPackage ./tools { };
in
with python3.pkgs;
buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "matrix-synapse";
version = "1.87.0";
format = "pyproject";
@ -34,7 +38,7 @@ buildPythonApplication rec {
sed -i '/^setuptools_rust =/d' pyproject.toml
'';
nativeBuildInputs = [
nativeBuildInputs = with python3.pkgs; [
poetry-core
rustPlatform.cargoSetupHook
setuptools-rust
@ -42,47 +46,90 @@ buildPythonApplication rec {
rustc
];
buildInputs = [ openssl ];
buildInputs = [
openssl
];
propagatedBuildInputs = [
authlib
propagatedBuildInputs = with python3.pkgs; [
attrs
bcrypt
bleach
canonicaljson
daemonize
cryptography
ijson
immutabledict
jinja2
jsonschema
lxml
matrix-common
msgpack
netaddr
packaging
phonenumbers
pillow
prometheus-client
psutil
psycopg2
pyasn1
pyasn1-modules
pydantic
pyicu
pymacaroons
pynacl
pyopenssl
pysaml2
pyyaml
requests
setuptools
service-identity
signedjson
sortedcontainers
treq
twisted
typing-extensions
unpaddedbase64
] ++ lib.optional enableSystemd systemd
++ lib.optionals enableRedis [ hiredis txredisapi ];
]
++ twisted.optional-dependencies.tls;
nativeCheckInputs = [ mock parameterized openssl ];
passthru.optional-dependencies = with python3.pkgs; {
postgres = if isPyPy then [
psycopg2cffi
] else [
psycopg2
];
saml2 = [
pysaml2
];
oidc = [
authlib
];
systemd = [
systemd
];
url-preview = [
lxml
];
sentry = [
sentry-sdk
];
opentracing = [
jaeger-client
opentracing
];
jwt = [
authlib
];
redis = [
hiredis
txredisapi
];
cache-memory = [
pympler
];
user-search = [
pyicu
];
};
nativeCheckInputs = [
openssl
] ++ (with python3.pkgs; [
mock
parameterized
])
++ lib.flatten (lib.attrValues passthru.optional-dependencies);
doCheck = !stdenv.isDarwin;
@ -112,6 +159,7 @@ buildPythonApplication rec {
meta = with lib; {
homepage = "https://matrix.org";
changelog = "https://github.com/matrix-org/synapse/releases/tag/v${version}";
description = "Matrix reference homeserver";
license = licenses.asl20;
maintainers = teams.matrix.members;