nixpkgs/pkgs/tools/misc/vdirsyncer/default.nix

67 lines
2.0 KiB
Nix
Raw Normal View History

{ stdenv, python3Packages, fetchFromGitHub, fetchpatch, rustPlatform, pkgconfig, openssl, Security }:
2015-01-30 15:39:51 +00:00
# Packaging documentation at:
# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
python3Packages.buildPythonApplication rec {
version = "unstable-2018-08-05";
2017-12-25 14:20:57 +00:00
pname = "vdirsyncer";
name = "${pname}-${version}";
src = fetchFromGitHub {
2019-08-25 15:32:15 +01:00
owner = "spk";
repo = pname;
2019-08-25 15:32:15 +01: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
};
2017-12-25 14:20:57 +00:00
native = rustPlatform.buildRustPackage {
name = "${name}-native";
2017-12-25 14:20:57 +00:00
inherit src;
sourceRoot = "source/rust";
2019-08-25 15:32:15 +01:00
cargoSha256 = "1n1dxq3klsry5mmbfff2jv7ih8mr5zvpncrdgba6qs93wi77qi0y";
buildInputs = [ pkgconfig openssl ] ++ stdenv.lib.optional stdenv.isDarwin Security;
2017-12-25 14:20:57 +00:00
};
2015-01-30 15:39:51 +00:00
propagatedBuildInputs = with python3Packages; [
2015-10-28 16:11:40 +00:00
click click-log click-threading
2015-01-30 15:39:51 +00:00
requests_toolbelt
requests
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
shippai
2015-01-30 15:39:51 +00:00
];
nativeBuildInputs = with python3Packages; [ setuptools_scm ];
2017-12-25 14:20:57 +00:00
checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ];
2017-12-25 14:20:57 +00:00
postPatch = ''
2019-09-09 17:16:11 +01:00
# see https://github.com/pimutils/vdirsyncer/pull/805
substituteInPlace setup.cfg --replace --duration --durations
2019-02-25 10:05:32 +00:00
# for setuptools_scm:
echo 'Version: ${version}' >PKG-INFO
sed -i 's/spec.add_external_build(cmd=cmd/spec.add_external_build(cmd="true"/g' setup.py
2017-12-25 14:20:57 +00:00
'';
preBuild = ''
mkdir -p rust/target/release
2018-10-06 17:30:44 +01:00
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
2017-12-25 14:20:57 +00:00
'';
checkPhase = ''
rm -rf vdirsyncer
make DETERMINISTIC_TESTS=true test
'';
2016-02-18 15:48:59 +00:00
meta = with stdenv.lib; {
homepage = https://github.com/pimutils/vdirsyncer;
2015-01-30 15:39:51 +00:00
description = "Synchronize calendars and contacts";
2019-08-25 15:32:15 +01:00
maintainers = with maintainers; [ matthiasbeyer gebner ];
license = licenses.mit;
2015-01-30 15:39:51 +00:00
};
}