Skip to content

Commit

Permalink
Merge pull request #63 from AXErunners/development
Browse files Browse the repository at this point in the history
Release 3.3.8.6
  • Loading branch information
charlesrocket authored Apr 14, 2020
2 parents d9bf640 + 22ff86b commit 781d5d0
Show file tree
Hide file tree
Showing 103 changed files with 14,504 additions and 1,281 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
####-*.patch
*.pyc
*.swp
.DS_Store
build/
dist/
electrum_axe/locale/
Expand All @@ -21,5 +22,6 @@ bin/

electrum_data/
electrum_axe/gui/kivy/theming/light-0.png
electrum_axe/gui/kivy/theming/light-1.png
electrum_axe/gui/kivy/theming/light.atlas
*.egg-info/
4 changes: 2 additions & 2 deletions .latest-version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "3.3.8.5",
"version": "3.3.8.6",
"signatures": {
"XuKFPN7RDbrvNsPddPyUPzVqwdhvfB67cx": "H92YPucT5pf94liRc7VHYyIwWfwHkxF5hO1h/3l1HlITULuMukuvu/uJzv5zRL0Sl7edEdV+XiGSqWQrNHrHW5E="
"7XwiL79Ae8S9qyKbY58aGJRRf334UHwtCW": "H2nkeQcgS4y6TXljC56xYLDDuFPjRsZvxez0BCY+qn0IDxRkTP4HbRgIKNbngJ4OlpAaMcNfvR1OENG0gKZR3z4="
}
}
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Axe Electrum - Lightweight AXE client
============
.. image:: electrum_axe/gui/icons/electrum-axe.png
:alt: Electrum-AXE logo
.. image:: https://travis-ci.org/AXErunners/electrum-axe.svg?branch=master
:target: https://travis-ci.org/AXErunners/electrum-axe
.. image:: https://travis-ci.com/AXErunners/electrum-axe.svg?branch=master
:target: https://travis-ci.com/AXErunners/electrum-axe
:alt: Build Status

Getting started
Expand Down
192 changes: 192 additions & 0 deletions contrib/axe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
#!/bin/bash


function read_jks_storepass {
KEYSTORE=~/.jks/keystore
KEYSTORE_ARG="-keystore $KEYSTORE"
KEYTOOL_CMD="keytool -list -storepass:env JKS_STOREPASS $KEYSTORE_ARG"
while [[ -z $JKS_STOREPASS ]]; do
echo -n Input $KEYSTORE keystore password:
read -s JKS_STOREPASS
echo
export JKS_STOREPASS
keytool_res=`$KEYTOOL_CMD`
if [[ $? == 0 ]]; then
break
else
echo Wrong password
export JKS_STOREPASS=''
fi
done
export JKS_KEYPASS=$JKS_STOREPASS
}


if [[ ${OSTYPE} == "linux-gnu" ]]; then
echo "Build for Linux/Windows/Android"
elif [[ ${OSTYPE} == "darwin"* ]]; then
echo "Build for macOS"
else
echo "Unknown OS: ${OSTYPE}"
exit 1
fi


source contrib/axe/travis/electrum_axe_version_env.sh
if [[ -n $IS_RELEASE ]]; then
echo electrum-axe version is $AXE_ELECTRUM_VERSION, release build
else
echo electrum-axe version is $AXE_ELECTRUM_VERSION
fi
mkdir -p dist

BUILD_DIST_DIR=build/electrum-axe/dist
BUILD_BIN_DIR=build/electrum-axe/bin
NAME=Axe-Electrum
TNAME=Axe-Electrum-Testnet
DEB_NAME=electrum-axe
APK_NAME=Electrum_AXE
APK_TNAME=Electrum_AXE_Testnet
UAPK_TAIL=release-unsigned.apk
APK_TAIL=release.apk

if [[ "$OSTYPE" == "linux-gnu" ]]; then
# Build sdist/AppImage/Windows
sudo rm -rf build
mkdir -p build && cp contrib/axe/travis/* ./build/
./build/before_install-linux.sh
./build/before_install-linux-apk.sh
./build/travis-build-linux.sh
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}.tar.gz \
dist/
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}.zip \
dist/
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}-x86_64.AppImage \
dist/
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}-setup-win32.exe \
dist/
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}-setup-win64.exe \
dist/

# Build deb packages
PEP440_PUBVER_PATTERN="^((\d+)!)?"
PEP440_PUBVER_PATTERN=${PEP440_PUBVER_PATTERN}"(([0-9]+)(\.[0-9]+)*)"
PEP440_PUBVER_PATTERN=${PEP440_PUBVER_PATTERN}"([a-zA-Z]+[0-9]+)?"
PEP440_PUBVER_PATTERN=${PEP440_PUBVER_PATTERN}"((\.[a-zA-Z]+[0-9]+)*)$"
if [[ ${AXE_ELECTRUM_VERSION} =~ ${PEP440_PUBVER_PATTERN} ]]; then
if [[ -n ${BASH_REMATCH[1]} ]]; then
DEB_VERSION="${BASH_REMATCH[2]}:"
fi
DEB_VERSION="${DEB_VERSION}${BASH_REMATCH[3]}"
if [[ -n ${BASH_REMATCH[6]} ]]; then
DEB_VERSION="${DEB_VERSION}~${BASH_REMATCH[6]}"
fi
if [[ -n ${BASH_REMATCH[7]} ]]; then
DEB_VERSION="${DEB_VERSION}${BASH_REMATCH[7]}"
fi
DEB_SERIES=("xenial" "bionic" "disco" "eoan")
DEB_SER_VER=("16.04.1" "18.04.1" "19.04.1" "19.10.1")

pushd build
sudo rm -rf electrum-axe
cp ../dist/${NAME}-${AXE_ELECTRUM_VERSION}.tar.gz \
${DEB_NAME}_${DEB_VERSION}.orig.tar.gz
tar xzf ${DEB_NAME}_${DEB_VERSION}.orig.tar.gz
pushd ${NAME}-${AXE_ELECTRUM_VERSION}

for ((i=0;i<${#DEB_SERIES[@]};i++)); do
if [[ -f ~/pbuilder/${DEB_SERIES[i]}-base.tgz ]]; then
PPA_VERSION=${DEB_VERSION}-0ppa1~ubuntu${DEB_SER_VER[i]}
PPA_NAME=${DEB_NAME}_${PPA_VERSION}
DEB_BUILD_DIR=~/pbuilder/${DEB_SERIES[i]}_result
CHANGELOG_FIRST="${DEB_NAME} (${PPA_VERSION})"
CHANGELOG_FIRST="${CHANGELOG_FIRST} ${DEB_SERIES[i]};"
CHANGELOG_FIRST="${CHANGELOG_FIRST} urgency=medium"
sed -i "1s/.*/$CHANGELOG_FIRST/" debian/changelog
echo Building ${PPA_NAME}_all.deb python3-${PPA_NAME}_all.deb
sudo debuild -i -us -uc -S
pbuilder-dist ${DEB_SERIES[i]} ../${PPA_NAME}.dsc
mkdir ../../dist/${DEB_SERIES[i]}
cp ${DEB_BUILD_DIR}/${PPA_NAME}_all.deb \
../../dist/${DEB_SERIES[i]}
cp ${DEB_BUILD_DIR}/python3-${PPA_NAME}_all.deb \
../../dist/${DEB_SERIES[i]}
else
echo ~/pbuilder/${DEB_SERIES[i]}-base.tgz not found
echo Skip deb packages build for ${DEB_SERIES[i]}
fi
done

popd
popd
else
echo Version does not match PEP440 pubversion patter
echo Skip deb packages build
fi

# Build mainnet release apk
if [[ -n $IS_RELEASE ]]; then
sudo rm -rf build
mkdir -p build && cp contrib/axe/travis/* ./build/
export ELECTRUM_MAINNET=true
./build/travis-build-linux-apk.sh
cp ${BUILD_BIN_DIR}/${APK_NAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
dist/
fi

# Build testnet release apk
sudo rm -rf build
mkdir -p build && cp contrib/axe/travis/* ./build/
export ELECTRUM_MAINNET=false
./build/travis-build-linux-apk.sh
cp ${BUILD_BIN_DIR}/${APK_TNAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
dist/

sudo rm -rf build

read_jks_storepass

# Sign mainnet apk
if [[ -n $IS_RELEASE ]]; then
jarsigner -verbose \
-tsa http://sha256timestamp.ws.symantec.com/sha256/timestamp \
-sigalg SHA1withRSA -digestalg SHA1 \
-sigfile axe-electrum \
-keystore ~/.jks/keystore \
-storepass:env JKS_STOREPASS \
-keypass:env JKS_KEYPASS \
dist/${APK_NAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
axerunners.com

zipalign -v 4 \
dist/${APK_NAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
dist/${NAME}-$AXE_ELECTRUM_APK_VERSION-$APK_TAIL \

rm dist/${APK_NAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL
fi

# Sign testnet apk
jarsigner -verbose \
-tsa http://sha256timestamp.ws.symantec.com/sha256/timestamp \
-sigalg SHA1withRSA -digestalg SHA1 \
-sigfile axe-electrum \
-keystore ~/.jks/keystore \
-storepass:env JKS_STOREPASS \
-keypass:env JKS_KEYPASS \
dist/${APK_TNAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
axerunners.com

zipalign -v 4 \
dist/${APK_TNAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL \
dist/${TNAME}-$AXE_ELECTRUM_APK_VERSION-$APK_TAIL \

rm dist/${APK_TNAME}-$AXE_ELECTRUM_APK_VERSION-$UAPK_TAIL
else
# Build macOS
sudo rm -rf build
mkdir -p build && cp contrib/axe/travis/* ./build/
./build/before_install-osx.sh
./build/travis-build-osx.sh
cp ${BUILD_DIST_DIR}/${NAME}-${AXE_ELECTRUM_VERSION}-macosx.dmg \
dist/
fi
6 changes: 5 additions & 1 deletion contrib/axe/osx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ else:
raise Exception('no name')

PY36BINDIR = os.environ.get('PY36BINDIR')
TRAVIS_TAG = os.environ.get('TRAVIS_TAG')
AXE_ELECTRUM_VERSION = os.environ.get('AXE_ELECTRUM_VERSION')
ICONS_FILE = 'electrum_axe/gui/icons/electrum-axe.icns'

Expand Down Expand Up @@ -73,7 +74,10 @@ datas += collect_data_files('btchip')
datas += collect_data_files('keepkeylib')

# Add the QR Scanner helper app
datas += [('contrib/CalinsQRReader/build/Release/CalinsQRReader.app', './contrib/CalinsQRReader/build/Release/CalinsQRReader.app')]
if TRAVIS_TAG:
QRREADER_ZPATH = 'contrib/CalinsQRReader/build/Release/CalinsQRReader.app'
QRREADER_PATH = './contrib/CalinsQRReader/build/Release/CalinsQRReader.app'
datas += [(QRREADER_ZPATH, QRREADER_PATH)]

# Add libusb so Trezor and Safe-T mini will work
binaries = [('../libusb-1.0.dylib', '.')]
Expand Down
6 changes: 3 additions & 3 deletions contrib/axe/travis/before_install-linux-apk.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -ev

if [[ -z $TRAVIS_TAG ]]; then
echo TRAVIS_TAG unset, exiting
exit 1
if [[ $ELECTRUM_MAINNET == "true" ]] && [[ -z $IS_RELEASE ]]; then
# do not build mainnet apk if is not release
exit 0
fi

docker pull zebralucky/electrum-dash-winebuild:Kivy33x
7 changes: 2 additions & 5 deletions contrib/axe/travis/before_install-linux.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/bin/bash
set -ev

if [[ -z $TRAVIS_TAG ]]; then
echo TRAVIS_TAG unset, exiting
exit 1
fi

docker pull zebralucky/electrum-dash-winebuild:LinuxPy36

docker pull zebralucky/electrum-dash-winebuild:LinuxAppImage

docker pull zebralucky/electrum-dash-winebuild:WinePy36
42 changes: 21 additions & 21 deletions contrib/axe/travis/before_install-osx.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
#!/bin/bash
set -ev

if [[ -z $TRAVIS_TAG ]]; then
echo TRAVIS_TAG unset, exiting
exit 1
if [[ -n $TRAVIS_TAG ]]; then
brew untap homebrew/homebrew-versions
brew update
brew tap zebra-lucky/qt5
brew install zebra-lucky/qt5/qt
brew install gettext
brew install libusb

PYTHON_VERSION=3.6.8
PYFTP=https://www.python.org/ftp/python/$PYTHON_VERSION
PYPKG_NAME=python-$PYTHON_VERSION-macosx10.6.pkg
PY_SHA256=3c5fd87a231eca3ee138b0cdc2be6517a7ca428304d41901a86b51c6a22b910c
echo "$PY_SHA256 $PYPKG_NAME" > $PYPKG_NAME.sha256
curl -O $PYFTP/$PYPKG_NAME
shasum -a256 -s -c $PYPKG_NAME.sha256
sudo installer -pkg $PYPKG_NAME -target /
rm $PYPKG_NAME $PYPKG_NAME.sha256
fi

cd build

brew update
brew tap zebra-lucky/qt5
brew install zebra-lucky/qt5/qt
brew install gettext
brew install libusb
cp /usr/local/Cellar/libusb/1.0.*/lib/libusb-1.0.dylib .

PYTHON_VERSION=3.6.8
PYFTP=https://www.python.org/ftp/python/$PYTHON_VERSION
PYPKG_NAME=python-$PYTHON_VERSION-macosx10.6.pkg
PY_SHA256=3c5fd87a231eca3ee138b0cdc2be6517a7ca428304d41901a86b51c6a22b910c
echo "$PY_SHA256 $PYPKG_NAME" > $PYPKG_NAME.sha256
curl -O $PYFTP/$PYPKG_NAME
shasum -a256 -s -c $PYPKG_NAME.sha256
sudo installer -pkg $PYPKG_NAME -target /
rm $PYPKG_NAME $PYPKG_NAME.sha256

curl -O -L https://github.com/zebra-lucky/secp256k1/releases/download/0.1/libsecp256k1-0.1-osx.tgz
tar -xzf libsecp256k1-0.1-osx.tgz
LSECP256K1_PATH=https://github.com/zebra-lucky/secp256k1/releases/download/0.1
LSECP256K1_FILE=libsecp256k1-0.1-osx.tgz
curl -O -L ${LSECP256K1_PATH}/${LSECP256K1_FILE}
tar -xzf ${LSECP256K1_FILE} && rm ${LSECP256K1_FILE}
cp libsecp256k1/libsecp256k1.0.dylib .
4 changes: 2 additions & 2 deletions contrib/axe/travis/build_wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ cp contrib/axe/pyi_tctl_runtimehook.py .
wine python -m pip install --no-warn-script-location -r contrib/deterministic-build/requirements.txt
wine python -m pip install --no-warn-script-location -r contrib/deterministic-build/requirements-hw.txt
wine python -m pip install --no-warn-script-location -r contrib/deterministic-build/requirements-binaries.txt
wine python -m pip install --no-warn-script-location PyInstaller==3.4 --no-use-pep517
wine python -m pip install --no-warn-script-location PyInstaller==3.6 --no-use-pep517

wine pyinstaller -y \
wine pyinstaller --clean -y \
--name electrum-axe-$AXE_ELECTRUM_VERSION.exe \
deterministic.spec

Expand Down
8 changes: 8 additions & 0 deletions contrib/axe/travis/electrum_axe_version_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ AXE_ELECTRUM_APK_VERSION=${APK_VERSION_STRING[2]}
AXE_ELECTRUM_APK_VERSION=${AXE_ELECTRUM_APK_VERSION#\'}
AXE_ELECTRUM_APK_VERSION=${AXE_ELECTRUM_APK_VERSION%\'}
export AXE_ELECTRUM_APK_VERSION

# Check is release
SIMPLIFIED_VERSION_PATTERN="^([^A-Za-z]+).*"
if [[ ${AXE_ELECTRUM_VERSION} =~ ${SIMPLIFIED_VERSION_PATTERN} ]]; then
if [[ ${BASH_REMATCH[1]} == ${AXE_ELECTRUM_VERSION} ]]; then
export IS_RELEASE=y
fi
fi
21 changes: 12 additions & 9 deletions contrib/axe/travis/travis-build-linux-apk.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
#!/bin/bash
set -ev

if [[ -z $TRAVIS_TAG ]]; then
echo TRAVIS_TAG unset, exiting
exit 1
if [[ $ELECTRUM_MAINNET == "true" ]] && [[ -z $IS_RELEASE ]]; then
# do not build mainnet apk if is not release
exit 0
fi

BUILD_REPO_URL=https://github.com/axerunners/electrum-axe.git

cd build
if [[ -n $TRAVIS_TAG ]]; then
BUILD_REPO_URL=https://github.com/axerunners/electrum-axe.git
git clone --branch $TRAVIS_TAG $BUILD_REPO_URL electrum-axe
else
git clone .. electrum-axe
fi

git clone --branch $TRAVIS_TAG $BUILD_REPO_URL electrum-axe

pushd electrum-axe
./contrib/make_locale
find . -name '*.po' -delete
find . -name '*.pot' -delete
popd

sudo chown -R 1000 electrum-axe

DOCKER_CMD="rm -rf packages"
DOCKER_CMD="$DOCKER_CMD && ./contrib/make_packages"
DOCKER_CMD="$DOCKER_CMD && rm -rf packages/bls_py"
DOCKER_CMD="$DOCKER_CMD && rm -rf packages/python_bls*"
DOCKER_CMD="$DOCKER_CMD && ./contrib/make_apk"
if [ $ELECTRUM_MAINNET = false ] ; then

if [[ $ELECTRUM_MAINNET == "false" ]]; then
DOCKER_CMD="$DOCKER_CMD release-testnet"
fi

sudo chown -R 1000 electrum-axe
docker run --rm \
-v $(pwd)/electrum-axe:/home/buildozer/build \
-t zebralucky/electrum-dash-winebuild:Kivy33x bash -c \
Expand Down
Loading

0 comments on commit 781d5d0

Please sign in to comment.