[source]
git = "https://gitlab.redox-os.org/redox-os/curl.git"
branch = "redox-8.6"
upstream = "https://github.com/curl/curl.git"

[build]
template = "custom"
dependencies = [
    #TODO: git fails to build when this is a dependency: "libpsl",
    "nghttp2",
    "openssl1",
    "zlib"
]
script = """
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false"
autoreconf -i
COOKBOOK_CONFIGURE="./configure"
COOKBOOK_CONFIGURE_FLAGS=(
    --build="$(cc -dumpmachine)"
    --host="${TARGET}"
    --prefix=""
    --disable-ftp
    --disable-ipv6
    --disable-ntlm-wb
    --disable-shared
    --disable-tftp
    --disable-threaded-resolver
    --enable-static
    --with-ca-path=/ssl/certs
    --with-nghttp2="${COOKBOOK_SYSROOT}"
    --with-ssl="${COOKBOOK_SYSROOT}"
    --with-zlib="${COOKBOOK_SYSROOT}"
    --without-libpsl
)
cookbook_configure
"""

[package]
dependencies = [
    "ca-certificates"
]
