summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@gentoo.org>2019-11-27 17:16:50 -0500
committerCraig Andrews <candrews@gentoo.org>2019-11-28 12:06:27 -0500
commit689374c04d16806fb4d5aac889c9088f0b430774 (patch)
tree50bf4054bf531bf8699d60525366dfc1c3b3dafc /net-p2p
parentmedia-libs/opencv: version bump 4.1.2 (diff)
downloadgentoo-689374c04d16806fb4d5aac889c9088f0b430774.tar.gz
gentoo-689374c04d16806fb4d5aac889c9088f0b430774.tar.bz2
gentoo-689374c04d16806fb4d5aac889c9088f0b430774.zip
net-p2p/xmr-stak-rx: Monero RandomX Miner
Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/xmr-stak-rx/Manifest1
-rw-r--r--net-p2p/xmr-stak-rx/files/xmr-stak-rx24
-rw-r--r--net-p2p/xmr-stak-rx/files/xmr-stak-rx.service32
-rw-r--r--net-p2p/xmr-stak-rx/metadata.xml17
-rw-r--r--net-p2p/xmr-stak-rx/xmr-stak-rx-1.0.1.ebuild65
-rw-r--r--net-p2p/xmr-stak-rx/xmr-stak-rx-9999.ebuild65
6 files changed, 204 insertions, 0 deletions
diff --git a/net-p2p/xmr-stak-rx/Manifest b/net-p2p/xmr-stak-rx/Manifest
new file mode 100644
index 000000000000..a85b06cd7446
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/Manifest
@@ -0,0 +1 @@
+DIST xmr-stak-rx-1.0.1.tar.gz 500735 BLAKE2B 112b75122f35358c8558dec116a5f37bbbd13e9f57a767e03e85da37ab4a408831aa50bf5f2415451f776492b42c5a4a36de730fefc7d99bb13f437c9007d549 SHA512 488884948ad66445c37725397152201883feef8aff5afecaa93297a5bb45e65173b095e2e796d729bd8e9c778e94ee6fb65146250be54c39b10635a2569b6866
diff --git a/net-p2p/xmr-stak-rx/files/xmr-stak-rx b/net-p2p/xmr-stak-rx/files/xmr-stak-rx
new file mode 100644
index 000000000000..7803b4eb27a6
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/files/xmr-stak-rx
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms fo the GNU General Public License, v2
+# /etc/init.d/xmr-stak-rx
+name="xmr-stak-rx"
+description="Free RandomX miner"
+pidfile=/run/xmr-stak-rx.pid
+command=/usr/bin/xmr-stak-rx
+command_args="--cpu /etc/xmr-stak-rx/cpu.config --amd /etc/xmr-stak-rx/amd.config --nvidia /etc/xmr-stak-rx/nvidia.config -c /etc/xmr-stak-rx/main.config -C /etc/xmr-stak-rx/pools.txt"
+start_stop_daemon_args="--background --make-pidfile"
+
+start_pre() {
+ if [ ! -r /etc/xmr-stak-rx/main.config ]; then
+ eerror "/etc/xmr-stak-rx/main.config is missing."
+ errror "Run:"
+ eerror "/usr/bin/xmr-stak-rx --cpu /etc/xmr-stak-rx/cpu.config --amd /etc/xmr-stak-rx/amd.config --nvidia /etc/xmr-stak-rx/nvidia.config -c /etc/xmr-stak-rx/main.config -C /etc/xmr-stak-rx/pools.txt"
+ errror "xmr-stak-rx can now be terminated and this service can be started"
+ return 1
+ fi
+}
+
+depend() {
+ use dns net
+}
diff --git a/net-p2p/xmr-stak-rx/files/xmr-stak-rx.service b/net-p2p/xmr-stak-rx/files/xmr-stak-rx.service
new file mode 100644
index 000000000000..d65af4945dfb
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/files/xmr-stak-rx.service
@@ -0,0 +1,32 @@
+[Unit]
+Description=Monero RandomX Miner
+After=network-online.target
+AssertFileNotEmpty=/etc/xmr-stak-rx/main.config
+
+[Service]
+Environment=GPU_FORCE_64BIT_PTR=1
+Environment=GPU_MAX_HEAP_SIZE=100
+Environment=GPU_USE_SYNC_OBJECTS=1
+Environment=GPU_MAX_ALLOC_PERCENT=100
+Environment=GPU_SINGLE_ALLOC_PERCENT=100
+ExecStart=/usr/bin/xmr-stak-rx --cpu /etc/xmr-stak-rx/cpu.config --amd /etc/xmr-stak-rx/amd.config --nvidia /etc/xmr-stak-rx/nvidia.config -c /etc/xmr-stak-rx/main.config -C /etc/xmr-stak-rx/pools.txt
+DynamicUser=true
+Group=video
+CPUSchedulingPolicy=idle
+PrivateTmp=true
+ProtectHome=true
+ProtectSystem=strict
+NoNewPrivileges=true
+CapabilityBoundingSet=
+MemoryDenyWriteExecute=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectControlGroups=true
+RestrictRealtime=true
+RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
+RestrictNamespaces=true
+PrivateUsers=true
+ConfigurationDirectory=xmr-stak-rx
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/xmr-stak-rx/metadata.xml b/net-p2p/xmr-stak-rx/metadata.xml
new file mode 100644
index 000000000000..e487487db1db
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>candrews@gentoo.org</email>
+ <name>Craig Andrews</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">fireice-uk/xmr-stak</remote-id>
+ </upstream>
+ <use>
+ <flag name="cuda">Enable NVIDIA CUDA toolkit support</flag>
+ <flag name="hwloc">Enable CPU affinity support via hwloc</flag>
+ <flag name="opencl">Enable OpenCL support</flag>
+ <flag name="webserver">Enable internal webserver</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/xmr-stak-rx/xmr-stak-rx-1.0.1.ebuild b/net-p2p/xmr-stak-rx/xmr-stak-rx-1.0.1.ebuild
new file mode 100644
index 000000000000..5bd13426b524
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/xmr-stak-rx-1.0.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils systemd
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
+ EGIT_BRANCH="xmr-stak-rx-dev"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}-rx.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/xmr-stak-${PV}-rx"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Monero RandomX Miner"
+HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cuda hwloc opencl ssl webserver"
+
+DEPEND="cuda? ( dev-util/nvidia-cuda-toolkit )
+ hwloc? ( sys-apps/hwloc )
+ opencl? ( virtual/opencl )
+ ssl? ( dev-libs/openssl:0= )
+ webserver? ( net-libs/libmicrohttpd )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCUDA_ENABLE=$(usex cuda)
+ -DHWLOC_ENABLE=$(usex hwloc)
+ -DMICROHTTPD_ENABLE=$(usex webserver)
+ -DOpenCL_ENABLE=$(usex opencl)
+ -DOpenSSL_ENABLE=$(usex ssl)
+ -DLIBRARY_OUTPUT_PATH=$(get_libdir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
+ doinitd "${FILESDIR}"/${PN}
+ dodir /etc/xmr-stak-rx
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/etc/xmr-stak-rx/main.config" ]; then
+ ewarn "To use xmr-stack-rx:"
+ if use cuda || use opencl; then
+ ewarn "As root or as a user that is a member of the 'video' group,"
+ fi
+ ewarn "run:"
+ ewarn "/usr/bin/xmr-stak-rx --cpu /etc/xmr-stak-rx/cpu.config --amd /etc/xmr-stak-rx/amd.config --nvidia /etc/xmr-stak-rx/nvidia.config -c /etc/xmr-stak-rx/main.config -C /etc/xmr-stak-rx/pools.txt"
+ ewarn "xmr-stak-rx can now be terminated and 'systemctl start xmr-stak-rx' or '/etc/init.d/xmr-stak-rx start' can be used."
+ fi
+}
diff --git a/net-p2p/xmr-stak-rx/xmr-stak-rx-9999.ebuild b/net-p2p/xmr-stak-rx/xmr-stak-rx-9999.ebuild
new file mode 100644
index 000000000000..5bd13426b524
--- /dev/null
+++ b/net-p2p/xmr-stak-rx/xmr-stak-rx-9999.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils systemd
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
+ EGIT_BRANCH="xmr-stak-rx-dev"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}-rx.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/xmr-stak-${PV}-rx"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Monero RandomX Miner"
+HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cuda hwloc opencl ssl webserver"
+
+DEPEND="cuda? ( dev-util/nvidia-cuda-toolkit )
+ hwloc? ( sys-apps/hwloc )
+ opencl? ( virtual/opencl )
+ ssl? ( dev-libs/openssl:0= )
+ webserver? ( net-libs/libmicrohttpd )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCUDA_ENABLE=$(usex cuda)
+ -DHWLOC_ENABLE=$(usex hwloc)
+ -DMICROHTTPD_ENABLE=$(usex webserver)
+ -DOpenCL_ENABLE=$(usex opencl)
+ -DOpenSSL_ENABLE=$(usex ssl)
+ -DLIBRARY_OUTPUT_PATH=$(get_libdir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
+ doinitd "${FILESDIR}"/${PN}
+ dodir /etc/xmr-stak-rx
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/etc/xmr-stak-rx/main.config" ]; then
+ ewarn "To use xmr-stack-rx:"
+ if use cuda || use opencl; then
+ ewarn "As root or as a user that is a member of the 'video' group,"
+ fi
+ ewarn "run:"
+ ewarn "/usr/bin/xmr-stak-rx --cpu /etc/xmr-stak-rx/cpu.config --amd /etc/xmr-stak-rx/amd.config --nvidia /etc/xmr-stak-rx/nvidia.config -c /etc/xmr-stak-rx/main.config -C /etc/xmr-stak-rx/pools.txt"
+ ewarn "xmr-stak-rx can now be terminated and 'systemctl start xmr-stak-rx' or '/etc/init.d/xmr-stak-rx start' can be used."
+ fi
+}