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
File renamed without changes.
2 changes: 1 addition & 1 deletion Formula/castxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Castxml < Formula
url "https://github.com/CastXML/CastXML/archive/v0.4.3.tar.gz"
sha256 "3dd94096e07ffe103b2a951e4ff0f9486cc615b3ef08e95e5778eaaec667fb65"
license "Apache-2.0"
revision 1
revision 2
head "https://github.com/CastXML/castxml.git", branch: "master"

livecheck do
Expand Down
2 changes: 1 addition & 1 deletion Formula/ccls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Ccls < Formula
url "https://github.com/MaskRay/ccls/archive/0.20210330.tar.gz"
sha256 "28c228f49dfc0f23cb5d581b7de35792648f32c39f4ca35f68ff8c9cb5ce56c2"
license "Apache-2.0"
revision 1
revision 2
head "https://github.com/MaskRay/ccls.git", branch: "master"

bottle do
Expand Down
1 change: 1 addition & 0 deletions Formula/clazy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Clazy < Formula
url "https://download.kde.org/stable/clazy/1.10/src/clazy-1.10.tar.xz"
sha256 "4ce6d55ffcddacdb005d847e0c329ade88a01e8e4f7590ffd2a9da367c1ba39d"
license "LGPL-2.0-or-later"
revision 1
head "https://invent.kde.org/sdk/clazy.git", branch: "master"

livecheck do
Expand Down
18 changes: 10 additions & 8 deletions Formula/enzyme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Enzyme < Formula
url "https://github.com/wsmoses/Enzyme/archive/v0.0.19.tar.gz"
sha256 "51729ff4b26f988f3204915cae28b3985987c33386ed0338eb03d1974ddbab0a"
license "Apache-2.0" => { with: "LLVM-exception" }
revision 1
head "https://github.com/wsmoses/Enzyme.git", branch: "main"

bottle do
Expand All @@ -14,14 +15,16 @@ class Enzyme < Formula
end

depends_on "cmake" => :build
depends_on "llvm"
depends_on "llvm@12"

def llvm
deps.map(&:to_formula).find { |f| f.name.match? "^llvm" }
end

def install
mkdir "build" do
system "cmake", "../enzyme", *std_cmake_args, "-DLLVM_DIR=#{Formula["llvm"].opt_lib}/cmake/llvm"
system "make"
system "make", "install"
end
system "cmake", "-S", "enzyme", "-B", "build", *std_cmake_args, "-DLLVM_DIR=#{llvm.opt_lib}/cmake/llvm"
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
Expand All @@ -40,13 +43,12 @@ def install
}
EOS

llvm = Formula["llvm"]
opt = llvm.opt_bin/"opt"
ENV["CC"] = llvm.opt_bin/"clang"

system ENV.cc, testpath/"test.c", "-S", "-emit-llvm", "-o", "input.ll", "-O2",
"-fno-vectorize", "-fno-slp-vectorize", "-fno-unroll-loops"
system opt, "input.ll", "-load=#{opt_lib}/#{shared_library("LLVMEnzyme-#{llvm.version.major}")}",
system opt, "input.ll", "-load=#{opt_lib/shared_library("LLVMEnzyme-#{llvm.version.major}")}",
"-enzyme", "-o", "output.ll", "-S"
system ENV.cc, "output.ll", "-O3", "-o", "test"

Expand Down
3 changes: 2 additions & 1 deletion Formula/faust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Faust < Formula
url "https://github.com/grame-cncm/faust/releases/download/2.33.1/faust-2.33.1.tar.gz"
sha256 "7185b43615588e4e52fac5f455ae0078661e20f87da806b31c4942ca377f9a0a"
license "GPL-2.0-or-later"
revision 1

bottle do
sha256 cellar: :any, arm64_big_sur: "408e07036801864f2e41bef989fcf378789a286d205cab9d2299e40d7d92ccf4"
Expand All @@ -16,7 +17,7 @@ class Faust < Formula
depends_on "pkg-config" => :build
depends_on "libmicrohttpd"
depends_on "libsndfile"
depends_on "llvm"
depends_on "llvm@12"

def install
system "make", "world"
Expand Down
3 changes: 2 additions & 1 deletion Formula/halide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Halide < Formula
url "https://github.com/halide/Halide/archive/v12.0.1.tar.gz"
sha256 "17f7a470c3fcf77205fdcd9d06257f17c1c1a3cda4b8023f56cec160e80bd519"
license "MIT"
revision 1

livecheck do
url :stable
Expand All @@ -20,7 +21,7 @@ class Halide < Formula
depends_on "cmake" => :build
depends_on "jpeg"
depends_on "libpng"
depends_on "llvm"
depends_on "llvm@12"
depends_on "python@3.9"

def install
Expand Down
27 changes: 18 additions & 9 deletions Formula/include-what-you-use.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
class IncludeWhatYouUse < Formula
desc "Tool to analyze #includes in C and C++ source files"
homepage "https://include-what-you-use.org/"
url "https://include-what-you-use.org/downloads/include-what-you-use-0.16.src.tar.gz"
sha256 "8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c"
license "NCSA"
revision 1
revision 2

stable do
url "https://include-what-you-use.org/downloads/include-what-you-use-0.16.src.tar.gz"
sha256 "8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c"
depends_on "llvm@12" # include-what-you-use 0.16 is compatible with llvm 12.0
end

# This omits the 3.3, 3.4, and 3.5 versions, which come from the older
# version scheme like `Clang+LLVM 3.5` (25 November 2014). The current
Expand All @@ -23,23 +27,28 @@ class IncludeWhatYouUse < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "bbca09d4ae951ffb3be87b585ba20f5c82f4cb5a8f15f14bc9a72ba2ee378507"
end

head do
url "https://github.com/include-what-you-use/include-what-you-use.git", branch: "master"
depends_on "llvm"
end

depends_on "cmake" => :build
depends_on "llvm" # include-what-you-use 0.16 is compatible with llvm 12.0

uses_from_macos "ncurses"
uses_from_macos "zlib"

def install
llvm = Formula["llvm"]
def llvm
deps.map(&:to_formula).find { |f| f.name.match? "^llvm" }
end

def install
# We do not want to symlink clang or libc++ headers into HOMEBREW_PREFIX,
# so install to libexec to ensure that the resource path, which is always
# computed relative to the location of the include-what-you-use executable
# and is not configurable, is also located under libexec.
args = std_cmake_args + %W[
-DCMAKE_INSTALL_PREFIX=#{libexec}
-DCMAKE_PREFIX_PATH=#{llvm.opt_lib}
-DCMAKE_CXX_FLAGS=-std=gnu++14
]

mkdir "build" do
Expand All @@ -58,9 +67,9 @@ def install
# locate stddef.h and/or stdlib.h when running the test block below.
# https://clang.llvm.org/docs/LibTooling.html#libtooling-builtin-includes
(libexec/"lib").mkpath
ln_sf llvm.opt_lib.relative_path_from(libexec/"lib")/"clang", libexec/"lib"
ln_sf (llvm.opt_lib/"clang").relative_path_from(libexec/"lib"), libexec/"lib"
(libexec/"include").mkpath
ln_sf llvm.opt_include.relative_path_from(libexec/"include")/"c++", libexec/"include"
ln_sf (llvm.opt_include/"c++").relative_path_from(libexec/"include"), libexec/"include"
end

test do
Expand Down
9 changes: 7 additions & 2 deletions Formula/ispc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ispc < Formula
url "https://github.com/ispc/ispc/archive/v1.16.1.tar.gz"
sha256 "e5dcd0d85df6ed5feb454ad9ec295083a07d7459fcaba00d5dd6266ceb476399"
license "BSD-3-Clause"
revision 1

bottle do
sha256 cellar: :any, arm64_big_sur: "774925e3f76b5bc791c697ccb33ba6ddb06263afc42afed3d3b5c042d1e418b2"
Expand All @@ -16,14 +17,18 @@ class Ispc < Formula
depends_on "cmake" => :build
depends_on "flex" => :build
depends_on "python@3.9" => :build
depends_on "llvm"
depends_on "llvm@12"

def llvm
deps.map(&:to_formula).find { |f| f.name.match? "^llvm" }
end

def install
args = std_cmake_args + %W[
-DISPC_INCLUDE_EXAMPLES=OFF
-DISPC_INCLUDE_TESTS=OFF
-DISPC_INCLUDE_UTILS=OFF
-DLLVM_TOOLS_BINARY_DIR='#{Formula["llvm"].opt_bin}'
-DLLVM_TOOLS_BINARY_DIR='#{llvm.opt_bin}'
-DISPC_NO_DUMPS=ON
-DARM_ENABLED=#{Hardware::CPU.arm? ? "ON" : "OFF"}
]
Expand Down
43 changes: 26 additions & 17 deletions Formula/julia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Julia < Formula
url "https://github.com/JuliaLang/julia/releases/download/v1.6.3/julia-1.6.3.tar.gz"
sha256 "2593def8cc9ef81663d1c6bfb8addc3f10502dd9a1d5a559728316a11dea2594"
license all_of: ["MIT", "BSD-3-Clause", "Apache-2.0", "BSL-1.0"]
revision 2
revision 3
head "https://github.com/JuliaLang/julia.git"

bottle do
Expand All @@ -23,7 +23,7 @@ class Julia < Formula
depends_on "libgit2"
depends_on "libnghttp2"
depends_on "libssh2"
depends_on "llvm"
depends_on "llvm@12"
depends_on "mbedtls@2"
depends_on "mpfr"
depends_on "openblas"
Expand Down Expand Up @@ -116,26 +116,28 @@ def install

args << "TAGGED_RELEASE_BANNER=Built by #{tap.user} (v#{pkg_version})"

# Help Julia find keg-only dependencies
deps.map(&:to_formula).select(&:keg_only?).map(&:opt_lib).each do |libdir|
ENV.append "LDFLAGS", "-Wl,-rpath,#{libdir}"

next unless OS.linux?

libdir.glob(shared_library("*")) do |so|
(buildpath/"usr/lib").install_symlink so
(lib/"julia").install_symlink so
end
end

gcc = Formula["gcc"]
gcclibdir = gcc.opt_lib/"gcc"/gcc.any_installed_version.major
if OS.mac?
deps.map(&:to_formula).select(&:keg_only?).map(&:opt_lib).each do |libdir|
ENV.append "LDFLAGS", "-Wl,-rpath,#{libdir}"
end
ENV.append "LDFLAGS", "-Wl,-rpath,#{gcclibdir}"
# List these two last, since we want keg-only libraries to be found first
ENV.append "LDFLAGS", "-Wl,-rpath,#{HOMEBREW_PREFIX}/lib"
ENV.append "LDFLAGS", "-Wl,-rpath,/usr/lib"
else
ENV.append "LDFLAGS", "-Wl,-rpath,#{opt_lib}"
ENV.append "LDFLAGS", "-Wl,-rpath,#{opt_lib}/julia"

# Help Julia find our libunwind. Remove when upstream replace this with LLVM libunwind.
(lib/"julia").mkpath
Formula["libunwind"].opt_lib.glob(shared_library("libunwind", "*")) do |so|
(buildpath/"usr/lib").install_symlink so
(lib/"julia").install_symlink so
end
ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}"
ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}/julia"
end

inreplace "Make.inc" do |s|
Expand All @@ -160,10 +162,10 @@ def install
if OS.linux?
# Replace symlinks referencing Cellar paths with ones using opt paths
deps.reject(&:build?).map(&:to_formula).map(&:opt_lib).each do |libdir|
(lib/"julia").children.each do |so|
next unless (libdir/so.basename).exist?
libdir.glob(shared_library("*")) do |so|
next unless (lib/"julia"/so.basename).exist?

ln_sf (libdir/so.basename).relative_path_from(lib/"julia"), lib/"julia"
ln_sf so.relative_path_from(lib/"julia"), lib/"julia"
end
end
end
Expand Down Expand Up @@ -207,6 +209,13 @@ def install
]
system bin/"julia", *args, "--eval", "using #{jlls.join(", ")}"

# FIXME: The test below will try, and fail, to load the unversioned LLVM's
# libraries since LLVM is not keg-only on Linux, but that's not what
# we want when Julia depends on a keg-only LLVM (which it currently does).
llvm = deps.map(&:to_formula)
.find { |f| f.name.match?(/^llvm(@\d+(\.\d+)*)$/) }
return if OS.linux? && llvm.keg_only?

# Check that Julia can load libraries in lib/"julia".
# Most of these are symlinks to Homebrew-provided libraries.
# This also checks that these libraries can be loaded even when
Expand Down
24 changes: 12 additions & 12 deletions Formula/klee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Klee < Formula
url "https://github.com/klee/klee/archive/v2.2.tar.gz"
sha256 "1ff2e37ed3128e005b89920fad7bcf98c7792a11a589dd443186658f5eb91362"
license "NCSA"
revision 2
revision 3
head "https://github.com/klee/klee.git"

bottle do
Expand All @@ -15,7 +15,7 @@ class Klee < Formula

depends_on "cmake" => :build
depends_on "gperftools"
depends_on "llvm"
depends_on "llvm@12"
depends_on "python-tabulate"
depends_on "python@3.9"
depends_on "sqlite"
Expand All @@ -27,30 +27,30 @@ class Klee < Formula

# klee needs a version of libc++ compiled with wllvm
resource "libcxx" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/llvm-project-12.0.0.src.tar.xz"
sha256 "9ed1688943a4402d7c904cc4515798cdb20080066efa010fe7e1f2551b423628"
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-project-12.0.1.src.tar.xz"
sha256 "129cb25cd13677aad951ce5c2deb0fe4afc1e9d98950f53b51bdcfb5a73afa0e"
end

# Patches for LLVM 12 Support
# https://github.com/klee/klee/pull/1389
patch do
url "https://github.com/klee/klee/commit/74ea9e5e63c5933ca2d5d7f846858c4de6e86b81.patch?full_index=1"
sha256 "5af19fb3dbc609a180014f89a78bd007316e1384f3b23bf64fcd15621951b130"
url "https://github.com/klee/klee/commit/8ac323db7d367799fba9435b64fe715c603e60ba.patch?full_index=1"
sha256 "e8c325ebe471b4f36eabd9d041f3ad9461061cc261c898e078d4dd211a1f3632"
end

patch do
url "https://github.com/klee/klee/commit/a34fb8961649bf3a065ec8f0eb4bc58715fd1d57.patch?full_index=1"
sha256 "beb18d3e74c8a580e2c3785e7224cacfb878b527fc4f261f7acb2ebecec93fb0"
url "https://github.com/klee/klee/commit/96aa751760b4efc3424a82b573057008bc639c3b.patch?full_index=1"
sha256 "1cbc17d413992f211f077687c4187f70b82d7129594fb178c7694fe1d897dac1"
end

patch do
url "https://github.com/klee/klee/commit/2b29d86a39421ac76421b888b96613173bc18851.patch?full_index=1"
sha256 "34515f7841dc3bc6e68888aa98492e3e003131fdc43018f4923799b0e2ff32fd"
url "https://github.com/klee/klee/commit/3d7c05a7e86a72a4fc8df115591bd1e7a50f9d84.patch?full_index=1"
sha256 "6eb99a36c25eaf311bcf666d4b893f9e9bdfd06b72cca63d570b6f3e8a8013bc"
end

patch do
url "https://github.com/klee/klee/commit/c0b10c6f7a00d81cfce24115168dd06888685f87.patch?full_index=1"
sha256 "d970235981e6f96f408b5943f80877b633a01cf098e1b4be2c19967b5412eff5"
url "https://github.com/klee/klee/commit/8775b9cf6c716f51fe90d668e734a1288c8b5404.patch?full_index=1"
sha256 "baefa3e332b2fb699d5329ba2e7c0d87485654dd7ae0a49e6da3a71102ef4ca0"
end

def llvm
Expand Down
15 changes: 8 additions & 7 deletions Formula/ldc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ldc < Formula
url "https://github.com/ldc-developers/ldc/releases/download/v1.27.1/ldc-1.27.1-src.tar.gz"
sha256 "93c8f500b39823dcdabbd73e1bcb487a1b93cb9a60144b0de1c81ab50200e59c"
license "BSD-3-Clause"
revision 1
head "https://github.com/ldc-developers/ldc.git"

livecheck do
Expand All @@ -22,7 +23,7 @@ class Ldc < Formula
depends_on "cmake" => :build
depends_on "libconfig" => :build
depends_on "pkg-config" => :build
depends_on "llvm"
depends_on "llvm@12"

uses_from_macos "libxml2" => :build

Expand All @@ -47,6 +48,10 @@ class Ldc < Formula
end
end

def llvm
deps.map(&:to_formula).find { |f| f.name.match? "^llvm" }
end

def install
ENV.cxx11
(buildpath/"ldc-bootstrap").install resource("ldc-bootstrap")
Expand All @@ -58,19 +63,15 @@ def install

mkdir "build" do
args = std_cmake_args + %W[
-DLLVM_ROOT_DIR=#{Formula["llvm"].opt_prefix}
-DLLVM_ROOT_DIR=#{llvm.opt_prefix}
-DINCLUDE_INSTALL_DIR=#{include}/dlang/ldc
-DD_COMPILER=#{buildpath}/ldc-bootstrap/bin/ldmd2
]
args << "-DCMAKE_INSTALL_RPATH=#{rpath};@loader_path/#{llvm.opt_lib.relative_path_from(lib)}" if OS.mac?

system "cmake", "..", *args
system "make"
system "make", "install"

if OS.mac?
# Workaround for https://github.com/ldc-developers/ldc/issues/3670
cp Formula["llvm"].opt_lib/"libLLVM.dylib", lib/"libLLVM.dylib"
end
end
end

Expand Down
Loading