@@ -14,53 +14,38 @@ if [ "${BASE_POLICY}" == "musllinux" ]; then
14
14
exit 0
15
15
fi
16
16
17
- PYTHON_VERSION=$1
18
- VERSION_PREFIX=$2
19
- GRAALPY_VERSION=$3
20
- ARCHIVE_PREFIX=$4
21
- GRAALPY_DOWNLOAD_URL=https://github.com/oracle/graalpython/releases/download/${VERSION_PREFIX} -${GRAALPY_VERSION} /
22
- # graal-23.0.0/graalpython-23.0.0-linux-amd64.tar.gz
23
-
24
-
25
- function get_shortdir {
26
- local exe=$1
27
- $exe -c ' import sys; print(sys.implementation.cache_tag)'
28
- }
29
-
30
-
31
- mkdir -p /tmp
32
- cd /tmp
33
-
34
17
case ${AUDITWHEEL_ARCH} in
35
18
x86_64) GRAALPY_ARCH=amd64;;
36
19
aarch64) GRAALPY_ARCH=aarch64;;
37
- * ) echo " No PyPy for ${AUDITWHEEL_ARCH} " ; exit 0;;
20
+ * ) echo " No GraalPy for ${AUDITWHEEL_ARCH} " ; exit 0;;
38
21
esac
39
22
40
- EXPAND_NAME=graalpy-${GRAALPY_VERSION} -linux-${GRAALPY_ARCH}
41
- TMPDIR=/tmp/${EXPAND_NAME}
23
+ PYTHON_VERSION=$1
24
+ VERSION_PREFIX=$2
25
+ GRAALPY_VERSION=$3
26
+ ARCHIVE_PREFIX=$4
27
+ GRAALPY_DOWNLOAD_URL=https://github.com/oracle/graalpython/releases/download/${VERSION_PREFIX} -${GRAALPY_VERSION} / # e.g. graal-23.0.0/graalpython-23.0.0-linux-amd64.tar.gz
28
+ TMPDIR=/tmp/
42
29
TARBALL=graalpython-${GRAALPY_VERSION} -linux-${GRAALPY_ARCH} .tar.gz
43
- PREFIX=" /opt/_internal"
30
+ TARBALL_SHA=` grep " ${TARBALL} \$ " ${MY_DIR} /graalpy.sha256`
31
+ PREFIX=" /opt/_internal/graalpy-${GRAALPY_VERSION} "
44
32
33
+ # create a download script that will download and extract graalpy. we leave
34
+ # this script in the image to avoid the large distribution to use up space in
35
+ # the default image.
45
36
mkdir -p ${PREFIX}
46
-
47
- fetch_source ${TARBALL} ${GRAALPY_DOWNLOAD_URL}
48
-
49
- # We only want to check the current tarball sha256sum
50
- grep " ${TARBALL} \$ " ${MY_DIR} /graalpy.sha256 > ${TARBALL} .sha256
51
- # then check sha256 sum
52
- sha256sum -c ${TARBALL} .sha256
53
-
54
- tar -xf ${TARBALL}
55
-
56
- # rename the directory to something shorter like graalpy230-310
57
- PREFIX=${PREFIX} /$( get_shortdir ${TMPDIR} /bin/graalpy)
58
- mv ${TMPDIR} ${PREFIX}
59
-
60
- # add a generic "python" symlink
61
- if [ ! -f " ${PREFIX} /bin/python" ]; then
62
- ln -s graalpy ${PREFIX} /bin/python
63
- fi
64
-
65
- # We do not need precompiled .pyc and .pyo files.
66
- clean_pyc ${PREFIX}
37
+ cat << EOF> ${PREFIX} /install-graalpy.sh
38
+ #!/bin/bash
39
+ set -exuo pipefail
40
+ mkdir -p ${PREFIX}
41
+ mkdir -p ${TMPDIR}
42
+ curl -fsSL -o "${TMPDIR} /${TARBALL} " "${GRAALPY_DOWNLOAD_URL} /${TARBALL} "
43
+ cd ${TMPDIR}
44
+ echo "${TARBALL_SHA} " | sha256sum -c
45
+ tar -xf "${TMPDIR} /${TARBALL} " --overwrite --strip-components=1 -C "${PREFIX} "
46
+ rm -f "${TMPDIR} /${TARBALL} "
47
+ EOF
48
+
49
+ # call the download script right now.
50
+ chmod +x ${PREFIX} /install-graalpy.sh
51
+ ${PREFIX} /install-graalpy.sh
0 commit comments