homebrew-core/Formula/mydumper.rb

62 lines
2.5 KiB
Ruby

class Mydumper < Formula
desc "How MySQL DBA & support engineer would imagine 'mysqldump' ;-)"
homepage "https://launchpad.net/mydumper"
url "https://github.com/maxbube/mydumper/archive/v0.10.3.tar.gz"
sha256 "571f0544ed60359dbcc933f439bd76741d6a51edcee0b1528f4c84e0bd521d9f"
license "GPL-3.0-or-later"
bottle do
sha256 cellar: :any, arm64_big_sur: "455f95559b2dbe864afba6e25ca4632c08ea01427d893e6b74da705f6ddc3df6"
sha256 cellar: :any, big_sur: "cef3fb7db8b705a3aff4a08105637454015184774d0a967e5ad012a176e5c76f"
sha256 cellar: :any, catalina: "dbd667367fe99a0b5ae562554dc8a8b83d6d66f53be8ab6279dbc52c920c7115"
sha256 cellar: :any, mojave: "8a774ee31ebfcf66b836daeb7e45150040276ad0bde488a4699908bc17bf8663"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "sphinx-doc" => :build
depends_on "glib"
depends_on "mysql-client"
depends_on "openssl@1.1"
depends_on "pcre"
uses_from_macos "zlib"
# This patch allows cmake to find .dylib shared libs in macOS. A bug report has
# been filed upstream here: https://bugs.launchpad.net/mydumper/+bug/1517966
# It also ignores .a libs because of an issue with glib's static libraries now
# being included by default in homebrew.
#
# Although we override the mysql library location this patch is still required
# because the setting of ${CMAKE_FIND_LIBRARY_SUFFIXES} affects other probes as well.
patch :p0, :DATA
def install
system "cmake", ".", *std_cmake_args,
# Override location of mysql-client:
"-DMYSQL_CONFIG_PREFER_PATH=#{Formula["mysql-client"].opt_bin}",
"-DMYSQL_LIBRARIES=#{Formula["mysql-client"].opt_lib}/libmysqlclient.dylib",
# find_package(ZLIB) has troube on Big Sur since physical libz.dylib
# doesn't exist on the filesystem. Instead provide details ourselves:
"-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=1", "-DZLIB_INCLUDE_DIRS=/usr/include", "-DZLIB_LIBRARIES=-lz"
system "make", "install"
end
test do
system bin/"mydumper", "--help"
end
end
__END__
--- cmake/modules/FindMySQL.cmake 2015-09-16 16:11:34.000000000 -0400
+++ cmake/modules/FindMySQL.cmake 2015-09-16 16:10:56.000000000 -0400
@@ -84,7 +84,7 @@
)
set(TMP_MYSQL_LIBRARIES "")
-set(CMAKE_FIND_LIBRARY_SUFFIXES .so .a .lib .so.1)
+set(CMAKE_FIND_LIBRARY_SUFFIXES .so .lib .dylib .so.1)
foreach(MY_LIB ${MYSQL_ADD_LIBRARIES})
find_library("MYSQL_LIBRARIES_${MY_LIB}" NAMES ${MY_LIB}
HINTS