pkgname=wcurl
pkgver=2024.12.08
pkgrel=1
pkgdesc='Simple wrapper around curl to easily download files'
arch=(any)
url='https://curl.se/wcurl'
msys2_repository_url='https://github.com/curl/wcurl'
license=(spdx:curl)
depends=(bash curl)
source=("wcurl-${pkgver}.tar.gz::https://github.com/curl/wcurl/archive/refs/tags/v${pkgver}.tar.gz"
        "0001-force-cygwin-curl.patch")
sha256sums=('9c0615b2c5d6b21da79ff559e75452197330d18449085a18e05f4b623b144a94'
            '5a520b3afc7a1a86398b41dc969c9b0ecaef692d3b195643845d26257f68e96f')

prepare() {
    cd "wcurl-${pkgver}"
    patch -Np1 -i ../0001-force-cygwin-curl.patch
}

package() {
    cd "wcurl-${pkgver}"
    install -Dm755 wcurl "$pkgdir/usr/bin/wcurl"
    install -Dm644 wcurl.1 "$pkgdir/usr/share/man/man1/wcurl.1"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
