From 5494e3e9d41757663786c3e12835c926b8a21976 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Wed, 6 Nov 2019 02:26:17 +0000 Subject: dev-libs/randomx: Proof-of-work algorithm for general-purpose CPUs Package-Manager: Portage-2.3.76, Repoman-2.3.16 --- dev-libs/randomx/Manifest | 1 + ...ild-mark-src-randomx.h-as-a-public-header.patch | 23 ++++++++++++++ ....6-build-remove-hardcoded-lib-destination.patch | 28 +++++++++++++++++ dev-libs/randomx/metadata.xml | 8 +++++ dev-libs/randomx/randomx-1.1.6.ebuild | 35 ++++++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 dev-libs/randomx/Manifest create mode 100644 dev-libs/randomx/files/1.1.6-build-mark-src-randomx.h-as-a-public-header.patch create mode 100644 dev-libs/randomx/files/1.1.6-build-remove-hardcoded-lib-destination.patch create mode 100644 dev-libs/randomx/metadata.xml create mode 100644 dev-libs/randomx/randomx-1.1.6.ebuild (limited to 'dev-libs') 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 +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 +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 @@ + + + + + bertrand@jacquin.bzh + Bertrand Jacquin + + 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 +} -- cgit v1.2.3