summaryrefslogtreecommitdiff
path: root/dev-lua/readline
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lua/readline')
-rw-r--r--dev-lua/readline/Manifest3
-rw-r--r--dev-lua/readline/metadata.xml8
-rw-r--r--dev-lua/readline/readline-3.0.ebuild93
3 files changed, 104 insertions, 0 deletions
diff --git a/dev-lua/readline/Manifest b/dev-lua/readline/Manifest
new file mode 100644
index 000000000000..5979bbb25916
--- /dev/null
+++ b/dev-lua/readline/Manifest
@@ -0,0 +1,3 @@
+DIST lua-readline-3.0.tar.gz 15675 BLAKE2B 877b50cdf05610eb54fcec6063368206d68b0571e70c28abd6bdf20e0533ae76809a18f3b7cbefc79185544966e2838c8ea95b30bc5821c31547026ee621d1f0 SHA512 7fc9b1b2b03909cd8ebccc539fa8c37a823c70728671dc09c7cec0641625a59ed3c8b7045635e53719d32046437e638193cb1055a94a3d635fb50efb199d213a
+EBUILD readline-3.0.ebuild 1566 BLAKE2B f0f46fc4e58f78db1b96a2776f2065bbc93937963a79733b809871c7ac4a8ac25a209d0db0a49afdb385acbfda77032fe407b0f5ac87d0cc5425501cfc57d028 SHA512 b126866992c907cde4b57d2ffa22e1117654a5c923f45cb0adda78c2b158b136123603bcf4fbe526738ab4abd4ead154b4dcba39b54e644be9e651a4d36032e4
+MISC metadata.xml 251 BLAKE2B ba937d5724c861b8bfd1d287a325357d6a63656cf5c2314185a486be769eb22b39fa780b38c05407bce5f0707585d499a849a28e15a2fde9eebba6f529e686a3 SHA512 0fb5b55fc7db96153970767478727504fd0e87c1c8a77593f1f30720064e95776b92e4993f9aed076c983eee5cebca446fe8894e36fbcc02802bb1c158747dd3
diff --git a/dev-lua/readline/metadata.xml b/dev-lua/readline/metadata.xml
new file mode 100644
index 000000000000..c07e13d4a6bd
--- /dev/null
+++ b/dev-lua/readline/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>conikost@gentoo.org</email>
+ <name>Conrad Kostecki</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-lua/readline/readline-3.0.ebuild b/dev-lua/readline/readline-3.0.ebuild
new file mode 100644
index 000000000000..6eb54114feba
--- /dev/null
+++ b/dev-lua/readline/readline-3.0.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} luajit )
+
+inherit lua toolchain-funcs
+
+DESCRIPTION="A simple interface to the readline and history libraries"
+HOMEPAGE="https://pjb.com.au/comp/lua/readline.html"
+SRC_URI="https://pjb.com.au/comp/lua/${P}.tar.gz -> lua-${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+# Tests are interactive
+RESTRICT="test"
+
+RDEPEND="
+ dev-lua/luaposix
+ sys-libs/readline
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+
+ lua_copy_sources
+}
+
+lua_src_compile() {
+ pushd "${BUILD_DIR}" || die
+
+ local compiler=(
+ "$(tc-getCC)"
+ "${CFLAGS}"
+ "-fPIC"
+ "$(lua_get_CFLAGS)"
+ "-c C-readline.c"
+ "-o C-readline.o"
+ )
+ einfo "${compiler[@]}"
+ ${compiler[@]} || die
+
+ local linker=(
+ "$(tc-getCC)"
+ "-shared"
+ "${LDFLAGS}"
+ "$($(tc-getPKG_CONFIG) --libs readline)"
+ "-o C-readline.so"
+ "C-readline.o"
+ )
+ einfo "${linker[@]}"
+ ${linker[@]} || die
+
+ popd
+}
+
+src_compile() {
+ lua_foreach_impl lua_src_compile
+}
+
+lua_src_test() {
+ pushd "${BUILD_DIR}" || die
+ LUA_CPATH="./?.so;${EROOT}/usr/$(get_libdir)/lua/$(ver_cut 1-2 $(lua_get_version))/?.so" ${ELUA} test/test_rl.lua
+ popd
+}
+
+src_test() {
+ lua_foreach_impl lua_src_test
+}
+
+lua_src_install() {
+ pushd "${BUILD_DIR}" || die
+
+ insinto "$(lua_get_cmod_dir)"
+ doins C-readline.so
+
+ insinto "$(lua_get_lmod_dir)"
+ doins readline.lua
+
+ popd
+}
+
+src_install() {
+ lua_foreach_impl lua_src_install
+
+ docinto html
+ dodoc doc/readline.html
+}