2023-06-03 00:44:30 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, makeWrapper
|
|
|
|
, matrix-synapse-unwrapped
|
|
|
|
, extras ? [
|
|
|
|
"postgres"
|
|
|
|
"url-preview"
|
|
|
|
"user-search"
|
|
|
|
] ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform matrix-synapse-unwrapped.python.pkgs.systemd) "systemd"
|
|
|
|
, plugins ? [ ]
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-07-31 16:54:17 +00:00
|
|
|
extraPackages = lib.concatMap (extra: matrix-synapse-unwrapped.optional-dependencies.${extra}) (lib.unique extras);
|
2023-06-03 00:44:30 +00:00
|
|
|
|
2023-12-10 02:21:27 +00:00
|
|
|
pythonEnv = matrix-synapse-unwrapped.python.buildEnv.override {
|
|
|
|
extraLibs = extraPackages ++ plugins;
|
2023-06-03 00:44:30 +00:00
|
|
|
};
|
|
|
|
|
2023-12-10 02:21:27 +00:00
|
|
|
searchPath = "${pythonEnv}/${matrix-synapse-unwrapped.python.sitePackages}";
|
2023-06-03 00:44:30 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = (lib.appendToName "wrapped" matrix-synapse-unwrapped).name;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
for bin in ${matrix-synapse-unwrapped}/bin/*; do
|
|
|
|
echo $bin
|
|
|
|
makeWrapper "$bin" "$out/bin/$(basename $bin)" \
|
2023-07-31 16:46:43 +00:00
|
|
|
--set PYTHONPATH ${searchPath}
|
2023-06-03 00:44:30 +00:00
|
|
|
done;
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
unwrapped = matrix-synapse-unwrapped;
|
|
|
|
|
|
|
|
# for backward compatibility
|
2024-08-02 20:29:19 +00:00
|
|
|
inherit (matrix-synapse-unwrapped) plugins tests tools;
|
2023-06-03 00:44:30 +00:00
|
|
|
};
|
2024-02-02 02:06:53 +00:00
|
|
|
|
|
|
|
# Carry the maintainer, licenses, and various useful information.
|
|
|
|
inherit (matrix-synapse-unwrapped) meta;
|
2023-06-03 00:44:30 +00:00
|
|
|
}
|