summaryrefslogtreecommitdiff
path: root/dev-libs
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2019-11-06 02:26:17 +0000
committerBertrand Jacquin <bertrand@jacquin.bzh>2019-11-06 02:26:29 +0000
commit5494e3e9d41757663786c3e12835c926b8a21976 (patch)
tree2aafc2fe665cc0d22cecce4ba1ff3a14eb8f805f /dev-libs
parentapp-crypt/vanitysearch: bitcoin address prefix finder (diff)
downloadportage-5494e3e9d41757663786c3e12835c926b8a21976.tar.xz
dev-libs/randomx: Proof-of-work algorithm for general-purpose CPUs
Package-Manager: Portage-2.3.76, Repoman-2.3.16
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/randomx/Manifest1
-rw-r--r--dev-libs/randomx/files/1.1.6-build-mark-src-randomx.h-as-a-public-header.patch23
-rw-r--r--dev-libs/randomx/files/1.1.6-build-remove-hardcoded-lib-destination.patch28
-rw-r--r--dev-libs/randomx/metadata.xml8
-rw-r--r--dev-libs/randomx/randomx-1.1.6.ebuild35
5 files changed, 95 insertions, 0 deletions
diff --git a/dev-libs/randomx/Manifest b/dev-libs/randomx/Manifest
new file mode 100644
index 00000000..0360b35b
--- /dev/null
+++ b/dev-libs/randomx/Manifest
@@ -0,0 +1 @@
+DIST randomx-1.1.6.tar.gz 1708251 BLAKE2B 55fc6d726eae9bdcb897ea02a277d11a7e29974f90db8af20a173fca2c7ab543d365c3a4599965282b909ba999c128a5d488099cc633d4a66574d92dc8aa519f SHA512 c59ebccd5ddc7690824b8fc68c4492f1a00d785e5820a69a73361ae639d66d2a6d1589e8b9783666edf29374516e4e1ca3a887393bab8b98bd0086e4783ac3c8
diff --git a/dev-libs/randomx/files/1.1.6-build-mark-src-randomx.h-as-a-public-header.patch b/dev-libs/randomx/files/1.1.6-build-mark-src-randomx.h-as-a-public-header.patch
new file mode 100644
index 00000000..0b4e9d35
--- /dev/null
+++ b/dev-libs/randomx/files/1.1.6-build-mark-src-randomx.h-as-a-public-header.patch
@@ -0,0 +1,23 @@
+From c1f958cb35904540c8c1a19dd8c9d7bb7004eca9 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Wed, 6 Nov 2019 01:59:07 +0000
+Subject: [PATCH 2/2] build: mark src/randomx.h as a public header
+
+this allow src/randomx.h to be installed in /usr/include/randomx.h
+automagically during make install
+---
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4b54a5ba613c..85da159bd23c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -157,6 +157,7 @@ add_library(randomx
+ set_property(TARGET randomx PROPERTY POSITION_INDEPENDENT_CODE ON)
+ set_property(TARGET randomx PROPERTY CXX_STANDARD 11)
+ set_property(TARGET randomx PROPERTY CXX_STANDARD_REQUIRED ON)
++set_property(TARGET randomx PROPERTY PUBLIC_HEADER src/randomx.h)
+ install(TARGETS randomx
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/dev-libs/randomx/files/1.1.6-build-remove-hardcoded-lib-destination.patch b/dev-libs/randomx/files/1.1.6-build-remove-hardcoded-lib-destination.patch
new file mode 100644
index 00000000..f036c8d6
--- /dev/null
+++ b/dev-libs/randomx/files/1.1.6-build-remove-hardcoded-lib-destination.patch
@@ -0,0 +1,28 @@
+From a1d310c36ce8254cc7d24524fe3307f2c5394445 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Wed, 6 Nov 2019 01:44:05 +0000
+Subject: [PATCH 1/2] build: remove hardcoded lib/ destination
+
+cmake internally has a logic to know where is the best place to install
+a given library. For example on amd64 it does not make sense to install
+the library in /usr/lib, this change allow the library to the installed
+in /usr/lib64
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 40f03541ed0d..4b54a5ba613c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -158,8 +158,8 @@ set_property(TARGET randomx PROPERTY POSITION_INDEPENDENT_CODE ON)
+ set_property(TARGET randomx PROPERTY CXX_STANDARD 11)
+ set_property(TARGET randomx PROPERTY CXX_STANDARD_REQUIRED ON)
+ install(TARGETS randomx
+- ARCHIVE DESTINATION lib
+- LIBRARY DESTINATION lib)
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ add_executable(randomx-tests
+ src/tests/tests.cpp)
diff --git a/dev-libs/randomx/metadata.xml b/dev-libs/randomx/metadata.xml
new file mode 100644
index 00000000..82f7232e
--- /dev/null
+++ b/dev-libs/randomx/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bertrand@jacquin.bzh</email>
+ <name>Bertrand Jacquin</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-libs/randomx/randomx-1.1.6.ebuild b/dev-libs/randomx/randomx-1.1.6.ebuild
new file mode 100644
index 00000000..f2e071e3
--- /dev/null
+++ b/dev-libs/randomx/randomx-1.1.6.ebuild
@@ -0,0 +1,35 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit cmake-multilib
+
+DESCRIPTION="Proof-of-work algorithm that is optimized for general-purpose CPUs"
+HOMEPAGE="https://github.com/tevador/RandomX"
+SRC_URI="https://github.com/tevador/RandomX/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+BDEPEND=">=dev-util/cmake-2.8.7"
+
+S="${WORKDIR}/RandomX-${PV}"
+
+CMAKE_BUILD_TYPE=Release
+
+PATCHES=(
+ "${FILESDIR}/${PV}-build-remove-hardcoded-lib-destination.patch"
+ "${FILESDIR}/${PV}-build-mark-src-randomx.h-as-a-public-header.patch"
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DARCH=native
+ )
+
+ cmake-multilib_src_configure
+}