net-p2p/cpuminer-opt: Optimized multi algo CPU miner
[gentoo.git] / net-p2p / cpuminer-opt / cpuminer-opt-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools flag-o-matic systemd
7
8 DESCRIPTION="Optimized multi algo CPU miner"
9 HOMEPAGE="https://github.com/JayDDee/cpuminer-opt"
10 IUSE="cpu_flags_x86_avx2 cpu_flags_x86_sse2 curl libressl"
11 LICENSE="GPL-2"
12 SLOT="0"
13 REQUIRED_USE="cpu_flags_x86_sse2"
14 DEPEND="
15         dev-libs/gmp:0
16         dev-libs/jansson
17         curl? ( >=net-misc/curl-7.15[ssl] )
18         !libressl? ( dev-libs/openssl:0= )
19         libressl? ( dev-libs/libressl:0= )
20 "
21 RDEPEND="${DEPEND}"
22 if [[ ${PV} == "9999" ]] ; then
23         SRC_URI=""
24         EGIT_REPO_URI="https://github.com/JayDDee/${PN}.git"
25         inherit git-r3
26 else
27         KEYWORDS="~amd64"
28         SRC_URI="https://github.com/JayDDee/${PN}/archive/v${PV}.tar.gz"
29 fi
30
31 src_prepare() {
32         default
33         eautoreconf
34 }
35
36 src_configure() {
37         append-ldflags -Wl,-z,noexecstack
38         use cpu_flags_x86_avx2 && append-cflags "-DFOUR_WAY"
39         econf --with-crypto $(use_with curl)
40 }
41
42 src_install() {
43         default
44         systemd_dounit "${FILESDIR}"/${PN}.service
45         insinto "/etc/${PN}"
46         doins cpuminer-conf.json
47 }