Skip to content

Commit

Permalink
Lookup LLVM 3.5 from Homebrew on require_llvm on OS X
Browse files Browse the repository at this point in the history
Prior to this we tried to use pre-built LLVM binaries since Yosemite,
but starting with Rubinius 2.3.0 this is no longer a feature of its
build system. Instead, look for "llvm" Homebrew package and suggest
installing it if it's missing.
  • Loading branch information
mislav committed Jan 2, 2015
1 parent d859ee1 commit 3b6f96d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion bin/ruby-build
Expand Up @@ -798,7 +798,28 @@ require_llvm() {
local llvm_version="$1"
if [ "$(uname -s)" = "Darwin" ] && [ "$(osx_version)" -ge 1010 ]; then
if [[ "$RUBY_CONFIGURE_OPTS" != *--llvm-* ]]; then
package_option ruby configure --prebuilt-name="llvm-3.2-x86_64-apple-darwin13.tar.bz2"
if [ "$llvm_version" = "3.2" ]; then
package_option ruby configure --prebuilt-name="llvm-3.2-x86_64-apple-darwin13.tar.bz2"
else
local llvm_prefix="$(brew --prefix llvm 2>/dev/null || true)"
local llvm_config="${llvm_prefix}/bin/llvm-config"
if [ -x "$llvm_config" ]; then
package_option ruby configure --llvm-config="$llvm_config"
else
{ echo
colorize 1 "ERROR"
echo ": Rubinius will not be able to compile using Apple's LLVM-based "
echo "build tools on OS X. You will need to install LLVM 3.5 first."
echo
colorize 1 "TO FIX THE PROBLEM"
echo ": Install Homebrew's llvm package with this"
echo -n "command: "
colorize 4 "brew install llvm"
echo
} >&3
return 1
fi
fi
fi
fi
}
Expand Down
2 changes: 1 addition & 1 deletion share/ruby-build/rbx-2.0.0-dev
@@ -1,3 +1,3 @@
require_llvm 3.4.2
require_llvm 3.2
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749"
install_git "rubinius-2.0.0-dev" "https://github.com/rubinius/rubinius.git" "master" rbx

0 comments on commit 3b6f96d

Please sign in to comment.