File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,20 @@ make -j$(nproc)
4949make install
5050popd
5151
52- # copy SSL SOs to the same directory as the native python modules
53- cp ${SSL_PREFIX} /lib64/* .so* /root/python/lib/python* /lib-dynload/
52+ # delete tests and static libraries to save disk space
53+ find ${DEST} -type d -name test -exec rm -rf {} +
54+ find ${DEST} -type f -name ' *.a' -delete
55+
56+ PYTHON_SO_DIR=${DEST} /lib/python* /lib-dynload
57+
58+ # copy SSL and any other system dependencies like libffi etc
59+ DEPS=$( env LD_LIBRARY_PATH=${SSL_PREFIX} /lib64 ldd ${PYTHON_SO_DIR} /* .so | grep ' => /' | grep -Ev ' lib(pthread|c|dl|rt)\.so' | awk ' { print $3 }' | sort | uniq)
60+ cp ${DEPS} ${PYTHON_SO_DIR} /
5461
55- # then patch the ssl and hashlib to look at $ORIGIN to find the crypto libs
56- patchelf --set-rpath \$ ORIGIN /root/python/lib/python* /lib-dynload/_ssl* .so
57- patchelf --set-rpath \$ ORIGIN /root/python/lib/python* /lib-dynload/_hashlib* .so
62+ # Patch all the SOs to look in their own directory.
63+ patchelf --set-rpath \$ ORIGIN ${PYTHON_SO_DIR} /* .so
5864
5965# strip executables
6066find ${DEST} -type f -perm /u+x -exec strip -d {} \;
6167
62- # delete tests and static libraries to save disk space
63- find ${DEST} -type d -name test -exec rm -rf {} +
64- find ${DEST} -type f -name ' *.a' -delete
65-
6668complete " ${DEST} " " ${FULLNAME} " " ${OUTPUT} "
You can’t perform that action at this time.
0 commit comments