summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31d311cac2b3a5ef65d588403dfd93ebd964381b (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
# Maintainer: Jiří Klimeš <blueowl@centrum.cz>

pkgbase=lua-gl
pkgname=('lua-gl' 'lua51-gl' 'lua52-gl')
pkgver=1.11
pkgrel=1
pkgdesc="Lua bindings for OpenGL"
arch=('i686' 'x86_64')
url="http://luagl.sourceforge.net"
license=('MIT')
makedepends=('lua' 'lua51' 'lua52' 'glu')
source=("https://sourceforge.net/projects/luagl/files/${pkgver}/Docs%20and%20Sources/luagl-${pkgver}_Sources.tar.gz"
        "https://sourceforge.net/projects/luagl/files/${pkgver}/Docs%20and%20Sources/luagl-${pkgver}_Docs_html.tar.gz"
)
sha256sums=('5898433a32c5ff7e36dcbf1a6b638f7af1e5ff8c4731ba17d5f109c4a8db981e'
            '3d23be0aac7d11232eaad76a6e327066b2fe4aa821af1244db7ccd37b82b0045')

prepare() {
  # Add RUN_PATH variable to be able to set DT_RUNPATH
  sed 's/$(ECHO)$(LD)/& $(RUN_PATH)/' -i "$srcdir"/luagl/tecmake.mak
}

build() {
  cd "$srcdir"/luagl
  msg2 'Building with Lua 5.3'
  make USE_LUA53=Yes RUN_PATH="-Wl,-rpath=/usr/lib/lua/5.3,--enable-new-dtags,--as-needed"

  msg2 'Building with Lua 5.1'
  make USE_LUA51=Yes RUN_PATH="-Wl,-rpath=/usr/lib/lua/5.1,--enable-new-dtags,--as-needed"

  msg2 'Building with Lua 5.2'
  make USE_LUA52=Yes RUN_PATH="-Wl,-rpath=/usr/lib/lua/5.2,--enable-new-dtags,--as-needed"
}

_package_helper() {
  _lua_ver=$1
  _lua_ver_nodot=`echo $1 | cut -c1,3`

  install -m755 -d "$pkgdir"/usr/lib/lua/${_lua_ver}
  install -m755 "$srcdir"/luagl/lib/Linux*/Lua${_lua_ver_nodot}/*.so "$pkgdir"/usr/lib/lua/${_lua_ver}
  install -Dm644 "$srcdir"/luagl/COPYRIGHT "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
  install -m755 -d "$pkgdir"/usr/share/doc/$pkgname/html
  install -Dm644 "$srcdir"/luagl/html/*.* "$pkgdir"/usr/share/doc/$pkgname/html
  install -m755 -d "$pkgdir"/usr/share/doc/$pkgname/html/examples
  install -Dm644 "$srcdir"/luagl/html/examples/* "$pkgdir"/usr/share/doc/$pkgname/html/examples
}

package_lua-gl() {
  pkgdesc="Lua 5.3 bindings for OpenGL"
  depends=('lua' 'glu')

  _package_helper "5.3"
}

package_lua51-gl() {
  pkgdesc="Lua 5.1 bindings for OpenGL"
  depends=('lua51' 'glu')

  _package_helper "5.1"
}

package_lua52-gl() {
  pkgdesc="Lua 5.2 bindings for OpenGL"
  depends=('lua52' 'glu')

  _package_helper "5.2"
}

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