101 lines
3.1 KiB
Ruby
101 lines
3.1 KiB
Ruby
class Groonga < Formula
|
|
desc "Fulltext search engine and column store"
|
|
homepage "https://groonga.org/"
|
|
url "https://packages.groonga.org/source/groonga/groonga-11.1.1.tar.gz"
|
|
sha256 "f1633b31e9ba74ee7879e2e57ba15cb9c0c26dd5430d3748cec22a7bb1669c0d"
|
|
license "LGPL-2.1-or-later"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(%r{>v?(\d+(?:\.\d+)+)</a> is the latest release}i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "30fff482fbb597ed6262161b37aa050889f9dcbf912470f333a76c1d045e2f16"
|
|
sha256 arm64_big_sur: "bff4d5c7ae73ecfd81a8a153093913625b46d87eaf16fa5cd66e4611edb4a884"
|
|
sha256 monterey: "31ad9897566ae592969e67e6daf7c2dba40592f227947864a3d48aa56f29324a"
|
|
sha256 big_sur: "0469dabc492facafbb692a9d48c5854a88218ce0ffb0c00075d34c4d3f6f0b98"
|
|
sha256 catalina: "a7e41dabd198d29e178dedd2c26627a9f886d04576545c2b55ba4d78753bb095"
|
|
sha256 x86_64_linux: "bb29067b827a62643c7287ee1431744591786b0900ae488d1c3da41641bececf"
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/groonga/groonga.git", branch: "master"
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "mecab"
|
|
depends_on "mecab-ipadic"
|
|
depends_on "msgpack"
|
|
depends_on "openssl@1.1"
|
|
depends_on "pcre"
|
|
|
|
on_linux do
|
|
depends_on "glib"
|
|
end
|
|
|
|
link_overwrite "lib/groonga/plugins/normalizers/"
|
|
link_overwrite "share/doc/groonga-normalizer-mysql/"
|
|
link_overwrite "lib/pkgconfig/groonga-normalizer-mysql.pc"
|
|
|
|
resource "groonga-normalizer-mysql" do
|
|
url "https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.1.8.tar.gz"
|
|
sha256 "0ed23e0c0b4d4dca23c57bbd98fe3d051c3f3ddacbbe55d07fddb6c53142cae5"
|
|
end
|
|
|
|
def install
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-zeromq
|
|
--disable-apache-arrow
|
|
--enable-mruby
|
|
--with-luajit=no
|
|
--with-ssl
|
|
--with-zlib
|
|
--without-libstemmer
|
|
--with-mecab
|
|
]
|
|
|
|
if build.head?
|
|
args << "--with-ruby"
|
|
system "./autogen.sh"
|
|
end
|
|
|
|
mkdir "builddir" do
|
|
system "../configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
resource("groonga-normalizer-mysql").stage do
|
|
ENV.prepend_path "PATH", bin
|
|
ENV.prepend_path "PKG_CONFIG_PATH", lib/"pkgconfig"
|
|
system "./configure", "--prefix=#{prefix}"
|
|
system "make"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
test do
|
|
IO.popen("#{bin}/groonga -n #{testpath}/test.db", "r+") do |io|
|
|
io.puts("table_create --name TestTable --flags TABLE_HASH_KEY --key_type ShortText")
|
|
sleep 2
|
|
io.puts("shutdown")
|
|
# expected returned result is like this:
|
|
# [[0,1447502555.38667,0.000824928283691406],true]\n
|
|
assert_match(/\[\[0,\d+.\d+,\d+.\d+\],true\]/, io.read)
|
|
end
|
|
|
|
IO.popen("#{bin}/groonga -n #{testpath}/test-normalizer-mysql.db", "r+") do |io|
|
|
io.puts "register normalizers/mysql"
|
|
sleep 2
|
|
io.puts("shutdown")
|
|
# expected returned result is like this:
|
|
# [[0,1447502555.38667,0.000824928283691406],true]\n
|
|
assert_match(/\[\[0,\d+.\d+,\d+.\d+\],true\]/, io.read)
|
|
end
|
|
end
|
|
end
|