48 lines
1.5 KiB
Ruby
48 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-09.06.0100.tar.gz"
|
|
sha256 "050c80b25eb6553a718b9ab4ac00dcbadf7a13ee5ae637c30f7dcde8f4a6c962"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "59f4b6715fdad0e38ac1ee3758042d4fee7df6ab2b0068588c49125bc6310d3b" => :sierra
|
|
sha256 "9044947d752f67254162f3ec41c2d1c846bd8b051f1f17d6300e199e181416a4" => :el_capitan
|
|
sha256 "1a1c6b579825a7e29621a955fb58ba1a881e3e9acc5fd7bd5910cf3fba265179" => :yosemite
|
|
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
|