aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/soci.rb
diff options
context:
space:
mode:
authorglejeune2012-02-27 20:02:19 +0100
committerMax Howell2012-08-27 21:25:51 -0400
commit8e599ede57501929f9403e88fd40da56ee7bfd29 (patch)
treee7f8941fe49a9196306cdf712e499bc7f9a64041 /Library/Formula/soci.rb
parent8ee1f6424e203ecb557653feb26fe0f8562bf825 (diff)
downloadhomebrew-8e599ede57501929f9403e88fd40da56ee7bfd29.tar.bz2
New Formula: SOCI 3.1.0
Closes #10538. Signed-off-by: Max Howell <mxcl@me.com> * Use options DSL. * DRY.
Diffstat (limited to 'Library/Formula/soci.rb')
-rw-r--r--Library/Formula/soci.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/Library/Formula/soci.rb b/Library/Formula/soci.rb
new file mode 100644
index 000000000..252e611cd
--- /dev/null
+++ b/Library/Formula/soci.rb
@@ -0,0 +1,39 @@
+require 'formula'
+
+class Soci < Formula
+ homepage 'http://soci.sourceforge.net/'
+ url 'http://download.sourceforge.net/project/soci/soci/soci-3.1.0/soci-3.1.0.zip'
+ md5 '6ffac090b996bc34aedf4a29adf4595c'
+
+ depends_on 'cmake' => :build
+ depends_on 'boost' => :build if build.include? 'with-boost'
+
+ option 'with-oracle', 'Enable Oracle support.'
+ option 'with-boost', 'Enable boost support.'
+ option 'with-mysql', 'Enable MySQL support.'
+ option 'with-odbc', 'Enable ODBC support.'
+ option 'with-pg', 'Enable PostgreSQL support.'
+
+ def translate a
+ if a == "pg" then "postgresql" else a end
+ end
+
+ fails_with :clang do
+ build 421
+ cause "Template oddities"
+ end
+
+ def install
+ args = std_cmake_args + %w{.. -DWITH_SQLITE3:BOOL=ON}
+
+ %w{boost mysql oracle odbc pg}.each do |a|
+ bool = build.include?("with-#{a}") ? "ON" : "OFF"
+ args << "-DWITH_#{translate(a).upcase}:BOOL=#{bool}"
+ end
+
+ mkdir 'build' do
+ system "cmake", *args
+ system "make install"
+ end
+ end
+end