Skip to content

Commit df4043d

Browse files
committed
ctl: backport OpenEXR 3 support to avoid deprecation
`ilmbase` and `openexr@2` were originally deprecated and are planned for re-deprecation (Homebrew#106902). In order to avoid deprecating `ctl`, we backport all upstream commits necessary to migrate to latest `imath` and `openexr`.
1 parent c9bee7d commit df4043d

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

Formula/ctl.rb

+32-25
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
class Ctl < Formula
22
desc "Programming language for digital color management"
33
homepage "https://github.com/ampas/CTL"
4-
# Check whether this can be switched to `openexr` and `imath` at version bump
5-
url "https://github.com/ampas/CTL/archive/ctl-1.5.2.tar.gz"
6-
sha256 "d7fac1439332c4d84abc3c285b365630acf20ea041033b154aa302befd25e0bd"
74
license "AMPAS"
8-
revision 7
5+
revision 8
6+
head "https://github.com/ampas/CTL.git", branch: "master"
7+
8+
stable do
9+
url "https://github.com/ampas/CTL/archive/ctl-1.5.2.tar.gz"
10+
sha256 "d7fac1439332c4d84abc3c285b365630acf20ea041033b154aa302befd25e0bd"
11+
12+
# Backport support for OpenEXR/Imath 3. Remove in the next release.
13+
# Due to large number of changes from last stable release to OpenEXR 3 commit
14+
# https://github.com/ampas/CTL/commit/3fc4ae7a8af35d380654e573d895216fd5ba407e,
15+
# we apply a patch generated from GitHub compare range.
16+
patch do
17+
url "https://github.com/ampas/CTL/compare/ctl-1.5.2..3fc4ae7a8af35d380654e573d895216fd5ba407e.patch?full_index=1"
18+
sha256 "701df07c80ad10341d8e70da09ce4a624ae3cccbe86e72bf07e6e6187bca96cc"
19+
end
20+
21+
# Fix installation error: file cannot create directory: /CTL.
22+
# Remove in the next release.
23+
patch do
24+
url "https://github.com/ampas/CTL/commit/f2474a09f647426302472009649edb4c3daac471.patch?full_index=1"
25+
sha256 "9adb22c5558bf661afea173695bad0a23a19af12981ba31c9fc0c6f9129fe6f1"
26+
end
27+
end
928

1029
bottle do
1130
sha256 cellar: :any, arm64_ventura: "4e53012495e07442d42c90ef1e566a07b114768054980bc10cd74511cb4e1a85"
@@ -20,30 +39,18 @@ class Ctl < Formula
2039

2140
depends_on "cmake" => :build
2241
depends_on "aces_container"
23-
depends_on "ilmbase"
42+
depends_on "imath"
2443
depends_on "libtiff"
25-
depends_on "openexr@2"
26-
27-
# from https://github.com/ampas/CTL/pull/73
28-
patch do
29-
url "https://github.com/ampas/CTL/commit/bda2165b97e512a39ee67cf36fe95e1d897e823b.patch?full_index=1"
30-
sha256 "09145020a79b180bb8bb8e18129194b064d4c8a949940fb97be4945b99b06d7f"
31-
end
32-
33-
# from https://github.com/ampas/CTL/pull/74
34-
patch do
35-
url "https://github.com/ampas/CTL/commit/0646adf9dcf966db3c6ec9432901c08387c1a1eb.patch?full_index=1"
36-
sha256 "5ec79eed7499612855d09d7bb18a66a660b6be9785fdfcc880d946f95fb7a44c"
37-
end
44+
depends_on "openexr"
3845

3946
def install
40-
ENV.cxx11
41-
ENV.delete "CTL_MODULE_PATH"
42-
43-
mkdir "build" do
44-
system "cmake", "..", *std_cmake_args
45-
system "make", "install"
46-
end
47+
system "cmake", "-S", ".", "-B", "build",
48+
"-DBUILD_SHARED_LIBS=ON",
49+
"-DCMAKE_INSTALL_RPATH=#{rpath}",
50+
"-DCTL_BUILD_TESTS=OFF",
51+
*std_cmake_args
52+
system "cmake", "--build", "build"
53+
system "cmake", "--install", "build"
4754
end
4855

4956
test do

0 commit comments

Comments
 (0)