Skip to content

Commit

Permalink
libunicode 0.6.0 (new formula)
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Nov 24, 2024
1 parent 4acc8ba commit f476ac3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,7 @@ libtrace
libtrng
libucl
libunibreak
libunicode
libuninameslist
libunistring
libunwind
Expand Down
43 changes: 43 additions & 0 deletions Formula/lib/libunicode.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class Libunicode < Formula
desc "Modern C++20 Unicode library"
homepage "https://github.com/contour-terminal/libunicode"
url "https://github.com/contour-terminal/libunicode/archive/refs/tags/v0.6.0.tar.gz"
sha256 "0c217f8264000f1b8c36e78969cb9cf91ac97de937cc141ab78e6b1ad7f404ef"
license "Apache-2.0"

depends_on "cmake" => :build
uses_from_macos "python" => :build

def install

Check failure on line 11 in Formula/lib/libunicode.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle libunicode` failed on Linux!

[ 19%] Building CXX object src/libunicode/CMakeFiles/unicode_loader.dir/codepoint_properties_loader.cpp.o cd /tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/build/src/libunicode && /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/g++-11 -Dunicode_loader_EXPORTS -I/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/.. -O3 -DNDEBUG -std=c++20 -fPIC -fdiagnostics-color=always -Wall -Wextra -fdiagnostics-color=always -Wconversion -Wduplicate-enum -Wduplicated-cond -Wextra-semi -Wfinal-dtor-non-final-class -Wimplicit-fallthrough -Wlogical-op -Wmissing-declarations -Wnewline-eof -Wno-unknown-attributes -Wno-unknown-pragmas -Wnull-dereference -Wpessimizing-move -Wredundant-move -Wsign-conversion -Wsuggest-destructor-override -pedantic -MD -MT src/libunicode/CMakeFiles/unicode_loader.dir/codepoint_properties_loader.cpp.o -MF CMakeFiles/unicode_loader.dir/codepoint_properties_loader.cpp.o.d -o CMakeFiles/unicode_loader.dir/codepoint_properties_loader.cpp.o -c /tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/codepoint_properties_loader.cpp In file included from �[K/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/../libunicode/codepoint_properties.h:16�[m�[K, from �[K/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/../libunicode/codepoint_properties_loader.h:16�[m�[K, from �[K/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/codepoint_properties_loader.cpp:14�[m�[K: �[K/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/src/libunicode/../libunicode/emoji_segmenter.h:18:10:�[m�[K �[Kfatal error: �[m�[Kformat: No such file or directory 18 | #include �[K<format>�[m�[K | �[K^~~~~~~~�[m�[K compilation terminated. make[2]: *** [src/libunicode/CMakeFiles/unicode_loader.dir/build.make:82: src/libunicode/CMakeFiles/unicode_loader.dir/codepoint_properties_loader.cpp.o] Error 1 make[2]: Leaving directory '/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/build' make[1]: *** [CMakeFiles/Makefile2:172: src/libunicode/CMakeFiles/unicode_loader.dir/all] Error 2 make[1]: Leaving directory '/tmp/libunicode-20241124-4566-hxh2gd/libunicode-0.6.0/build' make: *** [Makefile:139: all] Error 2 ==> Formula Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/lib/libunicode.rb ==> Configuration HOMEBREW_VERSION: 4.4.6-45-g3b1d59d ORIGIN: https://github.com/Homebrew/brew HEAD: 3b1d59d8c4fbf8c0ba0c9752007ff27bec3bc8b3 Last commit: 30 hours ago Core tap HEAD: 8de7c5bf2b266bf2ff113e5830e6d2212ef07ca0 Core tap last commit: 6 minutes ago Core tap JSON: 24 Nov 01:23 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /github/home/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.6 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby CPU: quad-core 64-bit zen3 Clang: N/A Git: 2.47.0 => /usr/bin/git Curl: 7.81.0 => /usr/bin/curl Kernel: Linux 6.5.0-1025-azure x86_64 GNU/Linux OS: Ubuntu 22.04.5 LTS Host glibc: 2.35 /usr/bin/gcc: 11.4.0 /usr/bin/ruby: N/A glibc: N/A gcc@11: N/A gcc: N/A xorg: N/A ==> ENV HOMEBREW_CC: gcc-11 HOMEBREW_CXX: g++-11 MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git ACLOCAL_PATH: /home/linuxbrew/.linuxbrew/share/aclocal PATH: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super:/home/linuxbrew/.linuxbrew/opt/cmake/bin:/home/l

Check failure on line 11 in Formula/lib/libunicode.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew install --verbose --formula --build-bottle libunicode` failed on macOS Ventura (13) on Apple Silicon!

::error::libunicode 0.6.0 did not build

Check failure on line 11 in Formula/lib/libunicode.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

`brew install --verbose --formula --build-bottle libunicode` failed on macOS Ventura (13)!

::error::libunicode 0.6.0 did not build
args = %W[
-DLIBUNICODE_EXAMPLES=OFF
-DLIBUNICODE_TESTING=OFF
-DLIBUNICODE_BENCHMARK=OFF
-DCMAKE_INSTALL_RPATH=#{rpath}
]

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
(testpath/"test.cpp").write <<~CPP
#include <iostream>
#include <libunicode/capi.h>
int main() {
u32_char_t u32_codepoints[] = { 'h', 'e', 'l', 'l', 'o', ' ', 0x1F30D };
int gc_count = u32_gc_count(u32_codepoints, 7);
std::cout << "Grapheme cluster count: " << gc_count << "\\n";
return 0;
}
CPP

system ENV.cxx, "-std=c++17", "-o", "test", "test.cpp", "-I#{include}", "-L#{lib}", "-lunicode"
assert_match "Grapheme cluster count: 7", shell_output("./test")

assert_match "HYPHEN", shell_output("#{bin}/unicode-query U+2D")
end
end

0 comments on commit f476ac3

Please sign in to comment.