snippets/bash/Curl + HTTP-3 (Build on the fly)

31 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-10-02 23:47:38 +00:00
#!/bin/bash
THREADS=8
apt update && apt install -y build-essential cmake automake git libtool pkg-config libev-dev
rm -rf /usr/local/tmp && mkdir -p /usr/local/tmp && cd /usr/local/tmp
git clone --depth 1 -b openssl-quic-draft-22 https://github.com/tatsuhiro-t/openssl openssl
cd openssl
./config enable-tls1_3 enable-shared --prefix=/usr/lib/x86_64-linux-gnu
make -j$THREADS && make install_sw || exit 0
cd ..
git clone https://github.com/ngtcp2/nghttp3
cd nghttp3
sed -i 's/PKG_PROG_PKG_CONFIG([0.20])/PKG_PROG_PKG_CONFIG([0.29])/' configure.ac
autoreconf -i
./configure --prefix=/usr/lib/x86_64-linux-gnu --enable-lib-only
make -j$THREADS && make install || exit 0
cd ..
git clone -b draft-25 https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -i
./configure PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/lib/pkgconfig LDFLAGS="-Wl,-rpath,/usr/lib/x86_64-linux-gnu/lib" --prefix=/usr/lib/x86_64-linux-gnu
make -j$THREADS && make install || exit 0
cd ..
git clone https://github.com/curl/curl
cd curl
git checkout curl-7_69_1
./buildconf
LDFLAGS="-Wl,-rpath,/usr/lib/x86_64-linux-gnu/lib" ./configure --with-ssl=/usr/lib/x86_64-linux-gnu --with-nghttp3=/usr/lib/x86_64-linux-gnu --with-ngtcp2=/usr/lib/x86_64-linux-gnu --prefix=/usr/local --libdir=/usr/lib/x86_64-linux-gnu --enable-alt-svc
make -j$THREADS && make install || exit 0
rm -rf /usr/local/tmp
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu /usr/local/bin/curl -V