homebrew-core/Formula/mariadb-connector-odbc.rb

50 lines
2.2 KiB
Ruby

class MariadbConnectorOdbc < Formula
desc "Database driver using the industry standard ODBC API"
homepage "https://downloads.mariadb.org/connector-odbc/"
url "https://downloads.mariadb.org/f/connector-odbc-3.1.13/mariadb-connector-odbc-3.1.13-src.tar.gz"
sha256 "29aa6b8b49971050b341be86f5e130d126c4c296d965aaa6a1559745164b82aa"
license "LGPL-2.1-or-later"
livecheck do
url :homepage
regex(/Download (\d+(?:\.\d+)+) Stable Now!/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "f5743a56b31fde067ee20a09ad1a9b07599293b93e0e9fe57cd28af1d28e6b18"
sha256 cellar: :any, big_sur: "605a16d0c1f7d05fbb2f509fe638f49797e56302c30b2bf875db4d7b54abaad7"
sha256 cellar: :any, catalina: "78fc1a7690d2bdf25fffe06fb0964873029aa9b312563e1bfc9ceca30abf5cd5"
sha256 cellar: :any, mojave: "952d6b594a1b313175e3e22afd2abfc4c89db5c99b5df31dfa17bc5a1165466f"
end
depends_on "cmake" => :build
depends_on "mariadb-connector-c"
depends_on "openssl@1.1"
depends_on "unixodbc"
def install
ENV.append_to_cflags "-I#{Formula["mariadb-connector-c"].opt_include}/mariadb"
ENV.append "LDFLAGS", "-L#{Formula["mariadb-connector-c"].opt_lib}/mariadb"
system "cmake", ".", "-DMARIADB_LINK_DYNAMIC=1",
"-DWITH_SSL=OPENSSL",
"-DOPENSSL_ROOT_DIR=#{Formula["openssl@1.1"].opt_prefix}",
"-DWITH_IODBC=0",
# Workaround 3.1.11 issues finding system's built-in -liconv
# See https://jira.mariadb.org/browse/ODBC-299
"-DICONV_LIBRARIES=#{MacOS.sdk_path}/usr/lib/libiconv.tbd",
"-DICONV_INCLUDE_DIR=/usr/include",
*std_cmake_args
# By default, the installer pkg is built - we don't want that.
# maodbc limits the build to just the connector itself.
# install/fast prevents an "all" build being invoked that a regular "install" would do.
system "make", "maodbc"
system "make", "install/fast"
end
test do
output = shell_output("#{Formula["unixodbc"].opt_bin}/dltest #{lib}/mariadb/#{shared_library("libmaodbc")}")
assert_equal "SUCCESS: Loaded #{lib}/mariadb/#{shared_library("libmaodbc")}", output.chomp
end
end