soci: refactor install.

master
Mike McQuaid 2018-03-06 09:30:03 +00:00
parent 457956a7c7
commit c1f7cf529b
1 changed files with 4 additions and 7 deletions

View File

@ -21,10 +21,6 @@ class Soci < Formula
depends_on "boost" => [:build, :optional]
depends_on "sqlite" if MacOS.version <= :snow_leopard
def translate(a)
(a == "pg") ? "postgresql" : a
end
fails_with :clang do
build 421
cause "Template oddities"
@ -33,9 +29,10 @@ class Soci < Formula
def install
args = std_cmake_args + %w[.. -DWITH_SQLITE3:BOOL=ON]
%w[boost mysql oracle odbc pg].each do |a|
bool = build.with?(a) ? "ON" : "OFF"
args << "-DWITH_#{translate(a).upcase}:BOOL=#{bool}"
%w[boost mysql oracle odbc pg].each do |arg|
arg_var = (arg == "pg") ? "postgresql" : arg
bool = build.with?(arg) ? "ON" : "OFF"
args << "-DWITH_#{arg_var.upcase}:BOOL=#{bool}"
end
mkdir "build" do