Add workaround for --enable-framework to work with CPython 2.7.6

This commit is contained in:
Yamashita Yuu 2014-01-18 02:46:13 +09:00
parent b225f2030d
commit bf94eb8cbe

View file

@ -1063,17 +1063,9 @@ build_package_verify_python() {
local package_name="$1" local package_name="$1"
local python="$2" local python="$2"
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
local path file # Only symlinks are installed in ${PREFIX_PATH}/bin
for path in bin include lib share; do rm -fr "${PREFIX_PATH}/bin"
mkdir -p "${PREFIX_PATH}/${path}" ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/bin" "${PREFIX_PATH}/bin"
mv -f "${PREFIX_PATH}/${path}" "${PREFIX_PATH}/.${path}"
ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/${path}" "${PREFIX_PATH}/${path}"
find "${PREFIX_PATH}/.${path}" -type l -delete
for file in "${PREFIX_PATH}/.${path}/"*; do
[ -e "${file}" ] && cp -fR "${file}" "${PREFIX_PATH}/${path}"
done
rm -fr "${PREFIX_PATH}/.${path}"
done
fi fi
if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then
( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" ) ( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" )
@ -1344,6 +1336,17 @@ if [[ "$CONFIGURE_OPTS" == *"--enable-shared"* ]] || [[ "$PYTHON_CONFIGURE_OPTS"
fi fi
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
create_framework_dirs() {
local version="$(echo "$1" | sed -E 's/^[^0-9]*([0-9]+\.[0-9]+).*$/\1/')"
mkdir -p "${PREFIX_PATH}/Python.framework/Versions/${version}"
( cd "${PREFIX_PATH}/Python.framework/Versions" && ln -fs "${version}" "Current")
local path
for path in include lib share; do
mkdir -p "${PREFIX_PATH}/Python.framework/Versions/Current/${path}"
ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/${path}" "${PREFIX_PATH}/${path}"
done
}
create_framework_dirs "${DEFINITION_PATH##*/}"
package_option python configure --enable-framework="${PREFIX_PATH}" package_option python configure --enable-framework="${PREFIX_PATH}"
fi fi