Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Scopy AppImage for Raspberry PI ARM64 #1828

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/appimage-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Scopy arm64 AppImage Build

on: [push, pull_request]

env:
BUILD_HOST: ubuntu-20.04
USERNAME: github-actions

jobs:

build_scopy_arm64_appimage:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
set-safe-directory: 'true'

- name: Pull the Docker Image
run: docker pull cristianbindea/scopy2-arm64-appimage:latest

- name: Create Scopy AppImage
shell: bash
run: |
cd $GITHUB_WORKSPACE
sudo apt update
./ci/arm/create_sysroot.sh arm64 install_packages install_qemu
./ci/arm/arm_build_process.sh arm64 generate_ci_envs

docker run \
--mount type=bind,source="$GITHUB_WORKSPACE",target=/home/runner/scopy \
--env-file $GITHUB_WORKSPACE/ci/general/gh-actions.envs \
cristianbindea/scopy2-arm64-appimage:latest \
/bin/bash -c 'cd $HOME && \
sudo chown -R runner:runner scopy && \
cd $HOME/scopy && \
./ci/arm/arm_build_process.sh arm64 install_packages move_tools move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage
'
- name: Set short git commit SHA
shell: bash
run: echo "commit_sha=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_ENV"

- uses: actions/upload-artifact@v4
with:
name: scopy-linux-arm64-${{ env.commit_sha }}
path: ${{ github.workspace }}/Scopy-arm64.AppImage
6 changes: 3 additions & 3 deletions .github/workflows/appimage-armhf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
run: |
cd $GITHUB_WORKSPACE
sudo apt update
./ci/armhf/create_sysroot.sh install_packages install_qemu
./ci/armhf/armhf_build_process.sh generate_ci_envs
./ci/arm/create_sysroot.sh arm32 install_packages install_qemu
./ci/arm/arm_build_process.sh arm32 generate_ci_envs

docker run \
--mount type=bind,source="$GITHUB_WORKSPACE",target=/home/runner/scopy \
Expand All @@ -34,7 +34,7 @@ jobs:
/bin/bash -c 'cd $HOME && \
sudo chown -R runner:runner scopy && \
cd $HOME/scopy && \
./ci/armhf/armhf_build_process.sh install_packages move_tools move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage
./ci/arm/arm_build_process.sh arm32 install_packages move_tools move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage
'
- name: Set short git commit SHA
shell: bash
Expand Down
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ build/*
ci/general/gh-actions.envs
ci/ubuntu/staging
ci/macOS/staging
ci/armhf/staging
ci/armhf/docker/sysroot*
ci/armhf/scopy.AppDir
ci/armhf/staging
ci/armhf/scopy.AppDir
ci/armhf/scopy.squashfs
ci/arm/staging
ci/arm/docker/sysroot*
ci/arm/scopy.AppDir
ci/arm/staging
ci/arm/scopy.AppDir
ci/arm/scopy.squashfs
ci/arm/squashfs-root
ci/arm/sysroot
ci/x86_64/staging
ci/x86_64/scopy.AppDir
ci/windows/staging
Expand Down
7 changes: 4 additions & 3 deletions ci/armhf/.dockerignore → ci/arm/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
*
!sysroot.tar.gz
!armhf_build_process.sh
!armhf_build_config.sh
!arm_build_process.sh
!arm_build_config.sh
!cmake_toolchain.cmake
!create_sysroot.sh
!copy-deps.sh
!inside_chroot.sh
!build_qt.sh
!qt_patch.patch
!qt_patch_armhf.patch
!qt_patch_arm64.patch
File renamed without changes.
106 changes: 106 additions & 0 deletions ci/arm/arm_build_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash

if [ "$1" == "arm64" ];then
echo "Building for aarch64"
TOOLCHAIN_HOST="aarch64-linux-gnu"
elif [ "$1" == "arm32" ]; then
echo "Building for armhf"
TOOLCHAIN_HOST="arm-linux-gnueabihf"
else
echo "$1 is invalid. Enter first argument arm32 or arm64 to choose the toolchain"
exit
fi

LIBSERIALPORT_BRANCH=scopy-v2
LIBIIO_VERSION=v0.26
LIBAD9361_BRANCH=main
GLOG_BRANCH=v0.4.0
LIBM2K_BRANCH=main
SPDLOG_BRANCH=v1.x
VOLK_BRANCH=main
GNURADIO_BRANCH=scopy2-maint-3.10
GRSCOPY_BRANCH=3.10
GRM2K_BRANCH=main
LIBSIGROKDECODE_BRANCH=master
QWT_BRANCH=qwt-multiaxes-updated
LIBTINYIIOD_BRANCH=master
IIOEMU_BRANCH=main
KDDOCK_BRANCH=2.1

export APPIMAGE=1

SRC_SCRIPT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
[ $CI_SCRIPT == "ON" ] && STAGING_AREA=$HOME/scopy/ci/arm/staging || STAGING_AREA=$SRC_SCRIPT/staging
SYSROOT=$STAGING_AREA/sysroot
SYSROOT_TAR=$STAGING_AREA/sysroot.tar.gz
TOOLCHAIN=$STAGING_AREA/cross-pi-gcc
TOOLCHAIN_BIN=$TOOLCHAIN/bin
TOOLCHAIN_FILE=$SRC_SCRIPT/cmake_toolchain.cmake
QT_LOCATION=$SYSROOT/usr/lib/$TOOLCHAIN_HOST/qt5

CMAKE_BIN=$STAGING_AREA/cmake/bin/cmake
QMAKE_BIN=$QT_LOCATION/bin/qmake
JOBS=-j14

APP_DIR=$SRC_SCRIPT/scopy.AppDir
APP_IMAGE=$SRC_SCRIPT/Scopy.AppImage
APP_RUN=$SRC_SCRIPT/AppRun
APP_DESKTOP=$SRC_SCRIPT/scopy.desktop
APP_SQUASHFS=$SRC_SCRIPT/scopy.squashfs

# Runetimes downloaded from https://github.com/AppImage/AppImageKit/releases/continuous Mar 9, 2023
if [ $TOOLCHAIN_HOST == "aarch64-linux-gnu" ]; then
RUNTIME_ARM=$SRC_SCRIPT/runtime-aarch64
elif [ $TOOLCHAIN_HOST == "arm-linux-gnueabihf" ]; then
RUNTIME_ARM=$SRC_SCRIPT/runtime-armhf
fi

if [ $TOOLCHAIN_HOST == "aarch64-linux-gnu" ]; then
CMAKE_SYSTEM_PROCESSOR=aarch64
CMAKE_LIBRARY_ARCHITECTURE=aarch64-linux-gnu
elif [ $TOOLCHAIN_HOST == "arm-linux-gnueabihf" ]; then
CMAKE_SYSTEM_PROCESSOR=arm
CMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf
fi

# The exports below ensure these variables are available to the toolchain file.
export CMAKE_SYSROOT="$SYSROOT"
export QT_LOCATION="$QT_LOCATION"
export STAGING_AREA="$STAGING_AREA"
export CMAKE_SYSTEM_PROCESSOR="$CMAKE_SYSTEM_PROCESSOR"
export CMAKE_LIBRARY_ARCHITECTURE="$CMAKE_LIBRARY_ARCHITECTURE"

CMAKE_OPTS=(\
-DCMAKE_INSTALL_PREFIX="$SYSROOT" \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
)

CMAKE="$CMAKE_BIN ${CMAKE_OPTS[*]}"

if [ $TOOLCHAIN_HOST == "aarch64-linux-gnu" ]; then
QT_DEVICE=linux-rasp-pi4-aarch64
elif [ $TOOLCHAIN_HOST == "arm-linux-gnueabihf" ]; then
QT_DEVICE="linux-rasp-pi4-v3d-g++"
fi

QT_BUILD_LOCATION=$QT_LOCATION # the location where Qt will be installed in the system
QT_SYSTEM_LOCATION=/usr/lib/$TOOLCHAIN_HOST/qt5 # the Qt location relative to the sysroot folder
CROSS_COMPILER=$STAGING_AREA/cross-pi-gcc

if [ $TOOLCHAIN_HOST == "aarch64-linux-gnu" ]; then
CROSSCOMPILER_DOWNLOAD_LINK=https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bookworm/GCC%2012.2.0/cross-gcc-12.2.0-pi_64.tar.gz
elif [ $TOOLCHAIN_HOST == "arm-linux-gnueabihf" ]; then
CROSSCOMPILER_DOWNLOAD_LINK=https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-10.2.0-pi_3%2B.tar.gz
fi

CMAKE_DOWNLOAD_LINK=https://github.com/Kitware/CMake/releases/download/v3.29.0-rc2/cmake-3.29.0-rc2-linux-x86_64.tar.gz
KUIPER_DOWNLOAD_LINK=https://swdownloads.analog.com/cse/kuiper/image_2023-12-13-ADI-Kuiper-full.zip

if [ $TOOLCHAIN_HOST == "aarch64-linux-gnu" ]; then
QT_DOWNLOAD_LINK=https://download.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz
elif [ $TOOLCHAIN_HOST == "arm-linux-gnueabihf" ]; then
QT_DOWNLOAD_LINK=http://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
fi

SYSROOT_RELATIVE_LINKS=https://raw.githubusercontent.com/abhiTronix/rpi_rootfs/master/scripts/sysroot-relativelinks.py
Loading
Loading