summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e8036750ed92d95080fcfb63172715472db24650 (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
# Maintainer:  Caleb Maclennan <caleb@alerque.com>
# Contributor: Popolon <popolon@popolon.org>
# Contributor: Martin Minka <https://github.com/k2s>
# Contributor: migerh <https://github.com/migerh>
# Contributor: hollunder <murks at tuxfamily dot org>

pkgname=wxlua-git
_pkgname=${pkgname/%-git}
pkgver=3.0.0.8.r7.g7684ddf
pkgrel=1
epoch=1
pkgdesc="Lua bindings for wxWidgets (Lua 5.3 compatible fork)"
arch=('i686' 'x86_64')
url="https://github.com/pkulchenko/$_pkgname"
license=('custom:wxWindows')
depends=('desktop-file-utils' 'wxgtk2' 'lua')
makedepends=('git' 'cmake')
provides=("$_pkgname")
conflicts=("$_pkgname")
checkdepends=('cppcheck')
source=("git://github.com/pkulchenko/$_pkgname.git")
sha256sums=('SKIP')

pkgver() {
    cd "${pkgname%-git}"
    git describe --tags --match "v[0-9\.]*" origin/master | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${pkgname%-git}/wxLua/build"
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
        -DwxLua_LUA_LIBRARY_USE_BUILTIN=FALSE \
        -DwxLua_LUA_LIBRARY_BUILD_SHARED=TRUE \
        -DwxLua_LUA_LIBRARY="/usr/lib/liblua.so" \
        -DwxLua_LUA_INCLUDE_DIR="/usr/include/" \
        -DCMAKE_BUILD_TYPE=Release \
        -DwxWidgets_COMPONENTS="stc;gl;html;aui;adv;core;net;base" \
        -DwxLuaBind_COMPONENTS="stc;gl;html;aui;adv;core;net;base" \
        -DBUILD_SHARED_LIBS=TRUE
    make
}

package() {
    cd "${pkgname%-git}/wxLua/build"
    make DESTDIR="$pkgdir/" install
    rm -f "$pkgdir"/usr/bin/lua{,c}

    install -d "$pkgdir/usr/lib/lua/5.3"
    mv "$pkgdir/usr/lib/libwx.so" "$pkgdir/usr/lib/lua/5.3/wx.so"

    pushd ..

    install -Dm644 distrib/autopackage/wxlua.desktop \
        "$pkgdir/usr/share/applications/wxlua.desktop"

    install -Dm644 art/wxlualogo.xpm \
        "$pkgdir/usr/share/icons/wxlualogo.xpm"

    install -Dm644 distrib/autopackage/wxlua.xml \
        "$pkgdir/usr/share/mime/packages/wxlua.xml"

    install -Dm 644 docs/licence.txt \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}