diff options
author | Sam James <sam@gentoo.org> | 2022-09-13 15:37:23 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-09-13 15:41:16 +0100 |
commit | 69dc5fd6b25b0cf5e4f5762bcdc4cd0d597dfa29 (patch) | |
tree | 87c2591690e161ab6c467c2c4bd037130c07ad3a /dev-perl/IO-Tty | |
parent | app-misc/logiops: Fix build on musl (diff) | |
download | gentoo-69dc5fd6b25b0cf5e4f5762bcdc4cd0d597dfa29.tar.gz gentoo-69dc5fd6b25b0cf5e4f5762bcdc4cd0d597dfa29.tar.bz2 gentoo-69dc5fd6b25b0cf5e4f5762bcdc4cd0d597dfa29.zip |
dev-perl/IO-Tty: fix build on musl (w/ Clang 15)
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-perl/IO-Tty')
-rw-r--r-- | dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild | 17 | ||||
-rw-r--r-- | dev-perl/IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch | 38 |
2 files changed, 55 insertions, 0 deletions
diff --git a/dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild b/dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild new file mode 100644 index 000000000000..296c1a886940 --- /dev/null +++ b/dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DIST_AUTHOR=TODDR +DIST_VERSION=1.16 +inherit perl-module + +DESCRIPTION="IO::Tty and IO::Pty modules for Perl" + +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +PATCHES=( + "${FILESDIR}"/${PN}-1.160.0-musl-strlcpy.patch +) diff --git a/dev-perl/IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch b/dev-perl/IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch new file mode 100644 index 000000000000..d96e5afe378b --- /dev/null +++ b/dev-perl/IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch @@ -0,0 +1,38 @@ +https://github.com/toddr/IO-Tty/pull/33 + +From fae771aefc593a0ef798bc0c1e21b0524eb85e2d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 31 Aug 2022 20:32:35 -0700 +Subject: [PATCH] Tty.xs: Do not mark strlcpy as static + +Some libcs e.g. musl do not provide implementation of strlcpy but they +do provide the signature in string.h, if we mark it static here then it +conflicts with the libc define and compiler may warn/error + +Fixes +Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration +strlcpy( ^ +/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libio-pty-perl/1.16-r0/recipe-sysroot/usr/include/string.h:86:8: note: previous declaration is here +size_t strlcpy (char *, const char *, size_t); ^ + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/Tty.xs ++++ b/Tty.xs +@@ -186,11 +186,11 @@ mysignal(int sig, mysig_t act) + * will be copied. Always NUL terminates (unless siz == 0). + * Returns strlen(src); if retval >= siz, truncation occurred. + */ +-static size_t +-strlcpy(dst, src, siz) +- char *dst; +- const char *src; +- size_t siz; ++size_t ++strlcpy( ++ char *dst, ++ const char *src, ++ size_t siz) + { + register char *d = dst; + register const char *s = src; + |