commit:     5e67e9544d195f29a9507da146ea62f15f0bcc99
Author:     Victor Skovorodnikov <victor3.14 <AT> yandex <DOT> com>
AuthorDate: Sun Oct  1 16:42:24 2023 +0000
Commit:     Victor Skovorodnikov <victor3.14 <AT> yandex <DOT> com>
CommitDate: Sun Oct  1 16:49:28 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5e67e954

net-p2p/dogecoin-qt: avx2 intel support and patch

- Adding avx2 intel support with intel patch check at pkg_pretend phase
- Removed duplicate gcc13 patch file

Signed-off-by: Victor Skovorodnikov <victor3.14 <AT> yandex.com>

 net-p2p/dogecoin-qt/dogecoin-qt-1.14.6.ebuild              | 14 +++++++++++++-
 net-p2p/dogecoin-qt/files/1.14.6-gcc13.patch               | 13 -------------
 .../files/intel-ipsec-mb/remove_digest_init.patch          | 13 +++++++++++++
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/net-p2p/dogecoin-qt/dogecoin-qt-1.14.6.ebuild 
b/net-p2p/dogecoin-qt/dogecoin-qt-1.14.6.ebuild
index f6551e749d..e7a887d145 100644
--- a/net-p2p/dogecoin-qt/dogecoin-qt-1.14.6.ebuild
+++ b/net-p2p/dogecoin-qt/dogecoin-qt-1.14.6.ebuild
@@ -12,7 +12,7 @@ LICENSE="MIT"
 SLOT="0"
 DB_VER="5.3"
 KEYWORDS="~amd64 ~arm64"
-IUSE="dogecoind +pie +prune +ssp tests utils +wallet zmq"
+IUSE="cpu_flags_x86_avx2 dogecoind +pie +prune +ssp tests utils +wallet zmq"
 REQUIRED_USE="dogecoind? ( utils )"
 DOGEDIR="/opt/${PN}"
 DEPEND="
@@ -30,6 +30,7 @@ DEPEND="
        dev-qt/qtnetwork
        dev-qt/qtprintsupport
        dev-qt/linguist-tools:=
+       cpu_flags_x86_avx2? ( app-crypt/intel-ipsec-mb )
        wallet? ( media-gfx/qrencode )
        zmq? ( net-libs/cppzmq )
 "
@@ -50,6 +51,16 @@ PATCHES=(
 WORKDIR_="${WORKDIR}/dogecoin-${PV}"
 S=${WORKDIR_}
 
+pkg_pretend() {
+
+       if use cpu_flags_x86_avx2 && [[ ! -e 
"${ROOT}"/etc/portage/patches/app-crypt/intel-ipsec-mb/remove_digest_init.patch 
]]; then
+               eerror 
"${ROOT}/etc/portage/patches/app-crypt/intel-ipsec-mb/remove_digest_init.patch 
does not exist!"
+               eerror "To build with avx2 intel support, please create 
${ROOT}/etc/portage/patches/app-crypt/intel-ipsec-mb directory"
+               eerror "and copy patch from package 
net-p2p/dogecoin-qt/files/intel-ipsec-mb/remove_digest_init.patch into that 
directory"
+               die     
+       fi
+}
+
 src_prepare() {
 
        if use pie && use ssp ; then
@@ -74,6 +85,7 @@ src_configure() {
                --bindir="${DOGEDIR}/bin"
                --with-gui=qt5
                --disable-bench
+               $(use_with cpu_flags_x86_avx2 intel-avx2)
                $(use_with dogecoind daemon)
                $(use_with utils utils)
                $(use_enable wallet)

diff --git a/net-p2p/dogecoin-qt/files/1.14.6-gcc13.patch 
b/net-p2p/dogecoin-qt/files/1.14.6-gcc13.patch
deleted file mode 100644
index 0e4852815b..0000000000
--- a/net-p2p/dogecoin-qt/files/1.14.6-gcc13.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-# Fixes error when building with gcc13
-diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp
-index ccebbe8..9d57846 100644
---- a/src/support/lockedpool.cpp
-+++ b/src/support/lockedpool.cpp
-@@ -5,6 +5,7 @@
- 
- #include "support/lockedpool.h"
- #include "support/cleanse.h"
-+#include <stdexcept>
- 
- #if defined(HAVE_CONFIG_H)
- #include "config/bitcoin-config.h"

diff --git a/net-p2p/dogecoin-qt/files/intel-ipsec-mb/remove_digest_init.patch 
b/net-p2p/dogecoin-qt/files/intel-ipsec-mb/remove_digest_init.patch
new file mode 100644
index 0000000000..0a8a5f3ba9
--- /dev/null
+++ b/net-p2p/dogecoin-qt/files/intel-ipsec-mb/remove_digest_init.patch
@@ -0,0 +1,13 @@
+diff -dur a/lib/include/sha_generic.h b/lib/include/sha_generic.h
+index 3752546..77efd91 100644
+--- a/lib/include/sha_generic.h
++++ b/lib/include/sha_generic.h
+@@ -308,7 +308,7 @@ void sha_generic_1block(const void *data, void *digest,
+         if (data == NULL || digest == NULL)
+                 return;
+ #endif
+-        sha_generic_init(digest, sha_type);
++//        sha_generic_init(digest, sha_type);
+         sha_generic_one_block(data, digest, is_avx, sha_type);
+ #ifdef SAFE_DATA
+         clear_scratch_gps();

Reply via email to