Skip to content

Commit

Permalink
[mxe] Better packaging and fix Qt5 plugins path
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Feb 9, 2018
1 parent 2ee0bc8 commit 6dbd0b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions ms-windows/mxe/build-mxe.sh
Expand Up @@ -34,9 +34,9 @@ PYDEPLOY=${DIR}/deploy.py
# Location of mxe install dir
MXE=${HOME}/dev/mxe/

# Where the artifact will be saved

# Directory for build
BUILD_DIR=`pwd`/build-mxe
# Directory where the artifact will be saved
RELEASE_DIR=`pwd`/release-mxe

# End configuration
Expand All @@ -45,35 +45,34 @@ RELEASE_DIR=`pwd`/release-mxe


if [[ "$COMMAND" != *"package"* ]]; then
[ -d $BUILD_DIR ] && rm -rf $BUILD_DIR
[ -d $RELEASE_DIR ] && rm -rf $RELEASE_DIR
[ -d ${BUILD_DIR} ] && rm -rf ${BUILD_DIR}
[ -d ${RELEASE_DIR} ] && rm -rf ${RELEASE_DIR}
# Make sure dirs exist

[ -d $BUILD_DIR ] || mkdir $BUILD_DIR
[ -d $RELEASE_DIR ] || mkdir $RELEASE_DIR
[ -d $RELEASE_DIR/qt5 ] || mkdir $RELEASE_DIR/qt5
[ -d ${BUILD_DIR} ] || mkdir ${BUILD_DIR}
[ -d ${RELEASE_DIR} ] || mkdir ${RELEASE_DIR}

fi

pushd .

cd $BUILD_DIR
cd ${BUILD_DIR}

# Build

if [[ "$COMMAND" != *"package"* ]]; then

$MXE/usr/bin/i686-w64-mingw32.shared-cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$RELEASE_DIR \
${MXE}/usr/bin/i686-w64-mingw32.shared-cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_INSTALL_PREFIX=${RELEASE_DIR} \
-DENABLE_TESTS=OFF \
-DWITH_QSPATIALITE=ON \
-DWITH_APIDOC=OFF \
-DWITH_QWTPOLAR=ON \
-DWITH_ASTYLE=OFF \
-DWITH_SERVER=OFF \
-DWITH_BINDINGS=FALSE \
-DQT_LRELEASE_EXECUTABLE=$MXE/usr/i686-w64-mingw32.shared/qt5/bin/lrelease \
-DQT_LRELEASE_EXECUTABLE=${MXE}/usr/i686-w64-mingw32.shared/qt5/bin/lrelease \
$ARGS


Expand All @@ -83,23 +82,25 @@ fi

# Collect deps

$PYDEPLOY --build=$RELEASE_DIR --objdump=$MXE/usr/bin/i686-w64-mingw32.shared-objdump ${RELEASE_DIR}/qgis.exe
$PYDEPLOY --build=${RELEASE_DIR} --objdump=${MXE}/usr/bin/i686-w64-mingw32.shared-objdump ${RELEASE_DIR}/qgis.exe
for dll in $(ls ${RELEASE_DIR}/*.dll); do \
$PYDEPLOY --build=$RELEASE_DIR --objdump=$MXE/usr/bin/i686-w64-mingw32.shared-objdump $dll; \
$PYDEPLOY --build=${RELEASE_DIR} --objdump=${MXE}/usr/bin/i686-w64-mingw32.shared-objdump $dll; \
done

cp -r $MXE/usr/i686-w64-mingw32.shared/qt5/plugins $RELEASE_DIR/qt5
cp -r ${MXE}/usr/i686-w64-mingw32.shared/qt5/plugins ${RELEASE_DIR}/qt5plugins

cat <<__TXT__ > ${RELEASE_DIR}/qt.conf
[Paths]
Plugins = qt5
Plugins = qt5plugins
__TXT__

# Make the zip

popd

ZIP_NAME=release-`date +%Y-%m-%d-%H-%I-%S`.zip
cd ${RELEASE_DIR}/..
ZIP_NAME=mxe-release-`date +%Y-%m-%d-%H-%I-%S`.zip
zip -r ${ZIP_NAME} $(basename ${RELEASE_DIR})
cp ${ZIP_NAME} ${DIR}

zip -r $ZIP_NAME $RELEASE_DIR
popd

echo "Release in $ZIP_NAME ready."
Empty file modified ms-windows/mxe/deploy.py 100644 → 100755
Empty file.

0 comments on commit 6dbd0b9

Please sign in to comment.