2021-06-07 22:14:25 +02:00
#!/bin/bash
2021-06-17 21:14:38 +02:00
# _ _ ____ _
# ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
2021-06-08 01:03:15 +02:00
2021-06-07 22:14:25 +02:00
set -e
2021-06-20 16:22:12 +02:00
trap 'read -p "Press any key..." x' EXIT
2021-06-07 22:14:25 +02:00
2021-06-13 20:11:58 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Set up compiler
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-13 16:15:09 +02:00
case " $( cc -dumpmachine) " in
i686-*)
2021-06-13 17:44:41 +02:00
readonly MY_CPU = x86
2021-06-18 01:48:56 +02:00
readonly MY_MARCH = i486
2021-06-13 16:15:09 +02:00
readonly MY_MTUNE = intel
; ;
x86_64-*)
2021-06-13 17:44:41 +02:00
readonly MY_CPU = x64
2021-06-13 16:15:09 +02:00
readonly MY_MARCH = x86-64
2022-06-28 22:49:30 +02:00
readonly MY_MTUNE = znver3
2021-06-13 16:15:09 +02:00
; ;
*)
echo "Unknown compiler detected!" ;
exit 1
; ;
esac
2021-06-07 22:14:25 +02:00
2021-06-13 20:11:58 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initialize paths
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-07 22:14:25 +02:00
readonly BASE_DIR = " $( dirname " $( readlink -f " ${ BASH_SOURCE [0] } " ) " ) "
2021-06-15 23:54:05 +02:00
readonly LIBS_DIR = " ${ BASE_DIR } /.local/ ${ MY_CPU } "
2021-06-13 17:44:41 +02:00
find " ${ BASE_DIR } " -maxdepth 1 -type d -name " *- ${ MY_CPU } " -exec rm -rf "{}" \;
2021-06-17 21:13:50 +02:00
rm -rf " ${ LIBS_DIR } " && mkdir -p " ${ LIBS_DIR } /.pkg " " ${ LIBS_DIR } /bin " " ${ LIBS_DIR } /include " " ${ LIBS_DIR } /lib/pkgconfig " " ${ LIBS_DIR } /share "
2021-06-07 22:14:25 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-06-21 20:05:41 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/zlib.tar.gz " https://zlib.net/zlib-1.2.12.tar.gz
2022-06-21 22:32:10 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/zstd.tar.gz " https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz
2021-06-17 21:13:50 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/brotli.tar.gz " https://github.com/google/brotli/archive/v1.0.9/brotli-1.0.9.tar.gz
2022-07-10 18:44:36 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/openssl.tar.gz " https://github.com/quictls/openssl/archive/refs/heads/OpenSSL_1_1_1q+quic.tar.gz
2021-06-17 21:13:50 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/rtmpdump.tar.gz " http://git.ffmpeg.org/gitweb/rtmpdump.git/snapshot/f1b83c10d8beb43fcc70a6e88cf4325499f25857.tar.gz
2021-06-18 00:09:42 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/libiconv.tar.gz " https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
wget -4 -O " ${ LIBS_DIR } /.pkg/gettext.tar.gz " https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz
2022-06-21 22:32:10 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/libssh2.tar.gz " https://www.libssh2.org/download/libssh2-1.10.0.tar.gz
2022-06-30 21:13:25 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/nghttp2.tar.gz " https://github.com/nghttp2/nghttp2/releases/download/v1.48.0/nghttp2-1.48.0.tar.gz
2022-06-22 20:00:20 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/nghttp3.tar.gz " https://github.com/ngtcp2/nghttp3/releases/download/v0.5.0/nghttp3-0.5.0.tar.gz
wget -4 -O " ${ LIBS_DIR } /.pkg/ngtcp2.tar.gz " https://github.com/ngtcp2/ngtcp2/releases/download/v0.6.0/ngtcp2-0.6.0.tar.gz
2022-06-21 22:46:27 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/libidn2.tar.gz " https://ftp.gnu.org/gnu/libidn/libidn2-2.3.2.tar.gz
2021-06-17 21:13:50 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/libgsasl.tar.gz " https://ftp.gnu.org/gnu/gsasl/libgsasl-1.10.0.tar.gz
2022-06-27 23:54:21 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/curl.tar.gz " https://curl.se/download/curl-7.84.0.tar.gz
2021-06-17 21:13:50 +02:00
wget -4 -O " ${ LIBS_DIR } /.pkg/cacert.pem " https://curl.se/ca/cacert.pem
wget -4 -O " ${ LIBS_DIR } /.pkg/manpage.html " https://curl.se/docs/manpage.html
2021-06-07 22:14:25 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# zlib
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== zlib ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly ZLIB_DIR = " ${ BASE_DIR } /zlib- ${ MY_CPU } "
2021-06-07 22:14:25 +02:00
rm -rf " ${ ZLIB_DIR } " && mkdir " ${ ZLIB_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/zlib.tar.gz " --strip-components= 1 -C " ${ ZLIB_DIR } "
2021-06-07 22:14:25 +02:00
pushd " ${ ZLIB_DIR } "
2022-06-22 23:20:16 +02:00
make -f win32/Makefile.gcc LOC = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 "
2021-06-15 23:54:05 +02:00
make -f win32/Makefile.gcc install BINARY_PATH = " ${ LIBS_DIR } /include " INCLUDE_PATH = " ${ LIBS_DIR } /include " LIBRARY_PATH = " ${ LIBS_DIR } /lib "
2021-06-07 22:14:25 +02:00
popd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Zstandard
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== Zstandard ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly ZSTD_DIR = " ${ BASE_DIR } /zstd- ${ MY_CPU } "
2021-06-07 22:14:25 +02:00
rm -rf " ${ ZSTD_DIR } " && mkdir " ${ ZSTD_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/zstd.tar.gz " --strip-components= 1 -C " ${ ZSTD_DIR } "
2021-06-07 22:14:25 +02:00
pushd " ${ ZSTD_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " make lib
2021-06-08 16:36:12 +02:00
cp -vf lib/libzstd.a " ${ LIBS_DIR } /lib "
2021-06-15 23:54:05 +02:00
cp -vf lib/zstd.h lib/zstd_errors.h lib/zdict.h " ${ LIBS_DIR } /include "
2021-06-16 21:16:50 +02:00
sed -e " s|@PREFIX@| ${ LIBS_DIR } |g " -e 's|@EXEC_PREFIX@|${prefix}|g' -e 's|@INCLUDEDIR@|${prefix}/include|g' -e 's|@LIBDIR@|${prefix}/lib|g' -e 's|@VERSION@|1.5.0|g' lib/libzstd.pc.in > " ${ LIBS_DIR } /lib/pkgconfig/libzstd.pc "
2021-06-07 22:14:25 +02:00
popd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Brotli
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== Brotli ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly BROT_DIR = " ${ BASE_DIR } /brotli- ${ MY_CPU } "
2021-06-07 22:14:25 +02:00
rm -rf " ${ BROT_DIR } " && mkdir " ${ BROT_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/brotli.tar.gz " --strip-components= 1 -C " ${ BROT_DIR } "
2021-06-07 22:14:25 +02:00
pushd " ${ BROT_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " make lib
2021-06-08 16:36:12 +02:00
mkdir -p " ${ LIBS_DIR } /include/brotli "
cp -vf c/include/brotli/*.h " ${ LIBS_DIR } /include/brotli "
2021-06-16 21:16:50 +02:00
for fname in scripts/*.pc.in; do
2021-06-17 00:43:11 +02:00
cp -vf libbrotli.a " ${ LIBS_DIR } /lib/ $( basename " ${ fname } " .pc.in) .a "
2021-06-16 21:16:50 +02:00
sed -e " s|@prefix@| ${ LIBS_DIR } |g " -e 's|@exec_prefix@|${prefix}|g' -e 's|@includedir@|${prefix}/include|g' -e 's|@libdir@|${prefix}/lib|g' -e 's|@PACKAGE_VERSION@|1.0.9|g' ${ fname } > " ${ LIBS_DIR } /lib/pkgconfig/ $( basename " ${ fname } " .in) "
done
2021-06-07 22:14:25 +02:00
popd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# OpenSSL
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== OpenSSL ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly OSSL_DIR = " ${ BASE_DIR } /openssl- ${ MY_CPU } "
2021-06-07 22:14:25 +02:00
rm -rf " ${ OSSL_DIR } " && mkdir " ${ OSSL_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/openssl.tar.gz " --strip-components= 1 -C " ${ OSSL_DIR } "
2021-06-13 17:44:41 +02:00
[ [ " ${ MY_CPU } " = = "x64" ] ] && readonly ossl_flag = "no-sse2" || readonly ossl_flag = "386"
[ [ " ${ MY_CPU } " = = "x64" ] ] && readonly ossl_mngw = "mingw64" || readonly ossl_mngw = "mingw"
2021-06-07 22:14:25 +02:00
pushd " ${ OSSL_DIR } "
2022-06-22 23:20:16 +02:00
./Configure no-hw no-shared no-engine no-capieng no-dso zlib ${ ossl_flag } -static -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT= 0x0501 -I" ${ LIBS_DIR } /include " -L" ${ LIBS_DIR } /lib " --prefix= " ${ LIBS_DIR } " ${ ossl_mngw }
2021-06-16 21:16:50 +02:00
make build_libs && make install_dev
2021-06-07 22:14:25 +02:00
popd
2021-06-17 21:13:50 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# librtmp
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== librtmp ====================\n\n"
readonly RTMP_DIR = " ${ BASE_DIR } /librtmp- ${ MY_CPU } "
rm -rf " ${ RTMP_DIR } " && mkdir " ${ RTMP_DIR } "
tar -xvf " ${ LIBS_DIR } /.pkg/rtmpdump.tar.gz " --strip-components= 1 -C " ${ RTMP_DIR } "
pushd " ${ RTMP_DIR } "
patch -p1 -b < " ${ BASE_DIR } /patch/librtmp_openssl.diff "
2022-06-22 23:20:16 +02:00
make SYS = mingw SHARED = prefix = " ${ LIBS_DIR } " XCFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " XLDFLAGS = " -L ${ LIBS_DIR } /lib " XLIBS = "-lws2_32"
2021-06-17 21:13:50 +02:00
make SYS = mingw SHARED = prefix = " ${ LIBS_DIR } " install
popd
2021-06-18 00:09:42 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# libiconv
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== libiconv ====================\n\n"
readonly ICNV_DIR = " ${ BASE_DIR } /libiconv- ${ MY_CPU } "
rm -rf " ${ ICNV_DIR } " && mkdir " ${ ICNV_DIR } "
tar -xvf " ${ LIBS_DIR } /.pkg/libiconv.tar.gz " --strip-components= 1 -C " ${ ICNV_DIR } "
pushd " ${ ICNV_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " ./configure --prefix= " ${ LIBS_DIR } " --disable-rpath --disable-shared
2021-06-18 00:09:42 +02:00
make && make install
popd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# gettext
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== gettext ====================\n\n"
readonly GTXT_DIR = " ${ BASE_DIR } /gettext- ${ MY_CPU } "
rm -rf " ${ GTXT_DIR } " && mkdir " ${ GTXT_DIR } "
tar -xvf " ${ LIBS_DIR } /.pkg/gettext.tar.gz " --strip-components= 1 -C " ${ GTXT_DIR } "
pushd " ${ GTXT_DIR } /gettext-runtime "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " ./configure --prefix= " ${ LIBS_DIR } " --disable-shared --disable-libasprintf --without-emacs --disable-java --disable-native-java --disable-csharp --disable-openmp
2021-06-18 00:09:42 +02:00
make && make install
popd
2021-06-08 18:47:03 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# libssh2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== libssh2 ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly SSH2_DIR = " ${ BASE_DIR } /libssh2- ${ MY_CPU } "
2021-06-08 18:47:03 +02:00
rm -rf " ${ SSH2_DIR } " && mkdir " ${ SSH2_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/libssh2.tar.gz " --strip-components= 1 -C " ${ SSH2_DIR } "
2021-06-08 18:47:03 +02:00
pushd " ${ SSH2_DIR } "
2021-06-13 21:58:25 +02:00
patch -p1 -b < " ${ BASE_DIR } /patch/ssh2_session.diff "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " ./configure --prefix= " ${ LIBS_DIR } " --disable-examples-build --disable-shared --with-libz
2021-06-16 21:16:50 +02:00
make && make install
2021-06-08 18:47:03 +02:00
popd
2021-06-08 02:51:43 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# nghttp2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== nghttp2 ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly NGH2_DIR = " ${ BASE_DIR } /nghttp2- ${ MY_CPU } "
2021-06-08 02:51:43 +02:00
rm -rf " ${ NGH2_DIR } " && mkdir " ${ NGH2_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/nghttp2.tar.gz " --strip-components= 1 -C " ${ NGH2_DIR } "
2021-06-08 03:00:49 +02:00
pushd " ${ NGH2_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " OPENSSL_CFLAGS = " -I ${ LIBS_DIR } /include " OPENSSL_LIBS = " -L ${ LIBS_DIR } /lib -lssl -lcrypto " ZLIB_CFLAGS = " -I ${ LIBS_DIR } /include " ZLIB_LIBS = " -L ${ LIBS_DIR } /lib -lz " ./configure --prefix= " ${ LIBS_DIR } " --enable-lib-only --disable-threads --disable-shared
2021-06-16 21:16:50 +02:00
make && make install
2021-06-08 17:35:58 +02:00
popd
2022-06-22 20:00:20 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# nghttp3
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== nghttp3 ====================\n\n"
readonly NGH3_DIR = " ${ BASE_DIR } /nghttp3- ${ MY_CPU } "
rm -rf " ${ NGH3_DIR } " && mkdir " ${ NGH3_DIR } "
tar -xvf " ${ LIBS_DIR } /.pkg/nghttp3.tar.gz " --strip-components= 1 -C " ${ NGH3_DIR } "
pushd " ${ NGH3_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " OPENSSL_CFLAGS = " -I ${ LIBS_DIR } /include " OPENSSL_LIBS = " -L ${ LIBS_DIR } /lib -lssl -lcrypto " ZLIB_CFLAGS = " -I ${ LIBS_DIR } /include " ZLIB_LIBS = " -L ${ LIBS_DIR } /lib -lz " ./configure --prefix= " ${ LIBS_DIR } " --enable-lib-only --disable-threads --disable-shared
2022-06-22 20:00:20 +02:00
make && make install
popd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ngtcp2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== ngtcp2 ====================\n\n"
readonly TCP2_DIR = " ${ BASE_DIR } /ngtcp2- ${ MY_CPU } "
rm -rf " ${ TCP2_DIR } " && mkdir " ${ TCP2_DIR } "
tar -xvf " ${ LIBS_DIR } /.pkg/ngtcp2.tar.gz " --strip-components= 1 -C " ${ TCP2_DIR } "
pushd " ${ TCP2_DIR } "
2022-07-10 19:43:13 +02:00
patch -p1 -b < " ${ BASE_DIR } /patch/ngtcp2_htons.diff "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " OPENSSL_CFLAGS = " -I ${ LIBS_DIR } /include " OPENSSL_LIBS = " -L ${ LIBS_DIR } /lib -lssl -lcrypto -lws2_32 -lz " ZLIB_CFLAGS = " -I ${ LIBS_DIR } /include " ZLIB_LIBS = " -L ${ LIBS_DIR } /lib -lz " ./configure --prefix= " ${ LIBS_DIR } " --enable-lib-only --with-openssl --disable-shared
2022-06-22 20:00:20 +02:00
make && make install
popd
2021-06-08 16:36:12 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# libidn2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== libidn2 ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly IDN2_DIR = " ${ BASE_DIR } /libidn2- ${ MY_CPU } "
2021-06-08 16:36:12 +02:00
rm -rf " ${ IDN2_DIR } " && mkdir " ${ IDN2_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/libidn2.tar.gz " --strip-components= 1 -C " ${ IDN2_DIR } "
2021-06-08 16:36:12 +02:00
pushd " ${ IDN2_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " ./configure --prefix= " ${ LIBS_DIR } " --disable-shared --disable-doc --without-libiconv-prefix --without-libunistring-prefix --disable-valgrind-tests
2021-06-16 21:16:50 +02:00
make && make install
2021-06-08 02:51:43 +02:00
popd
2021-06-09 21:32:35 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# libgsasl
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== libgsasl ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly SASL_DIR = " ${ BASE_DIR } /libgsasl- ${ MY_CPU } "
2021-06-09 21:32:35 +02:00
rm -rf " ${ SASL_DIR } " && mkdir " ${ SASL_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/libgsasl.tar.gz " --strip-components= 1 -C " ${ SASL_DIR } "
2021-06-09 21:32:35 +02:00
pushd " ${ SASL_DIR } "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -DNDEBUG -D_WIN32_WINNT=0x0501 -I ${ LIBS_DIR } /include " LDFLAGS = " -L ${ LIBS_DIR } /lib " ./configure --prefix= " ${ LIBS_DIR } " --disable-shared --disable-valgrind-tests --disable-obsolete -without-libintl-prefix
2021-06-16 21:16:50 +02:00
make && make install
2021-06-09 21:32:35 +02:00
popd
2021-06-07 22:14:25 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# cURL
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== cURL ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly CURL_DIR = " ${ BASE_DIR } /curl- ${ MY_CPU } "
2021-06-07 22:14:25 +02:00
rm -rf " ${ CURL_DIR } " && mkdir " ${ CURL_DIR } "
2021-06-17 21:13:50 +02:00
tar -xvf " ${ LIBS_DIR } /.pkg/curl.tar.gz " --strip-components= 1 -C " ${ CURL_DIR } "
2021-06-07 22:14:25 +02:00
pushd " ${ CURL_DIR } "
2022-06-21 20:05:41 +02:00
sed -i -E 's/\bmain[[:space:]]*\(([^\(\)]*)\)/wmain(\1)/g' configure
2021-06-20 14:44:55 +02:00
patch -p1 -b < " ${ BASE_DIR } /patch/curl_getenv.diff "
2021-06-09 19:47:18 +02:00
patch -p1 -b < " ${ BASE_DIR } /patch/curl_threads.diff "
patch -p1 -b < " ${ BASE_DIR } /patch/curl_tool_doswin.diff "
patch -p1 -b < " ${ BASE_DIR } /patch/curl_tool_parsecfg.diff "
2022-06-22 23:20:16 +02:00
CFLAGS = " -march= ${ MY_MARCH } -mtune= ${ MY_MTUNE } -I ${ LIBS_DIR } /include " CPPFLAGS = "-DNDEBUG -D_WIN32_WINNT=0x0501 -DNGHTTP2_STATICLIB -DNGHTTP3_STATICLIB -DNGTCP2_STATICLIB -DUNICODE -D_UNICODE" LDFLAGS = " -municode -mconsole -Wl,--trace -static -no-pthread -L ${ LIBS_DIR } /lib " LIBS = "-liconv -lcrypt32 -lwinmm" PKG_CONFIG_PATH = " ${ LIBS_DIR } /lib/pkgconfig " ./configure --enable-static --disable-shared --disable-pthreads --disable-libcurl-option --disable-openssl-auto-load-config --with-zlib --with-zstd --with-brotli --with-openssl --with-librtmp --with-libssh2 --with-nghttp2= " ${ LIBS_DIR } " --with-ngtcp2= " ${ LIBS_DIR } " --with-nghttp3= " ${ LIBS_DIR } " --with-libidn2 --with-gsasl --without-ca-bundle
2022-06-22 20:00:20 +02:00
make V = 1
2021-06-08 21:19:35 +02:00
strip -s src/curl.exe
2021-06-07 22:14:25 +02:00
popd
2021-06-08 21:19:35 +02:00
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Output
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf "\n==================== Output ====================\n\n"
2021-06-13 17:44:41 +02:00
readonly OUT_DIR = " ${ BASE_DIR } /.bin/ ${ MY_CPU } "
2021-06-13 16:24:31 +02:00
rm -rf " ${ OUT_DIR } " && mkdir -p " ${ OUT_DIR } "
2021-06-08 22:24:45 +02:00
pushd " ${ OUT_DIR } "
2021-06-17 21:13:50 +02:00
cp -vf " ${ CURL_DIR } /src/curl.exe " curl.exe
cp -vf " ${ LIBS_DIR } /.pkg/cacert.pem " curl-ca-bundle.crt
cp -vf " ${ LIBS_DIR } /.pkg/manpage.html " manpage.html
2021-06-10 00:01:32 +02:00
sed -n " /Configured to build curl\/libcurl: $/,/^[[:space:]]*Features:/p " " ${ CURL_DIR } /config.log " | sed -r "s/configure:[[:digit:]]+://" | sed -r "s/^[[:blank:]]*//" | unix2dos > config.log
2021-06-08 21:19:35 +02:00
mkdir -p " ${ OUT_DIR } /legal "
2021-06-08 22:24:45 +02:00
unix2dos -n " ${ BROT_DIR } /LICENSE " legal/brotli.LICENSE.txt
unix2dos -n " ${ BROT_DIR } /README.md " legal/brotli.README.md
2021-06-09 23:12:30 +02:00
unix2dos -n " ${ CURL_DIR } /CHANGES " legal/curl.CHANGES.txt
unix2dos -n " ${ CURL_DIR } /COPYING " legal/curl.COPYING.txt
unix2dos -n " ${ CURL_DIR } /README " legal/curl.README.txt
2021-06-18 16:45:24 +02:00
unix2dos -n " ${ GTXT_DIR } /AUTHORS " legal/gettext.AUTHORS.txt
unix2dos -n " ${ GTXT_DIR } /COPYING " legal/gettext.COPYING.txt
unix2dos -n " ${ GTXT_DIR } /README " legal/gettext.README.txt
2021-06-08 22:24:45 +02:00
unix2dos -n " ${ ICNV_DIR } /AUTHORS " legal/libiconv.AUTHORS.txt
unix2dos -n " ${ ICNV_DIR } /COPYING " legal/libiconv.COPYING.txt
unix2dos -n " ${ ICNV_DIR } /README " legal/libiconv.README
unix2dos -n " ${ IDN2_DIR } /AUTHORS " legal/libidn2.AUTHORS.txt
unix2dos -n " ${ IDN2_DIR } /COPYING " legal/libidn2.COPYING.txt
unix2dos -n " ${ IDN2_DIR } /README.md " legal/libidn2.README.md
unix2dos -n " ${ NGH2_DIR } /AUTHORS " legal/nghttp2.AUTHORS.txt
unix2dos -n " ${ NGH2_DIR } /COPYING " legal/nghttp2.COPYING.txt
unix2dos -n " ${ NGH2_DIR } /README.rst " legal/nghttp2.README.rst
2022-06-22 21:39:57 +02:00
unix2dos -n " ${ NGH3_DIR } /COPYING " legal/nghttp3.COPYING.txt
unix2dos -n " ${ NGH3_DIR } /README.rst " legal/nghttp3.README.rst
unix2dos -n " ${ TCP2_DIR } /COPYING " legal/ngtcp2.COPYING.txt
unix2dos -n " ${ TCP2_DIR } /README.rst " legal/ngtcp2.README.rst
2021-06-08 22:24:45 +02:00
unix2dos -n " ${ OSSL_DIR } /AUTHORS " legal/openssl.AUTHORS.txt
unix2dos -n " ${ OSSL_DIR } /LICENSE " legal/openssl.LICENSE.txt
2022-06-22 22:18:37 +02:00
unix2dos -n " ${ OSSL_DIR } /README.md " legal/openssl.README.md
2021-06-18 16:45:24 +02:00
unix2dos -n " ${ RTMP_DIR } /COPYING " legal/librtmp.COPYING.txt
unix2dos -n " ${ RTMP_DIR } /README " legal/librtmp.README.txt
2021-06-09 23:12:30 +02:00
unix2dos -n " ${ SASL_DIR } /AUTHORS " legal/libgsasl.AUTHORS.txt
unix2dos -n " ${ SASL_DIR } /COPYING " legal/libgsasl.COPYING.txt
unix2dos -n " ${ SASL_DIR } /README " legal/libgsasl.README.txt
2021-06-08 22:24:45 +02:00
unix2dos -n " ${ SSH2_DIR } /COPYING " legal/libssh2.COPYING.txt
unix2dos -n " ${ SSH2_DIR } /README " legal/libssh2.README.txt
unix2dos -n " ${ ZLIB_DIR } /README " legal/zlib.README.txt
unix2dos -n " ${ ZSTD_DIR } /LICENSE " legal/zstandard.LICENSE.txt
unix2dos -n " ${ ZSTD_DIR } /README.md " legal/zstandard.README.md
2021-06-09 23:12:30 +02:00
mkdir -p " ${ OUT_DIR } /patch "
2021-06-13 21:19:14 +02:00
cp -vf " ${ BASE_DIR } /patch/ " *.diff " ${ OUT_DIR } /patch "
2021-06-08 21:19:35 +02:00
find " ${ OUT_DIR } " -type f -exec chmod 444 "{}" \;
2021-06-13 20:14:23 +02:00
readonly zfile = " ${ BASE_DIR } /curl-windows- ${ MY_CPU } . $( date +"%Y-%m-%d" ) .zip "
2021-06-08 22:24:45 +02:00
rm -rf " ${ zfile } " && zip -v -r -9 " ${ zfile } " "."
chmod 444 " ${ zfile } "
popd
2021-06-08 21:19:35 +02:00
2021-06-07 22:14:25 +02:00
printf "\nCompleted.\n\n"