mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #542 from yyuu/default-unicode-ucs4
Compile with `--enable-unicode=ucs4` by default for CPython
This commit is contained in:
commit
a6f1f480eb
4 changed files with 46 additions and 20 deletions
|
@ -1850,6 +1850,11 @@ if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
||||||
package_option python configure --enable-universalsdk=/ --with-universal-archs=intel
|
package_option python configure --enable-universalsdk=/ --with-universal-archs=intel
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Compile with `--enable-unicode=ucs4` by default (#257)
|
||||||
|
if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then
|
||||||
|
package_option python configure --enable-unicode=ucs4
|
||||||
|
fi
|
||||||
|
|
||||||
# SSL Certificate error with older wget that does not support Server Name Indication (#60)
|
# SSL Certificate error with older wget that does not support Server Name Indication (#60)
|
||||||
if ! command -v curl 1>/dev/null 2>&1 && [[ "$(wget --version 2>/dev/null || true)" = "GNU Wget 1.1"[0-3]* ]]; then
|
if ! command -v curl 1>/dev/null 2>&1 && [[ "$(wget --version 2>/dev/null || true)" = "GNU Wget 1.1"[0-3]* ]]; then
|
||||||
echo "python-build: wget (< 1.14) doesn't support Server Name Indication. Please install curl (>= 7.18.1) and try again" >&2
|
echo "python-build: wget (< 1.14) doesn't support Server Name Indication. Please install curl (>= 7.18.1) and try again" >&2
|
||||||
|
|
|
@ -77,7 +77,7 @@ yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -105,7 +105,7 @@ make -j 2
|
||||||
make install
|
make install
|
||||||
patch -p0 --force -i $TMP/python-patch.XXX
|
patch -p0 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -133,7 +133,7 @@ make -j 2
|
||||||
make install
|
make install
|
||||||
patch -p1 --force -i $TMP/python-patch.XXX
|
patch -p1 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -156,7 +156,7 @@ OUT
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include " LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib "
|
Python-3.2.1: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include " LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib "
|
||||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -181,7 +181,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include " LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib "
|
Python-3.2.1: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include " LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib "
|
||||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -209,7 +209,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||||
Python-3.2.1: --prefix=$INSTALL_ROOT CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib --libdir=$INSTALL_ROOT/lib
|
Python-3.2.1: --prefix=$INSTALL_ROOT CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -237,7 +237,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -266,7 +266,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 4
|
make -j 4
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -294,7 +294,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 1
|
make -j 1
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -315,7 +315,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install DOGE="such wow"
|
make install DOGE="such wow"
|
||||||
OUT
|
OUT
|
||||||
|
@ -336,7 +336,7 @@ DEF
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install DOGE="such wow"
|
make install DOGE="such wow"
|
||||||
OUT
|
OUT
|
||||||
|
@ -406,7 +406,7 @@ DEF
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
apply -p1 -i /my/patch.diff
|
apply -p1 -i /my/patch.diff
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
|
|
@ -89,7 +89,7 @@ build_package_standard python
|
||||||
DEF
|
DEF
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib
|
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib --enable-unicode=ucs4
|
||||||
CC=clang
|
CC=clang
|
||||||
CFLAGS=no
|
CFLAGS=no
|
||||||
make -j 2
|
make -j 2
|
||||||
|
|
|
@ -106,7 +106,7 @@ resolve_link() {
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
patch -p0 --force -i $TMP/python-patch.XXX
|
patch -p0 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -134,7 +134,7 @@ patch: bar
|
||||||
patch: baz
|
patch: baz
|
||||||
patch: foo
|
patch: foo
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
@ -156,7 +156,7 @@ OUT
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
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
|
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4
|
||||||
make -j 2
|
make -j 2
|
||||||
make altinstall
|
make altinstall
|
||||||
OUT
|
OUT
|
||||||
|
@ -222,7 +222,7 @@ OUT
|
||||||
[[ "$(resolve_link "${INSTALL_ROOT}/bin/python-config")" == "python3.4-config" ]]
|
[[ "$(resolve_link "${INSTALL_ROOT}/bin/python-config")" == "python3.4-config" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "--enable-framework" {
|
@test "enable framework" {
|
||||||
mkdir -p "${INSTALL_ROOT}/Python.framework/Versions/Current/bin"
|
mkdir -p "${INSTALL_ROOT}/Python.framework/Versions/Current/bin"
|
||||||
touch "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3"
|
touch "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3"
|
||||||
chmod +x "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3"
|
chmod +x "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3"
|
||||||
|
@ -241,14 +241,14 @@ verify_python python3.4
|
||||||
OUT
|
OUT
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install --enable-unicode=ucs4)
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
[ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python" ]
|
[ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python" ]
|
||||||
[ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python-config" ]
|
[ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python-config" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "--enable-universalsdk" {
|
@test "enable universalsdk" {
|
||||||
stub uname '-s : echo Darwin'
|
stub uname '-s : echo Darwin'
|
||||||
|
|
||||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
|
@ -256,10 +256,31 @@ echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||||
OUT
|
OUT
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=intel)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=intel --enable-unicode=ucs4)
|
||||||
EOS
|
EOS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "enable custom unicode configuration" {
|
||||||
|
cached_tarball "Python-3.2.1"
|
||||||
|
|
||||||
|
stub brew false
|
||||||
|
stub "$MAKE" \
|
||||||
|
" : echo \"$MAKE \$@\" >> build.log" \
|
||||||
|
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||||
|
|
||||||
|
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
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 --enable-unicode=ucs2 --libdir=$INSTALL_ROOT/lib
|
||||||
|
make -j 2
|
||||||
|
make install
|
||||||
|
OUT
|
||||||
|
|
||||||
|
unstub make
|
||||||
|
}
|
||||||
|
|
||||||
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
||||||
stub uname '-s : echo Darwin'
|
stub uname '-s : echo Darwin'
|
||||||
stub sw_vers '-productVersion : echo 10.10'
|
stub sw_vers '-productVersion : echo 10.10'
|
||||||
|
|
Loading…
Reference in a new issue