summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesus P Rey (Chuso) <gentoo@chuso.net>2021-07-15 20:56:30 +0200
committerSam James <sam@gentoo.org>2021-07-16 02:33:18 +0100
commit207859482e3cca4d24bbb1d96e7a0f3511725d38 (patch)
tree09355c0c0511bfb5d9298e890d85209763a4ed77 /net-p2p
parentmedia-tv/plex-media-server: remove old versions (diff)
downloadgentoo-207859482e3cca4d24bbb1d96e7a0f3511725d38.tar.gz
gentoo-207859482e3cca4d24bbb1d96e7a0f3511725d38.tar.bz2
gentoo-207859482e3cca4d24bbb1d96e7a0f3511725d38.zip
net-p2p/mldonkey: Patch for C++17 support.
Signed-off-by: Jesus P Rey <gentoo@chuso.net> Closes: https://bugs.gentoo.org/790134 Closes: https://github.com/gentoo/gentoo/pull/21663 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/mldonkey/files/cpp17-byte-namespace.patch63
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild2
2 files changed, 65 insertions, 0 deletions
diff --git a/net-p2p/mldonkey/files/cpp17-byte-namespace.patch b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
new file mode 100644
index 000000000000..0b1ca44e8eed
--- /dev/null
+++ b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
@@ -0,0 +1,63 @@
+diff -ur a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc
+--- a/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:46.675183781 +0200
++++ b/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:51.025182789 +0200
+@@ -9482,7 +9482,7 @@
+ #define PRIVKEYSIZE 384
+
+ static Signer* s_signer = NULL;
+-static byte m_publicKey[MAXPUBKEYSIZE+1];
++static CryptoPP::byte m_publicKey[MAXPUBKEYSIZE+1];
+ static unsigned long m_publicKeyLen = 0;
+
+ void cc_lprintf_nl(const char * msg, bool verb);
+@@ -9555,7 +9555,7 @@
+
+
+ // return signatureSize (buf)
+-int createSignature(byte *buf, int maxLen, byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
++int createSignature(CryptoPP::byte *buf, int maxLen, CryptoPP::byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
+
+ int result = 0;
+
+@@ -9570,7 +9570,7 @@
+ CryptoPP::SecByteBlock sBB(s_signer->SignatureLength());
+ CryptoPP::AutoSeededRandomPool rng;
+
+- byte bArray[MAXPUBKEYSIZE+9];
++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
+
+ memcpy(bArray,key,keyLen);
+ PokeUInt32(bArray+keyLen,cInt);
+@@ -9597,7 +9597,7 @@
+
+ }
+
+-int verifySignature(byte *key, int keyLen, byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
++int verifySignature(CryptoPP::byte *key, int keyLen, CryptoPP::byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
+ using namespace CryptoPP;
+
+ bool result = false;
+@@ -9607,7 +9607,7 @@
+ StringSource ss_Pubkey(key, keyLen,true,0);
+ Verifier pubKey(ss_Pubkey);
+
+- byte bArray[MAXPUBKEYSIZE+9];
++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
+
+ memcpy(bArray,m_publicKey,m_publicKeyLen);
+ PokeUInt32(bArray+m_publicKeyLen,cInt);
+diff -ur a/src/utils/lib/CryptoPP.h b/src/utils/lib/CryptoPP.h
+--- a/src/utils/lib/CryptoPP.h 2021-07-06 22:20:46.675183781 +0200
++++ b/src/utils/lib/CryptoPP.h 2021-07-06 22:20:56.271848200 +0200
+@@ -181,10 +181,9 @@
+ # define __USE_W32_SOCKETS
+ #endif
+
+-typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
+-
+ NAMESPACE_BEGIN(CryptoPP)
+
++typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
+ typedef unsigned short word16;
+ typedef unsigned int word32;
+
diff --git a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
index 8557ea1a285e..c1bb19df5b69 100644
--- a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
+++ b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
@@ -51,6 +51,8 @@ DEPEND="${COMMON_DEPEND}
RESTRICT="!ocamlopt? ( strip )"
+PATCHES=( "${FILESDIR}/cpp17-byte-namespace.patch" )
+
S="${WORKDIR}/${P}-2"
pkg_setup() {