Skip to contentSkip to conversation

luajit: point /usr/bin/lua to luajit if lua not selected

PATCH New Danomi Manchego 2 participants 2 messages Nov 30, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 luajit: point /usr/bin/lua to luajit if lua not selected

The luajit package is a provider of a lua interpreter, but does not install a lua executable. This is fine for scripts that explicitly invoke luajit, but not so good for scripts that just need a lua interpreter and call lua. This mod creates a lua symlink so that the non-jit-specific scripts will still work.

---

Changes v1 -> v2:
- Remove BR2_PACKAGE_LUA conditional, as suggested by Yann Morin. (Diverges from python3 precedent, but saves a test.)
- Drop some detail from the commit log that might be misinterpreted.

---
 package/luajit/luajit.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/luajit/luajit.mk +5 -0
index 2c1f8f4..85e9f15 100644
@@ -64,6 +64,11 @@ define LUAJIT_INSTALL_TARGET_CMDS
 	$(MAKE) PREFIX="/usr" DESTDIR="$(TARGET_DIR)" LDCONFIG=true -C $(@D) install
 endef
 
+define LUAJIT_INSTALL_SYMLINK
+	ln -fs luajit $(TARGET_DIR)/usr/bin/lua
+endef
+LUAJIT_POST_INSTALL_TARGET_HOOKS += LUAJIT_INSTALL_SYMLINK
+
 define HOST_LUAJIT_BUILD_CMDS
 	$(MAKE) PREFIX="/usr" BUILDMODE=static -C $(@D) amalg
 endef
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 luajit: point /usr/bin/lua to luajit if lua not selected

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Danomi" == Danomi Manchego <[email protected]> writes:

The luajit package is a provider of a lua interpreter, but does not install a lua executable. This is fine for scripts that explicitly invoke luajit, but not so good for scripts that just need a lua interpreter and call lua. This mod creates a lua symlink so that the non-jit-specific scripts will still work.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard