|
|
@ -985,40 +985,50 @@ pyston_architecture() { |
|
|
|
build_package_pypy() { |
|
|
|
build_package_copy |
|
|
|
mkdir -p "${PREFIX_PATH}/bin" "${PREFIX_PATH}/lib" |
|
|
|
local pypy libpypy python |
|
|
|
local bin |
|
|
|
shopt -s nullglob |
|
|
|
for pypy in "bin/pypy"*; do |
|
|
|
case "${pypy##*/}" in |
|
|
|
"pypy-stm" ) |
|
|
|
python="bin/python" |
|
|
|
;; |
|
|
|
* ) |
|
|
|
python="$(basename "${pypy}" | sed -e 's/pypy/python/')" |
|
|
|
;; |
|
|
|
esac |
|
|
|
( cd "${PREFIX_PATH}/bin" && ln -fs "${pypy##*/}" "${python##*/}" ) |
|
|
|
done |
|
|
|
for libpypy in "bin/libpypy-c."*; do |
|
|
|
( cd "${PREFIX_PATH}/lib" && ln -fs "../bin/$(basename "${libpypy}")" "$(basename "${libpypy}")" ) |
|
|
|
for bin in "bin/"*; do |
|
|
|
if [ -f "${bin}" ] && [ -x "${bin}" ] && [ ! -L "${bin}" ]; then |
|
|
|
case "${bin##*/}" in |
|
|
|
"libpypy"* ) |
|
|
|
( cd "${PREFIX_PATH}/lib" && ln -fs "../bin/${bin##*/}" "${bin##*/}" ) |
|
|
|
;; |
|
|
|
"pypy"* ) |
|
|
|
( cd "${PREFIX_PATH}/bin" && ln -fs "${bin##*/}" "python" ) |
|
|
|
;; |
|
|
|
esac |
|
|
|
fi |
|
|
|
done |
|
|
|
shopt -u nullglob |
|
|
|
} |
|
|
|
|
|
|
|
build_package_pypy_builder() { |
|
|
|
if [ -f "rpython/bin/rpython" ]; then # pypy 2.x |
|
|
|
python "rpython/bin/rpython" ${PYPY_OPTS:-"-Ojit"} "pypy/goal/targetpypystandalone.py" >&4 2>&1 |
|
|
|
if [ -z "${PYPY_OPTS}" ]; then |
|
|
|
local PYPY_OPTS="--opt=jit --batch --make-jobs=$(num_cpu_cores)" |
|
|
|
fi |
|
|
|
python "rpython/bin/rpython" ${PYPY_OPTS} "pypy/goal/targetpypystandalone.py" >&4 2>&1 |
|
|
|
elif [ -f "pypy/translator/goal/translate.py" ]; then # pypy 1.x |
|
|
|
( cd "pypy/translator/goal" && python "translate.py" ${PYPY_OPTS:-"--opt=jit"} "targetpypystandalone.py" ) 1>&4 2>&1 |
|
|
|
if [ -z "${PYPY_OPTS}" ]; then |
|
|
|
local PYPY_OPTS="--opt=jit" |
|
|
|
fi |
|
|
|
( cd "pypy/translator/goal" && python "translate.py" ${PYPY_OPTS} "targetpypystandalone.py" ) 1>&4 2>&1 |
|
|
|
else |
|
|
|
echo "not a pypy source tree" 1>&3 |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
{ mkdir -p "bin" "lib" |
|
|
|
if [ -x "pypy-c" ]; then |
|
|
|
mv -f "pypy-c" "bin/pypy" |
|
|
|
fi |
|
|
|
for libpypy in "libpypy-c."*; do |
|
|
|
mv -f "${libpypy}" "bin/" |
|
|
|
local pypy |
|
|
|
for pypy in "pypy"*; do |
|
|
|
if [ -f "${pypy}" ] && [ -x "${pypy}" ] && [ ! -L "${pypy}" ]; then |
|
|
|
mv -f "${pypy}" "bin/${pypy##*/}" |
|
|
|
fi |
|
|
|
done |
|
|
|
local libpypy |
|
|
|
for libpypy in "libpypy"*; do |
|
|
|
if [ -f "${libpypy}" ] && [ -x "${libpypy}" ] && [ ! -L "${libpypy}" ]; then |
|
|
|
mv -f "${libpypy}" "bin/${libpypy##*/}" |
|
|
|
fi |
|
|
|
done |
|
|
|
} >&4 2>&1 |
|
|
|
build_package_pypy |
|
|
|