Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/readline/
Date: Sat, 01 Oct 2022 23:33:21
Message-Id: 1664666107.63d122007b020901a5fcb09020e62c868a27b02e.conikost@gentoo
1 commit: 63d122007b020901a5fcb09020e62c868a27b02e
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 1 23:15:07 2022 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 1 23:15:07 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63d12200
7
8 dev-lua/readline: add 3.2
9
10 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
11
12 dev-lua/readline/Manifest | 1 +
13 dev-lua/readline/readline-3.2.ebuild | 94 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 95 insertions(+)
15
16 diff --git a/dev-lua/readline/Manifest b/dev-lua/readline/Manifest
17 index 6db4e2e620fc..05cc92564ecb 100644
18 --- a/dev-lua/readline/Manifest
19 +++ b/dev-lua/readline/Manifest
20 @@ -1 +1,2 @@
21 DIST lua-readline-3.1.tar.gz 16114 BLAKE2B 372bc61573b20c8ebf66bb684624dde9d5ce7868543294450ef3d47bba5a042c5d7f4262366f2de2db8d3d92bbf7fb4895d29577af34307d7b145e6f913ec957 SHA512 d3bee61b6c876e96d2c1097e29862a3f16d1e666b1087e58899f59a3115f9af31793492edfcc3f3802565f98f276960d382a89c0b6cfb1d54acfd37ad006b74b
22 +DIST lua-readline-3.2.tar.gz 16215 BLAKE2B 889db8cfefc37008fac9f92b6ef071147763d00f01ca42b31646594e812ab936187e65e8959e723be409d21c3e3cc2d93fe52eafac79e37b7d0cec2216d8accf SHA512 d605b99f2fa06920e67125b462f257f8cd263912b6ffba173bee77425c77f6b08b463ec4c0851c81dfc23e736698c9fbbb40e8a935cada2329b6a8e02a6cdaad
23
24 diff --git a/dev-lua/readline/readline-3.2.ebuild b/dev-lua/readline/readline-3.2.ebuild
25 new file mode 100644
26 index 000000000000..813f6f10ba3e
27 --- /dev/null
28 +++ b/dev-lua/readline/readline-3.2.ebuild
29 @@ -0,0 +1,94 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=8
34 +
35 +LUA_COMPAT=( lua5-{1..4} luajit )
36 +
37 +inherit lua toolchain-funcs
38 +
39 +DESCRIPTION="A simple interface to the readline and history libraries"
40 +HOMEPAGE="https://pjb.com.au/comp/lua/readline.html"
41 +SRC_URI="https://pjb.com.au/comp/lua/${P}.tar.gz -> lua-${P}.tar.gz"
42 +
43 +LICENSE="MIT"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
46 +REQUIRED_USE="${LUA_REQUIRED_USE}"
47 +
48 +# Tests are interactive
49 +RESTRICT="test"
50 +
51 +RDEPEND="
52 + dev-lua/luaposix
53 + sys-libs/readline:=
54 +"
55 +DEPEND="${RDEPEND}"
56 +BDEPEND="virtual/pkgconfig"
57 +
58 +src_prepare() {
59 + default
60 +
61 + lua_copy_sources
62 +}
63 +
64 +lua_src_compile() {
65 + pushd "${BUILD_DIR}" || die
66 +
67 + local compiler=(
68 + "$(tc-getCC)"
69 + "${CFLAGS}"
70 + "-fPIC"
71 + "$(lua_get_CFLAGS)"
72 + "-c C-readline.c"
73 + "-o C-readline.o"
74 + )
75 + einfo "${compiler[@]}"
76 + ${compiler[@]} || die
77 +
78 + local linker=(
79 + "$(tc-getCC)"
80 + "-shared"
81 + "${LDFLAGS}"
82 + "$($(tc-getPKG_CONFIG) --libs readline)"
83 + "-o C-readline.so"
84 + "C-readline.o"
85 + )
86 + einfo "${linker[@]}"
87 + ${linker[@]} || die
88 +
89 + popd
90 +}
91 +
92 +src_compile() {
93 + lua_foreach_impl lua_src_compile
94 +}
95 +
96 +lua_src_test() {
97 + pushd "${BUILD_DIR}" || die
98 + LUA_CPATH="./?.so;${ESYSROOT}/usr/$(get_libdir)/lua/$(ver_cut 1-2 $(lua_get_version))/?.so" ${ELUA} test/test_rl.lua || die
99 + popd || die
100 +}
101 +
102 +src_test() {
103 + lua_foreach_impl lua_src_test
104 +}
105 +
106 +lua_src_install() {
107 + pushd "${BUILD_DIR}" || die
108 +
109 + insinto "$(lua_get_cmod_dir)"
110 + doins C-readline.so
111 +
112 + insinto "$(lua_get_lmod_dir)"
113 + doins readline.lua
114 +
115 + popd || die
116 +}
117 +
118 +src_install() {
119 + lua_foreach_impl lua_src_install
120 +
121 + docinto html
122 + dodoc doc/readline.html
123 +}