archrelease: copy trunk to community-any
[ArchLinux/community.git] / libluv / repos / community-x86_64 / PKGBUILD
blob6008dfb7adfdabcc405b60ae651bc31ac69c380b
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Jurica Bradarić <jbradaric@gmail.com>
3 # Contributor: jprjr <john@jrjrtech.com>
5 pkgname=('libluv' 'lua-luv' 'lua51-luv' 'lua52-luv' 'lua53-luv')
6 pkgbase=libluv
7 pkgver=1.44.2_1
8 pkgrel=2
9 pkgdesc='Bare libuv bindings for lua'
10 arch=('x86_64')
11 url='https://github.com/luvit/luv'
12 license=('APACHE')
13 depends=('libuv')
14 makedepends=('cmake' 'libuv' 'ninja' 'luajit' 'lua>=5.4.0' 'lua<5.5.0' 'lua51' 'lua52' 'lua53')
15 source=("https://github.com/luvit/luv/releases/download/${pkgver//_/-}/luv-${pkgver//_/-}.tar.gz")
16 sha256sums=('3eb5c7bc44f61fbc4148ea30e3221d410263e0ffa285672851fc19debf9e5c30')
18 build() {
19   # build per-lua versions
20   for ver in 5.1 5.2 5.3 5.4; do
21     incdir="/usr/include/lua${ver}"
22     if [ "$ver" = "5.4" ] ; then
23       incdir="/usr/include"
24     fi
25     cmake -GNinja \
26       -Bbuild-lua${ver//./} \
27       -DLUA=/usr/bin/lua${ver} \
28       -DLUA_INCDIR=${incdir} \
29       -DLUADIR=/usr/share/lua/${ver} \
30       -DLIBDIR=/usr/lib/lua/${ver} \
31       -DWITH_SHARED_LIBUV=ON \
32       -DLUA_BUILD_TYPE=System \
33       -DCMAKE_INSTALL_PREFIX=/usr \
34       "luv-${pkgver//_/-}"
35     ninja -C "build-lua${ver//./}"
36   done
38   # build shared library version
39   cmake -GNinja \
40     -Bbuild \
41     -DWITH_SHARED_LIBUV=ON \
42     -DLUA_BUILD_TYPE=System \
43     -DBUILD_MODULE=OFF \
44     -DBUILD_SHARED_LIBS=ON \
45     -DCMAKE_INSTALL_PREFIX=/usr \
46     "luv-${pkgver//_/-}"
47   ninja -C "build"
50 package_libluv() {
51   depends+=('luajit')
52   DESTDIR="${pkgdir}" ninja -C "build" install
55 package_lua-luv() {
56   pkgdesc+=' - Lua module'
57   depends+=('lua')
58   DESTDIR="${pkgdir}" ninja -C "build-lua54" install
61 package_lua51-luv() {
62   pkgdesc+=' - Lua 5.1 module'
63   depends+=('lua51')
64   DESTDIR="${pkgdir}" ninja -C "build-lua51" install
67 package_lua52-luv() {
68   pkgdesc+=' - Lua 5.2 module'
69   depends+=('lua52')
70   DESTDIR="${pkgdir}" ninja -C "build-lua52" install
73 package_lua53-luv() {
74   pkgdesc+=' - Lua 5.3 module'
75   depends+=('lua53')
76   DESTDIR="${pkgdir}" ninja -C "build-lua53" install
79 # vim:set ts=2 sw=2 et: