-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196833 from Freed-Wu/librime
librime 1.12.0 (new formula)
- Loading branch information
Showing
3 changed files
with
145 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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,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 |
This file contains 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,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 |
This file contains 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