2019-04-05 17:07:54 +02:00
|
|
|
{ stdenv, python3Packages, fetchFromGitHub, fetchpatch, rustPlatform, pkgconfig, openssl, Security }:
|
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
|
2018-12-29 16:30:15 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
version = "unstable-2018-08-05";
|
2017-12-25 15:20:57 +01:00
|
|
|
pname = "vdirsyncer";
|
2018-12-29 16:30:15 +01:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pimutils";
|
|
|
|
repo = pname;
|
|
|
|
rev = "ac45cf144b0ceb72cc2a9f454808688f3ac9ba4f";
|
|
|
|
sha256 = "0hqsjdpgvm7d34q5b2hzmrzfxk43ald1bx22mvgg559kw1ck54s9";
|
2015-01-30 16:39:51 +01:00
|
|
|
};
|
2018-12-29 16:30:15 +01:00
|
|
|
|
2017-12-25 15:20:57 +01:00
|
|
|
native = rustPlatform.buildRustPackage {
|
2018-12-29 16:30:15 +01:00
|
|
|
name = "${name}-native";
|
2017-12-25 15:20:57 +01:00
|
|
|
inherit src;
|
2018-12-29 16:30:15 +01:00
|
|
|
sourceRoot = "source/rust";
|
2019-05-25 13:03:08 +02:00
|
|
|
cargoSha256 = "1qziwlf6nlkpxb1hamb7qsipqg9ibp871rimgpwil38vqmyd570s";
|
2018-12-01 23:34:28 +01:00
|
|
|
buildInputs = [ pkgconfig openssl ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
2017-12-25 15:20:57 +01:00
|
|
|
};
|
2015-01-30 16:39:51 +01:00
|
|
|
|
2018-12-29 16:30:15 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
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
|
|
|
];
|
|
|
|
|
2019-04-05 17:07:54 +02:00
|
|
|
nativeBuildInputs = with python3Packages; [ setuptools_scm ];
|
2017-12-25 15:20:57 +01:00
|
|
|
|
2019-04-05 17:07:54 +02:00
|
|
|
checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ];
|
2017-12-25 15:20:57 +01:00
|
|
|
|
2018-12-01 23:34:28 +01:00
|
|
|
patches = [
|
2018-12-29 16:30:15 +01:00
|
|
|
# Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779
|
2018-12-01 23:34:28 +01:00
|
|
|
(fetchpatch {
|
|
|
|
url = https://github.com/pimutils/vdirsyncer/commit/22ad88a6b18b0979c5d1f1d610c1d2f8f87f4b89.patch;
|
|
|
|
sha256 = "0dbzj6jlxhdidnm3i21a758z83sdiwzhpd45pbkhycfhgmqmhjpl";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = https://github.com/pimutils/vdirsyncer/commit/29417235321c249c65904bc7948b066ef5683aee.patch;
|
|
|
|
sha256 = "0zvr0y88gm3vprjcdzs4m151laa9qhkyi61rvrfdjmf42fwhbm80";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-12-25 15:20:57 +01:00
|
|
|
postPatch = ''
|
2019-02-25 11:05:32 +01:00
|
|
|
# Invalid argument: 'perform_health_check' is not a valid setting
|
|
|
|
substituteInPlace tests/conftest.py \
|
|
|
|
--replace "perform_health_check=False" ""
|
|
|
|
substituteInPlace tests/unit/test_repair.py \
|
|
|
|
--replace $'@settings(perform_health_check=False) # Using the random module for UIDs\n' ""
|
|
|
|
|
2018-12-29 16:30:15 +01:00
|
|
|
# for setuptools_scm:
|
|
|
|
echo 'Version: ${version}' >PKG-INFO
|
|
|
|
|
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
|
|
|
|
|
|
|
checkPhase = ''
|
2018-08-03 12:40:46 +02:00
|
|
|
rm -rf vdirsyncer
|
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";
|
2019-03-12 23:45:33 +01:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2015-05-30 01:26:29 +02:00
|
|
|
license = licenses.mit;
|
2015-01-30 16:39:51 +01:00
|
|
|
};
|
|
|
|
}
|