build: workaround for 'realpath' missing on macOS

This commit is contained in:
SomberNight 2020-02-11 16:06:32 +01:00
parent 4cec098d2d
commit 5b84e714f2
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
3 changed files with 8 additions and 6 deletions

View file

@ -107,6 +107,12 @@ function host_strip()
fi fi
} }
# on MacOS, there is no realpath by default
if ! [ -x "$(command -v realpath)" ]; then
function realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
fi
export SOURCE_DATE_EPOCH=1530212462 export SOURCE_DATE_EPOCH=1530212462

View file

@ -4,12 +4,12 @@ LIBSECP_VERSION="b408c6a8b287003d1ade5709e6f7bc3c7f1d5be7"
set -e set -e
. $(dirname "$0")/build_tools_util.sh || (echo "Could not source build_tools_util.sh" && exit 1)
here=$(dirname $(realpath "$0" 2> /dev/null || grealpath "$0")) here=$(dirname $(realpath "$0" 2> /dev/null || grealpath "$0"))
CONTRIB="$here" CONTRIB="$here"
PROJECT_ROOT="$CONTRIB/.." PROJECT_ROOT="$CONTRIB/.."
. "$here"/build_tools_util.sh || (echo "Could not source build_tools_util.sh" && exit 1)
pkgname="secp256k1" pkgname="secp256k1"
info "Building $pkgname..." info "Building $pkgname..."

View file

@ -21,7 +21,3 @@ function DoCodeSignMaybe { # ARGS: infoName fileOrDirName codesignIdentity
info "Code signing ${infoName}..." info "Code signing ${infoName}..."
codesign -f -v $deep -s "$identity" "$file" || fail "Could not code sign ${infoName}" codesign -f -v $deep -s "$identity" "$file" || fail "Could not code sign ${infoName}"
} }
function realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}