summaryrefslogtreecommitdiff
path: root/libre/lib32-mesa-demos-libre/PKGBUILD
blob: b54dbaa913b6b505259f2ff1baf93d2ec8aa5804 (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
# $Id: PKGBUILD 178740 2013-02-26 16:15:13Z andyrtr $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>

_pkgbasename=mesa-demos-libre
pkgname=lib32-$_pkgbasename
pkgver=8.1.0
pkgrel=1
arch=(x86_64)
pkgdesc="Mesa demos and tools (32-bit), without nonfree demos"
url="http://mesa3d.sourceforge.net"
license=('custom')
provides=("lib32-mesa-demos=$pkgver")
replaces=('lib32-mesa-demos')
conflicts=('lib32-mesa-demos')
makedepends=(gcc-multilib 'lib32-mesa-libgl>=9.1' 'lib32-glew' 'libgl>=9.1')
source=(ftp://ftp.freedesktop.org/pub/mesa/demos/${pkgver}/mesa-demos-${pkgver}.tar.bz2
        mesa-demos-libre.patch)
md5sums=('9df33ba69a26bbfbc7c8148602e59542'
         '5ce0660b46beb1230194fbd852d33ab0')

build() {
  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

  cd "${srcdir}/mesa-demos-${pkgver}"

  # Remove nonfree demos (pointblast and spriteblast)
  rm -v src/demos/{pointblast,spriteblast}.c
  patch -Np1 -i "${srcdir}/mesa-demos-libre.patch"

  ./configure --prefix=/usr \
    --enable-gles1 \
    --enable-gles2

  make
}

package() {
  depends=('lib32-glew' mesa-demos)

  cd "${srcdir}/mesa-demos-${pkgver}"
  make DESTDIR="${pkgdir}" install

  for i in "$pkgdir/usr/bin/"*; do
    mv "$i" "$i"32
  done

  mkdir -p "$pkgdir/usr/share/licenses"
  ln -s mesa-demos "$pkgdir/usr/share/licenses/lib32-mesa-demos"
}