diff options
author | kfg | 2024-03-28 14:38:41 +0100 |
---|---|---|
committer | kfg | 2024-03-28 14:38:41 +0100 |
commit | 8d53a9e06a5781878a7f9d43ab9b42026dc2a0b6 (patch) | |
tree | 6499ee86ddaa700df20e62e49f192275033c46f3 | |
download | aur-8d53a9e06a5781878a7f9d43ab9b42026dc2a0b6.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 141 |
2 files changed, 160 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f42dc7a9b2dd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = mingw-w64-libdovi + pkgdesc = Library to read and write Dolby Vision metadata (mingw-w64) + pkgver = 3.3.0 + pkgrel = 1 + url = https://github.com/quietvoid/dovi_tool/tree/main/dolby_vision + arch = i686 + arch = x86_64 + license = MIT + makedepends = cargo-c + makedepends = git + makedepends = mingw-w64-rust + depends = mingw-w64-crt + options = !strip + options = !buildflags + options = staticlibs + source = git+https://github.com/quietvoid/dovi_tool.git#tag=108f7892fa9c5c5b24caec29f2289cf805e52119 + b2sums = SKIP + +pkgname = mingw-w64-libdovi diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3a49b5c97155 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,141 @@ +# Maintainer: Karl-Felix Glatzer <karl[dot]glatzer[at]gmx[dot]de> +# Contributor: Maxime Gauduin <alucryd@archlinux>org> +# Contributor: quietvoid <tcChlisop0@gmail.com> + +pkgname=mingw-w64-libdovi +pkgver=3.3.0 +pkgrel=1 +pkgdesc='Library to read and write Dolby Vision metadata (mingw-w64)' +arch=('i686' 'x86_64') +url=https://github.com/quietvoid/dovi_tool/tree/main/dolby_vision +license=(MIT) +depends=( + mingw-w64-crt +) +options=(!strip !buildflags staticlibs) +makedepends=( + cargo-c + git + mingw-w64-rust +) +_tag=108f7892fa9c5c5b24caec29f2289cf805e52119 +source=(git+https://github.com/quietvoid/dovi_tool.git#tag=${_tag}) +b2sums=(SKIP) +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +prepare() { + if [[ -d "${RUST_PATH}" ]] ; then + export PATH="${RUST_PATH}:${PATH}" + else + export PATH="/opt/rust/bin:${PATH}" + fi + if [[ ! -d "${CARGO_HOME}" ]] ; then + export CARGO_HOME="/opt/rust/cargo" + fi + + cargo fetch \ + --manifest-path dovi_tool/dolby_vision/Cargo.toml +} + +#pkgver() { +# cd dovi_tool +# git describe --tags | sed 's/^libdovi-//' +#} + +build() { + if [[ -d "${RUST_PATH}" ]] ; then + export PATH="${RUST_PATH}:${PATH}" + else + export PATH="/opt/rust/bin:${PATH}" + fi + if [[ ! -d "${CARGO_HOME}" ]] ; then + export CARGO_HOME="/opt/rust/cargo" + fi + + for _arch in ${_architectures}; do + if [[ ${_arch} = i686-w64-mingw32 ]] ; then + export RUST_TARGET=i686-pc-windows-gnu + fi + if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then + export RUST_TARGET=x86_64-pc-windows-gnu + fi + + export DLLTOOL="${_arch}-dlltool" + + cargo cbuild \ + --verbose \ + --verbose \ + --target ${RUST_TARGET} \ + --release \ + --frozen \ + --prefix=/usr/${_arch} \ + --manifest-path dovi_tool/dolby_vision/Cargo.toml + done +} + +check() { + if [[ -d "${RUST_PATH}" ]] ; then + export PATH="${RUST_PATH}:${PATH}" + else + export PATH="/opt/rust/bin:${PATH}" + fi + if [[ ! -d "${CARGO_HOME}" ]] ; then + export CARGO_HOME="/opt/rust/cargo" + fi + + for _arch in ${_architectures}; do + if [[ ${_arch} = i686-w64-mingw32 ]] ; then + export RUST_TARGET=i686-pc-windows-gnu + fi + if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then + export RUST_TARGET=x86_64-pc-windows-gnu + fi + + cargo test \ + --target ${RUST_TARGET} \ + --release \ + --frozen \ + --all-features \ + --manifest-path dovi_tool/dolby_vision/Cargo.toml + done +} + +package() { + cd dovi_tool/dolby_vision + + if [[ -d "${RUST_PATH}" ]] ; then + export PATH="${RUST_PATH}:${PATH}" + else + export PATH="/opt/rust/bin:${PATH}" + fi + if [[ ! -d "${CARGO_HOME}" ]] ; then + export CARGO_HOME="/opt/rust/cargo" + fi + + for _arch in ${_architectures}; do + if [[ ${_arch} = i686-w64-mingw32 ]] ; then + export RUST_TARGET=i686-pc-windows-gnu + fi + if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then + export RUST_TARGET=x86_64-pc-windows-gnu + fi + + cargo cinstall \ + --target ${RUST_TARGET} \ + --release \ + --frozen \ + --prefix /usr/${_arch} \ + --destdir "${pkgdir}" + + # somehow dlltool invocation of cargo cbuild produces a broken implib + rm "${pkgdir}"/usr/${_arch}/lib/dovi.dll.a + ${_arch}-dlltool -d "${pkgdir}"/usr/${_arch}/lib/dovi.def -D dovi.dll -l "${pkgdir}"/usr/${_arch}/lib/dovi.dll.a + + ${_arch}-strip --strip-unneeded "${pkgdir}"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "${pkgdir}"/usr/${_arch}/lib/*.a + + install -Dm 644 LICENSE -t "${pkgdir}"/usr/${_arch}/share/licenses/libdovi/ + done +} + +# vim: ts=2 sw=2 et: |