Skip to content

Commit

Permalink
Merge pull request #2895 from hoffie/autobuild-aarch64
Browse files Browse the repository at this point in the history
Autobuild: Add Linux .deb aarch64 (Raspberry) 64bit builds
  • Loading branch information
ann0see authored Oct 7, 2022
2 parents 7e60d6f + 4b4770b commit e483105
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/autobuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ The scripts in this folder are used by the Github autobuild actions in .github/w
They are responsible for setting up the Github environment, building the binaries and passing the resulting artifacts back to the workflow.

The scripts may work outside of Github, but haven't been designed or tested for that use case.
Some of the scripts modify global system settings, install software or create files in directories which are usually managed by package managers.
In short: They should probably only used in throw-away environments.

See the various platform-specific build scripts in their own folders for standalone builds (e.g. windows/deploy_windows.ps1).
11 changes: 8 additions & 3 deletions .github/autobuild/linux_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ case "${TARGET_ARCH}" in
armhf)
ABI_NAME="arm-linux-gnueabihf"
;;
arm64)
ABI_NAME="aarch64-linux-gnu"
;;
*)
echo "Unsupported TARGET_ARCH ${TARGET_ARCH}"
exit 1
Expand All @@ -37,7 +40,9 @@ setup_cross_compilation_apt_sources() {
return
fi
sudo dpkg --add-architecture "${TARGET_ARCH}"
# Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
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
# Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
}

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

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

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ jobs:
base_command: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh
run_codeql: false

- config_name: Linux .deb arm64 (artifacts)
target_os: linux
building_on_os: ubuntu-22.04
building_container: ubuntu:18.04
base_command: TARGET_ARCH=arm64 ./.github/autobuild/linux_deb.sh
run_codeql: false

- config_name: MacOS (artifacts)
target_os: macos
building_on_os: macos-12
Expand Down

0 comments on commit e483105

Please sign in to comment.