Guest User

openwrt-luapuc

a guest
Aug 4th, 2016
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
  2. index cf2d887..51860b7 100644
  3. --- a/package/utils/lua/Makefile
  4. +++ b/package/utils/lua/Makefile
  5. @@ -22,24 +22,28 @@ PKG_BUILD_PARALLEL:=1
  6.  PKG_LICENSE:=MIT
  7.  PKG_LICENSE_FILES:=COPYRIGHT
  8.  
  9. +PKG_CONFIG_DEPENDS:=\
  10. +   CONFIG_LUA_IS_JIT \
  11. +   CONFIG_LUA_IS_PUC
  12. +
  13.  HOST_PATCH_DIR := ./patches-host
  14.  
  15.  include $(INCLUDE_DIR)/package.mk
  16.  include $(INCLUDE_DIR)/host-build.mk
  17.  
  18. +define Package/lua/config
  19. +  source "$(SOURCE)/Config.in"
  20. +endef
  21. +
  22.  define Package/lua/Default
  23.    SUBMENU:=Lua
  24.    SECTION:=lang
  25.    CATEGORY:=Languages
  26. -  TITLE:=Lua programming language
  27. -  URL:=http://www.lua.org/
  28. -  MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  29. +  TITLE:=Lua [virtual]
  30.  endef
  31.  
  32.  define Package/lua/Default/description
  33. - Lua is a powerful light-weight programming language designed for extending
  34. - applications. Lua is also frequently used as a general-purpose, stand-alone
  35. - language. Lua is free software.
  36. +  Virtual Lua package
  37.  endef
  38.  
  39.  define Package/liblua
  40. @@ -48,43 +52,92 @@ $(call Package/lua/Default)
  41.    SECTION:=libs
  42.    CATEGORY:=Libraries
  43.    TITLE+= (libraries)
  44. +  DEPENDS:=+LUA_IS_PUC:libluapuc +LUA_IS_JIT:libluajit
  45.  endef
  46.  
  47.  define Package/liblua/description
  48.  $(call Package/lua/Default/description)
  49. - This package contains the Lua shared libraries, needed by other programs.
  50.  endef
  51.  
  52.  define Package/lua
  53.  $(call Package/lua/Default)
  54. -  DEPENDS:=+liblua
  55. +  DEPENDS:=+liblua +LUA_IS_PUC:luapuc +LUA_IS_JIT:luajit
  56.    TITLE+= (interpreter)
  57.  endef
  58.  
  59.  define Package/lua/description
  60.  $(call Package/lua/Default/description)
  61. - This package contains the Lua language interpreter.
  62.  endef
  63.  
  64.  define Package/luac
  65.  $(call Package/lua/Default)
  66. -  DEPENDS:=+liblua
  67. +  DEPENDS:=+liblua +LUA_IS_PUC:luapucc +LUA_IS_JIT:luajitc
  68.    TITLE+= (compiler)
  69.  endef
  70.  
  71.  define Package/luac/description
  72.  $(call Package/lua/Default/description)
  73. +endef
  74. +
  75. +define Package/luapuc/Default
  76. +  SUBMENU:=Lua
  77. +  SECTION:=lang
  78. +  CATEGORY:=Languages
  79. +  TITLE:=Lua programming language
  80. +  URL:=http://www.lua.org/
  81. +  MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  82. +endef
  83. +
  84. +define Package/luapuc/Default/description
  85. + Lua is a powerful light-weight programming language designed for extending
  86. + applications. Lua is also frequently used as a general-purpose, stand-alone
  87. + language. Lua is free software.
  88. +endef
  89. +
  90. +define Package/libluapuc
  91. +$(call Package/luapuc/Default)
  92. +  SUBMENU:=
  93. +  SECTION:=libs
  94. +  CATEGORY:=Libraries
  95. +  TITLE+= (libraries)
  96. +  DEPENDS:=@LUA_IS_PUC
  97. +endef
  98. +
  99. +define Package/libluapuc/description
  100. +$(call Package/luapuc/Default/description)
  101. + This package contains the Lua shared libraries, needed by other programs.
  102. +endef
  103. +
  104. +define Package/luapuc
  105. +$(call Package/luapuc/Default)
  106. +  DEPENDS:=+libluapuc
  107. +  TITLE+= (interpreter)
  108. +endef
  109. +
  110. +define Package/luapuc/description
  111. +$(call Package/luapuc/Default/description)
  112. + This package contains the Lua language interpreter.
  113. +endef
  114. +
  115. +define Package/luapucc
  116. +$(call Package/luapuc/Default)
  117. +  DEPENDS:=+libluapuc
  118. +  TITLE+= (compiler)
  119. +endef
  120. +
  121. +define Package/luapucc/description
  122. +$(call Package/luapuc/Default/description)
  123.   This package contains the Lua language compiler.
  124.  endef
  125.  
  126.  define Package/lua-examples
  127. -$(call Package/lua/Default)
  128. -  DEPENDS:=lua
  129. +$(call Package/luapuc/Default)
  130. +  DEPENDS:=luapuc
  131.    TITLE+= (examples)
  132.  endef
  133.  
  134.  define Package/lua-examples/description
  135. -$(call Package/lua/Default/description)
  136. +$(call Package/luapuc/Default/description)
  137.   This package contains Lua language examples.
  138.  endef
  139.  
  140. @@ -148,17 +201,17 @@ define Build/InstallDev
  141.     $(CP) $(PKG_BUILD_DIR)/etc/lua.pc $(1)/usr/lib/pkgconfig/
  142.  endef
  143.  
  144. -define Package/liblua/install
  145. +define Package/libluapuc/install
  146.     $(INSTALL_DIR) $(1)/usr/lib
  147.     $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
  148.  endef
  149.  
  150. -define Package/lua/install
  151. +define Package/luapuc/install
  152.     $(INSTALL_DIR) $(1)/usr/bin
  153.     $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
  154.  endef
  155.  
  156. -define Package/luac/install
  157. +define Package/luapucc/install
  158.     $(INSTALL_DIR) $(1)/usr/bin
  159.     $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
  160.  endef
  161. @@ -172,6 +225,11 @@ endef
  162.  $(eval $(call BuildPackage,liblua))
  163.  $(eval $(call BuildPackage,lua))
  164.  $(eval $(call BuildPackage,luac))
  165. -$(eval $(call BuildPackage,lua-examples))
  166. -$(eval $(call HostBuild))
  167.  
  168. +$(eval $(call BuildPackage,libluapuc))
  169. +$(eval $(call BuildPackage,luapuc))
  170. +$(eval $(call BuildPackage,luapucc))
  171. +$(eval $(call BuildPackage,lua-examples))
  172. +ifneq ($(CONFIG_PACKAGE_luapuc),)
  173. +# $(eval $(call HostBuild))
  174. +endif
  175. --- /dev/null   2016-07-20 13:17:04.379838998 +0300
  176. +++ b/package/utils/lua/Config.in   2016-08-04 01:37:21.928454855 +0300
  177. @@ -0,0 +1,21 @@
  178. +# lua interpreter choice
  179. +
  180. +menu "Interpreter"
  181. +   depends on PACKAGE_lua
  182. +
  183. +choice
  184. +   prompt "Type"
  185. +   default LUA_IS_PUC
  186. +
  187. +config LUA_IS_PUC
  188. +   bool "PUC"
  189. +   select PACKAGE_libluapuc
  190. +
  191. +config LUA_IS_JIT
  192. +   bool "JIT"
  193. +   select PACKAGE_libluajit
  194. +   depends on @arm||@mips
  195. +
  196. +endchoice
  197. +
  198. +endmenu
RAW Paste Data