homebrew-core/Formula/groonga.rb

103 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-12.0.5.tar.gz"
sha256 "abf1bdbf4b7ae1700f7725ea8d8139844fadb473457d7d907a8ebe94fdd5e451"
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: "69c3156dd8ac65530a24209b1a6c5075da5966f0224dbf0fad60a26f927ff53a"
sha256 arm64_big_sur: "3d6068d6652395fc0c704682cdb937ebe4c40a04e5fcd5d80846049a8ef0ebd6"
sha256 monterey: "9495982a54ac203d8af6e8aa980f91410dce31706afd8dcb6b403602c342cfab"
sha256 big_sur: "9375c0d5dbaa0bda0c2d0319313a0a13d5ebb044e10c4b98677af5c8f1cfc12e"
sha256 catalina: "38a8a3d502d8163f50632346ea1ef13cdc8ca73646ef3544f4c19167b26fd559"
sha256 x86_64_linux: "eb6001817f7ce66568faa473b58de6fcd91c5684e52dac2d7674d44a1f86b234"
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"
uses_from_macos "libxcrypt"
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