summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-10-10 13:20:25 +0200
committerKhem Raj <raj.khem@gmail.com>2019-10-10 21:58:10 -0700
commit54d9fe3e5f2c60c7da4ec7c019af927f1688c23d (patch)
tree84df268ce350aeb2c42386ddce2b49d10821d1b6 /meta-oe
parent1958ce52829f9efb2e9ba0d29679f6808e2d3631 (diff)
downloadmeta-openembedded-54d9fe3e5f2c60c7da4ec7c019af927f1688c23d.tar.gz
lua: change a hard readline dependency into an optional one
This requires patching the source code, as readline is hardcoded in there. The rationale is to allow disabling the dependency on a gplv3 component (readline) where that license is blacklisted. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch59
-rw-r--r--meta-oe/recipes-devtools/lua/lua_5.3.5.bb9
2 files changed, 65 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch b/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch
new file mode 100644
index 000000000..e76790086
--- /dev/null
+++ b/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch
@@ -0,0 +1,59 @@
1From 601ef636fc4dfb2af3e7fda88d8ea1c1d92affe4 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 2 Oct 2019 17:54:15 +0200
4Subject: [PATCH] Allow building lua without readline on Linux
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 Makefile | 2 +-
10 src/Makefile | 3 +++
11 src/luaconf.h | 5 +++++
12 3 files changed, 9 insertions(+), 1 deletion(-)
13
14diff --git a/Makefile b/Makefile
15index 119110d..9f6df45 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -36,7 +36,7 @@ RM= rm -f
19 # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
20
21 # Convenience platforms targets.
22-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
23+PLATS= aix bsd c89 freebsd generic linux linux-no-readline macosx mingw posix solaris
24
25 # What to install.
26 TO_BIN= lua luac
27diff --git a/src/Makefile b/src/Makefile
28index 64c78f7..5c0428a 100644
29--- a/src/Makefile
30+++ b/src/Makefile
31@@ -109,6 +109,9 @@ generic: $(ALL)
32 linux:
33 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
34
35+linux-no-readline:
36+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX_NO_READLINE" SYSLIBS="-Wl,-E -ldl"
37+
38 macosx:
39 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
40
41diff --git a/src/luaconf.h b/src/luaconf.h
42index 9eeeea6..d71ca25 100644
43--- a/src/luaconf.h
44+++ b/src/luaconf.h
45@@ -64,6 +64,11 @@
46 #define LUA_USE_READLINE /* needs some extra libraries */
47 #endif
48
49+#if defined(LUA_USE_LINUX_NO_READLINE)
50+#define LUA_USE_POSIX
51+#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
52+#endif
53+
54
55 #if defined(LUA_USE_MACOSX)
56 #define LUA_USE_POSIX
57--
582.17.1
59
diff --git a/meta-oe/recipes-devtools/lua/lua_5.3.5.bb b/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
index 265e2519e..ae41e627f 100644
--- a/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
+++ b/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
@@ -4,9 +4,9 @@ LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee" 4LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee"
5HOMEPAGE = "http://www.lua.org/" 5HOMEPAGE = "http://www.lua.org/"
6 6
7DEPENDS = "readline"
8SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ 7SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
9 file://lua.pc.in \ 8 file://lua.pc.in \
9 file://0001-Allow-building-lua-without-readline-on-Linux.patch \
10 " 10 "
11 11
12# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release. 12# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release.
@@ -24,18 +24,21 @@ SRC_URI[tarballtest.sha256sum] = "b80771238271c72565e5a1183292ef31bd7166414cd0d4
24 24
25inherit pkgconfig binconfig ptest 25inherit pkgconfig binconfig ptest
26 26
27PACKAGECONFIG ??= "readline"
28PACKAGECONFIG[readline] = ",,readline"
29
27UCLIBC_PATCHES += "file://uclibc-pthread.patch" 30UCLIBC_PATCHES += "file://uclibc-pthread.patch"
28SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}" 31SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}"
29 32
30TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" 33TARGET_CC_ARCH += " -fPIC ${LDFLAGS}"
31EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -DLUA_USE_LINUX -fPIC' MYLDFLAGS='${LDFLAGS}'" 34EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}'"
32 35
33do_configure_prepend() { 36do_configure_prepend() {
34 sed -i -e s:/usr/local:${prefix}:g src/luaconf.h 37 sed -i -e s:/usr/local:${prefix}:g src/luaconf.h
35} 38}
36 39
37do_compile () { 40do_compile () {
38 oe_runmake linux 41 oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux', 'linux-no-readline', d)}
39} 42}
40 43
41do_install () { 44do_install () {