[Groonga-mysql-commit] mroonga/homebrew at f9eaf0a [master] Support MariaDB with --use-homebrew-mariadb

アーカイブの一覧に戻る

HAYASHI Kentaro null+****@clear*****
Sun Dec 29 20:53:44 JST 2013


HAYASHI Kentaro	2013-12-29 20:53:44 +0900 (Sun, 29 Dec 2013)

  New Revision: f9eaf0aa069aefa82781ef314a438675dd877233
  https://github.com/mroonga/homebrew/commit/f9eaf0aa069aefa82781ef314a438675dd877233

  Message:
    Support MariaDB with --use-homebrew-mariadb
    
    [GitHub #1]
    
    Patch by odoku. Thanks!!!

  Modified files:
    README.md
    mroonga.rb

  Modified: README.md (+4 -0)
===================================================================
--- README.md    2013-12-29 18:24:33 +0900 (6ff3da0)
+++ README.md    2013-12-29 20:53:44 +0900 (bf6482a)
@@ -5,6 +5,10 @@ Type the following command to install mroonga by Homebrew:
 
     % brew install https://raw.github.com/mroonga/homebrew/master/mroonga.rb --use-homebrew-mysql
 
+With MariaDB:
+
+    % brew install https://raw.github.com/mroonga/homebrew/master/mroonga.rb --use-homebrew-mariadb
+
 If you want to use this formula with MySQL built by yourself instead of MySQL installed by Homebrew:
 
     % curl -O http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.24.tar.gz

  Modified: mroonga.rb (+21 -2)
===================================================================
--- mroonga.rb    2013-12-29 18:24:33 +0900 (87c69a1)
+++ mroonga.rb    2013-12-29 20:53:44 +0900 (d43a7dc)
@@ -8,11 +8,15 @@ class Mroonga < Formula
   sha256 'e2a9c33d1f59c0bf8be1e9f9ae8b5c753e74998745a6213eda63ed346cf2f7ff'
 
   depends_on 'pkg-config' => :build
+  depends_on 'groonga'
+  depends_on 'groonga-normalizer-mysql'
+
   if ARGV.include?("--use-homebrew-mysql")
     depends_on 'mysql'
   end
-  depends_on 'groonga'
-  depends_on 'groonga-normalizer-mysql'
+  if ARGV.include?("--use-homebrew-mariadb")
+    depends_on 'mariadb'
+  end
 
   def options
     [
@@ -38,6 +42,13 @@ class Mroonga < Formula
                           (mysql.prefix + "bin" + "mysql_config").to_s)
         end
       end
+    elsif ARGV.include?("--use-homebrew-mariadb")
+      build_mariadb_formula do |mysql|
+        Dir.chdir(buildpath.to_s) do
+          install_mroonga(mysql.buildpath.to_s,
+                          (mysql.prefix + "bin" + "mysql_config").to_s)
+        end
+      end
     else
       mysql_source_path = option_value("--with-mysql-source")
       if mysql_source_path.nil?
@@ -92,6 +103,14 @@ class Mroonga < Formula
     end
   end
 
+  def build_mariadb_formula
+    mysql = Formula.factory("mariadb")
+    mysql.extend(Patchable)
+    mysql.brew do
+      yield mysql
+    end
+  end
+
   def build_configure_args(mysql_source_path, mysql_config_path)
     configure_args = [
       "--prefix=#{prefix}",
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-mysql-commit mailing list
アーカイブの一覧に戻る