From 2cc310a5c9f21dcd83860813986d73f1982c0472 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 26 May 2005 21:28:31 +0000 Subject: [PATCH] Add lua package git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1066 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/Config.in | 1 + package/Makefile | 1 + package/lua/Config.in | 119 +++++++++++++++++++++ package/lua/Makefile | 97 +++++++++++++++++ package/lua/ipkg/liblua.control | 8 ++ package/lua/ipkg/lua-examples.control | 9 ++ package/lua/ipkg/lua.control | 9 ++ package/lua/ipkg/luac.control | 9 ++ package/lua/patches/lua-5.0.2-config.patch | 31 ++++++ package/lua/patches/lua-5.0.2-soname.patch | 14 +++ 10 files changed, 298 insertions(+) create mode 100644 package/lua/Config.in create mode 100644 package/lua/Makefile create mode 100644 package/lua/ipkg/liblua.control create mode 100644 package/lua/ipkg/lua-examples.control create mode 100644 package/lua/ipkg/lua.control create mode 100644 package/lua/ipkg/luac.control create mode 100644 package/lua/patches/lua-5.0.2-config.patch create mode 100644 package/lua/patches/lua-5.0.2-soname.patch diff --git a/package/Config.in b/package/Config.in index 9fe2faf3b..333cf0f5c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -12,6 +12,7 @@ source "package/iptables/Config.in" comment "Applications" source "package/haserl/Config.in" source "package/lcd4linux/Config.in" +source "package/lua/Config.in" source "package/microperl/Config.in" source "package/monit/Config.in" source "package/osiris/Config.in" diff --git a/package/Makefile b/package/Makefile index 8a5cd0619..f6cf6dec2 100644 --- a/package/Makefile +++ b/package/Makefile @@ -47,6 +47,7 @@ package-$(BR2_PACKAGE_LIBPTHREAD) += libpthread package-$(BR2_PACKAGE_LIBTOOL) += libtool package-$(BR2_PACKAGE_LIBUSB) += libusb package-$(BR2_PACKAGE_LIGHTTPD) += lighttpd +package-$(BR2_PACKAGE_LUA) += lua package-$(BR2_PACKAGE_LZO) += lzo package-$(BR2_PACKAGE_MARADNS) += maradns package-$(BR2_PACKAGE_MATRIXSSL) += matrixssl diff --git a/package/lua/Config.in b/package/lua/Config.in new file mode 100644 index 000000000..573f2135a --- /dev/null +++ b/package/lua/Config.in @@ -0,0 +1,119 @@ +menu "lua - LUA programming language" + +config BR2_PACKAGE_LUA + bool + default n + depends BR2_PACKAGE_LUA_INTERPRETER || BR2_PACKAGE_LUA_COMPILER || BR2_PACKAGE_LIBLUA + +config BR2_PACKAGE_LUA_INTERPRETER + tristate "lua - LUA programming language interpreter" +# default m if CONFIG_DEVEL + default n + select BR2_PACKAGE_LUA + select BR2_PACKAGE_LIBLUA + help + Lua is a powerful light-weight programming language designed for extending + applications. Lua is also frequently used as a general-purpose, stand-alone + language. Lua is free software. + + Lua combines simple procedural syntax with powerful data description + constructs based on associative arrays and extensible semantics. Lua is + dynamically typed, interpreted from bytecodes, and has automatic memory + management with garbage collection, making it ideal for configuration, + scripting, and rapid prototyping. + + Lua is implemented as a small library of C functions, written in ANSI C, and + compiles unmodified in all known platforms. The implementation goals are + simplicity, efficiency, portability, and low embedding cost. The result is a + fast language engine with small footprint, making it ideal in embedded systems + too. + + http://www.lua.org/ + + This package contains the LUA language interpreter. + + +config BR2_PACKAGE_LUA_COMPILER + tristate "luac - LUA programming language compiler" +# default m if CONFIG_DEVEL + default n + select BR2_PACKAGE_LUA + select BR2_PACKAGE_LIBLUA + help + Lua is a powerful light-weight programming language designed for extending + applications. Lua is also frequently used as a general-purpose, stand-alone + language. Lua is free software. + + Lua combines simple procedural syntax with powerful data description + constructs based on associative arrays and extensible semantics. Lua is + dynamically typed, interpreted from bytecodes, and has automatic memory + management with garbage collection, making it ideal for configuration, + scripting, and rapid prototyping. + + Lua is implemented as a small library of C functions, written in ANSI C, and + compiles unmodified in all known platforms. The implementation goals are + simplicity, efficiency, portability, and low embedding cost. The result is a + fast language engine with small footprint, making it ideal in embedded systems + too. + + http://www.lua.org/ + + This package contains the LUA language compiler. + + +config BR2_PACKAGE_LUA_EXAMPLES + tristate "lua-examples - LUA programming language examples" +# default m if CONFIG_DEVEL + default n + select BR2_PACKAGE_LUA + select BR2_PACKAGE_LUA_INTERPRETER + help + Lua is a powerful light-weight programming language designed for extending + applications. Lua is also frequently used as a general-purpose, stand-alone + language. Lua is free software. + + Lua combines simple procedural syntax with powerful data description + constructs based on associative arrays and extensible semantics. Lua is + dynamically typed, interpreted from bytecodes, and has automatic memory + management with garbage collection, making it ideal for configuration, + scripting, and rapid prototyping. + + Lua is implemented as a small library of C functions, written in ANSI C, and + compiles unmodified in all known platforms. The implementation goals are + simplicity, efficiency, portability, and low embedding cost. The result is a + fast language engine with small footprint, making it ideal in embedded systems + too. + + http://www.lua.org/ + + This package contains LUA language examples. + + +config BR2_PACKAGE_LIBLUA + tristate "liblua - LUA programming language shared libraries" +# default m if CONFIG_DEVEL + default n + select BR2_PACKAGE_LUA + help + Lua is a powerful light-weight programming language designed for extending + applications. Lua is also frequently used as a general-purpose, stand-alone + language. Lua is free software. + + Lua combines simple procedural syntax with powerful data description + constructs based on associative arrays and extensible semantics. Lua is + dynamically typed, interpreted from bytecodes, and has automatic memory + management with garbage collection, making it ideal for configuration, + scripting, and rapid prototyping. + + Lua is implemented as a small library of C functions, written in ANSI C, and + compiles unmodified in all known platforms. The implementation goals are + simplicity, efficiency, portability, and low embedding cost. The result is a + fast language engine with small footprint, making it ideal in embedded systems + too. + + http://www.lua.org/ + + This package contains the LUA shared libraries, needed by other programs. + + +endmenu diff --git a/package/lua/Makefile b/package/lua/Makefile new file mode 100644 index 000000000..cdeba906f --- /dev/null +++ b/package/lua/Makefile @@ -0,0 +1,97 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lua +PKG_VERSION:=5.0.2 +PKG_RELEASE:=1 +PKG_MD5SUM:= dea74646b7e5c621fef7174df83c34b1 + +PKG_SOURCE_URL:=http://www.lua.org/ftp/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,LIBLUA,liblua,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,LUA_INTERPRETER,lua,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,LUA_COMPILER,luac,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,LUA_EXAMPLES,lua-examples,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: + touch $@ + +$(PKG_BUILD_DIR)/.built: + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CROSS)gcc" \ + LD="$(TARGET_CROSS)ld" \ + AR="$(TARGET_CROSS)ar rcu" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + INSTALL_ROOT=/usr \ + MYCFLAGS="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \ + MYLDFLAGS="-L$(STAGING_DIR)/usr/lib" \ + all so + # remove statically linked binaries, so that they will get linked against shlib this time + rm -f $(PKG_BUILD_DIR)/bin/lua{,c} + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CROSS)gcc" \ + LD="$(TARGET_CROSS)ld" \ + AR="$(TARGET_CROSS)ar rcu" \ + RANLIB="$(TARGET_CROSS)ranlib" \ + INSTALL_ROOT=/usr \ + MYCFLAGS="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \ + MYLDFLAGS="-L$(STAGING_DIR)/usr/lib" \ + all + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + INSTALL_ROOT="$(PKG_INSTALL_DIR)/usr" \ + install soinstall + touch $@ + +$(IPKG_LIBLUA): + install -d -m0755 $(IDIR_LIBLUA)/usr/lib + cp -fp $(PKG_INSTALL_DIR)/usr/lib/liblua{,lib}.so.* $(IDIR_LIBLUA)/usr/lib/ + $(RSTRIP) $(IDIR_LIBLUA) + $(IPKG_BUILD) $(IDIR_LIBLUA) $(PACKAGE_DIR) + +$(IPKG_LUA_INTERPRETER): + install -d -m0755 $(IDIR_LUA_INTERPRETER)/usr/bin + cp -fp $(PKG_INSTALL_DIR)/usr/bin/lua $(IDIR_LUA_INTERPRETER)/usr/bin/ + $(RSTRIP) $(IDIR_LUA_INTERPRETER) + $(IPKG_BUILD) $(IDIR_LUA_INTERPRETER) $(PACKAGE_DIR) + +$(IPKG_LUA_COMPILER): + install -d -m0755 $(IDIR_LUA_COMPILER)/usr/bin + cp -fp $(PKG_INSTALL_DIR)/usr/bin/luac $(IDIR_LUA_COMPILER)/usr/bin/ + $(RSTRIP) $(IDIR_LUA_COMPILER) + $(IPKG_BUILD) $(IDIR_LUA_COMPILER) $(PACKAGE_DIR) + +$(IPKG_LUA_EXAMPLES): + install -d -m0755 $(IDIR_LUA_EXAMPLES)/usr/share/lua/examples + install -m0644 $(PKG_BUILD_DIR)/test/*.lua \ + $(IDIR_LUA_EXAMPLES)/usr/share/lua/examples/ + $(RSTRIP) $(IDIR_LUA_EXAMPLES) + $(IPKG_BUILD) $(IDIR_LUA_EXAMPLES) $(PACKAGE_DIR) + +$(STAGING_DIR)/usr/lib/liblua.so: $(PKG_BUILD_DIR)/.built + mkdir -p $(STAGING_DIR)/usr/include + cp -fp $(PKG_INSTALL_DIR)/usr/include/lua{,lib}.h $(STAGING_DIR)/usr/include/ + cp -fp $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(STAGING_DIR)/usr/include/ + mkdir -p $(STAGING_DIR)/usr/lib + cp -fp $(PKG_INSTALL_DIR)/usr/lib/liblua{,lib}.{a,so*} $(STAGING_DIR)/usr/lib/ + touch $@ + +install-dev: $(STAGING_DIR)/usr/lib/liblua.so + +uninstall-dev: + rm -rf \ + $(STAGING_DIR)/usr/include/lua{,lib}.h \ + $(STAGING_DIR)/usr/include/lauxlib.h \ + $(STAGING_DIR)/usr/lib/liblua{,lib}.{a,so*} \ + +compile: install-dev +clean: uninstall-dev diff --git a/package/lua/ipkg/liblua.control b/package/lua/ipkg/liblua.control new file mode 100644 index 000000000..6e727cbee --- /dev/null +++ b/package/lua/ipkg/liblua.control @@ -0,0 +1,8 @@ +Package: liblua +Priority: optional +Section: libs +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/lua/ +Description: LUA programming language shared libraries diff --git a/package/lua/ipkg/lua-examples.control b/package/lua/ipkg/lua-examples.control new file mode 100644 index 000000000..91058058f --- /dev/null +++ b/package/lua/ipkg/lua-examples.control @@ -0,0 +1,9 @@ +Package: lua-examples +Priority: optional +Section: devel +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/lua/ +Description: LUA programming language examples +Depends: lua diff --git a/package/lua/ipkg/lua.control b/package/lua/ipkg/lua.control new file mode 100644 index 000000000..1de945786 --- /dev/null +++ b/package/lua/ipkg/lua.control @@ -0,0 +1,9 @@ +Package: lua +Priority: optional +Section: admin +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/lua/ +Description: LUA programming language interpreter +Depends: liblua diff --git a/package/lua/ipkg/luac.control b/package/lua/ipkg/luac.control new file mode 100644 index 000000000..56e13c733 --- /dev/null +++ b/package/lua/ipkg/luac.control @@ -0,0 +1,9 @@ +Package: luac +Priority: optional +Section: devel +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/lua/ +Description: LUA programming language compiler +Depends: liblua diff --git a/package/lua/patches/lua-5.0.2-config.patch b/package/lua/patches/lua-5.0.2-config.patch new file mode 100644 index 000000000..fa5b0e765 --- /dev/null +++ b/package/lua/patches/lua-5.0.2-config.patch @@ -0,0 +1,31 @@ +diff -ruN lua-5.0.2-orig/config lua-5.0.2-1/config +--- lua-5.0.2-orig/config 2003-04-11 16:00:41.000000000 +0200 ++++ lua-5.0.2-1/config 2005-05-25 11:23:35.000000000 +0200 +@@ -25,15 +25,15 @@ + # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others), + # uncomment the next two lines. + # +-#LOADLIB= -DUSE_DLOPEN=1 +-#DLLIB= -ldl ++LOADLIB= -DUSE_DLOPEN=1 ++DLLIB= -ldl + # + # In Linux with gcc, you should also uncomment the next definition for + # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option + # allows dynamic libraries to link back to the `lua' program, so that they do + # not need the Lua libraries. (Other systems may have an equivalent facility.) + # +-#MYLDFLAGS= -Wl,-E ++MYLDFLAGS= -Wl,-E + # + # On Windows systems. support for dynamic loading is enabled by default. + # To disable this support, uncomment the next line. +@@ -142,7 +142,7 @@ + + # This should work in all Unix systems, but you may want to add options. + # +-STRIP= strip ++STRIP= /bin/true + + # ------------------------------------------------------------------ install + diff --git a/package/lua/patches/lua-5.0.2-soname.patch b/package/lua/patches/lua-5.0.2-soname.patch new file mode 100644 index 000000000..3364ff6ad --- /dev/null +++ b/package/lua/patches/lua-5.0.2-soname.patch @@ -0,0 +1,14 @@ +diff -ruN lua-5.0.2-orig/Makefile lua-5.0.2-1/Makefile +--- lua-5.0.2-orig/Makefile 2004-03-12 02:50:55.000000000 +0100 ++++ lua-5.0.2-1/Makefile 2005-05-25 11:41:44.000000000 +0200 +@@ -38,8 +38,8 @@ + + # shared libraries (for Linux) + so: +- ld -o lib/liblua.so.$V -shared src/*.o +- ld -o lib/liblualib.so.$V -shared src/lib/*.o ++ $(LD) -o lib/liblua.so.$V -shared -soname="liblua.so.$V" src/*.o ++ $(LD) -o lib/liblualib.so.$V -shared -soname="liblualib.so.$V" src/lib/*.o + cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so + + # binaries using shared libraries -- 2.20.1