@@ -12,17 +12,22 @@ ARG TOOLCHAIN=stable
12
12
# Dependencies
13
13
14
14
# OpenSSL v1.1.1
15
- ARG OPENSSL_VERSION=1.1.1g
15
+ # https://www.openssl.org/source/old/1.1.1/
16
+ ARG OPENSSL_VERSION=1.1.1h
16
17
17
18
# zlib - http://zlib.net/
18
19
ARG ZLIB_VERSION=1.2.11
19
20
20
21
# libpq - https://ftp.postgresql.org/pub/source/
21
- ARG POSTGRESQL_VERSION=11.10
22
+ ARG POSTGRESQL_VERSION=13.1
22
23
23
- # Mac OS X SDK version for OS X Cross
24
- ARG MACOSX_SDK_VERSION=10.11
24
+ # Mac OS X SDK version
25
+ ARG OSX_SDK_VERSION=10.15
26
+ ARG OSX_SDK_SUM=aee7b132a4b10cc26ab9904706412fd0907f5b8b660251e465647d8763f9f009
25
27
28
+ # OS X Cross
29
+ ARG OSX_CROSS_COMMIT=4287300a5c96397a2ee9ab3942e66578a1982031
30
+ ARG OSX_VERSION_MIN=10.14
26
31
27
32
# Make sure we have basic dev tools for building C libraries. Our goal
28
33
# here is to support the musl-libc builds and Cargo builds needed for a
@@ -54,15 +59,15 @@ RUN set -eux \
54
59
python \
55
60
xutils-dev \
56
61
zlib1g-dev \
57
- # Clean up local repository of retrieved packages and remove the package lists
62
+ # Clean up local repository of retrieved packages and remove the package lists
58
63
&& apt-get clean \
59
64
&& rm -rf /var/lib/apt/lists/* \
60
65
&& true
61
66
62
67
# Static linking for C++ code
63
68
RUN set -eux \
64
69
&& ln -s "/usr/bin/g++" "/usr/bin/musl-g++" \
65
- # Create appropriate directories for current user
70
+ # Create appropriate directories for current user
66
71
&& mkdir -p /root/libs /root/src \
67
72
&& true
68
73
@@ -89,24 +94,24 @@ RUN set -eux \
89
94
&& git config --global credential.https://github.com.helper ghtoken \
90
95
&& true
91
96
92
- # Build a static library version of OpenSSL using musl-libc. This is needed by
97
+ # Build a static library version of OpenSSL using musl-libc. This is needed by
93
98
# the popular Rust `hyper` crate.
94
99
#
95
100
# We point /usr/local/musl/include/linux at some Linux kernel headers (not
96
101
# necessarily the right ones) in an effort to compile OpenSSL 1.1's "engine"
97
102
# component. It's possible that this will cause bizarre and terrible things to
98
103
# happen. There may be "sanitized" header
99
104
RUN set -eux \
100
- && echo "Building OpenSSL..." \
105
+ && echo "Building OpenSSL ${OPENSSL_VERSION} ..." \
101
106
&& ls /usr/include/linux \
102
107
&& mkdir -p /usr/local/musl/include \
103
108
&& ln -s /usr/include/linux /usr/local/musl/include/linux \
104
109
&& ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/musl/include/asm \
105
110
&& ln -s /usr/include/asm-generic /usr/local/musl/include/asm-generic \
106
111
&& cd /tmp \
107
- && curl -LO "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" \
108
- && tar xvzf "openssl-$OPENSSL_VERSION.tar.gz" \
109
- && cd "openssl-$OPENSSL_VERSION" \
112
+ && curl -LO "https://www.openssl.org/source/openssl-${ OPENSSL_VERSION} .tar.gz" \
113
+ && tar xvzf "openssl-${ OPENSSL_VERSION} .tar.gz" \
114
+ && cd "openssl-${ OPENSSL_VERSION} " \
110
115
&& env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY linux-x86_64 \
111
116
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make depend \
112
117
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make \
@@ -117,23 +122,23 @@ RUN set -eux \
117
122
&& true
118
123
119
124
RUN set -eux \
120
- && echo "Building zlib..." \
125
+ && echo "Building zlib ${ZLIB_VERSION} ..." \
121
126
&& cd /tmp \
122
- && curl -LO "http://zlib.net/zlib-$ZLIB_VERSION.tar.gz" \
123
- && tar xzf "zlib-$ZLIB_VERSION.tar.gz" \
124
- && cd "zlib-$ZLIB_VERSION" \
127
+ && curl -LO "http://zlib.net/zlib-${ ZLIB_VERSION} .tar.gz" \
128
+ && tar xzf "zlib-${ ZLIB_VERSION} .tar.gz" \
129
+ && cd "zlib-${ ZLIB_VERSION} " \
125
130
&& env CC=musl-gcc ./configure --static --prefix=/usr/local/musl \
126
131
&& make \
127
132
&& make install \
128
133
&& rm -r /tmp/* \
129
134
&& true
130
135
131
136
RUN set -eux \
132
- && echo "Building libpq..." \
137
+ && echo "Building libpq ${POSTGRESQL_VERSION} ..." \
133
138
&& cd /tmp \
134
- && curl -LO "https://ftp.postgresql.org/pub/source/v$POSTGRESQL_VERSION/postgresql-$POSTGRESQL_VERSION.tar.gz" \
135
- && tar xzf "postgresql-$POSTGRESQL_VERSION.tar.gz" \
136
- && cd "postgresql-$POSTGRESQL_VERSION" \
139
+ && curl -LO "https://ftp.postgresql.org/pub/source/v${ POSTGRESQL_VERSION} /postgresql-${ POSTGRESQL_VERSION} .tar.gz" \
140
+ && tar xzf "postgresql-${ POSTGRESQL_VERSION} .tar.gz" \
141
+ && cd "postgresql-${ POSTGRESQL_VERSION} " \
137
142
&& env CC=musl-gcc CPPFLAGS=-I/usr/local/musl/include LDFLAGS=-L/usr/local/musl/lib ./configure --with-openssl --without-readline --prefix=/usr/local/musl \
138
143
&& cd src/interfaces/libpq \
139
144
&& make all-static-lib \
@@ -162,13 +167,21 @@ ENV X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR=/usr/local/musl/ \
162
167
# A Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android
163
168
164
169
RUN set -eux \
165
- && echo "Building osxcross..." \
166
- && cd /usr/local/ \
167
- && git clone --depth 1 https://github.com/tpoechtrager/osxcross \
168
- && cd osxcross \
169
- && curl -L -o "./tarballs/MacOSX$MACOSX_SDK_VERSION.sdk.tar.xz" \
170
- "https://s3.amazonaws.com/andrew-osx-sdks/MacOSX$MACOSX_SDK_VERSION.sdk.tar.xz" \
171
- && env UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh \
170
+ && echo "Cloning osxcross..." \
171
+ && git clone https://github.com/tpoechtrager/osxcross.git /usr/local/osxcross \
172
+ && cd /usr/local/osxcross \
173
+ && git checkout -q "${OSX_CROSS_COMMIT}" \
174
+ && rm -rf ./.git \
175
+ && true
176
+
177
+ RUN set -eux \
178
+ && echo "Building osxcross with ${OSX_SDK_VERSION}..." \
179
+ && cd /usr/local/osxcross \
180
+ && curl -Lo "./tarballs/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" \
181
+ "https://github.com/joseluisq/macosx-sdks/releases/download/${OSX_SDK_VERSION}/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" \
182
+ && echo "${OSX_SDK_SUM} ./tarballs/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" \
183
+ | sha256sum -c - \
184
+ && env UNATTENDED=yes OSX_VERSION_MIN=${OSX_VERSION_MIN} ./build.sh \
172
185
&& rm -rf *~ taballs *.tar.xz \
173
186
&& rm -rf /tmp/* \
174
187
&& true
0 commit comments