Skip to content

Commit

Permalink
add COINCURVE_UPSTREAM_REF env var (#85)
Browse files Browse the repository at this point in the history
* add COINCURVE_UPSTREAM_REF env var

* Update build-windows-wheels.sh

* .

* Update build-windows-wheels.sh

* .

* Update build.sh
  • Loading branch information
ofek committed Jan 19, 2021
1 parent ddc0b7f commit 871fbbd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/scripts/build-windows-wheels.sh
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -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
^^^^^^
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 871fbbd

Please sign in to comment.