1 |
commit: d63d78079332b0d18cdd745ff6ece3e9ea204533 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Mar 17 21:42:45 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 17 21:52:36 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d63d7807 |
7 |
|
8 |
dev-perl/Crypt-DES: fix build w/ clang 16 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/870427 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild | 32 ++++++++++++++++++++ |
14 |
.../files/Crypt-DES-2.07-implicit-func-decl.patch | 34 ++++++++++++++++++++++ |
15 |
2 files changed, 66 insertions(+) |
16 |
|
17 |
diff --git a/dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild b/dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild |
18 |
new file mode 100644 |
19 |
index 000000000000..1a477b6695dc |
20 |
--- /dev/null |
21 |
+++ b/dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild |
22 |
@@ -0,0 +1,32 @@ |
23 |
+# Copyright 1999-2023 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+DIST_AUTHOR=DPARIS |
29 |
+DIST_VERSION=2.07 |
30 |
+inherit perl-module |
31 |
+ |
32 |
+DESCRIPTION="Perl DES encryption module" |
33 |
+ |
34 |
+LICENSE="DES" |
35 |
+SLOT="0" |
36 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
37 |
+IUSE="test" |
38 |
+RESTRICT="!test? ( test )" |
39 |
+ |
40 |
+BDEPEND=" |
41 |
+ virtual/perl-ExtUtils-MakeMaker |
42 |
+ test? ( dev-perl/Crypt-CBC ) |
43 |
+" |
44 |
+ |
45 |
+PATCHES=( |
46 |
+ "${FILESDIR}"/${PN}-2.07-implicit-func-decl.patch |
47 |
+) |
48 |
+ |
49 |
+src_compile() { |
50 |
+ mymake=( |
51 |
+ "OPTIMIZE=${CFLAGS}" |
52 |
+ ) |
53 |
+ perl-module_src_compile |
54 |
+} |
55 |
|
56 |
diff --git a/dev-perl/Crypt-DES/files/Crypt-DES-2.07-implicit-func-decl.patch b/dev-perl/Crypt-DES/files/Crypt-DES-2.07-implicit-func-decl.patch |
57 |
new file mode 100644 |
58 |
index 000000000000..fa65def771b0 |
59 |
--- /dev/null |
60 |
+++ b/dev-perl/Crypt-DES/files/Crypt-DES-2.07-implicit-func-decl.patch |
61 |
@@ -0,0 +1,34 @@ |
62 |
+https://src.fedoraproject.org/rpms/perl-Crypt-DES/raw/0a4557f6b118387730b895037e4a17c90f212e68/f/perl-Crypt-DES-fedora-c99.patch |
63 |
+https://rt.cpan.org/Public/Bug/Display.html?id=133363 |
64 |
+https://rt.cpan.org/Public/Bug/Display.html?id=133412 |
65 |
+https://bugs.gentoo.org/870427 |
66 |
+--- a/DES.xs |
67 |
++++ b/DES.xs |
68 |
+@@ -36,7 +36,7 @@ _des_expand_key(key) |
69 |
+ if (key_len != sizeof(des_user_key)) |
70 |
+ croak("Invalid key"); |
71 |
+ |
72 |
+- perl_des_expand_key((i8 *)key, ks); |
73 |
++ perl_des_expand_key((unsigned char *)key, ks); |
74 |
+ |
75 |
+ ST(0) = sv_2mortal(newSVpv((char *)ks, sizeof(ks))); |
76 |
+ } |
77 |
+@@ -66,7 +66,8 @@ _des_crypt(input, output, ks, enc_flag) |
78 |
+ |
79 |
+ (SvUPGRADE(output, SVt_PV)); |
80 |
+ |
81 |
+- perl_des_crypt(input, SvGROW(output, output_len), (i32 *)ks, enc_flag); |
82 |
++ perl_des_crypt((unsigned char *)input, (unsigned char *)SvGROW(output, output_len), |
83 |
++ (unsigned long *)ks, enc_flag); |
84 |
+ |
85 |
+ SvCUR_set(output, output_len); |
86 |
+ *SvEND(output) = '\0'; |
87 |
+--- a/_des.h |
88 |
++++ b/_des.h |
89 |
+@@ -5,3 +5,5 @@ typedef unsigned long des_ks[32]; |
90 |
+ void _des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt ); |
91 |
+ void _des_expand_key( des_user_key userKey, des_ks key ); |
92 |
+ |
93 |
++void perl_des_expand_key(des_user_key userKey, des_ks ks); |
94 |
++void perl_des_crypt( des_cblock input, des_cblock output, des_ks ks, int encrypt ); |
95 |
+ |