Skip to content

Commit

Permalink
Merge pull request #196833 from Freed-Wu/librime
Browse files Browse the repository at this point in the history
librime 1.12.0 (new formula)
  • Loading branch information
BrewTestBot authored Dec 12, 2024
2 parents 534a211 48311f1 commit adb52ee
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 8 deletions.
86 changes: 86 additions & 0 deletions Formula/lib/librime.rb
Original file line number Diff line number Diff line change
@@ -0,0 1,86 @@
class Librime < Formula
desc "Rime Input Method Engine"
homepage "https://rime.im"
url "https://github.com/rime/librime.git",
tag: "1.12.0",
revision: "c7ab6390c143a11d670f3add41218111edb883c9"
license "BSD-3-Clause"

bottle do
sha256 cellar: :any, arm64_sequoia: "2378396ddbb8116448a413ccb8b39a3a98b67e23b333da46283021973cd1b237"
sha256 cellar: :any, arm64_sonoma: "c41ebccc5cec494e2f1c17d2fd6f8aaec95554b729c486b255410608804e37ec"
sha256 cellar: :any, arm64_ventura: "2fe20c928c785db0c7482f8d839cd8f1a66ec313c3a3ea583e4d27660f41d4f4"
sha256 cellar: :any, sonoma: "99246c970a08bda99591bf4eb7183b524860f90bbc4fb5133d9cdc9448b3eb41"
sha256 cellar: :any, ventura: "5639cc7d83e4d3eb3e769b62d79fee7e82371878531789ef997a2c4130bc2cd6"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1841313382f3b0664ec5a59ef3a0094ba03059b43c0094b75298e587499a7806"
end

depends_on "boost" => :build
depends_on "cmake" => :build
depends_on "icu4c@76" => :build
depends_on "pkgconf" => :build

depends_on "capnp"
depends_on "gflags"
depends_on "glog"
depends_on "googletest"
depends_on "leveldb"
depends_on "lua"
depends_on "marisa"
depends_on "opencc"
depends_on "yaml-cpp"

on_linux do
depends_on "libunwind"
end

resource "lua" do
url "https://github.com/hchunhui/librime-lua.git",
revision: "b210d0cfbd2a3cc6edd4709dd0a92c479bfca10b"
end

resource "octagram" do
url "https://github.com/lotem/librime-octagram.git",
revision: "dfcc15115788c828d9dd7b4bff68067d3ce2ffb8"
end

resource "predict" do
url "https://github.com/rime/librime-predict.git",
revision: "920bd41ebf6f9bf6855d14fbe80212e54e749791"
end

resource "proto" do
url "https://github.com/lotem/librime-proto.git",
revision: "657a923cd4c333e681dc943e6894e6f6d42d25b4"
end

def install
resources.each do |r|
r.stage buildpath/"plugins"/r.name
end

args = %W[
-DBUILD_MERGED_PLUGINS=OFF
-DCMAKE_INSTALL_RPATH=#{rpath}
-DENABLE_EXTERNAL_PLUGINS=ON
]
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 "rime_api.h"
int main(void)
{
RIME_STRUCT(RimeTraits, rime_traits);
return 0;
}
CPP

system ENV.cc, "./test.cpp", "-o", "test"
system testpath/"test"
end
end
50 changes: 50 additions & 0 deletions Formula/m/marisa.rb
Original file line number Diff line number Diff line change
@@ -0,0 1,50 @@
class Marisa < Formula
desc "Matching Algorithm with Recursively Implemented StorAge"
homepage "https://github.com/s-yata/marisa-trie"
url "https://github.com/s-yata/marisa-trie/archive/refs/tags/v0.2.6.tar.gz"
sha256 "1063a27c789e75afa2ee6f1716cc6a5486631dcfcb7f4d56d6485d2462e566de"
license all_of: ["BSD-2-Clause", "LGPL-2.1-or-later"]

bottle do
sha256 cellar: :any, arm64_sequoia: "3e875c402f816ea59607b35dfaba1ca3556934b77f3adf9522a662b474a531de"
sha256 cellar: :any, arm64_sonoma: "71fa0487725231a5d3c5d53f7564279b4f40d684939392d90f2d446502304666"
sha256 cellar: :any, arm64_ventura: "96d9aac1c7bd7c4f0d927619215b2216791f83ed80693b86706e0077062dfe81"
sha256 cellar: :any, sonoma: "89899d1173f4dcacc825068599a458c818f42c9ff2c6ae9dccac56a0eec837e6"
sha256 cellar: :any, ventura: "fc0d60913ac0333a5dc9f977e77f466388b5484c8e77cf190e80c48b582f9deb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "45455df30c80232d1c7d16146b550fea52fbd71d0bc341bdbe3acae2038b4286"
end

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build

def install
system "autoreconf", "--force", "--install", "--verbose"
system "./configure", *std_configure_args
system "make"
system "make", "install"
end

test do
(testpath/"test.cc").write <<~CPP
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <string>
#include <iostream>
#include <vector>
#include <marisa.h>
int main(void)
{
int x = 100, y = 200;
marisa::swap(x, y);
std::cout << x << "," << y << std::endl;
}
CPP

system ENV.cxx, "./test.cc", "-o", "test"
assert_equal "200,100", shell_output("./test").strip
end
end
17 changes: 9 additions & 8 deletions Formula/o/opencc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 6,24 @@ class Opencc < Formula
license "Apache-2.0"

bottle do
sha256 arm64_sequoia: "a27e13aa2de9e5c4775f1618842f8a94ba0399462295427f1c01ecb0bad59e45"
sha256 arm64_sonoma: "40bbcc0ea4cceadf579f5bcefded29585f45a18e42bba6ee2a0f0f8b9093f30c"
sha256 arm64_ventura: "517a8dfe20b621aad9d4f8fd9118794b53318f07007ee1ec1fb7081065921184"
sha256 arm64_monterey: "addb0ef3712437c10de21dfe670291144d1fa36d6c2661016cfbdba0d6a0e9f1"
sha256 sonoma: "125d0aa542c79a1c64ff50d6bb65f37b8a1df08842d2aadea4de148ad4fd7834"
sha256 ventura: "a6da927e23614ddef3ff4199a162a5ddb81ad3d0414e3943adc1622d5a0eebed"
sha256 monterey: "86fab72d30ba153353798d51f6f1e0ef3136b9edd23d69497fb3b8303cebfb72"
sha256 x86_64_linux: "127925772f41d4145e6f4ee5f74f08cea701fdce389b743174b960dc1e80629d"
rebuild 1
sha256 arm64_sequoia: "8b6b0e9d88ffeecb82287510d3416101529d017851b0b537f9e6b541673bed66"
sha256 arm64_sonoma: "6f5005829e63d7db587d1018470b02707ce5e47a1f253543877f7285f5a0b3eb"
sha256 arm64_ventura: "2563f2f90b6080cee6831a5873833064f03f34fad8af3c127f16ffe08a4d4376"
sha256 sonoma: "c04a149eacdc804adb89854db53fae7634aa4af832537dbe5ed9d032760f7fee"
sha256 ventura: "8a29fb0a0fe27a67c687f7ce0577fd9b8e7d4dc0574dc45af0d8f1ad4be2db95"
sha256 x86_64_linux: "9b7d0f7d8b7113014476146573c883666708cceba92f389a1cb9e0c3225c6337"
end

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

def install
args = %W[
-DCMAKE_INSTALL_RPATH=#{rpath}
-DPYTHON_EXECUTABLE=#{which("python3")}
-DUSE_SYSTEM_MARISA=ON
]

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
Expand Down

0 comments on commit adb52ee

Please sign in to comment.