Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6292 from elpaso/mxe
Scripts for cross build QGIS for windows on Linux with mxe
- Loading branch information
Showing
10 changed files
with
414 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
|
||
Scripts to cross build a windows QGIS binary from Linux using MXE: | ||
(M cross environment) http://mxe.cc/ | ||
|
||
For now, Python bindings cannot be built with mxe. | ||
|
||
Follow the instructions on the website to prepare the mxe environment, you | ||
will need to build all required dependencies for QGIS. | ||
|
||
Note that some of the packages listed below are dependencies of other | ||
packages, you will probably not need to build them all explicitly. | ||
|
||
|
||
armadillo | ||
bfd | ||
bzip2 | ||
cairo | ||
cmake | ||
curl | ||
dbus | ||
dlfcn-win32 | ||
expat | ||
fontconfig | ||
freetds | ||
freetype | ||
freexl | ||
gcc | ||
gdal | ||
gendef | ||
geos | ||
gettext | ||
giflib | ||
glib | ||
gmp | ||
gnutls | ||
gsl | ||
gta | ||
harfbuzz | ||
hdf4 | ||
hdf5 | ||
icu4c | ||
isl | ||
jasper | ||
jpeg | ||
json-c | ||
lcms | ||
libffi | ||
libgcrypt | ||
libgeotiff | ||
libgnurx | ||
libgpg_error | ||
libiconv | ||
libidn2 | ||
libmng | ||
libmysqlclient | ||
libpng | ||
libspatialindex | ||
libssh2 | ||
libunistring | ||
libwebp | ||
libxml2 | ||
libzip | ||
lzo | ||
mpc | ||
mpfr | ||
netcdf | ||
nettle | ||
openblas | ||
openjpeg | ||
openssl | ||
pcre | ||
pcre2 | ||
pixman | ||
pkgconf | ||
portablexdr | ||
postgresql | ||
proj | ||
qca | ||
qscintilla2 | ||
qt3d | ||
qtactiveqt | ||
qtbase | ||
qtcanvas3d | ||
qtcharts | ||
qtconnectivity | ||
qtdatavis3d | ||
qtdeclarative | ||
qtgamepad | ||
qtgraphicaleffects | ||
qtimageformats | ||
qtkeychain | ||
qtlocation | ||
qtmultimedia | ||
qtpurchasing | ||
qtquickcontrols | ||
qtquickcontrols2 | ||
qtscript | ||
qtscxml | ||
qtsensors | ||
qtserialbus | ||
qtserialport | ||
qtspeech | ||
qtsvg | ||
qttools | ||
qttranslations | ||
qtvirtualkeyboard | ||
qtwebchannel | ||
qtwebkit | ||
qtwebsockets | ||
qtwebview | ||
qtwinextras | ||
qtxmlpatterns | ||
qwt | ||
spatialite | ||
sqlite | ||
tiff | ||
xz | ||
zlib | ||
|
||
When done, you can edit the build-mxe.sh script to set the path to your mxe installation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/bin/bash | ||
########################################################################### | ||
# build-mxe.sh | ||
# --------------------- | ||
# Date : February 2018 | ||
# Copyright : (C) 2018 by Alessandro Pasotti | ||
# Email : elpaso at itopen dot it | ||
########################################################################### | ||
# # | ||
# This program is free software; you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License as published by # | ||
# the Free Software Foundation; either version 2 of the License, or # | ||
# (at your option) any later version. # | ||
# # | ||
########################################################################### | ||
|
||
|
||
set -e | ||
|
||
# Usage: you can pass an optional "package" command to skip the build | ||
# and directly go to the packaging | ||
# This script needs to be called from the main QGIS directory, the | ||
# one which contains CMakeLists.txt | ||
|
||
COMMAND=$1 | ||
|
||
# Location of current script | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
PYDEPLOY=${DIR}/deploy.py | ||
|
||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
# Configuration: change this! | ||
|
||
# Location of mxe install dir | ||
MXE=${HOME}/dev/mxe/ | ||
|
||
# Where the artifact will be saved | ||
|
||
BUILD_DIR=`pwd`/build-mxe | ||
RELEASE_DIR=`pwd`/release-mxe | ||
|
||
# End configuration | ||
|
||
|
||
|
||
|
||
if [[ "$COMMAND" != *"package"* ]]; then | ||
[ -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 | ||
|
||
fi | ||
|
||
pushd . | ||
|
||
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 \ | ||
-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 \ | ||
$ARGS | ||
|
||
|
||
make -j16 install | ||
|
||
fi | ||
|
||
# Collect deps | ||
|
||
$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; \ | ||
done | ||
|
||
cp -r $MXE/usr/i686-w64-mingw32.shared/qt5/plugins $RELEASE_DIR/qt5 | ||
|
||
cat <<__TXT__ > ${RELEASE_DIR}/qt.conf | ||
[Paths] | ||
Plugins = qt5 | ||
__TXT__ | ||
|
||
|
||
popd | ||
|
||
ZIP_NAME=release-`date +%Y-%m-%d-%H-%I-%S`.zip | ||
|
||
zip -r $ZIP_NAME $RELEASE_DIR | ||
|
||
echo "Release in $ZIP_NAME ready." |
Oops, something went wrong.