Skip to content

Commit

Permalink
libunistring: update 1.2 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Sep 4, 2024
1 parent 764e8bc commit 995ccc8
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Formula/lib/libunistring.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class Libunistring < Formula
desc "C string library for manipulating Unicode strings"
homepage "https://www.gnu.org/software/libunistring/"
url "https://ftp.gnu.org/gnu/libunistring/libunistring-1.2.tar.gz"
mirror "https://ftpmirror.gnu.org/libunistring/libunistring-1.2.tar.gz"
mirror "http://ftp.gnu.org/gnu/libunistring/libunistring-1.2.tar.gz"
sha256 "fd6d5662fa706487c48349a758b57bc149ce94ec6c30624ec9fdc473ceabbc8e"
license any_of: ["GPL-2.0-only", "LGPL-3.0-or-later"]

bottle do
root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/libunistring-1.2"
sha256 cellar: :any_skip_relocation, aarch64_linux: "271b35c0744b9cb30c0c24074b37bbf541d9e88286dd31853d8653becb6cdea7"
end

def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "check" if !OS.mac? || MacOS.version < :sonoma
system "make", "install"
end

test do
(testpath/"test.c").write <<~EOS
#include <uniname.h>
#include <unistdio.h>
#include <unistr.h>
#include <stdlib.h>
int main (void) {
uint32_t s[2] = {};
uint8_t buff[12] = {};
if (u32_uctomb (s, unicode_name_character ("BEER MUG"), sizeof s) != 1) abort();
if (u8_sprintf (buff, "%llU", s) != 4) abort();
printf ("%s\\n", buff);
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lunistring",
"-o", "test"
assert_equal "🍺", shell_output("./test").chomp
end
end

0 comments on commit 995ccc8

Please sign in to comment.