forked from bitcoindevkit/bdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-macos-arm64.sh
More file actions
34 lines (24 loc) · 1.04 KB
/
generate-macos-arm64.sh
File metadata and controls
34 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
printf "\nSubmodule check...\n"
git submodule update --init
printf "Submodule is checked out at commit: $(git submodule status)\n\n"
echo "Setting up Python dependencies..."
python3 --version
# Check for uv first (faster), then fall back to pip
if command -v uv &> /dev/null; then
echo "Using uv to install dependencies..."
uv add -r requirements.txt
else
echo "Using pip to install dependencies..."
pip install -r requirements.txt || pip3 install -r requirements.txt
fi
cd ./bdk-ffi/bdk-ffi/
rustup target add aarch64-apple-darwin
echo "Generating native binaries..."
cargo build --profile release-smaller --target aarch64-apple-darwin
echo "Generating bdk.py..."
cargo run --bin uniffi-bindgen generate --library ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib --language python --out-dir ../../src/bdkpython/ --no-format
echo "Copying libraries libbdkffi.dylib..."
cp ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../../src/bdkpython/libbdkffi.dylib
echo "All done!"