From 56efcec796a3d11d918607574e91bc09e4b9d6e7 Mon Sep 17 00:00:00 2001 From: Viktor Kopp Date: Sat, 23 Nov 2024 21:17:09 +0100 Subject: [PATCH] Build app for ubuntu 22 and 24 Signed-off-by: Viktor Kopp --- .github/workflows/BuildPR.yml | 17 ++++++++++++++ scripts/linux/buildUbuntu22and24.sh | 32 +++++++++++++++++++++++++++ scripts/linux/installUbuntu22and24.sh | 20 +++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100755 scripts/linux/buildUbuntu22and24.sh create mode 100755 scripts/linux/installUbuntu22and24.sh diff --git a/.github/workflows/BuildPR.yml b/.github/workflows/BuildPR.yml index cc886745..cd4fbf15 100644 --- a/.github/workflows/BuildPR.yml +++ b/.github/workflows/BuildPR.yml @@ -135,6 +135,23 @@ jobs: name: DLTViewer-linux-x86_64 path: build/dist/DLTViewer*.tgz + buildUbuntu22and24: + name: Build ${{ matrix.ubuntu }} + strategy: + matrix: + ubuntu: [ ubuntu-22.04, ubuntu-24.04 ] + runs-on: ${{ matrix.ubuntu }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + - name: install build environment + run: scripts/linux/installUbuntu22and24.sh + - name: Build project + run: scripts/linux/buildUbuntu22and24.sh + buildWindows: name: Build Windows strategy: diff --git a/scripts/linux/buildUbuntu22and24.sh b/scripts/linux/buildUbuntu22and24.sh new file mode 100755 index 00000000..fd0ad899 --- /dev/null +++ b/scripts/linux/buildUbuntu22and24.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -ex + +SRC_DIR=$(pwd) +BUILD_DIR="${SRC_DIR}/build" +INSTALL_DIR="${BUILD_DIR}/install" +APP_DIR_NAME="DLTViewer" + +NPROC=$(nproc) +echo Nb of cpus: ${NPROC} + +echo Cleanup +rm -rf "${APP_DIR_NAME}" +rm -rf "${INSTALL_DIR}" +rm -rf "${BUILD_DIR}" +mkdir -p "${BUILD_DIR}" +cd "${BUILD_DIR}" + +echo Build with CMake +cmake -G Ninja \ + -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ + -DCMAKE_BUILD_TYPE=Release \ + -DDLT_USE_QT_RPATH=ON \ + -DDLT_PARSER=OFF \ + -DDLT_APP_DIR_NAME=${APP_DIR_NAME} \ + -DDLT_LIBRARY_INSTALLATION_PATH="${APP_DIR_NAME}/usr/lib" \ + -DDLT_EXECUTABLE_INSTALLATION_PATH="${APP_DIR_NAME}/usr/bin" \ + -DDLT_RESOURCE_INSTALLATION_PATH="${APP_DIR_NAME}/usr/share" \ + -DDLT_PLUGIN_INSTALLATION_PATH="${APP_DIR_NAME}/usr/bin/plugins" \ + "${SRC_DIR}" + +cmake --build "${BUILD_DIR}" -j ${NPROC} -v diff --git a/scripts/linux/installUbuntu22and24.sh b/scripts/linux/installUbuntu22and24.sh new file mode 100755 index 00000000..6a4f0430 --- /dev/null +++ b/scripts/linux/installUbuntu22and24.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -ex + +id +env +pwd + +UBUNTU_VERSION=$(lsb_release -rs) +QT_PACKAGES="" +# for ubuntu 22 install QT 5, for ubuntu 24 install QT 6 +if [ "$UBUNTU_VERSION" = "22.04" ]; then + QT_PACKAGES="qtbase5-dev libqt5serialport5-dev" +else + QT_PACKAGES="qt6-base-dev libqt6serialport6-dev" +fi + +sudo apt update +sudo apt-get install -y --no-install-recommends ninja-build ${QT_PACKAGES} + +g++ --version