diff --git a/mingw-w64-cargo-component/PKGBUILD b/mingw-w64-cargo-component/PKGBUILD new file mode 100644 index 0000000000000..8ed1b91270d9f --- /dev/null +++ b/mingw-w64-cargo-component/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Konstantin Podsvirov + +_realname=cargo-component +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=0.19.0 +pkgrel=1 +pkgdesc='A Cargo subcommand for creating WebAssembly components (mingw-w64)' +arch=('any') +mingw_arch=('ucrt64' 'clang64' 'clangarm64') +url='https://github.com/bytecodealliance/cargo-component' +license=('spdx:Apache-2.0') +depends=("${MINGW_PACKAGE_PREFIX}-rust-wasm") +makedepends=("${MINGW_PACKAGE_PREFIX}-rust") +source=("${url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz") +sha256sums=('2081c277d3d9ef5392292ecf198f97cd218962452786d9a192bb8e314d35474a') + +prepare() { + cd "${_realname}-${pkgver}" + + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + cd "${_realname}-${pkgver}" + + cargo build --release --frozen +} + +check() { + cd "${_realname}-${pkgver}" + + cargo test --release --frozen +} + +package() { + cd "${_realname}-${pkgver}" + + cargo install \ + --offline \ + --no-track \ + --frozen \ + --path . \ + --root "${pkgdir}${MINGW_PREFIX}" + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +}