1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

Add lua-iconv, is a lua binding to iconv(3).

This commit is contained in:
Vanilla I. Shu 2009-12-05 16:33:14 +00:00
parent 6d8fe538c9
commit 09e4071352
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=245237
7 changed files with 82 additions and 0 deletions

View File

@ -35,6 +35,7 @@
SUBDIR += libiconv
SUBDIR += libticonv
SUBDIR += libutf-8
SUBDIR += lua-iconv
SUBDIR += mimelib
SUBDIR += mmencode
SUBDIR += mpack

View File

@ -0,0 +1,29 @@
# New ports collection makefile for: lua-iconv
# Date created: 04 Dec 2009
# Whom: vanilla@
#
# $FreeBSD$
#
PORTNAME= iconv
PORTVERSION= 6
CATEGORIES= converters
MASTER_SITES= http://luaforge.net/frs/download.php/4181/
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
MAINTAINER= vanilla@FreeBSD.org
COMMENT= Iconv binding for Lua 5
WRKSRC= ${WRKDIR}/lua-${PORTNAME}-${PORTVERSION}
USE_LUA?= 5.1
USE_GNOME= pkgconfig
PLIST_FILES= %%LUA_MODLIBDIR%%/iconv.so
post-patch:
@${REINPLACE_CMD} -e 's|%%INCDIR%%|-I${PREFIX}/include|;s|%%LIBDIR%%|-L${PREFIX}/lib|' ${WRKSRC}/Makefile
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/iconv.so ${LUA_MODLIBDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (iconv-6.tar.gz) = 2cec334c5786d7c420a53003d6cb93d4
SHA256 (iconv-6.tar.gz) = e3ca46cc4975d9dc496b282db217723d1b0b5277e6938be8797ea6e0ac4f77f4
SIZE (iconv-6.tar.gz) = 6101

View File

@ -0,0 +1,14 @@
--- Makefile.orig 2009-12-04 12:50:49.000000000 +0800
+++ Makefile 2009-12-04 12:54:18.000000000 +0800
@@ -31,8 +31,9 @@
OMIT_FRAME_POINTER = -fomit-frame-pointer
# Name of .pc file. "lua5.1" on Debian/Ubuntu
-LUAPKG = lua5.1
-CFLAGS = `pkg-config $(LUAPKG) --cflags` -fPIC -O3 -Wall
+LUAPKG = lua-5.1
+CFLAGS += `pkg-config $(LUAPKG) --cflags` -fPIC %%INCDIR%%
+LIBS = `pkg-config $(LUAPKG) --libs` -liconv %%LIBDIR%%
LFLAGS = -shared $(OMIT_FRAME_POINTER)
INSTALL_PATH = `pkg-config $(LUAPKG) --variable=INSTALL_CMOD`

View File

@ -0,0 +1,11 @@
--- luaiconv.c.orig 2009-12-04 12:57:38.000000000 +0800
+++ luaiconv.c 2009-12-04 12:58:30.000000000 +0800
@@ -102,7 +102,7 @@ static int Liconv_open(lua_State *L) {
static int Liconv(lua_State *L) {
iconv_t cd = get_iconv_t(L, 1);
size_t ibleft = lua_strlen(L, 2);
- char *inbuf = (char*) luaL_checkstring(L, 2);
+ const char *inbuf = luaL_checkstring(L, 2);
char *outbuf;
char *outbufs;
size_t obsize = (ibleft > 256) ? ibleft : 256;

View File

@ -0,0 +1,21 @@
--- Makefile.orig Wed Nov 5 21:26:49 2003
+++ Makefile Mon Aug 7 00:38:38 2006
@@ -1,13 +1,13 @@
# makefile for POSIX library for Lua
# change these to reflect your Lua installation
-LUA= /tmp/lhf/lua-5.0
-LUAINC= $(LUA)/include
-LUALIB= $(LUA)/lib
-LUABIN= $(LUA)/bin
+LUA= ${PREFIX}
+LUAINC= $(LUA_INCDIR)
+LUALIB= $(LUA_LIBDIR)
+LUABIN= $(LUA_BINDIR)
# no need to change anything below here
-CFLAGS= -fPIC $(INCS) $(WARN) -O2 $G
+CFLAGS+= -fPIC $(INCS) $(WARN) -O2 $G
WARN= -pedantic -Wall
INCS= -I$(LUAINC)

View File

@ -0,0 +1,3 @@
LuaIconv is a Lua binding to iconv library.
WWW: http://luaforge.net/projects/lua-iconv/