Navigation Menu

Skip to content

Commit

Permalink
Use "--use-xxx" options for using mysql or mariadb options
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Jun 28, 2015
1 parent 07c1a74 commit 7b37573
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions mroonga.rb
Expand Up @@ -7,27 +7,24 @@ class Mroonga < Formula
depends_on "pkg-config" => :build
depends_on "groonga-normalizer-mysql"

option "with-homebrew-mysql", "Use MySQL installed by Homebrew."
option "with-homebrew-mariadb", "Use MariaDB installed by Homebrew. You can't use this option with use-homebrew-mysql."
option "use-homebrew-mysql", "Use MySQL installed by Homebrew."
option "use-homebrew-mariadb", "Use MariaDB installed by Homebrew. You can't use this option with use-homebrew-mysql."
option "with-mecab", "Use MeCab installed by Homebrew. You can use additional tokenizer - TokenMecab. Note that you need to build Groonga with MeCab"
option "with-mysql-source=PATH", "MySQL source directory. You can't use this option with use-homebrew-mysql and use-homebrew-mariadb"
option "with-mysql-build=PATH", "MySQL build directory (default: guess from with-mysql-source)"
option "with-mysql-config=PATH", "mysql_config path (default: guess from with-mysql-source)"
option "with-debug[=full]", "Build with debug option"
option "with-default-parser=PARSER", "Specify the default fulltext parser like with-default-parser=TokenMecab (default: TokenBigram)"

deprecated_option "use-homebrew-mysql" => "with-homebrew-mysql"
deprecated_option "use-homebrew-mariadb" => "with-homebrew-mariadb"

if build.with?("mecab")
depends_on "groonga" => "--with-mecab"
else
depends_on "groonga"
end

if build.with?("homebrew-mysql")
if build.include?("use-homebrew-mysql")
depends_on "mysql"
elsif build.with?("homebrew-mariadb")
elsif build.include?("use-homebrew-mariadb")
depends_on "mariadb"
end

Expand All @@ -37,9 +34,9 @@ def patches
end

def install
if build.with?("homebrew-mysql")
if build.include?("use-homebrew-mysql")
mysql_formula_name = "mysql"
elsif build.with?("homebrew-mariadb")
elsif build.include?("use-homebrew-mariadb")
mysql_formula_name = "mariadb"
else
mysql_formula_name = nil
Expand All @@ -55,7 +52,7 @@ def install
else
mysql_source_path = option_value("--with-mysql-source")
if mysql_source_path.nil?
raise "--with-homebrew-mysql, --with-homebrew-mariadb or --with-mysql-source=PATH is required"
raise "--use-homebrew-mysql, --use-homebrew-mariadb or --with-mysql-source=PATH is required"
end
install_mroonga(mysql_source_path, nil)
end
Expand Down

0 comments on commit 7b37573

Please sign in to comment.