Skip to content

Commit

Permalink
halide: fix source build
Browse files Browse the repository at this point in the history
We need this after Homebrew/brew#17075.
  • Loading branch information
carlocab committed Apr 15, 2024
1 parent 084282a commit ebd2c5a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Formula/h/halide.rb
Expand Up @@ -23,11 +23,21 @@ class Halide < Formula

depends_on "cmake" => :build
depends_on "pybind11" => :build
depends_on "flatbuffers"
depends_on "jpeg-turbo"
depends_on "libpng"
depends_on "llvm"
depends_on "python@3.12"

# Check wabt version in `dependencies/wasm/CMakeLists.txt`.
# TODO: Ask upstream to support usage of a system-provided wabt.
# TODO: Do we really need a git checkout here?
resource "wabt" do
url "https://github.com/WebAssembly/wabt.git",
tag: "1.0.33",
revision: "963f973469b45969ce198e0c86d3af316790a780"
end

fails_with :gcc do
version "6"
cause "Requires C++17"
Expand All @@ -42,14 +52,18 @@ def install
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib if DevelopmentTools.clang_build_version >= 1500

system "cmake", "-S", ".", "-B", "build",
builddir = buildpath/"build"
(builddir/"_deps/wabt-src").install resource("wabt")

system "cmake", "-S", ".", "-B", builddir
"-DCMAKE_INSTALL_RPATH=#{rpath}",
"-DHalide_INSTALL_PYTHONDIR=#{prefix/Language::Python.site_packages(python3)}",
"-DHalide_SHARED_LLVM=ON",
"-DPYBIND11_USE_FETCHCONTENT=OFF",
"-DFLATBUFFERS_USE_FETCHCONTENT=OFF",
*std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
system "cmake", "--build", builddir
system "cmake", "--install", builddir
end

test do
Expand Down

0 comments on commit ebd2c5a

Please sign in to comment.