From f8945e2a8c90f5a74c3258569e92334eff07d6fd Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 11 May 2026 08:18:31 +0000 Subject: [PATCH] sys-apps/groff: Sync with Gentoo It's from Gentoo commit 0480c876b0789d9b672d28a371c8db89a5f660ba. Signed-off-by: Flatcar Buildbot --- .../files/groff-1.23.0-man-unicode-fix.patch | 41 +++++++ .../sys-apps/groff/groff-1.23.0-r2.ebuild | 116 ++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/sys-apps/groff/files/groff-1.23.0-man-unicode-fix.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-apps/groff/groff-1.23.0-r2.ebuild diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/groff/files/groff-1.23.0-man-unicode-fix.patch b/sdk_container/src/third_party/portage-stable/sys-apps/groff/files/groff-1.23.0-man-unicode-fix.patch new file mode 100644 index 0000000000..49a6cc589d --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/groff/files/groff-1.23.0-man-unicode-fix.patch @@ -0,0 +1,41 @@ +format dashes as dashes so as to not confuse people + +groff 1.23.0 also changed the "utf8" device to render +"^" and "~" as U+02C6 and U+02DC respectively. +this causes similar searchability/copy-paste issue +especially for ~ which is often used to denote $HOME path. + +http://bugs.gentoo.org/16108 +http://bugs.gentoo.org/17580 +http://bugs.gentoo.org/121502 + +--- a/tmac/man.local ++++ b/tmac/man.local +@@ -1,6 +1,12 @@ + .\" This file is loaded by an.tmac. + .\" + .\" Put local modifications to groff_man(7)'s behavior here. ++.if '\*[.T]'utf8' \{\ ++. char \- \N'45' ++. char - \N'45' ++. char ^ \[ha] ++. char ~ \[ti] ++.\} + .\" + .\" Change "0" to "1" to enable OSC 8 links on SGR-capable grotty(1) + .\" output devices. +--- a/tmac/mdoc.local ++++ b/tmac/mdoc.local +@@ -1,6 +1,12 @@ + .\" This file is loaded by mdoc.tmac. + .\" + .\" Put local modifications to groff_mdoc(7)'s behavior here. ++.if '\*[.T]'utf8' \{\ ++. char \- \N'45' ++. char - \N'45' ++. char ^ \[ha] ++. char ~ \[ti] ++.\} + .\" + .\" "CW" is not a portable font name, but some man pages use it anyway. + .\" Uncomment this to suppress warnings produced by such pages. This diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/groff/groff-1.23.0-r2.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/groff/groff-1.23.0-r2.ebuild new file mode 100644 index 0000000000..f47323fa06 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/groff/groff-1.23.0-r2.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MY_P="${P/_/.}" +DESCRIPTION="Text formatter used for man pages" +HOMEPAGE="https://www.gnu.org/software/groff/groff.html" + +if [[ ${PV} == *_rc* ]] ; then + SRC_URI="https://alpha.gnu.org/gnu/groff/${MY_P}.tar.gz" +else + SRC_URI="mirror://gnu/groff/${MY_P}.tar.gz" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris" +fi + +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-2" +SLOT="0" +IUSE="examples uchardet X" + +RDEPEND=" + uchardet? ( app-i18n/uchardet ) + X? ( + x11-libs/libICE + x11-libs/libSM + x11-libs/libX11 + x11-libs/libXaw + x11-libs/libXmu + x11-libs/libXt + ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-lang/perl + sys-apps/texinfo + sys-devel/m4 +" + +DOCS=( BUG-REPORT ChangeLog MORE.STUFF NEWS PROBLEMS PROJECTS README TODO ) + +QA_CONFIG_IMPL_DECL_SKIP=( + # False positive with older autoconf, will be fixed w/ autoconf-2.72 + static_assert +) + +PATCHES=( + # bug #16108, bug #17580, bug #121502 + "${FILESDIR}"/${PN}-1.23.0-man-unicode-fix.patch + "${FILESDIR}"/${PN}-1.23.0-musl-getopt.patch +) + +src_prepare() { + default + + # Honor Gentoo's docdir + sed -i -e "s|^docdir =.*|docdir = \"${EPREFIX}/usr/share/doc/${PF}\"|g" \ + Makefile.in \ + || die "failed to modify Makefile.in" + + local pfx=$(usex prefix ' Prefix' '') + cat <<-EOF >> tmac/mdoc.local || die + .ds volume-operating-system Gentoo${pfx} + .ds operating-system Gentoo${pfx}/${KERNEL} + .ds default-operating-system Gentoo${pfx}/${KERNEL} + EOF + + # make sure we don't get a crappy `g' nameprefix on UNIX systems with real + # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy) + sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die +} + +src_configure() { + local myeconfargs=( + --with-appdefdir="${EPREFIX}"/usr/share/X11/app-defaults + --without-compatibility-wrappers # for Prefix + $(use_with uchardet) + $(use_with X x) + ) + + econf "${myeconfargs[@]}" +} + +src_compile() { + local -a CROSS_ARGS + tc-is-cross-compiler && CROSS_ARGS+=( + GROFFBIN="$(type -P groff)" + TROFFBIN="$(type -P troff)" + GROFF_BIN_DIR= + GROFF_BIN_PATH= + ) + + emake AR="$(tc-getAR)" "${CROSS_ARGS[@]}" +} + +src_install() { + default + + # The following links are required for man, bug #123674 + dosym eqn /usr/bin/geqn + dosym tbl /usr/bin/gtbl + + if ! use examples ; then + # The pdf files might not be generated if ghostscript is unavailable, bug #602020 + local pdf="${ED}/usr/share/doc/${PF}/examples/mom/mom-pdf.pdf" + if [[ -e ${pdf} ]] ; then + # Keep mom-pdf.pdf since it's more of a manual than an example + # bug #454196 and bug #516732 + mv "${pdf}" "${ED}/usr/share/doc/${PF}/pdf/" || die + fi + rm -rf "${ED}/usr/share/doc/${PF}/examples" + fi +}