sys-apps/less: Sync with Gentoo

It's from Gentoo commit 6fe3612495ee5a5fa43d567da877d543164922f1.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:08:22 +00:00
parent a415072e53
commit 361f53f212
2 changed files with 97 additions and 0 deletions

View File

@ -1,3 +1,4 @@
DIST less-633.tar.gz 375733 BLAKE2B e9df180794af365f86734c6b8fde766c1bba42b111717ee5e1cf11001fc7ec3d78910db9bb7c51a76816086f599808b1b60f514011ec40e37650d6bc4f8b3d5c SHA512 a29aaf72abca07fb29d12f218bbd422a39e3898b3d53e8dbd5265ae47ecf68b88c3381aa3a9bf7caa8db1e2d8e2c138b333f0d69fddd4cf014e39118c53f7fb1
DIST less-643.tar.gz 592291 BLAKE2B 6dc60dc2e8db05afdae466877a1d26a3008ff5378bbbf2fbdf9efc4f87c0fcfde5703d44a24d4355c98d3a5f438bdb51173150f2a69f801d9c8e4a7401d71b53 SHA512 6a324ac54e22429ac652dc303bc1fe48933555d1cbf8ad7ecf345940910c014fef9551a3219743cfb7115e356b5841ae97d6ce62e7a1ba1e3300d243efca34d9
DIST less-661.tar.gz 648198 BLAKE2B c1fa9a7a646fcc1203945e00c35fe41bddef0c564e30f120a37e417ecd5c60d234e0253a2e18123508dd5c0313bce346dc7752e96cdc1b067bd07a2a39818b42 SHA512 49d81ff9e79d43ce0271490e3bffd590b4aed5fcb387bc8eb3128de99e5b5a5ede2e2818b546f6e3a140fa6261f1de3dfba1231f7ff7ef18502bb7030eaea1b5
DIST less-668.tar.gz 649770 BLAKE2B 0f6a85a1c66577dd2a28682a6f8399e42fdbe9fc1498b2e89c6bb7c47109e8d3ab934abe5dd998b2c8dfacfb174ad9daeb79b3d4c13df22fa035ea792b2eaf5e SHA512 6527741a609849ec27b6ab35de46f2c5c2b2771391e3efe263207bee28915946f44331a42f832a7cb42231a19b135cbadc15ae02cd997b83a13cdfbc7213fc27

View File

@ -0,0 +1,96 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Releases are usually first a beta then promoted to stable if no
# issues were found. Upstream explicitly ask "to not generally distribute"
# the beta versions. It's okay to keyword beta versions if they fix
# a serious bug, but otherwise try to avoid it.
WANT_AUTOMAKE=none
WANT_LIBTOOL=none
inherit autotools flag-o-matic optfeature toolchain-funcs
DESCRIPTION="Excellent text file viewer"
HOMEPAGE="https://www.greenwoodsoftware.com/less/"
MY_PV=${PV/_beta/-beta}
MY_P=${PN}-${MY_PV}
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/gwsw/less"
inherit git-r3
else
SRC_URI="https://www.greenwoodsoftware.com/less/${MY_P}.tar.gz"
if [[ ${PV} != *_beta* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
fi
S="${WORKDIR}"/${MY_P/?beta}
LICENSE="|| ( GPL-3 BSD-2 )"
SLOT="0"
IUSE="pcre test"
# chinese1, utf8-2
RESTRICT="test !test? ( test )"
DEPEND="
>=app-misc/editor-wrapper-3
>=sys-libs/ncurses-5.2:=
pcre? ( dev-libs/libpcre2 )
"
RDEPEND="${DEPEND}"
BDEPEND="test? ( virtual/pkgconfig )"
PATCHES=(
"${FILESDIR}"/${PN}-643-lesstest-pkg-config.patch
)
src_prepare() {
default
# Per upstream README to prepare live build
[[ ${PV} == 9999 ]] && emake -f Makefile.aut distfiles
# Upstream uses unpatched autoconf-2.69, which breaks with clang-16.
# https://bugs.gentoo.org/870412
eautoreconf
}
src_configure() {
append-lfs-flags # bug #896316
local myeconfargs=(
--with-regex=$(usex pcre pcre2 posix)
--with-editor="${EPREFIX}"/usr/libexec/editor
)
econf "${myeconfargs[@]}"
}
src_test() {
emake check VERBOSE=1 CC="$(tc-getCC)" PKG_CONFIG="$(tc-getPKG_CONFIG)"
}
src_install() {
default
keepdir /usr/lib/lessfilter.d
keepdir /etc/lessfilter.d
newbin "${FILESDIR}"/lesspipe-r4.sh lesspipe
newenvd "${FILESDIR}"/less.envd 70less
}
pkg_preinst() {
optfeature "Colorized output support" dev-python/pygments
if has_version "<${CATEGORY}/${PN}-483-r1" ; then
elog "The lesspipe.sh symlink has been dropped. If you are still setting"
elog "LESSOPEN to that, you will need to update it to '|lesspipe %s'."
fi
if has_version "<${CATEGORY}/${PN}-643" ; then
elog "less now colorizes by default. To disable this, set LESSCOLOR=no."
fi
}