File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,20 @@ make -j$(nproc)
49
49
make install
50
50
popd
51
51
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} /
54
61
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
58
64
59
65
# strip executables
60
66
find ${DEST} -type f -perm /u+x -exec strip -d {} \;
61
67
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
-
66
68
complete " ${DEST} " " ${FULLNAME} " " ${OUTPUT} "
You can’t perform that action at this time.
0 commit comments