pkgname=wcurl
pkgver=2025.04.20
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=('c40ccf365febca9115611db271b2d6705728fc7efb297df3f2eba70d3a97fa03'
            '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"
}
