summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lua/lua-utf8/Manifest1
-rw-r--r--dev-lua/lua-utf8/files/lua-utf8.Makefile41
-rw-r--r--dev-lua/lua-utf8/lua-utf8-0.1.1.ebuild43
-rw-r--r--dev-lua/lua-utf8/metadata.xml20
4 files changed, 105 insertions, 0 deletions
diff --git a/dev-lua/lua-utf8/Manifest b/dev-lua/lua-utf8/Manifest
new file mode 100644
index 000000000000..b2369602833e
--- /dev/null
+++ b/dev-lua/lua-utf8/Manifest
@@ -0,0 +1 @@
+DIST lua-utf8-0.1.1.tar.gz 35475 BLAKE2B 99ffece901878fc966e0314886ca20255834c76b9266b1806acda7afb84d6a358c556b9a88c10497d2874d7902fac5905907ab25fefb4ba38544d46e3bae1471 SHA512 e0a8632b9391c7e7b35e371f4e95899ec58adb4988f1fe5a7101310f7c774c3a3e88073f156cf7799c57f69c0fc53aff4486beb1e7006bfaa96d86e248e38897
diff --git a/dev-lua/lua-utf8/files/lua-utf8.Makefile b/dev-lua/lua-utf8/files/lua-utf8.Makefile
new file mode 100644
index 000000000000..ebbaecefea69
--- /dev/null
+++ b/dev-lua/lua-utf8/files/lua-utf8.Makefile
@@ -0,0 +1,41 @@
+# this file builds lua-utf8
+
+MY_USE_LUA?=luajit
+PKG_CONFIG?=pkg-config
+PREFIX?=/usr/local
+DESTDIR?=/
+
+LUA_LIBDIR := $(shell $(PKG_CONFIG) --variable INSTALL_CMOD $(MY_USE_LUA))
+LUA_INC := $(shell $(PKG_CONFIG) --variable INSTALL_INC $(MY_USE_LUA))
+LUA_SHARE := $(shell $(PKG_CONFIG) --variable INSTALL_LMOD $(MY_USE_LUA))
+CWARNS := -Wall -pedantic
+CFLAGS += -I$(LUA_INC) -fPIC $(CWARNS)
+LIB_OPTION := -shared
+
+SONAME := lua-utf8.so
+SONAMEV := $(SONAME).0
+LIBRARY := $(SONAMEV).1.1
+SRC := lutf8lib.c
+OBJ := $(patsubst %.c, %.o, $(SRC))
+
+FILES := parseucd.lua
+
+all: $(LIBRARY) $(SONAMEV) $(SONAME)
+
+$(SONAMEV):
+ ln -s $(LIBRARY) $@
+
+$(SONAME):
+ ln -s $(SONAMEV) $@
+
+$(LIBRARY): $(OBJ)
+ $(CC) $(CFLAGS) $(LIB_OPTION) -o $(LIBRARY) $(OBJ) -lc
+
+install:
+ install -d $(DESTDIR)$(LUA_LIBDIR)
+ install $(SONAME) $(DESTDIR)$(LUA_LIBDIR)
+ install -d $(DESTDIR)$(LUA_SHARE)
+ install --mode=0444 $(FILES) $(DESTDIR)$(LUA_SHARE)
+
+clean:
+ rm -rf $(LIBRARY) $(SONAMEV) $(SONAME) *.o
diff --git a/dev-lua/lua-utf8/lua-utf8-0.1.1.ebuild b/dev-lua/lua-utf8/lua-utf8-0.1.1.ebuild
new file mode 100644
index 000000000000..00f5147b88b0
--- /dev/null
+++ b/dev-lua/lua-utf8/lua-utf8-0.1.1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="UTF-8 support for Lua"
+HOMEPAGE="https://github.com/starwing/luautf8"
+SRC_URI="https://github.com/starwing/luautf8/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="luajit test"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ !luajit? ( >=dev-lang/lua-5.1:= )
+ luajit? ( dev-lang/luajit:2 )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PN//-/}-${PV}"
+
+src_prepare() {
+ default
+
+ cp -v ${FILESDIR}/${PN}.Makefile ${S}/Makefile || die
+}
+
+src_compile() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}" MY_USE_LUA="$(usex luajit 'luajit' 'lua')" PKG_CONFIG="$(tc-getPKG_CONFIG)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}" MY_USE_LUA="$(usex luajit 'luajit' 'lua')" PKG_CONFIG="$(tc-getPKG_CONFIG)" install
+ einstalldocs
+}
+
+src_test() {
+ LUA_CPATH=./src/?.so $(usex luajit 'luajit' 'lua') test.lua || die
+}
diff --git a/dev-lua/lua-utf8/metadata.xml b/dev-lua/lua-utf8/metadata.xml
new file mode 100644
index 000000000000..efc3ff445600
--- /dev/null
+++ b/dev-lua/lua-utf8/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>vpayno+gentoo@gmail.com</email>
+ <name>Victor Payno</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>gyakovlev@gentoo.org</email>
+ <name>Georgy Yakovlev</name>
+ </maintainer>
+ <longdescription lang="en">
+ This module adds UTF-8 support to Lua.
+
+ It use data extracted from Unicode Character Database, and tested on Lua 5.2.3, Lua 5.3.0 and LuaJIT.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">starwing/luautf8</remote-id>
+ </upstream>
+</pkgmetadata>