net-p2p/xmr-stak: Unified all-in-one Monero miner

Package-Manager: Portage-2.3.19, Repoman-2.3.6
This commit is contained in:
Craig Andrews
2017-12-23 10:37:54 -05:00
parent 3f65159b5c
commit 0ff9128b80
5 changed files with 179 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST xmr-stak-2.2.0.tar.gz 316309 BLAKE2B 8a5042e91eff1d7a49dcf50d67430f21459509443117150f59f861edb0c145e0f336cb617ea4f2a7edfd923493efbc8f5ce9cd134a7f7af14b270c8cfdd3cc24 SHA512 1ec30b1f97043307461816e61cb7afaf9e77cfad895b13f5facf98f34da8d9b8751d9885930b0a38777017978fb4f25bb3a69a1c2a5db47b1a851bc88cd7d78d

View File

@@ -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

View File

@@ -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>

View File

@@ -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
}

View File

@@ -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
}