-
Notifications
You must be signed in to change notification settings - Fork 1
/
libodb-mysql.rb
53 lines (46 loc) · 1.38 KB
/
libodb-mysql.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require_relative "libodb-base"
class LibodbMysql < LibodbBase
homepage "http://www.codesynthesis.com/products/odb/"
url "http://www.codesynthesis.com/download/odb/2.4/libodb-mysql-2.4.0.tar.gz"
sha256 "95e5b7a4ef3cc5abbb91e7f155b6b74d5e143df99258da1d49097bb7498eefef"
option "with-libstdc++",
"Force compiling with libstdc++ (Default BEFORE 10.9)"
option "with-libc++",
"Force compiling with libc++ (Default SINCE 10.9)"
option "with-gcc",
"Force compiling with gcc and GCC's libstdc++"
if build.with?("gcc")
if MacOS.version <= :el_capitan
depends_on "gcc@5"
else
depends_on "[email protected]"
end
fails_with :clang
STDLIB = "gcc"
elsif build.with?("libstdc++")
STDLIB = "libstdc++"
elsif build.with?("libc++")
STDLIB = "libc++"
else
STDLIB = MacOS.version < :mavericks ? "libstdc++" : "libc++"
end
depends_on "libodb" => "with-" + STDLIB
depends_on "mysql-connector-c"
def install
standard_install(STDLIB)
end
test do
(testpath/"test.cpp").write <<-EOS
#include <odb/mysql/exceptions.hxx>
int main()
{
try {
throw odb::mysql::database_exception(0, "state", "message");
} catch (const odb::mysql::database_exception &e) {}
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-lodb-mysql", "-lodb"
system "./test"
end
end