From 871fbbdf82190b0dfcc5d21259ad4c104f5348a1 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Tue, 19 Jan 2021 00:53:45 -0500 Subject: [PATCH] add COINCURVE_UPSTREAM_REF env var (#85) * add COINCURVE_UPSTREAM_REF env var * Update build-windows-wheels.sh * . * Update build-windows-wheels.sh * . * Update build.sh --- .github/scripts/build-windows-wheels.sh | 7 +++++-- .github/workflows/build.yml | 1 + HISTORY.rst | 1 + setup.py | 8 ++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/scripts/build-windows-wheels.sh b/.github/scripts/build-windows-wheels.sh index 1fbfd161b..18c3e6bdd 100755 --- a/.github/scripts/build-windows-wheels.sh +++ b/.github/scripts/build-windows-wheels.sh @@ -5,12 +5,15 @@ set -e -x build_dll() { ./autogen.sh echo "LDFLAGS = -no-undefined" >> Makefile.am - ./configure --host=$1 --enable-module-recovery --enable-experimental --enable-module-ecdh --enable-endomorphism --disable-jni + ./configure --host=$1 --enable-module-recovery --enable-experimental --enable-module-ecdh --enable-benchmark=no --enable-tests=no --enable-openssl-tests=no --enable-exhaustive-tests=no --enable-static --disable-dependency-tracking --with-pic make } cd .. -git clone https://github.com/bitcoin-core/secp256k1.git + +curl -sLO "https://github.com/bitcoin-core/secp256k1/archive/$COINCURVE_UPSTREAM_REF.tar.gz" +tar -xzf "$COINCURVE_UPSTREAM_REF.tar.gz" +mv "secp256k1-$COINCURVE_UPSTREAM_REF" secp256k1 mv secp256k1 64bit cp 64bit 32bit -R diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 279484d4e..b32e236f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ on: - master env: + COINCURVE_UPSTREAM_REF: f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7 LD_LIBRARY_PATH: ./libsecp256k1_ext/.libs DYLD_FALLBACK_LIBRARY_PATH: ./libsecp256k1_ext/.libs LIB_DIR: ./libsecp256k1_ext/.libs diff --git a/HISTORY.rst b/HISTORY.rst index 1ac7eb844..53953b3d2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,6 +12,7 @@ master - Build binary wheels for PyPy3.6 7.3.3 & PyPy3.7 7.3.3 on Linux - Upgrade libsecp256k1 to the latest available version - Upgrade libgmp to the latest available version +- Introduce ``COINCURVE_UPSTREAM_REF`` environment variable to select an alternative libsecp256k1 version when building from source 14.0.0 ^^^^^^ diff --git a/setup.py b/setup.py index 7529f2d4f..1caede085 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,9 @@ MAKE = 'gmake' if platform.system() in ['FreeBSD', 'OpenBSD'] else 'make' # Version of libsecp256k1 to download if none exists in the `libsecp256k1` directory -LIB_TARBALL_URL = 'https://github.com/bitcoin-core/secp256k1/archive/f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7.tar.gz' +UPSTREAM_REF = os.getenv('COINCURVE_UPSTREAM_REF') or 'f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7' + +LIB_TARBALL_URL = f'https://github.com/bitcoin-core/secp256k1/archive/{UPSTREAM_REF}.tar.gz' # We require setuptools >= 3.3 @@ -175,12 +177,14 @@ def run(self): '--disable-dependency-tracking', '--with-pic', '--enable-module-recovery', - '--disable-jni', '--prefix', os.path.abspath(self.build_clib), '--enable-experimental', '--enable-module-ecdh', '--enable-benchmark=no', + '--enable-tests=no', + '--enable-openssl-tests=no', + '--enable-exhaustive-tests=no', ] log.debug('Running configure: {}'.format(' '.join(cmd)))