Gentoo Archives: gentoo-commits

From: Vadim Misbakh-Soloviov <mva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/lua-utf8/
Date: Sat, 25 Sep 2021 22:57:21
Message-Id: 1632610607.a9dcb35859e3573e7030ebc9141c9517316fcccd.mva@gentoo
1 commit: a9dcb35859e3573e7030ebc9141c9517316fcccd
2 Author: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 22:46:19 2021 +0000
4 Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 25 22:56:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9dcb358
7
8 dev-lua/lua-utf8: fix ucd data header regeneration
9
10 Package-Manager: Portage-3.0.23, Repoman-3.0.1
11 Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
12
13 dev-lua/lua-utf8/lua-utf8-0.1.3-r101.ebuild | 102 ++++++++++++++++++++++++++++
14 1 file changed, 102 insertions(+)
15
16 diff --git a/dev-lua/lua-utf8/lua-utf8-0.1.3-r101.ebuild b/dev-lua/lua-utf8/lua-utf8-0.1.3-r101.ebuild
17 new file mode 100644
18 index 00000000000..56443c4373a
19 --- /dev/null
20 +++ b/dev-lua/lua-utf8/lua-utf8-0.1.3-r101.ebuild
21 @@ -0,0 +1,102 @@
22 +# Copyright 2020-2021 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +LUA_COMPAT=( lua5-{1..4} luajit )
28 +
29 +inherit lua toolchain-funcs
30 +
31 +DESCRIPTION="A UTF-8 support module for Lua and LuaJIT"
32 +HOMEPAGE="https://github.com/starwing/luautf8"
33 +SRC_URI="https://github.com/starwing/luautf8/archive/${PV}.tar.gz -> ${P}.tar.gz"
34 +S="${WORKDIR}/${PN//-/}-${PV}"
35 +
36 +LICENSE="MIT"
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
39 +IUSE="test"
40 +REQUIRED_USE="${LUA_REQUIRED_USE}"
41 +RESTRICT="!test? ( test )"
42 +
43 +RDEPEND="${LUA_DEPS}"
44 +DEPEND="${RDEPEND}"
45 +BDEPEND="
46 + virtual/pkgconfig
47 + ${LUA_DEPS}
48 +"
49 +
50 +src_prepare() {
51 + local unicodedir="${EPREFIX}"/usr/share/unicode
52 + local ucddir
53 +
54 + if has_verson '<app-i18n/unicode-data-14.0.0-r1'; then
55 + ucddir="${unicodedir}-data"
56 + else
57 + ucddir=${unicodedir}
58 + fi
59 +
60 + sed -i \
61 + -e "s@UCD/@${ucd}/@" \
62 + parseucd.lua
63 +
64 + default
65 +}
66 +
67 +lua_src_compile() {
68 + einfo "Performing regeneration unicode data header against app-i18n/unicode-data with ${ELUA}"
69 + "${ELUA}" parseucd.lua
70 +
71 + local compiler=(
72 + "$(tc-getCC)"
73 + "${CFLAGS}"
74 + "-fPIC"
75 + "${LDFLAGS}"
76 + "$(lua_get_CFLAGS)"
77 + "-c lutf8lib.c"
78 + "-o lutf8lib-${ELUA}.o"
79 + )
80 + einfo "${compiler[@]}"
81 + ${compiler[@]} || die
82 +
83 + local linker=(
84 + "$(tc-getCC)"
85 + "-shared"
86 + "${LDFLAGS}"
87 + "-o lutf8lib-${ELUA}.so"
88 + "lutf8lib-${ELUA}.o"
89 + )
90 + einfo "${linker[@]}"
91 + ${linker[@]} || die
92 +}
93 +
94 +src_compile() {
95 + lua_foreach_impl lua_src_compile
96 +}
97 +
98 +lua_src_test() {
99 + local mytests=(
100 + "test.lua"
101 + "test_compat.lua"
102 + "test_pm.lua"
103 + )
104 +
105 + for mytest in ${mytests[@]}; do
106 + LUA_CPATH="${S}/lutf8lib-${ELUA}.so" ${ELUA} ${mytest} || die
107 + done
108 +}
109 +
110 +src_test() {
111 + lua_foreach_impl lua_src_test
112 +}
113 +
114 +lua_src_install() {
115 + exeinto "$(lua_get_cmod_dir)"
116 + newexe "lutf8lib-${ELUA}.so" "lua-utf8.so"
117 +}
118 +
119 +src_install() {
120 + lua_foreach_impl lua_src_install
121 +
122 + einstalldocs
123 +}