Skip to content

Commit

Permalink
script: Add script to install the lib locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Synss committed May 2, 2020
1 parent 8aacbe3 commit a91c707
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/install-pymbedtls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# vim:noet:ts=2:sw=2:tw=79

# Install python-mbedtls locally
#
# This assumes that mbedtls is installed in `./lib/current`.

set -ex

version="${1:\*}"
upstream="$PWD/lib/current"
python="cp$(python --version 2>&1 | perl -pne 's|^\w+\s(\d)\.(\d+)\.\d+$|\1\2|g')"

fixlib=$([ "$(uname -s)" = "Darwin" ] \
&& echo "delocate-wheel -v" \
|| echo "auditwheel repair")

wheel="python_mbedtls-$version-$python-$python"'m*.whl'

C_INCLUDE_PATH=/usr/include:$upstream/include
DYLD_LIBRARY_PATH=/usr/lib
LD_LIBRARY_PATH=/usr/lib

export C_INCLUDE_PATH
export DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH

python setup.py bdist_wheel && \
delocate-wheel -v dist/$wheel && \
pip install -U dist/$wheel

0 comments on commit a91c707

Please sign in to comment.