git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39195 from teto/vdirsyncer

[RDY] Vdirsyncer update

commit1aaab715e42dbe0961bea0a4dd0c722e7350fd92 authorRobert Schütz <rschuetz17@gmail.com> dateTue 24 Apr 2018, 00:52 (9 years ago) parentf220f1849f55fa
3 files changed+69−10
pkgs/development/python-modules/milksnake/default.nix+26 pkgs/tools/misc/vdirsyncer/default.nix+41−10 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/milksnake/default.nixnew file+26
@@ -0,0 +1,26 @@
1+{ lib, buildPythonPackage, fetchPypi, cffi }:
2+
3+buildPythonPackage rec {
4+ pname = "milksnake";
5+ version = "0.1.5";
6+
7+ src = fetchPypi {
8+ inherit pname version;
9+ extension = "zip";
10+ sha256 = "120nprd8lqis7x7zy72536gk2j68f7gxm8gffmx8k4ygifvl7kfz";
11+ };
12+
13+ propagatedBuildInputs = [
14+ cffi
15+ ];
16+
17+ # tests rely on pip/venv
18+ doCheck = false;
19+
20+ meta = with lib; {
21+ description = "A python library that extends setuptools for binary extensions";
22+ homepage = https://github.com/getsentry/milksnake;
23+ license = licenses.asl20;
24+ maintainers = with maintainers; [ matthiasbeyer ];
25+ };
26+}
pkgs/tools/misc/vdirsyncer/default.nix+41−10
@@ -1,18 +1,30 @@
1−{ stdenv, fetchurl, python3Packages, glibcLocales }:
1+{ stdenv, python3Packages, glibcLocales, rustPlatform }:
22
33# Packaging documentation at:
44# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
55let
66 pythonPackages = python3Packages;
7−in
8−pythonPackages.buildPythonApplication rec {
9− version = "0.16.4";
10− name = "vdirsyncer-${version}";
11−
12− src = fetchurl {
13− url = "mirror://pypi/v/vdirsyncer/${name}.tar.gz";
14− sha256 = "03wva48bgv1ad3df6plc9b8xxh6k8bcaxrhlzwh81c9mzn5bspzv";
7+ version = "0.17.0a2";
8+ pname = "vdirsyncer";
9+ name = pname + "-" + version;
10+ src = pythonPackages.fetchPypi {
11+ inherit pname version;
12+ sha256 = "0y464rsx5la6bp94z2g0nnkbl4nwfya08abynvifw4c84vs1gr4q";
1513 };
14+ native = rustPlatform.buildRustPackage {
15+ name = name + "-native";
16+ inherit src;
17+ sourceRoot = name + "/rust";
18+ cargoSha256 = "1cr7xs11gbsc3x5slga9qahchwc22qq49amf28g4jgs9lzf57qis";
19+ postInstall = ''
20+ mkdir $out/include $out/lib
21+ cp $out/bin/libvdirsyncer_rustext* $out/lib
22+ rm -r $out/bin
23+ cp target/vdirsyncer_rustext.h $out/include
24+ '';
25+ };
26+in pythonPackages.buildPythonApplication rec {
27+ inherit version pname src;
1628
1729 propagatedBuildInputs = with pythonPackages; [
1830 click click-log click-threading
@@ -20,14 +32,33 @@ pythonPackages.buildPythonApplication rec {
2032 requests
2133 requests_oauthlib # required for google oauth sync
2234 atomicwrites
35+ milksnake
2336 ];
2437
25− buildInputs = with pythonPackages; [hypothesis pytest pytest-localserver pytest-subtesthack setuptools_scm ] ++ [ glibcLocales ];
38+ buildInputs = with pythonPackages; [ setuptools_scm ];
39+
40+ checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
41+
42+ postPatch = ''
43+ sed -i "/cargo build/d" Makefile
44+ '';
45+
46+ preBuild = ''
47+ mkdir -p rust/target/release
48+ ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/
49+ ln -s ${native}/include/vdirsyncer_rustext.h rust/target/
50+ '';
2651
2752 LC_ALL = "en_US.utf8";
2853
54+ preCheck = ''
55+ ln -sf ../dist/tmpbuild/vdirsyncer/vdirsyncer/_native__lib.so vdirsyncer
56+ '';
57+
2958 checkPhase = ''
59+ runHook preCheck
3060 make DETERMINISTIC_TESTS=true test
61+ runHook postCheck
3162 '';
3263
3364 meta = with stdenv.lib; {
pkgs/top-level/python-packages.nix+2
@@ -7642,6 +7642,8 @@ in {
76427642
76437643 micawber = callPackage ../development/python-modules/micawber { };
76447644
7645+ milksnake = callPackage ../development/python-modules/milksnake { };
7646+
76457647 minimock = buildPythonPackage rec {
76467648 version = "1.2.8";
76477649 name = "minimock-${version}";