xref: /openbmc/openbmc/poky/meta/recipes-devtools/lua/lua_5.4.7.bb (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1*8460358cSPatrick WilliamsSUMMARY = "Lua is a powerful light-weight programming language designed \
2*8460358cSPatrick Williamsfor extending applications."
3*8460358cSPatrick WilliamsLICENSE = "MIT"
4*8460358cSPatrick WilliamsLIC_FILES_CHKSUM = "file://doc/readme.html;beginline=305;endline=326;md5=344ad98880a7ee9ff6e1498a519a7c76"
5*8460358cSPatrick WilliamsHOMEPAGE = "http://www.lua.org/"
6*8460358cSPatrick Williams
7*8460358cSPatrick WilliamsSRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
8*8460358cSPatrick Williams           file://lua.pc.in \
9*8460358cSPatrick Williams           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest file://run-ptest ', '', d)} \
10*8460358cSPatrick Williams           "
11*8460358cSPatrick Williams
12*8460358cSPatrick Williams# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release.
13*8460358cSPatrick WilliamsPV_testsuites = "${PV}"
14*8460358cSPatrick Williams
15*8460358cSPatrick WilliamsSRC_URI[tarballsrc.sha256sum] = "9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30"
16*8460358cSPatrick WilliamsSRC_URI[tarballtest.sha256sum] = "8a4898ffe4c7613c8009327a0722db7a41ef861d526c77c5b46114e59ebf811e"
17*8460358cSPatrick Williams
18*8460358cSPatrick Williamsinherit pkgconfig binconfig ptest
19*8460358cSPatrick Williams
20*8460358cSPatrick WilliamsPACKAGECONFIG ??= "readline"
21*8460358cSPatrick WilliamsPACKAGECONFIG[readline] = ",,readline"
22*8460358cSPatrick Williams
23*8460358cSPatrick WilliamsTARGET_CC_ARCH += " -fPIC ${LDFLAGS}"
24*8460358cSPatrick WilliamsEXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}' 'AR=ar rcD' 'RANLIB=ranlib -D'"
25*8460358cSPatrick Williams
26*8460358cSPatrick Williamsdo_configure:prepend() {
27*8460358cSPatrick Williams    sed -i -e s:/usr/local:${prefix}:g src/luaconf.h
28*8460358cSPatrick Williams    sed -i -e s:lib/lua/:${baselib}/lua/:g src/luaconf.h
29*8460358cSPatrick Williams}
30*8460358cSPatrick Williams
31*8460358cSPatrick Williamsdo_compile () {
32*8460358cSPatrick Williams    oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux-readline', 'linux', d)}
33*8460358cSPatrick Williams}
34*8460358cSPatrick Williams
35*8460358cSPatrick Williamsdo_install () {
36*8460358cSPatrick Williams    oe_runmake \
37*8460358cSPatrick Williams        'INSTALL_TOP=${D}${prefix}' \
38*8460358cSPatrick Williams        'INSTALL_BIN=${D}${bindir}' \
39*8460358cSPatrick Williams        'INSTALL_INC=${D}${includedir}/' \
40*8460358cSPatrick Williams        'INSTALL_MAN=${D}${mandir}/man1' \
41*8460358cSPatrick Williams        'INSTALL_SHARE=${D}${datadir}/lua' \
42*8460358cSPatrick Williams        'INSTALL_LIB=${D}${libdir}' \
43*8460358cSPatrick Williams        'INSTALL_CMOD=${D}${libdir}/lua/5.4' \
44*8460358cSPatrick Williams        install
45*8460358cSPatrick Williams    install -d ${D}${libdir}/pkgconfig
46*8460358cSPatrick Williams
47*8460358cSPatrick Williams    sed -e s/@VERSION@/${PV}/ -e s#@LIBDIR@#${libdir}# -e s#@INCLUDEDIR@#${includedir}# ${UNPACKDIR}/lua.pc.in > ${S}/lua.pc
48*8460358cSPatrick Williams    install -m 0644 ${S}/lua.pc ${D}${libdir}/pkgconfig/
49*8460358cSPatrick Williams    rmdir ${D}${datadir}/lua/5.4
50*8460358cSPatrick Williams    rmdir ${D}${datadir}/lua
51*8460358cSPatrick Williams}
52*8460358cSPatrick Williams
53*8460358cSPatrick Williamsdo_install_ptest () {
54*8460358cSPatrick Williams        cp -R --no-dereference --preserve=mode,links -v ${UNPACKDIR}/lua-${PV_testsuites}-tests ${D}${PTEST_PATH}/test
55*8460358cSPatrick Williams}
56*8460358cSPatrick Williams
57*8460358cSPatrick Williamsdo_install_ptest:append:libc-musl () {
58*8460358cSPatrick Williams        # locale tests does not work on musl, due to limited locale implementation
59*8460358cSPatrick Williams        # https://wiki.musl-libc.org/open-issues.html#Locale-limitations
60*8460358cSPatrick Williams        sed -i -e 's|os.setlocale("pt_BR") or os.setlocale("ptb")|false|g' ${D}${PTEST_PATH}/test/literals.lua
61*8460358cSPatrick Williams}
62*8460358cSPatrick Williams
63*8460358cSPatrick WilliamsBBCLASSEXTEND = "native nativesdk"
64*8460358cSPatrick Williams
65*8460358cSPatrick Williamsinherit multilib_script
66*8460358cSPatrick WilliamsMULTILIB_SCRIPTS = "${PN}-dev:${includedir}/luaconf.h"
67