summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8840bbc5d2c830338fc86d343b820202864d0862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: quietvoid <tcChlisop0@gmail.com>

_pkgname=libdovi
pkgname=lib32-${_pkgname}
pkgver=3.3.1
pkgrel=1
pkgdesc='Library to read and write Dolby Vision metadata C-API (32-bit)'
_pkgtag="libdovi-${pkgver}"
arch=('x86_64')
url='https://github.com/quietvoid/dovi_tool/tree/main/dolby_vision'
license=('MIT')
depends=('lib32-gcc-libs' 'lib32-glibc')
makedepends=('cargo' 'cargo-c' 'lib32-rust-libs')
provides=('libdovi.so')
source=(
  "https://github.com/quietvoid/dovi_tool/archive/refs/tags/${_pkgtag}.tar.gz"
  "0001-lib32-libdovi-remove-subdirectory.patch"
)
sha256sums=(
  '4cd7a4c418fd8af1da13278ce7524c15b7fdf61e1fe53663aa291c68c5062777'
  '20f1168e3ad003502031578246a6f8f61a73f53cd2b00b583f944fda0dea2654'
)
_rootdir="dovi_tool-${_pkgtag}"

prepare() {
  cd "${_rootdir}"
  patch -Np1 -i "${srcdir}/0001-lib32-libdovi-remove-subdirectory.patch"

  cargo fetch \
    --manifest-path dolby_vision/Cargo.toml
}

build() {
  cargo cbuild --target i686-unknown-linux-gnu \
    --release \
    --frozen \
    --prefix=/usr \
    --libdir /usr/lib32 \
    --includedir /usr/include/"${_pkgname}"32 \
    --manifest-path ${_rootdir}/dolby_vision/Cargo.toml
}

check() {
  cargo test --target i686-unknown-linux-gnu \
    --release \
    --frozen \
    --all-features \
    --manifest-path ${_rootdir}/dolby_vision/Cargo.toml
}

package() {
  cd "${_rootdir}/dolby_vision"

  cargo cinstall --target i686-unknown-linux-gnu \
    --release \
    --frozen \
    --prefix /usr \
    --libdir /usr/lib32 \
    --includedir /usr/include/"${_pkgname}"32 \
    --destdir "${pkgdir}"

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}