mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2024-12-23 13:14:52 +01:00
55da78ad91
Former-commit-id: e77044f56c199268115c8768d69b4fe06357d6c3
27 lines
721 B
Bash
Executable file
27 lines
721 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 wheel..."
|
|
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"
|