Browse Source
heavily based on Electron-Cash/Electron-Cash@eda015908e9d6ea9a0adfbda9db55b929c0926bahard-fail-on-bad-server-string
SomberNight
5 years ago
11 changed files with 146 additions and 105 deletions
@ -1,56 +0,0 @@ |
|||
#!/bin/bash |
|||
# heavily based on https://github.com/ofek/coincurve/blob/417e726f553460f88d7edfa5dc67bfda397c4e4a/.travis/build_windows_wheels.sh |
|||
|
|||
set -e |
|||
|
|||
here="$(dirname "$(readlink -e "$0")")" |
|||
LIBSECP_VERSION="b408c6a8b287003d1ade5709e6f7bc3c7f1d5be7" |
|||
|
|||
. "$CONTRIB"/build_tools_util.sh |
|||
|
|||
info "building libsecp256k1..." |
|||
|
|||
|
|||
build_dll() { |
|||
#sudo apt-get install -y mingw-w64 |
|||
export SOURCE_DATE_EPOCH=1530212462 |
|||
echo "LDFLAGS = -no-undefined" >> Makefile.am |
|||
./autogen.sh |
|||
# Note: set both --build and --host when running configure |
|||
# Otherwise weird voodoo magic happens with Docker and Wine. |
|||
# https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html |
|||
LDFLAGS="-Wl,--no-insert-timestamp" ./configure \ |
|||
--host=$1 \ |
|||
--build=x86_64-pc-linux-gnu \ |
|||
--enable-module-recovery \ |
|||
--enable-experimental \ |
|||
--enable-module-ecdh \ |
|||
--disable-jni |
|||
make -j4 |
|||
${1}-strip .libs/libsecp256k1-0.dll |
|||
} |
|||
|
|||
|
|||
cd "$CACHEDIR" |
|||
|
|||
if [ -f "secp256k1/libsecp256k1.dll" ]; then |
|||
info "libsecp256k1.dll already built, skipping" |
|||
exit 0 |
|||
fi |
|||
|
|||
|
|||
if [ ! -d secp256k1 ]; then |
|||
git clone https://github.com/bitcoin-core/secp256k1.git |
|||
fi |
|||
|
|||
cd secp256k1 |
|||
git reset --hard |
|||
git clean -f -x -q |
|||
git checkout $LIBSECP_VERSION |
|||
|
|||
build_dll i686-w64-mingw32 # 64-bit would be: x86_64-w64-mingw32 |
|||
mv .libs/libsecp256k1-0.dll libsecp256k1.dll |
|||
|
|||
find -exec touch -d '2000-11-11T11:11:11+00:00' {} + |
|||
|
|||
info "building libsecp256k1 finished" |
@ -0,0 +1,49 @@ |
|||
#!/bin/bash |
|||
|
|||
LIBSECP_VERSION="b408c6a8b287003d1ade5709e6f7bc3c7f1d5be7" |
|||
|
|||
set -e |
|||
|
|||
here=$(dirname $(realpath "$0" 2> /dev/null || grealpath "$0")) |
|||
CONTRIB="$here" |
|||
PROJECT_ROOT="$CONTRIB/.." |
|||
|
|||
. "$here"/build_tools_util.sh || (echo "Could not source build_tools_util.sh" && exit 1) |
|||
|
|||
pkgname="secp256k1" |
|||
info "Building $pkgname..." |
|||
|
|||
( |
|||
cd $CONTRIB |
|||
if [ ! -d secp256k1 ]; then |
|||
git clone https://github.com/bitcoin-core/secp256k1.git |
|||
fi |
|||
cd secp256k1 |
|||
git reset --hard |
|||
git clean -f -x -q |
|||
git checkout $LIBSECP_VERSION |
|||
|
|||
if ! [ -x configure ] ; then |
|||
echo "libsecp256k1_la_LDFLAGS = -no-undefined" >> Makefile.am |
|||
echo "LDFLAGS = -no-undefined" >> Makefile.am |
|||
./autogen.sh || fail "Could not run autogen for $pkgname. Please make sure you have automake and libtool installed, and try again." |
|||
fi |
|||
if ! [ -r config.status ] ; then |
|||
./configure \ |
|||
$AUTOCONF_FLAGS \ |
|||
--prefix="$here/$pkgname/dist" \ |
|||
--enable-module-recovery \ |
|||
--enable-experimental \ |
|||
--enable-module-ecdh \ |
|||
--disable-jni \ |
|||
--disable-tests \ |
|||
--disable-static \ |
|||
--enable-shared || fail "Could not configure $pkgname. Please make sure you have a C compiler installed and try again." |
|||
fi |
|||
make -j4 || fail "Could not build $pkgname" |
|||
make install || fail "Could not install $pkgname" |
|||
. "$here/$pkgname/dist/lib/libsecp256k1.la" |
|||
host_strip "$here/$pkgname/dist/lib/$dlname" |
|||
cp -fpv "$here/$pkgname/dist/lib/$dlname" "$PROJECT_ROOT/electrum" || fail "Could not copy the $pkgname binary to its destination" |
|||
info "$dlname has been placed in the inner 'electrum' folder." |
|||
) |
Loading…
Reference in new issue