Trolli Schmittlauch
e54c1770d1
- downgrade to the latest stable seafile-server - switch to a stable libsearpc version - adapt & backport libevhtp patch
113 lines
4.3 KiB
Nix
113 lines
4.3 KiB
Nix
{ stdenv, lib, fetchFromGitHub,
|
|
autoconf, automake, autoreconfHook, pkgconfig, curl, libevent, glib, libuuid, intltool, sqlite, withMysql ? true, libmysql, libarchive, libtool, jansson, vala, fuse, openssl, libevhtp, ccnet, libsearpc, which,
|
|
# for SeaHub
|
|
python27, python27Packages }:
|
|
|
|
let
|
|
version = "7.0.5";
|
|
seafile-server-core = stdenv.mkDerivation rec {
|
|
name = "seafile-server-core";
|
|
inherit version;
|
|
src = fetchFromGitHub {
|
|
owner = "haiwen";
|
|
repo = "seafile-server";
|
|
rev = "v${version}-server";
|
|
sha256 = "sha256:1875qsdcy6lw0nkjqjg8qwahwqxm8iy02lw8012s5qp91jcg8gpl";
|
|
};
|
|
# patch to work with latest, non-vulnerable libevhtp
|
|
patches = [
|
|
./recent_libevhtp.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 ];
|
|
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 {
|
|
name = "seahub";
|
|
inherit version;
|
|
src = fetchFromGitHub {
|
|
owner = "haiwen";
|
|
repo = "seahub";
|
|
rev = "v${version}-server";
|
|
sha256 = "sha256:04wy0cj76j8kwgnx6iqja5gpc3q661lcy64qpqf3bzi907bad6xp";
|
|
};
|
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" "distPhase" ];
|
|
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
|
|
];
|
|
meta = with lib; {
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ schmittlauch ];
|
|
};
|
|
};
|
|
django-constance = python27Packages.buildPythonPackage rec {
|
|
pname = "django-constance";
|
|
version = "1.0.1";
|
|
src = fetchFromGitHub {
|
|
owner = "haiwen";
|
|
repo = pname;
|
|
rev = "bde7f7c";
|
|
sha256 = "sha256:0m5hhylsrs6bn7ma04615r1n7jwykyw8kmbw1xqrkgxs259lm77h";
|
|
};
|
|
propagatedBuildInputs = with python27Packages; [ django ];
|
|
checkInputs = [ python27Packages.redis python27Packages.coverage python27Packages.django-picklefield ];
|
|
doCheck = false; # figure that out later
|
|
meta = {
|
|
license = lib.licenses.bsd3;
|
|
};
|
|
};
|
|
ccnet-server = stdenv.mkDerivation rec {
|
|
name = "ccnet-server";
|
|
inherit version;
|
|
src = fetchFromGitHub {
|
|
owner = "haiwen";
|
|
repo = "ccnet-server";
|
|
rev = "v${version}-server";
|
|
sha256 = "sha256:0mi0d2b4jwg511r0pp2ws9cw8ab6njplwy2a03wn6zi8q8fpjl38";
|
|
};
|
|
|
|
buildInputs = [ vala libsearpc libuuid sqlite openssl libevent glib python27 ]
|
|
++ 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 ];
|
|
configureFlags = [ "--disable-static" ];
|
|
|
|
meta = {
|
|
description = "Internal communication framework and user/group management for Seafile server";
|
|
license = lib.licenses.agpl3; # with additional OpenSSL linking exception
|
|
};
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "seafile-server";
|
|
inherit version;
|
|
|
|
buildInputs = [ seahub seafile-server-core ccnet-server libsearpc ]
|
|
++ lib.optional withMysql libmysql;
|
|
phases = [ "installPhase" "fixupPhase" "distPhase" ];
|
|
# todo: create data directory in /srv in activation script
|
|
installPhase = ''
|
|
mkdir "$out"
|
|
cd "$out"
|
|
ln -s ${seahub} seahub
|
|
ln -s ${seafile-server-core} seafile-server-latest
|
|
'';
|
|
meta = with lib; {
|
|
maintainers = with maintainers; [ schmittlauch ];
|
|
license = licenses.free; # components with different free software licenses are combined
|
|
};
|
|
inherit ccnet-server seafile-server-core; # for using the path in the NixOS module
|
|
}
|