For development statically link dcc-rs

This links the python bindings statically to libdeltachat.a if the
DCC_RS_DEV environment variable is set to the project's root.  This is
a little simpler then requiring the manual CFLAGS and LD_LIBRARY_PATH
tweaking.

It also adds a script to easily invoke the integration tests locally
without forgetting steps.
This commit is contained in:
Floris Bruynooghe
2019-06-10 17:17:34 +02:00
parent af8d056206
commit 5090b4d24b
7 changed files with 88 additions and 45 deletions

View File

@@ -1,13 +1,12 @@
#!/bin/bash
#
# Build the Delta Chat C/Rust library
# typically run in a docker container that contains all library deps
# but should also work outside if you have the dependencies installed
# on your system.
# Build the Delta Chat C/Rust library typically run in a docker
# container that contains all library deps but should also work
# outside if you have the dependencies installed on your system.
set -e -x
# perform clean build of core and install
# Perform clean build of core and install.
export TOXWORKDIR=.docker-tox
# install core lib
@@ -16,12 +15,11 @@ export PATH=/root/.cargo/bin:$PATH
cargo build --release -p deltachat_ffi
# cargo test --all --all-features
# make sure subsequent compiler invocations find header and libraries
export CFLAGS=-I`pwd`/deltachat-ffi
export LD_LIBRARY_PATH=`pwd`/target/release
# Statically link against libdeltachat.a.
export DCC_RS_DEV=$(pwd)
# configure access to a base python and
# to several python interpreters needed by tox below
# Configure access to a base python and to several python interpreters
# needed by tox below.
export PATH=$PATH:/opt/python/cp35-cp35m/bin
export PYTHONDONTWRITEBYTECODE=1
pushd /bin
@@ -30,23 +28,23 @@ ln -s /opt/python/cp36-cp36m/bin/python3.6
ln -s /opt/python/cp37-cp37m/bin/python3.7
popd
if [ -n "$TESTS" ]; then
if [ -n "$TESTS" ]; then
pushd python
# prepare a clean tox run
pushd python
# prepare a clean tox run
rm -rf tests/__pycache__
rm -rf src/deltachat/__pycache__
export PYTHONDONTWRITEBYTECODE=1
# run tox
# run tox
tox --workdir "$TOXWORKDIR" -e py27,py35,py36,py37,auditwheels
popd
fi
if [ -n "$DOCS" ]; then
if [ -n "$DOCS" ]; then
echo -----------------------
echo generating python docs
echo -----------------------
(cd python && tox --workdir "$TOXWORKDIR" -e doc)
(cd python && tox --workdir "$TOXWORKDIR" -e doc)
fi