From 8874c9dbb33eafd734532e3aead1ed8bb0a24779 Mon Sep 17 00:00:00 2001 From: Jose Quinteiro Date: Sun, 13 Nov 2016 15:58:03 -0800 Subject: [PATCH] mysql++: use mysql instead of connector. Closes #6895. Signed-off-by: Mike McQuaid --- Formula/mysql++.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Formula/mysql++.rb b/Formula/mysql++.rb index 64f93d3d8b..cb88c57780 100644 --- a/Formula/mysql++.rb +++ b/Formula/mysql++.rb @@ -13,15 +13,31 @@ class Mysqlxx < Formula sha256 "154e219e9cac151437d47b281ca35aa35eaf3d510b04f5e9886a0257a983a760" => :mountain_lion end - depends_on "mysql-connector-c" + depends_on :mysql def install + mysql_include_dir = `mysql_config --variable=pkgincludedir` system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-field-limit=40", "--with-mysql-lib=#{HOMEBREW_PREFIX}/lib", - "--with-mysql-include=#{HOMEBREW_PREFIX}/include" + "--with-mysql-include=#{mysql_include_dir}" system "make", "install" end + + test do + (testpath/"test.cpp").write <<-EOS.undent + #include + int main(int argc, char *argv[]) { + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + return 0; + } + EOS + system ENV.cxx, "test.cpp", `mysql_config --include`.chomp, "-L#{lib}", "-lmysqlpp", "-o", "test" + system "./test", "-u", "foo", "-p", "bar" + end end