Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

upgrade to mysql 5.5.10

Note: MySQL 5.1.x is still available in Homebrew-Alt

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
commit edb70c3e29a675c9e4e700b0dea62b22f780b005 1 parent cb377cb
@ghostrocket ghostrocket authored adamv committed
Showing with 27 additions and 43 deletions.
  1. +27 −43 Library/Formula/mysql.rb
View
70 Library/Formula/mysql.rb
@@ -1,20 +1,18 @@
require 'formula'
class Mysql < Formula
- homepage 'http://dev.mysql.com/doc/refman/5.1/en/'
- url 'http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-5.1.56.tar.gz'
- md5 '15161d67f4830aad3a8a89e083749d49'
+ homepage 'http://dev.mysql.com/doc/refman/5.5/en/'
+ url 'http://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-5.5/mysql-5.5.10.tar.gz'
+ md5 'ee604aff531ff85abeb10cf332c1355a'
+ depends_on 'cmake' => :build
depends_on 'readline'
def options
[
['--with-tests', "Keep tests when installing."],
['--with-bench', "Keep benchmark app when installing."],
- ['--with-embedded', "Build the embedded server."],
- ['--client-only', "Only install client tools, not the server."],
- ['--universal', "Make mysql a universal binary"],
- ['--with-utf8-default', "Set the default character set to utf8"]
+ ['--universal', "Make mysql a universal binary"]
]
end
@@ -25,43 +23,25 @@ def patches
def install
fails_with_llvm "https://github.com/mxcl/homebrew/issues/issue/144"
- # See: http://dev.mysql.com/doc/refman/5.1/en/configure-options.html
- # These flags may not apply to gcc 4+
- ENV['CXXFLAGS'] = ENV['CXXFLAGS'].gsub "-fomit-frame-pointer", ""
- ENV['CXXFLAGS'] += " -fno-omit-frame-pointer -felide-constructors"
+ args = [
+ ".",
+ "-DCMAKE_INSTALL_PREFIX='#{prefix}'",
+ "-DMYSQL_DATADIR='#{var}/mysql/data'",
+ "-DINSTALL_MANDIR='#{man}'",
+ "-DWITH_SSL=yes",
+ "-DDEFAULT_CHARSET='utf8'",
+ "-DDEFAULT_COLLATION='utf8_general_ci'",
+ "-DSYSCONFDIR='#{HOMEBREW_PREFIX}/etc'"]
- # Make universal for bindings to universal applications
- ENV.universal_binary if ARGV.include? '--universal'
-
- configure_args = [
- "--without-docs",
- "--without-debug",
- "--disable-dependency-tracking",
- "--prefix=#{prefix}",
- "--localstatedir=#{var}/mysql",
- "--sysconfdir=#{etc}",
- "--with-plugins=innobase,myisam",
- "--with-extra-charsets=complex",
- "--with-ssl",
- "--without-readline", # Confusingly, means "use detected readline instead of included readline"
- "--enable-assembler",
- "--enable-thread-safe-client",
- "--enable-local-infile",
- "--enable-shared",
- "--with-partition"]
-
- configure_args << "--without-server" if ARGV.include? '--client-only'
- configure_args << "--with-embedded-server" if ARGV.include? '--with-embedded'
- configure_args << "--with-charset=utf8" if ARGV.include? '--with-utf8-default'
-
- system "./configure", *configure_args
- system "make install"
+ args << "-DWITH_UNIT_TESTS=OFF" if not ARGV.include? '--with-tests'
+ args << "-DINSTALL_SQLBENCHDIR=" if not ARGV.include? '--with-bench'
- ln_s "#{libexec}/mysqld", bin
- ln_s "#{share}/mysql/mysql.server", bin
+ # Make universal for bindings to universal applications
+ args << "-DCMAKE_OSX_ARCHITECTURES='ppc;i386'" if ARGV.include? '--universal'
- (prefix+'mysql-test').rmtree unless ARGV.include? '--with-tests' # save 66MB!
- (prefix+'sql-bench').rmtree unless ARGV.include? '--with-bench'
+ system "cmake", *args
+ system "make"
+ system "make install"
(prefix+'com.mysql.mysqld.plist').write startup_plist
end
@@ -69,7 +49,11 @@ def install
def caveats; <<-EOS.undent
Set up databases with:
unset TMPDIR
- mysql_install_db
+ cd #{prefix}
+ scripts/mysql_install_db --basedir=#{prefix} --user=mysql --tmpdir=/tmp
+
+ Running the mysql_install_db command with the user and tmpdir option will
+ ensure that there is no issue creating your system databases.
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
@@ -87,7 +71,7 @@ def caveats; <<-EOS.undent
plist with a version specific program argument.
Or start manually with:
- mysql.server start
+ mysqld_safe &

Why mysqld_safe over mysql.server start?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
EOS
end

1 comment on commit edb70c3

@ghostrocket

muchos gracias to @shedd and @carlwolff who did the 5.5.10 and 5.5.9 scripts, respectively. i did the original 5.5.8.

@theunraveler

Why mysqld_safe over mysql.server start?

Please sign in to comment.
Something went wrong with that request. Please try again.