Skip to content

Commit

Permalink
More tweaks for llvm.
Browse files Browse the repository at this point in the history
* Port more changes from llvm formulae of homebrew-versions.
  - Don't install Clang tools.
* Remove all man pages.
  - Currently only clang.1 is available, and we don't ship clang binary
    in core.
  • Loading branch information
manphiz committed Aug 29, 2013
1 parent 75024c0 commit d46a337
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions Formula/llvm.rb
Expand Up @@ -29,13 +29,13 @@ class Llvm < Formula
env :std if build.universal?

def install
if build.with? 'python' and build.include? 'disable-shared'
if python and build.include? 'disable-shared'
raise 'The Python bindings need the shared library.'
end

Clang.new("clang").brew do
clang_dir.install Dir['*']
end if build.include? 'with-clang'
(buildpath/'tools/clang').install Dir['*']
end if build.with? 'clang'

if build.universal?
ENV['UNIVERSAL'] = '1'
Expand Down Expand Up @@ -68,18 +68,14 @@ def install
# install llvm python bindings
if python
python.site_packages.install buildpath/'bindings/python/llvm'
python.site_packages.install buildpath/'tools/clang/bindings/python/clang' if build.with? 'clang'
end

# Install clang tools and bindings
cd clang_dir do
(share/'clang/tools').install 'tools/scan-build', 'tools/scan-view'
python.site_packages.install 'bindings/python/clang' if python
end if build.include? 'with-clang'

# Remove all binaries except llvm-config
Dir[bin/'*'].each do |exec_path|
rm_f exec_path unless File.basename(exec_path) == 'llvm-config'
end
rm_f Dir["#{bin}/*"] - Dir["#{bin}/llvm-config"]

# Remove all man pages
man.rmtree if build.with? 'clang'
end

def test
Expand All @@ -105,7 +101,4 @@ def caveats
EOS
end

def clang_dir
buildpath/'tools/clang'
end
end

0 comments on commit d46a337

Please sign in to comment.