blob: 9c0ee6cc24fdbd76bdb8356d4fe9ecd777c56f3f (
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
88
89
90
91
92
93
94
95
|
pkgname='mygui-git'
pkgver=3.2.1.20140829
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')
_giturl='git://github.com/MyGUI/mygui.git'
_gitname='mygui'
#source=("$_giturl")
#md5sums=('SKIP')
source=()
md5sums=()
depends=('boost-libs' 'ogre' 'ois')
makedepends=('boost' 'cmake' 'doxygen' 'ttf-dejavu')
optdepends=('mygui-docs: documentation')
conflicts=('mygui' 'mygui-svn')
provides=('mygui')
_gitfetch() {
cd "${srcdir}"
if [[ -d $_gitname ]]; then
cd $_gitname
git pull -v origin master
else
git clone $_giturl
#git clone $_giturl --depth 1
fi
}
pkgver() {
_gitfetch &> log.gitpull
cd "${srcdir}/${pkgname%-git}"
_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;}'`
_gitlog=`git log -1 --format=%cd --date=short | tr -d '-'`
#git log -1 --format=%cd.%h --date=short | tr -d '-'
echo $_maj.$_min.$_rev.$_gitlog
}
build() {
cd "${srcdir}/${pkgname%-git}"
msg "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
sed -i 's/\${OIS_LIBRARIES}/${OIS_LIBRARIES} boost_system/g' Common/CMakeLists.txt
msg "Get a clean build dir..."
[[ -d build ]] && rm -rf build
mkdir build && cd build
msg "Generate CMake makefiles..."
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DMYGUI_INSTALL_SAMPLES=TRUE \
-DMYGUI_INSTALL_TOOLS=TRUE \
-DMYGUI_INSTALL_MEDIA=TRUE \
-DFREETYPE_INCLUDE_DIR=/usr/include/freetype2/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=TRUE
msg "Starting make..."
make
}
package() {
cd "${srcdir}/${pkgname%-git}/build"
make DESTDIR="$pkgdir" install
# make demos work
chown root:users $pkgdir/opt/MYGUI
chmod 775 $pkgdir/opt/MYGUI
}
|