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

llvm (all versions): add missing versioned libLLVM symlink; fix Mojave sysroot #47146

Closed
wants to merge 4 commits into from
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
9 changes: 6 additions & 3 deletions Formula/llvm.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Llvm < Formula
desc "Next-gen compiler infrastructure"
homepage "https://llvm.org/"
revision 1
revision 2

stable do
url "https://releases.llvm.org/9.0.0/llvm-9.0.0.src.tar.xz"
Expand Down Expand Up @@ -159,7 +159,7 @@ def install

mkdir "build" do
if MacOS.version >= :mojave
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" : MacOS.sdk_path
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk" : MacOS.sdk_path
args << "-DDEFAULT_SYSROOT=#{sdk_path}"
end

Expand All @@ -169,6 +169,9 @@ def install
system "make", "install-xcode-toolchain"
end

# llvm-config requires a versioned dylib
lib.install_symlink lib/"libLLVM.dylib" => "libLLVM-#{version.to_s[/\d+/]}.dylib"

(share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"]
(share/"cmake").install "cmake/modules"
inreplace "#{share}/clang/tools/scan-build/bin/scan-build", "$RealBin/bin/clang", "#{bin}/clang"
Expand Down Expand Up @@ -247,7 +250,7 @@ def caveats; <<~EOS
# Testing Command Line Tools
if MacOS::CLT.installed?
toolchain_path = "/Library/Developer/CommandLineTools"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk"
system "#{bin}/clang++", "-v",
"-isysroot", sdk_path,
"-isystem", "#{toolchain_path}/usr/include/c++/v1",
Expand Down
9 changes: 6 additions & 3 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class LlvmAT6 < Formula
homepage "https://llvm.org/"
url "https://releases.llvm.org/6.0.1/llvm-6.0.1.src.tar.xz"
sha256 "b6d6c324f9c71494c0ccaf3dac1f16236d970002b42bb24a6c9e1634f7d0f4e2"
revision 2
revision 3

bottle do
cellar :any
Expand Down Expand Up @@ -109,7 +109,7 @@ def install
]

if MacOS.version >= :mojave
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" : MacOS.sdk_path
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk" : MacOS.sdk_path
args << "-DDEFAULT_SYSROOT=#{sdk_path}"
end

Expand All @@ -120,6 +120,9 @@ def install
system "make", "install-xcode-toolchain"
end

# llvm-config requires a versioned dylib
lib.install_symlink lib/"libLLVM.dylib" => "libLLVM-6.0.dylib"

(share/"cmake").install "cmake/modules"
(share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"]

Expand Down Expand Up @@ -205,7 +208,7 @@ def caveats; <<~EOS
# Testing Command Line Tools
if MacOS::CLT.installed?
toolchain_path = "/Library/Developer/CommandLineTools"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk"
system "#{bin}/clang++", "-v",
"-isysroot", sdk_path,
"-isystem", "#{toolchain_path}/usr/include/c++/v1",
Expand Down
9 changes: 6 additions & 3 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class LlvmAT7 < Formula
homepage "https://llvm.org/"
url "https://releases.llvm.org/7.1.0/llvm-7.1.0.src.tar.xz"
sha256 "1bcc9b285074ded87b88faaedddb88e6b5d6c331dfcfb57d7f3393dd622b3764"
revision 1
revision 2

bottle do
cellar :any
Expand Down Expand Up @@ -105,7 +105,7 @@ def install
]

if MacOS.version >= :mojave
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" : MacOS.sdk_path
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk" : MacOS.sdk_path
args << "-DDEFAULT_SYSROOT=#{sdk_path}"
end

Expand All @@ -116,6 +116,9 @@ def install
system "make", "install-xcode-toolchain"
end

# llvm-config requires a versioned dylib
lib.install_symlink lib/"libLLVM.dylib" => "libLLVM-#{version.to_s[/\d+/]}.dylib"

(share/"cmake").install "cmake/modules"
(share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"]

Expand Down Expand Up @@ -198,7 +201,7 @@ def caveats; <<~EOS
# Testing Command Line Tools
if MacOS::CLT.installed?
toolchain_path = "/Library/Developer/CommandLineTools"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk"
system "#{bin}/clang++", "-v",
"-isysroot", sdk_path,
"-isystem", "#{toolchain_path}/usr/include/c++/v1",
Expand Down
9 changes: 6 additions & 3 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class LlvmAT8 < Formula
homepage "https://llvm.org/"
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz"
sha256 "44787a6d02f7140f145e2250d56c9f849334e11f9ae379827510ed72f12b75e7"
revision 1
revision 2

bottle do
cellar :any
Expand Down Expand Up @@ -115,7 +115,7 @@ def install
]

if MacOS.version >= :mojave
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" : MacOS.sdk_path
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk" : MacOS.sdk_path
args << "-DDEFAULT_SYSROOT=#{sdk_path}"
end

Expand All @@ -126,6 +126,9 @@ def install
system "make", "install-xcode-toolchain"
end

# llvm-config requires a versioned dylib
lib.install_symlink lib/"libLLVM.dylib" => "libLLVM-#{version.to_s[/\d+/]}.dylib"

(share/"clang/tools").install Dir["tools/clang/tools/scan-{build,view}"]
(share/"cmake").install "cmake/modules"
inreplace "#{share}/clang/tools/scan-build/bin/scan-build", "$RealBin/bin/clang", "#{bin}/clang"
Expand Down Expand Up @@ -204,7 +207,7 @@ def caveats; <<~EOS
# Testing Command Line Tools
if MacOS::CLT.installed?
toolchain_path = "/Library/Developer/CommandLineTools"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX#{MacOS.version}.sdk"
system "#{bin}/clang++", "-v",
"-isysroot", sdk_path,
"-isystem", "#{toolchain_path}/usr/include/c++/v1",
Expand Down