2018-08-03 12:40:46 +02:00
|
|
|
{ stdenv, python3Packages, glibcLocales, rustPlatform, pkgconfig, openssl }:
|
2015-01-30 16:39:51 +01:00
|
|
|
|
2016-03-13 08:37:57 +01:00
|
|
|
# Packaging documentation at:
|
|
|
|
# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
|
2016-10-08 09:09:55 +02:00
|
|
|
let
|
|
|
|
pythonPackages = python3Packages;
|
2018-08-03 12:40:46 +02:00
|
|
|
version = "0.17.0a3";
|
2017-12-25 15:20:57 +01:00
|
|
|
pname = "vdirsyncer";
|
|
|
|
name = pname + "-" + version;
|
|
|
|
src = pythonPackages.fetchPypi {
|
|
|
|
inherit pname version;
|
2018-08-03 12:40:46 +02:00
|
|
|
sha256 = "1n7izfa5x9mh0b4zp20gd8qxfcca5wpjh834bsbi5pk6zam5pfdy";
|
2015-01-30 16:39:51 +01:00
|
|
|
};
|
2017-12-25 15:20:57 +01:00
|
|
|
native = rustPlatform.buildRustPackage {
|
|
|
|
name = name + "-native";
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = name + "/rust";
|
2018-08-03 12:40:46 +02:00
|
|
|
cargoSha256 = "08xq9q5fx37azzkqqgwcnds1yd8687gh26dsl3ivql5h13fa2w3q";
|
|
|
|
buildInputs = [ pkgconfig openssl ];
|
2017-12-25 15:20:57 +01:00
|
|
|
};
|
|
|
|
in pythonPackages.buildPythonApplication rec {
|
2018-08-03 12:40:46 +02:00
|
|
|
inherit version pname src native;
|
2015-01-30 16:39:51 +01:00
|
|
|
|
2015-05-30 01:03:48 +02:00
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
2015-10-28 17:11:40 +01:00
|
|
|
click click-log click-threading
|
2015-01-30 16:39:51 +01:00
|
|
|
requests_toolbelt
|
2017-05-07 12:55:45 +02:00
|
|
|
requests
|
2017-10-29 09:31:15 +01:00
|
|
|
requests_oauthlib # required for google oauth sync
|
2015-01-30 16:39:51 +01:00
|
|
|
atomicwrites
|
2017-12-25 15:20:57 +01:00
|
|
|
milksnake
|
2018-08-03 12:40:46 +02:00
|
|
|
shippai
|
2015-01-30 16:39:51 +01:00
|
|
|
];
|
|
|
|
|
2017-12-25 15:20:57 +01:00
|
|
|
buildInputs = with pythonPackages; [ setuptools_scm ];
|
|
|
|
|
|
|
|
checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2018-08-03 12:40:46 +02:00
|
|
|
sed -i 's/spec.add_external_build(cmd=cmd/spec.add_external_build(cmd="true"/g' setup.py
|
2017-12-25 15:20:57 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p rust/target/release
|
2018-10-06 18:30:44 +02:00
|
|
|
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
|
2017-12-25 15:20:57 +01:00
|
|
|
'';
|
2016-03-13 08:37:57 +01:00
|
|
|
|
|
|
|
LC_ALL = "en_US.utf8";
|
|
|
|
|
|
|
|
checkPhase = ''
|
2018-08-03 12:40:46 +02:00
|
|
|
rm -rf vdirsyncer
|
|
|
|
export PYTHONPATH=$out/${pythonPackages.python.sitePackages}:$PYTHONPATH
|
2016-03-13 08:37:57 +01:00
|
|
|
make DETERMINISTIC_TESTS=true test
|
|
|
|
'';
|
2016-02-18 16:48:59 +01:00
|
|
|
|
2015-05-30 01:26:29 +02:00
|
|
|
meta = with stdenv.lib; {
|
2016-03-24 17:30:52 +01:00
|
|
|
homepage = https://github.com/pimutils/vdirsyncer;
|
2015-01-30 16:39:51 +01:00
|
|
|
description = "Synchronize calendars and contacts";
|
2018-04-06 10:57:19 +02:00
|
|
|
maintainers = with maintainers; [ jgeerds ];
|
2015-05-30 01:26:29 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.mit;
|
2015-01-30 16:39:51 +01:00
|
|
|
};
|
|
|
|
}
|