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