blob: d3461b06de7e63512ca19fed1715071e24e4dfc6 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001DESCRIPTION = "Lua is a powerful light-weight programming language designed \
2for extending applications."
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee"
5HOMEPAGE = "http://www.lua.org/"
6
Brad Bishopc342db32019-05-15 21:57:59 -04007SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
8 file://lua.pc.in \
Brad Bishop00ab2372019-10-14 11:06:18 -04009 file://0001-Allow-building-lua-without-readline-on-Linux.patch \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050010 file://CVE-2020-15888.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040011 "
12
13# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release.
14PV_testsuites = "5.3.4"
15
16SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
17 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest \
18 file://run-ptest \
19 ', '', d)}"
20
21SRC_URI[tarballsrc.md5sum] = "4f4b4f323fd3514a68e0ab3da8ce3455"
22SRC_URI[tarballsrc.sha256sum] = "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"
23SRC_URI[tarballtest.md5sum] = "b14fe3748c1cb2d74e3acd1943629ba3"
24SRC_URI[tarballtest.sha256sum] = "b80771238271c72565e5a1183292ef31bd7166414cd0d43a8eb79845fa7f599f"
25
26inherit pkgconfig binconfig ptest
27
Brad Bishop00ab2372019-10-14 11:06:18 -040028PACKAGECONFIG ??= "readline"
29PACKAGECONFIG[readline] = ",,readline"
30
Brad Bishopc342db32019-05-15 21:57:59 -040031UCLIBC_PATCHES += "file://uclibc-pthread.patch"
32SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}"
33
34TARGET_CC_ARCH += " -fPIC ${LDFLAGS}"
Brad Bishop00ab2372019-10-14 11:06:18 -040035EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}'"
Brad Bishopc342db32019-05-15 21:57:59 -040036
37do_configure_prepend() {
38 sed -i -e s:/usr/local:${prefix}:g src/luaconf.h
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 sed -i -e s:lib/lua/:${baselib}/lua/:g src/luaconf.h
Brad Bishopc342db32019-05-15 21:57:59 -040040}
41
42do_compile () {
Brad Bishop00ab2372019-10-14 11:06:18 -040043 oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux', 'linux-no-readline', d)}
Brad Bishopc342db32019-05-15 21:57:59 -040044}
45
46do_install () {
47 oe_runmake \
48 'INSTALL_TOP=${D}${prefix}' \
49 'INSTALL_BIN=${D}${bindir}' \
50 'INSTALL_INC=${D}${includedir}/' \
51 'INSTALL_MAN=${D}${mandir}/man1' \
52 'INSTALL_SHARE=${D}${datadir}/lua' \
53 'INSTALL_LIB=${D}${libdir}' \
54 'INSTALL_CMOD=${D}${libdir}/lua/5.3' \
55 install
56 install -d ${D}${libdir}/pkgconfig
57
58 sed -e s/@VERSION@/${PV}/ ${WORKDIR}/lua.pc.in > ${WORKDIR}/lua.pc
59 install -m 0644 ${WORKDIR}/lua.pc ${D}${libdir}/pkgconfig/
60 rmdir ${D}${datadir}/lua/5.3
61 rmdir ${D}${datadir}/lua
62}
63
64do_install_ptest () {
65 cp -R --no-dereference --preserve=mode,links -v ${WORKDIR}/lua-${PV_testsuites}-tests ${D}${PTEST_PATH}/test
66}
67
68BBCLASSEXTEND = "native nativesdk"