The specification and common information for these CI repositories
Find a file
crueter db7b59b458
ksdnkmf
Signed-off-by: crueter <crueter@eden-emu.dev>
2025-12-03 02:08:30 -05:00
README.md ksdnkmf 2025-12-03 02:08:30 -05:00

crueter-ci spec

This repository outlines the specifications and common information for CI repositories in this organization.

What?

These CI repositories provide prebuilt, preconfigured binaries and header files for common libraries. The purpose of this is primarily to reduce build time on projects, as they can use prebuilt packages rather than building it every single time.

Platforms

Every build should support:

  • FreeBSD, OpenBSD, illumos (amd64)
  • Linux (aarch64, amd64)
  • Windows MSVC (aarch64, amd64)
  • Windows MinGW (aarch64, amd64)
  • Android (aarch64, x86_64)

Some projects may not support specific platforms. See their READMEs for more.

Usage

Supported platforms:

  • FreeBSD, OpenBSD, illumos (amd64)
  • Linux (aarch64, amd64)
  • Windows MSVC (aarch64, amd64)
  • Windows MinGW (aarch64, amd64)
  • Android (aarch64, x86_64)

You can add the packages through FetchContent:

if (ANDROID)
    FetchContent_Declare(
      FFmpeg
      DOWNLOAD_EXTRACT_TIMESTAMP true
      URL https://github.com/crueter-ci/FFmpeg/releases/download/v8.0-ddf443f1e9/ffmpeg-android-aarch64-8.0-ddf443f1e9.tar.zst
    )
    FetchContent_MakeAvailable(FFmpeg)
endif()

...CPM:

if (MSVC)
  CPMAddPackage(
    NAME FFmpeg
    URL https://github.com/crueter-ci/FFmpeg/releases/download/v8.0/ffmpeg-windows-8.0.tar.zst
  )
endif()

...or CPMUtil for full platform management:

cpmfile.json:

{
    "ffmpeg-ci": {
        "ci": true,
        "package": "FFmpeg",
        "name": "ffmpeg",
        "repo": "crueter-ci/FFmpeg",
        "version": "8.0-ddf443f1e9",
        "min_version": "4.1"
    }
}
include(CPMUtil)
AddJsonPackage(ffmpeg-ci)

Downloads containing the file's sums are included in each release and can be fetched programmatically (CPMUtil does this for you). You can choose between static or shared linking via BUILD_SHARED_LIBS, but static linking is always recommended. Some projects (notably FFmpeg) do not support shared libraries.

Building

Everything is handled by the common build script, tools/build.sh. A POSIX-like environment is required. Input environment variables:

  • ARCH: arch to build for (default universal on macOS, amd64 on other desktops, aarch64 on Android)
    • Android uses x86_64 instead of amd64
    • Windows and MinGW use arm64 instead of aarch64
    • macOS always builds universal binaries
  • PLATFORM: platform to build for. One of:
    • linux
    • solaris
    • openbsd
    • freebsd
    • mingw
    • windows
    • android
    • macos
  • MACOSX_DEPLOYMENT_TARGET (macOS only, default 11): minimum MacOS version to target
  • ANDROID_NDK_ROOT (required on Android): path to an installed Android NDK
  • ANDROID_API (Android only, default 23): minimum Android SDK to target

Outputs (libraries, headers, etc.) are in out. zstd-compressed tarball artifact and sum files are in artifacts.

e.g:

Android:

export ANDROID_NDK_ROOT=/data/Android/Sdk/ndk/28.2.13676358
PLATFORM=android ARCH=x86_64 ANDROID_API=16 ./tools/build.sh

OpenBSD:

PLATFORM=openbsd ARCH=amd64 ./tools/build.sh

The "spec"

Artifact names must follow the format:

<projectname>-<platform>-<arch>-<version>

From there, each artifact must be in a tarball (preferably zstd), and must provide sha1, sha256, and sha512 sums. The arch must be one of:

  • x86_64 for Android x86_64
  • amd64 for desktop x86_64/amd64
  • aarch64 for Android arm64-v8a and ARM UNIXes (Linux, *BSD, etc)
  • arm64 for MinGW/Windows on ARM
  • riscv64 for riscv64
  • ppc64 for PowerPC64 (little-endian only)
  • universal for macOS

Other architectures are entirely unsupported, namely mips64 (RIP), ppc64be (big-endian), s390x, and ALL 32-bit arches.