Diff less-702 with a less-9999

/usr/portage/sys-apps/less/less-9999.ebuild 2026-06-10 19:17:07.266990751 +0300
10 10

  
11 11
WANT_AUTOMAKE=none
12 12
WANT_LIBTOOL=none
13
inherit autotools flag-o-matic optfeature toolchain-funcs
13
inherit autotools flag-o-matic multibuild optfeature toolchain-funcs
14 14

  
15 15
DESCRIPTION="Excellent text file viewer"
16 16
HOMEPAGE="https://www.greenwoodsoftware.com/less/"
......
56 56

  
57 57
src_prepare() {
58 58
	default
59

  
59 60
	# Per upstream README to prepare live build
60 61
	[[ ${PV} == 9999 ]] && emake -f Makefile.aut distfiles
61 62
	# Upstream uses unpatched autoconf-2.69, which breaks with clang-16.
62 63
	# https://bugs.gentoo.org/870412
63 64
	eautoreconf
65

  
66
	MULTIBUILD_VARIANTS=(
67
		base
68
		$(usev test)
69
	)
70

  
71
	multibuild_copy_sources
64 72
}
65 73

  
66
src_configure() {
74
less_configure() {
75
	cd "${BUILD_DIR}" || die
67 76
	append-lfs-flags # bug #896316
68 77

  
69 78
	local myeconfargs=(
70 79
		--with-regex=$(usex pcre pcre2 posix)
71 80
		--with-editor="${EPREFIX}"/usr/libexec/editor
72 81
	)
73
	econf "${myeconfargs[@]}"
82

  
83
	ECONF_SOURCE=${PWD} econf "${myeconfargs[@]}"
84
}
85

  
86
src_configure() {
87
	multibuild_foreach_variant less_configure
88
}
89

  
90
less_compile() {
91
	emake -C "${BUILD_DIR}"
92
}
93

  
94
src_compile() {
95
	multibuild_foreach_variant less_compile
96
}
97

  
98
less_test() {
99
	# https://github.com/gwsw/less/issues/791
100
	[[ ${MULTIBUILD_VARIANT} == "test" ]] || return
101
	emake -C "${BUILD_DIR}" check VERBOSE=1 CC="$(tc-getCC)" PKG_CONFIG="$(tc-getPKG_CONFIG)"
74 102
}
75 103

  
76 104
src_test() {
77
	emake check VERBOSE=1 CC="$(tc-getCC)" PKG_CONFIG="$(tc-getPKG_CONFIG)"
105
	multibuild_foreach_variant less_test
78 106
}
79 107

  
80
src_install() {
81
	default
108
less_install() {
109
	[[ ${MULTIBUILD_VARIANT} == "base" ]] || return
110

  
111
	emake -C "${BUILD_DIR}" DESTDIR="${D}" install
112
	einstalldocs
82 113

  
83 114
	keepdir /usr/lib/lessfilter.d
84 115
	keepdir /etc/lessfilter.d
......
87 118
	newenvd "${FILESDIR}"/less.envd 70less
88 119
}
89 120

  
121
src_install() {
122
	multibuild_foreach_variant less_install
123
}
124

  
90 125
pkg_preinst() {
91 126
	optfeature "Colorized output support" dev-python/pygments
92 127

  
Thank you!