mysql++: use mysql instead of connector.
Closes #6895. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
cdab5f959a
commit
8874c9dbb3
1 changed files with 18 additions and 2 deletions
|
@ -13,15 +13,31 @@ class Mysqlxx < Formula
|
||||||
sha256 "154e219e9cac151437d47b281ca35aa35eaf3d510b04f5e9886a0257a983a760" => :mountain_lion
|
sha256 "154e219e9cac151437d47b281ca35aa35eaf3d510b04f5e9886a0257a983a760" => :mountain_lion
|
||||||
end
|
end
|
||||||
|
|
||||||
depends_on "mysql-connector-c"
|
depends_on :mysql
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
mysql_include_dir = `mysql_config --variable=pkgincludedir`
|
||||||
system "./configure", "--disable-debug",
|
system "./configure", "--disable-debug",
|
||||||
"--disable-dependency-tracking",
|
"--disable-dependency-tracking",
|
||||||
"--prefix=#{prefix}",
|
"--prefix=#{prefix}",
|
||||||
"--with-field-limit=40",
|
"--with-field-limit=40",
|
||||||
"--with-mysql-lib=#{HOMEBREW_PREFIX}/lib",
|
"--with-mysql-lib=#{HOMEBREW_PREFIX}/lib",
|
||||||
"--with-mysql-include=#{HOMEBREW_PREFIX}/include"
|
"--with-mysql-include=#{mysql_include_dir}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
(testpath/"test.cpp").write <<-EOS.undent
|
||||||
|
#include <mysql++/cmdline.h>
|
||||||
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue