Skip to content

Commit 05eefaf

Browse files
committed
add ARM64 support to Linux CI
1 parent 22c57f7 commit 05eefaf

File tree

6 files changed

+68
-43
lines changed

6 files changed

+68
-43
lines changed

.github/workflows/linux.yml

+32-25
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- 'Stable*'
88
tags:
99
- 'v*'
10+
workflow_dispatch:
1011
pull_request:
1112
paths:
1213
- '.github/workflows/linux.yml'
@@ -20,20 +21,29 @@ on:
2021

2122
jobs:
2223
build:
23-
runs-on: ubuntu-22.04
24+
runs-on: ${{ matrix.runs-on }}
2425

2526
strategy:
2627
matrix:
2728
BuildType: [Debug, Release]
28-
# Arch: [x64] # Arm64
29+
runs-on: [ubuntu-24.04-arm, ubuntu-22.04]
30+
include:
31+
- runs-on: ubuntu-24.04-arm
32+
ARTIFACT: QGroundControl-aarch64.AppImage
33+
PACKAGE: QGroundControl-aarch64
34+
host: linux_arm64
35+
arch: linux_gcc_arm64
36+
- runs-on: ubuntu-22.04
37+
ARTIFACT: QGroundControl-x86_64.AppImage
38+
PACKAGE: QGroundControl-x86_64
39+
host: linux
40+
arch: linux_gcc_64
2941

3042
defaults:
3143
run:
3244
shell: bash
3345

3446
env:
35-
ARTIFACT: QGroundControl-x86_64.AppImage
36-
PACKAGE: QGroundControl-x86_64
3747
QT_VERSION: 6.8.1
3848
GST_VERSION: 1.22.12
3949
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
@@ -55,33 +65,30 @@ jobs:
5565
5666
- name: Install Vulkan
5767
run: |
58-
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
59-
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
60-
sudo apt update
61-
sudo apt install vulkan-sdk
62-
63-
- name: Install Compiler
64-
run: |
65-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
66-
sudo apt install gcc-11 g++-11
67-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
68-
sudo update-alternatives --set gcc /usr/bin/gcc-11
68+
sudo apt install -y --quiet libvulkan-dev
69+
if apt-cache show vulkan-validationlayers-dev >/dev/null 2>&1 && apt-cache show vulkan-validationlayers-dev 2>/dev/null | grep -q "^Package: vulkan-validationlayers-dev"; then
70+
sudo apt-get install -y --quiet vulkan-validationlayers-dev
71+
fi
72+
if apt-cache show vulkan-utility-libraries-dev >/dev/null 2>&1 && apt-cache show vulkan-utility-libraries-dev 2>/dev/null | grep -q "^Package: apt-cache show vulkan-utility-libraries-dev"; then
73+
sudo apt-get install -y --quiet vulkan-utility-libraries-dev
74+
fi
6975
7076
- name: Setup Caching
77+
if: ${{ matrix.arch=='linux_gcc_64' }}
7178
uses: ./.github/actions/cache
7279
with:
73-
host: linux
74-
target: linux_gcc_64
80+
host: ${{ matrix.host }}
81+
target: desktop
7582
build-type: ${{ matrix.BuildType }}
7683
cpm-modules: ${{ env.CPM_SOURCE_CACHE }}
7784

78-
- name: Install Qt for Linux (x64)
79-
uses: jurplel/install-qt-action@v4
85+
- name: Install Qt for Linux
86+
uses: jdpurcell/install-qt-action@b45c67aaa9e0ea77e59a7031ec14a12d5ddf4b35
8087
with:
8188
version: ${{ env.QT_VERSION }}
82-
host: linux
89+
host: ${{ matrix.host }}
8390
target: desktop
84-
arch: linux_gcc_64
91+
arch: ${{ matrix.arch }}
8592
dir: ${{ runner.temp }}
8693
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors
8794

@@ -106,19 +113,19 @@ jobs:
106113
- name: Sanity check release excecutable
107114
if: matrix.BuildType == 'Release'
108115
working-directory: ${{ runner.temp }}/shadow_build_dir
109-
run: xvfb-run -a ./${{ env.ARTIFACT }} --simple-boot-test
116+
run: xvfb-run -a ./${{ matrix.ARTIFACT }} --simple-boot-test
110117

111118
- name: Run unit tests
112119
if: matrix.BuildType == 'Debug'
113120
working-directory: ${{ runner.temp }}/shadow_build_dir
114-
run: xvfb-run -a ./${{ env.ARTIFACT }} --unittest
121+
run: xvfb-run -a ./${{ matrix.ARTIFACT }} --unittest
115122

116123
- name: Upload Build File
117124
if: matrix.BuildType == 'Release'
118125
uses: ./.github/actions/upload
119126
with:
120-
artifact_name: ${{ env.ARTIFACT }}
121-
package_name: ${{ env.PACKAGE }}
127+
artifact_name: ${{ matrix.ARTIFACT }}
128+
package_name: ${{ matrix.PACKAGE }}
122129
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
123130
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
124131
github_token: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,10 @@ elseif(LINUX)
596596
FILES ${CMAKE_SOURCE_DIR}/deploy/linux/AppRun
597597
DESTINATION ${CMAKE_BINARY_DIR}
598598
)
599-
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CreateAppImage.cmake")
599+
install(CODE "
600+
set(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")
601+
include(\"${CMAKE_SOURCE_DIR}/cmake/CreateAppImage.cmake\")
602+
")
600603
elseif(WIN32)
601604
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CreateWinInstaller.cmake")
602605
elseif(MACOS)

cmake/CreateAppImage.cmake

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@ message(STATUS "Creating AppImage")
22
# TODO: https://github.com/AppImageCommunity/AppImageUpdate
33

44
set(APPDIR_PATH "${CMAKE_BINARY_DIR}/AppDir")
5-
set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-x86_64.AppImage")
6-
set(LD_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-x86_64.AppImage")
7-
# set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage")
8-
# set(LD_QTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage")
5+
set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
6+
set(LD_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
7+
# set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
8+
# set(LD_QTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
99
# set(LD_GSTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gstreamer.sh")
1010
# set(LD_GTKPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gtk.sh")
11+
set(FETCHCONTENT_QUIET FALSE)
1112

1213
if(NOT EXISTS "${APPIMAGETOOL_PATH}")
13-
file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage "${APPIMAGETOOL_PATH}")
14+
message(STATUS "Downloading appimagetool")
15+
file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${APPIMAGETOOL_PATH}")
1416
# file(DOWNLOAD https://github.com/probonopd/go-appimage/releases/download/832/appimagetool-823-x86_64.AppImage "${APPIMAGETOOL_PATH}") # TODO: Use Continuous Release
1517
execute_process(COMMAND chmod a+x "${APPIMAGETOOL_PATH}")
1618
endif()
1719
if(NOT EXISTS "${LD_PATH}")
18-
file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage "${LD_PATH}")
20+
message(STATUS "Downloading linuxdeploy")
21+
file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_PATH}")
1922
execute_process(COMMAND chmod a+x "${LD_PATH}")
2023
endif()
2124
# if(NOT EXISTS "${LD_APPIMAGEPLUGIN_PATH}")
22-
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage "${LD_APPIMAGEPLUGIN_PATH}")
25+
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_APPIMAGEPLUGIN_PATH}")
2326
# execute_process(COMMAND chmod a+x "${LD_APPIMAGEPLUGIN_PATH}")
2427
# endif()
2528
# if(NOT EXISTS "${LD_QTPLUGIN_PATH}")
26-
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage "${LD_QTPLUGIN_PATH}")
29+
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_QTPLUGIN_PATH}")
2730
# execute_process(COMMAND chmod a+x "${LD_QTPLUGIN_PATH}")
2831
# endif()
2932
# if(NOT EXISTS "${LD_GTKPLUGIN_PATH}")
@@ -35,14 +38,19 @@ endif()
3538
# execute_process(COMMAND chmod a+x "${LD_GSTPLUGIN_PATH}")
3639
# endif()
3740

41+
message(STATUS "Executing linuxdeploy")
3842
execute_process(COMMAND ${LD_PATH}
3943
--appdir ${APPDIR_PATH}
4044
--executable ${APPDIR_PATH}/usr/bin/QGroundControl
4145
--desktop-file ${APPDIR_PATH}/usr/share/applications/org.mavlink.qgroundcontrol.desktop
42-
--custom-apprun ${CMAKE_BINARY_DIR}/AppRun)
46+
--custom-apprun ${CMAKE_BINARY_DIR}/AppRun
47+
COMMAND_ERROR_IS_FATAL ANY)
4348
# --exclude-library "libgst*"
4449
# --plugin qt --plugin gtk --plugin gstreamer
4550

46-
set(ENV{ARCH} x86_64)
51+
set(ENV{ARCH} ${CMAKE_SYSTEM_PROCESSOR})
4752
# set(ENV{VERSION} 5.0)
48-
execute_process(COMMAND ${APPIMAGETOOL_PATH} ${APPDIR_PATH})
53+
54+
message(STATUS "Executing appimagetool")
55+
execute_process(COMMAND ${APPIMAGETOOL_PATH} ${APPDIR_PATH}
56+
COMMAND_ERROR_IS_FATAL ANY)

cmake/find-modules/FindGStreamer.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ elseif(MACOS)
5353
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/pkgconfig:${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
5454
elseif(LINUX)
5555
set(GSTREAMER_PREFIX "/usr")
56-
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/pkgconfig:${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
56+
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/pkgconfig:${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
5757
# if(QGC_GST_STATIC_BUILD)
5858
# list(APPEND PKG_CONFIG_ARGN
5959
# --dont-define-prefix
6060
# --define-variable=prefix=${GSTREAMER_PREFIX}
61-
# --define-variable=libdir=${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu
61+
# --define-variable=libdir=${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu
6262
# --define-variable=includedir=${GSTREAMER_PREFIX}/include
6363
# )
6464
# endif()
@@ -136,7 +136,7 @@ cmake_print_variables(GSTREAMER_PREFIX)
136136

137137
# TODO: find_path
138138
if(LINUX)
139-
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu)
139+
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
140140
elseif(MACOS OR ANDROID OR WIN32)
141141
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib)
142142
elseif(IOS)

src/AnalyzeView/CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ set(EXIV2_VERSION 0.28.3)
106106

107107
if(NOT QGC_BUILD_DEPENDENCIES)
108108
if(LINUX)
109-
set(EXIV2_RELEASE_URL "https://github.com/Exiv2/exiv2/releases/download/v${EXIV2_VERSION}/exiv2-${EXIV2_VERSION}-Linux64.tar.gz")
109+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
110+
set(EXIV2_RELEASE_URL "https://github.com/gmesm/exiv2/releases/download/v${EXIV2_VERSION}/exiv2-${EXIV2_VERSION}-Linux-x86_64.tar.gz")
111+
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
112+
set(EXIV2_RELEASE_URL "https://github.com/gmesm/exiv2/releases/download/v${EXIV2_VERSION}/exiv2-${EXIV2_VERSION}-Linux-aarch64.tar.gz")
113+
endif()
110114
elseif(MACOS)
111-
set(EXIV2_RELEASE_URL "https://github.com/Exiv2/exiv2/releases/download/v${EXIV2_VERSION}/exiv2-${EXIV2_VERSION}-Darwin.tar.gz")
115+
set(EXIV2_RELEASE_URL "https://github.com/Exiv2/exiv2/releases/download/v${EXIV2_VERSION}/exiv2-${EXIV2_VERSION}-Darwin-x86_64.tar.gz")
112116
endif()
113117
endif()
114118

tools/setup/install-dependencies-debian.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \
133133
flex \
134134
gobject-introspection \
135135
gvfs \
136-
intel-media-va-driver \
137136
libasound2-dev \
138137
libass-dev \
139138
libdrm-dev \
@@ -190,6 +189,10 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \
190189
vainfo \
191190
wayland-protocols
192191

192+
if apt-cache show intel-media-va-driver >/dev/null 2>&1 && apt-cache show intel-media-va-driver 2>/dev/null | grep -q "^Package: intel-media-va-driver"; then
193+
DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet intel-media-va-driver
194+
fi
195+
193196
if apt-cache show libdav1d-dev >/dev/null 2>&1 && apt-cache show libdav1d-dev 2>/dev/null | grep -q "^Package: libdav1d-dev"; then
194197
DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet libdav1d-dev
195198
fi

0 commit comments

Comments
 (0)