From ce199c5f848ca0417ec79108779ca114cef242c5 Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Fri, 17 May 2024 22:24:20 +0200 Subject: [PATCH] gha: Add job to build Talipot AppImage with Qt6 --- .github/workflows/appimage-build.yml | 8 +++- bundlers/linux/CMakeLists.txt | 9 ++++ bundlers/linux/make_appimage_bundle.sh.in | 32 ++++++++++---- bundlers/linux/talipot.appdata.xml | 6 +-- .../linux/talipot_appimage_centos_build.sh | 42 +++++++++++++++---- 5 files changed, 76 insertions(+), 21 deletions(-) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index a2e1442ae3..2b2e5aade3 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -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/cancel-workflow-action@0.12.1 @@ -90,7 +94,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' diff --git a/bundlers/linux/CMakeLists.txt b/bundlers/linux/CMakeLists.txt index 4494056763..a2d959764e 100644 --- a/bundlers/linux/CMakeLists.txt +++ b/bundlers/linux/CMakeLists.txt @@ -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}) diff --git a/bundlers/linux/make_appimage_bundle.sh.in b/bundlers/linux/make_appimage_bundle.sh.in index c47c0cc967..8d5279d301 100644 --- a/bundlers/linux/make_appimage_bundle.sh.in +++ b/bundlers/linux/make_appimage_bundle.sh.in @@ -1,9 +1,17 @@ #!/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 +centos8=true +centos9=false +if grep -q "CentOS Stream release 9" /etc/centos-release +then + centos8=false + centos9=true +fi + TALIPOT_INSTALL_DIR=@CMAKE_INSTALL_PREFIX@ OUTPUT_DIR=/tmp QMAKE=@QT_QMAKE_EXECUTABLE@ @@ -130,13 +138,23 @@ if [ "$PYTHON_LIB" != "" ]; then popd > /dev/null 2>&1 fi -# copy required shared libs using linuxdeployqt tool -wget "https://github.com/probonopd/linuxdeployqt/releases/download/\ +if [ "$centos8" = true ] +then + # copy required shared libs using linuxdeployqt tool + 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 + 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 +else + wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/\ +continuous/linuxdeploy-x86_64.AppImage" + wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/\ +download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + chmod a+x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-qt-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir $BUNDLE_DIR --plugin qt +fi pushd $BUNDLE_LIB_DIR > /dev/null 2>&1 diff --git a/bundlers/linux/talipot.appdata.xml b/bundlers/linux/talipot.appdata.xml index a40ae093a1..ebedda5a8a 100644 --- a/bundlers/linux/talipot.appdata.xml +++ b/bundlers/linux/talipot.appdata.xml @@ -6,12 +6,12 @@ Talipot Display, analyze and edit relational data -

Talipot is an information visualization framework dedicated to the analysis and visualization of relational data.

+

Talipot is an information visualization framework dedicated to the analysis and visualization + of relational data.

- Talipot.png talipot.desktop https://github.com/anlambert/talipot talipot.desktop - + \ No newline at end of file diff --git a/bundlers/linux/talipot_appimage_centos_build.sh b/bundlers/linux/talipot_appimage_centos_build.sh index 1426154c15..0fa79ce964 100644 --- a/bundlers/linux/talipot_appimage_centos_build.sh +++ b/bundlers/linux/talipot_appimage_centos_build.sh @@ -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 @@ -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-qtwebengine-devel qt6-qt5compat-devel +fi # install Python 3, Sphinx and SIP yum -y install python3.11-devel python3.11-pip @@ -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 .. @@ -77,7 +101,7 @@ 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 +TALIPOT_APPIMAGE=Talipot-$(sh talipot-config --version)-$(uname -p)-qt$($qmake -query QT_VERSION).AppImage ./appimagetool-$(uname -p).AppImage --appimage-extract-and-run Talipot.AppDir $TALIPOT_APPIMAGE chmod +x $TALIPOT_APPIMAGE