From 90e6e30d63a3911f9fad3774e0b94c6050566735 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Mon, 15 Feb 2016 00:27:40 +0000 Subject: [PATCH 1/3] Compile with `--enable-unicode=ucs4` by default for CPython (fixes #257) --- plugins/python-build/bin/python-build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index fef4260a..e22cfc5a 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1850,6 +1850,11 @@ if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then package_option python configure --enable-universalsdk=/ --with-universal-archs=intel 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) 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 From b37361b862747de369bad1fd76057c55b3f503b4 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Mon, 15 Feb 2016 00:37:20 +0000 Subject: [PATCH 2/3] Fix broken tests with `--enable-unicode=ucs4` by default --- plugins/python-build/test/build.bats | 24 ++++++++++++------------ plugins/python-build/test/compiler.bats | 2 +- plugins/python-build/test/pyenv_ext.bats | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index b8aa3acd..c14ea61a 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -77,7 +77,7 @@ yaml-0.1.6: --prefix=$INSTALL_ROOT make -j 2 make install 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 install OUT @@ -105,7 +105,7 @@ make -j 2 make install 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: --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 install OUT @@ -133,7 +133,7 @@ make -j 2 make install 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: --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 install OUT @@ -156,7 +156,7 @@ OUT assert_build_log < Date: Mon, 15 Feb 2016 00:40:07 +0000 Subject: [PATCH 3/3] Add a test for custom value for `--enable-unicode` --- plugins/python-build/test/pyenv_ext.bats | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/plugins/python-build/test/pyenv_ext.bats b/plugins/python-build/test/pyenv_ext.bats index e538237c..4ccc7705 100644 --- a/plugins/python-build/test/pyenv_ext.bats +++ b/plugins/python-build/test/pyenv_ext.bats @@ -222,7 +222,7 @@ OUT [[ "$(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" touch "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3" chmod +x "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python3" @@ -248,7 +248,7 @@ EOS [ -L "${INSTALL_ROOT}/Python.framework/Versions/Current/bin/python-config" ] } -@test "--enable-universalsdk" { +@test "enable universalsdk" { stub uname '-s : echo Darwin' PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <> 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 <