summaryrefslogtreecommitdiff
path: root/libre/ogre-libre/PKGBUILD
blob: f918553220be6ca8bd7b1e3ec11228e7160698bb (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Maintainer: Márcio Silva <coadde@parabola.nu>

_bldname=blender
_bldver=2.69
_bldep=10

# ($srcdir/Tools/${_bldname^}2.6Export/__init__.py:bl_info>version)
_addver=2.0.3
_addrel=1

pkgbase=ogre
pkgname=(
  $pkgbase-libre
  #$_bldname-addon-$pkgbase # package unstable
)
pkgver=1.9.0
pkgrel=5
pkgdesc='Scene-oriented, flexible 3D engine written in C++, without nonfree software support and files'
arch=(
  mips64el
  x86_64
  i686
)
url=http://www.${pkgbase}3d.org
license=MIT
depends=(
  boost-libs
  freeimage
  freetype2
  glu
  libxaw
  libxrandr
  ois
  tinyxml
  zziplib
)
makedepends=(
  boost
  cmake
  doxygen
  graphviz
  mesa
  mercurial
  ttf-dejavu
)
mksource=(
  ogre::hg+https://bitbucket.org/sinbad/ogre/src#tag=v${pkgver//./-}
  libre.patch
)
source=(
  https://repo.parabolagnulinux.org/other/$pkgbase-libre/$pkgbase-libre-$pkgver.tar.xz
)
mksha512sums=(
  SKIP
  e668b39e4784e4b1b17ec6e21b5cef45f29a8d8e73288817ce7832d1fe24527d5e0d4fd67b8f756db301e4211ceac2d5c387c1599e799ca41de0593457204767
)
sha512sums=(
  9be9dbd78e09c8c50cf833004bfa3fbb7b3cd2a0f52a4e8c4beb1eb30357625455d65906bd007be6c2be9cf90a0e335d5ad7c5011e038c3d0754d5b3b18c4a2a
)

mksource() {
  cd ${pkgbase}

  # remove nonfree files
  rm -v RenderSystems/GL/include/GL/{gl{,ext},wglext,glx{tokens,ext}}.h
  rm -v RenderSystems/GL3Plus/include/GL/glxtokens-backup.h
  rm -rv Samples/Media/materials/textures/nvidia
  rm -v Samples/Media/packs/chiropteraDM.{pk3,txt}
  rm -v CMake/Templates/quakemap{,_d}.cfg.in
  patch -Np1 -i $srcdir/libre.patch
}

prepare() {
  cd ${pkgbase}

  # add symlinks to point to mesa header files
  cd RenderSystems/GL/include/GL
  ln -sv /usr/include/GL/gl.h gl.h
  ln -sv /usr/include/GL/glext.h glext.h
  ln -sv /usr/include/GL/wglext.h wglext.h
  ln -sv /usr/include/GL/glxtokens.h glxtokens.h
  ln -sv /usr/include/GL/glxext.h glxext.h
}

build() {
  cd ${pkgbase}

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

  # SAMPLES, SAMPLES_SOURCE and TESTS are nonfree
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release\
    -DCMAKE_INSTALL_PREFIX=/usr\
    -DCPACK_PACKAGE_DESCRIPTION_SUMMARY='Libre 3D Graphics Engine'\
    -D${pkgbase^^}_BUILD_COMPONENT_PAGING=TRUE\
    -D${pkgbase^^}_BUILD_COMPONENT_PROPERTY=TRUE\
    -D${pkgbase^^}_BUILD_COMPONENT_RTSHADERSYSTEM=TRUE\
    -D${pkgbase^^}_BUILD_COMPONENT_TERRAIN=TRUE\
    -D${pkgbase^^}_BUILD_PLATFORM_NACL=FALSE\
    -D${pkgbase^^}_BUILD_PLUGIN_BSP=TRUE\
    -D${pkgbase^^}_BUILD_PLUGIN_OCTREE=TRUE\
    -D${pkgbase^^}_BUILD_PLUGIN_PCZ=TRUE\
    -D${pkgbase^^}_BUILD_PLUGIN_PFX=TRUE\
    -D${pkgbase^^}_BUILD_RENDERSYSTEM_GL=TRUE\
    -D${pkgbase^^}_BUILD_RENDERSYSTEM_GLES=FALSE\
    -D${pkgbase^^}_BUILD_RENDERSYSTEM_GLES2=FALSE\
    -D${pkgbase^^}_BUILD_RTSHADERSYSTEM_CORE_SHADERS=TRUE\
    -D${pkgbase^^}_BUILD_RTSHADERSYSTEM_EXT_SHADERS=TRUE\
    -D${pkgbase^^}_BUILD_SAMPLES=FALSE\
    -D${pkgbase^^}_BUILD_TESTS=FALSE\
    -D${pkgbase^^}_BUILD_TOOLS=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_DDS=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_FREEIMAGE=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_GLES2_GLSL_OPTIMISER=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_PVRTC=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE=TRUE\
    -D${pkgbase^^}_CONFIG_ENABLE_ZIP=TRUE\
    -D${pkgbase^^}_CONFIG_NEW_COMPILERS=TRUE\
    -D${pkgbase^^}_CONFIG_THREAD_PROVIDER=boost\
    -D${pkgbase^^}_INSTALL_DOCS=FALSE\
    -D${pkgbase^^}_INSTALL_SAMPLES=FALSE\
    -D${pkgbase^^}_INSTALL_SAMPLES_SOURCE=FALSE\
    -D${pkgbase^^}_INSTALL_TOOLS=TRUE\
    -D${pkgbase^^}_LIB_DIRECTORY=lib\
    -D${pkgbase^^}_PROFILING=TRUE\
    -D${pkgbase^^}_USE_BOOST=TRUE
#  make V=0
  make
}

package_ogre-libre() {
  optdepends=(
    "boost: for developing using $pkgbase"
    "$pkgbase-docs: documentation"
  )
  provides=($pkgbase=$pkgver)
  conflicts=$pkgbase
  replaces=$pkgbase

  cd ${pkgbase}/build

  make DESTDIR=$pkgdir install

  # install license
  install -vDm644 ../Docs/License.html $pkgdir/usr/share/licenses/$pkgbase/license.html

  # remove nonfree files
  rm -vr $pkgdir/usr/lib/OGRE/cmake
  rm -v $pkgdir/usr/include/OGRE/Example*.h
}

package_blender-addon-ogre() {
  pkgdesc="${pkgbase^} Mesh Exporter: A addon for the ${_bldname^} which allows export mesh and (skeletal/morph/pose) animations to ${pkgbase^}3D format (built for the $_bldname-libre package)"
  arch=any
  depends=(
    "$_bldname-libre>=$(($_bldep-1)):$_bldver"
    "$_bldname-libre<$_bldep:${_bldver::2}$((${_bldver:2:4}+1))"
  )
  _pkgver=$pkgver
  pkgver=$_addver.v$_bldver
  pkgrel=$_addrel

  cd ${pkgbase}
  a=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons               
  install -vd $a && cp -va Tools/${_bldname^}2.6Export $a/$pkgbase
}

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