commit c76375de9188f13573910bd5b054df39a74bf168
parent 1e06b1921e324ba41803f6e970a629be30037340
Author: Johann Bauer <bauerj@bauerj.eu>
Date: Wed, 30 May 2018 20:31:35 +0200
Build libsecp256k1
Diffstat:
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/contrib/build-osx/make_osx b/contrib/build-osx/make_osx
@@ -5,6 +5,7 @@ PYTHON_VERSION=3.6.4
BUILDDIR=/tmp/electrum-build
PACKAGE=Electrum
GIT_REPO=https://github.com/spesmilo/electrum
+LIBSECP_VERSION=452d8e4d2a2f9f1b5be6b02e18f1ba102e5ca0b4
. $(dirname "$0")/base.sh
@@ -14,6 +15,8 @@ cd $src_dir/../..
export PYTHONHASHSEED=22
VERSION=`git describe --tags --dirty`
+which brew > /dev/null 2>&1 || fail "Please install brew from https://brew.sh/ to continue"
+
info "Installing Python $PYTHON_VERSION"
export PATH="~/.pyenv/bin:~/.pyenv/shims:~/Library/Python/3.6/bin:$PATH"
if [ -d "~/.pyenv" ]; then
@@ -52,6 +55,19 @@ curl https://homebrew.bintray.com/bottles/libusb-1.0.22.el_capitan.bottle.tar.gz
tar xz --directory $BUILDDIR
cp $BUILDDIR/libusb/1.0.22/lib/libusb-1.0.dylib contrib/build-osx
+info "Building libsecp256k1"
+brew install autoconf automake libtool
+git clone https://github.com/bitcoin-core/secp256k1 $BUILDDIR/secp256k1
+pushd $BUILDDIR/secp256k1
+git reset --hard $LIBSECP_VERSION
+git clean -f -x -q
+./autogen.sh
+./configure --enable-module-recovery --enable-experimental --enable-module-ecdh --disable-jni
+make
+popd
+cp $BUILDDIR/secp256k1/.libs/libsecp256k1.0.dylib contrib/build-osx
+
+
info "Installing requirements..."
python3 -m pip install -Ir ./contrib/deterministic-build/requirements.txt --user && \
python3 -m pip install -Ir ./contrib/deterministic-build/requirements-binaries.txt --user || \
diff --git a/contrib/build-osx/osx.spec b/contrib/build-osx/osx.spec
@@ -43,6 +43,7 @@ datas += collect_data_files('keepkeylib')
# Add libusb so Trezor will work
binaries = [(electrum + "contrib/build-osx/libusb-1.0.dylib", ".")]
+binaries += [(electrum + "contrib/build-osx/libsecp256k1.0.dylib", ".")]
# Workaround for "Retro Look":
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]