archrelease: copy trunk to testing-x86_64
[arch-packages.git] / lua / trunk / PKGBUILD
blob9dbde3ed8217395079a9d63e614780c08d81e1cc
1 # Maintainer: Sébastien Luttringer <seblu@archlinux.org>
2 # Contributor: Juergen Hoetzel <juergen@archlinux.org>
3 # Contributor: Damir Perisa <damir.perisa@bluewin.ch>
5 pkgname=lua
6 pkgver=5.4.4
7 _majorver=${pkgver%.*}
8 pkgrel=4
9 pkgdesc='Powerful lightweight programming language designed for extending applications'
10 arch=('x86_64')
11 url='https://www.lua.org/'
12 depends=('readline')
13 license=('MIT')
14 options=('!emptydirs')
15 source=(https://www.lua.org/ftp/lua-$pkgver.tar.gz
16         liblua.so.patch
17         lua.pc
18         LICENSE)
19 sha256sums=('164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61'
20             'a8a7f89ab0c03b4bc1d58a935c54df792ad628edb4d1788c5ac66e4fc2d9f800'
21             'ca9252633e782b8f85d6a94ea4f6babd4fe30bd759085b373160b1878e36ff78'
22             '142fb08b41a807b192b4b2c166696a1830a1c97967e5099ad0e579bf500e1da4')
24 prepare() {
25   patch -d lua-$pkgver -p1 -i ../liblua.so.patch
26   cp -r lua-$pkgver lua++-$pkgver
28   sed "s/%VER%/$_majorver/g;s/%REL%/$pkgver/g" lua.pc > lua-$pkgver/lua.pc
29   sed "s/%VER%/$_majorver/g;s/%REL%/$pkgver/g;s/-llua/-llua++/g" lua.pc > lua++-$pkgver/lua++.pc
32 build() {
33   cd lua-$pkgver
35   make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" linux-readline
37   cd ../lua++-$pkgver
39   make MYCFLAGS="$CXXFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" CC=g++ LUA_A=liblua++.a LUA_SO=liblua++.so linux-readline
42 package() {
43   cd lua-$pkgver
45   make \
46     TO_LIB="liblua.a liblua.so liblua.so.$_majorver liblua.so.$pkgver" \
47     INSTALL_DATA='cp -d' \
48     INSTALL_TOP="$pkgdir"/usr \
49     INSTALL_MAN="$pkgdir"/usr/share/man/man1 \
50     install
51   ln -sf /usr/bin/lua "$pkgdir"/usr/bin/lua$_majorver
52   ln -sf /usr/bin/luac "$pkgdir"/usr/bin/luac$_majorver
53   ln -sf /usr/lib/liblua.so.$pkgver "$pkgdir"/usr/lib/liblua$_majorver.so
55   install -Dm644 lua.pc "$pkgdir"/usr/lib/pkgconfig/lua54.pc
56   ln -sf lua54.pc "$pkgdir"/usr/lib/pkgconfig/lua.pc
57   ln -sf lua54.pc "$pkgdir"/usr/lib/pkgconfig/lua5.4.pc
58   ln -sf lua54.pc "$pkgdir"/usr/lib/pkgconfig/lua-5.4.pc
60   install -d "$pkgdir"/usr/share/doc/$pkgname
61   install -m644 doc/*.{gif,png,css,html} "$pkgdir"/usr/share/doc/$pkgname
62   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
64   cd ../lua++-$pkgver
65   make \
66     TO_LIB="liblua++.a liblua++.so liblua++.so.$_majorver liblua++.so.$pkgver" \
67     INSTALL_BIN=null INSTALL_INC=null INSTALL_MAN=../null \
68     INSTALL_DATA='cp -d' \
69     INSTALL_TOP="$pkgdir"/usr \
70     install
71   ln -sf /usr/lib/liblua++.so.$pkgver "$pkgdir"/usr/lib/liblua++$_majorver.so
73   install -Dm644 lua++.pc "$pkgdir"/usr/lib/pkgconfig/lua++54.pc
74   ln -sf lua++54.pc "$pkgdir"/usr/lib/pkgconfig/lua++.pc
75   ln -sf lua++54.pc "$pkgdir"/usr/lib/pkgconfig/lua++5.4.pc
76   ln -sf lua++54.pc "$pkgdir"/usr/lib/pkgconfig/lua++-5.4.pc