Skip to content

Commit

Permalink
gha: Add job to build Talipot AppImage with Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
anlambert committed May 22, 2024
1 parent 1c22b93 commit f6f8e6c
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 19 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/appimage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ jobs:
fail-fast: false
matrix:
config:
- name: Talipot AppImage build on CentOS 8
- name: Talipot AppImage build on CentOS 8 Stream
docker-image: tgagor/centos-stream:8
centos-version: centos8
- name: Talipot AppImage build on CentOS 9 Stream
docker-image: dokken/centos-stream-9
centos-version: centos9
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -41,6 +45,8 @@ jobs:
run: docker run
-e CCACHE_DIR=/ccache
--volumes-from ccache
--device /dev/fuse
--privileged
-v `pwd`:/talipot:rw
${{ matrix.config.docker-image }}
/bin/bash -c "bash -xe /talipot/bundlers/linux/talipot_appimage_centos_build.sh"
Expand All @@ -61,7 +67,7 @@ jobs:
-v ${{ github.workspace }}:/talipot:rw
run: |
dnf -y group install "Basic Desktop" GNOME
yum install -y xorg-x11-server-Xvfb
yum install -y xorg-x11-server-Xvfb libglvnd-opengl
xvfb-run $(ls /talipot/build/Talipot*.AppImage) --check-application-starts --debug-plugins-load
- name: Check Talipot AppImage can be executed on ArchLinux
uses: addnab/docker-run-action@v3
Expand Down Expand Up @@ -90,7 +96,7 @@ jobs:
- name: Upload Taliot AppImage to GitHub Actions artifacts
uses: actions/upload-artifact@v4
with:
name: Talipot-AppImage
name: Talipot-AppImage-${{ matrix.config.centos-version }}
path: ./build/Talipot*.AppImage
- name: Upload Talipot bundle to dev-latest prerelease
if: github.ref == 'refs/tags/dev-latest'
Expand Down
9 changes: 9 additions & 0 deletions bundlers/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ ADD_CUSTOM_TARGET(
-e DISPLAY=$DISPLAY tgagor/centos-stream:8 /bin/bash -c
"bash -xe /talipot/bundlers/linux/talipot_appimage_centos_build.sh"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

ADD_CUSTOM_TARGET(
bundle-qt6
COMMAND
docker run --rm=true -it -v ${CMAKE_SOURCE_DIR}:/talipot:rw -v
${CMAKE_BINARY_DIR}:/talipot_host_build:rw -v /tmp/.X11-unix:/tmp/.X11-unix
-e DISPLAY=$DISPLAY dokken/centos-stream-9 /bin/bash -c
"bash -xe /talipot/bundlers/linux/talipot_appimage_centos_build.sh"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
14 changes: 11 additions & 3 deletions bundlers/linux/make_appimage_bundle.sh.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This script is CentOS Stream 8.x specific, it intends to create a
# This script is CentOS Stream [8|9].x specific, it intends to create a
# talipot portable bundle (using AppImageKit) suitable to
# run on most linux distributions

Expand Down Expand Up @@ -135,8 +135,16 @@ wget "https://github.com/probonopd/linuxdeployqt/releases/download/\
continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage

./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run \
$BUNDLE_BIN_DIR/talipot -bundle-non-qt-libs -no-translations
linuxdeployqt_opts="-bundle-non-qt-libs -no-translations"
if [ $(${QMAKE} -query QT_VERSION | cut -c1) -ge 6 ]
then
linuxdeployqt_opts+=" -unsupported-allow-new-glibc"
linuxdeployqt_opts+=" -exclude-libs=libnss3.so,libnssutil3.so"
fi

export LD_LIBRARY_PATH=/usr/lib64/samba/
./linuxdeployqt-continuous-x86_64.AppImage $BUNDLE_BIN_DIR/talipot \
$linuxdeployqt_opts

pushd $BUNDLE_LIB_DIR > /dev/null 2>&1

Expand Down
6 changes: 3 additions & 3 deletions bundlers/linux/talipot.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<name>Talipot</name>
<summary>Display, analyze and edit relational data</summary>
<description>
<p>Talipot is an information visualization framework dedicated to the analysis and visualization of relational data.</p>
<p>Talipot is an information visualization framework dedicated to the analysis and visualization
of relational data.</p>
</description>
<icon type="cached">Talipot.png</icon>
<launchable type="desktop-id">talipot.desktop</launchable>
<url type="homepage">https://github.com/anlambert/talipot</url>
<provides>
<id>talipot.desktop</id>
</provides>
</component>
</component>
61 changes: 51 additions & 10 deletions bundlers/linux/talipot_appimage_centos_build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

# this script should only be run in a CentOS Stream 8.x docker image
# this script should only be run in a CentOS Stream [8|9].x docker image

centos8=true
centos9=false
if grep -q "CentOS Stream release 9" /etc/centos-release
then
centos8=false
centos9=true
fi

cd

Expand All @@ -12,22 +20,37 @@ yum -y update
# install base build system
yum -y install epel-release
yum -y install xz tar gzip make wget ccache
yum -y install dnf-plugins-core

if [ "$centos8" = true ]
then
# add extra CentOS 8 repositories to get some build dependencies
yum config-manager --set-enabled powertools
yum -y install https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm
talipot_use_qt6=OFF
qmake=qmake-qt5
else
# add extra CentOS 9 repositories to get some build dependencies
yum config-manager --set-enabled crb
talipot_use_qt6=ON
qmake=qmake
fi

# add extra CentOS 8 repositories to get some build dependencies
yum -y install dnf-plugins-core
yum config-manager --set-enabled powertools
yum -y install https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm
yum -y install cmake


# install talipot deps
yum -y install zlib-devel libzstd-devel qhull-devel yajl-devel \
graphviz-devel libgit2-devel binutils-devel
yum -y install freetype-devel fontconfig-devel glew-devel fribidi-devel
yum -y install qt5-qtbase-devel qt5-qtimageformats qt5-qtsvg \
quazip-qt5-devel qt5-qtwebkit-devel --enablerepo=epel-testing --nobest

if [ "$centos8" = true ]
then
yum -y install qt5-qtbase-devel qt5-qtimageformats qt5-qtsvg \
quazip-qt5-devel qt5-qtwebkit-devel --enablerepo=epel-testing --nobest
else
yum -y install qt6-qtbase-devel qt6-qtimageformats qt6-qtsvg \
qt6-qt5compat-devel qt6-qtwebengine-devel
fi

# install Python 3, Sphinx and SIP
yum -y install python3.11-devel python3.11-pip
Expand Down Expand Up @@ -60,6 +83,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \
-DTALIPOT_USE_CCACHE=ON \
-DTALIPOT_BUILD_FOR_APPIMAGE=ON \
-DTALIPOT_BUILD_TESTS=ON \
-DTALIPOT_USE_QT6=$talipot_use_qt6 \
-DOpenMP_C_FLAGS=-fopenmp \
-DOpenMP_CXX_FLAGS=-fopenmp ..

Expand All @@ -71,14 +95,31 @@ xvfb-run make tests
# build a bundle dir suitable for AppImageKit
bash bundlers/linux/make_appimage_bundle.sh --appdir $PWD

# ensure QtWebEngine is functional when bundled in AppImage
if [ "$centos9" = true ]
then
yum -y install patchelf cpio
# for some reasons, qt6-qtwebengine translations files are not installed
# by yum but those are still available in the rpm archive so we hack a bit
# to extract and copy them in the AppImage AppDir
yum -y remove --noautoremove qt6-qtwebengine
yum -y install --downloadonly --downloaddir=$PWD qt6-qtwebengine
rpm2cpio qt6-qtwebengine*.rpm | cpio -idmv --directory=/opt/qtwebengine
cp -r /opt/qtwebengine/usr/share/qt6/translations/qtwebengine_locales/ $BUNDLE_DIR/usr/translations/
# this file is also required to be bundled in AppImage or V8 crashes on startup
cp /opt/qtwebengine/usr/share/qt6/resources/v8_context_snapshot.bin $BUNDLE_DIR/usr/resources/
# rpath of QtWebEngineProcess also needs to be patched to work in AppImage
patchelf --set-rpath '$ORIGIN/../lib' $BUNDLE_DIR/usr/libexec/QtWebEngineProcess
fi

# get appimagetool
wget "https://github.com/probonopd/AppImageKit/releases/download/\
continuous/appimagetool-$(uname -p).AppImage"
chmod a+x appimagetool-$(uname -p).AppImage

# finally build the portable app
TALIPOT_APPIMAGE=Talipot-$(sh talipot-config --version)-$(uname -p).AppImage
./appimagetool-$(uname -p).AppImage --appimage-extract-and-run Talipot.AppDir $TALIPOT_APPIMAGE
TALIPOT_APPIMAGE=Talipot-$(sh talipot-config --version)-$(uname -p)-qt$($qmake -query QT_VERSION).AppImage
./appimagetool-$(uname -p).AppImage Talipot.AppDir $TALIPOT_APPIMAGE
chmod +x $TALIPOT_APPIMAGE

if [ -d /talipot_host_build ]; then
Expand Down

0 comments on commit f6f8e6c

Please sign in to comment.