secp-sys: update README for new vendoring script

Also a couple minor tweaks to the vendoring script itself.
This commit is contained in:
Andrew Poelstra 2023-03-30 12:37:28 +00:00
parent 4b02e9c405
commit 2ae7ca9cf2
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 11 additions and 6 deletions

View File

@ -20,11 +20,12 @@ This prefix ensures that no symbol collision can happen:
To update the vendored sources, use the `vendor-libsecp.sh` script:
```
$ ./vendor-libsecp.sh depend <version-code> <rev>
$ ./vendor-libsecp.sh <rev>
```
- Where `<version-code>` is the secp256k1-sys version number underscored: `0_1_2`.
- Where `<rev>` is the git revision of libsecp256k1 to checkout.
Where `<rev>` is the git revision of libsecp256k1 to checkout. If you do not
specify a revision, the script will simply clone the repo and use whatever
revision the default branch is pointing to.
## Linking to external symbols

View File

@ -1,2 +1,2 @@
# This file was automatically created by ./vendor-libsecp.sh
# This file was automatically created by vendor-libsecp.sh
21ffe4b22a9683cf24ae0763359e401d1284cc7a

View File

@ -2,7 +2,11 @@
set -e
# Set default variables
: "${SECP_VENDOR_GIT_ROOT:=$(git rev-parse --show-toplevel)}"
if [ -z "$SECP_VENDOR_GIT_ROOT" ]; then
SECP_VENDOR_GIT_ROOT="$(git rev-parse --show-toplevel)"
else
SECP_VENDOR_GIT_ROOT="$(realpath "$SECP_VENDOR_GIT_ROOT")"
fi
SECP_SYS="$SECP_VENDOR_GIT_ROOT"/secp256k1-sys
DEFAULT_VERSION_CODE=$(grep version "$SECP_SYS/Cargo.toml" | sed 's/\./_/g' | sed 's/.*"\(.*\)".*/\1/')
DEFAULT_DEPEND_DIR="$SECP_SYS/depend"
@ -83,7 +87,7 @@ rm -rf .git/ || true
popd
# Record revision
echo "# This file was automatically created by $0" > ./secp256k1-HEAD-revision.txt
echo "# This file was automatically created by $(basename "$0")" > ./secp256k1-HEAD-revision.txt
echo "$SOURCE_REV" >> ./secp256k1-HEAD-revision.txt
# Patch source files