2023-06-03 02:44:30 +02: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 18:54:17 +02:00
|
|
|
extraPackages = lib.concatMap (extra: matrix-synapse-unwrapped.optional-dependencies.${extra}) (lib.unique extras);
|
2023-06-03 02:44:30 +02:00
|
|
|
|
|
|
|
pluginsEnv = matrix-synapse-unwrapped.python.buildEnv.override {
|
|
|
|
extraLibs = plugins;
|
|
|
|
};
|
|
|
|
|
|
|
|
searchPath = lib.makeSearchPathOutput "lib" matrix-synapse-unwrapped.python.sitePackages (extraPackages ++ [ pluginsEnv ]);
|
|
|
|
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 18:46:43 +02:00
|
|
|
--set PYTHONPATH ${searchPath}
|
2023-06-03 02:44:30 +02:00
|
|
|
done;
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
unwrapped = matrix-synapse-unwrapped;
|
|
|
|
|
|
|
|
# for backward compatibility
|
|
|
|
inherit (matrix-synapse-unwrapped) plugins tools;
|
|
|
|
};
|
|
|
|
}
|