forked from LtbLightning/payjoin-ffi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_macos.sh
More file actions
29 lines (20 loc) · 974 Bytes
/
generate_macos.sh
File metadata and controls
29 lines (20 loc) · 974 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
python3 --version
pip install -r requirements.txt -r requirements-dev.txt
LIBNAME=libpayjoin_ffi.dylib
echo "Generating payjoin_ffi.py..."
cd ../
cargo build --features uniffi --profile release
cargo run --features uniffi --profile release --bin uniffi-bindgen generate --library target/release/$LIBNAME --language python --out-dir python/src/payjoin/
echo "Generating native binaries..."
rustup target add aarch64-apple-darwin x86_64-apple-darwin
cargo build --profile release-smaller --target aarch64-apple-darwin --features uniffi
echo "Done building aarch64-apple-darwin"
cargo build --profile release-smaller --target x86_64-apple-darwin --features uniffi
echo "Done building x86_64-apple-darwin"
echo "Building macos fat library"
lipo -create -output python/src/payjoin/$LIBNAME \
target/aarch64-apple-darwin/release-smaller/$LIBNAME \
target/x86_64-apple-darwin/release-smaller/$LIBNAME
echo "All done!"