2017-12-25 14:20:57 +00:00
|
|
|
{ stdenv, python3Packages, glibcLocales, rustPlatform }:
|
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
|
2016-10-08 07:09:55 +00:00
|
|
|
let
|
|
|
|
pythonPackages = python3Packages;
|
2017-12-25 14:20:57 +00:00
|
|
|
version = "0.17.0a2";
|
|
|
|
pname = "vdirsyncer";
|
|
|
|
name = pname + "-" + version;
|
|
|
|
src = pythonPackages.fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "0y464rsx5la6bp94z2g0nnkbl4nwfya08abynvifw4c84vs1gr4q";
|
2015-01-30 15:39:51 +00:00
|
|
|
};
|
2017-12-25 14:20:57 +00:00
|
|
|
native = rustPlatform.buildRustPackage {
|
|
|
|
name = name + "-native";
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = name + "/rust";
|
|
|
|
cargoSha256 = "1cr7xs11gbsc3x5slga9qahchwc22qq49amf28g4jgs9lzf57qis";
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/include $out/lib
|
|
|
|
cp $out/bin/libvdirsyncer_rustext* $out/lib
|
|
|
|
rm -r $out/bin
|
|
|
|
cp target/vdirsyncer_rustext.h $out/include
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in pythonPackages.buildPythonApplication rec {
|
|
|
|
inherit version pname src;
|
2015-01-30 15:39:51 +00:00
|
|
|
|
2015-05-29 23:03:48 +00:00
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
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
|
2015-01-30 15:39:51 +00:00
|
|
|
];
|
|
|
|
|
2017-12-25 14:20:57 +00:00
|
|
|
buildInputs = with pythonPackages; [ setuptools_scm ];
|
|
|
|
|
|
|
|
checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "/cargo build/d" Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p rust/target/release
|
|
|
|
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
|
|
|
|
ln -s ${native}/include/vdirsyncer_rustext.h rust/target/
|
|
|
|
'';
|
2016-03-13 07:37:57 +00:00
|
|
|
|
|
|
|
LC_ALL = "en_US.utf8";
|
|
|
|
|
2017-12-25 14:20:57 +00:00
|
|
|
preCheck = ''
|
|
|
|
ln -sf ../dist/tmpbuild/vdirsyncer/vdirsyncer/_native__lib.so vdirsyncer
|
|
|
|
'';
|
|
|
|
|
2016-03-13 07:37:57 +00:00
|
|
|
checkPhase = ''
|
2017-12-25 14:20:57 +00:00
|
|
|
runHook preCheck
|
2016-03-13 07:37:57 +00:00
|
|
|
make DETERMINISTIC_TESTS=true test
|
2017-12-25 14:20:57 +00:00
|
|
|
runHook postCheck
|
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; {
|
2016-03-24 16:30:52 +00:00
|
|
|
homepage = https://github.com/pimutils/vdirsyncer;
|
2015-01-30 15:39:51 +00:00
|
|
|
description = "Synchronize calendars and contacts";
|
2018-04-06 08:57:19 +00:00
|
|
|
maintainers = with maintainers; [ jgeerds ];
|
2015-05-29 23:26:29 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.mit;
|
2015-01-30 15:39:51 +00:00
|
|
|
};
|
|
|
|
}
|