-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (115 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class ShopifyImagemagickAT6 < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://www.imagemagick.org/"
# Please always keep the Homebrew mirror as the primary URL as the
# ImageMagick site removes tarballs regularly which means we get issues
# unnecessarily and older versions of the formula are broken.
url "https://download.imagemagick.org/ImageMagick/download/releases/ImageMagick-6.9.9-51.tar.xz"
mirror "https://github.com/Shopify/homebrew-shopify/releases/download/bag-of-holding/ImageMagick-6.9.9-51.tar.xz"
sha256 "aa5f6b1e97bd98fbf642c47487531bea0faf675c728d01130b52d2b46849104a"
head "https://github.com/imagemagick/imagemagick.git", :branch => "ImageMagick-6"
bottle do
root_url 'https://github.com/Shopify/homebrew-shopify/releases/download/bag-of-holding'
sha256 arm64_monterey: "77162c495611f55383042a98879456d92785a4afb1a6c46d76614c78a8820365"
end
conflicts_with "imagemagick@6", :because => "imagemagick@6 is newer but unsupported in rmagick"
keg_only :versioned_formula
option "with-fftw", "Compile with FFTW support"
option "with-hdri", "Compile with HDRI support"
option "with-opencl", "Compile with OpenCL support"
option "with-openmp", "Compile with OpenMP support"
option "with-perl", "Compile with PerlMagick"
option "without-magick-plus-plus", "disable build/install of Magick++"
option "without-modules", "Disable support for dynamically loadable modules"
option "without-threads", "Disable threads support"
option "with-zero-configuration", "Disables depending on XML configuration files"
deprecated_option "enable-hdri" => "with-hdri"
deprecated_option "with-gcc" => "with-openmp"
deprecated_option "with-jp2" => "with-openjpeg"
depends_on "pkg-config" => :build
depends_on "libtool"
depends_on "xz"
depends_on "jpeg" => :recommended
depends_on "libpng" => :recommended
depends_on "libtiff" => :recommended
depends_on "freetype" => :recommended
depends_on "fontconfig" => :optional
depends_on "little-cms" => :optional
depends_on "little-cms2" => :optional
depends_on "libwmf" => :optional
depends_on "librsvg" => :optional
depends_on "liblqr" => :optional
depends_on "openexr" => :optional
depends_on "ghostscript" => :optional
depends_on "webp" => :optional
depends_on "openjpeg" => :optional
depends_on "fftw" => :optional
depends_on "pango" => :optional
depends_on "perl" => :optional
if build.with? "openmp"
depends_on "gcc"
fails_with :clang
end
skip_clean :la
def install
args = %W[
--disable-osx-universal-binary
--prefix=#{prefix}
--disable-dependency-tracking
--disable-silent-rules
--enable-shared
--enable-static
]
if build.without? "modules"
args << "--without-modules"
else
args << "--with-modules"
end
if build.with? "opencl"
args << "--enable-opencl"
else
args << "--disable-opencl"
end
if build.with? "openmp"
args << "--enable-openmp"
else
args << "--disable-openmp"
end
if build.with? "webp"
args << "--with-webp=yes"
else
args << "--without-webp"
end
if build.with? "openjpeg"
args << "--with-openjp2"
else
args << "--without-openjp2"
end
args << "--without-gslib" if build.without? "ghostscript"
args << "--with-perl" << "--with-perl-options='PREFIX=#{prefix}'" if build.with? "perl"
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" if build.without? "ghostscript"
args << "--without-magick-plus-plus" if build.without? "magick-plus-plus"
args << "--enable-hdri=yes" if build.with? "hdri"
args << "--without-fftw" if build.without? "fftw"
args << "--without-pango" if build.without? "pango"
args << "--without-threads" if build.without? "threads"
args << "--with-rsvg" if build.with? "librsvg"
args << "--without-x" if build.without? "libx11"
args << "--with-fontconfig=yes" if build.with? "fontconfig"
args << "--with-freetype=yes" if build.with? "freetype"
args << "--enable-zero-configuration" if build.with? "zero-configuration"
args << "--without-wmf" if build.without? "libwmf"
# versioned stuff in main tree is pointless for us
inreplace "configure", "${PACKAGE_NAME}-${PACKAGE_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
end
end