Browse Source

build scripts: add libsecp256k1 library to the electrum_ecc directory

master
ThomasV 1 year ago committed by SomberNight
parent
commit
9dbbd815a3
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 6
      .cirrus.yml
  2. 4
      contrib/build-wine/build-electrum-git.sh
  3. 5
      contrib/make_libsecp256k1.sh
  4. 6
      contrib/osx/make_osx.sh

6
.cirrus.yml

@ -46,8 +46,6 @@ task:
- ./contrib/make_libsecp256k1.sh
- mkdir contrib/_saved_secp256k1_build
- cp electrum/libsecp256k1.so.* contrib/_saved_secp256k1_build/
libsecp_install_script:
- cp contrib/_saved_secp256k1_build/* electrum/
tox_script:
- export PYTHONASYNCIODEBUG
- export PYTHONDEVMODE
@ -55,6 +53,7 @@ task:
coveralls_script:
- if [ ! -z "$COVERALLS_REPO_TOKEN" ] ; then coveralls ; fi
env:
LD_LIBRARY_PATH: contrib/_saved_secp256k1_build/
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
# following CI_* env vars are set up for coveralls
@ -127,8 +126,6 @@ task:
- ./contrib/make_libsecp256k1.sh
- mkdir contrib/_saved_secp256k1_build
- cp electrum/libsecp256k1.so.* contrib/_saved_secp256k1_build/
libsecp_install_script:
- cp contrib/_saved_secp256k1_build/* electrum/
bitcoind_service_background_script:
- tests/regtest/run_bitcoind.sh
electrumx_service_background_script:
@ -137,6 +134,7 @@ task:
- sleep 10s
- python3 -m unittest tests/regtest.py
env:
LD_LIBRARY_PATH: contrib/_saved_secp256k1_build/
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
# ElectrumX exits with an error without this:
ALLOW_ROOT: 1

4
contrib/build-wine/build-electrum-git.sh

@ -50,9 +50,9 @@ pushd $WINEPREFIX/drive_c/electrum
# see https://github.com/pypa/pip/issues/2195 -- pip makes a copy of the entire directory
info "Pip installing Electrum. This might take a long time if the project folder is large."
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location .
# pyinstaller needs to be able to "import electrum", for which we need libsecp256k1:
# pyinstaller needs to be able to "import electrum_ecc", for which we need libsecp256k1:
# (or could try "pip install -e" instead)
cp electrum/libsecp256k1-*.dll "$WINEPREFIX/drive_c/python3/Lib/site-packages/electrum/"
cp electrum/libsecp256k1-*.dll "$WINEPREFIX/drive_c/python3/Lib/site-packages/electrum_ecc/"
popd

5
contrib/make_libsecp256k1.sh

@ -66,9 +66,10 @@ info "Building $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."
if [ -n "$DLL_TARGET_DIR" ] ; then
cp -fpv "$here/$pkgname/dist/lib/$dlname" "$DLL_TARGET_DIR/" || fail "Could not copy the $pkgname binary to DLL_TARGET_DIR"
else
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 'electrum' folder."
fi
)

6
contrib/osx/make_osx.sh

@ -149,7 +149,7 @@ if [ ! -f "$DLL_TARGET_DIR/libsecp256k1.2.dylib" ]; then
else
info "Skipping libsecp256k1 build: reusing already built dylib."
fi
cp -f "$DLL_TARGET_DIR"/libsecp256k1.*.dylib "$PROJECT_ROOT/electrum/" || fail "Could not copy libsecp256k1 dylib"
#cp -f "$DLL_TARGET_DIR"/libsecp256k1.*.dylib "$PROJECT_ROOT/electrum" || fail "Could not copy libsecp256k1 dylib"
if [ ! -f "$DLL_TARGET_DIR/libzbar.0.dylib" ]; then
info "Building ZBar dylib..."
@ -189,9 +189,9 @@ python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all:
info "Building $PACKAGE..."
python3 -m pip install --no-build-isolation --no-dependencies \
--no-warn-script-location . > /dev/null || fail "Could not build $PACKAGE"
# pyinstaller needs to be able to "import electrum", for which we need libsecp256k1:
# pyinstaller needs to be able to "import electrum_ecc", for which we need libsecp256k1:
# (or could try "pip install -e" instead)
cp "$PROJECT_ROOT/electrum"/libsecp256k1.*.dylib "$VENV_DIR/lib/python$PY_VER_MAJOR/site-packages/electrum/"
cp "$DLL_TARGET_DIR"/libsecp256k1.*.dylib "$VENV_DIR/lib/python$PY_VER_MAJOR/site-packages/electrum_ecc/"
# strip debug symbols of some compiled libs
# - hidapi (hid.cpython-39-darwin.so) in particular is not reproducible without this

Loading…
Cancel
Save