From 0ff9128b8023fd2f9730d06c7e92338c04ce1448 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Sat, 23 Dec 2017 10:37:54 -0500 Subject: net-p2p/xmr-stak: Unified all-in-one Monero miner Package-Manager: Portage-2.3.19, Repoman-2.3.6 --- net-p2p/xmr-stak/Manifest | 1 + net-p2p/xmr-stak/files/xmr-stak.service | 32 +++++++++++++++++ net-p2p/xmr-stak/metadata.xml | 18 ++++++++++ net-p2p/xmr-stak/xmr-stak-2.2.0.ebuild | 64 +++++++++++++++++++++++++++++++++ net-p2p/xmr-stak/xmr-stak-9999.ebuild | 64 +++++++++++++++++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 net-p2p/xmr-stak/Manifest create mode 100644 net-p2p/xmr-stak/files/xmr-stak.service create mode 100644 net-p2p/xmr-stak/metadata.xml create mode 100644 net-p2p/xmr-stak/xmr-stak-2.2.0.ebuild create mode 100644 net-p2p/xmr-stak/xmr-stak-9999.ebuild (limited to 'net-p2p') 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 @@ + + + + + candrews@gentoo.org + Craig Andrews + + + fireice-uk/xmr-stak + + + Enable NVIDIA CUDA toolkit support + Enable payment of devfee to the developer + Enable CPU affinity support via hwloc + Enable OpenCL support + Enable internal webserver + + 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 +} -- cgit v1.2.3-65-gdbad