Unify cross-compiled windows build

This commit is contained in:
Aditya Kulkarni
2018-10-30 16:25:29 -07:00
parent 75e755707c
commit 0a8b3f61b3
3 changed files with 54 additions and 46 deletions

View File

@@ -1,42 +0,0 @@
#!/bin/bash
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
if [ -z $MXE_PATH ]; then echo "MXE_PATH is not set. Set it to ~/github/mxe/usr/bin"; exit 1; fi
export PATH=$MXE_PATH:$PATH
echo -n "Configuring..."
make distclean > /dev/null
rm -f zec-qt-wallet-mingw.pro
rm -rf release/
#Mingw seems to have trouble with precompiled heades, 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
echo "[OK]"
echo -n "Building......"
x86_64-w64-mingw32.static-qmake-qt5 zec-qt-wallet-mingw.pro CONFIG+=release > /dev/null
make -j32 > /dev/null
echo "[OK]"
echo -n "Packaging....."
mkdir release/zec-qt-wallet-v$APP_VERSION
cp release/zec-qt-wallet.exe release/zec-qt-wallet-v$APP_VERSION
cp README.md release/zec-qt-wallet-v$APP_VERSION
cp LICENSE release/zec-qt-wallet-v$APP_VERSION
cd release && zip -r Windows-zec-qt-wallet-v$APP_VERSION.zip zec-qt-wallet-v$APP_VERSION/ > /dev/null
cd ..
cp release/Windows-zec-qt-wallet-v$APP_VERSION.zip .
if [ -f Windows-zec-qt-wallet-v$APP_VERSION.zip ] ; then
echo "[OK]"
echo "Done. Build is Windows-zec-qt-wallet-v$APP_VERSION.zip"
echo "Package contents:"
unzip -l "Windows-zec-qt-wallet-v$APP_VERSION.zip"
else
echo "[ERROR]"
exit 1
fi

View File

@@ -1,6 +1,11 @@
#!/bin/bash
if [ -z $QT_STATIC ]; then echo "QT_STATIC is not set"; exit 1; fi
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
if [ -z $MXE_PATH ]; then echo "MXE_PATH is not set. Set it to ~/github/mxe/usr/bin"; 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
@@ -12,11 +17,17 @@ sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" zec-qt-wallet.pro > /dev/null
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" README.md > /dev/null
echo "[OK]"
echo -n "Cleaning......"
rm -f bin/linux-zec-qt-wallet*
rm -rf release/
make distclean > /dev/null
echo "[OK]"
echo "Linux"
echo -n "Configuring..."
rm -f bin/linux-zec-qt-wallet*
make distclean > /dev/null
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null
#Mingw seems to have trouble with precompiled heades, so strip that option from the .pro file
echo "[OK]"
@@ -55,3 +66,42 @@ else
exit 1
fi
echo "Windows"
export PATH=$MXE_PATH:$PATH
echo -n "Configuring..."
make clean > /dev/null
rm -f zec-qt-wallet-mingw.pro
rm -rf release/
#Mingw seems to have trouble with precompiled heades, 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
echo "[OK]"
echo -n "Building......"
x86_64-w64-mingw32.static-qmake-qt5 zec-qt-wallet-mingw.pro CONFIG+=release > /dev/null
make -j32 > /dev/null
echo "[OK]"
echo -n "Packaging....."
mkdir release/zec-qt-wallet-v$APP_VERSION
cp release/zec-qt-wallet.exe release/zec-qt-wallet-v$APP_VERSION
cp README.md release/zec-qt-wallet-v$APP_VERSION
cp LICENSE release/zec-qt-wallet-v$APP_VERSION
cd release && zip -r Windows-zec-qt-wallet-v$APP_VERSION.zip zec-qt-wallet-v$APP_VERSION/ > /dev/null
cd ..
cp release/Windows-zec-qt-wallet-v$APP_VERSION.zip .
if [ -f Windows-zec-qt-wallet-v$APP_VERSION.zip ] ; then
echo "[OK]"
echo "Done. Build is Windows-zec-qt-wallet-v$APP_VERSION.zip"
echo "Package contents:"
unzip -l "Windows-zec-qt-wallet-v$APP_VERSION.zip"
else
echo "[ERROR]"
exit 1
fi