Commit d6985343 authored by Alberto Mardegan's avatar Alberto Mardegan Committed by Alberto Mardegan

CI: build AppImage

parent ad850d98
......@@ -14,6 +14,7 @@ before_script:
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
- PACKAGES+=libexpat1-dev # for libdbus
- PACKAGES+=" libjpeg8-dev libpng12-dev libtiff5-dev zlib1g-dev" # for OpenCV
- PACKAGES+=" fuse libegl1-mesa" # for AppImage
- |
apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y \
build-essential gettext pkg-config libglu1-mesa-dev libxrender1 \
......@@ -167,3 +168,85 @@ test_desktop:
dependencies:
- build_dependencies
- build_desktop
appimage:
stage: build
only:
- tags
dependencies:
- build_dependencies
cache:
paths:
- apt-cache/
- tools
artifacts:
paths:
- appimage/
script:
- STAGING="$PWD/staging"
- APPDIR="$PWD/appdir"
- OUTPUT="$PWD/appimage"
- export PKG_CONFIG_PATH="$STAGING/lib/pkgconfig:$PKG_CONFIG_PATH"
- LINUXDEPLOYQT_NAME="linuxdeployqt-continuous-x86_64.AppImage"
- LINUXDEPLOYQT="$PWD/tools/$LINUXDEPLOYQT_NAME"
- 'if [ ! -x "$LINUXDEPLOYQT" ]; then'
- mkdir -p tools && cd tools
- wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$LINUXDEPLOYQT_NAME"
- chmod a+x "$LINUXDEPLOYQT"
- cd ..
- fi
# Remove those Qt plugins that we know we won't use; this is so that
# linuxdeployqt won't dig for their dependencies and add them into the
# AppImage
- |
cd /usr/local/Qt/5.12.0/gcc_64/plugins/
for i in position/* \
sqldrivers/libqsqlmysql.so \
sqldrivers/libqsqlpsql.so
do
rm "/usr/local/Qt/5.12.0/gcc_64/plugins/$i"
done
cd -
# Remove other stuff that we don't want to be copied
- cd $STAGING
- rm -rf usr/bin/* usr/share/xml usr/share/doc usr/share/dbus-1
- cd -
# Build Imaginario
- mkdir $APPDIR
- mkdir abuild
- cd abuild
- qmake CONFIG+=release CONFIG+=desktop CONFIG+=nomake_tests PREFIX=/usr QMAKE_LFLAGS+="-static-libgcc -static-libstdc++" ..
- make -j8
- make INSTALL_ROOT=$STAGING install
- cd ..
# Copy those things we need into the appdir
- cd staging
- cp -a --parents usr/bin/ usr/share/ $APPDIR
- mkdir -p $APPDIR/usr/lib
- cp -a lib/*.so.* $APPDIR/usr/lib/
- cp usr/lib/libdbus-1.so.3 $APPDIR/usr/lib # not to use the system one
- cd ..
# Run linuxdeployqt
- cd appdir
- |
LD_LIBRARY_PATH="$STAGING/lib:$LD_LIBRARY_PATH" "$LINUXDEPLOYQT" \
$PWD/usr/share/applications/imaginario.desktop \
-qmldir=$APPDIR/usr/share/imaginario/qml \
-extra-plugins=imageformats/libqsvg.so,iconengines,geoservices/libqtgeoservices_osm.so \
-bundle-non-qt-libs \
-no-copy-copyright-files
# Manually copy the gtk platform theme: we don't want to add it to the
# linuxdeployqt command, as that would also bring in the gtk3 libraries.
# In this way, instead, the qgtk3 plugin will silently fail to load if
# gtk3 is not installed.
- mkdir -p usr/plugins/platformthemes
- cp /usr/local/Qt/5.12.0/gcc_64/plugins/platformthemes/libqgtk3.so usr/plugins/platformthemes/
- cd ..
- find appdir
- cd abuild
- '"$LINUXDEPLOYQT" --appimage-extract'
- 'PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool $APPDIR'
# Finally, copy the AppImage into the artifacts directory
- mkdir $OUTPUT
- 'mv "Imaginario-x86_64.AppImage" "$OUTPUT/Imaginario_${CI_COMMIT_TAG:-$CI_COMMIT_SHA}.AppImage"'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment