expose python environment throug sub-attribute, for accessing python interpreter to run admin scripts
This commit is contained in:
parent
9dde0d319f
commit
8b73ec0585
3 changed files with 19 additions and 13 deletions
|
@ -49,6 +49,8 @@ let
|
|||
pycryptodome
|
||||
]
|
||||
++ map (p: p.override { inherit django; }) djangoModules; # build django modules with required version
|
||||
# defining them here to be able to expose them in a python environment as well
|
||||
pythonEnvDeps = seahubPythonDependencies ++ [ libsearpc ];
|
||||
seafile-server-core = stdenv.mkDerivation rec {
|
||||
name = "seafile-server-core";
|
||||
inherit version;
|
||||
|
@ -66,7 +68,7 @@ let
|
|||
# `which` is called directly from python during buildPhase, so we need the binary
|
||||
nativeBuildInputs = [ autoconf automake libtool pkgconfig vala autoreconfHook which pythonPackages.wrapPython ];
|
||||
buildInputs = [ sqlite glib python libuuid openssl oniguruma fuse libarchive libevent libevhtp ];
|
||||
propagatedBuildInputs = [ libsearpc ] ++ seahubPythonDependencies;
|
||||
propagatedBuildInputs = pythonEnvDeps;
|
||||
# copy manual to required location
|
||||
postInstall = ''
|
||||
mkdir $out/doc
|
||||
|
@ -127,6 +129,7 @@ stdenv.mkDerivation {
|
|||
name = "seafile-server";
|
||||
inherit version;
|
||||
|
||||
nativeBuildInputs = [ python3Packages.wrapPython ];
|
||||
buildInputs = [ seahub seafile-server-core libsearpc ]
|
||||
++ lib.optional withMysql libmysqlclient;
|
||||
phases = [ "installPhase" "fixupPhase" "distPhase" ];
|
||||
|
@ -145,10 +148,21 @@ stdenv.mkDerivation {
|
|||
cp -r ${seafile-server-core.src}/scripts/upgrade .
|
||||
cp -r ${seafile-server-core.src}/scripts/sql .
|
||||
# copy_user_manual is already done in the postInstall hook of seafile-server-core
|
||||
# python admin scripts need to be made executable and patched with python path
|
||||
chmod ugo+x *.py
|
||||
buildPythonPath $propagatedBuildInputs
|
||||
wrapPythonProgramsIn "$out/*.py" "$out $pythonPath"
|
||||
|
||||
echo -n "${version}" > installed_version
|
||||
'';
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ schmittlauch ];
|
||||
license = licenses.free; # components with different free software licenses are combined
|
||||
};
|
||||
inherit seafile-server-core seahub;# for using the path in the NixOS module
|
||||
|
||||
pythonEnv = python3.buildEnv.override {
|
||||
extraLibs = pythonEnvDeps;
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue