1 |
# Copyright 1999-2014 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/cgminer/cgminer-4.7.0.ebuild,v 1.1 2014/10/15 23:40:37 blueness Exp $ |
4 |
|
5 |
EAPI=5 |
6 |
|
7 |
inherit autotools eutils flag-o-matic |
8 |
|
9 |
DESCRIPTION="Bitcoin CPU/GPU/FPGA/ASIC miner in C" |
10 |
HOMEPAGE="http://bitcointalk.org/?topic=28402.msg357369 http://github.com/ckolivas/cgminer" |
11 |
SRC_URI="http://ck.kolivas.org/apps/cgminer/${P}.tar.bz2" |
12 |
#SRC_URI="http://ck.kolivas.org/apps/cgminer/4.5/${P}.tar.bz2" |
13 |
|
14 |
LICENSE="GPL-3" |
15 |
SLOT="0" |
16 |
KEYWORDS="~amd64 ~arm ~x86" |
17 |
|
18 |
HARDWARE="ants1 ants2 avalon avalon2 bab bitmine_A1 bflsc bitforce bitfury cointerra drillbit hashfast hashratio icarus klondike knc minion modminer spondoolies" |
19 |
IUSE="doc examples udev hardened ncurses ${HARDWARE}" |
20 |
|
21 |
REQUIRED_USE="|| ( ${HARDWARE} )" |
22 |
|
23 |
RDEPEND="net-misc/curl |
24 |
>=dev-libs/jansson-2.6 |
25 |
ncurses? ( sys-libs/ncurses ) |
26 |
avalon? ( virtual/libusb:1[udev] ) |
27 |
bflsc? ( virtual/libusb:1[udev] ) |
28 |
bitforce? ( virtual/libusb:1[udev] ) |
29 |
bitfury? ( virtual/libusb:1[udev] ) |
30 |
cointerra? ( virtual/libusb:1[udev] ) |
31 |
drillbit? ( virtual/libusb:1[udev] ) |
32 |
hashfast? ( virtual/libusb:1[udev] ) |
33 |
hashratio? ( virtual/libusb:1[udev] ) |
34 |
icarus? ( virtual/libusb:1[udev] ) |
35 |
klondike? ( virtual/libusb:1[udev] ) |
36 |
modminer? ( virtual/libusb:1[udev] ) |
37 |
spondoolies? ( virtual/libusb:1[udev] ) |
38 |
udev? ( virtual/libudev )" |
39 |
DEPEND="virtual/pkgconfig |
40 |
${RDEPEND}" |
41 |
|
42 |
src_prepare() { |
43 |
epatch "${FILESDIR}"/${PN}-4.4.2-system-jansson.patch |
44 |
eautoreconf |
45 |
} |
46 |
|
47 |
src_configure() { |
48 |
use hardened && append-cflags "-nopie" |
49 |
|
50 |
econf $(use_with ncurses curses) \ |
51 |
$(use_enable ants1) \ |
52 |
$(use_enable ants2) \ |
53 |
$(use_enable avalon) \ |
54 |
$(use_enable avalon2) \ |
55 |
$(use_enable bab) \ |
56 |
$(use_enable bitmine_A1) \ |
57 |
$(use_enable bflsc) \ |
58 |
$(use_enable bitforce) \ |
59 |
$(use_enable bitfury) \ |
60 |
$(use_enable cointerra) \ |
61 |
$(use_enable drillbit) \ |
62 |
$(use_enable hashfast) \ |
63 |
$(use_enable hashratio) \ |
64 |
$(use_enable icarus) \ |
65 |
$(use_enable klondike) \ |
66 |
$(use_enable knc) \ |
67 |
$(use_enable minion) \ |
68 |
$(use_enable modminer) \ |
69 |
$(use_enable spondoolies) \ |
70 |
$(use_enable udev) \ |
71 |
--disable-forcecombo \ |
72 |
--with-system-libusb |
73 |
# sanitize directories (is this still needed?) |
74 |
sed -i 's~^\(\#define CGMINER_PREFIX \).*$~\1"'"${EPREFIX}/usr/lib/cgminer"'"~' config.h |
75 |
} |
76 |
|
77 |
src_install() { # How about using some make install? |
78 |
dobin cgminer |
79 |
|
80 |
if use udev; then |
81 |
insinto /lib/udev/rules.d |
82 |
use udev && doins 01-cgminer.rules |
83 |
fi |
84 |
|
85 |
if use doc; then |
86 |
dodoc AUTHORS NEWS README API-README |
87 |
use icarus || use bitforce || use modminer && dodoc FPGA-README |
88 |
use avalon || use bflsc && dodoc ASIC-README |
89 |
fi |
90 |
|
91 |
if use examples; then |
92 |
docinto examples |
93 |
dodoc api-example.php miner.php API.java api-example.c example.conf |
94 |
fi |
95 |
} |