98 lines
3.1 KiB
Ruby
98 lines
3.1 KiB
Ruby
class Imagemagick < Formula
|
|
desc "Tools and libraries to manipulate images in many formats"
|
|
homepage "https://imagemagick.org/index.php"
|
|
url "https://www.imagemagick.org/download/releases/ImageMagick-7.1.0-19.tar.xz"
|
|
sha256 "3fd79174ab0f30bc1643af3e654f1d2ffcc3a9554263981155688b4f49f7fd77"
|
|
license "ImageMagick"
|
|
head "https://github.com/ImageMagick/ImageMagick.git", branch: "main"
|
|
|
|
livecheck do
|
|
url "https://download.imagemagick.org/ImageMagick/download/"
|
|
regex(/href=.*?ImageMagick[._-]v?(\d+(?:\.\d+)+-\d+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "b0f385e6eb86b0a27ff8e820e1324805ca5fa4b175ba1a8c2991a1894517123a"
|
|
sha256 arm64_big_sur: "9c7cfee6544b370aedde789595804c00506a9dbc3ae65e70150eae203aac6bf2"
|
|
sha256 monterey: "d88f50b40cc2623b429ebf626f91aa210b65f441a24e3838992c99995200be8c"
|
|
sha256 big_sur: "4a43dd1dfcc3d08434ba054643c2c3906cab2feb9881a4462e6770111e90117a"
|
|
sha256 catalina: "615a6f32e044d3a5d298fc803a47cebb7e3364871b3e4d05e7477386b7bf20f3"
|
|
sha256 x86_64_linux: "2c3e17656493158300f5e4409a908bf0f8be08eb28c6b726d5340128c08f8c8b"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "freetype"
|
|
depends_on "ghostscript"
|
|
depends_on "jpeg"
|
|
depends_on "libheif"
|
|
depends_on "liblqr"
|
|
depends_on "libomp"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "libtool"
|
|
depends_on "little-cms2"
|
|
depends_on "openexr"
|
|
depends_on "openjpeg"
|
|
depends_on "webp"
|
|
depends_on "xz"
|
|
|
|
uses_from_macos "bzip2"
|
|
uses_from_macos "libxml2"
|
|
uses_from_macos "zlib"
|
|
|
|
on_linux do
|
|
depends_on "libx11"
|
|
end
|
|
|
|
skip_clean :la
|
|
|
|
def install
|
|
# Avoid references to shim
|
|
inreplace Dir["**/*-config.in"], "@PKG_CONFIG@", Formula["pkg-config"].opt_bin/"pkg-config"
|
|
|
|
args = [
|
|
"--enable-osx-universal-binary=no",
|
|
"--prefix=#{prefix}",
|
|
"--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--disable-opencl",
|
|
"--enable-shared",
|
|
"--enable-static",
|
|
"--with-freetype=yes",
|
|
"--with-gvc=no",
|
|
"--with-modules",
|
|
"--with-openjp2",
|
|
"--with-openexr",
|
|
"--with-webp=yes",
|
|
"--with-heic=yes",
|
|
"--with-gslib",
|
|
"--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts",
|
|
"--with-lqr",
|
|
"--without-fftw",
|
|
"--without-pango",
|
|
"--without-wmf",
|
|
"--enable-openmp",
|
|
"ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp",
|
|
"ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp",
|
|
"LDFLAGS=-lomp -lz",
|
|
]
|
|
|
|
args << "--without-x" if OS.mac?
|
|
|
|
# versioned stuff in main tree is pointless for us
|
|
inreplace "configure", "${PACKAGE_NAME}-${PACKAGE_BASE_VERSION}", "${PACKAGE_NAME}"
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
assert_match "PNG", shell_output("#{bin}/identify #{test_fixtures("test.png")}")
|
|
# Check support for recommended features and delegates.
|
|
features = shell_output("#{bin}/convert -version")
|
|
%w[Modules freetype jpeg png tiff].each do |feature|
|
|
assert_match feature, features
|
|
end
|
|
assert_match "Helvetica", shell_output("#{bin}/identify -list font")
|
|
end
|
|
end
|