This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
/
mysql.rb
53 lines (44 loc) · 1.46 KB
/
mysql.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'brewkit'
class Mysql <Formula
@url='http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.37.zip'
@homepage='http://dev.mysql.com/doc/refman/5.1/en/'
@md5='7564d7759a8077b3a0e6190955422287'
def deps
# --without-readline means use system's readline
LibraryDep.new 'readline'
end
def options
[
['--with-tests', "Keep tests when installing."],
['--with-bench', "Keep benchmark app when installing."],
['--client-only', "Only install client tools, not the server."],
]
end
def install
ENV['CXXFLAGS'] = ENV['CXXFLAGS'].gsub "-fomit-frame-pointer", ""
ENV['CXXFLAGS'] += " -fno-omit-frame-pointer -felide-constructors"
configure_args = [
"--without-bench",
"--without-docs",
"--without-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-plugins=innobase,myisam",
"--with-extra-charsets=complex",
"--with-plugins=innobase,myisam",
"--with-ssl",
"--enable-assembler",
"--enable-thread-safe-client",
"--enable-local-infile",
"--enable-shared"]
if ARGV.include? '--client-only'
configure_args.push("--without-server")
end
system "./configure", *configure_args
system "make install"
# Why does sql-bench still get built w/ above options?
(prefix+'sql-bench').rmtree unless ARGV.include? '--with-bench'
# save 66MB!
(prefix+'mysql-test').rmtree unless ARGV.include? '--with-tests'
end
end