-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvips-lite.patch
126 lines (121 loc) · 4.04 KB
/
vips-lite.patch
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
--- vips.rb 2024-12-31 01:56:37.866604495 +0900
+++ vips-lite.rb 2024-12-31 01:56:02.551058578 +0900
@@ -1,4 +1,4 @@
-class Vips < Formula
+class VipsLite < Formula
desc "Image processing library"
homepage "https://github.com/libvips/libvips"
url "https://github.com/libvips/libvips/releases/download/v8.16.0/vips-8.16.0.tar.xz"
@@ -20,35 +20,14 @@
sha256 x86_64_linux: "7d1acd4661c389afe2b37616d813a542e0b9d0cc58929c4868a5841d42e41815"
end
- depends_on "gobject-introspection" => :build
+ keg_only "homebrew-core provides vips"
+
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => [:build, :test]
- depends_on "cairo"
- depends_on "cfitsio"
- depends_on "cgif"
- depends_on "fftw"
- depends_on "fontconfig"
- depends_on "gettext"
depends_on "glib"
- depends_on "highway"
- depends_on "imagemagick"
- depends_on "jpeg-xl"
- depends_on "libarchive"
- depends_on "libexif"
- depends_on "libheif"
- depends_on "libimagequant"
- depends_on "libmatio"
- depends_on "librsvg"
depends_on "libspng"
- depends_on "libtiff"
- depends_on "little-cms2"
depends_on "mozjpeg"
- depends_on "openexr"
- depends_on "openjpeg"
- depends_on "openslide"
- depends_on "pango"
- depends_on "poppler"
depends_on "webp"
uses_from_macos "python" => :build
@@ -59,20 +38,54 @@
# mozjpeg needs to appear before libjpeg, otherwise it's not used
ENV.prepend_path "PKG_CONFIG_PATH", Formula["mozjpeg"].opt_lib/"pkgconfig"
- system "meson", "setup", "build", *std_meson_args
+ system "meson", "setup", "build", *std_meson_args,
+ "-Djpeg=enabled",
+ "-Dspng=enabled",
+ "-Dwebp=enabled",
+ "-Dzlib=enabled",
+ "-Ddeprecated=false",
+ "-Dexamples=false",
+ "-Dmodules=disabled",
+ "-Dintrospection=disabled",
+ "-Dvapi=false",
+ "-Dcfitsio=disabled",
+ "-Dcgif=disabled",
+ "-Dexif=disabled",
+ "-Dfftw=disabled",
+ "-Dfontconfig=disabled",
+ "-Darchive=disabled",
+ "-Dheif=disabled",
+ "-Dheif-module=disabled",
+ "-Dimagequant=disabled",
+ "-Djpeg-xl=disabled",
+ "-Djpeg-xl-module=disabled",
+ "-Dlcms=disabled",
+ "-Dmagick=disabled",
+ "-Dmagick-package=",
+ "-Dmagick-module=disabled",
+ "-Dmatio=disabled",
+ "-Dnifti=disabled",
+ "-Dopenexr=disabled",
+ "-Dopenjpeg=disabled",
+ "-Dopenslide=disabled",
+ "-Dopenslide-module=disabled",
+ "-Dhighway=disabled",
+ "-Dorc=disabled",
+ "-Dpangocairo=disabled",
+ "-Dpdfium=disabled",
+ "-Dpng=disabled",
+ "-Dpoppler=disabled",
+ "-Dpoppler-module=disabled",
+ "-Dquantizr=disabled",
+ "-Drsvg=disabled",
+ "-Dtiff=disabled",
+ "-Dnsgif=false",
+ "-Dppm=false",
+ "-Danalyze=false",
+ "-Dradiance=false"
+
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
-
- if OS.mac?
- # `pkg-config --libs vips` includes libarchive, but that package is
- # keg-only so it needs to look for the pkgconfig file in libarchive's opt
- # path.
- libarchive = Formula["libarchive"].opt_prefix
- inreplace [lib/"pkgconfig/vips.pc", lib/"pkgconfig/vips-cpp.pc"] do |s|
- s.gsub!(/^Requires\.private:(.*)\blibarchive\b(.*?)(,.*)?$/,
- "Requires.private:\\1#{libarchive}/lib/pkgconfig/libarchive.pc\\3")
- end
- end
end
test do
@@ -84,11 +98,8 @@
cmd = "#{bin}/vips jpegsave #{test_fixtures("test.png")} #{testpath}/test.jpg --trellis-quant 2>&1"
assert_empty shell_output(cmd)
- # [palette] requires libimagequant, vips warns if it's not present
- cmd = "#{bin}/vips copy #{test_fixtures("test.png")} #{testpath}/test.png[palette] 2>&1"
- assert_empty shell_output(cmd)
-
# Make sure `pkg-config` can parse `vips.pc` and `vips-cpp.pc` after the `inreplace`.
+ ENV.prepend_path "PKG_CONFIG_PATH", Formula["vips-lite"].opt_lib/"pkgconfig"
system "pkgconf", "--print-errors", "vips"
system "pkgconf", "--print-errors", "vips-cpp"
end