net-p2p/saku: Remove last-rited pkg
[gentoo.git] / net-p2p / xmr-stak / xmr-stak-2.10.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit cmake-utils systemd
7
8 if [[ ${PV} == "9999" ]] ; then
9         EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
10         EGIT_BRANCH="dev"
11         inherit git-r3
12         SRC_URI=""
13 else
14         SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}.tar.gz -> ${P}.tar.gz"
15         KEYWORDS="~amd64"
16 fi
17
18 DESCRIPTION="Unified all-in-one Monero miner"
19 HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
20 LICENSE="GPL-3"
21 SLOT="0"
22 IUSE="cuda devfee hwloc opencl ssl webserver"
23
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 )"
29 RDEPEND="${DEPEND}"
30
31 src_prepare() {
32         cmake-utils_src_prepare
33         if ! use devfee; then
34                 sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
35         fi
36 }
37
38 src_configure() {
39         local mycmakeargs=(
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)
46         )
47         cmake-utils_src_configure
48 }
49
50 src_install() {
51         cmake-utils_src_install
52         systemd_newunit "${FILESDIR}"/${PN}-2.3.0.service ${PN}.service
53         doinitd "${FILESDIR}"/${PN}
54         dodir /etc/xmr-stak
55 }
56
57 pkg_postinst() {
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,"
62                 fi
63                 ewarn "run:"
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."
66         fi
67 }