git: 56b72f9ebb54 - main - net-p2p/ethash: New port: C/C++ implementation of Ethash and ProgPoW

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Thu, 13 Jan 2022 20:58:29 UTC
The branch main has been updated by nc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=56b72f9ebb5406d3536a9f81b01835ee4d88f9ce

commit 56b72f9ebb5406d3536a9f81b01835ee4d88f9ce
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2022-01-13 20:58:42 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2022-01-13 20:58:42 +0000

    net-p2p/ethash: New port: C/C++ implementation of Ethash and ProgPoW
---
 net-p2p/Makefile                                   |  1 +
 net-p2p/ethash/Makefile                            | 22 ++++++++++++++++++++++
 net-p2p/ethash/distinfo                            |  3 +++
 .../ethash/files/patch-lib_ethash_endianness.hpp   | 11 +++++++++++
 net-p2p/ethash/pkg-descr                           |  3 +++
 net-p2p/ethash/pkg-plist                           | 17 +++++++++++++++++
 6 files changed, 57 insertions(+)

diff --git a/net-p2p/Makefile b/net-p2p/Makefile
index a747f3945409..4eb6b19463b1 100644
--- a/net-p2p/Makefile
+++ b/net-p2p/Makefile
@@ -31,6 +31,7 @@
     SUBDIR += eiskaltdcpp-data
     SUBDIR += eiskaltdcpp-gtk
     SUBDIR += eiskaltdcpp-lib
+    SUBDIR += ethash
     SUBDIR += frost
     SUBDIR += go-ethereum
     SUBDIR += go-prysm
diff --git a/net-p2p/ethash/Makefile b/net-p2p/ethash/Makefile
new file mode 100644
index 000000000000..6eacfae84d55
--- /dev/null
+++ b/net-p2p/ethash/Makefile
@@ -0,0 +1,22 @@
+PORTNAME=	ethash
+PORTVERSION=	0.8.0
+DISTVERSIONPREFIX=	v
+CATEGORIES=	net-p2p
+
+MAINTAINER=	nc@FreeBSD.org
+COMMENT=	C/C++ implementation of Ethash and ProgPoW
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libbenchmark.so:devel/benchmark \
+		libgtest.so:devel/googletest
+
+USES=		cmake
+USE_GITHUB=	yes
+GH_ACCOUNT=	chfast
+
+CMAKE_OFF=	HUNTER_ENABLED
+
+.include <bsd.port.mk>
+
diff --git a/net-p2p/ethash/distinfo b/net-p2p/ethash/distinfo
new file mode 100644
index 000000000000..b64115f52a75
--- /dev/null
+++ b/net-p2p/ethash/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1642107104
+SHA256 (chfast-ethash-v0.8.0_GH0.tar.gz) = c53a39cd7b4687f1fcc6e4a561a0aaaab9ec0438ae818860dd4e98bb4ad2f153
+SIZE (chfast-ethash-v0.8.0_GH0.tar.gz) = 103991
diff --git a/net-p2p/ethash/files/patch-lib_ethash_endianness.hpp b/net-p2p/ethash/files/patch-lib_ethash_endianness.hpp
new file mode 100644
index 000000000000..4a7546acd522
--- /dev/null
+++ b/net-p2p/ethash/files/patch-lib_ethash_endianness.hpp
@@ -0,0 +1,11 @@
+--- lib/ethash/endianness.hpp.orig	2021-11-09 08:29:42 UTC
++++ lib/ethash/endianness.hpp
+@@ -24,7 +24,7 @@
+ #endif
+ #endif
+ 
+-#if __has_builtin(__builtin_bswap64) || defined(__GNUC__)
++#if (__has_builtin(__builtin_bswap64) || defined(__GNUC__)) && !defined(__FreeBSD__)
+ #define bswap32 __builtin_bswap32
+ #define bswap64 __builtin_bswap64
+ #elif defined(_MSC_VER)
diff --git a/net-p2p/ethash/pkg-descr b/net-p2p/ethash/pkg-descr
new file mode 100644
index 000000000000..258d166fcc22
--- /dev/null
+++ b/net-p2p/ethash/pkg-descr
@@ -0,0 +1,3 @@
+C/C++ implementation of Ethash - the Ethereum Proof of Work algorithm.
+
+WWW: https://github.com/chfast/ethash
diff --git a/net-p2p/ethash/pkg-plist b/net-p2p/ethash/pkg-plist
new file mode 100644
index 000000000000..864574db3151
--- /dev/null
+++ b/net-p2p/ethash/pkg-plist
@@ -0,0 +1,17 @@
+include/ethash/ethash.h
+include/ethash/ethash.hpp
+include/ethash/global_context.h
+include/ethash/global_context.hpp
+include/ethash/hash_types.h
+include/ethash/hash_types.hpp
+include/ethash/keccak.h
+include/ethash/keccak.hpp
+include/ethash/progpow.hpp
+include/ethash/version.h
+lib/cmake/ethash/ethashConfig.cmake
+lib/cmake/ethash/ethashConfigVersion.cmake
+lib/cmake/ethash/ethashTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/ethash/ethashTargets.cmake
+lib/libethash-global-context.a
+lib/libethash.a
+lib/libkeccak.a