2020-05-17 08:19:40 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy27
|
|
|
|
, fetchpatch
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, CoreServices
|
|
|
|
, Security
|
|
|
|
, click
|
|
|
|
, click-log
|
|
|
|
, click-threading
|
|
|
|
, requests_toolbelt
|
|
|
|
, requests
|
|
|
|
, requests_oauthlib # required for google oauth sync
|
|
|
|
, atomicwrites
|
|
|
|
, milksnake
|
|
|
|
, shippai
|
|
|
|
, hypothesis
|
|
|
|
, pytest
|
|
|
|
, pytest-localserver
|
|
|
|
, pytest-subtesthack
|
|
|
|
, setuptools_scm
|
|
|
|
}:
|
2015-01-30 15:39:51 +00:00
|
|
|
|
2016-03-13 07:37:57 +00:00
|
|
|
# Packaging documentation at:
|
|
|
|
# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
|
2020-05-17 08:19:40 +00:00
|
|
|
buildPythonPackage rec {
|
2018-12-29 15:30:15 +00:00
|
|
|
version = "unstable-2018-08-05";
|
2017-12-25 14:20:57 +00:00
|
|
|
pname = "vdirsyncer";
|
2018-12-29 15:30:15 +00:00
|
|
|
name = "${pname}-${version}";
|
2020-05-17 08:19:40 +00:00
|
|
|
disabled = isPy27;
|
2018-12-29 15:30:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-08-25 14:32:15 +00:00
|
|
|
owner = "spk";
|
2018-12-29 15:30:15 +00:00
|
|
|
repo = pname;
|
2019-08-25 14:32:15 +00:00
|
|
|
# fix-build-style branch, see https://github.com/pimutils/vdirsyncer/pull/798
|
|
|
|
rev = "2c62d03bd73f8b44a47c2e769ade046697896ae9";
|
|
|
|
sha256 = "1q6xvzz5rf5sqdaj3mdvhpgwy5b16isavgg7vardgjwqwv1yal28";
|
2015-01-30 15:39:51 +00:00
|
|
|
};
|
2018-12-29 15:30:15 +00:00
|
|
|
|
2017-12-25 14:20:57 +00:00
|
|
|
native = rustPlatform.buildRustPackage {
|
2018-12-29 15:30:15 +00:00
|
|
|
name = "${name}-native";
|
2017-12-25 14:20:57 +00:00
|
|
|
inherit src;
|
2018-12-29 15:30:15 +00:00
|
|
|
sourceRoot = "source/rust";
|
2020-03-09 03:32:01 +00:00
|
|
|
cargoSha256 = "0cqy0s55pkg6hww86h7qip4xaidh6g8lcypdj84n2x374jq38c5d";
|
2020-05-17 08:19:40 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-03-29 07:33:20 +00:00
|
|
|
buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2017-12-25 14:20:57 +00:00
|
|
|
};
|
2015-01-30 15:39:51 +00:00
|
|
|
|
2020-05-17 08:19:40 +00:00
|
|
|
propagatedBuildInputs = [
|
2015-10-28 16:11:40 +00:00
|
|
|
click click-log click-threading
|
2015-01-30 15:39:51 +00:00
|
|
|
requests_toolbelt
|
2017-05-07 10:55:45 +00:00
|
|
|
requests
|
2017-10-29 08:31:15 +00:00
|
|
|
requests_oauthlib # required for google oauth sync
|
2015-01-30 15:39:51 +00:00
|
|
|
atomicwrites
|
2017-12-25 14:20:57 +00:00
|
|
|
milksnake
|
2018-08-03 10:40:46 +00:00
|
|
|
shippai
|
2015-01-30 15:39:51 +00:00
|
|
|
];
|
|
|
|
|
2020-05-17 08:19:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools_scm
|
|
|
|
];
|
2017-12-25 14:20:57 +00:00
|
|
|
|
2020-05-17 08:19:40 +00:00
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
|
|
|
pytest
|
|
|
|
pytest-localserver
|
|
|
|
pytest-subtesthack
|
|
|
|
];
|
2017-12-25 14:20:57 +00:00
|
|
|
|
2019-12-05 15:08:42 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/pimutils/vdirsyncer/commit/7b636e8e40d69c495901f965b9c0686513659e44.patch";
|
|
|
|
sha256 = "0vl942ii5iad47y63v0ngmhfp37n30nxyk4j7h64b95fk38vfwx9";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-12-25 14:20:57 +00:00
|
|
|
postPatch = ''
|
2019-09-09 16:16:11 +00:00
|
|
|
# see https://github.com/pimutils/vdirsyncer/pull/805
|
|
|
|
substituteInPlace setup.cfg --replace --duration --durations
|
2019-02-25 10:05:32 +00:00
|
|
|
|
2018-12-29 15:30:15 +00:00
|
|
|
# for setuptools_scm:
|
|
|
|
echo 'Version: ${version}' >PKG-INFO
|
|
|
|
|
2018-08-03 10:40:46 +00:00
|
|
|
sed -i 's/spec.add_external_build(cmd=cmd/spec.add_external_build(cmd="true"/g' setup.py
|
2020-04-22 20:36:37 +00:00
|
|
|
|
|
|
|
# fixing test
|
|
|
|
sed -i "s/invalid value for \"--verbosity\"/invalid value for \\\'--verbosity\\\'/" tests/system/cli/test_sync.py
|
2017-12-25 14:20:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p rust/target/release
|
2018-10-06 16:30:44 +00:00
|
|
|
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
|
2017-12-25 14:20:57 +00:00
|
|
|
'';
|
2016-03-13 07:37:57 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2018-08-03 10:40:46 +00:00
|
|
|
rm -rf vdirsyncer
|
2020-04-28 09:20:00 +00:00
|
|
|
make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/unit/utils/test_vobject.py::test_replace_uid --deselect=tests/unit/sync/test_sync.py::TestSyncMachine" test
|
2016-03-13 07:37:57 +00:00
|
|
|
'';
|
2016-02-18 15:48:59 +00:00
|
|
|
|
2015-05-29 23:26:29 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/pimutils/vdirsyncer";
|
2015-01-30 15:39:51 +00:00
|
|
|
description = "Synchronize calendars and contacts";
|
2019-08-25 14:32:15 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer gebner ];
|
2015-05-29 23:26:29 +00:00
|
|
|
license = licenses.mit;
|
2015-01-30 15:39:51 +00:00
|
|
|
};
|
|
|
|
}
|