mirror of https://github.com/crytic/echidna
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
813 B
32 lines
813 B
#!/bin/bash
|
|
set -eux
|
|
|
|
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")" || true
|
|
}
|
|
|
|
|
|
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 "$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
|
|
|