-
Notifications
You must be signed in to change notification settings - Fork 2
feat(JuliaStrings/utf8proc): add utf8proc v2.9.0 LLAR formula #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fennoai
wants to merge
1
commit into
main
Choose a base branch
from
fennoai/issue-22-1785407797
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <stdio.h> | ||
| #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 | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "path": "JuliaStrings/utf8proc", | ||
| "deps": {} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
lastErrcheck before readingoutput. After acapoutblock, the reference convention requires validating the command result (if lastErr != nil { panic lastErr }) before consumingoutput— theonTestsections below do exactly this, and so does the reference's complete example.Here, if
pkg-configfails (missing.pc, wrong name, or not installed), the hook does not error:outputis empty/stale, so metadata is silently set to just-DUTF8PROC_STATIC, producing an install with broken consumer link/compile flags instead of a clear build failure.