summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e96d5830e584eec0f6b3b6e64512199672c6ef60 (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
# Contributer: Paramvir Likhari <plikhari at gmail dot com>
# Maintainer: Paramvir Likhari <plikhari at gmail dot com>


pkgname=tolua++_5.3
pkgver=1.0.93
pkgrel=1
pkgdesc='Provides tolua++ for 5.3 - This tool integrates C/C++ code with Lua 5.3 !!  - See this PKGBUILD source - Just change one variable to build the git version - defaults to release version.'
arch=('i686' 'x86_64')
url="https://github.com/LuaDist/toluapp"
license=('MIT')
depends=('lua')
options=('staticlibs')
conflicts=('tolua++')
provides=('tolua++')

### NOTE: Install conky-cairo from AUR - one of my other packages besides conkywx weather program

### change _myopts=0 to use git version
_myopts=1

case ${_myopts} in
0)  ### _myopts=0 for git version #####################################
    _pkgname=toluapp
    makedepends=('cmake' 'git')
    source=("git+${url}.git"
             'tolua53.patch')
    pkgver() {
        cd "${srcdir}/${_pkgname}"
        git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
    }
    md5sums=('SKIP'
             '863770a6c505f2a76068d54f7aac1cd8')
    ;;
1)  ### _myopts=1 for release version #################################
    _pkgname="toluapp-${pkgver}"
    makedepends=('cmake' )
    source=(${url}/archive/${pkgver}.tar.gz
             'tolua53.patch')
    md5sums=('689d952034e55d4333fa240f7516e68a'
             '863770a6c505f2a76068d54f7aac1cd8')
    ;;
esac

prepare() {
    cd "${srcdir}/${_pkgname}"
    patch -p3 -i ../tolua53.patch
}

build() {
    cd "${srcdir}/${_pkgname}"
    cmake \
        -D CMAKE_INSTALL_PREFIX=/usr \
        .

    make
}

package() {
    cd "${srcdir}/${_pkgname}"

    make DESTDIR="${pkgdir}" install

    mkdir -p ${pkgdir}/usr/share/toluapp/luapp
    install -D -m755 src/bin/lua/* ${pkgdir}/usr/share/toluapp/luapp/
    install -Dm644 "$srcdir/${_pkgname}/COPYRIGHT" "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
}