blob: 06df0690acc5b25c60fe4ca1cdef209a4f6f36ff [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Just-In-Time Compiler for Lua"
2LICENSE = "MIT"
Andrew Geissler9aee5002022-03-30 16:27:02 +00003LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=23d6278200de9b48fd1439f80507cba8"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004HOMEPAGE = "http://luajit.org"
5
Andrew Geissler82c905d2020-04-13 13:39:40 -05006SRC_URI = "git://luajit.org/git/luajit-2.0.git;protocol=http;branch=v2.1 \
7 file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \
8 file://clang.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -05009 file://0001-Use-builtin-for-clear_cache.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050010 "
11
Andrew Geissler97771a32021-03-05 15:23:11 -060012# Set PV to a version tag and date (YYMMDD) associated with SRCREV if it is later.
Andrew Geissler517393d2023-01-13 08:55:19 -060013PV = "2.1.0~beta3-220721"
14SRCREV = "32984282ddae666b3c94cd27538e1c78b49a1877"
Andrew Geisslerd688a012020-09-18 13:36:00 -050015
Andrew Geissler82c905d2020-04-13 13:39:40 -050016S = "${WORKDIR}/git"
17
18inherit pkgconfig binconfig siteinfo
19
20BBCLASSEXTEND = "native"
21
22# http://luajit.org/install.html#cross
23# Host luajit needs to be compiled with the same pointer size
24# If you want to cross-compile to any 32 bit target on an x64 OS,
25# you need to install the multilib development package (e.g.
26# libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
27# (HOST_CC="gcc -m32").
Patrick Williams213cb262021-08-07 19:21:33 -050028BUILD_CC_ARCH:append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30# The lua makefiles expect the TARGET_SYS to be from uname -s
31# Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
32LUA_TARGET_OS = "Unknown"
Patrick Williams213cb262021-08-07 19:21:33 -050033LUA_TARGET_OS:darwin = "Darwin"
34LUA_TARGET_OS:linux = "Linux"
35LUA_TARGET_OS:linux-gnueabi = "Linux"
36LUA_TARGET_OS:mingw32 = "Windows"
Andrew Geissler82c905d2020-04-13 13:39:40 -050037
38# We don't want the lua buildsystem's compiler optimizations, or its
39# stripping, and we don't want it to pick up CFLAGS or LDFLAGS, as those apply
40# to both host and target compiles
41EXTRA_OEMAKE = "\
42 Q= E='@:' \
43 \
44 CCOPT= CCOPT_x86= CFLAGS= LDFLAGS= TARGET_STRIP='@:' \
45 \
46 'TARGET_SYS=${LUA_TARGET_OS}' \
47 \
48 'CC=${CC}' \
49 'TARGET_AR=${AR} rcus' \
50 'TARGET_CFLAGS=${CFLAGS}' \
51 'TARGET_LDFLAGS=${LDFLAGS}' \
52 'TARGET_SHLDFLAGS=${LDFLAGS}' \
53 'HOST_CC=${BUILD_CC}' \
54 'HOST_CFLAGS=${BUILD_CFLAGS}' \
55 \
56 'PREFIX=${prefix}' \
57 'MULTILIB=${baselib}' \
58 'LDCONFIG=:' \
59"
60
61do_compile () {
62 oe_runmake
63}
64
65# There's INSTALL_LIB and INSTALL_SHARE also, but the lua binary hardcodes the
66# '/share' and '/' + LUA_MULTILIB paths, so we don't want to break those
67# expectations.
68EXTRA_OEMAKEINST = "\
69 'DESTDIR=${D}' \
70 'INSTALL_BIN=${D}${bindir}' \
71 'INSTALL_INC=${D}${includedir}/luajit-$(MAJVER).$(MINVER)' \
72 'INSTALL_MAN=${D}${mandir}/man1' \
73"
74do_install () {
75 oe_runmake ${EXTRA_OEMAKEINST} install
76 rmdir ${D}${datadir}/lua/5.* \
77 ${D}${datadir}/lua \
78 ${D}${libdir}/lua/5.* \
79 ${D}${libdir}/lua
80}
81
82PACKAGES += 'luajit-common'
83
84# See the comment for EXTRA_OEMAKEINST. This is needed to ensure the hardcoded
85# paths are packaged regardless of what the libdir and datadir paths are.
Patrick Williams213cb262021-08-07 19:21:33 -050086FILES:${PN} += "${prefix}/${baselib} ${prefix}/share"
87FILES:${PN} += "${libdir}/libluajit-5.1.so.2 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050088 ${libdir}/libluajit-5.1.so.${PV} \
89"
Patrick Williams213cb262021-08-07 19:21:33 -050090FILES:${PN}-dev += "${libdir}/libluajit-5.1.a \
Andrew Geissler82c905d2020-04-13 13:39:40 -050091 ${libdir}/libluajit-5.1.so \
92 ${libdir}/pkgconfig/luajit.pc \
93"
Patrick Williams213cb262021-08-07 19:21:33 -050094FILES:luajit-common = "${datadir}/${BPN}-${PV}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050095
Andrew Geissler9aee5002022-03-30 16:27:02 +000096# mips64/ppc/ppc64/riscv64/riscv32 is not supported in this release
Patrick Williams213cb262021-08-07 19:21:33 -050097COMPATIBLE_HOST:mipsarchn32 = "null"
98COMPATIBLE_HOST:mipsarchn64 = "null"
99COMPATIBLE_HOST:powerpc = "null"
100COMPATIBLE_HOST:powerpc64 = "null"
101COMPATIBLE_HOST:powerpc64le = "null"
102COMPATIBLE_HOST:riscv64 = "null"
103COMPATIBLE_HOST:riscv32 = "null"