Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

pgroonga 0.6.0 (new formula) #41174

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions Library/Formula/pgroonga.rb
@@ -0,0 +1,27 @@
class Pgroonga < Formula
desc "An extension for PostgreSQL to use Groonga as an index."
homepage "https://pgroonga.github.io/"
url "http://packages.groonga.org/source/pgroonga/pgroonga-0.6.0.tar.gz"
sha256 "29a631f68013bba19321beac0d7b933eafce60aec1597aa8fff0b0898ff2a73d"

depends_on "pkg-config" => :build
depends_on "postgresql"
depends_on "groonga"

def pour_bottle?
# Postgres extensions must live in the Postgres prefix, which precludes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, Pgroonga should be put as a optional resource of Postgres rather than a standalone formula.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. We should also do that with postgis too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, Pgroonga should be put as a optional resource of Postgres rather than a standalone formula

👍 For me.

# bottling: https://github.com/Homebrew/homebrew/issues/10247
# Overcoming this will likely require changes in Postgres itself.
false
end

def install
system "make"
system "make", "install"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a prefix specified somehow/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PGroonga intends to install ${prefix}/Cellar/postgresql/9.4.4{/lib/pgroonga.so, /share/postgresql/extension/pgroonga--<version>.sql}.
PGroonga's makefile dose not provide choice installation directory.
"No choice installation directory" is an big issue to Homebrew Formula?
If so, I will discuss about it at upstream.

end

test do
postgres_realpath = Formula["postgresql"].opt_prefix.realpath
File.exist?("#{postgres_realpath}/share/postgresql/extension/pgroonga--#{version}.sql")
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a test be added to do something more substantial than e.g. --version or --help? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm..., it's a bit difficult to test.
PGroonga consists shared object and sql file, not executables. It does not have entry point.
And now, PGroonga project does not have executable example, though.