Skip to content

rampageX/static-curl

 
 

Repository files navigation

Static cURL with HTTP3

Static cURL binary built with HTTP3, brotli, and zstd support.

The script will automatically retrieve the latest version of each component.
Simply execute it to compile the most recent version.

Included components

curl -V

  • Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
  • Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP TrackMemory UnixSockets zstd

Usage

Download the latest release from the Releases page.
Extract the archive and use it.
The binary is built with GitHub Actions.

Release files

  • curl-linux-ARCH-VERSION: binaries for Linux, linked with glibc
  • curl-linux-ARCH-dev-VERSION: binaries, headers and static library archives for Linux, for development
  • curl-linux-ARCH-musl-VERSION: binaries for Linux, linked with musl
  • curl-macOS-ARCH-VERSION: binaries for macOS
  • curl-macOS-ARCH-dev-VERSION: binaries, headers and static library archives for macOS, for development
  • curl-windows-ARCH-VERSION: binaries for Windows
  • curl-windows-ARCH-dev-VERSION: binaries, headers and library archives for Windows, for development

Compile

This script utilizes clang or qbt-musl-cross-make for cross-compilation on Linux, mstorsjo/llvm-mingw for cross-compilation for Windows, providing support for the following architectures:

  • Linux
    • x86_64(glibc and musl)
    • aarch64(glibc and musl)
    • armv7(glibc and musl)
    • i686(musl)
    • riscv64(glibc and musl)
    • s390x(glibc and musl)
    • mips64(glibc and musl)
    • mips64el(glibc and musl)
    • mips(musl)
    • mipsel(glibc and musl)
    • powerpc64le(glibc and musl)
    • powerpc(glibc and musl)
  • macOS
    • x86_64
    • aarch64
  • Windows
    • x86_64
    • aarch64
    • i686
    • armv7

How to compile

Linux

  • To compile locally, install Docker, clone the Git repository, navigate to the repository directory, and then execute the following command:
    sh curl-static-cross.sh
    script will create a container and compile the host architecture cURL only.

  • To compile in docker, run:

    docker run --network host --rm -v $(pwd):/mnt -w /mnt \
        --name "build-curl-$(date +%Y%m%d-%H%M)" \
        -e ARCHES="x86_64 aarch64 armv7 i686 riscv64 s390x mips64 mips64el mips mipsel powerpc64le powerpc" \
        -e TLS_LIB="openssl" \
        -e CURL_VERSION="" \
        -e QUICTLS_VERSION="" \
        -e OPENSSL_VERSION="" \
        -e NGTCP2_VERSION="" \
        -e NGHTTP3_VERSION="" \
        -e NGHTTP2_VERSION="" \
        -e ZLIB_VERSION="" \
        -e LIBUNISTRING_VERSION="" \
        -e LIBIDN2_VERSION="" \
        -e LIBPSL_VERSION="" \
        -e ARES_VERSION="" \
        -e ENABLE_TRURL="true" \
        -e TRURL_VERSION="" \
        debian:latest sh curl-static-cross.sh

macOS

Run the following command to compile:

ARCHES="x86_64 arm64" \
    TLS_LIB=openssl \
    CURL_VERSION="" \
    QUICTLS_VERSION="" \
    OPENSSL_VERSION="" \
    NGTCP2_VERSION="" \
    NGHTTP3_VERSION="" \
    NGHTTP2_VERSION="" \
    LIBIDN2_VERSION="" \
    LIBUNISTRING_VERSION="" \
    ZLIB_VERSION="" \
    BROTLI_VERSION="" \
    ZSTD_VERSION="" \
    LIBSSH2_VERSION="" \
    LIBPSL_VERSION="" \
    ARES_VERSION="" \
    bash curl-static-mac.sh

Windows

  • To compile locally, install Docker, clone the Git repository, navigate to the repository directory, and then execute the following command:
    ARCHES="x86_64 aarch64" sh curl-static-win.sh
    script will create a Linux container and cross-compile cURL via LLVM MinGW toolchain.

  • To compile in docker, run:

    docker run --network host --rm -v $(pwd):/mnt -w /mnt \
        --name "build-curl-$(date +%Y%m%d-%H%M)" \
        -e ARCHES="x86_64 i686 aarch64 armv7" \
        -e TLS_LIB="openssl" \
        -e CURL_VERSION="" \
        -e QUICTLS_VERSION="" \
        -e OPENSSL_VERSION="" \
        -e NGTCP2_VERSION="" \
        -e NGHTTP3_VERSION="" \
        -e NGHTTP2_VERSION="" \
        -e ZLIB_VERSION="" \
        -e LIBUNISTRING_VERSION="" \
        -e LIBIDN2_VERSION="" \
        -e LIBPSL_VERSION="" \
        -e ARES_VERSION="" \
        -e ENABLE_TRURL="true" \
        -e TRURL_VERSION="" \
        mstorsjo/llvm-mingw:latest sh curl-static-win.sh

Environment Variables

Supported Environment Variables list:
For all VERSION variables, leaving them blank will automatically fetch the latest version.

  • ARCHES: The list of architectures to compile. You can set one or multiple architectures from the following options: Compile
  • TLS_LIB: The TLS library. quictls(default) or openssl(requires openssl 3.2.0+, and curl 8.6.0+).
  • CURL_VERSION: The version of cURL. If set to dev, will clone the latest source code from GitHub.
  • QUICTLS_VERSION: The version of quictls.
  • OPENSSL_VERSION: The version of OpenSSL.
  • NGTCP2_VERSION: The version of ngtcp2.
  • NGHTTP3_VERSION: The version of nghttp3.
  • NGHTTP2_VERSION: The version of nghttp2.
  • LIBUNISTRING_VERSION: The version of libunistring.
  • LIBIDN2_VERSION: The version of libidn2.
  • LIBPSL_VERSION: The version of libpsl.
  • LIBSSH2_VERSION: The version of libssh2.
  • ZLIB_VERSION: The version of zlib.
  • BROTLI_VERSION: The version of brotli.
  • ZSTD_VERSION: The version of zstd.
  • ARES_VERSION: The version of c-ares.
  • TRURL_VERSION: The version of trurl.
  • ENABLE_TRURL: Compile trurl. Default is false, set to true or yes to enable it. NOT available for macOS.
  • ENABLE_DEBUG: Enable curl debug. Default is false, set to true or yes to enable it.

The compiled files will be saved in the current release directory.

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%