-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3e469f
commit 38b0537
Showing
5 changed files
with
82 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[target.x86_64-apple-darwin] | ||
linker = "x86_64-apple-darwin14-clang" | ||
ar = "x86_64-apple-darwin14-ar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
#!/bin/bash | ||
|
||
JAVA_BLS_RESOURCES="/native/src/main/resources/co/rsk/bls12_381" | ||
PATH="/osxcross/target/bin:$PATH" | ||
PATH="$HOME/.cargo/bin:$PATH" | ||
|
||
# delete old build dir, if exists | ||
rm -rf "target/" && \ | ||
rm -rf "/native/src/main/resources/co/rsk/bls12_381" || true && \ | ||
mkdir -p "/native/src/main/resources/co/rsk/bls12_381" && \ | ||
rm -rf $JAVA_BLS_RESOURCES && \ | ||
mkdir -p $JAVA_BLS_RESOURCES && \ | ||
mkdir $JAVA_BLS_RESOURCES/macos && \ | ||
mkdir $JAVA_BLS_RESOURCES/linux && \ | ||
mkdir $JAVA_BLS_RESOURCES/win && \ | ||
|
||
# clean & build bls12-381 | ||
# clean & build bls12-381 (linux) | ||
rustup target add x86_64-unknown-linux-gnu && \ | ||
rustup toolchain install stable-x86_64-unknown-linux-gnu && \ | ||
cargo clean && \ | ||
cargo build --lib --features eip_2357_c_api --release && \ | ||
cargo build --lib --features eip_2357_c_api --release --target x86_64-unknown-linux-gnu && \ | ||
cp target/x86_64-unknown-linux-gnu/release/libeth_pairings.so $JAVA_BLS_RESOURCES/linux &&\ | ||
|
||
# move to resources | ||
cp target/release/libeth_pairings.so "/native/src/main/resources/co/rsk/bls12_381" | ||
# clean & build bls12-381 (windows 64 bits) | ||
rustup target add x86_64-pc-windows-gnu && \ | ||
rustup toolchain install stable-x86_64-pc-windows-gnu && \ | ||
cargo clean && \ | ||
cargo build --lib --features eip_2357_c_api --release --target x86_64-pc-windows-gnu && \ | ||
cp target/x86_64-pc-windows-gnu/release/eth_pairings.dll $JAVA_BLS_RESOURCES/win | ||
|
||
# clean & build bls12-381 (mac) - toolchain: osxcross | ||
rustup target add x86_64-apple-darwin && \ | ||
cargo clean && \ | ||
cargo build --lib --features eip_2357_c_api --release --target x86_64-apple-darwin && \ | ||
cp target/x86_64-apple-darwin/release/libeth_pairings.dylib $JAVA_BLS_RESOURCES/macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters