Skip to content

Commit e483105

Browse files
authored
Merge pull request #2895 from hoffie/autobuild-aarch64
Autobuild: Add Linux .deb aarch64 (Raspberry) 64bit builds
2 parents 7e60d6f + 4b4770b commit e483105

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/autobuild/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ The scripts in this folder are used by the Github autobuild actions in .github/w
44
They are responsible for setting up the Github environment, building the binaries and passing the resulting artifacts back to the workflow.
55

66
The scripts may work outside of Github, but haven't been designed or tested for that use case.
7+
Some of the scripts modify global system settings, install software or create files in directories which are usually managed by package managers.
8+
In short: They should probably only used in throw-away environments.
9+
710
See the various platform-specific build scripts in their own folders for standalone builds (e.g. windows/deploy_windows.ps1).

.github/autobuild/linux_deb.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ case "${TARGET_ARCH}" in
1414
armhf)
1515
ABI_NAME="arm-linux-gnueabihf"
1616
;;
17+
arm64)
18+
ABI_NAME="aarch64-linux-gnu"
19+
;;
1720
*)
1821
echo "Unsupported TARGET_ARCH ${TARGET_ARCH}"
1922
exit 1
@@ -37,7 +40,9 @@ setup_cross_compilation_apt_sources() {
3740
return
3841
fi
3942
sudo dpkg --add-architecture "${TARGET_ARCH}"
43+
# Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
4044
sed -rne "s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/"${TARGET_ARCH}".list
45+
# Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
4146
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
4247
}
4348

@@ -50,10 +55,10 @@ setup_cross_compiler() {
5055
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-g++" g++ "/usr/bin/${ABI_NAME}-g++-${GCC_VERSION}" 10
5156
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-gcc" gcc "/usr/bin/${ABI_NAME}-gcc-${GCC_VERSION}" 10
5257

53-
if [[ "${TARGET_ARCH}" == armhf ]]; then
54-
# Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf. Therefore, build a custom one:
58+
# Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf or aarch64. Therefore, build a custom one:
59+
if [[ $ABI_NAME ]]; then
5560
sudo cp -R "/usr/lib/${ABI_NAME}/qt5/mkspecs/linux-arm-gnueabi-g++/" "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/"
56-
sudo sed -re 's/-gnueabi/-gnueabihf/' -i "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/qmake.conf"
61+
sudo sed -re "s/arm-linux-gnueabi/${ABI_NAME}/" -i "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/qmake.conf"
5762
fi
5863
}
5964

.github/workflows/autobuild.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ jobs:
209209
base_command: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh
210210
run_codeql: false
211211

212+
- config_name: Linux .deb arm64 (artifacts)
213+
target_os: linux
214+
building_on_os: ubuntu-22.04
215+
building_container: ubuntu:18.04
216+
base_command: TARGET_ARCH=arm64 ./.github/autobuild/linux_deb.sh
217+
run_codeql: false
218+
212219
- config_name: MacOS (artifacts)
213220
target_os: macos
214221
building_on_os: macos-12

0 commit comments

Comments
 (0)