recipes: lua/luarocks: Adjust build recipe, set for latest version
[dragora.git] / recipes / lua / luarocks / recipe
blobaf6b54296b69260207b6101de06f7b7dd9150c45
1 # Build recipe for luarocks.
3 # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
4 # Copyright (c) 2020 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 program=luarocks
19 version=3.3.1
20 release=1
22 # To define release of Lua
23 lua_version=5.3
25 # Set 'outdir' for a nice and well-organized output directory
26 outdir="${outdir}/${arch}/lua"
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=http://luarocks.org/releases/${tarname}
33 description="
34 The package manager for Lua modules.
36 Luarocks allows you to create and install Lua modules
37 as self-contained packages called rocks.
40 homepage=http://luarocks.org/
41 license="MIT License"
43 # Source documentation
44 docs="CHANGELOG.md COPYING CODE_OF_CONDUCT.md README.md"
45 docsdir="${docdir}/${program}-${version}"
47 # Limit parallel jobs for this build
48 jobs=1
50 build()
52     set -e
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     ./configure \
62      --prefix=/usr \
63      --with-lua=/usr \
64      --with-lua-lib=/usr/lib${libSuffix} \
65      --sysconfdir=/etc \
66      --lua-version=${lua_version}
68     make -j${jobs}
69     make -j${jobs} DESTDIR="$destdir" install
70     mkdir -p "${destdir}/usr/lib${libSuffix}/luarocks/rocks-${lua_version}"
72     # To manage (dot) new files
73     touch "${destdir}/etc/luarocks/.graft-config"
75     # Copy documentation
76     mkdir -p "${destdir}${docsdir}"
77     cp -p $docs "${destdir}${docsdir}"