Skip to content

Commit

Permalink
misc/randomx: New port: Proof of work algorithm based on random code …
Browse files Browse the repository at this point in the history
…execution
  • Loading branch information
yurivict committed Sep 4, 2023
1 parent aa9c959 commit 4d3be3c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions misc/Makefile
Expand Up @@ -502,6 +502,7 @@
SUBDIR += qt6-examples
SUBDIR += qt6ct
SUBDIR += quantum++
SUBDIR += randomx
SUBDIR += raspberrypi-gpioshutdown
SUBDIR += raspberrypi-userland
SUBDIR += raspbsd-led
Expand Down
30 changes: 30 additions & 0 deletions 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>
3 changes: 3 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions 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()
4 changes: 4 additions & 0 deletions 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.

0 comments on commit 4d3be3c

Please sign in to comment.