-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
luastruct: openwrt packaging of luastruct
The upstream package has no top level directory in the tarball, and needs patches to properly allow specifying the C compiler and include paths, but otherwise straightforward.
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# | ||
# Copyright (C) 2009-2013 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=luastruct | ||
PKG_VERSION:=0.2 | ||
PKG_RELEASE:=1 | ||
|
||
PKG_SOURCE:=struct-$(PKG_VERSION).tar.gz | ||
PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/struct | ||
PKG_MD5_SUM:=99384bf1f54457ec9f796ad0b539d19c | ||
# Workaround original tarball not having a parent directory | ||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) | ||
PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) -xf - | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/$(PKG_NAME) | ||
SUBMENU:=Lua | ||
SECTION:=lang | ||
CATEGORY:=Languages | ||
TITLE:=LuaStruct | ||
URL:=http://www.inf.puc-rio.br/~roberto/struct/ | ||
DEPENDS:=+lua | ||
MAINTAINER:=Karl Palsson <karlp@remake.is> | ||
endef | ||
|
||
define Package/$(PKG_NAME)/description | ||
This library offers basic facilities to convert Lua values to and from | ||
C structs. Its main functions are struct.pack, which packs multiple Lua | ||
values into a struct-like string; and struct.unpack, which unpacks | ||
multiple Lua values from a given struct-like string. | ||
endef | ||
|
||
define Build/Configure | ||
endef | ||
|
||
define Build/Compile | ||
$(MAKE) -C $(PKG_BUILD_DIR)/ \ | ||
LUADIR="$(STAGING_DIR)/usr/include/" \ | ||
CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \ | ||
LD="$(TARGET_CROSS)ld -shared" | ||
endef | ||
|
||
|
||
define Package/$(PKG_NAME)/install | ||
$(INSTALL_DIR) $(1)/usr/lib/lua | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/struct.so $(1)/usr/lib/lua | ||
endef | ||
|
||
$(eval $(call BuildPackage,$(PKG_NAME))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- a/makefile 2012-07-04 15:55:36.000000000 +0000 | ||
+++ b/makefile 2014-03-10 18:47:03.694896629 +0000 | ||
@@ -1,6 +1,5 @@ | ||
# point it to where the compiler can find the Lua header files (lua.h, etc.) | ||
# LUADIR = ../lua | ||
-LUADIR = /usr/include/lua5.1/ | ||
|
||
# define your own "large" integer type; not defining a proper type | ||
# will default to 'long', which may cause problems with 'size_t' | ||
@@ -17,7 +16,6 @@ | ||
-Wwrite-strings | ||
|
||
CFLAGS = -D_POSIX_SOURCE $(CWARNS) $(INTTYPE) -O2 -I$(LUADIR) | ||
-CC = gcc | ||
|
||
struct.so: struct.c makefile | ||
$(CC) $(CFLAGS) -shared -fpic -o struct.so struct.c |