summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2023-09-04 10:40:20 -0700
committerYuri Victorovich <yuri@FreeBSD.org>2023-09-04 10:40:50 -0700
commit4d3be3c0d914e2fbc5f155c74a5915af2ea37b54 (patch)
tree962ca4f88336e07d0932504b2548e021ab2f7516 /misc
parentaa9c959a282c698c5fcf8087664e860e664c93fe (diff)
downloadfreebsd-ports-4d3be3c0d914e2fbc5f155c74a5915af2ea37b54.zip
misc/randomx: New port: Proof of work algorithm based on random code execution
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile1
-rw-r--r--misc/randomx/Makefile30
-rw-r--r--misc/randomx/distinfo3
-rw-r--r--misc/randomx/files/patch-CMakeLists.txt17
-rw-r--r--misc/randomx/pkg-descr4
5 files changed, 55 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 107fc608f44d..31a5c25df116 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -502,6 +502,7 @@
SUBDIR += qt6-examples
SUBDIR += qt6ct
SUBDIR += quantum++
+ SUBDIR += randomx
SUBDIR += raspberrypi-gpioshutdown
SUBDIR += raspberrypi-userland
SUBDIR += raspbsd-led
diff --git a/misc/randomx/Makefile b/misc/randomx/Makefile
new file mode 100644
index 000000000000..cacf47371c9e
--- /dev/null
+++ b/misc/randomx/Makefile
@@ -0,0 +1,30 @@
+PORTNAME= randomx
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.1.10-28
+DISTVERSIONSUFFIX= -g67ea010
+CATEGORIES= misc
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Proof of work algorithm based on random code execution
+WWW= https://github.com/tevador/RandomX
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= cmake:testing compiler:c++11-lang
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= tevador
+GH_PROJECT= RandomX
+
+CMAKE_ON= BUILD_SHARED_LIBS
+CMAKE_TESTING_TARGET=
+
+PLIST_FILES= include/randomx.h \
+ lib/librandomx.so
+
+post-test: # run tests
+ @cd ${BUILD_WRKSRC} && ./randomx-tests
+
+.include <bsd.port.mk>
diff --git a/misc/randomx/distinfo b/misc/randomx/distinfo
new file mode 100644
index 000000000000..7ff79618688a
--- /dev/null
+++ b/misc/randomx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1693848545
+SHA256 (tevador-RandomX-v1.1.10-28-g67ea010_GH0.tar.gz) = 4ee0eda587b91b7812ab638a9d8d68b637f105145945dab7ddbcfc126e52c8d5
+SIZE (tevador-RandomX-v1.1.10-28-g67ea010_GH0.tar.gz) = 165919
diff --git a/misc/randomx/files/patch-CMakeLists.txt b/misc/randomx/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..956b88a592d2
--- /dev/null
+++ b/misc/randomx/files/patch-CMakeLists.txt
@@ -0,0 +1,17 @@
+--- CMakeLists.txt.orig 2023-09-04 17:31:42 UTC
++++ CMakeLists.txt
+@@ -192,6 +192,8 @@ install(TARGETS randomx
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
++if (${BUILD_TESTING})
++
+ add_executable(randomx-tests
+ src/tests/tests.cpp)
+ target_link_libraries(randomx-tests
+@@ -234,3 +236,5 @@ if(NOT HAVE_CXX_ATOMICS)
+ endif()
+ set_property(TARGET randomx-benchmark PROPERTY POSITION_INDEPENDENT_CODE ON)
+ set_property(TARGET randomx-benchmark PROPERTY CXX_STANDARD 11)
++
++endif()
diff --git a/misc/randomx/pkg-descr b/misc/randomx/pkg-descr
new file mode 100644
index 000000000000..253a3ba3dda5
--- /dev/null
+++ b/misc/randomx/pkg-descr
@@ -0,0 +1,4 @@
+RandomX is a proof-of-work (PoW) algorithm that is optimized for general-purpose
+CPUs. RandomX uses random code execution (hence the name) together with several
+memory-hard techniques to minimize the efficiency advantage of specialized
+hardware.