diff options
| author | Patrick Li | 2013-06-24 17:09:20 +1200 |
|---|---|---|
| committer | Jack Nagel | 2013-06-30 10:11:21 -0500 |
| commit | f43eeaca36c3a0d0e3d87de89d830cd479e537a5 (patch) | |
| tree | b915ffabc565218ff1fbfca1163247ee0dfc582a /Library/Formula | |
| parent | 31e6238fbdb8bfa50312e764ed8baa63033933b7 (diff) | |
| download | homebrew-f43eeaca36c3a0d0e3d87de89d830cd479e537a5.tar.bz2 | |
mariadb: port latest changes from mysql formula
Closes #20734.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/mariadb.rb | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/Library/Formula/mariadb.rb b/Library/Formula/mariadb.rb index 8e7ec8bf4..93ad9c084 100644 --- a/Library/Formula/mariadb.rb +++ b/Library/Formula/mariadb.rb @@ -38,19 +38,17 @@ class Mariadb < Formula build 421 end - def patches - # fix build on Xcode only systems - DATA - end - def install + # Don't hard-code the libtool path. See: + # https://github.com/mxcl/homebrew/issues/20185 + inreplace "cmake/libutils.cmake", + "COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}", + "COMMAND libtool -static -o ${TARGET_LOCATION}" + # Build without compiler or CPU specific optimization flags to facilitate # compilation of gems and other software that queries `mysql-config`. ENV.minimal_optimization - # Make sure the var/mysql directory exists - (var+"mysql").mkpath - cmake_args = %W[ . -DCMAKE_INSTALL_PREFIX=#{prefix} @@ -113,13 +111,30 @@ class Mariadb < Formula end ln_s "#{prefix}/support-files/mysql.server", bin + + # Move mysqlaccess to libexec + mv "#{bin}/mysqlaccess", libexec + mv "#{bin}/mysqlaccess.conf", libexec + end + end + + def post_install + # Make sure the var/mysql directory exists + (var+"mysql").mkpath + + unless File.exist? "#{var}/mysql/mysql/user.frm" + ENV['TMPDIR'] = nil + system "#{bin}/mysql_install_db", '--verbose', "--user=#{ENV['USER']}", + "--basedir=#{prefix}", "--datadir=#{var}/mysql", "--tmpdir=/tmp" end end def caveats; <<-EOS.undent - Set up databases with: - unset TMPDIR - mysql_install_db --user=\`whoami\` --basedir="$(brew --prefix mariadb)" --datadir=#{var}/mysql --tmpdir=/tmp + A "/etc/my.cnf" from another install may interfere with a Homebrew-built + server starting up correctly. + + To connect: + mysql -uroot EOS end @@ -134,8 +149,11 @@ class Mariadb < Formula <true/> <key>Label</key> <string>#{plist_name}</string> - <key>Program</key> - <string>#{HOMEBREW_PREFIX}/bin/mysqld_safe</string> + <key>ProgramArguments</key> + <array> + <string>#{opt_prefix}/bin/mysqld_safe</string> + <string>--bind-address=127.0.0.1</string> + </array> <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> @@ -144,19 +162,10 @@ class Mariadb < Formula </plist> EOS end -end -__END__ -diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake -index 7c13df0..c82de4d 100644 ---- a/cmake/libutils.cmake -+++ b/cmake/libutils.cmake -@@ -183,7 +183,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) - # binaries properly) - ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD - COMMAND rm ${TARGET_LOCATION} -- COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION} -+ COMMAND libtool -static -o ${TARGET_LOCATION} - ${STATIC_LIBS} - ) - ELSE() + test do + (prefix+'mysql-test').cd do + system './mysql-test-run.pl', 'status' + end + end +end |
