From 39bdad2812a0cebeae154ba430d87fa1c65e29fa Mon Sep 17 00:00:00 2001 From: "fennoai[bot]" <231223108+fennoai[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 11:28:36 +0000 Subject: [PATCH] feat(JuliaStrings/utf8proc): add utf8proc v2.9.0 LLAR formula Translate the Conan Center utf8proc recipe (snapshot ffe30df101afd4dc95aac2f14b25bf345e64d7be, version 2.9.0) into an idiomatic LLAR Formula for JuliaStrings/utf8proc. - versions.json: no dependencies (utf8proc is a self-contained C library; upstream v2.9.0 declares no third-party requirements). - Utf8proc_cmp.gox: semver comparator for the leading-"v" release tags. - v2.9.0/Utf8proc_llar.gox: - onBuild uses the CMake helper to build the static archive (the upstream and Conan default), pinning CMAKE_POLICY_VERSION_MINIMUM=3.5 and CMAKE_POLICY_DEFAULT_CMP0042=NEW as the recipe does for pre-2.10.0, with fPIC on to match Conan's default and testing off to stay hermetic. - Metadata is derived from the installed libutf8proc.pc via pkg-config, plus -DUTF8PROC_STATIC to mirror the Conan static package_info branch. - onTest compiles and runs a consumer modelled on the Conan test_package (utf8proc_version / utf8proc_unicode_version) in a build tree independent of the onBuild scratch dir, so it also passes on a cache hit. fromVer is pinned to v2.9.0: the earlier recipe versions (e.g. v2.5.0) use a different CMake floor and do not install a pkg-config file, so their build contract is not verified here. Add a lower threshold once those are checked. Verified with `llar test` (cache-miss and cache-hit) and `llar make --json` on linux/amd64: static lib, header, and libutf8proc.pc install; the consumer prints utf8proc 2.9.0 / Unicode 15.1.0. Co-authored-by: fennoai[bot] <231223108+fennoai[bot]@users.noreply.github.com> Co-authored-by: MeteorsLiu <17515813+MeteorsLiu@users.noreply.github.com> --- JuliaStrings/utf8proc/Utf8proc_cmp.gox | 5 ++ .../utf8proc/v2.9.0/Utf8proc_llar.gox | 84 +++++++++++++++++++ JuliaStrings/utf8proc/versions.json | 4 + 3 files changed, 93 insertions(+) create mode 100644 JuliaStrings/utf8proc/Utf8proc_cmp.gox create mode 100644 JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox create mode 100644 JuliaStrings/utf8proc/versions.json diff --git a/JuliaStrings/utf8proc/Utf8proc_cmp.gox b/JuliaStrings/utf8proc/Utf8proc_cmp.gox new file mode 100644 index 0000000..0d30580 --- /dev/null +++ b/JuliaStrings/utf8proc/Utf8proc_cmp.gox @@ -0,0 +1,5 @@ +compareVer (a, b) => { + // utf8proc tags releases as semver with a leading "v" (e.g. v2.9.0), + // so compare with semver semantics rather than dpkg ordering. + return semver.compare(a.Version, b.Version) +} diff --git a/JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox b/JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox new file mode 100644 index 0000000..4bad0a3 --- /dev/null +++ b/JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox @@ -0,0 +1,84 @@ +import "os" +import "strings" + +id "JuliaStrings/utf8proc" + +fromVer "v2.9.0" + +onBuild ctx => { + installDir := ctx.outputDir + + c := cmake.new(ctx.SourceDir, ctx.SourceDir+"/_build", installDir) + c.buildType "Release" + // utf8proc v2.9.0 declares cmake_minimum_required(VERSION 3.0.0); the Conan + // recipe injects the same policy floor for pre-2.10.0 releases so the + // project keeps configuring under CMake 4. + c.define "CMAKE_POLICY_VERSION_MINIMUM", "3.5" + c.define "CMAKE_POLICY_DEFAULT_CMP0042", "NEW" + // Build the static archive that is both the upstream and Conan default. + // utf8proc adds the UTF8PROC_STATIC compile definition itself in this mode. + c.defineBool "BUILD_SHARED_LIBS", false + // Match Conan's default fPIC=True so the static archive can still be linked + // into shared consumers. + c.defineBool "CMAKE_POSITION_INDEPENDENT_CODE", true + // utf8proc's own test/fuzz targets download Unicode data; keep them off + // (already the upstream default) so the build stays hermetic. + c.defineBool "UTF8PROC_ENABLE_TESTING", false + + c.configure + c.build + c.install + + // Derive the consumer interface from the pkg-config file utf8proc installs + // (libutf8proc.pc) rather than guessing flags. + c.use installDir + capout => { + exec "pkg-config", "--libs", "--cflags", "libutf8proc" + } + meta := strings.trimSpace(output) + // A consumer of the static build must define UTF8PROC_STATIC so the header + // does not mark symbols dllimport on Windows; harmless elsewhere. Mirrors + // the Conan package_info static branch. + meta = strings.trimSpace(meta + " -DUTF8PROC_STATIC") + ctx.setMetadata meta +} + +onTest ctx => { + installDir := ctx.outputDir + + // Build the consumer in a tree independent of the onBuild scratch dir so + // onTest behaves identically on a cache hit (where _build does not exist). + testDir := ctx.SourceDir + "/_llartest" + os.removeAll(testDir) + os.mkdirAll(testDir, 0o755)! + + // Consumer modelled on the Conan test_package: print the library and + // Unicode versions through the installed public headers/library. + src := testDir + "/consumer.c" + os.writeFile(src, []byte(`#include +#include "utf8proc.h" + +int main(void) { + printf("utf8proc version: %s\n", utf8proc_version()); + printf("Unicode version: %s\n", utf8proc_unicode_version()); + return 0; +} +`), 0o644)! + + bin := testDir + "/consumer" + // Compile and link against the installed artifact using its own pkg-config + // entry so include/lib paths and flags come from the real installation. + // Paths are single-quoted because a matrix suffix can contain a "|". + build := "cc '" + src + "' -o '" + bin + "'" + + " -I'" + installDir + "/include' -DUTF8PROC_STATIC" + + " $(PKG_CONFIG_PATH='" + installDir + "/lib/pkgconfig' pkg-config --cflags --libs libutf8proc)" + exec "sh", "-c", build + if lastErr != nil { + panic lastErr + } + + exec "sh", "-c", "'" + bin + "'" + if lastErr != nil { + panic lastErr + } +} diff --git a/JuliaStrings/utf8proc/versions.json b/JuliaStrings/utf8proc/versions.json new file mode 100644 index 0000000..a89cf50 --- /dev/null +++ b/JuliaStrings/utf8proc/versions.json @@ -0,0 +1,4 @@ +{ + "path": "JuliaStrings/utf8proc", + "deps": {} +}