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

Commit

Permalink
upgrade to mysql 5.5.10
Browse files Browse the repository at this point in the history
Note: MySQL 5.1.x is still available in Homebrew-Alt

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information
ghostrocket authored and adamv committed Mar 24, 2011
1 parent cb377cb commit edb70c3
Showing 1 changed file with 27 additions and 43 deletions.
70 changes: 27 additions & 43 deletions 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

Expand All @@ -25,51 +23,37 @@ 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

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
Expand All @@ -87,7 +71,7 @@ def caveats; <<-EOS.undent
plist with a version specific program argument.
Or start manually with:
mysql.server start
mysqld_safe &

This comment has been minimized.

Copy link
@theunraveler

theunraveler Mar 27, 2011

Contributor

Why mysqld_safe over mysql.server start?

EOS
end

Expand Down

1 comment on commit edb70c3

@ghostrocket
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Please sign in to comment.