Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion Formula/c/colmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Colmap < Formula
url "https://github.com/colmap/colmap/archive/refs/tags/3.11.1.tar.gz"
sha256 "d2c20729ab5b1198e17725b720128f304f4cfae5c0a8c20d75c0e9c5bdee5860"
license "BSD-3-Clause"
revision 2
revision 3

bottle do
sha256 cellar: :any, arm64_sequoia: "a10d84ff5e6e26782f2043ea71657f741f6ad2a84870b15126d52dd75216fab8"
Expand Down Expand Up @@ -44,6 +44,12 @@ class Colmap < Formula
depends_on "mesa"
end

# Backport build fix. Remove in the next release
patch do
url "https://github.com/colmap/colmap/commit/a586e7cb223cc86c609105246ecd3a10e0c55131.patch?full_index=1"
sha256 "9d8a1699c87d7989a78820ba82717a7222761f329639e45ace23e6f84df973c4"
end

def install
ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].prefix

Expand Down
1 change: 1 addition & 0 deletions Formula/f/forge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Forge < Formula
url "https://github.com/arrayfire/forge/archive/refs/tags/v1.0.8.tar.gz"
sha256 "77d2581414d6392aa51748454b505a747cd63404f63d3e1ddeafae6a0664419c"
license "BSD-3-Clause"
revision 1

livecheck do
url :stable
Expand Down
126 changes: 103 additions & 23 deletions Formula/f/freeimage.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,84 @@
class Freeimage < Formula

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / Linux x86_64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)

Check notice on line 1 in Formula/f/freeimage.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

Bottle cache hit

Bottle for freeimage built at 7b8e4f2dd8e (Merge 0ab9360577f33d40e57bfd20bfd1991bc68fa48f into 436bced829a369d83ac3d897206fb3f2e7864d4e, 2025-04-19)
desc "Library for FreeImage, a dependency-free graphics library"
desc "Graphics library"
homepage "https://sourceforge.net/projects/freeimage/"
url "https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.18.0/FreeImage3180.zip"
version "3.18.0"
sha256 "f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd"
license "FreeImage"
head "https://svn.code.sf.net/p/freeimage/svn/FreeImage/trunk/"

stable do
url "https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.18.0/FreeImage3180.zip"
version "3.18.0"
sha256 "f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd"

depends_on "pkgconf" => :build
depends_on "imath"
depends_on "jpeg-turbo"
depends_on "jxrlib"
depends_on "libpng"
depends_on "libraw"
depends_on "libtiff"
depends_on "openexr"
depends_on "openjpeg"
depends_on "webp"

uses_from_macos "zlib"

# Apply Debian patches to unbundle libraries and fix some CVEs. Debian's
# unbundle patch is based on Fedora's patch though some differences like
# LDFLAGS vs. LIBRARIES usage makes the Debian patch more suitable when
# building on an Ubuntu machine.
patch do
url "https://deb.debian.org/debian/pool/main/f/freeimage/freeimage_3.18.0+ds2-11.debian.tar.xz"
sha256 "4ebd3a84c696dd650d756a43ec60fe22f5b2e591bc5cf8df94a605c5d740c904"
# Debian patches to unbundle libraries and build without root
apply "patches/Disable-vendored-dependencies.patch",
"patches/Use-system-dependencies.patch",
"patches/build-without-root.patch",
# fixes for newer `libraw`
"patches/Fix-macro-redefinition-for-64-bit-integer-types.patch",
"patches/Fix-libraw-compilation.patch",
"patches/Fix-libraw-compilation-2.patch",
# fixes for newer `jpeg-turbo`
"patches/Fix_compilation_external-static.patch",
"patches/Use-system-jpeg_read_icc_profile.patch",
# CVE-2019-12211
"patches/CVE-2019-12211-13.patch",
# CVE-2020-21427
"patches/r1830-minor-refactoring.patch",
"patches/r1832-improved-BMP-plugin-when-working-with-malicious-images.patch",
"patches/r1836-improved-BMP-plugin-when-working-with-malicious-images.patch",
# CVE-2020-22524
"patches/r1848-improved-PFM-plugin-against-malicious-images.patch",
# CVE-2020-21428
"patches/r1877-improved-DDS-plugin-against-malicious-images.patch"
end

# Modify Debian patch for Homebrew compatibility like `jxrlib` path
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/debian-to-homebrew.patch"
sha256 "fb678426fe403a07dc9bd9dd0d18237fcb5f815a0a3660d1757d200fa9b2d23a"
end

# Fix build with unbundled `imath` as type change impacts macOS.
# May be able to remove if upstream updates bundled OpenEXR.
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/imath-int64.patch"
sha256 "e940d5925bcfc9cfd40a01e8d7f45747b49c757e0f7995b6255f228022d1a3d5"
end

# Workaround to silence some warnings from unbundled `libtiff` otherwise
# dependents like `perceptualdiff` will flood warnings as tags are searched
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/libtiff-warning.patch"
sha256 "ab9281cb3f2a4aa67cb6de15e7876666d5894374087ff9fad635ef6de351e9b1"
end

# Makefile.osx isn't ideal for Homebrew use so modify Linux Makefiles for macOS
patch do
on_macos do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/macos.patch"
sha256 "231248bab0a92c7004b33c3c4590f40496f551c818222dda2a4634d4c3edc0ca"
end
end
end

bottle do
rebuild 3
Expand All @@ -23,32 +96,39 @@
sha256 cellar: :any_skip_relocation, x86_64_linux: "a6c63d08f4adf2395f983ad5f8a51f36ac1e749de9fe6428d056859b199ac6e6"
end

patch do
on_macos do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/4dcf528/freeimage/3.17.0.patch"
sha256 "8ef390fece4d2166d58e739df76b5e7996c879efbff777a8a94bcd1dd9a313e2"
end
on_linux do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/696e313c1f89925a8d04f00282d3b6c204a64f48/freeimage/3.17.0-linux.patch"
sha256 "537a4045d31a3ce1c3bab2736d17b979543758cf2081e97fff4d72786f1830dc"
head do
url "https://svn.code.sf.net/p/freeimage/svn/FreeImage/trunk/"

patch do
on_macos do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/head-macos.patch"
sha256 "f113aa6a815584dc604e83c1bf64c00dff6259dd0068f2d10798690d43cc2cb2"
end
on_linux do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/53efe785df9a41a00d63a9ff088a9846bceba398/freeimage/head-linux.patch"
sha256 "dad2e80c19c927c0502142843b9551af869e29bb5555fe3f301f9e588cb74253"
end
end
end

def install
# Temporary workaround for ARM. Upstream tracking issue:
# https://sourceforge.net/p/freeimage/bugs/325/
# https://sourceforge.net/p/freeimage/discussion/36111/thread/cc4cd71c6e/
ENV["CFLAGS"] = "-O3 -fPIC -fexceptions -fvisibility=hidden -DPNG_ARM_NEON_OPT=0" if Hardware::CPU.arm?
if build.stable?
# OpenEXR 3+ needs at least C++11. Can remove after https://sourceforge.net/p/freeimage/svn/1821/
ENV.cxx11

# Fix compile with newer Clang
ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403
# Avoid overlinking to `little-cms2` and help find installed freeimage library
ENV.append "LDFLAGS", "-Wl,#{OS.mac? ? "-dead_strip_dylibs" : "--as-needed"} -L#{lib}"

# Remove the bundled libraries and regenerate some Makefiles
rm_r([*Dir["Source/Lib*"], "Source/ZLib", "Source/OpenEXR"])
system "bash", "gensrclist.sh"
system "bash", "genfipsrclist.sh"
end

# Fix build error on Linux: ImathVec.h:771:37: error: ISO C++17 does not allow dynamic exception specifications
ENV["CXXFLAGS"] = "-std=c++98" if OS.linux?
system "make", "-f", "Makefile.gnu"
system "make", "-f", "Makefile.gnu", "install", "PREFIX=#{prefix}"
system "make", "-f", "Makefile.gnu", "install", "INCDIR=#{include}", "INSTALLDIR=#{lib}"
system "make", "-f", "Makefile.fip"
system "make", "-f", "Makefile.fip", "install", "PREFIX=#{prefix}"
system "make", "-f", "Makefile.fip", "install", "INCDIR=#{include}", "INSTALLDIR=#{lib}"
end

test do
Expand Down
1 change: 1 addition & 0 deletions Formula/o/opencascade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Opencascade < Formula
version "7.9.0"
sha256 "ff118a524ec451867e8f0ac3b631522c98f2b4353c7dbf2786bf239589909ec6"
license "LGPL-2.1-only"
revision 1

# The first-party download page (https://dev.opencascade.org/release)
# references version 7.5.0 and hasn't been updated for later maintenance
Expand Down
11 changes: 10 additions & 1 deletion Formula/p/perceptualdiff.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class Perceptualdiff < Formula
desc "Perceptual image comparison tool"
homepage "https://pdiff.sourceforge.net/"
# TODO: Remove CMAKE_POLICY_VERSION_MINIMUM in next release
url "https://github.com/myint/perceptualdiff/archive/refs/tags/v2.1.tar.gz"
sha256 "0dea51046601e4d23dc45a3ec342f1a305baf3bf3328e9ccdae115fe1942f041"
license "GPL-2.0-or-later"
revision 1

bottle do
sha256 cellar: :any, arm64_sequoia: "69f5e86989148e15fdca126111c1070bb23777eabadd346f8e735b6cedc86f5a"
Expand All @@ -17,8 +19,15 @@ class Perceptualdiff < Formula
depends_on "cmake" => :build
depends_on "freeimage"

on_macos do
depends_on "libomp"
end

def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
args = ["-DCMAKE_POLICY_VERSION_MINIMUM=3.5"]
args << "-DCMAKE_EXE_LINKER_FLAGS=-lomp" if OS.mac?

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
Expand Down
Loading