summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 68bf1d8985056fb4267fbb35fc0b1c3584cee931 (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: bkacjios < blackops7799 at gmail dot com >

pkgbase=lua-periphery
pkgname=(lua-periphery lua51-periphery lua52-periphery lua53-periphery)

pkgver=2.4.2
pkgrel=1
_commit=f2d98044b93fce643553d545827d739d5fe85c2a
pkgdesc='A Lua library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.'
arch=('x86_64')
url='https://github.com/vsergeev/lua-periphery'
license=('MIT')
#options=('debug')
makedepends=('lua' 'lua51' 'lua52' 'lua53' 'git')
source=("git+https://github.com/vsergeev/lua-periphery.git#commit=${_commit}")
md5sums=('SKIP')

prepare() {
  cd "$srcdir/lua-periphery"
  git submodule update --init --recursive

  cd "$srcdir"
  cp -a lua-periphery lua-periphery-51
  cp -a lua-periphery lua-periphery-52
  cp -a lua-periphery lua-periphery-53
}

build() {
  cd "$srcdir"/lua-periphery-51
  MYCFLAGS="$CFLAGS" MYLDFLAGS=$LDFLAGS LUA=lua51 make

  cd "$srcdir"/lua-periphery-52
  MYCFLAGS="$CFLAGS" MYLDFLAGS=$LDFLAGS LUA=lua52 make

  cd "$srcdir"/lua-periphery-53
  MYCFLAGS="$CFLAGS" MYLDFLAGS=$LDFLAGS LUA=lua53 make

  cd "$srcdir"/lua-periphery
  MYCFLAGS="$CFLAGS" MYLDFLAGS=$LDFLAGS LUA=lua54 make
}

package_lua51-periphery() {
  cd lua-periphery-51
  install -D -m644 periphery.so "$pkgdir/usr/lib/lua/5.1/periphery.so"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua52-periphery() {
  cd lua-periphery-52
  install -D -m644 periphery.so "$pkgdir/usr/lib/lua/5.2/periphery.so"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua53-periphery() {
  cd lua-periphery-53
  install -D -m644 periphery.so "$pkgdir/usr/lib/lua/5.3/periphery.so"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua-periphery() {
  cd lua-periphery
  install -D -m644 periphery.so "$pkgdir/usr/lib/lua/5.4/periphery.so"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}