homebrew-core/Formula/psqlodbc.rb

49 lines
1.5 KiB
Ruby

class Psqlodbc < Formula
desc "Official PostgreSQL ODBC driver"
homepage "https://odbc.postgresql.org"
url "https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-10.01.0000.tar.gz"
sha256 "87ca436f268b92fd525113e78133f65b444c6feec474837c7ec39d128eaecab3"
bottle do
cellar :any
sha256 "b1a48d253a1c945b768d71834ae8774597ad1fd29e4814ba7da889a0ed044b4d" => :high_sierra
sha256 "ca7cc3b3e57f4a121d823baf9a8452f321e493765164325bf15a451381245e8a" => :sierra
sha256 "3c053b77eac2261f37c449f0b7cc4f620fae54687ae6e4b709b0459844be4c48" => :el_capitan
end
head do
url "https://git.postgresql.org/git/psqlodbc.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
depends_on "openssl"
depends_on "postgresql"
depends_on "unixodbc" => :recommended
depends_on "libiodbc" => :optional
def install
if build.with?("libiodbc") && build.with?("unixodbc")
odie "psqlodbc: --without-unixodbc must be specified when using --with-libiodbc"
end
args = %W[
--prefix=#{prefix}
]
args << "--with-iodbc=#{Formula["libiodbc"].opt_prefix}" if build.with?("libiodbc")
args << "--with-unixodbc=#{Formula["unixodbc"].opt_prefix}" if build.with?("unixodbc")
system "./bootstrap" if build.head?
system "./configure", *args
system "make"
system "make", "install"
end
test do
output = shell_output("#{Formula["unixodbc"].bin}/dltest #{lib}/psqlodbcw.so")
assert_equal "SUCCESS: Loaded #{lib}/psqlodbcw.so\n", output
end
end