Skip to content

Commit 4399e5d

Browse files
committed
Upgrade brew formula
1 parent 95ef7fa commit 4399e5d

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

configure

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if [ $(echo "$OSTYPE" | grep "darwin") ]; then
7171

7272
# Use system 'brew' if available
7373
if [ $(command -v brew) ]; then
74-
MYSQLBREWDIR="$(brew --prefix)/Cellar/mysql-connector-c/6.1.3";
74+
MYSQLBREWDIR="$(brew --prefix)/Cellar/mysql-connector-c/6.1.6";
7575
if [ ! -r "$MYSQLBREWDIR/include/mysql.h" ]; then
7676
echo "Brewing libmysql...";
7777
brew install ./tools/mysql-connector-c.rb;
@@ -94,13 +94,13 @@ if [ $(echo "$OSTYPE" | grep "darwin") ]; then
9494
if [ ! -r "$LOCALBREW/bin/brew" ]; then
9595
mkdir -p $LOCALBREW && curl -fsSL https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $LOCALBREW
9696
fi
97-
if [ ! -r "$LOCALBREW/Cellar/mysql-connector-c/6.1.3/include/mysql.h" ]; then
97+
if [ ! -r "$LOCALBREW/Cellar/mysql-connector-c/6.1.6/include/mysql.h" ]; then
9898
HOMEBREW_CACHE="/tmp" $LOCALBREW/bin/brew install ./tools/mysql-connector-c.rb;
9999
fi
100-
if [ -r "$LOCALBREW/Cellar/mysql-connector-c/6.1.3/include/mysql.h" ]; then
100+
if [ -r "$LOCALBREW/Cellar/mysql-connector-c/6.1.6/include/mysql.h" ]; then
101101
echo "Using local brew from $LOCALBREW."
102-
echo "PKG_CPPFLAGS= -I../$LOCALBREW/Cellar/mysql-connector-c/6.1.3/include/" > src/Makevars
103-
cp -f $LOCALBREW/Cellar/mysql-connector-c/6.1.3/lib/libmysqlclient.a ./src/libmysqlstatic.a
102+
echo "PKG_CPPFLAGS= -I../$LOCALBREW/Cellar/mysql-connector-c/6.1.6/include/" > src/Makevars
103+
cp -f $LOCALBREW/Cellar/mysql-connector-c/6.1.6/lib/libmysqlclient.a ./src/libmysqlstatic.a
104104
echo "PKG_LIBS= -L. -lz -lmysqlstatic" >> src/Makevars
105105
exit 0;
106106
fi

tools/mysql-connector-c.rb

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
require 'formula'
2-
31
class MysqlConnectorC < Formula
4-
homepage 'http://dev.mysql.com/downloads/connector/c/'
5-
url 'http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-6.1.3-src.tar.gz'
6-
sha1 'd70392aafb9ddeddd797c8131898e8727f904898'
2+
desc "MySQL database connector for C applications"
3+
homepage "https://dev.mysql.com/downloads/connector/c/"
4+
url "https://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-6.1.6-src.tar.gz"
5+
sha256 "2222433012c415871958b61bc4f3683e1ebe77e3389f698b267058c12533ea78"
6+
7+
bottle do
8+
sha256 "b7cc223beca61228800d26878f7882b23afeb3a8a4297c1b2b84a9faa604a7e4" => :yosemite
9+
sha256 "c9a3c310c3eb3f9a0284b6b337bc531e0bb1e5351134fa7d8b26d331aaaebd7b" => :mavericks
10+
sha256 "5928f92ae51c122d69863ecfdda5f055bc0f6e8aea02c8ae484f3148747f5984" => :mountain_lion
11+
end
712

8-
depends_on 'cmake' => :build
13+
depends_on "cmake" => :build
914

10-
conflicts_with 'mysql', 'mariadb', 'percona-server',
11-
:because => 'both install MySQL client libraries'
15+
conflicts_with "mysql", "mariadb", "percona-server",
16+
:because => "both install MySQL client libraries"
1217

1318
fails_with :llvm do
1419
build 2334
@@ -17,8 +22,12 @@ class MysqlConnectorC < Formula
1722

1823
def install
1924
system "cmake", ".", *std_cmake_args
20-
system 'make'
21-
ENV.j1
22-
system 'make install'
25+
system "make", "install"
26+
end
27+
28+
test do
29+
system "#{bin}/mysql_config", "--cflags"
30+
system "#{bin}/mysql_config", "--include"
31+
system "#{bin}/mysql_config", "--libs"
2332
end
2433
end

0 commit comments

Comments
 (0)