Skip to content
This repository
Browse code

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
Keith Fitzgerald authored March 24, 2011 adamv committed March 24, 2011

Showing 1 changed file with 27 additions and 43 deletions. Show diff stats Hide diff stats

  1. 70  Library/Formula/mysql.rb
70  Library/Formula/mysql.rb
... ...
@@ -1,20 +1,18 @@
1 1
 require 'formula'
2 2
 
3 3
 class Mysql < Formula
4  
-  homepage 'http://dev.mysql.com/doc/refman/5.1/en/'
5  
-  url 'http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-5.1.56.tar.gz'
6  
-  md5 '15161d67f4830aad3a8a89e083749d49'
  4
+  homepage 'http://dev.mysql.com/doc/refman/5.5/en/'
  5
+  url 'http://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-5.5/mysql-5.5.10.tar.gz'
  6
+  md5 'ee604aff531ff85abeb10cf332c1355a'
7 7
 
  8
+  depends_on 'cmake' => :build
8 9
   depends_on 'readline'
9 10
 
10 11
   def options
11 12
     [
12 13
       ['--with-tests', "Keep tests when installing."],
13 14
       ['--with-bench', "Keep benchmark app when installing."],
14  
-      ['--with-embedded', "Build the embedded server."],
15  
-      ['--client-only', "Only install client tools, not the server."],
16  
-      ['--universal', "Make mysql a universal binary"],
17  
-      ['--with-utf8-default', "Set the default character set to utf8"]
  15
+      ['--universal', "Make mysql a universal binary"]
18 16
     ]
19 17
   end
20 18
 
@@ -25,43 +23,25 @@ def patches
25 23
   def install
26 24
     fails_with_llvm "https://github.com/mxcl/homebrew/issues/issue/144"
27 25
 
28  
-    # See: http://dev.mysql.com/doc/refman/5.1/en/configure-options.html
29  
-    # These flags may not apply to gcc 4+
30  
-    ENV['CXXFLAGS'] = ENV['CXXFLAGS'].gsub "-fomit-frame-pointer", ""
31  
-    ENV['CXXFLAGS'] += " -fno-omit-frame-pointer -felide-constructors"
  26
+    args = [
  27
+      ".",
  28
+      "-DCMAKE_INSTALL_PREFIX='#{prefix}'",
  29
+      "-DMYSQL_DATADIR='#{var}/mysql/data'",
  30
+      "-DINSTALL_MANDIR='#{man}'",
  31
+      "-DWITH_SSL=yes",
  32
+      "-DDEFAULT_CHARSET='utf8'",
  33
+      "-DDEFAULT_COLLATION='utf8_general_ci'",
  34
+      "-DSYSCONFDIR='#{HOMEBREW_PREFIX}/etc'"]
32 35
 
33  
-    # Make universal for bindings to universal applications
34  
-    ENV.universal_binary if ARGV.include? '--universal'
35  
-
36  
-    configure_args = [
37  
-      "--without-docs",
38  
-      "--without-debug",
39  
-      "--disable-dependency-tracking",
40  
-      "--prefix=#{prefix}",
41  
-      "--localstatedir=#{var}/mysql",
42  
-      "--sysconfdir=#{etc}",
43  
-      "--with-plugins=innobase,myisam",
44  
-      "--with-extra-charsets=complex",
45  
-      "--with-ssl",
46  
-      "--without-readline", # Confusingly, means "use detected readline instead of included readline"
47  
-      "--enable-assembler",
48  
-      "--enable-thread-safe-client",
49  
-      "--enable-local-infile",
50  
-      "--enable-shared",
51  
-      "--with-partition"]
52  
-
53  
-    configure_args << "--without-server" if ARGV.include? '--client-only'
54  
-    configure_args << "--with-embedded-server" if ARGV.include? '--with-embedded'
55  
-    configure_args << "--with-charset=utf8" if ARGV.include? '--with-utf8-default'
56  
-
57  
-    system "./configure", *configure_args
58  
-    system "make install"
  36
+    args << "-DWITH_UNIT_TESTS=OFF" if not ARGV.include? '--with-tests'
  37
+    args << "-DINSTALL_SQLBENCHDIR=" if not ARGV.include? '--with-bench'
59 38
 
60  
-    ln_s "#{libexec}/mysqld", bin
61  
-    ln_s "#{share}/mysql/mysql.server", bin
  39
+    # Make universal for bindings to universal applications
  40
+    args << "-DCMAKE_OSX_ARCHITECTURES='ppc;i386'" if ARGV.include? '--universal'
62 41
 
63  
-    (prefix+'mysql-test').rmtree unless ARGV.include? '--with-tests' # save 66MB!
64  
-    (prefix+'sql-bench').rmtree unless ARGV.include? '--with-bench'
  42
+    system "cmake", *args
  43
+    system "make"
  44
+    system "make install"
65 45
 
66 46
     (prefix+'com.mysql.mysqld.plist').write startup_plist
67 47
   end
@@ -69,7 +49,11 @@ def install
69 49
   def caveats; <<-EOS.undent
70 50
     Set up databases with:
71 51
         unset TMPDIR
72  
-        mysql_install_db
  52
+        cd #{prefix}
  53
+        scripts/mysql_install_db --basedir=#{prefix} --user=mysql --tmpdir=/tmp
  54
+
  55
+    Running the mysql_install_db command with the user and tmpdir option will
  56
+        ensure that there is no issue creating your system databases.
73 57
 
74 58
     If this is your first install, automatically load on login with:
75 59
         mkdir -p ~/Library/LaunchAgents
@@ -87,7 +71,7 @@ def caveats; <<-EOS.undent
87 71
         plist with a version specific program argument.
88 72
 
89 73
     Or start manually with:
90  
-        mysql.server start
  74
+        mysqld_safe &
91 75
     EOS
92 76
   end
93 77
 

1 note on commit edb70c3

Keith Fitzgerald

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.

Jake Bell

Why mysqld_safe over mysql.server start?

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