mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #726 from yyuu/osx-unicode-narrow-ucs2
Stop using ucs4 as default unicode encoding on OS X
This commit is contained in:
commit
31a3aec870
4 changed files with 94 additions and 6 deletions
|
@ -1939,7 +1939,9 @@ fi
|
|||
|
||||
# Compile with `--enable-unicode=ucs4` by default (#257)
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then
|
||||
if ! is_mac; then
|
||||
package_option python configure --enable-unicode=ucs4
|
||||
fi
|
||||
fi
|
||||
|
||||
# SSL Certificate error with older wget that does not support Server Name Indication (#60)
|
||||
|
|
|
@ -67,6 +67,10 @@ assert_build_log() {
|
|||
stub_make_install
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
install_fixture definitions/needs-yaml
|
||||
assert_success
|
||||
|
||||
|
@ -93,6 +97,10 @@ OUT
|
|||
stub_make_install
|
||||
stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<""
|
||||
assert_success
|
||||
|
||||
|
@ -121,6 +129,10 @@ OUT
|
|||
stub_make_install
|
||||
stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<"diff --git a/script.py"
|
||||
assert_success
|
||||
|
||||
|
@ -149,6 +161,10 @@ OUT
|
|||
stub brew "--prefix libyaml : echo '$brew_libdir'" false
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
install_fixture definitions/needs-yaml
|
||||
assert_success
|
||||
|
||||
|
@ -172,6 +188,10 @@ OUT
|
|||
stub brew "--prefix readline : echo '$readline_libdir'"
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
DEF
|
||||
|
@ -199,6 +219,10 @@ OUT
|
|||
stub brew
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
|
@ -223,7 +247,11 @@ OUT
|
|||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub sysctl false
|
||||
stub_make_install
|
||||
|
||||
|
@ -238,7 +266,7 @@ DEF
|
|||
|
||||
assert_build_log <<OUT
|
||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
|
@ -251,7 +279,11 @@ OUT
|
|||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub sysctl '-n hw.ncpu : echo 4'
|
||||
stub_make_install
|
||||
|
||||
|
@ -267,7 +299,7 @@ DEF
|
|||
|
||||
assert_build_log <<OUT
|
||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
make -j 4
|
||||
make install
|
||||
OUT
|
||||
|
@ -283,6 +315,9 @@ OUT
|
|||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
export -n MAKE_OPTS
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
|
@ -306,6 +341,10 @@ OUT
|
|||
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
export PYTHON_MAKE_INSTALL_OPTS="DOGE=\"such wow\""
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
|
@ -327,6 +366,10 @@ OUT
|
|||
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
export MAKE_INSTALL_OPTS="DOGE=\"such wow\""
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
|
@ -361,6 +404,9 @@ OUT
|
|||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
MAKE= install_fixture definitions/vanilla-python
|
||||
assert_success
|
||||
|
||||
|
@ -377,6 +423,9 @@ OUT
|
|||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
MAKE= install_fixture definitions/vanilla-python
|
||||
assert_success
|
||||
|
||||
|
@ -395,6 +444,10 @@ CONF
|
|||
stub apply 'echo apply "$@" >> build.log'
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
export PYTHON_CONFIGURE="${TMP}/custom-configure"
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
|
|
|
@ -12,6 +12,9 @@ export -n PYTHON_CONFIGURE_OPTS
|
|||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9.5'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9.5'
|
||||
stub gcc '--version : echo 4.2.1'
|
||||
|
@ -33,6 +36,9 @@ OUT
|
|||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub gcc '--version : echo 4.2.1'
|
||||
|
@ -67,6 +73,9 @@ DEF
|
|||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub cc 'false'
|
||||
|
@ -89,7 +98,7 @@ build_package_standard python
|
|||
DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib --enable-unicode=ucs4
|
||||
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib
|
||||
CC=clang
|
||||
CFLAGS=no
|
||||
make -j 2
|
||||
|
|
|
@ -101,6 +101,10 @@ resolve_link() {
|
|||
|
||||
echo | install_patch definitions/vanilla-python "Python-3.2.1/empty.patch"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
|
||||
|
@ -127,6 +131,10 @@ OUT
|
|||
echo "bar" | install_patch definitions/vanilla-python "Python-3.2.1/bar.patch"
|
||||
echo "baz" | install_patch definitions/vanilla-python "Python-3.2.1/baz.patch"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
|
||||
|
@ -152,6 +160,10 @@ OUT
|
|||
" : echo \"$MAKE \$@\" >> build.log" \
|
||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
|
||||
PYTHON_MAKE_INSTALL_TARGET="altinstall" TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
|
||||
|
@ -234,6 +246,9 @@ OUT
|
|||
touch "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3.4-config"
|
||||
chmod +x "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3.4-config"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-framework" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
|
@ -242,7 +257,7 @@ verify_python python3.4
|
|||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install --enable-unicode=ucs4)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install)
|
||||
EOS
|
||||
|
||||
[ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python" ]
|
||||
|
@ -250,6 +265,9 @@ EOS
|
|||
}
|
||||
|
||||
@test "enable universalsdk" {
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
|
@ -257,7 +275,7 @@ echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
|||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=intel --enable-unicode=ucs4)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=intel)
|
||||
EOS
|
||||
}
|
||||
|
||||
|
@ -283,6 +301,9 @@ OUT
|
|||
}
|
||||
|
||||
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
|
@ -294,6 +315,9 @@ OUT
|
|||
}
|
||||
|
||||
@test "use custom MACOSX_DEPLOYMENT_TARGET if defined" {
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
MACOSX_DEPLOYMENT_TARGET="10.4" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
|
|
Loading…
Reference in a new issue