1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils systemd
8 if [[ ${PV} == "9999" ]] ; then
9 EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
14 SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}.tar.gz -> ${P}.tar.gz"
18 DESCRIPTION="Unified all-in-one Monero miner"
19 HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
22 IUSE="cuda devfee hwloc opencl ssl webserver"
24 DEPEND="cuda? ( dev-util/nvidia-cuda-toolkit )
25 hwloc? ( sys-apps/hwloc )
26 opencl? ( virtual/opencl )
27 ssl? ( dev-libs/openssl:0= )
28 webserver? ( net-libs/libmicrohttpd )"
32 cmake-utils_src_prepare
34 sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
40 -DCUDA_ENABLE=$(usex cuda)
41 -DHWLOC_ENABLE=$(usex hwloc)
42 -DMICROHTTPD_ENABLE=$(usex webserver)
43 -DOpenCL_ENABLE=$(usex opencl)
44 -DOpenSSL_ENABLE=$(usex ssl)
45 -DLIBRARY_OUTPUT_PATH=$(get_libdir)
47 cmake-utils_src_configure
51 cmake-utils_src_install
52 systemd_newunit "${FILESDIR}"/${PN}-2.3.0.service ${PN}.service
53 doinitd "${FILESDIR}"/${PN}
58 if [ ! -e "${ROOT}/etc/xmr-stak/main.config" ]; then
59 ewarn "To use xmr-stack:"
60 if use cuda || use opencl; then
61 ewarn "As root or as a user that is a member of the 'video' group,"
64 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 -C /etc/xmr-stak/pools.txt"
65 ewarn "xmr-stak can now be terminated and 'systemctl start xmr-stak' or '/etc/init.d/xmr-stak start' can be used."