codemp-sublime/build.sh
Camillo Schenone c29c95fe55 fix: logger does not panic anymore on reload.
cleanup: old lib version

Former-commit-id: 4dc9cc8048c8dd58438c8da8c2f2a57b16eaaec5
2024-08-04 19:52:12 +02:00

27 lines
722 B
Bash
Executable file

#!/bin/sh
ROOT_DIR="$(pwd)"
BUILD_DIR="$ROOT_DIR/target/debug/"
WHEEL_DIR="$ROOT_DIR/target/wheels"
FILENAME="libcodemp"
TARGET_DIR="$ROOT_DIR/bindings"
SO_NAME="codemp"
WHEEL_NAME="Codemp_Sublime"
PYO3_PYTHON="$(pyenv which python)"
TARGET_EXT="$($PYO3_PYTHON -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')"
SO_TARGET="${SO_NAME}${TARGET_EXT}"
echo "Building .SO with python: $PYO3_PYTHON"
env PYO3_PYTHON="${PYO3_PYTHON}" cargo build
echo "Copying into: $TARGET_DIR/$SO_TARGET"
echo "Building python wheels..."
maturin build -i "$PYO3_PYTHON"
wheels=($WHEEL_DIR/$WHEEL_NAME*.whl)
for whl in $wheels; do
cp $whl $TARGET_DIR
done
ditto "$BUILD_DIR/${FILENAME}.dylib" "$TARGET_DIR/$SO_TARGET"