1 |
commit: 69dc5fd6b25b0cf5e4f5762bcdc4cd0d597dfa29 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 13 14:37:23 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 13 14:41:16 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69dc5fd6 |
7 |
|
8 |
dev-perl/IO-Tty: fix build on musl (w/ Clang 15) |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild | 17 ++++++++++ |
13 |
.../IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch | 38 ++++++++++++++++++++++ |
14 |
2 files changed, 55 insertions(+) |
15 |
|
16 |
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 |
17 |
new file mode 100644 |
18 |
index 000000000000..296c1a886940 |
19 |
--- /dev/null |
20 |
+++ b/dev-perl/IO-Tty/IO-Tty-1.160.0-r1.ebuild |
21 |
@@ -0,0 +1,17 @@ |
22 |
+# Copyright 1999-2022 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI=8 |
26 |
+ |
27 |
+DIST_AUTHOR=TODDR |
28 |
+DIST_VERSION=1.16 |
29 |
+inherit perl-module |
30 |
+ |
31 |
+DESCRIPTION="IO::Tty and IO::Pty modules for Perl" |
32 |
+ |
33 |
+SLOT="0" |
34 |
+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" |
35 |
+ |
36 |
+PATCHES=( |
37 |
+ "${FILESDIR}"/${PN}-1.160.0-musl-strlcpy.patch |
38 |
+) |
39 |
|
40 |
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 |
41 |
new file mode 100644 |
42 |
index 000000000000..d96e5afe378b |
43 |
--- /dev/null |
44 |
+++ b/dev-perl/IO-Tty/files/IO-Tty-1.160.0-musl-strlcpy.patch |
45 |
@@ -0,0 +1,38 @@ |
46 |
+https://github.com/toddr/IO-Tty/pull/33 |
47 |
+ |
48 |
+From fae771aefc593a0ef798bc0c1e21b0524eb85e2d Mon Sep 17 00:00:00 2001 |
49 |
+From: Khem Raj <raj.khem@×××××.com> |
50 |
+Date: Wed, 31 Aug 2022 20:32:35 -0700 |
51 |
+Subject: [PATCH] Tty.xs: Do not mark strlcpy as static |
52 |
+ |
53 |
+Some libcs e.g. musl do not provide implementation of strlcpy but they |
54 |
+do provide the signature in string.h, if we mark it static here then it |
55 |
+conflicts with the libc define and compiler may warn/error |
56 |
+ |
57 |
+Fixes |
58 |
+Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration |
59 |
+strlcpy( ^ |
60 |
+/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 |
61 |
+size_t strlcpy (char *, const char *, size_t); ^ |
62 |
+ |
63 |
+Signed-off-by: Khem Raj <raj.khem@×××××.com> |
64 |
+--- a/Tty.xs |
65 |
++++ b/Tty.xs |
66 |
+@@ -186,11 +186,11 @@ mysignal(int sig, mysig_t act) |
67 |
+ * will be copied. Always NUL terminates (unless siz == 0). |
68 |
+ * Returns strlen(src); if retval >= siz, truncation occurred. |
69 |
+ */ |
70 |
+-static size_t |
71 |
+-strlcpy(dst, src, siz) |
72 |
+- char *dst; |
73 |
+- const char *src; |
74 |
+- size_t siz; |
75 |
++size_t |
76 |
++strlcpy( |
77 |
++ char *dst, |
78 |
++ const char *src, |
79 |
++ size_t siz) |
80 |
+ { |
81 |
+ register char *d = dst; |
82 |
+ register const char *s = src; |
83 |
+ |