Skip to content

Commit

Permalink
sqliteodbc: fix for Linuxbrew
Browse files Browse the repository at this point in the history
Closes Linuxbrew/homebrew-core#8296.

Signed-off-by: Michka Popoff <[email protected]>
  • Loading branch information
xu-cheng authored and iMichka committed Aug 2, 2018
1 parent 1aeb869 commit f7048ce
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Formula/sqliteodbc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,39 @@ class Sqliteodbc < Formula
homepage "http://www.ch-werner.de/sqliteodbc/"
url "http://www.ch-werner.de/sqliteodbc/sqliteodbc-0.9996.tar.gz"
sha256 "8afbc9e0826d4ff07257d7881108206ce31b5f719762cbdb4f68201b60b0cb4e"
revision 1 unless OS.mac?

bottle do
cellar :any
sha256 "7d825f83232825a51c8fd871368a2ff8cce3a76fe9ba1646f20e15f121ecf79e" => :high_sierra
sha256 "907c1b32398eb7f3276e1da956723ac27868d9bcae27fb55ef76277cf2f67cb7" => :sierra
sha256 "7c550f77c2db4e4927b9f23ed8a57610727b438f6a0fad98e1adecee3c8c1aa1" => :el_capitan
sha256 "25ff46c773af4b633504f96ba20e1232d637fbc873c7af41ded2888483a0d318" => :x86_64_linux
end

depends_on "sqlite"
depends_on "unixodbc"
unless OS.mac?
depends_on "libxml2"
depends_on "zlib"
end

def install
unless OS.mac?
# sqliteodbc ships its own version of libtool, which breaks superenv.
# Therefore, we set the following enviroment to help it find superenv.
ENV["CC"] = which("cc")
ENV["CXX"] = which("cxx")
end
lib.mkdir
system "./configure", "--prefix=#{prefix}", "--with-odbc=#{Formula["unixodbc"].opt_prefix}"
args = ["--prefix=#{prefix}", "--with-odbc=#{Formula["unixodbc"].opt_prefix}"]
unless OS.mac?
args += ["--with-sqlite3=#{Formula["sqlite"].opt_prefix}",
"--with-libxml2=#{Formula["libxml2"].opt_prefix}"]
end
system "./configure", *args
system "make"
system "make", "install"
lib.install_symlink "#{lib}/libsqlite3odbc.dylib" => "libsqlite3odbc.so"
lib.install_symlink "#{lib}/libsqlite3odbc.dylib" => "libsqlite3odbc.so" if OS.mac?
end

test do
Expand Down

0 comments on commit f7048ce

Please sign in to comment.