Add support for --enable-framework (#55, #99)

```
$ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.3.2
```
This commit is contained in:
Yamashita Yuu 2014-01-18 01:52:50 +09:00
parent cbe7d0241b
commit b225f2030d

View file

@ -1062,6 +1062,19 @@ apply_python_patch() {
build_package_verify_python() {
local package_name="$1"
local python="$2"
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
local path file
for path in bin include lib share; do
mkdir -p "${PREFIX_PATH}/${path}"
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
if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then
( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" )
fi
@ -1330,6 +1343,10 @@ if [[ "$CONFIGURE_OPTS" == *"--enable-shared"* ]] || [[ "$PYTHON_CONFIGURE_OPTS"
fi
fi
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
package_option python configure --enable-framework="${PREFIX_PATH}"
fi
SEED="$(date "+%Y%m%d%H%M%S").$$"
LOG_PATH="${TMP}/python-build.${SEED}.log"
PYTHON_BIN="${PREFIX_PATH}/bin/python"