commit:     d63d78079332b0d18cdd745ff6ece3e9ea204533
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 17 21:42:45 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 17 21:52:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d63d7807

dev-perl/Crypt-DES: fix build w/ clang 16

Closes: https://bugs.gentoo.org/870427
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild      | 32 ++++++++++++++++++++
 .../files/Crypt-DES-2.07-implicit-func-decl.patch  | 34 ++++++++++++++++++++++
 2 files changed, 66 insertions(+)

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
new file mode 100644
index 000000000000..1a477b6695dc
--- /dev/null
+++ b/dev-perl/Crypt-DES/Crypt-DES-2.70.0-r3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=DPARIS
+DIST_VERSION=2.07
+inherit perl-module
+
+DESCRIPTION="Perl DES encryption module"
+
+LICENSE="DES"
+SLOT="0"
+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"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       virtual/perl-ExtUtils-MakeMaker
+       test? ( dev-perl/Crypt-CBC )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.07-implicit-func-decl.patch
+)
+
+src_compile() {
+       mymake=(
+               "OPTIMIZE=${CFLAGS}"
+       )
+       perl-module_src_compile
+}

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
new file mode 100644
index 000000000000..fa65def771b0
--- /dev/null
+++ b/dev-perl/Crypt-DES/files/Crypt-DES-2.07-implicit-func-decl.patch
@@ -0,0 +1,34 @@
+https://src.fedoraproject.org/rpms/perl-Crypt-DES/raw/0a4557f6b118387730b895037e4a17c90f212e68/f/perl-Crypt-DES-fedora-c99.patch
+https://rt.cpan.org/Public/Bug/Display.html?id=133363
+https://rt.cpan.org/Public/Bug/Display.html?id=133412
+https://bugs.gentoo.org/870427
+--- a/DES.xs
++++ b/DES.xs
+@@ -36,7 +36,7 @@ _des_expand_key(key)
+               if (key_len != sizeof(des_user_key))
+                       croak("Invalid key");
+ 
+-              perl_des_expand_key((i8 *)key, ks);
++              perl_des_expand_key((unsigned char *)key, ks);
+ 
+               ST(0) = sv_2mortal(newSVpv((char *)ks, sizeof(ks)));
+       }
+@@ -66,7 +66,8 @@ _des_crypt(input, output, ks, enc_flag)
+ 
+               (SvUPGRADE(output, SVt_PV));
+ 
+-              perl_des_crypt(input, SvGROW(output, output_len), (i32 *)ks, 
enc_flag);
++              perl_des_crypt((unsigned char *)input, (unsigned char 
*)SvGROW(output, output_len),
++                             (unsigned long *)ks, enc_flag);
+ 
+               SvCUR_set(output, output_len);
+               *SvEND(output) = '\0';
+--- a/_des.h
++++ b/_des.h
+@@ -5,3 +5,5 @@ typedef unsigned long des_ks[32];
+ void _des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt );
+ void _des_expand_key( des_user_key userKey, des_ks key );
+ 
++void perl_des_expand_key(des_user_key userKey, des_ks ks);
++void perl_des_crypt( des_cblock input, des_cblock output, des_ks ks, int 
encrypt );
+

Reply via email to