summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-13 03:56:17 +0100
committerSam James <sam@gentoo.org>2023-08-13 04:01:02 +0100
commitd6404dafdf171eec9933510a160a4506776127e9 (patch)
tree2a3857890644e3094f15611b070e262bab672d32 /sys-apps/less
parentapp-emulation/qemu: add 8.0.4 (diff)
downloadgentoo-d6404dafdf171eec9933510a160a4506776127e9.tar.gz
gentoo-d6404dafdf171eec9933510a160a4506776127e9.tar.bz2
gentoo-d6404dafdf171eec9933510a160a4506776127e9.zip
sys-apps/less: add 643
Closes: https://bugs.gentoo.org/910700 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/less')
-rw-r--r--sys-apps/less/Manifest1
-rw-r--r--sys-apps/less/files/less-643-lesstest-pkg-config.patch34
-rw-r--r--sys-apps/less/less-643.ebuild93
-rw-r--r--sys-apps/less/less-9999.ebuild46
4 files changed, 156 insertions, 18 deletions
diff --git a/sys-apps/less/Manifest b/sys-apps/less/Manifest
index e7ca470d197a..becfdcc62104 100644
--- a/sys-apps/less/Manifest
+++ b/sys-apps/less/Manifest
@@ -1,3 +1,4 @@
DIST less-608.tar.gz 362346 BLAKE2B 988940745fef1222c43b0bf4edec7cc7206ded0ac5d89d3faf4dab706a249913581c2fe7aa6063cf3d717176ed07b69299d3e791ba8a60358483fe9d1bf7f7c6 SHA512 7945b7f88921832ebb1b45fba8cbb449ee0133342796b654a52c146dfff3d84db18724ee84e53349eeea6017a0ebe2d8eb5366210275981dde7bb7190118fa66
DIST less-632.tar.gz 375440 BLAKE2B 26c27a2e25882a4ce34e5e6e83bc0af784c8d4e8ac20691e0e31f1021bfb30f96e07024a6ff1ad634f7812875e0d920bd52394ccdba47a2a944ba7de92aa4c97 SHA512 5104f1fd76cdd59dfa957a61f8ccffe7c6e79345b94a5961abbd30f2d059f2b6d4b359a27dd5528993e5e1248c655439c1e4a39fd92234e4af23c7167f69f066
DIST less-633.tar.gz 375733 BLAKE2B e9df180794af365f86734c6b8fde766c1bba42b111717ee5e1cf11001fc7ec3d78910db9bb7c51a76816086f599808b1b60f514011ec40e37650d6bc4f8b3d5c SHA512 a29aaf72abca07fb29d12f218bbd422a39e3898b3d53e8dbd5265ae47ecf68b88c3381aa3a9bf7caa8db1e2d8e2c138b333f0d69fddd4cf014e39118c53f7fb1
+DIST less-643.tar.gz 592291 BLAKE2B 6dc60dc2e8db05afdae466877a1d26a3008ff5378bbbf2fbdf9efc4f87c0fcfde5703d44a24d4355c98d3a5f438bdb51173150f2a69f801d9c8e4a7401d71b53 SHA512 6a324ac54e22429ac652dc303bc1fe48933555d1cbf8ad7ecf345940910c014fef9551a3219743cfb7115e356b5841ae97d6ce62e7a1ba1e3300d243efca34d9
diff --git a/sys-apps/less/files/less-643-lesstest-pkg-config.patch b/sys-apps/less/files/less-643-lesstest-pkg-config.patch
new file mode 100644
index 000000000000..cd5f6f3047ba
--- /dev/null
+++ b/sys-apps/less/files/less-643-lesstest-pkg-config.patch
@@ -0,0 +1,34 @@
+https://github.com/gwsw/less/pull/412
+
+From 5d884b29fb11c2686b804428f483f4607334eb68 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 13 Aug 2023 03:57:25 +0100
+Subject: [PATCH] lesstest: use pkg-config to find ncurses libraries
+
+Fails to build with split tinfo otherwise like:
+```
+
+x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-z,pack-relative-relocs -ggdb3 -o lesstest display.o env.o lesstest.o parse.o pipeline.o log.o run.o term.o wchar.o -lncurses
+/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: display.o: in function `display_screen':
+/var/tmp/portage/sys-apps/less-643/work/less-643/lesstest/display.c:86:(.text+0x2e0): undefined reference to `tgoto'
+/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: term.o: in function `setup_mode':
+/var/tmp/portage/sys-apps/less-643/work/less-643/lesstest/term.c:83:(.text+0x18): undefined reference to `tgetstr'
+[...]
+```
+
+Going forward, we may want to just add a Makefile.in which configure handles
+to the lesstest subdir.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/lesstest/Makefile
++++ b/lesstest/Makefile
+@@ -1,7 +1,8 @@
+ CC ?= gcc
+ CFLAGS ?= -Wall -O2
+ LDFLAGS ?=
+-TERMLIB = -lncurses
++PKG_CONFIG ?= pkg-config
++TERMLIB ?= $(shell ${PKG_CONFIG} --libs ncurses)
+ srcdir ?= .
+
+ all: lesstest lt_screen
diff --git a/sys-apps/less/less-643.ebuild b/sys-apps/less/less-643.ebuild
new file mode 100644
index 000000000000..559db6a78878
--- /dev/null
+++ b/sys-apps/less/less-643.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2023 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 ~ia64 ~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
+
+ newbin "${FILESDIR}"/lesspipe-r2.sh lesspipe
+ newenvd "${FILESDIR}"/less.envd 70less
+}
+
+pkg_preinst() {
+ optfeature "Colorized output supprt" 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
+}
diff --git a/sys-apps/less/less-9999.ebuild b/sys-apps/less/less-9999.ebuild
index cbd0aff28900..559db6a78878 100644
--- a/sys-apps/less/less-9999.ebuild
+++ b/sys-apps/less/less-9999.ebuild
@@ -3,34 +3,39 @@
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
-fi
-
-inherit autotools flag-o-matic optfeature
+else
+ SRC_URI="https://www.greenwoodsoftware.com/less/${MY_P}.tar.gz"
-# 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.
+ if [[ ${PV} != *_beta* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ fi
+fi
-MY_PV=${PV/_beta/-beta}
-MY_P=${PN}-${MY_PV}
-DESCRIPTION="Excellent text file viewer"
-HOMEPAGE="https://www.greenwoodsoftware.com/less/"
-[[ ${PV} != 9999 ]] && SRC_URI="https://www.greenwoodsoftware.com/less/${MY_P}.tar.gz"
S="${WORKDIR}"/${MY_P/?beta}
LICENSE="|| ( GPL-3 BSD-2 )"
SLOT="0"
-if [[ ${PV} != 9999 && ${PV} != *_beta* ]] ; then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="pcre"
+IUSE="pcre test"
+# chinese1, utf8-2
+RESTRICT="test !test? ( test )"
DEPEND="
>=app-misc/editor-wrapper-3
@@ -38,9 +43,10 @@ DEPEND="
pcre? ( dev-libs/libpcre2 )
"
RDEPEND="${DEPEND}"
+BDEPEND="test? ( virtual/pkgconfig )"
PATCHES=(
- "${FILESDIR}"/${PN}-633-tinfow.patch
+ "${FILESDIR}"/${PN}-643-lesstest-pkg-config.patch
)
src_prepare() {
@@ -63,7 +69,7 @@ src_configure() {
}
src_test() {
- emake check VERBOSE=1
+ emake check VERBOSE=1 CC="$(tc-getCC)" PKG_CONFIG="$(tc-getPKG_CONFIG)"
}
src_install() {
@@ -80,4 +86,8 @@ pkg_preinst() {
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
}