/
argyll-cms.rb
122 lines (103 loc) 路 5 KB
/
argyll-cms.rb
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
class ArgyllCms < Formula
desc "ICC compatible color management system"
homepage "https://www.argyllcms.com/"
url "https://www.argyllcms.com/Argyll_V3.2.0_src.zip"
sha256 "4861ab87b41618fb6706843099aad2cc649115634dee1e60738792387b371176"
license "AGPL-3.0-only"
livecheck do
url "https://www.argyllcms.com/downloadsrc.html"
regex(/href=.*?Argyll[._-]v?(\d+(?:\.\d+)+)[._-]src\.zip/i)
end
bottle do
rebuild 1
sha256 cellar: :any, arm64_sonoma: "9416d935216f5054e63c9baa53364c28d96d678c70abaf4d697c41bcc9bed185"
sha256 cellar: :any, arm64_ventura: "6954dce83aba27dfa337eca3141fe1506bfcd72ffcc79d63040ba329d236a658"
sha256 cellar: :any, arm64_monterey: "9862c45da43e3cca13c78e82081c1dcaa5806dac6583c00f8eba95fe6ac298ed"
sha256 cellar: :any, sonoma: "4577cd47871d566e045db7872a94946b7a4fab52d38e52e39ce6b353aa6082fd"
sha256 cellar: :any, ventura: "2f13881ab15bd8d8b0aba4bf9ef4b9a40217c4b36b847190cc1f47e577f9bce3"
sha256 cellar: :any, monterey: "3259f5cd7063614fa2e2434b7be2ccd19971226d2d5bb1a7561c942b8c4625ef"
sha256 cellar: :any_skip_relocation, x86_64_linux: "746d1e088f61bdfbca13e17f5351cc81a22ccba3acc3ea8e0f7ebe38c4bd82c2"
end
depends_on "jpeg-turbo"
depends_on "libpng"
depends_on "libtiff"
depends_on "openssl@3"
uses_from_macos "zlib"
on_linux do
depends_on "libx11"
depends_on "libxinerama"
depends_on "libxrandr"
depends_on "libxscrnsaver"
depends_on "libxxf86vm"
depends_on "xorgproto"
end
conflicts_with "num-utils", because: "both install `average` binaries"
resource "jam" do
# The "Jam Documentation" page has a banner stating:
# "Perforce is no longer actively contributing to the Jam Open Source project.
# The last Perforce release of Jam was version 2.6 in August of 2014. We will
# keep the Perforce-controlled links and information posted here available
# until further notice."
# The argyll-cms maintainer told us that they want to keep jam as a build system
# even if it is not maintained anymore
# https://www.freelists.org/post/argyllcms/Status-of-Jam-build,1
# Vendoring jam will allow to get rid of our jam formula
url "https://swarm.workshop.perforce.com/downloads/guest/perforce_software/jam/jam-2.6.1.zip"
sha256 "72ea48500ad3d61877f7212aa3d673eab2db28d77b874c5a0b9f88decf41cb73"
# * Ensure <unistd.h> is included on macOS, fixing the following error:
# `make1.c:392:8: error: call to undeclared function 'unlink'`.
# * Fix a typo that leads to an undeclared function error:
# `parse.c:102:20: error: call to undeclared function 'yylineno'`
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/cf70f015e7398796660da57212ff0ab90c609acf/jam/2.6.1.patch"
sha256 "1850cf53c4db0e05978d52b90763b519c00fa4f2fbd6fc2753200e49943821ec"
end
end
def install
resource("jam").stage do
system "make", "CC=#{ENV.cc}", "CFLAGS=#{ENV.cflags}", "LOCATE_TARGET=bin"
libexec.install "bin/jam"
end
# Remove bundled libraries to prevent fallback
%w[jpeg png tiff zlib].each { |l| (buildpath/l).rmtree }
inreplace "Jamtop" do |s|
openssl = Formula["openssl@3"]
libname = shared_library("lib$(lcase)")
usr = if OS.mac?
"#{MacOS.sdk_path_if_needed}/usr"
else
"/usr"
end
# These two inreplaces make sure all Homebrew and SDK libraries can be found by the Jamfile
s.gsub! "[ GLOB /usr/include$(subd) : $(lcase).h $(lcase)lib.h ]",
"[ GLOB #{openssl.opt_include}$(subd) : $(lcase).h $(lcase)lib.h ] || " \
"[ GLOB #{HOMEBREW_PREFIX}/include$(subd) : $(lcase).h $(lcase)lib.h ] || " \
"[ GLOB #{usr}/include$(subd) : $(lcase).h $(lcase)lib.h ]"
s.gsub! "[ GLOB /usr/lib : lib$(lcase).so ]",
"[ GLOB #{openssl.opt_lib} : #{libname} ] || " \
"[ GLOB #{HOMEBREW_PREFIX}/lib : #{libname} ] || " \
"[ GLOB #{usr}/lib : #{libname} lib$(lcase).tbd ]"
# These two inreplaces make sure the X11 headers can be found on Linux.
s.gsub! "/usr/X11R6/include", HOMEBREW_PREFIX/"include"
s.gsub! "/usr/X11R6/lib", HOMEBREW_PREFIX/"lib"
end
ENV["NUMBER_OF_PROCESSORS"] = ENV.make_jobs.to_s
inreplace "makeall.sh", "jam", libexec/"jam"
inreplace "makeinstall.sh", "jam", libexec/"jam"
system "sh", "makeall.sh"
system "./makeinstall.sh"
rm "bin/License.txt"
prefix.install "bin", "ref", "doc"
rm libexec/"jam"
end
test do
system bin/"targen", "-d", "0", "test.ti1"
system bin/"printtarg", testpath/"test.ti1"
%w[test.ti1.ps test.ti1.ti1 test.ti1.ti2].each do |f|
assert_predicate testpath/f, :exist?
end
# Skip this part of the test on Linux because it hangs due to lack of a display.
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]
assert_match "Calibrate a Display", shell_output("#{bin}/dispcal 2>&1", 1)
end
end