mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
Merge pull request #158387 from greizgh/seahub-8.0.8
[21.11] seahub: 8.0.7 -> 8.0.8
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
python = pkgs.python3Packages.python;
|
||||
cfg = config.services.seafile;
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
|
||||
@@ -220,9 +219,7 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
seahub = let
|
||||
penv = (pkgs.python3.withPackages (ps: with ps; [ gunicorn seahub ]));
|
||||
in {
|
||||
seahub = {
|
||||
description = "Seafile Server Web Frontend";
|
||||
wantedBy = [ "seafile.target" ];
|
||||
partOf = [ "seafile.target" ];
|
||||
@@ -230,8 +227,7 @@ in {
|
||||
requires = [ "seaf-server.service" ];
|
||||
restartTriggers = [ seahubSettings ];
|
||||
environment = {
|
||||
PYTHONPATH =
|
||||
"${pkgs.python3Packages.seahub}/thirdpart:${pkgs.python3Packages.seahub}:${penv}/${python.sitePackages}";
|
||||
PYTHONPATH = "${pkgs.seahub.pythonPath}:${pkgs.seahub}/thirdpart:${pkgs.seahub}";
|
||||
DJANGO_SETTINGS_MODULE = "seahub.settings";
|
||||
CCNET_CONF_DIR = ccnetDir;
|
||||
SEAFILE_CONF_DIR = dataDir;
|
||||
@@ -248,7 +244,7 @@ in {
|
||||
LogsDirectory = "seafile";
|
||||
ConfigurationDirectory = "seafile";
|
||||
ExecStart = ''
|
||||
${penv}/bin/gunicorn seahub.wsgi:application \
|
||||
${pkgs.seahub.python.pkgs.gunicorn}/bin/gunicorn seahub.wsgi:application \
|
||||
--name seahub \
|
||||
--workers ${toString cfg.workers} \
|
||||
--log-level=info \
|
||||
@@ -261,27 +257,27 @@ in {
|
||||
preStart = ''
|
||||
mkdir -p ${seahubDir}/media
|
||||
# Link all media except avatars
|
||||
for m in `find ${pkgs.python3Packages.seahub}/media/ -maxdepth 1 -not -name "avatars"`; do
|
||||
for m in `find ${pkgs.seahub}/media/ -maxdepth 1 -not -name "avatars"`; do
|
||||
ln -sf $m ${seahubDir}/media/
|
||||
done
|
||||
if [ ! -e "${seafRoot}/.seahubSecret" ]; then
|
||||
${penv}/bin/python ${pkgs.python3Packages.seahub}/tools/secret_key_generator.py > ${seafRoot}/.seahubSecret
|
||||
${pkgs.seahub.python}/bin/python ${pkgs.seahub}/tools/secret_key_generator.py > ${seafRoot}/.seahubSecret
|
||||
chmod 400 ${seafRoot}/.seahubSecret
|
||||
fi
|
||||
if [ ! -f "${seafRoot}/seahub-setup" ]; then
|
||||
# avatars directory should be writable
|
||||
install -D -t ${seahubDir}/media/avatars/ ${pkgs.python3Packages.seahub}/media/avatars/default.png
|
||||
install -D -t ${seahubDir}/media/avatars/groups ${pkgs.python3Packages.seahub}/media/avatars/groups/default.png
|
||||
install -D -t ${seahubDir}/media/avatars/ ${pkgs.seahub}/media/avatars/default.png
|
||||
install -D -t ${seahubDir}/media/avatars/groups ${pkgs.seahub}/media/avatars/groups/default.png
|
||||
# init database
|
||||
${pkgs.python3Packages.seahub}/manage.py migrate
|
||||
${pkgs.seahub}/manage.py migrate
|
||||
# create admin account
|
||||
${pkgs.expect}/bin/expect -c 'spawn ${pkgs.python3Packages.seahub}/manage.py createsuperuser --email=${cfg.adminEmail}; expect "Password: "; send "${cfg.initialAdminPassword}\r"; expect "Password (again): "; send "${cfg.initialAdminPassword}\r"; expect "Superuser created successfully."'
|
||||
echo "${pkgs.python3Packages.seahub.version}-sqlite" > "${seafRoot}/seahub-setup"
|
||||
${pkgs.expect}/bin/expect -c 'spawn ${pkgs.seahub}/manage.py createsuperuser --email=${cfg.adminEmail}; expect "Password: "; send "${cfg.initialAdminPassword}\r"; expect "Password (again): "; send "${cfg.initialAdminPassword}\r"; expect "Superuser created successfully."'
|
||||
echo "${pkgs.seahub.version}-sqlite" > "${seafRoot}/seahub-setup"
|
||||
fi
|
||||
if [ $(cat "${seafRoot}/seahub-setup" | cut -d"-" -f1) != "${pkgs.python3Packages.seahub.version}" ]; then
|
||||
if [ $(cat "${seafRoot}/seahub-setup" | cut -d"-" -f1) != "${pkgs.seahub.version}" ]; then
|
||||
# update database
|
||||
${pkgs.python3Packages.seahub}/manage.py migrate
|
||||
echo "${pkgs.python3Packages.seahub.version}-sqlite" > "${seafRoot}/seahub-setup"
|
||||
${pkgs.seahub}/manage.py migrate
|
||||
echo "${pkgs.seahub.version}-sqlite" > "${seafRoot}/seahub-setup"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
{ lib, fetchFromGitHub, python3Packages, makeWrapper }:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
{ lib, fetchFromGitHub, python3, makeWrapper }:
|
||||
let
|
||||
# Seahub 8.x.x does not support django-webpack-loader >=1.x.x
|
||||
python = python3.override {
|
||||
packageOverrides = self: super: {
|
||||
django-webpack-loader = super.django-webpack-loader.overridePythonAttrs (old: rec {
|
||||
version = "0.7.0";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "0izl6bibhz3v538ad5hl13lfr6kvprf62rcl77wq2i5538h8hg3s";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
in
|
||||
python.pkgs.buildPythonApplication rec {
|
||||
pname = "seahub";
|
||||
version = "8.0.7";
|
||||
version = "8.0.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "haiwen";
|
||||
repo = "seahub";
|
||||
rev = "4f7bb3f617dd847cf0a6b33c0bfb567b44c06059"; # using a fixed revision because upstream may re-tag releases :/
|
||||
sha256 = "09d05sxly1bljxxzm77limhwsbg8c4b54fzv3kmaih59pjnjyr03";
|
||||
rev = "c51346155b2f31e038c3a2a12e69dcc6665502e2"; # using a fixed revision because upstream may re-tag releases :/
|
||||
sha256 = "0dagiifxllfk73xdzfw2g378jccpzplhdrmkwbaakbhgbvvkg92k";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
@@ -16,7 +29,7 @@ python3Packages.buildPythonPackage rec {
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
propagatedBuildInputs = with python.pkgs; [
|
||||
django
|
||||
future
|
||||
django-statici18n
|
||||
@@ -37,15 +50,20 @@ python3Packages.buildPythonPackage rec {
|
||||
qrcode
|
||||
pysearpc
|
||||
seaserv
|
||||
gunicorn
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
cp -dr --no-preserve='ownership' . $out/
|
||||
wrapProgram $out/manage.py \
|
||||
--prefix PYTHONPATH : "$PYTHONPATH:$out/thirdpart:" \
|
||||
--prefix PATH : "${python3Packages.python}/bin"
|
||||
--prefix PYTHONPATH : "$PYTHONPATH:$out/thirdpart:"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit python;
|
||||
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/haiwen/seahub";
|
||||
description = "The web end of seafile server";
|
||||
@@ -1,5 +1,12 @@
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3Packages
|
||||
, glib, jansson }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, python3
|
||||
, glib
|
||||
, jansson
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "3.2.0";
|
||||
@@ -12,9 +19,19 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "18i5zvrp6dv6vygxx5nc93mai2p2x786n5lnf5avrin6xiz2j6hd";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
buildInputs = with python3Packages; [ python simplejson ];
|
||||
propagatedBuildInputs = [ glib jansson ];
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
python3
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
glib
|
||||
jansson
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/haiwen/libsearpc";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, lib, fetchFromGitHub, pkg-config, python3Packages, autoreconfHook
|
||||
{ stdenv, lib, fetchFromGitHub, pkg-config, python3, autoreconfHook
|
||||
, libuuid, sqlite, glib, libevent, libsearpc, openssl, fuse, libarchive, which
|
||||
, vala, cmake, oniguruma, nixosTests }:
|
||||
|
||||
@@ -28,7 +28,7 @@ in stdenv.mkDerivation rec {
|
||||
glib
|
||||
libsearpc
|
||||
libevent
|
||||
python3Packages.python
|
||||
python3
|
||||
fuse
|
||||
libarchive
|
||||
which
|
||||
|
||||
@@ -28081,6 +28081,8 @@ with pkgs;
|
||||
|
||||
seafile-client = libsForQt5.callPackage ../applications/networking/seafile-client { };
|
||||
|
||||
seahub = callPackage ../applications/networking/seahub { };
|
||||
|
||||
seatd = callPackage ../applications/misc/seatd { };
|
||||
|
||||
secretscanner = callPackage ../tools/security/secretscanner { };
|
||||
|
||||
@@ -7134,7 +7134,9 @@ in {
|
||||
|
||||
pysdl2 = callPackage ../development/python-modules/pysdl2 { };
|
||||
|
||||
pysearpc = toPythonModule pkgs.libsearpc;
|
||||
pysearpc = toPythonModule (pkgs.libsearpc.override {
|
||||
python3 = self.python;
|
||||
});
|
||||
|
||||
pysecuritas = callPackage ../development/python-modules/pysecuritas { };
|
||||
|
||||
@@ -8521,9 +8523,9 @@ in {
|
||||
|
||||
seabreeze = callPackage ../development/python-modules/seabreeze { };
|
||||
|
||||
seahub = callPackage ../development/python-modules/seahub { };
|
||||
|
||||
seaserv = toPythonModule pkgs.seafile-server;
|
||||
seaserv = toPythonModule (pkgs.seafile-server.override {
|
||||
python3 = self.python;
|
||||
});
|
||||
|
||||
seccomp = callPackage ../development/python-modules/seccomp { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user