From 037529fa7f9b35c1631521add144b06c6614cae6 Mon Sep 17 00:00:00 2001 From: Jorik Jonker Date: Mon, 18 Oct 2021 14:34:29 +0200 Subject: [PATCH] Add support for armv6 (raspberry pi) to CD --- .github/scripts/install-dependencies.sh | 12 +++++++++++- .github/workflows/cd.yml | 14 +++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/scripts/install-dependencies.sh b/.github/scripts/install-dependencies.sh index d5325347..a50904f6 100755 --- a/.github/scripts/install-dependencies.sh +++ b/.github/scripts/install-dependencies.sh @@ -32,8 +32,12 @@ apt-get update # Setup magic vars for foreign packages if [ "${ARCH}" != "$(uname -m)" ]; then + if [ "${ARCH}" == "armv6"]; then + BUILD_PKGS="curl libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config" + else + BUILD_PKGS="gcc-${ARCH}-linux-${ABI} libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config" + fi CROSS=":${DEBARCH}" - BUILD_PKGS="gcc-${ARCH}-linux-${ABI} libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config" dpkg --add-architecture ${DEBARCH} else CROSS="" @@ -51,6 +55,12 @@ apt-get install -y \ ${BUILDDEP_DEFAULT} \ ${BUILDDEP_FULL} +if [ "${ARCH}" == "armv6" ]; then + curl -Lo /tmp/raspi-toolchain.tar.gz https://github.com/Pro/raspi-toolchain/releases/latest/download/raspi-toolchain.tar.gz + tar -zxf /tmp/raspi-toolchain.tar.gz -C /opt + echo "/opt/cross-pi-gcc/bin" >> ${GITHUB_PATH} +fi + # Tell rust to cross-compile if [ "${ARCH}" != "$(uname -m)" ]; then mkdir -p ~/.cargo diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a4ed07cd..14ec7605 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -13,19 +13,31 @@ jobs: matrix: build_target: [linux, macos] artifact_type: [slim, default, full] - arch: [x86_64, armhf, arm64] # "our" name of the arch. How debian, rust and gcc call them will be set later + arch: [x86_64, armv6, armhf, arm64] # "our" name of the arch. How debian, rust and gcc call them will be set later # remove unwanted combinations. Arm64 macos is not supported by GH right now exclude: + - build_target: macos + arch: armv6 - build_target: macos arch: armhf - build_target: macos arch: arm64 + - build_target: linux + arch: armv6 + artifact_type: default + - build_target: linux + arch: armv6 + artifact_type: full include: # Setup Arch-specific defaults. Different systems use different names - arch: x86_64 abi: gnu binarch: x86_64 debarch: amd64 + - arch: armv6 + abi: gnueabihf + binarch: arm + debarch: armhf - arch: armhf abi: gnueabihf binarch: arm