pythonPackages.syncserver: move to all-packages.nix and fix dependencies

This commit is contained in:
Nadrieril 2019-01-28 18:11:32 +01:00
parent 08aa3e7f2e
commit 957d0589ad
5 changed files with 56 additions and 47 deletions

View file

@ -127,14 +127,16 @@ in
config = mkIf cfg.enable {
systemd.services.syncserver = let
syncServerEnv = pkgs.python.withPackages(ps: with ps; [ syncserver pasteScript requests ]);
user = "syncserver";
group = "syncserver";
in {
after = [ "network.target" ];
description = "Firefox Sync Server";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.coreutils syncServerEnv ];
path = [
pkgs.coreutils
(pkgs.python.withPackages (ps: [ pkgs.syncserver ps.pasteScript ps.requests ]))
];
serviceConfig = {
User = user;
@ -166,7 +168,9 @@ in
chown ${user}:${group} ${defaultDbLocation}
fi
'';
serviceConfig.ExecStart = "${syncServerEnv}/bin/paster serve ${syncServerIni}";
script = ''
paster serve ${syncServerIni}
'';
};
users.users.syncserver = {

View file

@ -1,42 +0,0 @@
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, isPy27
, unittest2
, cornice
, gunicorn
, pyramid
, requests
, simplejson
, sqlalchemy
, mozsvc
, tokenserver
, serversyncstorage
, configparser
}:
buildPythonPackage rec {
pname = "syncserver";
version = "1.8.0";
disabled = ! isPy27;
src = fetchFromGitHub {
owner = "mozilla-services";
repo = "syncserver";
rev = version;
sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8";
};
buildInputs = [ unittest2 ];
propagatedBuildInputs = [
cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver
serversyncstorage configparser
];
meta = with stdenv.lib; {
description = "Run-Your-Own Firefox Sync Server";
homepage = "https://github.com/mozilla-services/syncserver";
platforms = platforms.unix;
license = licenses.mpl20;
};
}

View file

@ -0,0 +1,47 @@
{ lib
, python2
, fetchFromGitHub
}:
let
python = python2.override {
packageOverrides = self: super: {
# Older version, used by syncserver, tokenserver and serversyncstorage
cornice = super.cornice.overridePythonAttrs (oldAttrs: rec {
version = "0.17";
src = oldAttrs.src.override {
inherit version;
sha256 = "1vvymhf6ydc885ygqiqpa39xr9v302i1l6nzirjnczqy9llyqvpj";
};
});
};
};
# buildPythonPackage is necessary for syncserver to work with gunicorn or paster scripts
in python.pkgs.buildPythonPackage rec {
pname = "syncserver";
version = "1.8.0";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = "syncserver";
rev = version;
sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8";
};
# There are no tests
doCheck = false;
propagatedBuildInputs = with python.pkgs; [
cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver
serversyncstorage configparser
];
meta = with lib; {
description = "Run-Your-Own Firefox Sync Server";
homepage = https://github.com/mozilla-services/syncserver;
platforms = platforms.unix;
license = licenses.mpl20;
maintainers = with maintainers; [ nadrieril ];
};
}

View file

@ -14138,6 +14138,8 @@ in
systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { };
syncserver = callPackage ../servers/syncserver { };
inherit (callPackages ../servers/http/tomcat { })
tomcat7
tomcat8

View file

@ -774,8 +774,6 @@ in {
supervise_api = callPackage ../development/python-modules/supervise_api { };
syncserver = callPackage ../development/python-modules/syncserver {};
tables = callPackage ../development/python-modules/tables {
hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; };
};