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

63 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, python3Packages, glibcLocales, rustPlatform, pkgconfig, openssl }:
2015-01-30 15:39:51 +00:00
# Packaging documentation at:
# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
let
pythonPackages = python3Packages;
version = "0.17.0a3";
2017-12-25 14:20:57 +00:00
pname = "vdirsyncer";
name = pname + "-" + version;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "1n7izfa5x9mh0b4zp20gd8qxfcca5wpjh834bsbi5pk6zam5pfdy";
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 = "08xq9q5fx37azzkqqgwcnds1yd8687gh26dsl3ivql5h13fa2w3q";
buildInputs = [ pkgconfig openssl ];
2017-12-25 14:20:57 +00:00
};
in pythonPackages.buildPythonApplication rec {
inherit version pname src native;
2015-01-30 15:39:51 +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
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
];
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 '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 16:30:44 +00:00
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
2017-12-25 14:20:57 +00:00
'';
LC_ALL = "en_US.utf8";
checkPhase = ''
rm -rf vdirsyncer
export PYTHONPATH=$out/${pythonPackages.python.sitePackages}:$PYTHONPATH
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";
maintainers = with maintainers; [ jgeerds ];
platforms = platforms.all;
license = licenses.mit;
2015-01-30 15:39:51 +00:00
};
}