summaryrefslogtreecommitdiff
path: root/community/gigi/PKGBUILD
blob: 5066202b22a2210498bb96e227c0e230e2cf705f (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
# $Id: PKGBUILD 76013 2012-09-08 21:44:20Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: fana-m <geminin@gmx.net>
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Manuel Gaul <inkaine@hotmail.com>

pkgname=gigi
pkgver=0.8.0
pkgrel=12
_fixedrevision=5208
pkgdesc="Small, efficient and feature rich GUI for C++ and OpenGL (freeorion fork)"
url="http://gigi.sourceforge.net/"
arch=('x86_64' 'i686')
license=('LGPL')
depends=('boost' 'mesa' 'libpng' 'libjpeg' 'libtiff' 'freetype2' 'ogre' 'sdl' 'ois' 'python')
makedepends=('subversion' 'cmake' 'setconf' 'doxygen')
conflicts=('gigi-svn' 'mesa-full')

build() {
  cd "$srcdir"

  msg2 "Fetching files..."
  if [ -d gigi/.svn ]; then
    (cd gigi && svn up -r "$_fixedrevision")
  else
    #svn co https://gigi.svn.sourceforge.net/svnroot/gigi/trunk/GG/ \
    svn co https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/GG/ \
      --config-dir ./ -r "$_fixedrevision" gigi
  fi

  rm -rf gigi-build
  svn export gigi gigi-build
  cd gigi-build

  msg2 "Configuring..."
  setconf cmake/GiGiOgre.pc.in prefix /usr
  setconf cmake/GiGi.pc.in prefix /usr
  setconf cmake/GiGiSDL.pc.in prefix /usr
  cmake \
    -D CMAKE_INSTALL_PREFIX="$pkgdir"/usr \
    -D BUILD_TUTORIALS=OFF \
    -D CPACK_GENERATOR=GiGiDevel \
    -D CMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
    .

  msg2 "Building documentation..."
  cd doc
  doxygen
  cd ..

  msg2 "Compiling..."
  make -j1
}

package() {
  cd "$srcdir/gigi-build"

  msg2 "Packaging files..."
  make install

  msg2 "Fixing documentation..."
  mkdir -p "$pkgdir/usr/share/doc"
  mv "$pkgdir/usr/doc" "$pkgdir/usr/share/doc/$pkgname"

  for f in `find "$pkgdir/usr/share/doc" -name "dir_*.html"`; do
    sed -i "s:$srcdir:/:g" "$f"
  done

  msg2 "Packaging license..."
  install -Dm 644 COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

# vim:set ts=2 sw=2 et: