forked from bitcoindevkit/bdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-windows.sh
More file actions
34 lines (24 loc) · 1.03 KB
/
generate-windows.sh
File metadata and controls
34 lines (24 loc) · 1.03 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 x86_64-pc-windows-msvc
echo "Generating native binaries..."
cargo build --profile release-smaller --target x86_64-pc-windows-msvc
echo "Generating bdk.py..."
cargo run --bin uniffi-bindgen generate --library ./target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll --language python --out-dir ../../src/bdkpython/ --no-format
echo "Copying libraries bdkffi.dll..."
cp ./target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll ../../src/bdkpython/bdkffi.dll
echo "All done!"