-
Notifications
You must be signed in to change notification settings - Fork 1
/
libodb-pgsql.rb
52 lines (45 loc) · 1.34 KB
/
libodb-pgsql.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
require_relative "libodb-base"
class LibodbPgsql < LibodbBase
homepage "http://www.codesynthesis.com/products/odb/"
url "http://www.codesynthesis.com/download/odb/2.4/libodb-pgsql-2.4.0.tar.gz"
sha256 "8e365b33617ec8ad8594d488755659dea28eea6463eedcde2ec59655fef20f1d"
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
def install
standard_install(STDLIB)
end
test do
(testpath/"test.cpp").write <<-EOS
#include <odb/pgsql/exceptions.hxx>
int main()
{
try {
throw odb::pgsql::database_exception("test exception");
} catch (const odb::pgsql::database_exception &e) {}
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-lodb-pgsql", "-lodb"
system "./test"
end
end