diff --git a/pkgs/servers/seafile-server/default.nix b/pkgs/servers/seafile-server/default.nix new file mode 100644 index 000000000000..d60dd7809913 --- /dev/null +++ b/pkgs/servers/seafile-server/default.nix @@ -0,0 +1,52 @@ +{ stdenv, lib, fetchFromGitHub, pkg-config, python3Packages, autoreconfHook +, libuuid, sqlite, glib, libevent, libsearpc, openssl, fuse, libarchive, which +, vala, cmake, oniguruma }: + +let + # seafile-server relies on a specific version of libevhtp. + # It contains non upstreamed patches and is forked off an outdated version. + libevhtp = import ./libevhtp.nix { + inherit stdenv lib fetchFromGitHub cmake libevent; + }; +in stdenv.mkDerivation rec { + pname = "seafile-server"; + version = "8.0.7"; + + src = fetchFromGitHub { + owner = "haiwen"; + repo = "seafile-server"; + rev = "27dac89bb3a81c5acc3f764ce92134eb357ea64b"; + sha256 = "1h2hxvv0l5m9nbkdyjpznb7ddk8hb8hhwj8b2lx6aqbvp8gll9q7"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ + libuuid + sqlite + openssl + glib + libsearpc + libevent + python3Packages.python + fuse + libarchive + which + vala + libevhtp + oniguruma + ]; + + postInstall = '' + mkdir -p $out/share/seafile/sql + cp -r scripts/sql $out/share/seafile + ''; + + meta = with lib; { + description = "File syncing and sharing software with file encryption and group sharing, emphasis on reliability and high performance"; + homepage = "https://github.com/haiwen/seafile-server"; + license = licenses.agpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ greizgh schmittlauch ]; + }; +} diff --git a/pkgs/servers/seafile-server/libevhtp.nix b/pkgs/servers/seafile-server/libevhtp.nix new file mode 100644 index 000000000000..97cdc0804faa --- /dev/null +++ b/pkgs/servers/seafile-server/libevhtp.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchFromGitHub, cmake, libevent }: + +stdenv.mkDerivation rec { + pname = "libevhtp"; + version = "unstable-2021-04-28"; + + src = fetchFromGitHub { + owner = "haiwen"; + repo = "libevhtp"; + rev = "18c649203f009ef1d77d6f8301eba09af3777adf"; + sha256 = "1rf0jcy2lf8jbzpkhfgv289hc8zdy5zs6sn36k4vlqvilginxiid"; + }; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ libevent ]; + + cmakeFlags = [ + "-DEVHTP_DISABLE_SSL=ON" + "-DEVHTP_BUILD_SHARED=ON" + ]; + + meta = with lib; { + description = "Create extremely-fast and secure embedded HTTP servers with ease"; + homepage = "https://github.com/criticalstack/libevhtp"; + license = licenses.bsd3; + maintainers = with maintainers; [ greizgh schmittlauch ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a296c56a8e5c..c769d7839546 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32621,6 +32621,8 @@ with pkgs; thrift = thrift-0_10; }; + seafile-server = callPackage ../servers/seafile-server { }; + seafile-shared = callPackage ../misc/seafile-shared { }; ser2net = callPackage ../servers/ser2net {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 03c5e5b2bf77..a9f93ac2cba5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8317,6 +8317,8 @@ in { seabreeze = callPackage ../development/python-modules/seabreeze { }; + seaserv = toPythonModule pkgs.seafile-server; + seccomp = callPackage ../development/python-modules/seccomp { }; secp256k1 = callPackage ../development/python-modules/secp256k1 {