瀏覽代碼

Use same `require_gcc` as ruby-build

pull/101/merge
Yamashita Yuu 10 年之前
父節點
當前提交
93ba3a4c51
共有 12 個文件被更改,包括 80 次插入121 次删除
  1. +69
    -110
      plugins/python-build/bin/python-build
  2. +1
    -1
      plugins/python-build/share/python-build/3.3-dev
  3. +1
    -1
      plugins/python-build/share/python-build/3.3.0
  4. +1
    -1
      plugins/python-build/share/python-build/3.3.1
  5. +1
    -1
      plugins/python-build/share/python-build/3.3.2
  6. +1
    -1
      plugins/python-build/share/python-build/3.3.3
  7. +1
    -1
      plugins/python-build/share/python-build/3.4-dev
  8. +1
    -1
      plugins/python-build/share/python-build/3.4.0a2
  9. +1
    -1
      plugins/python-build/share/python-build/3.4.0a3
  10. +1
    -1
      plugins/python-build/share/python-build/3.4.0a4
  11. +1
    -1
      plugins/python-build/share/python-build/3.4.0b1
  12. +1
    -1
      plugins/python-build/share/python-build/3.4.0b2

+ 69
- 110
plugins/python-build/bin/python-build 查看文件

@ -758,53 +758,56 @@ fix_rbx_irb() {
}
require_gcc() {
require_cc "gcc"
}
require_cc() {
while [ -n "$1" ]; do
if [ "$1" = "--if" ]; then
"$2" || return 0
shift 2
else
break
fi
done
local gcc="$(locate_gcc || true)"
local cc
local ccname="${1:-cc}"
cc="$(locate_cc "$ccname" || true)"
if [ -z "$cc" ]; then
if [ -z "$gcc" ]; then
local esc=$'\033'
{ echo
echo "${esc}[1mERROR${esc}[0m: This package must be compiled with $ccname, but python-build couldn't"
echo "find a suitable \`$ccname\` executable on your system. Please install $ccname"
echo "${esc}[1mERROR${esc}[0m: This package must be compiled with GCC, but python-build couldn't"
echo "find a suitable \`gcc\` executable on your system. Please install GCC"
echo "and try again."
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "${esc}[1mDETAILS${esc}[0m: Apple no longer includes the official GCC compiler with Xcode"
echo "as of version 4.2. Instead, the \`gcc\` executable is a symlink to"
echo "\`llvm-gcc\`, a modified version of GCC which outputs LLVM bytecode."
echo
echo "For most programs the \`llvm-gcc\` compiler works fine. However,"
echo "versions of CPython newer than 3.3.0 are incompatible with"
echo "\`llvm-gcc\`. To build newer versions of CPython you must have the official"
echo "GCC compiler installed on your system."
echo
if type brew &>/dev/null; then
echo "${esc}[1mTO FIX THE PROBLEM${esc}[0m: Install Homebrew's apple-gcc42 package with this"
echo "command: ${esc}[4mbrew tap homebrew/dupes ; brew install apple-gcc42${esc}[0m"
else
echo "${esc}[1mTO FIX THE PROBLEM${esc}[0m: Install the official GCC compiler using these"
echo "packages: ${esc}[4mhttps://github.com/kennethreitz/osx-gcc-installer/downloads${esc}[0m"
fi
echo
echo "You will need to install the official GCC compiler to build newer"
echo "versions of CPython even if you have installed Apple's Command Line Tools"
echo "for Xcode package. The Command Line Tools for Xcode package only"
echo "includes \`llvm-gcc\`."
fi
} >&3
return 1
fi
export CC="$cc"
}
locate_gcc() {
locate_cc "gcc" "$@"
export CC="$gcc"
}
locate_cc() {
local ccname="$1"; shift
if [ -z "$ccname" ]; then
return 1
fi
local cc ccs
IFS=: ccs=($(ccs_in_path "${ccname}"))
locate_gcc() {
local gcc gccs
IFS=: gccs=($(gccs_in_path))
verify_cc "${ccname}" "$CC" ||
verify_cc "${ccname}" "$(command -v "${ccname}" || true)" || {
for cc in "${ccs[@]}"; do
verify_cc "${ccname}" "$cc" && break || true
verify_gcc "$CC" ||
verify_gcc "$(command -v gcc || true)" || {
for gcc in "${gccs[@]}"; do
verify_gcc "$gcc" && break || true
done
}
@ -812,114 +815,75 @@ locate_cc() {
}
gccs_in_path() {
ccs_in_path "gcc" "$@"
}
ccs_in_path() {
local ccname="$1"; shift
if [ -z "$ccname" ]; then
return 1
fi
local cc path paths
local ccs=()
local gcc path paths
local gccs=()
IFS=: paths=($PATH)
shopt -s nullglob
for path in "${paths[@]}"; do
for cc in "$path"/${ccname}-*; do
ccs["${#ccs[@]}"]="$cc"
for gcc in "$path"/gcc-*; do
gccs["${#gccs[@]}"]="$gcc"
done
done
shopt -u nullglob
printf :%s "${ccs[@]}"
printf :%s "${gccs[@]}"
}
verify_gcc() {
verify_cc "gcc" "$@"
}
verify_cc() {
local ccname="$1"; shift
if [ -z "$ccname" ]; then
local gcc="$1"
if [ -z "$gcc" ]; then
return 1
fi
local cc="$1"
if [ -z "$cc" ]; then
local version="$("$gcc" --version || true)"
if [ -z "$version" ]; then
return 1
fi
local version="$("$cc" --version || true)"
if [ -z "$version" ]; then
if echo "$version" | grep LLVM >/dev/null; then
return 1
fi
echo "$cc"
echo "$gcc"
}
require_java() {
local java="$(locate_java || true)"
require_clang() {
local cc="$(command -v "$CC" || command -v "clang" || command -v "cc" || true)"
if [ -z "$java" ]; then
if [ -z "$cc" ]; then
local esc=$'\033'
{ echo
echo "${esc}[1mERROR${esc}[0m: This package must be installed with java, but python-build couldn't"
echo "find a suitable \`java\` executable on your system. Please install Java"
echo "${esc}[1mERROR${esc}[0m: This package must be compiled with cc, but python-build couldn't"
echo "find a suitable \`cc\` executable on your system. Please install cc"
echo "and try again."
echo
} >&3
return 1
fi
export CC="$cc"
}
export JAVA="$java"
}
locate_java() {
local java javas
IFS=: javas=($(javas_in_path))
verify_java "$JAVA" ||
verify_java "$(command -v java || true)" || {
for java in "${javas[@]}"; do
verify_java "$java" && break || true
done
}
return 1
}
javas_in_path() {
local java path paths
local javas=()
IFS=: paths=($PATH)
shopt -s nullglob
for path in "${paths[@]}"; do
local java="$path"/java
if [ -x "$java" ]; then
javas["${#javas[@]}"]="$java"
fi
done
shopt -u nullglob
printf :%s "${javas[@]}"
}
require_java() {
local java="$(command -v java || true)"
verify_java() {
local java="$1"
if [ -z "$java" ]; then
local esc=$'\033'
{ echo
echo "${esc}[1mERROR${esc}[0m: This package must be installed with java, but python-build couldn't"
echo "find a suitable \`java\` executable on your system. Please install Java"
echo "and try again."
echo
} >&3
return 1
fi
if [ ! -x "$java" ]; then
return 1
fi
echo "$java"
export JAVA="$java"
}
needs_yaml() {
[[ "$RUBY_CONFIGURE_OPTS" != *--with-libyaml-dir=* ]] &&
[[ "$PYTHON_CONFIGURE_OPTS" != *--with-libyaml-dir=* ]] &&
! use_homebrew_yaml
}
@ -1069,11 +1033,6 @@ apply_python_patch() {
esac
}
has_broken_mac_llvm_gcc() {
[ "$(uname -s)" = "Darwin" ] &&
[[ "$(gcc --version 2>/dev/null || true)" == *"llvm-gcc-4.2"* ]]
}
build_package_verify_python() {
# Check the existence of ./bin since pyenv-which searches the executables from there
if [ ! -d "${PREFIX_PATH}/bin" ]; then

+ 1
- 1
plugins/python-build/share/python-build/3.3-dev 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_hg "Python-3.3-dev" "https://bitbucket.org/mirror/cpython" "3.3" standard verify_py33
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.3.0 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.3.0" "http://python.org/ftp/python/3.3.0/Python-3.3.0.tgz#198a64f7a04d1d5e95ce2782d5fd8254" ldflags_dirs standard verify_py33
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.3.1 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.3.1" "http://python.org/ftp/python/3.3.1/Python-3.3.1.tgz#c19bfd6ea252b61779a4f2996fb3b330" ldflags_dirs standard verify_py33
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.3.2 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.3.2" "http://python.org/ftp/python/3.3.2/Python-3.3.2.tgz#0a2ea57f6184baf45b150aee53c0c8da" ldflags_dirs standard verify_py33
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.3.3 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.3.3" "http://python.org/ftp/python/3.3.3/Python-3.3.3.tgz#831d59212568dc12c95df222865d3441" ldflags_dirs standard verify_py33
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4-dev 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_hg "Python-3.4-dev" "https://bitbucket.org/mirror/cpython" "default" standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4.0a2 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.4.0a2" "http://python.org/ftp/python/3.4.0/Python-3.4.0a2.tgz#e6e81242a32e6f63d224254d24edbd2f" ldflags_dirs standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4.0a3 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.4.0a3" "http://python.org/ftp/python/3.4.0/Python-3.4.0a3.tgz#3598af9717cddd4c346d731913fdfd64" ldflags_dirs standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4.0a4 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.4.0a4" "http://python.org/ftp/python/3.4.0/Python-3.4.0a4.tgz#f874d97c90130b0249848be889b5e6e1" ldflags_dirs standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4.0b1 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.4.0b1" "http://python.org/ftp/python/3.4.0/Python-3.4.0b1.tgz#83143a755b8a29a59026c1fdfb8d18fc" ldflags_dirs standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

+ 1
- 1
plugins/python-build/share/python-build/3.4.0b2 查看文件

@ -1,4 +1,4 @@
require_cc --if has_broken_mac_llvm_gcc "clang"
require_clang || require_gcc
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
install_package "Python-3.4.0b2" "http://python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz#afe112d6fe595f501f1dcb3627e7b476" ldflags_dirs standard verify_py34
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python

Loading…
取消
儲存