summaryrefslogtreecommitdiff
path: root/community/mygui/PKGBUILD
blob: dc8c305c7847922fe85fde1362ddf5cd04ca3e1e (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
# $Id: PKGBUILD 69363 2012-04-14 17:09:46Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Andrew Belitsky <belitsky.a@gmail.com>
pkgbase=mygui
pkgname=('mygui' 'mygui-docs')
pkgver=3.2.0
pkgrel=2
pkgdesc="A multilayer and overlappable GUI System for OGRE"
arch=('i686' 'x86_64' 'mips64el')
url="http://mygui.info/"
license=('LGPL')
depends=('boost-libs' 'ogre' 'ois')
makedepends=('boost' 'cmake' 'doxygen' 'graphviz' 'ttf-dejavu')
install=mygui.install
source=("http://downloads.sourceforge.net/my-gui/MyGUI_$pkgver.zip")
md5sums=('7c20486a0db82f497d8b7c5300613b61')

build() {
  cd $srcdir/MyGUI_$pkgver

  # change CMake config so demos install to /opt
  sed -i 's:"bin:"../opt/MYGUI:' CMake/Utils/MyGUIConfigTargets.cmake
  sed -i -e 's:../share:/usr/share:' \
         -e 's:"bin":"../opt/MYGUI":' \
         CMake/InstallResources.cmake
  sed -i '71 i set(MYGUI_GCC_VISIBILITY_FLAGS "")' CMakeLists.txt

  # get a clean build dir
  [[ -d build ]] && rm -rf build
  mkdir build && cd build

  # generate CMake Makefile
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DMYGUI_INSTALL_SAMPLES=TRUE \
    -DMYGUI_INSTALL_TOOLS=TRUE \
    -DMYGUI_INSTALL_DOCS=TRUE \
    -DMYGUI_INSTALL_MEDIA=TRUE \
    -DCMAKE_BUILD_TYPE=Release # set=Debug for debugging version

  # compile
  make

  # generate docs
  if [[ $(which dot) && $(which doxygen) ]]; then
    make api-docs 2>/dev/null
  fi
}

package_mygui() {
  optdepends=('mygui-docs: documentation')

  cd $srcdir/MyGUI_$pkgver
  
  cd build

  # install the whole bunch
  make DESTDIR="$pkgdir" install

  # make demos work
  chown root:users $pkgdir/opt/MYGUI
  chmod 775 $pkgdir/opt/MYGUI
}

package_mygui-docs() {
  pkgdesc="Documentation for mygui"
  depends=()

  cd $srcdir/MyGUI_$pkgver
  
  cd build

  # install docs
  install -d $pkgdir/usr/share/doc/
  cp -r Docs/html $pkgdir/usr/share/doc/MYGUI
}

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