Install rust on readthedocs

This commit is contained in:
Markus Unterwaditzer 2017-10-05 17:44:03 +02:00
parent 1b7cb4e656
commit 69543b8615
3 changed files with 12 additions and 5 deletions

View file

@ -139,4 +139,11 @@ ssh-submodule-urls:
echo -n 'New URL: '; \
git remote get-url origin"
install-rust:
curl https://sh.rustup.rs -sSf | sh -s -- -y
rust-ext:
[ "$$READTHEDOCS" != "True" ] || $(MAKE) install-rust
cd ./rust && PATH="$$HOME/.cargo/bin/:$$PATH" cargo build --release
.PHONY: docs

View file

@ -9,5 +9,5 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
. $HOME/osx-py3/bin/activate
fi
curl https://sh.rustup.rs -sSf | sh -s -- -y
make install-rust
export PATH="$HOME/.cargo/bin/:$PATH"

View file

@ -40,16 +40,16 @@ requirements = [
def build_native(spec):
build = spec.add_external_build(
cmd=['cargo', 'build', '--release'],
path='./rust'
cmd=['make', 'rust-ext'],
path='.'
)
spec.add_cffi_module(
module_path='vdirsyncer._native',
dylib=lambda: build.find_dylib(
'vdirsyncer_rustext', in_path='target/release'),
'vdirsyncer_rustext', in_path='rust/target/release'),
header_filename=lambda: build.find_header(
'vdirsyncer_rustext.h', in_path='target'),
'vdirsyncer_rustext.h', in_path='rust/target'),
# Rust bug: If thread-local storage is used, this flag is necessary
# (mitsuhiko)
rtld_flags=['NODELETE']