summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9fae3d2989d73c5c8e44735907e03f5f42925536 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=avif-git
pkgver=0.2.0.r3.g9c502a4
pkgrel=1
pkgdesc="Library for encoding and decoding .avif files"
arch=('i686' 'x86_64')
url="https://github.com/AOMediaCodec/libavif"
license=('BSD')
depends=('glibc')
makedepends=('git' 'cmake' 'nasm')
provides=('avif')
conflicts=('avif')
options=('staticlibs')
source=("git+https://github.com/AOMediaCodec/libavif.git")
sha256sums=('SKIP')


prepare() {
  cd "libavif"

  git submodule update --init --recursive
}

pkgver() {
  cd "libavif"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "libavif"

  mkdir -p "_build" && cd "_build"
  cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DCMAKE_INSTALL_LIBDIR="lib" \
    -DAVIF_BUILD_APPS=ON \
    ../
  make
}

package() {
  cd "libavif"

  install -Dm755 "_build"/{avifdec,avifenc} -t "$pkgdir/usr/bin"

  install -d "$pkgdir/usr/include"
  cp -r "include/avif" "$pkgdir/usr/include"
  install -Dm644 "_build/libavif.a" -t "$pkgdir/usr/lib"

  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/avif"
}