@@ -86,10 +86,6 @@ hash -r
86
86
curl --version
87
87
curl-config --features
88
88
89
- # Install a git we link against OpenSSL so that we can use TLS 1.2
90
- build_git $GIT_ROOT $GIT_HASH
91
- git version
92
-
93
89
# Install newest autoconf
94
90
build_autoconf $AUTOCONF_ROOT $AUTOCONF_HASH
95
91
autoconf --version
@@ -102,6 +98,41 @@ automake --version
102
98
build_libtool $LIBTOOL_ROOT $LIBTOOL_HASH
103
99
libtool --version
104
100
101
+ # Install patchelf (latest with unreleased bug fixes)
102
+ curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION .tar.gz
103
+ check_sha256sum patchelf.tar.gz $PATCHELF_HASH
104
+ tar -xzf patchelf.tar.gz
105
+ (cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && do_standard_install)
106
+ rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION
107
+
108
+ # Let's patch curl & openssl
109
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libcrypto.so.1.0.0)
110
+ CHECKSUM=${CHECKSUM: 0: 8}
111
+ patchelf --set-soname /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcrypto.so.1.0.0
112
+ mv /opt/_internal/_vendor/lib/libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM}
113
+ ln -sf libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcrypto.so
114
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so.1.0.0
115
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
116
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /usr/local/bin/curl
117
+
118
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libssl.so.1.0.0)
119
+ CHECKSUM=${CHECKSUM: 0: 8}
120
+ patchelf --set-soname /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so.1.0.0
121
+ mv /opt/_internal/_vendor/lib/libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM}
122
+ ln -sf libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so
123
+ patchelf --replace-needed libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
124
+ patchelf --replace-needed libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /usr/local/bin/curl
125
+
126
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libcurl.so.4)
127
+ CHECKSUM=${CHECKSUM: 0: 8}
128
+ patchelf --set-soname /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
129
+ mv /opt/_internal/_vendor/lib/libcurl.so.4 /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM}
130
+ patchelf --replace-needed libcurl.so.4 /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM} /usr/local/bin/curl
131
+
132
+ # Install a git we link against OpenSSL so that we can use TLS 1.2
133
+ build_git $GIT_ROOT $GIT_HASH
134
+ git version
135
+
105
136
# Install a more recent SQLite3
106
137
curl -fsSLO $SQLITE_AUTOCONF_DOWNLOAD_URL /$SQLITE_AUTOCONF_VERSION .tar.gz
107
138
check_sha256sum $SQLITE_AUTOCONF_VERSION .tar.gz $SQLITE_AUTOCONF_HASH
@@ -110,11 +141,14 @@ cd $SQLITE_AUTOCONF_VERSION
110
141
do_standard_install
111
142
cd ..
112
143
rm -rf $SQLITE_AUTOCONF_VERSION *
144
+ rm -f /usr/local/lib/libsqlite3.a
145
+
146
+ # Create a symbolic link for python to find openssl
147
+ ln -s /opt/_internal/_vendor /usr/local/ssl
113
148
114
149
# Compile the latest Python releases.
115
150
# (In order to have a proper SSL module, Python is compiled
116
- # against a recent openssl [see env vars above], which is linked
117
- # statically.
151
+ # against a recent openssl [see env vars above])
118
152
mkdir -p /opt/python
119
153
build_cpythons $CPYTHON_VERSIONS
120
154
@@ -134,14 +168,8 @@ ln -s $($PY36_BIN/python -c 'import certifi; print(certifi.where())') \
134
168
export SSL_CERT_FILE=/opt/_internal/certs.pem
135
169
136
170
# Now we can delete our built OpenSSL headers/static libs since we've linked everything we need
137
- rm -rf /usr/local/ssl
138
-
139
- # Install patchelf (latest with unreleased bug fixes)
140
- curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION .tar.gz
141
- check_sha256sum patchelf.tar.gz $PATCHELF_HASH
142
- tar -xzf patchelf.tar.gz
143
- (cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && do_standard_install)
144
- rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION
171
+ unlink /usr/local/ssl
172
+ find /opt/_internal/_vendor -mindepth 1 -maxdepth 1 -not -path ' /opt/_internal/_vendor/lib*' | xargs rm -rf
145
173
146
174
ln -s $PY36_BIN /auditwheel /usr/local/bin/auditwheel
147
175
@@ -167,6 +195,8 @@ find /opt/_internal -name '*.a' -print0 | xargs -0 rm -f
167
195
# *everything*, including non-ELF files:
168
196
find /opt/_internal -type f -print0 \
169
197
| xargs -0 -n1 strip --strip-unneeded 2> /dev/null || true
198
+ find /usr/local -type f -print0 \
199
+ | xargs -0 -n1 strip --strip-unneeded 2> /dev/null || true
170
200
171
201
for PYTHON in /opt/python/* /bin/python; do
172
202
# Smoke test to make sure that our Pythons work, and do indeed detect as
0 commit comments