summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@gentoo.org>2017-12-23 10:37:54 -0500
committerCraig Andrews <candrews@gentoo.org>2017-12-23 14:10:31 -0500
commit0ff9128b8023fd2f9730d06c7e92338c04ce1448 (patch)
tree85da3571fd1f09c8e1259e2547dc1619bbfec011 /net-p2p
parentsci-electronics/gwave: Restrict guile-2.2, thanks Juergen Rose. (diff)
downloadgentoo-0ff9128b8023fd2f9730d06c7e92338c04ce1448.tar.gz
gentoo-0ff9128b8023fd2f9730d06c7e92338c04ce1448.tar.bz2
gentoo-0ff9128b8023fd2f9730d06c7e92338c04ce1448.zip
net-p2p/xmr-stak: Unified all-in-one Monero miner
Package-Manager: Portage-2.3.19, Repoman-2.3.6
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/xmr-stak/Manifest1
-rw-r--r--net-p2p/xmr-stak/files/xmr-stak.service32
-rw-r--r--net-p2p/xmr-stak/metadata.xml18
-rw-r--r--net-p2p/xmr-stak/xmr-stak-2.2.0.ebuild64
-rw-r--r--net-p2p/xmr-stak/xmr-stak-9999.ebuild64
5 files changed, 179 insertions, 0 deletions
diff --git a/net-p2p/xmr-stak/Manifest b/net-p2p/xmr-stak/Manifest
new file mode 100644
index 000000000000..6fa84342d869
--- /dev/null
+++ b/net-p2p/xmr-stak/Manifest
@@ -0,0 +1 @@
+DIST xmr-stak-2.2.0.tar.gz 316309 BLAKE2B 8a5042e91eff1d7a49dcf50d67430f21459509443117150f59f861edb0c145e0f336cb617ea4f2a7edfd923493efbc8f5ce9cd134a7f7af14b270c8cfdd3cc24 SHA512 1ec30b1f97043307461816e61cb7afaf9e77cfad895b13f5facf98f34da8d9b8751d9885930b0a38777017978fb4f25bb3a69a1c2a5db47b1a851bc88cd7d78d
diff --git a/net-p2p/xmr-stak/files/xmr-stak.service b/net-p2p/xmr-stak/files/xmr-stak.service
new file mode 100644
index 000000000000..00f63c0dcd96
--- /dev/null
+++ b/net-p2p/xmr-stak/files/xmr-stak.service
@@ -0,0 +1,32 @@
+[Unit]
+Description=Unified all-in-one Monero miner
+After=network-online.target
+AssertFileNotEmpty=/etc/xmr-stak/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 --cpu /etc/xmr-stak/cpu.config --amd /etc/xmr-stak/amd.config --nvidia /etc/xmr-stak/nvidia.config -c /etc/xmr-stak/main.config
+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
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/xmr-stak/metadata.xml b/net-p2p/xmr-stak/metadata.xml
new file mode 100644
index 000000000000..ad51a30e1d06
--- /dev/null
+++ b/net-p2p/xmr-stak/metadata.xml
@@ -0,0 +1,18 @@
+<?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="devfee">Enable payment of devfee to the developer</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/xmr-stak-2.2.0.ebuild b/net-p2p/xmr-stak/xmr-stak-2.2.0.ebuild
new file mode 100644
index 000000000000..a135ea9bfcd9
--- /dev/null
+++ b/net-p2p/xmr-stak/xmr-stak-2.2.0.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils systemd
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Unified all-in-one Monero miner"
+HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cuda devfee 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
+ if ! use devfee; then
+ sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCUDA_ENABLE=$(usex cuda)
+ -DHWLOC_ENABLE=$(usex hwloc)
+ -DMICROHTTPD_ENABLE=$(usex webserver)
+ -DOpenCL_ENABLE=$(usex opencl)
+ -DOpenSSL_ENABLE=$(usex ssl)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ dodir /etc/xmr-stak
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}etc/xmr-stak/main.config" ]; then
+ ewarn "To use xmr-stack:"
+ 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 --cpu /etc/xmr-stak/cpu.config --amd /etc/xmr-stak/amd.config --nvidia /etc/xmr-stak/nvidia.config -c /etc/xmr-stak/main.config"
+ ewarn "If the systemd will be used, xmr-stak can now be terminated and 'systemctl start xmr-stak' can be used."
+ fi
+}
diff --git a/net-p2p/xmr-stak/xmr-stak-9999.ebuild b/net-p2p/xmr-stak/xmr-stak-9999.ebuild
new file mode 100644
index 000000000000..a135ea9bfcd9
--- /dev/null
+++ b/net-p2p/xmr-stak/xmr-stak-9999.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils systemd
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Unified all-in-one Monero miner"
+HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cuda devfee 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
+ if ! use devfee; then
+ sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCUDA_ENABLE=$(usex cuda)
+ -DHWLOC_ENABLE=$(usex hwloc)
+ -DMICROHTTPD_ENABLE=$(usex webserver)
+ -DOpenCL_ENABLE=$(usex opencl)
+ -DOpenSSL_ENABLE=$(usex ssl)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ dodir /etc/xmr-stak
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}etc/xmr-stak/main.config" ]; then
+ ewarn "To use xmr-stack:"
+ 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 --cpu /etc/xmr-stak/cpu.config --amd /etc/xmr-stak/amd.config --nvidia /etc/xmr-stak/nvidia.config -c /etc/xmr-stak/main.config"
+ ewarn "If the systemd will be used, xmr-stak can now be terminated and 'systemctl start xmr-stak' can be used."
+ fi
+}