Import changes from ruby-build 20140110.1
This commit is contained in:
parent
461c5bbc2d
commit
07ae0d8e42
@ -99,7 +99,7 @@ unset VERSION_NAME
|
|||||||
# version is specified by pyenv. Show usage instructions if a local
|
# version is specified by pyenv. Show usage instructions if a local
|
||||||
# version is not specified.
|
# version is not specified.
|
||||||
DEFINITION="${ARGUMENTS[0]}"
|
DEFINITION="${ARGUMENTS[0]}"
|
||||||
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv local 2>/dev/null || true)"
|
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv-local 2>/dev/null || true)"
|
||||||
[ -n "$DEFINITION" ] || usage 1
|
[ -n "$DEFINITION" ] || usage 1
|
||||||
|
|
||||||
|
|
||||||
@ -118,10 +118,10 @@ after_install() {
|
|||||||
after_hooks["${#after_hooks[@]}"]="$hook"
|
after_hooks["${#after_hooks[@]}"]="$hook"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load plugin hooks.
|
OLDIFS="$IFS"
|
||||||
for script in $(pyenv-hooks install); do
|
IFS=$'\n' scripts=(`pyenv-hooks install`)
|
||||||
source "$script"
|
IFS="$OLDIFS"
|
||||||
done
|
for script in "${scripts[@]}"; do source "$script"; done
|
||||||
|
|
||||||
|
|
||||||
# Set VERSION_NAME from $DEFINITION, if it is not already set. Then
|
# Set VERSION_NAME from $DEFINITION, if it is not already set. Then
|
||||||
@ -201,7 +201,7 @@ for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
|||||||
|
|
||||||
# Run `pyenv-rehash` after a successful installation.
|
# Run `pyenv-rehash` after a successful installation.
|
||||||
if [ "$STATUS" == "0" ]; then
|
if [ "$STATUS" == "0" ]; then
|
||||||
pyenv rehash
|
pyenv-rehash
|
||||||
else
|
else
|
||||||
cleanup
|
cleanup
|
||||||
fi
|
fi
|
||||||
|
@ -38,6 +38,24 @@ case "$DEFINITION" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
declare -a before_hooks after_hooks
|
||||||
|
|
||||||
|
before_uninstall() {
|
||||||
|
local hook="$1"
|
||||||
|
before_hooks["${#before_hooks[@]}"]="$hook"
|
||||||
|
}
|
||||||
|
|
||||||
|
after_uninstall() {
|
||||||
|
local hook="$1"
|
||||||
|
after_hooks["${#after_hooks[@]}"]="$hook"
|
||||||
|
}
|
||||||
|
|
||||||
|
OLDIFS="$IFS"
|
||||||
|
IFS=$'\n' scripts=(`pyenv-hooks uninstall`)
|
||||||
|
IFS="$OLDIFS"
|
||||||
|
for script in "${scripts[@]}"; do source "$script"; done
|
||||||
|
|
||||||
|
|
||||||
VERSION_NAME="${DEFINITION##*/}"
|
VERSION_NAME="${DEFINITION##*/}"
|
||||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||||
|
|
||||||
@ -54,7 +72,11 @@ if [ -z "$FORCE" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||||
|
|
||||||
if [ -d "$PREFIX" ]; then
|
if [ -d "$PREFIX" ]; then
|
||||||
rm -rf "$PREFIX"
|
rm -rf "$PREFIX"
|
||||||
pyenv rehash
|
pyenv-rehash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PYTHON_BUILD_VERSION="20131225.1"
|
PYTHON_BUILD_VERSION="20140110.1"
|
||||||
|
|
||||||
set -E
|
set -E
|
||||||
exec 3<&2 # preserve original stderr at fd 3
|
exec 3<&2 # preserve original stderr at fd 3
|
||||||
@ -897,7 +897,6 @@ require_java() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
needs_yaml() {
|
needs_yaml() {
|
||||||
[[ "$PYTHON_CONFIGURE_OPTS" != *--with-libyaml-dir=* ]] &&
|
|
||||||
! use_homebrew_yaml
|
! use_homebrew_yaml
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1048,14 +1047,8 @@ apply_python_patch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_package_verify_python() {
|
build_package_verify_python() {
|
||||||
# Check the existence of ./bin since pyenv-which searches the executables from there
|
|
||||||
if [ ! -d "${PREFIX_PATH}/bin" ]; then
|
|
||||||
echo "pyenv: invalid Python installation" >&4 2>&1
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create `python` executable if missing. Especially for Py3k.
|
# Create `python` executable if missing. Especially for Py3k.
|
||||||
if [ ! -e "${PREFIX_PATH}/bin/python" ]; then
|
[ -e "${PYTHON_BIN}" ] || {
|
||||||
local python
|
local python
|
||||||
for python in "${PREFIX_PATH}/bin/python"*; do
|
for python in "${PREFIX_PATH}/bin/python"*; do
|
||||||
if expr "$(basename "$python")" : '^python[0-9][0-9]*\.[0-9][0-9]*$' 2>&1 >/dev/null; then
|
if expr "$(basename "$python")" : '^python[0-9][0-9]*\.[0-9][0-9]*$' 2>&1 >/dev/null; then
|
||||||
@ -1063,8 +1056,7 @@ build_package_verify_python() {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
}
|
||||||
|
|
||||||
if [ ! -x "${PYTHON_BIN}" ]; then
|
if [ ! -x "${PYTHON_BIN}" ]; then
|
||||||
echo "pyenv: invalid Python executable: ${PYTHON_BIN}" >&4 2>&1
|
echo "pyenv: invalid Python executable: ${PYTHON_BIN}" >&4 2>&1
|
||||||
return 1
|
return 1
|
||||||
@ -1193,8 +1185,8 @@ list_definitions() {
|
|||||||
unset VERBOSE
|
unset VERBOSE
|
||||||
unset KEEP_BUILD_PATH
|
unset KEEP_BUILD_PATH
|
||||||
unset HAS_PATCH
|
unset HAS_PATCH
|
||||||
unset DEBUG
|
|
||||||
PYTHON_BUILD_ROOT="$(abs_dirname "$0")/.."
|
PYTHON_BUILD_ROOT="$(abs_dirname "$0")/.."
|
||||||
|
unset DEBUG
|
||||||
|
|
||||||
parse_options "$@"
|
parse_options "$@"
|
||||||
|
|
||||||
@ -1311,9 +1303,9 @@ if [ -n "$DEBUG" ]; then
|
|||||||
package_option python configure --with-pydebug
|
package_option python configure --with-pydebug
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]] && [[ "$LDFLAGS" != *"-rpath="* ]]; then
|
if [[ "$CONFIGURE_OPTS" == *"--enable-shared"* ]] || [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]]; then
|
||||||
# The ld on Darwin embeds the full paths to each dylib by default
|
# The ld on Darwin embeds the full paths to each dylib by default
|
||||||
if [[ "Darwin" != "$(uname -s)" ]]; then
|
if [[ "$LDFLAGS" != *"-rpath="* ]] && [[ "Darwin" != "$(uname -s)" ]]; then
|
||||||
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib ${LDFLAGS}"
|
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib ${LDFLAGS}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -1323,7 +1315,7 @@ LOG_PATH="${TMP}/python-build.${SEED}.log"
|
|||||||
PYTHON_BIN="${PREFIX_PATH}/bin/python"
|
PYTHON_BIN="${PREFIX_PATH}/bin/python"
|
||||||
CWD="$(pwd)"
|
CWD="$(pwd)"
|
||||||
|
|
||||||
if [ -z $PYTHON_BUILD_BUILD_PATH ]; then
|
if [ -z "$PYTHON_BUILD_BUILD_PATH" ]; then
|
||||||
BUILD_PATH="${TMP}/python-build.${SEED}"
|
BUILD_PATH="${TMP}/python-build.${SEED}"
|
||||||
else
|
else
|
||||||
BUILD_PATH="$PYTHON_BUILD_BUILD_PATH"
|
BUILD_PATH="$PYTHON_BUILD_BUILD_PATH"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user