Skip to content

Why ofLibs? #4

@dimitre

Description

@dimitre

The idea behind ofLibs is:
Decreasing libs building process complexity

so it is easier for new maintainers to read and understand and work / update libraries projects.
The more structured (and regular) everything is, the easier is to add new libraries and platforms.
work gets easier over time because solutions are more global.
ofLibs is based on Chalet capabilities, and projects for each lib are in Yaml format.
Chalet takes care of the repetitive work : Cloning the right tag or commit, compiling with cmake and getting the output and bundling them in a .zip file, so all this work is solved and we can focus only on libs.

Principles

Each library has its own runners without dependencies so any change will be reflected on a new download in a few minutes.
macOS Desktop use simple fat libs (universal, aarch64 + x86_64)
Priorities: CMAKE used whenever possible. Cmake has the ability of generating fat libs easily.
Using CMAKE default parameters whenever possible, example: BUILD_SHARED_LIBS=OFF will work for most of the libraries. Some will have some custom parameter like ZLIB_BUILD_SHARED=OFF.
Meson as second build choice.
Avoid code duplication: Chalet does not allow repeating CMAKE entries, so all global entries for all platforms are first, then exceptions are used only when needed. This keeps libs with the desired capabilities for all platforms and exceptions on demand (like ARM Neon intrinsics)
No patches applied on files, using a fork whenever a patch is needed.
Using CMAKE install so files are in correct folders for all platforms, no need of additional scripts to put files in place.
It uses .zip files for all platforms.
It uses gh command to publish .zip to release, so no additional external github action to publish to release.
no branches used, only a simple tag for each release like 0.12.1

Challenges

There are some hard to build libraries like Cairo. it is a little bit harder to make a fat lib using meson.
and when we want an universal library it means we can't count on having dependencies from homebrew, we have to build the minimum dependencies (universal) like pixman / libpng

Collaboration

Chalet project is helping a lot in the meantime, it is a hard task to get everything right
some discussion here: chalet-org/chalet#231
it added support for Cmake install, meson projects and it plans to add .xcframeworks capabilities
chalet-org/chalet#397

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions