Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/
Date: Fri, 16 Jul 2021 01:34:59
Message-Id: 1626399198.207859482e3cca4d24bbb1d96e7a0f3511725d38.sam@gentoo
1 commit: 207859482e3cca4d24bbb1d96e7a0f3511725d38
2 Author: Jesus P Rey (Chuso) <gentoo <AT> chuso <DOT> net>
3 AuthorDate: Thu Jul 15 18:56:30 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 16 01:33:18 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20785948
7
8 net-p2p/mldonkey: Patch for C++17 support.
9
10 Signed-off-by: Jesus P Rey <gentoo <AT> chuso.net>
11 Closes: https://bugs.gentoo.org/790134
12 Closes: https://github.com/gentoo/gentoo/pull/21663
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 net-p2p/mldonkey/files/cpp17-byte-namespace.patch | 63 +++++++++++++++++++++++
16 net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild | 2 +
17 2 files changed, 65 insertions(+)
18
19 diff --git a/net-p2p/mldonkey/files/cpp17-byte-namespace.patch b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
20 new file mode 100644
21 index 00000000000..0b1ca44e8ee
22 --- /dev/null
23 +++ b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
24 @@ -0,0 +1,63 @@
25 +diff -ur a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc
26 +--- a/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:46.675183781 +0200
27 ++++ b/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:51.025182789 +0200
28 +@@ -9482,7 +9482,7 @@
29 + #define PRIVKEYSIZE 384
30 +
31 + static Signer* s_signer = NULL;
32 +-static byte m_publicKey[MAXPUBKEYSIZE+1];
33 ++static CryptoPP::byte m_publicKey[MAXPUBKEYSIZE+1];
34 + static unsigned long m_publicKeyLen = 0;
35 +
36 + void cc_lprintf_nl(const char * msg, bool verb);
37 +@@ -9555,7 +9555,7 @@
38 +
39 +
40 + // return signatureSize (buf)
41 +-int createSignature(byte *buf, int maxLen, byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
42 ++int createSignature(CryptoPP::byte *buf, int maxLen, CryptoPP::byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
43 +
44 + int result = 0;
45 +
46 +@@ -9570,7 +9570,7 @@
47 + CryptoPP::SecByteBlock sBB(s_signer->SignatureLength());
48 + CryptoPP::AutoSeededRandomPool rng;
49 +
50 +- byte bArray[MAXPUBKEYSIZE+9];
51 ++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
52 +
53 + memcpy(bArray,key,keyLen);
54 + PokeUInt32(bArray+keyLen,cInt);
55 +@@ -9597,7 +9597,7 @@
56 +
57 + }
58 +
59 +-int verifySignature(byte *key, int keyLen, byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
60 ++int verifySignature(CryptoPP::byte *key, int keyLen, CryptoPP::byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
61 + using namespace CryptoPP;
62 +
63 + bool result = false;
64 +@@ -9607,7 +9607,7 @@
65 + StringSource ss_Pubkey(key, keyLen,true,0);
66 + Verifier pubKey(ss_Pubkey);
67 +
68 +- byte bArray[MAXPUBKEYSIZE+9];
69 ++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
70 +
71 + memcpy(bArray,m_publicKey,m_publicKeyLen);
72 + PokeUInt32(bArray+m_publicKeyLen,cInt);
73 +diff -ur a/src/utils/lib/CryptoPP.h b/src/utils/lib/CryptoPP.h
74 +--- a/src/utils/lib/CryptoPP.h 2021-07-06 22:20:46.675183781 +0200
75 ++++ b/src/utils/lib/CryptoPP.h 2021-07-06 22:20:56.271848200 +0200
76 +@@ -181,10 +181,9 @@
77 + # define __USE_W32_SOCKETS
78 + #endif
79 +
80 +-typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
81 +-
82 + NAMESPACE_BEGIN(CryptoPP)
83 +
84 ++typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
85 + typedef unsigned short word16;
86 + typedef unsigned int word32;
87 +
88
89 diff --git a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
90 index 8557ea1a285..c1bb19df5b6 100644
91 --- a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
92 +++ b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
93 @@ -51,6 +51,8 @@ DEPEND="${COMMON_DEPEND}
94
95 RESTRICT="!ocamlopt? ( strip )"
96
97 +PATCHES=( "${FILESDIR}/cpp17-byte-namespace.patch" )
98 +
99 S="${WORKDIR}/${P}-2"
100
101 pkg_setup() {