99 lines
2.9 KiB
Ruby
99 lines
2.9 KiB
Ruby
class Imagemagick < Formula
|
|
desc "Tools and libraries to manipulate images in many formats"
|
|
homepage "https://www.imagemagick.org/"
|
|
url "https://dl.bintray.com/homebrew/mirror/ImageMagick-7.0.11-3.tar.xz"
|
|
mirror "https://www.imagemagick.org/download/releases/ImageMagick-7.0.11-3.tar.xz"
|
|
sha256 "3a970d1afd5e8fa08754ee8e097af4b7b088e6cd17cf55f1d3a9999d20018bc5"
|
|
license "ImageMagick"
|
|
head "https://github.com/ImageMagick/ImageMagick.git"
|
|
|
|
livecheck do
|
|
url "https://download.imagemagick.org/ImageMagick/download/"
|
|
regex(/href=.*?ImageMagick[._-]v?(\d+(?:\.\d+)+-\d+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "420edef75429398019172ddf4ef05c46f9b06225f92af054efe9d195884359a4"
|
|
sha256 big_sur: "51de4599cf631810750c36c39cbec1251782096bcb6399a53ab8beda88b65260"
|
|
sha256 catalina: "d3cbc778196046e2f833b0746e085aae58d4e99d0b5e466da08c8d4738c3421f"
|
|
sha256 mojave: "39707051a2c8f5563f3291833938a7a23766bb96c347d304f1b6dc344a4a5d00"
|
|
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 = %W[
|
|
--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
|
|
]
|
|
|
|
on_macos do
|
|
args << "--without-x"
|
|
end
|
|
|
|
# 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
|