summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6cfac12e5b356d05c386582b86914bf214b1b140 (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
# Maintainer:  Vincent Grande <shoober420@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>

pkgname=sdl2_image-minimal-hg
pkgver=2.0.5
pkgrel=1
pkgdesc="A simple library to load images of various formats as SDL surfaces (Version 2)"
arch=('x86_64')
url="http://www.libsdl.org/projects/SDL_image"
license=('MIT')
depends=('sdl2' 'libpng' 'libtiff' 'libjpeg')
makedepends=('cmake' 'mercurial')
provides=(sdl2_image)
conflicts=(sdl2_image)
source=(hg+https://hg.libsdl.org/SDL_image/)
sha512sums=('SKIP')

pkgver() {
  cd SDL_image

  local _lasttag=$(hg tags -q | sort -r | grep release- | head -n1)
  local _commits=$(hg log --template "{node}\n" -r $_lasttag:tip | wc -l)
  printf "%s.r%s.%s" "${_lasttag/release-}" "$_commits" "$(hg identify -i)"
}


build() {
  cd SDL_image

  ./autogen.sh
  ./configure --disable-static --prefix=/usr \
    --disable-jpg-shared \
    --disable-png-shared \
    --disable-tif-shared \
    --disable-webp-shared \
    --disable-webp \
    --disable-webpdec
  make
}

package() {
  cd SDL_image

  make DESTDIR="${pkgdir}/" install
  install -Dm644 COPYING.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}