Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grokj2k: unbundle jpeg-turbo and little-cms2 #196906

Merged
2 commits merged into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Formula/g/grokj2k.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,15 @@ def install
# Fix: ExifTool Perl module not found
ENV.prepend_path "PERL5LIB", Formula["exiftool"].opt_libexec/"lib"

# Ensure we use Homebrew little-cms2
# Ensure we use Homebrew libraries
%w[liblcms2 libpng libtiff libz].each { |l| rm_r(buildpath/"thirdparty"/l) }
inreplace "thirdparty/CMakeLists.txt" do |s|
s.gsub! "add_subdirectory(liblcms2)", ""
s.gsub! %r{(set\(LCMS_INCLUDE_DIRNAME) \$\{GROK_SOURCE_DIR\}/thirdparty/liblcms2/include},
"\\1 #{Formula["little-cms2"].opt_include}"
end

perl = DevelopmentTools.locate("perl")
perl_archlib = Utils.safe_popen_read(perl.to_s, "-MConfig", "-e", "print $Config{archlib}")
args = %W[
-DGRK_BUILD_DOC=ON
-DGRK_BUILD_JPEG=OFF
-DGRK_BUILD_LCMS2=OFF
-DGRK_BUILD_LIBPNG=OFF
-DGRK_BUILD_LIBTIFF=OFF
-DPERL_EXECUTABLE=#{perl}
Expand All @@ -86,7 +83,7 @@ def install
ENV.append "LDFLAGS", "-Wl,-rpath,#{perl_archlib}/CORE"
end

system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
include.install_symlink "grok-#{version.major_minor}" => "grok"
Expand Down
Loading