commit:     e0d09d93d567b095c66269d8c4bbe45c66c9a5bd
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  7 15:30:01 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 19:32:37 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0d09d93

net-mail/mess822: Fix modern C and other issues

- Modern C issues are fixed by a patch. (bug #883265)
- AR and RANLIB sed script is updated to allow users set them with full
  path.
- Enhanced hier.c sed script to modify man page and library locations,
  eliminating the need for manual moves in src_install (bug #829200).
  This update prevents move failures when get_libdir returns "lib",
  which led to a conflict between source and destination paths.

Closes: https://bugs.gentoo.org/829200
Closes: https://bugs.gentoo.org/883265
Closes: https://github.com/gentoo/gentoo/pull/32272
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 net-mail/mess822/Manifest               |  1 +
 net-mail/mess822/mess822-0.58-r3.ebuild | 33 ++++++++++++++++++---------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/net-mail/mess822/Manifest b/net-mail/mess822/Manifest
index 776b5f9db09e..aa8db7ce393e 100644
--- a/net-mail/mess822/Manifest
+++ b/net-mail/mess822/Manifest
@@ -1 +1,2 @@
+DIST mess822-0.58-modern-compilers.patch.xz 3056 BLAKE2B 
6c812bc0f05f8e03d81b6067d53dd94c4140cd67aeee23a039db5a87057a883e10c5676b7d352074215667c4d161b721d58610e8036ad3f9c9b4282f924a7287
 SHA512 
9462668e0d16cb0ece4e72beb23a873c47da1478a1f23b971a484af931135dd97e662a517ae91dd434adcef238f49c55bef08c1172188090f65e420d9afe8cf8
 DIST mess822-0.58.tar.gz 64287 BLAKE2B 
d24c7c6c4d3cfcd21166ba9ac2ec72c0a0dbd05fb8329ac04668d9febe8632f63304342642f8c1a3543d4edd94ee5bcc7a2688ccc6f4afc12bfbd8d38eaccea5
 SHA512 
5fb30f06dfa08f60dc8760f9c5d692e59397ff848441bc94313a079bac8fb53b779133b48abae9b487dff6fbb277d5210a9690a138366bf4d34f052d661be65e

diff --git a/net-mail/mess822/mess822-0.58-r3.ebuild 
b/net-mail/mess822/mess822-0.58-r3.ebuild
index 7c5b7b7b6029..38d224864552 100644
--- a/net-mail/mess822/mess822-0.58-r3.ebuild
+++ b/net-mail/mess822/mess822-0.58-r3.ebuild
@@ -6,8 +6,11 @@ EAPI=8
 inherit toolchain-funcs
 
 DESCRIPTION="Collection of utilities for parsing Internet mail messages"
-SRC_URI="http://cr.yp.to/software/${P}.tar.gz";
 HOMEPAGE="http://cr.yp.to/mess822.html";
+SRC_URI="
+       http://cr.yp.to/software/${P}.tar.gz
+       https://dev.gentoo.org/~arkamar/distfiles/${P}-modern-compilers.patch.xz
+"
 
 LICENSE="public-domain"
 SLOT="0"
@@ -18,7 +21,7 @@ RESTRICT="test"
 RDEPEND="sys-apps/sed"
 
 PATCHES=(
-       "${FILESDIR}"/${P}-implicit.patch
+       "${WORKDIR}/${P}-modern-compilers.patch"
 )
 
 src_prepare() {
@@ -28,11 +31,11 @@ src_prepare() {
        echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
        echo "/usr" > conf-home || die
 
-       # fix errno.h problem; bug #26165
-       sed -i 's/^extern int errno;/#include <errno.h>/' error.h || die
-
-       sed -i -e "s/ar/$(tc-getAR)/" make-makelib.sh || die
-       sed -i -e "s/ranlib/$(tc-getRANLIB)/" make-makelib.sh || die
+       local sed_args=(
+               -e "s:ar:$(tc-getAR):"
+               -e "s:ranlib:$(tc-getRANLIB):"
+       )
+       sed -i "${sed_args[@]}" make-makelib.sh || die "sed make-makelib.sh 
failed"
 }
 
 src_install() {
@@ -42,15 +45,15 @@ src_install() {
        # Now that the commands are compiled, update the conf-home file to point
        # to the installation image directory.
        echo "${ED}/usr/" > conf-home || die
-       sed -i -e "s:\"/etc\":\"${ED}/etc\":" hier.c || die "sed hier.c failed"
 
-       emake setup
+       local sed_args=(
+               -e "s:\"/etc\":\"${ED}/etc\":"
+               -e "s:lib:$(get_libdir):"
+               -e "s:man:share/man:"
+       )
+       sed -i "${sed_args[@]}" hier.c || die "sed hier.c failed"
 
-       # Move the man pages into /usr/share/man
-       mv "${ED}/usr/man" "${ED}/usr/share/" || die
+       emake setup
 
-       dodir /usr/$(get_libdir)
-       mv "${ED}/usr/lib/${PN}.a" "${ED}/usr/$(get_libdir)/${PN}.a" || die
-       rmdir "${ED}/usr/lib" || die
-       dodoc BLURB CHANGES INSTALL README THANKS TODO VERSION
+       einstalldocs
 }

Reply via email to