diff --git a/mingw-w64-libhdr10plus-rs/PKGBUILD b/mingw-w64-libhdr10plus-rs/PKGBUILD new file mode 100644 index 0000000000000..121f0f989f20b --- /dev/null +++ b/mingw-w64-libhdr10plus-rs/PKGBUILD @@ -0,0 +1,59 @@ +_realname=libhdr10plus +_sourcename=hdr10plus_tool +pkgbase=mingw-w64-${_realname} +pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}-rs +pkgver=2.1.2 +pkgrel=1 +pkgdesc='Library to read and write HDR10+ metadata (C-API)' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://github.com/quietvoid/hdr10plus_tool/tree/main/hdr10plus' +license=('spdx:MIT') +msys2_references=( + 'archlinux: libhdr10plus-rs' + 'purl: pkg:cargo/hdr10plus' +) +makedepends=("${MINGW_PACKAGE_PREFIX}-rust" + "${MINGW_PACKAGE_PREFIX}-cargo-c") +source=("https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${_realname}-${pkgver}.tar.gz") +sha256sums=('c46908d70caa77053804a2e88a2b0e158e6bf67e10bb21b30d585ad8fb27cf6b') + +prepare() { + cd "${srcdir}/${_sourcename}-${_realname}-${pkgver}/hdr10plus" + + cargo fetch +} + +build() { + cd "${srcdir}/${_sourcename}-${_realname}-${pkgver}/hdr10plus" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + cargo cbuild \ + --release \ + --frozen \ + --all-features \ + --prefix="${MINGW_PREFIX}" +} + +check() { + cd "${srcdir}/${_sourcename}-${_realname}-${pkgver}/hdr10plus" + + cargo test \ + --release \ + --frozen \ + --all-features +} + +package() { + cd "${srcdir}/${_sourcename}-${_realname}-${pkgver}/hdr10plus" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + cargo cinstall \ + --release \ + --frozen \ + --all-features \ + --prefix="${MINGW_PREFIX}" \ + --destdir="${pkgdir}" + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-rs/LICENSE" +}