commit:     e92f7bdce710ca8fb567feb063354fea3a8c37de
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Wed Nov  2 12:13:54 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 08:17:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e92f7bdc

app-editors/vis: add 0.8

Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
Closes: https://github.com/gentoo/gentoo/pull/28101
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-editors/vis/Manifest       |  1 +
 app-editors/vis/vis-0.8.ebuild | 92 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)

diff --git a/app-editors/vis/Manifest b/app-editors/vis/Manifest
index 6493d5119b5d..d0c8ab5655e7 100644
--- a/app-editors/vis/Manifest
+++ b/app-editors/vis/Manifest
@@ -1,2 +1,3 @@
 DIST vis-0.7.tar.gz 403918 BLAKE2B 
5e4930fdb14ed42a2daf6682a99107ee6eb59e99e348abab5262bdbc53956dd9ccd094695d7f53c6770d10e46b2812b0e07ff90184ff920790f5b95f4091a610
 SHA512 
ccc6a054fea6917e7751882468a74c30c712f7ec400a913c95c0084691f706e2bee54efb86b75be8b121c9a209c7e587e72e5474c55271d9943e91fc8aaf9bac
+DIST vis-0.8.tar.gz 404496 BLAKE2B 
eafb7098a6c8e0d8f277be66984d5fd298ac86d524a4219a7d7730599157ca68c040615622cd1680b101e1cd003eba03343496762d0d4dc2766a079116f21eea
 SHA512 
ab4eda075034955411bdbc0ade2fe9149a48c644fa2f70add8d3b9d749f86b98a4e429745b5cae7fdbc0a1e07c8587539a055cd1c6734bb59e43c580c949e0aa
 DIST vis-test-0.5.tar.gz 99314 BLAKE2B 
988d7e93d0f3c58d2fc8fbe9293049c6a3cc44dfcbfbd4f42f7992815cf33a604340b59171dcd880f7180ae56e3f73f46684b7aacd96438480db6c4592851f2c
 SHA512 
c41b40f23a45a7ebd9c16aa853d9c3b517767cb88ff8dc268da44276a02aa8c77de0fc6aa243a1e4cdfbc27182870b82d0b9bc892bb87ea74d5275d76c554ed1

diff --git a/app-editors/vis/vis-0.8.ebuild b/app-editors/vis/vis-0.8.ebuild
new file mode 100644
index 000000000000..8f1fe78c20dd
--- /dev/null
+++ b/app-editors/vis/vis-0.8.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PTV=0.5
+LUA_COMPAT=( lua5-2 lua5-3 lua5-4 )
+
+inherit lua-single optfeature
+
+if [ "${PV}" == "9999" ]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/martanne/vis.git";
+else
+       
SRC_URI="https://github.com/martanne/vis/releases/download/v${PV}/${P}.tar.gz
+               test? ( 
https://github.com/martanne/vis-test/releases/download/v${MY_PTV}/vis-test-${MY_PTV}.tar.gz
 )"
+       KEYWORDS="~amd64 ~arm ~riscv ~x86"
+fi
+
+DESCRIPTION="modern, legacy free, simple yet efficient vim-like editor"
+HOMEPAGE="https://github.com/martanne/vis";
+LICENSE="ISC MIT"
+SLOT="0"
+IUSE="+ncurses +lua selinux test tre"
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+# - Known to also work with NetBSD curses
+DEPEND="dev-libs/libtermkey
+       sys-apps/acl
+       ncurses? ( sys-libs/ncurses:0= )
+       lua? ( ${LUA_DEPS} )
+       tre? ( dev-libs/tre )"
+RDEPEND="${DEPEND}
+       app-eselect/eselect-vi"
+# lpeg: https://github.com/martanne/vis-test/issues/28
+BDEPEND="test? (
+       $(lua_gen_cond_dep 'dev-lua/lpeg[${LUA_USEDEP}]')
+       $(lua_gen_cond_dep 'dev-lua/busted[${LUA_USEDEP}]')
+)"
+
+pkg_setup() {
+       use lua && lua-single_pkg_setup
+}
+
+src_prepare() {
+       if use test; then
+               if [ ! "${PV}" == "9999" ]; then
+                       rm -r test || die
+                       mv "${WORKDIR}/vis-test-${MY_PTV}" test || die
+               fi
+
+               # https://bugs.gentoo.org/722014 
https://github.com/martanne/vis-test/pull/22
+               sed -i 's;./ccan-config > config.h;./ccan-config "${CC}" 
${CFLAGS} > config.h;' test/core/Makefile || die
+
+               # https://github.com/martanne/vis-test/pull/29
+               sed -i 's;cpp -P;${CPP:-cpp} -P;' test/vim/test.sh || die
+
+               # https://github.com/martanne/vis-test/issues/27 a Werror clone
+               sed -i 's;|| strstr(output, "warning");;' 
test/core/ccan-config.c || die
+       fi
+
+       sed -i 's|STRIP?=.*|STRIP=true|' Makefile || die
+       sed -i 's|${DOCPREFIX}/vis|${DOCPREFIX}|' Makefile || die
+       sed -i 's|DOCUMENTATION = LICENSE|DOCUMENTATION =|' Makefile || die
+
+       default
+}
+
+src_configure() {
+       ./configure \
+               --prefix="${EPREFIX}"/usr \
+               --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+               $(use_enable lua) \
+               $(use_enable ncurses curses) \
+               $(use_enable selinux) \
+               $(use_enable tre) || die
+}
+
+update_symlinks() {
+       einfo "Calling eselect vi update --if-unset"
+       eselect vi update --if-unset
+}
+
+pkg_postrm() {
+       update_symlinks
+}
+
+pkg_postinst() {
+       update_symlinks
+       optfeature "syntax highlighting support" dev-lua/lpeg
+}

Reply via email to