summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7f353d179a1f57aa014e8449a19f6ac01aacb54f (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
pkgname='mygui-git'
pkgver=3.4.2.a238876f5
pkgrel=1

pkgdesc="A library for creating Graphical User Interfaces for games and 3D applications"
arch=('i686' 'x86_64')
url="http://mygui.info/"
license=('LGPL')

depends=('ogre')
makedepends=('cmake' 'doxygen' 'graphviz' 'ttf-dejavu')
conflicts=('mygui' 'mygui-svn')
provides=('mygui')

source=("git+https://github.com/MyGUI/mygui.git")
sha512sums=('SKIP')

pkgver() {
	cd "${srcdir}/mygui"

	_hfile='MyGUIEngine/include/MyGUI_Prerequest.h'
	_maj=$(cat $_hfile | grep MYGUI_VERSION_MAJOR | head -n1 | awk '{print $3;}')
	_min=$(cat $_hfile | grep MYGUI_VERSION_MINOR | head -n1 | awk '{print $3;}')
	_rev=$(cat $_hfile | grep MYGUI_VERSION_PATCH | head -n1 | awk '{print $3;}')

	_gitcommit=$(git rev-parse --short HEAD)
	#git log -1 --format=%cd.%h --date=short | tr -d '-'

	echo $_maj.$_min.$_rev.$_gitcommit
}

prepare() {
	mkdir -p cd "${srcdir}/mygui/build"
}

build() {
	cd "${srcdir}/mygui/build"

	# msg "Get a clean build dir..."

	# [[ -d build ]] && rm -rf build
	# mkdir build && cd build

	# generate CMake Makefile
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DMYGUI_BUILD_DEMOS=FALSE \
		-DMYGUI_BUILD_TOOLS=TRUE \
		-DMYGUI_INSTALL_DOCS=TRUE \
		-DMYGUI_INSTALL_TOOLS=TRUE \
		-DCMAKE_BUILD_TYPE=Release \
		-DMYGUI_RENDERSYSTEM=3 \
		-DBUILD_SHARED_LIBS=TRUE

	make
	make api-docs
}

package() {
	cd "${srcdir}/mygui/build"

	make DESTDIR="$pkgdir" install

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