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.4.1.ebuild,v 1.2 2014/07/18 11:52:45 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.4/${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 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.5 |
25 |
ncurses? ( sys-libs/ncurses ) |
26 |
avalon? ( virtual/libusb:1 ) |
27 |
bflsc? ( virtual/libusb:1 ) |
28 |
bitforce? ( virtual/libusb:1 ) |
29 |
bitfury? ( virtual/libusb:1 ) |
30 |
cointerra? ( virtual/libusb:1 ) |
31 |
drillbit? ( virtual/libusb:1 ) |
32 |
hashfast? ( virtual/libusb:1 ) |
33 |
icarus? ( virtual/libusb:1 ) |
34 |
klondike? ( virtual/libusb:1 ) |
35 |
modminer? ( virtual/libusb:1 ) |
36 |
spondoolies? ( virtual/libusb:1 )" |
37 |
DEPEND="virtual/pkgconfig |
38 |
${RDEPEND}" |
39 |
|
40 |
src_prepare() { |
41 |
epatch "${FILESDIR}"/${PN}-4.3.5-system-jansson.patch |
42 |
eautoreconf |
43 |
} |
44 |
|
45 |
src_configure() { |
46 |
use hardened && append-cflags "-nopie" |
47 |
|
48 |
econf $(use_with ncurses curses) \ |
49 |
$(use_enable ants1) \ |
50 |
$(use_enable ants2) \ |
51 |
$(use_enable avalon) \ |
52 |
$(use_enable avalon2) \ |
53 |
$(use_enable bab) \ |
54 |
$(use_enable bitmine_A1) \ |
55 |
$(use_enable bflsc) \ |
56 |
$(use_enable bitforce) \ |
57 |
$(use_enable bitfury) \ |
58 |
$(use_enable cointerra) \ |
59 |
$(use_enable drillbit) \ |
60 |
$(use_enable hashfast) \ |
61 |
$(use_enable icarus) \ |
62 |
$(use_enable klondike) \ |
63 |
$(use_enable knc) \ |
64 |
$(use_enable minion) \ |
65 |
$(use_enable modminer) \ |
66 |
$(use_enable spondoolies) \ |
67 |
--with-system-libusb |
68 |
# sanitize directories (is this still needed?) |
69 |
sed -i 's~^\(\#define CGMINER_PREFIX \).*$~\1"'"${EPREFIX}/usr/lib/cgminer"'"~' config.h |
70 |
} |
71 |
|
72 |
src_install() { # How about using some make install? |
73 |
dobin cgminer |
74 |
|
75 |
insinto /lib/udev/rules.d |
76 |
use udev && doins 01-cgminer.rules |
77 |
|
78 |
if use doc; then |
79 |
dodoc AUTHORS NEWS README API-README |
80 |
use icarus || use bitforce || use modminer && dodoc FPGA-README |
81 |
use avalon || use bflsc && dodoc ASIC-README |
82 |
fi |
83 |
|
84 |
if use examples; then |
85 |
docinto examples |
86 |
dodoc api-example.php miner.php API.java api-example.c example.conf |
87 |
fi |
88 |
} |