48 lines
1.5 KiB
Ruby
48 lines
1.5 KiB
Ruby
|
class MysqlClient < Formula
|
||
|
desc "Open source relational database management system"
|
||
|
homepage "https://dev.mysql.com/doc/refman/5.7/en/"
|
||
|
# Pinned at `5.7.*`
|
||
|
url "https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.22.tar.gz"
|
||
|
sha256 "5b2a61700af7c99f5630a7dfdb099af9283c3029843cddd9e123bcdbcc4aad03"
|
||
|
|
||
|
keg_only "conflicts with mysql"
|
||
|
|
||
|
depends_on "cmake" => :build
|
||
|
# https://github.com/Homebrew/homebrew-core/issues/1475
|
||
|
# Needs at least Clang 3.3, which shipped alongside Lion.
|
||
|
# Note: MySQL themselves don't support anything below El Capitan.
|
||
|
depends_on :macos => :lion
|
||
|
depends_on "openssl"
|
||
|
|
||
|
def install
|
||
|
# https://bugs.mysql.com/bug.php?id=87348
|
||
|
# Fixes: "ADD_SUBDIRECTORY given source
|
||
|
# 'storage/ndb' which is not an existing"
|
||
|
inreplace "CMakeLists.txt", "ADD_SUBDIRECTORY(storage/ndb)", ""
|
||
|
|
||
|
# -DINSTALL_* are relative to `CMAKE_INSTALL_PREFIX` (`prefix`)
|
||
|
args = %W[
|
||
|
-DCOMPILATION_COMMENT=Homebrew
|
||
|
-DDEFAULT_CHARSET=utf8
|
||
|
-DDEFAULT_COLLATION=utf8_general_ci
|
||
|
-DINSTALL_DOCDIR=share/doc/#{name}
|
||
|
-DINSTALL_INCLUDEDIR=include/mysql
|
||
|
-DINSTALL_INFODIR=share/info
|
||
|
-DINSTALL_MANDIR=share/man
|
||
|
-DINSTALL_MYSQLSHAREDIR=share/mysql
|
||
|
-DWITH_BOOST=boost
|
||
|
-DWITH_EDITLINE=system
|
||
|
-DWITH_SSL=yes
|
||
|
-DWITH_UNIT_TESTS=OFF
|
||
|
-DWITHOUT_SERVER=ON
|
||
|
]
|
||
|
|
||
|
system "cmake", ".", *std_cmake_args, *args
|
||
|
system "make", "install"
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
assert_match version.to_s, shell_output("#{bin}/mysql --version")
|
||
|
end
|
||
|
end
|