-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Actions: improve macOS releases
Currently, releases for macOS are not very portable. The binaries have hardcoded paths and might not run on other systems. This commit improves the macOS binary releases made via GitHub actions by bundling binary copies of libff, libgmp and libsecp256k1, and by adjusting the rpath and library names to make echidna run on other systems.
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
add_rpath() | ||
{ | ||
BINARY="$1" | ||
install_name_tool -add_rpath "@executable_path/." "$BINARY" | ||
} | ||
|
||
fix_path() | ||
{ | ||
BINARY="$1" | ||
MATCH="$2" | ||
NEW="$3" | ||
OLD=$(otool -L "$BINARY" | grep "$MATCH" | awk '{print $1}') | ||
install_name_tool -change "$OLD" "$NEW" "$BINARY" | ||
cp -n "$OLD" "$(dirname "$BINARY")/$(basename "$NEW")" | ||
} | ||
|
||
|
||
BUILD="$(mktemp -d)/echidna-test" | ||
mkdir -p "$BUILD" | ||
cp "$HOME/.local/bin/echidna-test" "$BUILD" | ||
|
||
BINARY="$BUILD/echidna-test" | ||
add_rpath "$BINARY" | ||
fix_path "$BINARY" libsecp256k1 "@rpath/libsecp256k1.dylib" | ||
fix_path "$BINARY" libff "@rpath/libff.dylib" | ||
fix_path "$BINARY" libgmp "@rpath/libgmp.dylib" | ||
fix_path "$BUILD/libff.dylib" libgmp "@rpath/libgmp.dylib" | ||
fix_path "$BUILD/libsecp256k1.dylib" libgmp "@rpath/libgmp.dylib" | ||
|
||
GZIP=-9 tar -czf echidna-test.tar.gz -C "$BUILD/.." echidna-test |
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