diff options
author | Alessandro Barbieri <lssndrbarbieri@gmail.com> | 2021-11-01 17:17:23 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-06-16 01:34:43 +0100 |
commit | 43b339616b8cd4ab204fb89b882dfe3d8ca55f78 (patch) | |
tree | 4bc026490f2d8b9fa8045b61e6af0c0ca5a19be6 /app-misc | |
parent | games-action/noiz2sa: add missing libsdl[joystick] dep (diff) | |
download | gentoo-43b339616b8cd4ab204fb89b882dfe3d8ca55f78.tar.gz gentoo-43b339616b8cd4ab204fb89b882dfe3d8ca55f78.tar.bz2 gentoo-43b339616b8cd4ab204fb89b882dfe3d8ca55f78.zip |
app-misc/cw: EAPI 8, fix build
Closes: https://bugs.gentoo.org/830507
Closes: https://bugs.gentoo.org/692426
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/22782
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r-- | app-misc/cw/cw-1.0.16-r4.ebuild | 71 | ||||
-rw-r--r-- | app-misc/cw/files/cw-1.0.16-replace-isastream-with-fcntl.patch | 20 |
2 files changed, 91 insertions, 0 deletions
diff --git a/app-misc/cw/cw-1.0.16-r4.ebuild b/app-misc/cw/cw-1.0.16-r4.ebuild new file mode 100644 index 000000000000..8a1bb807eb9a --- /dev/null +++ b/app-misc/cw/cw-1.0.16-r4.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="A non-intrusive real-time ANSI color wrapper for common unix-based commands" +HOMEPAGE="http://cwrapper.sourceforge.net" +SRC_URI="mirror://sourceforge/cwrapper/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +PATCHES=( + "${FILESDIR}"/${PV}-ldflags.patch + "${FILESDIR}"/${PV}-path.patch + "${FILESDIR}"/${PV}-collision.patch + "${FILESDIR}"/${PV}-format-security.patch + "${FILESDIR}"/${P}-replace-isastream-with-fcntl.patch +) + +src_unpack() { + default + gunzip "${S}"/man/*.gz || die +} + +src_configure() { + tc-export CC + econf +} + +src_compile() { + emake local +} + +src_install() { + insinto /usr/share/cw + doins etc/* + + exeinto /usr/libexec/cw + doexe def/* + + doman man/cwu.1 + doman man/cwe.1 + newman man/cw.1 color-wrapper + dodoc CHANGES CONTRIB INSTALL README PLATFORM doc/README* + + dobin bin/{cwu,colorcfg} + # app-misc/color currently conflicts; hopefully 'colors' is safe + newbin bin/color colors + # media-radio/unixcw currently conflicts; + newbin bin/cw color-wrapper +} + +pkg_postinst() { + ebegin "Updating definition files" + cwu /usr/libexec/cw /usr/bin/color-wrapper || die # >/dev/null + eend $? + + elog "To enable color-wrapper, as your user, run:" + elog " colorcfg [1|2|3]" + elog "to add relevant environment variables to your ~/.bash_profile" + elog "Run colorcfg without options to see what [1|2|3] means." + elog + elog "After sourcing your ~/.bash_profile, commands for which definitions" + elog "are provided should have colored output." + elog + elog "To enable/disable colored output, run: 'colors [on|off]'." +} diff --git a/app-misc/cw/files/cw-1.0.16-replace-isastream-with-fcntl.patch b/app-misc/cw/files/cw-1.0.16-replace-isastream-with-fcntl.patch new file mode 100644 index 000000000000..18f2dba953d2 --- /dev/null +++ b/app-misc/cw/files/cw-1.0.16-replace-isastream-with-fcntl.patch @@ -0,0 +1,20 @@ +--- /var/tmp/portage/app-misc/cw-1.0.16-r3/work/cw-1.0.16/src/cw.c ++++ cw-1.0.16/src/cw.c +@@ -1173,7 +1173,7 @@ + close(master); + return(0); + } +- if(isastream(slave)){ ++ if(fcntl(slave,F_GETFD) < 0){ + if(ioctl(slave,I_PUSH,"ptem")<0||ioctl(slave,I_PUSH,"ldterm")<0){ + close(master); + close(slave); +@@ -1211,7 +1211,7 @@ + close(master); + return(0); + } +- if(isastream(slave)){ ++ if(fcntl(slave,F_GETFD) < 0){ + if(ioctl(slave,I_PUSH,"ptem")<0||ioctl(slave,I_PUSH,"ldterm")<0){ + close(master); + close(slave); |