#!/usr/bin/env bash
set -ev

# We have to include the avogadro library in Linux's LD_LIBRARY_PATH,
# or auditwheel won't work.
# The Avogadro library does not exist for some reason and needs to be built.
python setup.py build

LIBRARY_DIR=$(find . -name "libAvogadroCore.so*" | head -n 1 | xargs readlink -f | xargs dirname)

export LD_LIBRARY_PATH=$LIBRARY_DIR:$LD_LIBRARY_PATH

WHEEL_PATH=$(find /tmp/cibuildwheel/built_wheel/ -name "*.whl" | xargs readlink -f)

auditwheel repair -w /tmp/cibuildwheel/repaired_wheel $WHEEL_PATH

rm -rf /tmp/cibuildwheel/built_wheel

#!/usr/bin/env bash
set -ev

# FIXME: if the libraries are already inside the wheel, why do we have
# to provide them to auditwheel again? It would be ideal if we could
# avoid this script entirely.

# We have to include the avogadro library in Linux's LD_LIBRARY_PATH,
# or auditwheel won't work. These libraries are already in the wheel.
WHEEL_DIR=/tmp/cibuildwheel/built_wheel
WHEEL_PATH=$(find $WHEEL_DIR -name "*.whl" | xargs readlink -f)

cd $WHEEL_DIR
unzip $WHEEL_PATH

LIBRARY_DIR=$WHEEL_DIR/avogadro

export LD_LIBRARY_PATH=$LIBRARY_DIR:$LD_LIBRARY_PATH

auditwheel repair -w /tmp/cibuildwheel/repaired_wheel $WHEEL_PATH

rm -rf /tmp/cibuildwheel/built_wheel

Use libraries already inside wheel for auditwheel
Use libraries already inside wheel for auditwheel

I don't know why auditwheel can't see the libraries since they are
already inside the wheel. If we can figure out how to get it to see
the libraries, we can skip the whole script.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>
