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 9653017
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
auditwheel; sys_platform = "linux"
coverage
cython
delocate; sys_platform = "darwin"
pytest
wheel
45 changes: 45 additions & 0 deletions scripts/install-pymbedtls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh
# vim:noet:ts=2:sw=2:tw=79

set -e

if [ $# -eq 0 ] || [ $# -gt 2 ]; then
cat <<- EOF
usage:
$0 LIBDIR [ VERSION ]
Install python-mbedtls locally, using mbedtls from LIBDIR
The script requires 'delocate' on MacOS or 'auditwheel' on Linux.
EOF
exit 1
fi

if [ -n "$(command -v delocate-wheel)" ]; then
fixlib="delocate-wheel -v"
elif [ -n "$(command -v auditwheel)" ]; then
fixlib="auditwheel repair"
else
echo "Missing requirement."
exit 1
fi

libdir="$1"
version="${2:-*}"

python="cp$(python --version 2>&1 | perl -pne 's|^\w+\s(\d)\.(\d+)\.\d+$|\1\2|g')"
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 9653017

Please sign in to comment.