luainterpreter: create virtual package
authorFrancois Perrad <fperrad@gmail.com>
Sat, 11 Jan 2014 15:42:03 +0000 (16:42 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 13 Jan 2014 22:15:33 +0000 (23:15 +0100)
This patch introduces the luainterpreter virtual package, which
is provided either by 'lua' or by 'lua-jit'.

Packages that require a Lua interpreter can then depend on
BR2_PACKAGE_LUAINTERPRETER (in their Config.in) and luainterpreter
(in their .mk).

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[yann.morin.1998@free.fr: switch to package-defined providers,
                          apply Thomas' comments]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
27 files changed:
package/Config.in
package/lbase64/Config.in
package/lbase64/lbase64.mk
package/lua-ev/Config.in
package/lua-ev/lua-ev.mk
package/lua-msgpack-native/Config.in
package/lua-msgpack-native/lua-msgpack-native.mk
package/lua/Config.in
package/luacjson/Config.in
package/luacjson/luacjson.mk
package/luaexpat/Config.in
package/luaexpat/luaexpat.mk
package/luafilesystem/Config.in
package/luafilesystem/luafilesystem.mk
package/luainterpreter/Config.in [new file with mode: 0644]
package/luainterpreter/luainterpreter.mk [new file with mode: 0644]
package/luajit/Config.in
package/luaposix/Config.in
package/luaposix/luaposix.mk
package/luasec/Config.in
package/luasec/luasec.mk
package/luasocket/Config.in
package/luasocket/luasocket.mk
package/luasql/Config.in
package/luasql/luasql.mk
package/rings/Config.in
package/rings/rings.mk

index 40f8047d4a227727d085e4f1cddf3f5502430990..39b0801f87e04ef558d872072b0575f6329467fc 100644 (file)
@@ -360,8 +360,9 @@ source "package/haserl/Config.in"
 source "package/jamvm/Config.in"
 source "package/jimtcl/Config.in"
 source "package/lua/Config.in"
+source "package/luainterpreter/Config.in"
 source "package/luajit/Config.in"
-if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT
+if BR2_PACKAGE_HAS_LUA_INTERPRETER
 menu "Lua libraries/modules"
 source "package/cgilua/Config.in"
 source "package/copas/Config.in"
index bd8503a168ed7253204dc414973fab3ffd54adfa..ca9dd5dac2e7b562a45eb744829489d740f6bb90 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LBASE64
        bool "lbase64"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          A base64 library for Lua
 
index 8e360c872e1b34a81d355a7249be0836909240a3..605dcf75b304efa9e9af5a5b84d057f338b1c80f 100644 (file)
@@ -9,7 +9,7 @@ LBASE64_SITE = http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1
 LBASE64_SOURCE = lbase64.tar.gz
 LBASE64_LICENSE = Public domain
 LBASE64_LICENSE_FILES = README
-LBASE64_DEPENDENCIES = lua
+LBASE64_DEPENDENCIES = luainterpreter
 
 define LBASE64_BUILD_CMDS
        $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
index 4f704ad54e77cadc88bfca02b7f1e9dd80729c1f..28da114a40b397be4c6ab6500f3b32cbb168737a 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUA_EV
        bool "lua-ev"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        select BR2_PACKAGE_LIBEV
        depends on !(BR2_avr32 || BR2_bfin) # libev
        help
index 173cf0b0aec61441c2c6a22f204e3e019faee3ed..298bcf2c38d9b15b4a6148b0bd79265591a823bb 100644 (file)
@@ -6,7 +6,7 @@
 
 LUA_EV_VERSION = 458165bdfe0c6eadc788813925f11a0e6a823845
 LUA_EV_SITE = $(call github,brimworks,lua-ev,$(LUA_EV_VERSION))
-LUA_EV_DEPENDENCIES = lua libev
+LUA_EV_DEPENDENCIES = luainterpreter libev
 LUA_EV_LICENSE = MIT
 LUA_EV_LICENSE_FILES = README
 LUA_EV_CONF_OPT = -DINSTALL_CMOD="/usr/lib/lua"
index 8894ee5352110f3a1c52e771b263caab6f90522d..1014298c78224443875c50e5473ddb3b5bdb750c 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUA_MSGPACK_NATIVE
        bool "lua-msgpack-native"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          This is a native, C language implementation of msgpack
          (http://msgpack.org) library/protocol for Lua language
index 496f8a815c22c2cea0d5ce337de0cdddbc8330c5..2c1dede5bca21c533b8757139b72e603572521b1 100644 (file)
@@ -6,7 +6,7 @@
 
 LUA_MSGPACK_NATIVE_VERSION = 41cce91ab6b54e4426c6d626a0ac41a02ec2096d
 LUA_MSGPACK_NATIVE_SITE = $(call github,kengonakajima,lua-msgpack-native,$(LUA_MSGPACK_NATIVE_VERSION))
-LUA_MSGPACK_NATIVE_DEPENDENCIES = lua
+LUA_MSGPACK_NATIVE_DEPENDENCIES = luainterpreter
 LUA_MSGPACK_NATIVE_LICENSE = Apache-2.0
 LUA_MSGPACK_NATIVE_LICENSE_FILES = LICENSE.txt
 
index 8c05d081e4670be553f9289800b0905a918143c1..b96ef0e92e51de0747da6667315afb973c411b6a 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUA
        bool "lua"
+       select BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          Lua is a powerful, fast, light-weight, embeddable scripting language.
 
@@ -7,6 +8,9 @@ config BR2_PACKAGE_LUA
 
 if BR2_PACKAGE_LUA
 
+config BR2_PACKAGE_PROVIDES_LUA_INTERPRETER
+       default "lua"
+
 choice
        prompt "Lua Interpreter command-line editing"
        default BR2_PACKAGE_LUA_INTERPRETER_EDITING_NONE
index 8a5624f759f1d942e156882f18c0d772d2025688..d3665c0122b42df2a5740cd0a5e17a6c4429abe2 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUACJSON
        bool "luacjson"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          The Lua CJSON module provides JSON support for Lua. It features:
          - Fast, standards compliant encoding/parsing routines
index 1ebb588ac94cd111c1f07f88cc12e3bbe52989a2..fcb8a9a75a9a86606d7c90326709c7531cd7e68b 100644 (file)
@@ -7,7 +7,7 @@
 LUACJSON_VERSION       = 2.1.0
 LUACJSON_SOURCE        = lua-cjson-$(LUACJSON_VERSION).tar.gz
 LUACJSON_SITE          = http://www.kyne.com.au/~mark/software/download
-LUACJSON_DEPENDENCIES  = lua
+LUACJSON_DEPENDENCIES  = luainterpreter
 LUACJSON_LICENSE       = MIT
 LUACJSON_LICENSE_FILES = LICENSE
 
index 186c5c917bc4b8c40ffcea0bc74d412255baa463..f8db318e828832974e36218d480f6947a38616ec 100644 (file)
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_LUAEXPAT
        bool "luaexpat"
        select BR2_PACKAGE_EXPAT
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          LuaExpat is a SAX XML parser based on the Expat library.
 
index 0d73d28f63a04a39664bf891ab84fa1316e8051d..65d4355d3dee20b271839aee46ef350b8408c830 100644 (file)
@@ -6,7 +6,7 @@
 
 LUAEXPAT_VERSION      = 1.2.0
 LUAEXPAT_SITE         = http://matthewwild.co.uk/projects/luaexpat
-LUAEXPAT_DEPENDENCIES = lua expat
+LUAEXPAT_DEPENDENCIES = luainterpreter expat
 LUAEXPAT_LICENSE      = MIT
 
 
index 7c130f8d3baeef88945bb705477181a6f262879f..489ebf359a152c6275e44ed1949355b692de06ca 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUAFILESYSTEM
        bool "luafilesystem"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          LuaFileSystem offers a portable way to access
          the underlying directory structure and file attributes.
index c75d7a7cc782e496e34546bac75111c36938f2b3..c928c6ee52179d9eddbc4c23bdd3fd414f8cc5d9 100644 (file)
@@ -6,7 +6,7 @@
 
 LUAFILESYSTEM_VERSION = 1.6.2
 LUAFILESYSTEM_SITE = http://github.com/downloads/keplerproject/luafilesystem
-LUAFILESYSTEM_DEPENDENCIES = lua
+LUAFILESYSTEM_DEPENDENCIES = luainterpreter
 LUAFILESYSTEM_LICENSE = MIT
 
 ifeq ($(BR2_LARGEFILE),y)
diff --git a/package/luainterpreter/Config.in b/package/luainterpreter/Config.in
new file mode 100644 (file)
index 0000000..1562145
--- /dev/null
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LUA_INTERPRETER
+       bool
+
+config BR2_PACKAGE_PROVIDES_LUA_INTERPRETER
+       string
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
diff --git a/package/luainterpreter/luainterpreter.mk b/package/luainterpreter/luainterpreter.mk
new file mode 100644 (file)
index 0000000..04d63d4
--- /dev/null
@@ -0,0 +1,10 @@
+#############################################################
+#
+# luainterpreter
+#
+#############################################################
+
+LUAINTERPRETER_SOURCE =
+LUAINTERPRETER_DEPENDENCIES = $(call qstrip,$(BR2_PACKAGE_PROVIDES_LUA_INTERPRETER))
+
+$(eval $(generic-package))
index 23b265049372feb01eb1960c62f92d79be1afa9c..e0bfbf5505faa9e94fa6af8834fb62862f902a5f 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUAJIT
        bool "luajit"
+       select BR2_PACKAGE_HAS_LUA_INTERPRETER
        # Luajit is only available for some target architectures, and
        # has some complexity wrt 32/64. See luajit.mk for details.
        depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64') || BR2_powerpc || BR2_arm || BR2_armeb
@@ -10,3 +11,10 @@ config BR2_PACKAGE_LUAJIT
          deployed as a drop-in replacement.
 
          http://luajit.org/
+
+if BR2_PACKAGE_LUAJIT
+
+config BR2_PACKAGE_PROVIDES_LUA_INTERPRETER
+       default "luajit"
+
+endif
index 598bf111af76da2bf6503f27054c24b74bae04c8..cad6fe976a90c00a443f5150150524b804f67dc2 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUAPOSIX
        bool "luaposix"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        select BR2_PACKAGE_LUABITOP if BR2_PACKAGE_LUA
        # LuaBitOp is already included in LuaJIT
        help
index cbcdf32590a897e8500e88a3858d7407de7ae2ef..b398c8c98e1b170e04def0d59a6fb9928c8dead2 100644 (file)
@@ -9,7 +9,7 @@ LUAPOSIX_SITE = https://github.com/luaposix/luaposix/archive
 LUAPOSIX_SOURCE = release-v$(LUAPOSIX_VERSION).tar.gz
 LUAPOSIX_LICENSE = MIT
 LUAPOSIX_LICENSE_FILES = COPYING
-LUAPOSIX_DEPENDENCIES = lua host-lua
+LUAPOSIX_DEPENDENCIES = luainterpreter host-lua
 LUAPOSIX_CONF_OPT = --libdir="/usr/lib/lua" --datarootdir="/usr/share/lua"
 
 ifeq ($(BR2_PACKAGE_NCURSES),y)
index 2d303c184beb2124afc49ee67f4b7e6f4fb33143..ed55df73ae866e8ee11881276bcf38f8d82b3179 100644 (file)
@@ -2,6 +2,7 @@ config BR2_PACKAGE_LUASEC
        bool "luasec"
        select BR2_PACKAGE_OPENSSL
        select BR2_PACKAGE_LUASOCKET
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          LuaSec is a binding for OpenSSL library to provide TLS/SSL
          communication.
index 9a99034cb739fd1c81febc10797e3caab94066ea..d89f61dbb3c64c61ed6cfbe93a546cf1da30e83b 100644 (file)
@@ -8,7 +8,7 @@ LUASEC_VERSION = 0.4.1
 LUASEC_SITE = http://www.inf.puc-rio.br/~brunoos/luasec/download/
 LUASEC_LICENSE = MIT
 LUASEC_LICENSE_FILES = LICENSE
-LUASEC_DEPENDENCIES = lua openssl
+LUASEC_DEPENDENCIES = luainterpreter openssl
 
 define LUASEC_BUILD_CMDS
        $(MAKE) -C $(@D) CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
index 45263030f36f49e2cfaf21c79132c2a39b1faedf..619d649677917ddcb1967a0f793bc80221c48d00 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUASOCKET
        bool "luasocket"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          LuaSocket is the most comprehensive networking support library
          for the Lua language.
index 4b01a3e3f12371b4130eb715ba3fd8c3bed35b2b..6a2d4c8b6b6cc161eeac88789b69849b183f9fa6 100644 (file)
@@ -6,7 +6,7 @@
 
 LUASOCKET_VERSION = 2.0.2
 LUASOCKET_SITE = http://luaforge.net/frs/download.php/2664
-LUASOCKET_DEPENDENCIES = lua
+LUASOCKET_DEPENDENCIES = luainterpreter
 LUASOCKET_LICENSE = MIT
 LUASOCKET_LICENSE_FILES = LICENSE
 
index 4dd011a2aac764b7f6fb30841c9e128abc84bc80..96e04fb82330961ed3969c7537f31da01ddf47da 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LUASQL
        bool "luasql"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          LuaSQL is a simple interface from Lua to a DBMS.
 
index 44ad90d83736dc0805e5d1f1ba83a99b145bf048..62d0cf80fc09e13d67ed41b50722f0d1b5cbae13 100644 (file)
@@ -8,7 +8,7 @@ LUASQL_VERSION = v2.3.0
 LUASQL_SITE = $(call github,keplerproject,luasql,$(LUASQL_VERSION))
 LUASQL_LICENSE = MIT
 LUASQL_LICENSE_FILES = README
-LUASQL_DEPENDENCIES = lua
+LUASQL_DEPENDENCIES = luainterpreter
 
 LUASQL_MAKE_FLAGS = \
        CC="$(TARGET_CC)" \
index d1f1efe55338e7e54b518a5be421e39f1eaa12f5..b1d41f391a3874e8de32f9f51bdbfb8c579b7406 100644 (file)
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_RINGS
        bool "rings"
+       depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
        help
          Provides a way to create new Lua states from within Lua.
 
index a483b6214dc1ba453afb56846b96b731b15fc203..47d25b6781e78fdc1c8daaeecb7258ac88cda7d9 100644 (file)
@@ -6,7 +6,7 @@
 
 RINGS_VERSION = 1.2.3
 RINGS_SITE = http://github.com/downloads/keplerproject/rings
-RINGS_DEPENDENCIES = lua
+RINGS_DEPENDENCIES = luainterpreter
 RINGS_LICENSE = MIT
 
 define RINGS_BUILD_CMDS