From feabc475c09f3aaf82fb973f184b5680849312e3 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 3 Aug 2018 12:40:46 +0200 Subject: [PATCH] vdirsyncer: 0.17.0a2 -> 0.17.0a3 fixes build --- pkgs/tools/misc/vdirsyncer/default.nix | 31 +++++++++----------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/misc/vdirsyncer/default.nix b/pkgs/tools/misc/vdirsyncer/default.nix index 9e9ded5c3a7..0655264cc54 100644 --- a/pkgs/tools/misc/vdirsyncer/default.nix +++ b/pkgs/tools/misc/vdirsyncer/default.nix @@ -1,30 +1,25 @@ -{ stdenv, python3Packages, glibcLocales, rustPlatform }: +{ stdenv, python3Packages, glibcLocales, rustPlatform, pkgconfig, openssl }: # Packaging documentation at: # https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst let pythonPackages = python3Packages; - version = "0.17.0a2"; + version = "0.17.0a3"; pname = "vdirsyncer"; name = pname + "-" + version; src = pythonPackages.fetchPypi { inherit pname version; - sha256 = "0y464rsx5la6bp94z2g0nnkbl4nwfya08abynvifw4c84vs1gr4q"; + sha256 = "1n7izfa5x9mh0b4zp20gd8qxfcca5wpjh834bsbi5pk6zam5pfdy"; }; 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 - ''; + cargoSha256 = "08xq9q5fx37azzkqqgwcnds1yd8687gh26dsl3ivql5h13fa2w3q"; + buildInputs = [ pkgconfig openssl ]; }; in pythonPackages.buildPythonApplication rec { - inherit version pname src; + inherit version pname src native; propagatedBuildInputs = with pythonPackages; [ click click-log click-threading @@ -33,6 +28,7 @@ in pythonPackages.buildPythonApplication rec { requests_oauthlib # required for google oauth sync atomicwrites milksnake + shippai ]; buildInputs = with pythonPackages; [ setuptools_scm ]; @@ -40,25 +36,20 @@ in pythonPackages.buildPythonApplication rec { checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ]; postPatch = '' - sed -i "/cargo build/d" Makefile + sed -i 's/spec.add_external_build(cmd=cmd/spec.add_external_build(cmd="true"/g' setup.py ''; preBuild = '' mkdir -p rust/target/release - ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/ - ln -s ${native}/include/vdirsyncer_rustext.h rust/target/ + ln -s ${native}/bin/libvdirsyncer_rustext* rust/target/release/ ''; LC_ALL = "en_US.utf8"; - preCheck = '' - ln -sf ../dist/tmpbuild/vdirsyncer/vdirsyncer/_native__lib.so vdirsyncer - ''; - checkPhase = '' - runHook preCheck + rm -rf vdirsyncer + export PYTHONPATH=$out/${pythonPackages.python.sitePackages}:$PYTHONPATH make DETERMINISTIC_TESTS=true test - runHook postCheck ''; meta = with stdenv.lib; {