Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Formula/o/opencc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Opencc < Formula
desc "Simplified-traditional Chinese conversion tool"
homepage "https://opencc.byvoid.com/"
Expand Down Expand Up @@ -25,6 +25,7 @@
-DCMAKE_INSTALL_RPATH=#{rpath}
-DPYTHON_EXECUTABLE=#{which("python3")}
-DUSE_SYSTEM_MARISA=ON
-DBUILD_OPENCC_JIEBA_PLUGIN=ON
Comment thread
SMillerDev marked this conversation as resolved.
]

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
Expand All @@ -37,5 +38,11 @@
output = pipe_output(bin/"opencc", input)
output = output.force_encoding("UTF-8") if output.respond_to?(:force_encoding)
assert_match "中國鼠標軟件打印機", output

assert_path_exists lib/"opencc/plugins"/shared_library("libopencc-jieba")
input = "城堡里的士兵"
output = pipe_output("#{bin}/opencc -c s2twp_jieba.json", input)
output = output.force_encoding("UTF-8") if output.respond_to?(:force_encoding)
assert_match "城堡裡的士兵", output
end
end
Loading