1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

textproc/lua-icu-utils: New port

Lua interface to selected utilities from the ICU project

WWW: https://github.com/adam-stanek/lua_icu_utils
This commit is contained in:
Martin Matuska 2022-02-16 16:19:10 +01:00
parent 76d8d035f5
commit 654cb5b912
5 changed files with 76 additions and 0 deletions

View File

@ -429,6 +429,7 @@
SUBDIR += lt-hyphen SUBDIR += lt-hyphen
SUBDIR += lttoolbox SUBDIR += lttoolbox
SUBDIR += ltxml SUBDIR += ltxml
SUBDIR += lua-icu-utils
SUBDIR += lua-lyaml SUBDIR += lua-lyaml
SUBDIR += luaexpat SUBDIR += luaexpat
SUBDIR += lucene SUBDIR += lucene

View File

@ -0,0 +1,40 @@
# Created by: Martin Matuska <mm@FreeBSD.org>
PORTNAME= icu-utils
DISTVERSION= 0.0-20160816
CATEGORIES= textproc
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
MAINTAINER= mm@FreeBSD.org
COMMENT= Lua interface to selected ICU utilities
LICENSE= MIT
LIB_DEPENDS= libicui18n.so:devel/icu
USES= gmake lua:module
USE_GITHUB= yes
GH_ACCOUNT= adam-stanek
GH_PROJECT= lua_icu_utils
GH_TAGNAME= df830c0
CFLAGS+= -fPIC -I${LOCALBASE}/include
MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="-shared -L${LOCALBASE}/lib" LUA_INCDIR="${LUA_INCDIR}"
PLIST_FILES= ${LUA_MODLIBDIR}/icu_utils.so
PORTDOCS= README.md
DOCSDIR= ${PREFIX}/share/doc/lua${LUA_VER_STR}/${PORTNAME}
OPTIONS_DEFINE= DOCS
do-install:
${MKDIR} ${STAGEDIR}${LUA_MODLIBDIR}
${INSTALL_LIB} ${WRKSRC}/icu_utils.so ${STAGEDIR}${LUA_MODLIBDIR}
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1645023714
SHA256 (adam-stanek-lua_icu_utils-0.0-20160816-df830c0_GH0.tar.gz) = 52f964db41cbdad5baac755805a9310b27d8d0dc7a7f429cddd81dea948f4348
SIZE (adam-stanek-lua_icu_utils-0.0-20160816-df830c0_GH0.tar.gz) = 5799

View File

@ -0,0 +1,29 @@
--- src/convert_case.c.orig 2022-02-16 14:49:42 UTC
+++ src/convert_case.c
@@ -45,7 +45,7 @@ int strtolower(lua_State *l) {
int32_t out_len = u_strToLower(dest, str_len, str, str_len, "", &status);
if(U_FAILURE(status)) {
// Allocate more memory if necessary
- if(status = U_BUFFER_OVERFLOW_ERROR) {
+ if(status == U_BUFFER_OVERFLOW_ERROR) {
free(dest);
dest = malloc(sizeof(UChar) * (out_len + 1));
if(!dest) {
@@ -109,7 +109,7 @@ int strtoupper(lua_State *l) {
int32_t out_len = u_strToUpper(dest, str_len, str, str_len, "", &status);
if(U_FAILURE(status)) {
// Allocate more memory if necessary
- if(status = U_BUFFER_OVERFLOW_ERROR) {
+ if(status == U_BUFFER_OVERFLOW_ERROR) {
free(dest);
dest = malloc(sizeof(UChar) * (out_len + 1));
if(!dest) {
@@ -173,7 +173,7 @@ int strtotitle(lua_State *l) {
int32_t out_len = u_strToTitle(dest, str_len, str, str_len, NULL, "", &status);
if(U_FAILURE(status)) {
// Allocate more memory if necessary
- if(status = U_BUFFER_OVERFLOW_ERROR) {
+ if(status == U_BUFFER_OVERFLOW_ERROR) {
free(dest);
dest = malloc(sizeof(UChar) * (out_len + 1));
if(!dest) {

View File

@ -0,0 +1,3 @@
Lua interface to selected utilities from the ICU project
WWW: https://github.com/adam-stanek/lua_icu_utils