matrix-synapse: Add wrapper to configure extras
The original matrix-synapse packages is now available with the -unwrapped prefix.
This commit is contained in:
parent
fd429f5bac
commit
3453128510
5 changed files with 54 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
|||
, fetchPypi
|
||||
, ldap3
|
||||
, ldaptor
|
||||
, matrix-synapse
|
||||
, matrix-synapse-unwrapped
|
||||
, pytestCheckHook
|
||||
, service-identity
|
||||
, setuptools
|
||||
|
@ -33,7 +33,7 @@ buildPythonPackage rec {
|
|||
|
||||
propagatedBuildInputs = [ service-identity ldap3 twisted ];
|
||||
|
||||
nativeCheckInputs = [ ldaptor matrix-synapse pytestCheckHook ];
|
||||
nativeCheckInputs = [ ldaptor matrix-synapse-unwrapped pytestCheckHook ];
|
||||
|
||||
pythonImportsCheck = [ "ldap_auth_provider" ];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, matrix-synapse }:
|
||||
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, matrix-synapse-unwrapped }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "matrix-synapse-mjolnir-antispam";
|
||||
|
@ -13,7 +13,7 @@ buildPythonPackage rec {
|
|||
|
||||
sourceRoot = "./source/synapse_antispam";
|
||||
|
||||
buildInputs = [ matrix-synapse ];
|
||||
buildInputs = [ matrix-synapse-unwrapped ];
|
||||
|
||||
doCheck = false; # no tests
|
||||
pythonImportsCheck = [ "mjolnir" ];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, buildPythonPackage, fetchFromGitHub, matrix-synapse, twisted }:
|
||||
{ lib, buildPythonPackage, fetchFromGitHub, matrix-synapse-unwrapped, twisted }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "matrix-synapse-shared-secret-auth";
|
||||
|
@ -14,7 +14,7 @@ buildPythonPackage rec {
|
|||
doCheck = false;
|
||||
pythonImportsCheck = [ "shared_secret_authenticator" ];
|
||||
|
||||
buildInputs = [ matrix-synapse ];
|
||||
buildInputs = [ matrix-synapse-unwrapped ];
|
||||
propagatedBuildInputs = [ twisted ];
|
||||
|
||||
meta = with lib; {
|
||||
|
|
44
pkgs/servers/matrix-synapse/wrapper.nix
Normal file
44
pkgs/servers/matrix-synapse/wrapper.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ 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
|
||||
extraPackages = lib.concatMap (extra: matrix-synapse-unwrapped.optional-dependencies.${extra}) extras;
|
||||
|
||||
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)" \
|
||||
--set PYTHONPATH=${searchPath}
|
||||
done;
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
unwrapped = matrix-synapse-unwrapped;
|
||||
|
||||
# for backward compatibility
|
||||
inherit (matrix-synapse-unwrapped) plugins tools;
|
||||
};
|
||||
}
|
|
@ -9624,11 +9624,10 @@ with pkgs;
|
|||
|
||||
matrix-sliding-sync = callPackage ../servers/matrix-synapse/sliding-sync { };
|
||||
|
||||
matrix-synapse = callPackage ../servers/matrix-synapse { };
|
||||
|
||||
matrix-synapse-plugins = recurseIntoAttrs matrix-synapse.plugins;
|
||||
|
||||
matrix-synapse-tools = recurseIntoAttrs matrix-synapse.tools;
|
||||
matrix-synapse = callPackage ../servers/matrix-synapse/wrapper.nix { };
|
||||
matrix-synapse-unwrapped = callPackage ../servers/matrix-synapse/default.nix { };
|
||||
matrix-synapse-plugins = recurseIntoAttrs matrix-synapse-unwrapped.plugins;
|
||||
matrix-synapse-tools = recurseIntoAttrs matrix-synapse-unwrapped.tools;
|
||||
|
||||
matrix-appservice-irc = callPackage ../servers/matrix-synapse/matrix-appservice-irc { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue