Skip to content

Commit

Permalink
Fix hashlib too. Also use GH download link as python.org 403'd me (#97)
Browse files Browse the repository at this point in the history
* Fix hashlib too. Also use GH download link as python.org 403'd me
  • Loading branch information
mattgodbolt authored Nov 26, 2024
1 parent 50a8ac8 commit f269be7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
REVISION="python-${VERSION}"
initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}"

curl -sL https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tar.xz | tar Jxf -
curl -sL https://github.com/python/cpython/archive/refs/tags/v${VERSION}.tar.gz | tar zxf -

SSL_PREFIX=/root/ssl
SSL_VERSION=3.3.2
Expand All @@ -37,7 +37,7 @@ export LD_LIBRARY_PATH=${SSL_PREFIX}/lib64

DEST=/root/python

pushd Python-${VERSION}
pushd cpython-${VERSION}
./configure \
--prefix=${DEST} \
--with-openssl=${SSL_PREFIX} \
Expand All @@ -52,8 +52,9 @@ popd
# copy SSL SOs to the same directory as the native python modules
cp ${SSL_PREFIX}/lib64/*.so* /root/python/lib/python*/lib-dynload/

# then patch the ssl to look at $ORIGIN to find the crypto libs
# then patch the ssl and hashlib to look at $ORIGIN to find the crypto libs
patchelf --set-rpath \$ORIGIN /root/python/lib/python*/lib-dynload/_ssl*.so
patchelf --set-rpath \$ORIGIN /root/python/lib/python*/lib-dynload/_hashlib*.so

# strip executables
find ${DEST} -type f -perm /u+x -exec strip -d {} \;
Expand Down

0 comments on commit f269be7

Please sign in to comment.