Skip to content

Commit

Permalink
ci/armhf: rename kuiperbuild worfkflow to appimage-armhf
Browse files Browse the repository at this point in the history
 - the generated AppImage now works on other platforms, other than Kuiper Linux

Signed-off-by: Bindea Cristian <cristian.bindea@analog.com>
  • Loading branch information
bindea-cristian committed Jun 12, 2024
1 parent 9d132d8 commit 62c38b6
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Kuiper Scopy Build
name: Scopy armhf Build

on: [push, pull_request]

Expand All @@ -8,7 +8,7 @@ env:

jobs:

build_scopy_for_kuiper:
build_scopy_for_armhf:
runs-on: ubuntu-20.04

steps:
Expand All @@ -17,24 +17,24 @@ jobs:
set-safe-directory: 'true'

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

- name: Create Scopy AppImage
shell: bash
run: |
cd $GITHUB_WORKSPACE
sudo apt update
./ci/kuiper/create_sysroot.sh install_packages install_qemu
./ci/kuiper/kuiper_build_process.sh generate_ci_envs
./ci/armhf/create_sysroot.sh install_packages install_qemu
./ci/armhf/armhf_build_process.sh 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-kuiper:latest \
cristianbindea/scopy2-armhf-appimage:latest \
/bin/bash -c 'cd $HOME && \
sudo chown -R runner:runner scopy && \
cd $HOME/scopy && \
./ci/kuiper/kuiper_build_process.sh install_packages download_cmake download_crosscompiler move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage
./ci/armhf/armhf_build_process.sh install_packages download_cmake download_crosscompiler move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage
'
- name: Set short git commit SHA
shell: bash
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ build/*
.vscode/*
ci/ubuntu/staging
ci/macOS/staging
ci/kuiper/staging
ci/kuiper/docker/sysroot*
ci/kuiper/scopy.AppDir
ci/armhf/staging
ci/armhf/docker/sysroot*
ci/armhf/scopy.AppDir
ci/armhf/staging
ci/armhf/scopy.AppDir
ci/armhf/scopy.squashfs
windows/*
core/include/scopy-core_config.h
core/include/scopy-core_export.h
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ QWT_BRANCH=qwt-multiaxes-updated
LIBTINYIIOD_BRANCH=master
IIOEMU_BRANCH=main

STAGING_AREA=$SRC_DIR/ci/kuiper/staging
STAGING_AREA=$SRC_DIR/ci/armhf/staging
SYSROOT=$STAGING_AREA/sysroot
SYSROOT_TAR=$STAGING_AREA/sysroot.tar.gz
SYSROOT_DOCKER=$SRC_DIR/ci/kuiper/docker/sysroot.tar.gz
SYSROOT_DOCKER=$SRC_DIR/ci/armhf/docker/sysroot.tar.gz
TOOLCHAIN=$STAGING_AREA/cross-pi-gcc
TOOLCHAIN_BIN=$TOOLCHAIN/bin
TOOLCHAIN_HOST="arm-linux-gnueabihf"
TOOLCHAIN_FILE=$SRC_DIR/ci/kuiper/cmake_toolchain.cmake
TOOLCHAIN_FILE=$SRC_DIR/ci/armhf/cmake_toolchain.cmake
QT_LOCATION=$SYSROOT/usr/local/qt5.15

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

APP_DIR=$SRC_DIR/ci/kuiper/scopy.AppDir
APP_IMAGE=$SRC_DIR/ci/kuiper/Scopy.AppImage
APP_RUN=$SRC_DIR/ci/kuiper/AppRun
APP_DESKTOP=$SRC_DIR/ci/kuiper/scopy.desktop
APP_SQUASHFS=$SRC_DIR/ci/kuiper/scopy.squashfs
RUNTIME_ARMHF=$SRC_DIR/ci/kuiper/runtime-armhf
APP_DIR=$SRC_DIR/ci/armhf/scopy.AppDir
APP_IMAGE=$SRC_DIR/ci/armhf/Scopy.AppImage
APP_RUN=$SRC_DIR/ci/armhf/AppRun
APP_DESKTOP=$SRC_DIR/ci/armhf/scopy.desktop
APP_SQUASHFS=$SRC_DIR/ci/armhf/scopy.squashfs
RUNTIME_ARMHF=$SRC_DIR/ci/armhf/runtime-armhf

CMAKE_OPTS=(\
-DCMAKE_SYSROOT="$SYSROOT" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex
git config --global --add safe.directory $HOME/scopy
SRC_DIR=$(git rev-parse --show-toplevel)
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh
source $SRC_DIR/ci/armhf/armhf_build_config.sh

echo -- USING CMAKE COMMAND:
echo $CMAKE
Expand Down Expand Up @@ -285,7 +285,7 @@ create_appdir(){
PLUGINS=$BUILD_FOLDER/plugins/plugins
REGMAP_XMLS=$BUILD_FOLDER/plugins/regmap/xmls
TRANSLATIONS_QM=$(find $BUILD_FOLDER/translations -type f -name "*.qm")
COPY_DEPS=$SRC_DIR/ci/kuiper/copy-deps.sh
COPY_DEPS=$SRC_DIR/ci/armhf/copy-deps.sh

rm -rf $APP_DIR
mkdir $APP_DIR
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions ci/kuiper/copy-deps.sh → ci/armhf/copy-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

set -e
SRC_DIR=$(git rev-parse --show-toplevel)
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh
source $SRC_DIR/ci/armhf/armhf_build_config.sh

BINARY=$1
LOCATION=$2


if [ ! -f "${SRC_DIR}"/ci/kuiper/ldd-mod ]; then
sed 's|.*RTLDLIST=.*|RTLDLIST="/usr/arm-linux-gnueabihf/lib/ld-2.31.so /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3"|' /usr/bin/ldd | tee "${SRC_DIR}"/ci/kuiper/ldd-mod
chmod +x "${SRC_DIR}"/ci/kuiper/ldd-mod
if [ ! -f "${SRC_DIR}"/ci/armhf/ldd-mod ]; then
sed 's|.*RTLDLIST=.*|RTLDLIST="/usr/arm-linux-gnueabihf/lib/ld-2.31.so /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3"|' /usr/bin/ldd | tee "${SRC_DIR}"/ci/armhf/ldd-mod
chmod +x "${SRC_DIR}"/ci/armhf/ldd-mod
fi

export LD_LIBRARY_PATH="${APP_DIR}/usr/lib:${SYSROOT}/lib:${SYSROOT}/lib/arm-linux-gnueabihf:${SYSROOT}/usr/arm-linux-gnueabihf/lib:${SYSROOT}/usr/local/qt5.15/lib:${SYSROOT}/usr/local/lib:${SRC_DIR}/build"
LIBS_ARRAY=()
run_ldd(){
for library in $("${SRC_DIR}"/ci/kuiper/ldd-mod "$1" | cut -d '>' -f 2 | awk '{print $1}')
for library in $("${SRC_DIR}"/ci/armhf/ldd-mod "$1" | cut -d '>' -f 2 | awk '{print $1}')
do
# check if the library exists at that path and if it was processed already
if [ -f "${library}" ] && ! [[ "${LIBS_ARRAY[*]}" =~ "${library}" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex
SRC_DIR=$(git rev-parse --show-toplevel)
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh
source $SRC_DIR/ci/armhf/armhf_build_config.sh

# install docker
install_packages(){
Expand All @@ -15,7 +15,7 @@ install_packages(){
}

create_sysroot(){
$SRC_DIR/ci/kuiper/create_sysroot.sh \
$SRC_DIR/ci/armhf/create_sysroot.sh \
install_packages \
download_kuiper \
install_qemu \
Expand All @@ -32,9 +32,9 @@ tar_and_move_sysroot(){
}

create_image(){
pushd ${SRC_DIR}/ci/kuiper/docker
sudo docker build --load --tag cristianbindea/scopy2-kuiper .
# sudo DOCKER_BUILDKIT=0 docker build --tag cristianbindea/scopy2-kuiper . # build the image using old backend
pushd ${SRC_DIR}/ci/armhf/docker
sudo docker build --load --tag cristianbindea/scopy2-armhf-appimage .
# sudo DOCKER_BUILDKIT=0 docker build --tag cristianbindea/scopy2-armhf-appimage . # build the image using old backend
popd
}

Expand Down
4 changes: 2 additions & 2 deletions ci/kuiper/create_sysroot.sh → ci/armhf/create_sysroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex
SRC_DIR=$(git rev-parse --show-toplevel)
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh
source $SRC_DIR/ci/armhf/armhf_build_config.sh

IMAGE_FILE=2023-12-13-ADI-Kuiper-full.img

Expand Down Expand Up @@ -44,7 +44,7 @@ extract_sysroot(){

# execute chroot inside the sysroot folder and install/remove packages using apt
configure_sysroot(){
cat $SRC_DIR/ci/kuiper/inside_chroot.sh | sudo chroot ${SYSROOT}
cat $SRC_DIR/ci/armhf/inside_chroot.sh | sudo chroot ${SYSROOT}
}

move_and_extract_sysroot(){
Expand Down
14 changes: 7 additions & 7 deletions ci/kuiper/docker/Dockerfile → ci/armhf/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ FROM start AS sysroot_builder
ARG USER=runner
ENV DEBIAN_FRONTEND=noninteractive
COPY sysroot.tar.gz /home/${USER}
RUN git clone https://github.com/analogdevicesinc/scopy -b kuiper-worflow
RUN git clone https://github.com/analogdevicesinc/scopy -b dev
WORKDIR /home/${USER}/scopy
RUN ./ci/kuiper/create_sysroot.sh \
RUN ./ci/armhf/create_sysroot.sh \
install_packages \
move_and_extract_sysroot \
fix_relativelinks
RUN ./ci/kuiper/build_qt.sh \
RUN ./ci/armhf/build_qt.sh \
install_packages \
download_qt \
download_crosscompiler \
build_qt5.15.2
RUN ./ci/kuiper/kuiper_build_process.sh \
RUN ./ci/armhf/armhf_build_process.sh \
install_packages \
download_cmake \
download_crosscompiler \
Expand All @@ -51,9 +51,9 @@ FROM start
ARG USER=runner
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /home/${USER}/sysroot
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/usr /home/${USER}/sysroot/usr
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/share /home/${USER}/sysroot/share
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/include /home/${USER}/sysroot/include
COPY --from=sysroot_builder /home/${USER}/scopy/ci/armhf/staging/sysroot/usr /home/${USER}/sysroot/usr
COPY --from=sysroot_builder /home/${USER}/scopy/ci/armhf/staging/sysroot/share /home/${USER}/sysroot/share
COPY --from=sysroot_builder /home/${USER}/scopy/ci/armhf/staging/sysroot/include /home/${USER}/sysroot/include
WORKDIR /home/${USER}/sysroot
RUN ln -s usr/bin bin && ln -s usr/lib lib && ln -s usr/sbin sbin
WORKDIR /home/${USER}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 62c38b6

Please sign in to comment.