Skip to content

Commit 19a8024

Browse files
authored
Merge pull request Homebrew#263377 from Homebrew/imagemagick_full
imagemagick: slim down formula
2 parents ca73203 + fc8f1e9 commit 19a8024

File tree

5 files changed

+171
-65
lines changed

5 files changed

+171
-65
lines changed

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ LICENSE.txt @Homebrew/lead-maintainers @MikeMcQuaid
1818
.github/workflows/triage.yml @Homebrew/lead-maintainers
1919
Formula/f/ffmpeg.rb @MikeMcQuaid
2020
Formula/f/ffmpeg-full.rb @MikeMcQuaid
21+
Formula/i/imagemagick.rb @MikeMcQuaid
22+
Formula/i/imagemagick-full.rb @MikeMcQuaid
2123

2224
audit_exceptions/linux_only_gcc_dependency_allowlist.json @Homebrew/lead-maintainers
2325
audit_exceptions/permitted_formula_license_mismatches.json @Homebrew/lead-maintainers @MikeMcQuaid

Formula/i/imagemagick-full.rb

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
class ImagemagickFull < Formula
2+
desc "Tools and libraries to manipulate images in many formats"
3+
homepage "https://imagemagick.org/index.php"
4+
url "https://imagemagick.org/archive/releases/ImageMagick-7.1.2-12.tar.xz"
5+
sha256 "e22c5dc6cd3f8e708a2809483fd10f8e37438ef7831ec8d3a07951ccd70eceba"
6+
license "ImageMagick"
7+
revision 2
8+
head "https://github.com/ImageMagick/ImageMagick.git", branch: "main"
9+
10+
livecheck do
11+
url "https://imagemagick.org/archive/"
12+
regex(/href=.*?ImageMagick[._-]v?(\d+(?:\.\d+)+-\d+)\.t/i)
13+
end
14+
15+
bottle do
16+
sha256 arm64_tahoe: "4e4faf644af0d4b684c83f8775dd95eb713ab85c81940c394c4c8acf3fe6510f"
17+
sha256 arm64_sequoia: "6761b474f366449e080554f241f2d5aeb966cff5e95a38af94d9858710bb4885"
18+
sha256 arm64_sonoma: "af102b8cb6925b4791de85cb5e0078e45ecd1cbb510e97cf37af1fa88d49a061"
19+
sha256 sonoma: "90d1e6abdd1d5b03e783fcc36fd42fbf614fd42cbb35fe2a742e1171164f2991"
20+
sha256 arm64_linux: "0c40dbe723e02769624a8068638b98e39868c77e6542c01fc90b1811351b27df"
21+
sha256 x86_64_linux: "8bd7821eff6ebb2325cbad886ae6992728539c42de2e4710e29ae49c4a50625e"
22+
end
23+
24+
keg_only :versioned_formula
25+
26+
depends_on "pkgconf" => :build
27+
depends_on "cairo"
28+
depends_on "fontconfig"
29+
depends_on "freetype"
30+
depends_on "ghostscript"
31+
depends_on "glib"
32+
depends_on "jpeg-turbo"
33+
depends_on "jpeg-xl"
34+
depends_on "libheif"
35+
depends_on "liblqr"
36+
depends_on "libpng"
37+
depends_on "libraw"
38+
depends_on "librsvg"
39+
depends_on "libtiff"
40+
depends_on "libtool"
41+
depends_on "libultrahdr"
42+
depends_on "libzip"
43+
depends_on "little-cms2"
44+
depends_on "openexr"
45+
depends_on "openjpeg"
46+
depends_on "webp"
47+
depends_on "xz"
48+
49+
uses_from_macos "bzip2"
50+
uses_from_macos "libxml2"
51+
uses_from_macos "zlib"
52+
53+
on_macos do
54+
depends_on "gdk-pixbuf"
55+
depends_on "gettext"
56+
depends_on "imath"
57+
depends_on "libomp"
58+
end
59+
60+
on_linux do
61+
depends_on "libx11"
62+
depends_on "libxext"
63+
end
64+
65+
skip_clean :la
66+
67+
# Patch to fix build with LibRaw 0.22+
68+
patch do
69+
url "https://gitlab.archlinux.org/archlinux/packaging/packages/imagemagick/-/raw/ca9b35f767e1c4a166847fbfe17c2d715aa80582/libraw-0.22.patch"
70+
sha256 "baed7cbfb378734d32d277b6e13882ac541932ef67e6aa8867b185ffef12f986"
71+
end
72+
73+
def install
74+
# Avoid references to shim
75+
inreplace Dir["**/*-config.in"], "@PKG_CONFIG@", Formula["pkg-config"].opt_bin/"pkg-config"
76+
# versioned stuff in main tree is pointless for us
77+
inreplace "configure", "${PACKAGE_NAME}-${PACKAGE_BASE_VERSION}", "${PACKAGE_NAME}"
78+
79+
args = [
80+
"--enable-osx-universal-binary=no",
81+
"--disable-silent-rules",
82+
"--disable-opencl",
83+
"--enable-shared",
84+
"--enable-static",
85+
"--with-freetype=yes",
86+
"--with-rsvg=yes",
87+
"--with-gvc=no",
88+
"--with-modules",
89+
"--with-openjp2",
90+
"--with-openexr",
91+
"--with-webp=yes",
92+
"--with-heic=yes",
93+
"--with-raw=yes",
94+
"--with-uhdr=yes",
95+
"--with-zip=yes",
96+
"--with-gslib",
97+
"--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts",
98+
"--with-lqr",
99+
"--without-djvu",
100+
"--without-fftw",
101+
"--without-pango",
102+
"--without-wmf",
103+
"--enable-openmp",
104+
]
105+
if OS.mac?
106+
args += [
107+
"--without-x",
108+
# Work around "checking for clang option to support OpenMP... unsupported"
109+
"ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp",
110+
"ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp",
111+
"LDFLAGS=-lomp -lz",
112+
]
113+
end
114+
115+
system "./configure", *args, *std_configure_args
116+
system "make", "install"
117+
end
118+
119+
def caveats
120+
<<~EOS
121+
imagemagick-full includes additional tools and libraries that are not included in the regular imagemagick formula.
122+
EOS
123+
end
124+
125+
test do
126+
assert_match "PNG", shell_output("#{bin}/identify #{test_fixtures("test.png")}")
127+
128+
# Check support for recommended features and delegates.
129+
features = shell_output("#{bin}/magick -version")
130+
%w[Modules freetype heic jpeg png raw rsvg tiff].each do |feature|
131+
assert_match feature, features
132+
end
133+
134+
# Check support for a few specific image formats, mostly to ensure LibRaw linked correctly.
135+
formats = shell_output("#{bin}/magick -list format")
136+
["AVIF HEIC rw+", "ARW DNG r--", "DNG DNG r--"].each do |format|
137+
assert_match format, formats
138+
end
139+
end
140+
end

Formula/i/imagemagick.rb

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Imagemagick < Formula
2-
desc "Tools and libraries to manipulate images in many formats"
2+
desc "Tools and libraries to manipulate images in select formats"
33
homepage "https://imagemagick.org/index.php"
44
url "https://imagemagick.org/archive/releases/ImageMagick-7.1.2-12.tar.xz"
55
sha256 "e22c5dc6cd3f8e708a2809483fd10f8e37438ef7831ec8d3a07951ccd70eceba"
66
license "ImageMagick"
7-
revision 1
7+
revision 2
88
head "https://github.com/ImageMagick/ImageMagick.git", branch: "main"
99

1010
livecheck do
@@ -13,32 +13,28 @@ class Imagemagick < Formula
1313
end
1414

1515
bottle do
16-
sha256 arm64_tahoe: "70a4007af2df1cbceee0f1d245b9c3b63610c7e47ea17bafb6722964b401c8b3"
17-
sha256 arm64_sequoia: "aa09d81bf684995f2b039a6fea27b58c5fa68d69af3b1111bc4f659a691e55ba"
18-
sha256 arm64_sonoma: "3a6ab91642e7cd983422eddfc2535c56365dad208e4ecc10b2162fab2029e55d"
19-
sha256 sonoma: "126ce8dfc0ac26bcc92193f6c27d49a9d79a9fa652cf56bb37107f2789736940"
20-
sha256 arm64_linux: "0e44e1adc76f7985b20ef49cbeb1a96128b748fc27c2c8d52b3b2e192744c38d"
21-
sha256 x86_64_linux: "97bf08e3d0a9dc3adaed58d3b6142bee0542de0add7c7882ccebf28f783a8949"
16+
sha256 arm64_tahoe: "aad5fc7749d91edf4f9f8340a9a89b042368dc353e7751ab3fa463e2c78ec336"
17+
sha256 arm64_sequoia: "cb1edb6b9073b44f9a9a9a96e88f2061be3332a8a933e329540764f8cc0f2983"
18+
sha256 arm64_sonoma: "068e0c8ba5387c15421a00265147b04c3afdff8aa7c56cb1841c9a9c4467955a"
19+
sha256 sonoma: "d5b690a4b989f732c022673dc1a76ee566a10d290c536435b7408f74ef96c1f5"
20+
sha256 arm64_linux: "724870b999a939457eb40326bdc8e8231b9a71f94a8b6cf50c19199b4b583df2"
21+
sha256 x86_64_linux: "f9f3f1107aa32df9e481fca5cf2ade56b6d22072283d83d9007d1234d724c78c"
2222
end
2323

2424
depends_on "pkgconf" => :build
25-
depends_on "cairo"
26-
depends_on "fontconfig"
27-
depends_on "freetype"
25+
26+
# Only add dependencies required for dependents in homebrew-core,
27+
# recursive dependencies or INCREDIBLY widely used and light formats in the
28+
# current year (2026).
29+
# Add other dependencies to imagemagick-full formula or consider making
30+
# formulae dependent on imagemagick-full.
31+
depends_on "glib"
2832
depends_on "jpeg-turbo"
29-
depends_on "jpeg-xl"
3033
depends_on "libheif"
31-
depends_on "liblqr"
3234
depends_on "libpng"
33-
depends_on "libraw"
34-
depends_on "librsvg"
3535
depends_on "libtiff"
3636
depends_on "libtool"
37-
depends_on "libultrahdr"
38-
depends_on "libzip"
3937
depends_on "little-cms2"
40-
depends_on "openexr"
41-
depends_on "openjpeg"
4238
depends_on "webp"
4339
depends_on "xz"
4440

@@ -47,27 +43,12 @@ class Imagemagick < Formula
4743
uses_from_macos "zlib"
4844

4945
on_macos do
50-
depends_on "gdk-pixbuf"
5146
depends_on "gettext"
52-
depends_on "glib"
5347
depends_on "imath"
54-
depends_on "libomp"
55-
end
56-
57-
on_linux do
58-
depends_on "glib"
59-
depends_on "libx11"
60-
depends_on "libxext"
6148
end
6249

6350
skip_clean :la
6451

65-
# Patch to fix build with LibRaw 0.22+
66-
patch do
67-
url "https://gitlab.archlinux.org/archlinux/packaging/packages/imagemagick/-/raw/ca9b35f767e1c4a166847fbfe17c2d715aa80582/libraw-0.22.patch"
68-
sha256 "baed7cbfb378734d32d277b6e13882ac541932ef67e6aa8867b185ffef12f986"
69-
end
70-
7152
def install
7253
# Avoid references to shim
7354
inreplace Dir["**/*-config.in"], "@PKG_CONFIG@", Formula["pkg-config"].opt_bin/"pkg-config"
@@ -80,33 +61,23 @@ def install
8061
"--disable-opencl",
8162
"--enable-shared",
8263
"--enable-static",
83-
"--with-freetype=yes",
84-
"--with-rsvg=yes",
8564
"--with-gvc=no",
8665
"--with-modules",
87-
"--with-openjp2",
88-
"--with-openexr",
8966
"--with-webp=yes",
9067
"--with-heic=yes",
91-
"--with-raw=yes",
92-
"--with-uhdr=yes",
93-
"--with-zip=yes",
68+
"--with-raw=no",
9469
"--without-gslib",
95-
"--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts",
9670
"--with-lqr",
9771
"--without-djvu",
9872
"--without-fftw",
9973
"--without-pango",
10074
"--without-wmf",
101-
"--enable-openmp",
75+
"--without-jxl",
76+
"--without-openexr",
10277
]
10378
if OS.mac?
10479
args += [
10580
"--without-x",
106-
# Work around "checking for clang option to support OpenMP... unsupported"
107-
"ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp",
108-
"ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp",
109-
"LDFLAGS=-lomp -lz",
11081
]
11182
end
11283

@@ -116,8 +87,7 @@ def install
11687

11788
def caveats
11889
<<~EOS
119-
Ghostscript is not installed by default as a dependency.
120-
If you need PS or PDF support, ImageMagick will still use the ghostscript formula if installed directly.
90+
imagemagick-full includes additional tools and libraries that are not included in the regular imagemagick formula.
12191
EOS
12292
end
12393

@@ -126,14 +96,8 @@ def caveats
12696

12797
# Check support for recommended features and delegates.
12898
features = shell_output("#{bin}/magick -version")
129-
%w[Modules freetype heic jpeg png raw rsvg tiff].each do |feature|
99+
%w[Modules heic jpeg png tiff].each do |feature|
130100
assert_match feature, features
131101
end
132-
133-
# Check support for a few specific image formats, mostly to ensure LibRaw linked correctly.
134-
formats = shell_output("#{bin}/magick -list format")
135-
["AVIF HEIC rw+", "ARW DNG r--", "DNG DNG r--"].each do |format|
136-
assert_match format, formats
137-
end
138102
end
139103
end

Formula/v/vapoursynth-imwri.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,25 @@ class VapoursynthImwri < Formula
1111
no_autobump! because: :requires_manual_review
1212

1313
bottle do
14-
sha256 cellar: :any, arm64_tahoe: "cc90cc4f2d65c9f885c7fe4557766fdfb19a868f1a6ef9166803851a3fb8d798"
15-
sha256 cellar: :any, arm64_sequoia: "05e577ee12e4337fb9af5870c39c485e5e7a5ac4b56365361e9c2e7e35eca388"
16-
sha256 cellar: :any, arm64_sonoma: "2bbe0c55617799e49cfd693a838565894dc7ecb5fbcaef0b72e9103da674999d"
17-
sha256 cellar: :any, arm64_ventura: "8795d8f3142e89ca1785f5d83312ab82ae4c24dc0e92b54aae294dbca1d14d0c"
18-
sha256 cellar: :any, sonoma: "6ffe0859ceae64e20741fb000a0319b456dd51d437e35e79f354eabcdface889"
19-
sha256 cellar: :any, ventura: "92866496e81b76604e8f4fbd5cab2d6d94d2f83cb4521e731802445ebcbd86e6"
20-
sha256 arm64_linux: "f90a76a7b71b8d829a4f90c0969b2f7321f849f1ab9616f136cf943ffe198d10"
21-
sha256 x86_64_linux: "099e77da73bbc6d8333e6067705d531ba193d3a496d8c99fc5287f7bec4f5ac2"
14+
rebuild 1
15+
sha256 cellar: :any, arm64_tahoe: "7a8829c333c4d82d927f3cfc9c88a5d162b230924f17003b44b86f8b61966ff8"
16+
sha256 cellar: :any, arm64_sequoia: "04dc93bb5a1c4a49b90f29800901f4c6cc00f6a024512e3a94f06864724524df"
17+
sha256 cellar: :any, arm64_sonoma: "90d9c3dbeceab3b486f1a73273079fff14e4b70ee85e70a766b672ffa25df7f2"
18+
sha256 cellar: :any, sonoma: "11435523067bbf5c1cfd7c9597b1340afe4f34c94c64f8d0667e3d580c84ebe5"
19+
sha256 arm64_linux: "b72bf4ebcdaade6cb9e1ac993c2334fda6aa69b54dab5c5deb58b804fd193d5d"
20+
sha256 x86_64_linux: "21b4c595a5528b6d61eaba2d223e2f51bdf2b69ff50d623a915fc55a98263513"
2221
end
2322

2423
depends_on "meson" => :build
2524
depends_on "ninja" => :build
2625
depends_on "pkgconf" => :build
2726

2827
depends_on "imagemagick"
28+
depends_on "libheif"
2929
depends_on "vapoursynth"
3030

3131
on_macos do
3232
depends_on "jpeg-xl"
33-
depends_on "libheif"
3433
depends_on "libtiff"
3534
end
3635

synced_versions_formulae.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
["gmic", "cimg"],
3333
["gnome-online-accounts", "libgoa"],
3434
["hdf5", "hdf5-mpi"],
35+
["imagemagick", "imagemagick-full"],
3536
["libmediainfo", "media-info"],
3637
["libnetworkit", "networkit"],
3738
["libnghttp2", "nghttp2"],

0 commit comments

Comments
 (0)