Build scripts

This commit is contained in:
Aditya Kulkarni
2019-10-28 11:54:52 -07:00
parent fe35401118
commit 764f1e315d
9 changed files with 45 additions and 116 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ src/ui_*.h
src/precompiled.h.cpp src/precompiled.h.cpp
.qmake.stash .qmake.stash
zecwallet zecwallet
ZecWallet.app Zecwallet-Lite.app
zecwallet-lite-mingw* zecwallet-lite-mingw*
zecwallet-lite.vcxproj* zecwallet-lite.vcxproj*
zecwallet.vcxproj* zecwallet.vcxproj*
+1 -1
View File
@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>zecwallet</string> <string>zecwallet-lite</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string> <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
+4 -4
View File
@@ -1,9 +1,9 @@
Package: zec-qt-wallet Package: zecwallet-lite
Version: RELEASE_VERSION Version: RELEASE_VERSION
Section: base Section: base
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64
Maintainer: Aditya Kulkarni <zcash@adityapk.com> Maintainer: Aditya Kulkarni <zcash@adityapk.com>
Description: ZecWallet is a full node and UI wallet for Zcash. Description: Zecwallet-Lite is a lightclient UI wallet for Zcash.
ZecWallet is a full node and UI wallet for Zcash. It comes with Zecwallet-Lite is a lightclient UI wallet for Zcash. It comes with
full support for shielded addresses and many apps for Zcash. full support for shielded addresses, transparent addresses and memos for Zcash.
+5 -5
View File
@@ -1,12 +1,12 @@
[Desktop Entry] [Desktop Entry]
Name=ZecWallet Name=Zecwallet-Lite
Comment=Full node and wallet for Zcash Comment=Lightclient UI wallet for Zcash
GenericName=Wallet GenericName=Wallet
Exec=/usr/local/bin/zecwallet %u Exec=/usr/local/bin/zecwallet-lite %u
Icon=zecwallet.xpm Icon=zecwallet-lite.xpm
Type=Application Type=Application
StartupNotify=true StartupNotify=true
StartupWMClass=zecwallet StartupWMClass=zecwallet-lite
Categories=Utility; Categories=Utility;
MimeType=x-scheme-handler/zcash; MimeType=x-scheme-handler/zcash;
Keywords=zecwallet; Keywords=zecwallet;
+1 -1
View File
@@ -6,7 +6,7 @@ if [ -z $QT_STATIC ]; then
fi fi
rm -f res/*.qm rm -f res/*.qm
$QT_STATIC/bin/lrelease zec-qt-wallet.pro $QT_STATIC/bin/lrelease zecwallet-lite.pro
# Then update the qt base translations. First, get all languages # Then update the qt base translations. First, get all languages
ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do
+6 -26
View File
@@ -35,21 +35,11 @@ if [ -z $QT_PATH ]; then
exit 1; exit 1;
fi fi
if [ -z $ZCASH_DIR ]; then
echo "ZCASH_DIR is not set. Please set it to the base directory of a compiled zcashd";
exit 1;
fi
if [ -z $APP_VERSION ]; then if [ -z $APP_VERSION ]; then
echo "APP_VERSION is not set. Please set it to the current release version of the app"; echo "APP_VERSION is not set. Please set it to the current release version of the app";
exit 1; exit 1;
fi fi
if [ ! -f $ZCASH_DIR/src/zcashd ]; then
echo "Could not find compiled zcashd in $ZCASH_DIR/src/.";
exit 1;
fi
if ! cat src/version.h | grep -q "$APP_VERSION"; then if ! cat src/version.h | grep -q "$APP_VERSION"; then
echo "Version mismatch in src/version.h" echo "Version mismatch in src/version.h"
exit 1 exit 1
@@ -67,7 +57,7 @@ echo "[OK]"
echo -n "Configuring............" echo -n "Configuring............"
# Build # Build
QT_STATIC=$QT_PATH src/scripts/dotranslations.sh >/dev/null QT_STATIC=$QT_PATH src/scripts/dotranslations.sh >/dev/null
$QT_PATH/bin/qmake zec-qt-wallet.pro CONFIG+=release >/dev/null $QT_PATH/bin/qmake zecwallet-lite.pro CONFIG+=release >/dev/null
echo "[OK]" echo "[OK]"
@@ -78,27 +68,17 @@ echo "[OK]"
#Qt deploy #Qt deploy
echo -n "Deploying.............." echo -n "Deploying.............."
mkdir artifacts >/dev/null 2>&1 mkdir artifacts >/dev/null 2>&1
rm -f artifcats/zecwallet.dmg >/dev/null 2>&1 rm -f artifcats/zecwallet-lite.dmg >/dev/null 2>&1
rm -f artifacts/rw* >/dev/null 2>&1 rm -f artifacts/rw* >/dev/null 2>&1
cp $ZCASH_DIR/src/zcashd zecwallet.app/Contents/MacOS/ $QT_PATH/bin/macdeployqt zecwallet-lite.app
cp $ZCASH_DIR/src/zcash-cli zecwallet.app/Contents/MacOS/
$QT_PATH/bin/macdeployqt zecwallet.app
echo "[OK]" echo "[OK]"
echo -n "Building dmg..........." echo -n "Building dmg..........."
mv zecwallet.app ZecWallet.app mv zecwallet-lite.app Zecwallet-Lite.app
create-dmg --volname "ZecWallet-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "ZecWallet.app" 200 190 --app-drop-link 600 185 --hide-extension "ZecWallet.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-zecwallet-v$APP_VERSION.dmg ZecWallet.app >/dev/null 2>&1 create-dmg --volname "Zecwallet-Lite-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "Zecwallet-Lite.app" 200 190 --app-drop-link 600 185 --hide-extension "Zecwallet-Lite.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-zecwallet-lite-v$APP_VERSION.dmg Zecwallet-Lite.app >/dev/null 2>&1
#mkdir bin/dmgbuild >/dev/null 2>&1 if [ ! -f artifacts/macOS-zecwallet-lite-v$APP_VERSION.dmg ]; then
#sed "s/RELEASE_VERSION/${APP_VERSION}/g" res/appdmg.json > bin/dmgbuild/appdmg.json
#cp res/logo.icns bin/dmgbuild/
#cp res/dmgbg.png bin/dmgbuild/
#cp -r zecwallet.app bin/dmgbuild/
#appdmg --quiet bin/dmgbuild/appdmg.json artifacts/macOS-zecwallet-v$APP_VERSION.dmg >/dev/null
if [ ! -f artifacts/macOS-zecwallet-v$APP_VERSION.dmg ]; then
echo "[ERROR]" echo "[ERROR]"
exit 1 exit 1
fi fi
+26 -77
View File
@@ -7,40 +7,6 @@ fi
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi
if [ -z $ZCASH_DIR ]; then
echo "ZCASH_DIR is not set. Please set it to the base directory of a Zcash project with built Zcash binaries."
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcashd ]; then
echo "Couldn't find zcashd in $ZCASH_DIR/artifacts/. Please build zcashd."
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli ]; then
echo "Couldn't find zcash-cli in $ZCASH_DIR/artifacts/. Please build zcashd."
exit 1;
fi
# Ensure that zcashd is the right build
echo -n "zcashd version........."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd && ! readelf -s $ZCASH_DIR/artifacts/zcashd | grep -q "GLIBC_2\.25"; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build or zcashd is built with libc 2.25"
exit 1
fi
echo -n "zcashd.exe version....."
if grep -q "zqwMagicBean" $ZCASH_DIR/artifacts/zcashd.exe; then
echo "[OK]"
else
echo "[ERROR]"
echo "zcashd doesn't seem to be a zqwMagicBean build"
exit 1
fi
echo -n "Version files.........." echo -n "Version files.........."
# Replace the version number in the .pro file so it gets picked up everywhere # Replace the version number in the .pro file so it gets picked up everywhere
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" zec-qt-wallet.pro > /dev/null sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" zec-qt-wallet.pro > /dev/null
@@ -60,12 +26,11 @@ echo "[Building on" `lsb_release -r`"]"
echo -n "Configuring............" echo -n "Configuring............"
QT_STATIC=$QT_STATIC bash src/scripts/dotranslations.sh >/dev/null QT_STATIC=$QT_STATIC bash src/scripts/dotranslations.sh >/dev/null
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null $QT_STATIC/bin/qmake zecwallet-lite.pro -spec linux-clang CONFIG+=release > /dev/null
echo "[OK]" echo "[OK]"
echo -n "Building..............." echo -n "Building..............."
rm -rf bin/zec-qt-wallet* > /dev/null
rm -rf bin/zecwallet* > /dev/null rm -rf bin/zecwallet* > /dev/null
make clean > /dev/null make clean > /dev/null
make -j$(nproc) > /dev/null make -j$(nproc) > /dev/null
@@ -74,7 +39,7 @@ echo "[OK]"
# Test for Qt # Test for Qt
echo -n "Static link............" echo -n "Static link............"
if [[ $(ldd zecwallet | grep -i "Qt") ]]; then if [[ $(ldd zecwallet-lite | grep -i "Qt") ]]; then
echo "FOUND QT; ABORT"; echo "FOUND QT; ABORT";
exit 1 exit 1
fi fi
@@ -82,27 +47,25 @@ echo "[OK]"
echo -n "Packaging.............." echo -n "Packaging.............."
mkdir bin/zecwallet-v$APP_VERSION > /dev/null mkdir bin/zecwallet-lite-v$APP_VERSION > /dev/null
strip zecwallet strip zecwallet-lite
cp zecwallet bin/zecwallet-v$APP_VERSION > /dev/null cp zecwallet-lite bin/zecwallet-lite-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcashd bin/zecwallet-v$APP_VERSION > /dev/null cp README.md bin/zecwallet-lite-v$APP_VERSION > /dev/null
cp $ZCASH_DIR/artifacts/zcash-cli bin/zecwallet-v$APP_VERSION > /dev/null cp LICENSE bin/zecwallet-lite-v$APP_VERSION > /dev/null
cp README.md bin/zecwallet-v$APP_VERSION > /dev/null
cp LICENSE bin/zecwallet-v$APP_VERSION > /dev/null
cd bin && tar czf linux-zecwallet-v$APP_VERSION.tar.gz zecwallet-v$APP_VERSION/ > /dev/null cd bin && tar czf linux-zecwallet-lite-v$APP_VERSION.tar.gz zecwallet-lite-v$APP_VERSION/ > /dev/null
cd .. cd ..
mkdir artifacts >/dev/null 2>&1 mkdir artifacts >/dev/null 2>&1
cp bin/linux-zecwallet-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz cp bin/linux-zecwallet-lite-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-zecwallet-lite-v$APP_VERSION.tar.gz
echo "[OK]" echo "[OK]"
if [ -f artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz ] ; then if [ -f artifacts/linux-binaries-zecwallet-lite-v$APP_VERSION.tar.gz ] ; then
echo -n "Package contents......." echo -n "Package contents......."
# Test if the package is built OK # Test if the package is built OK
if tar tf "artifacts/linux-binaries-zecwallet-v$APP_VERSION.tar.gz" | wc -l | grep -q "6"; then if tar tf "artifacts/linux-binaries-zecwallet-lite-v$APP_VERSION.tar.gz" | wc -l | grep -q "4"; then
echo "[OK]" echo "[OK]"
else else
echo "[ERROR]" echo "[ERROR]"
@@ -114,7 +77,7 @@ else
fi fi
echo -n "Building deb..........." echo -n "Building deb..........."
debdir=bin/deb/zecwallet-v$APP_VERSION debdir=bin/deb/zecwallet-lite-v$APP_VERSION
mkdir -p $debdir > /dev/null mkdir -p $debdir > /dev/null
mkdir $debdir/DEBIAN mkdir $debdir/DEBIAN
mkdir -p $debdir/usr/local/bin mkdir -p $debdir/usr/local/bin
@@ -122,16 +85,15 @@ mkdir -p $debdir/usr/local/bin
cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control
cp zecwallet $debdir/usr/local/bin/ cp zecwallet $debdir/usr/local/bin/
cp $ZCASH_DIR/artifacts/zcashd $debdir/usr/local/bin/zqw-zcashd
mkdir -p $debdir/usr/share/pixmaps/ mkdir -p $debdir/usr/share/pixmaps/
cp res/zecwallet.xpm $debdir/usr/share/pixmaps/ cp res/zecwallet-lite.xpm $debdir/usr/share/pixmaps/
mkdir -p $debdir/usr/share/applications mkdir -p $debdir/usr/share/applications
cp src/scripts/desktopentry $debdir/usr/share/applications/zec-qt-wallet.desktop cp src/scripts/desktopentry $debdir/usr/share/applications/zecwallet-lite.desktop
dpkg-deb --build $debdir >/dev/null dpkg-deb --build $debdir >/dev/null
cp $debdir.deb artifacts/linux-deb-zecwallet-v$APP_VERSION.deb cp $debdir.deb artifacts/linux-deb-zecwallet-lite-v$APP_VERSION.deb
echo "[OK]" echo "[OK]"
@@ -145,51 +107,38 @@ if [ -z $MXE_PATH ]; then
exit 0; exit 0;
fi fi
if [ ! -f $ZCASH_DIR/artifacts/zcashd.exe ]; then
echo "Couldn't find zcashd.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
exit 1;
fi
if [ ! -f $ZCASH_DIR/artifacts/zcash-cli.exe ]; then
echo "Couldn't find zcash-cli.exe in $ZCASH_DIR/artifacts/. Please build zcashd.exe"
exit 1;
fi
export PATH=$MXE_PATH:$PATH export PATH=$MXE_PATH:$PATH
echo -n "Configuring............" echo -n "Configuring............"
make clean > /dev/null make clean > /dev/null
rm -f zec-qt-wallet-mingw.pro #rm -f zec-qt-wallet-mingw.pro
rm -rf release/ rm -rf release/
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file #Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
cat zec-qt-wallet.pro | sed "s/precompile_header/release/g" | sed "s/PRECOMPILED_HEADER.*//g" > zec-qt-wallet-mingw.pro #cat zec-qt-wallet.pro | sed "s/precompile_header/release/g" | sed "s/PRECOMPILED_HEADER.*//g" > zec-qt-wallet-mingw.pro
echo "[OK]" echo "[OK]"
echo -n "Building..............." echo -n "Building..............."
x86_64-w64-mingw32.static-qmake-qt5 zec-qt-wallet-mingw.pro CONFIG+=release > /dev/null x86_64-w64-mingw32.static-qmake-qt5 zecwallet-lite.pro CONFIG+=release > /dev/null
make -j32 > /dev/null make -j32 > /dev/null
echo "[OK]" echo "[OK]"
echo -n "Packaging.............." echo -n "Packaging.............."
mkdir release/zecwallet-v$APP_VERSION mkdir release/zecwallet-lite-v$APP_VERSION
cp release/zecwallet.exe release/zecwallet-v$APP_VERSION cp release/zecwallet-lite.exe release/zecwallet-lite-v$APP_VERSION
cp $ZCASH_DIR/artifacts/zcashd.exe release/zecwallet-v$APP_VERSION > /dev/null cp README.md release/zecwallet-lite-v$APP_VERSION
cp $ZCASH_DIR/artifacts/zcash-cli.exe release/zecwallet-v$APP_VERSION > /dev/null cp LICENSE release/zecwallet-lite-v$APP_VERSION
cp README.md release/zecwallet-v$APP_VERSION cd release && zip -r Windows-binaries-zecwallet-lite-v$APP_VERSION.zip zecwallet-lite-v$APP_VERSION/ > /dev/null
cp LICENSE release/zecwallet-v$APP_VERSION
cd release && zip -r Windows-binaries-zecwallet-v$APP_VERSION.zip zecwallet-v$APP_VERSION/ > /dev/null
cd .. cd ..
mkdir artifacts >/dev/null 2>&1 mkdir artifacts >/dev/null 2>&1
cp release/Windows-binaries-zecwallet-v$APP_VERSION.zip ./artifacts/ cp release/Windows-binaries-zecwallet-lite-v$APP_VERSION.zip ./artifacts/
echo "[OK]" echo "[OK]"
if [ -f artifacts/Windows-binaries-zecwallet-v$APP_VERSION.zip ] ; then if [ -f artifacts/Windows-binaries-zecwallet-lite-v$APP_VERSION.zip ] ; then
echo -n "Package contents......." echo -n "Package contents......."
if unzip -l "artifacts/Windows-binaries-zecwallet-v$APP_VERSION.zip" | wc -l | grep -q "11"; then if unzip -l "artifacts/Windows-binaries-zecwallet-lite-v$APP_VERSION.zip" | wc -l | grep -q "9"; then
echo "[OK]" echo "[OK]"
else else
echo "[ERROR]" echo "[ERROR]"
+1 -1
View File
@@ -13,7 +13,7 @@ PRECOMPILED_HEADER = src/precompiled.h
QT += widgets QT += widgets
QT += websockets QT += websockets
TARGET = zecwallet TARGET = zecwallet-lite
TEMPLATE = app TEMPLATE = app