/[gentoo-x86]/net-misc/cgminer/cgminer-2.4.2-r1.ebuild
Gentoo

Contents of /net-misc/cgminer/cgminer-2.4.2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Jun 16 22:03:30 2012 UTC (2 years, 3 months ago) by blueness
Branch: MAIN
Changes since 1.3: +2 -2 lines
Fix SRC_URI

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/cgminer/cgminer-2.4.2-r1.ebuild,v 1.3 2012/06/16 08:54:41 blueness Exp $
4
5 EAPI="4"
6
7 inherit versionator
8
9 MY_PV="$(replace_version_separator 3 -)"
10 S="${WORKDIR}/${PN}-${MY_PV}"
11
12 DESCRIPTION="Bitcoin CPU/GPU/FPGA miner in C"
13 HOMEPAGE="https://bitcointalk.org/index.php?topic=28402.0"
14 SRC_URI="http://ck.kolivas.org/apps/${PN}/${PN}-2.4/${PN}-${MY_PV}-1.tar.bz2"
15
16 LICENSE="GPL-3"
17 SLOT="0"
18 KEYWORDS="~x86 ~amd64"
19
20 IUSE="+adl altivec bitforce +cpumining examples hardened icarus ncurses +opencl padlock sse2 sse2_4way sse4 +udev ztex"
21 REQUIRED_USE="
22 || ( bitforce cpumining icarus opencl ztex )
23 adl? ( opencl )
24 altivec? ( cpumining ppc ppc64 )
25 opencl? ( ncurses )
26 padlock? ( cpumining || ( amd64 x86 ) )
27 sse2? ( cpumining || ( amd64 x86 ) )
28 sse4? ( cpumining amd64 )
29 "
30
31 DEPEND="
32 net-misc/curl
33 ncurses? (
34 sys-libs/ncurses
35 )
36 dev-libs/jansson
37 opencl? (
38 virtual/opencl
39 )
40 udev? (
41 sys-fs/udev
42 )
43 ztex? (
44 virtual/libusb:1
45 )
46 "
47 RDEPEND="${DEPEND}"
48 DEPEND="${DEPEND}
49 virtual/pkgconfig
50 sys-apps/sed
51 adl? (
52 x11-libs/amd-adl-sdk
53 )
54 sse2? (
55 >=dev-lang/yasm-1.0.1
56 )
57 sse4? (
58 >=dev-lang/yasm-1.0.1
59 )
60 "
61
62 src_prepare() {
63 sed -i 's/\(^\#define WANT_.*\(SSE\|PADLOCK\|ALTIVEC\)\)/\/\/ \1/' miner.h
64 ln -s /usr/include/ADL/* ADL_SDK/
65 }
66
67 src_configure() {
68 local CFLAGS="${CFLAGS}"
69 if ! use altivec; then
70 sed -i 's/-faltivec//g' configure
71 else
72 CFLAGS="${CFLAGS} -DWANT_ALTIVEC=1"
73 fi
74 use padlock && CFLAGS="${CFLAGS} -DWANT_VIA_PADLOCK=1"
75 if use sse2; then
76 if use amd64; then
77 CFLAGS="${CFLAGS} -DWANT_X8664_SSE2=1"
78 else
79 CFLAGS="${CFLAGS} -DWANT_X8632_SSE2=1"
80 fi
81 fi
82 use sse2_4way && CFLAGS="${CFLAGS} -DWANT_SSE2_4WAY=1"
83 use sse4 && CFLAGS="${CFLAGS} -DWANT_X8664_SSE4=1"
84 use hardened && CFLAGS="${CFLAGS} -nopie"
85
86 CFLAGS="${CFLAGS}" \
87 econf \
88 $(use_enable adl) \
89 $(use_enable bitforce) \
90 $(use_enable cpumining) \
91 $(use_enable icarus) \
92 $(use_with ncurses curses) \
93 $(use_enable opencl) \
94 $(use_with udev libudev) \
95 $(use_enable ztex)
96 if use opencl; then
97 # sanitize directories
98 sed -i 's~^\(\#define CGMINER_PREFIX \).*$~\1"'"${EPREFIX}/usr/lib/cgminer/opencl"'"~' config.h
99 fi
100 if use ztex; then
101 sed -i 's~bitstreams/~'"${EPREFIX}"'/usr/lib/cgminer/ztex/~' libztex.c
102 fi
103 }
104
105 src_install() {
106 dobin cgminer
107 dodoc AUTHORS NEWS README API-README
108 if use icarus; then
109 dodoc FPGA-README
110 fi
111 if use opencl; then
112 insinto /usr/lib/cgminer/opencl
113 doins *.cl
114 fi
115 if use ztex; then
116 insinto /usr/lib/cgminer/ztex
117 doins bitstreams/*.bit
118 fi
119 if use examples; then
120 docinto examples
121 dodoc api-example.php miner.php API.java api-example.c
122 fi
123 }

  ViewVC Help
Powered by ViewVC 1.1.20