forked from pypa/manylinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pypa#1099
- Loading branch information
Showing
5 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
# Stop at any error, show all commands | ||
set -exuo pipefail | ||
|
||
# Get script directory | ||
MY_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
|
||
# Get build utilities | ||
source $MY_DIR/build_utils.sh | ||
|
||
|
||
PYTHON_VERSION=$1 | ||
PYPY_VERSION=$2 | ||
PYPY_DOWNLOAD_URL=https://downloads.python.org/pypy | ||
|
||
|
||
function get_shortdir { | ||
local exe=$1 | ||
$exe -c 'import sys; print("pypy%d.%d-%d.%d.%d" % (sys.version_info[:2]+sys.pypy_version_info[:3]))' | ||
} | ||
|
||
|
||
mkdir -p /tmp | ||
cd /tmp | ||
|
||
case ${AUDITWHEEL_ARCH} in | ||
x86_64) PYPY_ARCH=linux64;; | ||
i686) PYPY_ARCH=linux32;; | ||
aarch64) PYPY_ARCH=aarch64;; | ||
*) echo "No PyPy for ${AUDITWHEEL_ARCH}"; exit 0;; | ||
esac | ||
|
||
TARBALL=pypy${PYTHON_VERSION}-v${PYPY_VERSION}-${PYPY_ARCH}.tar.bz2 | ||
TMPDIR=/tmp/${TARBALL/.tar.bz2//} | ||
PREFIX="/opt/_internal" | ||
|
||
mkdir -p ${PREFIX} | ||
|
||
fetch_source ${TARBALL} ${PYPY_DOWNLOAD_URL} | ||
|
||
tar -xf ${TARBALL} | ||
|
||
# the new PyPy 3 distributions don't have pypy symlinks to pypy3 | ||
if [ ! -f "${TMPDIR}/bin/pypy" ]; then | ||
ln -s pypy3 ${TMPDIR}/bin/pypy | ||
fi | ||
|
||
# rename the directory to something shorter like pypy3.7-7.3.4 | ||
PREFIX=${PREFIX}/$(get_shortdir ${TMPDIR}/bin/pypy) | ||
mv ${TMPDIR} ${PREFIX} | ||
|
||
# add a generic "python" symlink | ||
if [ ! -f "${PREFIX}/bin/python" ]; then | ||
ln -s pypy ${PREFIX}/bin/python | ||
fi | ||
|
||
# remove debug symbols | ||
rm ${PREFIX}/bin/*.debug | ||
|
||
# We do not need the Python test suites | ||
find ${PREFIX} -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf | ||
|
||
# We do not need precompiled .pyc and .pyo files. | ||
clean_pyc ${PREFIX} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters