Skip to content

Commit

Permalink
Android CMake - Cross compiling Linux (#490)
Browse files Browse the repository at this point in the history
* Workflow wait loop

* Actions
em build artefact

(cherry picked from commit ea48478014cee42a387b427c1f12d7e4c00f23f7)

* Actions fixes / script install linux cross

* Debug paths

* Rasbian

* Android / install arm64

* fix pathing issues apothecary from calling exeternal / gstreamer

* android test configure off and use toolchain

* gstreamer

* gstreamer + meson cross compiler

* gstreamer 1.24.0

* zlib

* gstreamer cross location

* meson

* gstreamer

* meson toolchains

* meson toolchain single line

* Android Toolchain

* Android configure

* Android Configure

* directory script fix test

* Toolchain android

* Android toolchain

* meson update to latest

* Android toolchain and gstreamer build

* Android test no x86. FreeType Linux, GStreamer linking to freetype (it would not link to installed)

* freetype fix

* Android configure fix

* freetype linux

* freetype linux

* freetype

* freetype

* freetype

* freetype pkgconfig

* freetype 2

* Perhaps you should add the directory containing `freetype.pc'

* gstreamer

* split scripts for raspios

* os type update

* Freetype

* Android toolchain

* Android debug and rap changes

* debug paths android toolchain

* Linux arm64 cross. rpi

* gstreamer

* android ls for toolchain

* Invite some ninjas

* Android Toolchain with API postfix before clang in new NDKs

* Android Toolchain linker and armv7a clang

* Android - arm64 CMAKE_ANDROID_ARM_NEON is set but is valid only for 'armeabi-v7a' fix

* Android Toolchain Fixes

* Android API variable

* Android Toolchain fixes. armv7a - floating to softp

* Android Add explicit target on C/C++

* Android LibXML2

* Android LibXML2

* Android SVGTiny. zlib pkg. EMSDK to 4.0.1

* Android SVGTiny

* Apothecary fixes

* Linux print

* SVGTiny apply patch

* tess2 android

* Tess2. Github Summary

* Tess2

* Fix workflow

* gstreamer

* gstreamer

* meson native

* menson 1 line

* Menson ini

* menson add -lm

* gstreamer

* arm64 linux

* sources in ubuntu new locations

* sources

* Fix cross compling Linux arm64 due to bloody apt sources arch issues

* Linux fixes

* Andorid tess2 and linux arm64 install

* Tess2 / arm64 setup

* Linux fixes

* Linux arm64 install minimse. and android fmt fix

* linux fix

* Android Pugixml

* linux arm64 install fix

* Pugi fix android

* native install

* uriparser Android

* Andrioid uriparser

* Update Github Summary.
Secure script fix awk to just cut (arm64 package issues from depend setup for architecture on amd64)
LibPNG Android

* LibPNG Android copy fix
Summary table fix

* linux arm64

* gawk fix amd64 linux

* Android brotli and freetype

* arm64

* install

* gawk fix

* gawk fix

* Android freetype. awk

* Android FreeImage

* awk

* FreeImage Android copy

* Android freetype copy fix. gawk url fix

* Raspberry Pi native arm64. Setup like arm64 Linux. Fix action. Android logs supressed

* Android Assimp / rpi fix action

* gawk - awk just change to cut and allow gawk on cross compiler to work

* Android fix assimp

* Rpi

* linux actions fix for gawk nightmare

* gawk makes no sense

* Android x86, json download for xz for arm64

* apt update android

* fix json xz

* x86 toolchain

* sudo mark hold

* package managers cant handle multi arch

* zlib / assimp

* cross build

* setup

* Assimp [5.3.1 -> 5.4.3] - Fixes for android

* utf8 [4.0.5 ~ 4.0.6 ] - and tar.gz download for linux

* zlib build id

* utf8 fix download

* all actions

* json fix download linux

* assimp downloader

* osx install

* OpenSSL fix and Android remove x86

* openssl sha fix

* libxml2 entropy off for macOS

* tess2 mys2.
Emsripten 4.0.1 -> 4.0.2 and fix actions upload env vars

* tess2 msys2
  • Loading branch information
danoli3 authored Feb 5, 2025
1 parent 6b3dcb9 commit 7e436a1
Show file tree
Hide file tree
Showing 60 changed files with 1,617 additions and 1,326 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: true
DISABLE_WORKFLOW: "true"
DISABLE_WORKFLOW: "false"

jobs:
pre-check:
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ARCH: [armv7, arm64, x86, x86_64]
ARCH: [armv7, arm64, x86_64]
SDK: ["35.0.0"]
NDK: ["27.2.12479018"] #"26.3.11579264",
env:
Expand Down Expand Up @@ -74,6 +74,12 @@ jobs:
NDK: ${{ matrix.NDK }}
- name: List output directory
run: ls -lah out/

- name: Generate Summary
run: |
chmod +x ./scripts/summary.sh
./scripts/summary.sh
- name: Package
if: (github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding'))
working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-catos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: true
DISABLE_WORKFLOW: "true"
DISABLE_WORKFLOW: "false"

jobs:
pre-check:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ concurrency:

env:
TARGET: "emscripten"
EMSDK_VERSION: "4.0.0"
USE_ARTIFACT: false
EMSDK_VERSION: "4.0.2"
USE_ARTIFACT: true
PTHREADS_ENABLED: 1
DISABLE_WORKFLOW: "false"

Expand All @@ -42,12 +42,14 @@ jobs:
strategy:
matrix:
ARCH: [32, 64]
env:
ARCH: ${{matrix.cfg.ARCH}}
steps:
- uses: actions/[email protected]
- name: Docker Step
run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:${{ env.EMSDK_VERSION }} bash
- name: Setup Environment
run: |
echo "Setting up environment for Emscripten ${{ matrix.ARCH }} "
echo "ARCH=${{ matrix.ARCH }}" >> $GITHUB_ENV
- name: Scripts Calc Formula
run: ./scripts/calculate_formulas.sh
- name: Scripts Install
Expand Down Expand Up @@ -152,16 +154,15 @@ jobs:
run: ./scripts/build.sh
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
ARCH: ${{ matrix.ARCH }}
ARCH: ${{ env.ARCH }}

- name: Package Binaries for Artifact
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') && env.USE_ARTIFACT == 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
scripts/artifact/artifact.sh
env:
BUNDLE: ${{ matrix.bundle }}
ARCH: ${{ matrix.ARCH }}
ARCH: ${{ env.ARCH }}

- name: Upload Artifact
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') && env.USE_ARTIFACT == 'true'
Expand All @@ -186,7 +187,7 @@ jobs:
scripts/package.sh
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
ARCH: ${{ matrix.ARCH }}
ARCH: ${{ env.ARCH }}

- name: List output directory final
run: ls -lah out/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-linux-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: false
DISABLE_WORKFLOW: "true"
DISABLE_WORKFLOW: "false"

jobs:
pre-check:
Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
run: ./scripts/calculate_formulas.sh

- name: Scripts Setup
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/setup.sh
run: sudo ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/setup.sh

- name: Scripts Install
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/install.sh
run: sudo ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/install.sh

- name: BuildLinux64
working-directory: ${{env.GITHUB_WORKSPACE}}
Expand Down
161 changes: 74 additions & 87 deletions .github/workflows/build-linux-rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,96 +44,83 @@ jobs:
echo "::set-output name=RELEASE=latest"
fi
build-linux-aarch64:
if: needs.pre-check.outputs.workflow_disabled != 'true'
needs: pre-check
runs-on: ubuntu-latest

strategy:
matrix:
CROSS_CPU: [cortex-a53, cortex-a72, cortex-a76]
CROSS_OS: [bookworm]
ARCH: [aarch64, armv8]
exclude:
- ARCH: armv8
CROSS_CPU: cortex-a72 # Example exclusion, customize as needed
build-linux-aarch64:
if: needs.pre-check.outputs.workflow_disabled != 'true'
needs: pre-check
runs-on: ubuntu-latest
strategy:
matrix:
CROSS_CPU: [cortex-a53] #cortex-a72, cortex-a76
CROSS_OS: [bookworm]
ARCH: [aarch64]

env:
CROSS_COMPILER: raspbian
CROSS_OS: ${{ matrix.CROSS_OS }}
ARCH: ${{ matrix.ARCH }}
WORKDIR: "/home/runner/work/apothecary/apothecary"
SYSROOT: "${WORKDIR}/${{ matrix.CROSS_OS }}_sysroot"
TOOLCHAIN_ROOT: "${WORKDIR}/${CROSS_COMPILER}"
env:
CROSS_COMPILER: raspbian
WORKDIR: "/home/runner/work/apothecary/apothecary"
SYSROOT: "${WORKDIR}/${{ matrix.CROSS_OS }}_sysroot"
TOOLCHAIN_ROOT: "${WORKDIR}/${CROSS_COMPILER}"

steps:
- uses: actions/[email protected]
steps:
- uses: actions/[email protected]

- name: Setup Environment
run: |
echo "Setting up environment for ${CROSS_OS} ${ARCH}"
echo "CROSS_CPU: ${matrix.CROSS_CPU}"
echo "SYSROOT: ${SYSROOT}"
echo "TOOLCHAIN_ROOT: ${TOOLCHAIN_ROOT}"
- name: Setup Environment
run: |
echo "Setting up environment for ${{ matrix.CROSS_OS }} ${{ matrix.CROSS_CPU }} ${ARCH}"
echo "CROSS_CPU: ${{ matrix.CROSS_CPU }}"
echo "SYSROOT: ${SYSROOT}"
echo "TOOLCHAIN_ROOT: ${TOOLCHAIN_ROOT}"
echo "CROSS_OS=${{ matrix.CROSS_OS }}" >> $GITHUB_ENV
echo "ARCH=${{ matrix.ARCH }}" >> $GITHUB_ENV
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
- name: Update and Upgrade System Packages
run: |
sudo apt update && sudo apt dist-upgrade -y
sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
- name: Update and Upgrade System Packages
run: |
sudo apt update && sudo apt dist-upgrade -y
sudo apt-get install -y build-essential gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
- name: Setup Cross Compiler and Target Local File System
run: ./scripts/${{ env.TARGET }}/${{ matrix.arch }}/setup.sh
env:
CROSS_CPU: ${{ matrix.cross_cpu }}
CROSS_OS: ${{ matrix.cross_os }}
- name: Script Install
run: ./scripts/${{ env.TARGET }}/raspios/install.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ matrix.arch }}/install.sh
env:
CROSS_CPU: ${{ matrix.cross_cpu }}
CROSS_OS: ${{ matrix.cross_os }}
- name: Setup Cross Compiler and Target Local File System
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/setup.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ matrix.arch }}/build.sh
env:
CROSS_CPU: ${{ matrix.cross_cpu }}
CROSS_OS: ${{ matrix.cross_os }}
- name: Build
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/build.sh

- name: Package
#if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/package.sh
env:
BUNDLE: ${{ matrix.bundle }}
GCC: "_${{ matrix.cross_cpu }}_${{ matrix.cross_os }}"
- name: Package
#if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/package.sh
env:
BUNDLE: ${{ matrix.bundle }}
GCC: "_${{ matrix.CROSS_CPU }}_${{ matrix.CROSS_OS }}"

- name: List output directory
run: ls -lah out/
- name: List output directory
run: ls -lah out/

- name: Update Release
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: softprops/[email protected]
env:
GCC: "_${{ matrix.cross_cpu }}_${{ matrix.cross_os }}"
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
draft: false
files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_{{ env.GCC }}.tar.bz2
- name: Update Release
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: softprops/[email protected]
env:
GCC: "_${{ matrix.CROSS_CPU }}_${{ matrix.CROSS_OS }}"
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
draft: false
files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_{{ env.GCC }}.tar.bz2

build-linux-armv6l-pi-1zero:
if: needs.pre-check.outputs.workflow_disabled != 'true'
Expand Down Expand Up @@ -167,16 +154,16 @@ build-linux-aarch64:
- name: Update and Upgrade System Packages
run: |
sudo apt update && sudo apt dist-upgrade -y
sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
sudo apt-get install -y build-essential gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
- name: Setup Cross Compiler and Target Local File System
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/setup.sh
run: ./scripts/${{ env.TARGET }}/raspios/setup.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/install.sh
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/install.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/build.sh
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/build.sh

- name: Update Release armv6l
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
Expand Down Expand Up @@ -226,7 +213,7 @@ build-linux-aarch64:
- name: Update and Upgrade System Packages
run: |
sudo apt update && sudo apt dist-upgrade -y
sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
sudo apt-get install -y build-essential gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils
# - name: Cache raspbian folder
# uses: actions/[email protected]
Expand All @@ -245,13 +232,13 @@ build-linux-aarch64:
# fi

- name: Setup Cross Compiler and Target Local File System
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/setup.sh
run: ./scripts/${{ env.TARGET }}/raspios/setup.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/install.sh
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/install.sh

- name: Script Install and Build
run: ./scripts/${{ env.TARGET }}/${{ env.ARCH }}/build.sh
run: ./scripts/${{ env.TARGET }}/raspios/${{ env.ARCH }}/build.sh

- name: Update Release armv7l
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-linux64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ jobs:
- name: List packaged file
run: find out/ -type f \( -name "*.zip" -o -name "*.tar.bz2" \) -exec echo {} \;

- name: Generate Summary
run: |
chmod +x ./scripts/summary.sh
./scripts/summary.sh
# - name: Package
# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
# working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-watchos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: true
DISABLE_WORKFLOW: "true"
DISABLE_WORKFLOW: "false"

jobs:
pre-check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-xros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NO_FORCE: 1
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
USE_ARTIFACT: true
DISABLE_WORKFLOW: "true"
DISABLE_WORKFLOW: "false"

jobs:
pre-check:
Expand Down
Loading

0 comments on commit 7e436a1

Please sign in to comment.