summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 199ee5535fbc45c0a51bfde525febdb8561bc121 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Maintainer:  Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=lib32-zimg-git
pkgver=3.0.5.155.ga0fac0f
pkgrel=1
pkgdesc="Scaling, colorspace conversion, and dithering library. (GIT version)"
arch=('x86_64')
url='http://forum.doom9.org/showthread.php?t=171334'
license=('custom:WTFPL')
depends=(
  'lib32-gcc-libs'
  'lib32-glibc'
)
makedepends=(
  'git'
  'cmake'
)
provides=(
  "lib32-zimg=${pkgver}"
  'libzimg.so'
)
conflicts=('lib32-zimg')
source=(
  'git+https://bitbucket.org/the-sekrit-twc/zimg.git'
  'git+https://bitbucket.org/the-sekrit-twc/graphengine.git'
  'git+https://github.com/google/googletest.git'
)
sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
)
options=('debug')

pkgver() {
  cd zimg
  echo "$(git describe --long --tags | tr - . | sed 's|release.||g')"
}

prepare() {
  mkdir -p build

  cd zimg
  git config submodule.graphengine.url "${srcdir}/graphengine"
  git config submodule.test/extra/googletest.url "${srcdir}/googletest"
  git -c protocol.file.allow=always submodule update --init \
    graphengine \
    test/extra/googletest
}

build() {

  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG="i686-pc-linux-gnu-pkg-config"

  cd zimg
  ./autogen.sh

  cd "${srcdir}/build"
  ../zimg/configure \
    --prefix=/usr \
    --libdir=/usr/lib32 \
    --enable-testapp \
    --enable-example \
    --enable-unit-test \
    --host=i686-linux-gnu

  make
  make test/unit_test
}

check() {
  cd build
  ./testapp cpuinfo
  ./test/unit_test
}

package(){
  depends+=("zimg=${pkgver}")
  make -C build DESTDIR="${pkgdir}" install

  rm -fr "${pkgdir}/usr/include"
  rm -fr "${pkgdir}/usr/share"

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