vdirsyncer: 0.17.0a2 -> 0.17.0a3

fixes build
This commit is contained in:
Gabriel Ebner 2018-08-03 12:40:46 +02:00
parent 0a519ad6df
commit feabc475c0

View File

@ -1,30 +1,25 @@
{ stdenv, python3Packages, glibcLocales, rustPlatform }: { stdenv, python3Packages, glibcLocales, rustPlatform, pkgconfig, openssl }:
# Packaging documentation at: # Packaging documentation at:
# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst # https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
let let
pythonPackages = python3Packages; pythonPackages = python3Packages;
version = "0.17.0a2"; version = "0.17.0a3";
pname = "vdirsyncer"; pname = "vdirsyncer";
name = pname + "-" + version; name = pname + "-" + version;
src = pythonPackages.fetchPypi { src = pythonPackages.fetchPypi {
inherit pname version; inherit pname version;
sha256 = "0y464rsx5la6bp94z2g0nnkbl4nwfya08abynvifw4c84vs1gr4q"; sha256 = "1n7izfa5x9mh0b4zp20gd8qxfcca5wpjh834bsbi5pk6zam5pfdy";
}; };
native = rustPlatform.buildRustPackage { native = rustPlatform.buildRustPackage {
name = name + "-native"; name = name + "-native";
inherit src; inherit src;
sourceRoot = name + "/rust"; sourceRoot = name + "/rust";
cargoSha256 = "1cr7xs11gbsc3x5slga9qahchwc22qq49amf28g4jgs9lzf57qis"; cargoSha256 = "08xq9q5fx37azzkqqgwcnds1yd8687gh26dsl3ivql5h13fa2w3q";
postInstall = '' buildInputs = [ pkgconfig openssl ];
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 { in pythonPackages.buildPythonApplication rec {
inherit version pname src; inherit version pname src native;
propagatedBuildInputs = with pythonPackages; [ propagatedBuildInputs = with pythonPackages; [
click click-log click-threading click click-log click-threading
@ -33,6 +28,7 @@ in pythonPackages.buildPythonApplication rec {
requests_oauthlib # required for google oauth sync requests_oauthlib # required for google oauth sync
atomicwrites atomicwrites
milksnake milksnake
shippai
]; ];
buildInputs = with pythonPackages; [ setuptools_scm ]; buildInputs = with pythonPackages; [ setuptools_scm ];
@ -40,25 +36,20 @@ in pythonPackages.buildPythonApplication rec {
checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ]; checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
postPatch = '' 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 = '' preBuild = ''
mkdir -p rust/target/release mkdir -p rust/target/release
ln -s ${native}/lib/libvdirsyncer_rustext* rust/target/release/ ln -s ${native}/bin/libvdirsyncer_rustext* rust/target/release/
ln -s ${native}/include/vdirsyncer_rustext.h rust/target/
''; '';
LC_ALL = "en_US.utf8"; LC_ALL = "en_US.utf8";
preCheck = ''
ln -sf ../dist/tmpbuild/vdirsyncer/vdirsyncer/_native__lib.so vdirsyncer
'';
checkPhase = '' checkPhase = ''
runHook preCheck rm -rf vdirsyncer
export PYTHONPATH=$out/${pythonPackages.python.sitePackages}:$PYTHONPATH
make DETERMINISTIC_TESTS=true test make DETERMINISTIC_TESTS=true test
runHook postCheck
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {