-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script: Add script to install the lib locally
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |