mariadb 5.5.27

Closes Homebrew/homebrew#14929.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
master
Bernhard Valenti 2012-09-14 00:40:38 -04:00 committed by Jack Nagel
parent 8c78b394fb
commit a7bd2be314
1 changed files with 78 additions and 31 deletions

View File

@ -2,15 +2,21 @@ require 'formula'
class Mariadb < Formula
homepage 'http://mariadb.org/'
url 'http://ftp.osuosl.org/pub/mariadb/mariadb-5.3.8/kvm-tarbake-jaunty-x86/mariadb-5.3.8.tar.gz'
sha1 '1a6cc5e1c0aedf6aae61cd55f8d75fce11fa3115'
url 'http://ftp.osuosl.org/pub/mariadb/mariadb-5.5.27/kvm-tarbake-jaunty-x86/mariadb-5.5.27.tar.gz'
sha1 '0f10c6294f44f4a595e2f96317a2b5e04a13ba4f'
depends_on 'readline'
depends_on 'cmake' => :build
depends_on 'pidof' unless MacOS.version >= :mountain_lion
option :universal
option 'with-tests', 'Keep test when installing'
option 'with-bench', 'Keep benchmark app when installing'
option 'client-only', 'Install only client tools'
option 'with-embedded', 'Build the embedded server'
option 'with-libedit', 'Compile with editline wrapper instead of readline'
option 'with-archive-storage-engine', 'Compile with the ARCHIVE storage engine enabled'
option 'with-blackhole-storage-engine', 'Compile with the BLACKHOLE storage engine enabled'
option 'enable-local-infile', 'Build with local infile loading support'
conflicts_with 'mysql',
:because => "mariadb and mysql install the same binaries."
@ -21,48 +27,74 @@ class Mariadb < Formula
build 421
end
def patches
# fix build on Xcode only systems
DATA
end
def install
# Build without compiler or CPU specific optimization flags to facilitate
# compilation of gems and other software that queries `mysql-config`.
ENV.minimal_optimization
ENV.append 'CXXFLAGS', '-fno-omit-frame-pointer -felide-constructors'
# Make sure the var/mysql directory exists
(var+"mysql").mkpath
# Make universal for bindings to universal applications
ENV.universal_binary if build.universal?
configure_args = [
"--without-docs",
"--without-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}/mysql",
"--sysconfdir=#{etc}",
"--with-extra-charsets=complex",
"--enable-assembler",
"--enable-thread-safe-client",
"--with-big-tables",
"--with-plugin-aria",
"--with-aria-tmp-tables",
"--without-plugin-innodb_plugin",
"--with-mysqld-ldflags=-static",
"--with-client-ldflags=-static",
"--with-plugins=max-no-ndb",
"--with-embedded-server",
"--with-libevent",
"--with-readline",
cmake_args = %W[
.
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DMYSQL_DATADIR=#{var}/mysql
-DINSTALL_MANDIR=#{man}
-DINSTALL_DOCDIR=#{doc}
-DINSTALL_MYSQLSHAREDIR=#{share.basename}/#{name}
-DWITH_SSL=yes
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DINSTALL_SYSCONFDIR=#{etc}
]
configure_args << "--without-server" if build.include? 'client-only'
# Client only
cmake_args << "-DWITHOUT_SERVER=1" if build.include? 'client-only'
system "./configure", *configure_args
# Build the embedded server
cmake_args << "-DWITH_EMBEDDED_SERVER=ON" if build.include? 'with-embedded'
# Compile with readline unless libedit is explicitly chosen
cmake_args << "-DWITH_READLINE=yes" unless build.include? 'with-libedit'
# Compile with ARCHIVE engine enabled if chosen
cmake_args << "-DWITH_ARCHIVE_STORAGE_ENGINE=1" if build.include? 'with-archive-storage-engine'
# Compile with BLACKHOLE engine enabled if chosen
cmake_args << "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" if build.include? 'with-blackhole-storage-engine'
# Make universal for binding to universal applications
cmake_args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if build.universal?
# Build with local infile loading support
cmake_args << "-DENABLED_LOCAL_INFILE=1" if build.include? 'enable-local-infile'
system "cmake", *cmake_args
system "make"
system "make install"
bin.install_symlink "#{libexec}/mysqld"
bin.install_symlink "#{share}/mysql/mysql.server"
# Don't create databases inside of the prefix!
# See: https://github.com/mxcl/homebrew/issues/4975
rm_rf prefix+'data'
(prefix+'mysql-test').rmtree unless build.include? 'with-tests' # save 121MB!
(prefix+'sql-bench').rmtree unless build.include? 'with-bench'
# Link the setup script into bin
ln_s prefix+'scripts/mysql_install_db', bin+'mysql_install_db'
# Fix up the control script and link into bin
inreplace "#{prefix}/support-files/mysql.server" do |s|
s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2")
# pidof can be replaced with pgrep from proctools on Mountain Lion
s.gsub!(/pidof/, 'pgrep') if MacOS.version >= :mountain_lion
end
ln_s "#{prefix}/support-files/mysql.server", bin
end
def caveats; <<-EOS.undent
@ -111,3 +143,18 @@ class Mariadb < Formula
EOPLIST
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()