2023-08-17 18:39:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ROOT_DIR="$(pwd)"
|
|
|
|
BUILD_DIR="$ROOT_DIR/target/debug/deps"
|
|
|
|
FILENAME="libcodemp_client"
|
|
|
|
|
|
|
|
TARGET_DIR="$ROOT_DIR/bindings"
|
|
|
|
TARGET_NAME="codemp_client"
|
|
|
|
|
|
|
|
PYO3_PYTHON="$(pyenv which python)"
|
|
|
|
PYTHON_SYS_EXECUTABLE="$PYO3_PYTHON"
|
2024-03-16 14:59:26 +01:00
|
|
|
TARGET_EXT="$($PYO3_PYTHON -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')"
|
|
|
|
FULL_TARGET="${TARGET_NAME}${TARGET_EXT}"
|
2023-08-17 18:39:47 +02:00
|
|
|
|
2023-08-25 03:05:53 +02:00
|
|
|
echo "Building with python: $PYO3_PYTHON"
|
2024-03-16 14:59:26 +01:00
|
|
|
env PYO3_PYTHON="${PYO3_PYTHON}" PYTHON_SYS_EXECUTABLE="$PYO3_PYTHON" cargo build
|
2023-08-25 03:05:53 +02:00
|
|
|
echo "Copying into: $TARGET_DIR/$FULL_TARGET"
|
2023-08-17 18:39:47 +02:00
|
|
|
|
|
|
|
[[ -f "$TARGET_DIR/$FUll_TARGET" ]] && echo "$FILE exists."
|
|
|
|
ditto "$BUILD_DIR/${FILENAME}.dylib" "$TARGET_DIR/$FULL_TARGET"
|