wrap seafile-server-tools to use python dependencies
- also fix seahub dependencies
This commit is contained in:
parent
e54c1770d1
commit
fb48e3c568
|
@ -5,6 +5,13 @@
|
|||
|
||||
let
|
||||
version = "7.0.5";
|
||||
python = python27;
|
||||
pythonPackages = python27Packages;
|
||||
seahubPythonDependencies = with pythonPackages; [
|
||||
django pytz django-statici18n djangorestframework django_compressor
|
||||
django-post_office django-constance gunicorn flup chardet dateutil six
|
||||
openpyxl pysqlite jsonfield pillow
|
||||
];
|
||||
seafile-server-core = stdenv.mkDerivation rec {
|
||||
name = "seafile-server-core";
|
||||
inherit version;
|
||||
|
@ -17,19 +24,24 @@
|
|||
# patch to work with latest, non-vulnerable libevhtp
|
||||
patches = [
|
||||
./recent_libevhtp.patch
|
||||
./django-version.patch
|
||||
];
|
||||
# `which` is called directly from python during buildPhase, so we need the binary
|
||||
nativeBuildInputs = [ autoconf automake libtool pkgconfig vala autoreconfHook which ];
|
||||
buildInputs = [ sqlite glib python27 libuuid openssl fuse libarchive ccnet-server libevent libsearpc libevhtp ];
|
||||
nativeBuildInputs = [ autoconf automake libtool pkgconfig vala autoreconfHook which pythonPackages.wrapPython ];
|
||||
buildInputs = [ sqlite glib python libuuid openssl fuse libarchive ccnet-server libevent libevhtp ];
|
||||
propagatedBuildInputs = [ libsearpc ] ++ seahubPythonDependencies;
|
||||
postFixup = ''
|
||||
buildPythonPath $propagatedBuildInputs
|
||||
wrapPythonProgramsIn "$out/bin" "$out $pythonPath"
|
||||
'';
|
||||
checkPhase = "bash ./run_tests.sh";
|
||||
propagatedBuildInputs = [ python27Packages.django ];
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.agpl3; # with additional OpenSSL linking exception
|
||||
maintainers = with maintainers; [ schmittlauch ];
|
||||
};
|
||||
};
|
||||
seahub = python27Packages.buildPythonApplication rec {
|
||||
seahub = pythonPackages.buildPythonApplication rec {
|
||||
name = "seahub";
|
||||
inherit version;
|
||||
src = fetchFromGitHub {
|
||||
|
@ -42,17 +54,13 @@
|
|||
installPhase = ''
|
||||
cp -r ./ $out
|
||||
'';
|
||||
propagatedBuildInputs = with python27Packages; [
|
||||
django pytz django-statici18n djangorestframework django_compressor
|
||||
django-post_office django-constance gunicorn flup chardet dateutil six
|
||||
openpyxl
|
||||
];
|
||||
propagatedBuildInputs = seahubPythonDependencies;
|
||||
meta = with lib; {
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ schmittlauch ];
|
||||
};
|
||||
};
|
||||
django-constance = python27Packages.buildPythonPackage rec {
|
||||
django-constance = pythonPackages.buildPythonPackage rec {
|
||||
pname = "django-constance";
|
||||
version = "1.0.1";
|
||||
src = fetchFromGitHub {
|
||||
|
@ -61,8 +69,8 @@
|
|||
rev = "bde7f7c";
|
||||
sha256 = "sha256:0m5hhylsrs6bn7ma04615r1n7jwykyw8kmbw1xqrkgxs259lm77h";
|
||||
};
|
||||
propagatedBuildInputs = with python27Packages; [ django ];
|
||||
checkInputs = [ python27Packages.redis python27Packages.coverage python27Packages.django-picklefield ];
|
||||
propagatedBuildInputs = with pythonPackages; [ django ];
|
||||
checkInputs = [ pythonPackages.redis pythonPackages.coverage pythonPackages.django-picklefield ];
|
||||
doCheck = false; # figure that out later
|
||||
meta = {
|
||||
license = lib.licenses.bsd3;
|
||||
|
@ -78,7 +86,7 @@
|
|||
sha256 = "sha256:0mi0d2b4jwg511r0pp2ws9cw8ab6njplwy2a03wn6zi8q8fpjl38";
|
||||
};
|
||||
|
||||
buildInputs = [ vala libsearpc libuuid sqlite openssl libevent glib python27 ]
|
||||
buildInputs = [ vala libsearpc libuuid sqlite openssl libevent glib python ]
|
||||
++ lib.optional (!withMysql) "--without-mysql";
|
||||
# `which` is called directly from python during buildPhase, so we need the binary
|
||||
nativeBuildInputs = [ autoconf automake libtool pkgconfig autoreconfHook which ];
|
||||
|
|
18
seafile-server/django-version.patch
Normal file
18
seafile-server/django-version.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
diff --git a/tools/seafile-admin b/tools/seafile-admin
|
||||
index 5e3658b..2fc2c08 100755
|
||||
--- a/tools/seafile-admin
|
||||
+++ b/tools/seafile-admin
|
||||
@@ -518,10 +518,10 @@ def init_seahub():
|
||||
|
||||
|
||||
def check_django_version():
|
||||
- '''Requires django 1.8'''
|
||||
+ '''Requires django 1.11 or later'''
|
||||
import django
|
||||
- if django.VERSION[0] != 1 or django.VERSION[1] != 8:
|
||||
- error('Django 1.8 is required')
|
||||
+ if django.VERSION[0] != 1 or django.VERSION[1] < 11:
|
||||
+ error('Django 1.11+ is required')
|
||||
del django
|
||||
|
||||
|
Loading…
Reference in a new issue