Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions Dockerfile-linux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:jammy
FROM ubuntu:noble

ARG zlib_version
ARG zlib_hash
Expand Down Expand Up @@ -43,8 +43,8 @@ RUN \
tar -zxvf "zlib-$zlib_version.tar.gz"

RUN \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
gpg --keyring /openssl.gpg --verify "openssl-$openssl_version.tar.gz.asc" "openssl-$openssl_version.tar.gz" && \
echo "$openssl_hash openssl-$openssl_version.tar.gz" | shasum -a 256 -c - && \
tar -xvzf "openssl-$openssl_version.tar.gz"
Expand Down Expand Up @@ -76,10 +76,33 @@ RUN \
RUN \
cd "openssl-$openssl_version" && \
./config --prefix="$PWD/root" --libdir=lib \
no-apps \
no-cmp \
no-cms \
no-comp \
no-ct \
no-dgram \
no-docs \
no-dso \
no-ec2m \
no-engine \
no-http \
no-legacy \
no-module \
no-nextprotoneg \
no-ocsp \
no-padlockeng \
no-psk \
no-quic \
no-rfc3779 \
no-shared \
no-srp \
no-srtp \
no-ssl-trace \
no-ui-console && \
no-static-engine \
no-ts \
no-ui-console \
no-uplink && \
make ${jobs:+-j${jobs}} && \
make test && \
make install
Expand Down
31 changes: 27 additions & 4 deletions Dockerfile-linux-arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:jammy
FROM ubuntu:noble

ARG zlib_version
ARG zlib_hash
Expand Down Expand Up @@ -44,8 +44,8 @@ RUN \
tar -zxvf "zlib-$zlib_version.tar.gz"

RUN \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
gpg --keyring /openssl.gpg --verify "openssl-$openssl_version.tar.gz.asc" "openssl-$openssl_version.tar.gz" && \
echo "$openssl_hash openssl-$openssl_version.tar.gz" | shasum -a 256 -c - && \
tar -xvzf "openssl-$openssl_version.tar.gz"
Expand Down Expand Up @@ -79,10 +79,33 @@ RUN \
./Configure --prefix="$PWD/root" \
--cross-compile-prefix=aarch64-linux-gnu- \
linux-aarch64 \
no-apps \
no-cmp \
no-cms \
no-comp \
no-ct \
no-dgram \
no-docs \
no-dso \
no-ec2m \
no-engine \
no-http \
no-legacy \
no-module \
no-nextprotoneg \
no-ocsp \
no-padlockeng \
no-psk \
no-quic \
no-rfc3779 \
no-shared \
no-srp \
no-srtp \
no-ssl-trace \
no-ui-console && \
no-static-engine \
no-ts \
no-ui-console \
no-uplink && \
make ${jobs:+-j${jobs}} && \
make install_sw

Expand Down
31 changes: 27 additions & 4 deletions Dockerfile-mingw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:jammy
FROM ubuntu:noble

ARG zlib_version
ARG zlib_hash
Expand Down Expand Up @@ -43,8 +43,8 @@ RUN \
tar -zxvf "zlib-$zlib_version.tar.gz"

RUN \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://www.openssl.org/source/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz" -o "openssl-$openssl_version.tar.gz" && \
curl --proto '=https' --tlsv1.3 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$openssl_version/openssl-$openssl_version.tar.gz.asc" -o "openssl-$openssl_version.tar.gz.asc" && \
gpg --keyring /openssl.gpg --verify "openssl-$openssl_version.tar.gz.asc" "openssl-$openssl_version.tar.gz" && \
echo "$openssl_hash openssl-$openssl_version.tar.gz" | shasum -a 256 -c - && \
tar -xvzf "openssl-$openssl_version.tar.gz"
Expand Down Expand Up @@ -80,10 +80,33 @@ RUN \
./Configure --prefix="$PWD/root" \
--cross-compile-prefix=i686-w64-mingw32- \
mingw \
no-apps \
no-cmp \
no-cms \
no-comp \
no-ct \
no-dgram \
no-docs \
no-dso \
no-ec2m \
no-engine \
no-http \
no-legacy \
no-module \
no-nextprotoneg \
no-ocsp \
no-padlockeng \
no-psk \
no-quic \
no-rfc3779 \
no-shared \
no-srp \
no-srtp \
no-ssl-trace \
no-ui-console && \
no-static-engine \
no-ts \
no-ui-console \
no-uplink && \
make ${jobs:+-j${jobs}} && \
make install_sw

Expand Down
4 changes: 2 additions & 2 deletions build_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ curl --proto '=https' --tlsv1.2 -fsSL "https://zlib.net/zlib-$ZLIB_VERSION.tar.g
GNUPGHOME="$PWD" gpg --keyring gpg-keys/zlib.gpg --verify "zlib-$ZLIB_VERSION.tar.gz.asc" "zlib-$ZLIB_VERSION.tar.gz"
echo "$ZLIB_HASH zlib-$ZLIB_VERSION.tar.gz" | shasum -a 256 -c -

curl --proto '=https' --tlsv1.2 -fsSL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o "openssl-$OPENSSL_VERSION.tar.gz"
curl --proto '=https' --tlsv1.2 -fsSL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o "openssl-$OPENSSL_VERSION.tar.gz.asc"
curl --proto '=https' --tlsv1.2 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz" -o "openssl-$OPENSSL_VERSION.tar.gz"
curl --proto '=https' --tlsv1.2 -fsSL "https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz.asc" -o "openssl-$OPENSSL_VERSION.tar.gz.asc"
GNUPGHOME="$PWD" gpg --keyring gpg-keys/openssl.gpg --verify "openssl-$OPENSSL_VERSION.tar.gz.asc" "openssl-$OPENSSL_VERSION.tar.gz"
echo "$OPENSSL_HASH openssl-$OPENSSL_VERSION.tar.gz" | shasum -a 256 -c -

Expand Down
123 changes: 75 additions & 48 deletions build_darwin_arm64.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh -eu

echo "running build_darwin_arm64.sh..."
BUILD_CPU=arm64
BUILD_HOST=arm-apple-darwin

echo "running build_darwin_$BUILD_CPU.sh..."

SDK_PATH=$(xcrun --show-sdk-path)
XCODE_LIB="$SDK_PATH/usr/lib/"
Expand All @@ -16,68 +19,92 @@ else
jobs=$(sysctl -n hw.logicalcpu_max)
fi

rm -rf arm64 && mkdir arm64
rm -rf $BUILD_CPU && mkdir $BUILD_CPU

tar -xvzf "zlib-$ZLIB_VERSION.tar.gz" -C arm64
cd "arm64/zlib-$ZLIB_VERSION"
CFLAGS="-target arm64-apple-macos11" LDFLAGS="-target arm64-apple-macos11" ./configure --prefix="$PWD/root"
make ${jobs:+-j${jobs}} && make install
tar -xvzf "zlib-$ZLIB_VERSION.tar.gz" -C $BUILD_CPU
cd "$BUILD_CPU/zlib-$ZLIB_VERSION"
CFLAGS="-target $BUILD_CPU-apple-macos11" LDFLAGS="-target $BUILD_CPU-apple-macos11" ./configure --prefix="$PWD/root"
make ${jobs:+-j${jobs}} && make ${jobs:+-j${jobs}} check && make install
cd ../../

tar -xvzf "openssl-$OPENSSL_VERSION.tar.gz" -C arm64
cd "arm64/openssl-$OPENSSL_VERSION"
tar -xvzf "openssl-$OPENSSL_VERSION.tar.gz" -C $BUILD_CPU
cd "$BUILD_CPU/openssl-$OPENSSL_VERSION"
./Configure --prefix="$PWD/root" \
darwin64-arm64-cc \
no-dso \
no-shared \
no-ssl-trace \
no-ui-console

make ${jobs:+-j${jobs}} && make install
darwin64-$BUILD_CPU-cc \
no-apps \
no-cmp \
no-cms \
no-comp \
no-ct \
no-dgram \
no-docs \
no-dso \
no-ec2m \
no-engine \
no-http \
no-legacy \
no-module \
no-nextprotoneg \
no-ocsp \
no-padlockeng \
no-psk \
no-quic \
no-rfc3779 \
no-shared \
no-srp \
no-srtp \
no-ssl-trace \
no-static-engine \
no-ts \
no-ui-console \
no-uplink
make ${jobs:+-j${jobs}} && make test && make install
cd ../../

#Apple messed up getentropy and clock_gettimesymbols when they added two functions in Sierra:
#they forgot to decorate them with appropriate AVAILABLE_MAC_OS_VERSION checks.
#So we have to explicitly disable them for binaries to work on MacOS 10.11.

tar -zxvf "libevent-$LIBEVENT_VERSION.tar.gz" -C arm64
cd "arm64/libevent-$LIBEVENT_VERSION"
tar -zxvf "libevent-$LIBEVENT_VERSION.tar.gz" -C $BUILD_CPU
cd "$BUILD_CPU/libevent-$LIBEVENT_VERSION"
patch -p0 < ../../patch/libevent/regress.c.patch
patch -p0 < ../../patch/libevent/regress_http.c.patch
./configure \
LDFLAGS="-L$PWD/../openssl-$OPENSSL_VERSION/root/lib --target=arm64-apple-macos11" \
CPPFLAGS="-I$PWD/../openssl-$OPENSSL_VERSION/include --target=arm64-apple-macos11" \
--prefix="$PWD/install" \
--disable-openssl \
--disable-shared \
--enable-static \
--host=arm-apple-darwin \
--disable-clock-gettime \
--with-pic
LDFLAGS="-L$PWD/../openssl-$OPENSSL_VERSION/root/lib --target=$BUILD_CPU-apple-macos11" \
CPPFLAGS="-I$PWD/../openssl-$OPENSSL_VERSION/include --target=$BUILD_CPU-apple-macos11" \
--prefix="$PWD/install" \
--disable-openssl \
--disable-shared \
--enable-static \
--host=$BUILD_HOST \
--disable-clock-gettime \
--with-pic
make ${jobs:+-j${jobs}} && make ${jobs:+-j${jobs}} check && make install
cd ../../

tar -xvzf "tor-$TOR_VERSION.tar.gz" -C arm64
cd "arm64/tor-$TOR_VERSION"
tar -xvzf "tor-$TOR_VERSION.tar.gz" -C $BUILD_CPU
cd "$BUILD_CPU/tor-$TOR_VERSION"
patch -p0 < ../../patch/tor/test_slow.c.patch
./configure \
LDFLAGS="--target=arm64-apple-macos11 -L$XCODE_LIB" \
CPPFLAGS="--target=arm64-apple-macos11 -I$XCODE_INCLUDE" \
--prefix="$PWD/root" \
--enable-static-libevent \
--enable-static-openssl \
--enable-static-zlib \
--with-libevent-dir="$PWD/../libevent-$LIBEVENT_VERSION/install" \
--with-openssl-dir="$PWD/../openssl-$OPENSSL_VERSION/root" \
--with-zlib-dir="$PWD/../zlib-$ZLIB_VERSION/root" \
--disable-asciidoc \
--disable-html-manual \
--disable-lzma \
--disable-manpage \
--disable-zstd \
--disable-module-relay \
--disable-module-dirauth \
--host=arm-apple-darwin \
--disable-tool-name-check \
ac_cv_func_getentropy=no \
ac_cv_func_clock_gettime=no
LDFLAGS="--target=$BUILD_CPU-apple-macos11 -L$XCODE_LIB" \
CPPFLAGS="--target=$BUILD_CPU-apple-macos11 -I$XCODE_INCLUDE" \
--prefix="$PWD/root" \
--enable-static-libevent \
--enable-static-openssl \
--enable-static-zlib \
--with-libevent-dir="$PWD/../libevent-$LIBEVENT_VERSION/install" \
--with-openssl-dir="$PWD/../openssl-$OPENSSL_VERSION/root" \
--with-zlib-dir="$PWD/../zlib-$ZLIB_VERSION/root" \
--disable-asciidoc \
--disable-html-manual \
--disable-lzma \
--disable-manpage \
--disable-zstd \
--disable-module-relay \
--disable-module-dirauth \
--host=$BUILD_HOST \
--disable-tool-name-check \
ac_cv_func_getentropy=no \
ac_cv_func_clock_gettime=no
make ${jobs:+-j${jobs}} && make install
cd ../../
Loading