| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoin-qt/bitcoin-qt-0.7.0.ebuild,v 1.3 2013/01/08 01:59:36 blueness Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
DB_VER="4.8"
|
| 8 |
|
| 9 |
LANGS="bg ca_ES cs da de el_GR en es es_CL et eu_ES fa fa_IR fi fr fr_CA he hr hu it lt nb nl pl pt_BR pt_PT ro_RO ru sk sr sv tr uk zh_CN zh_TW"
|
| 10 |
inherit db-use eutils qt4-r2 versionator
|
| 11 |
|
| 12 |
DESCRIPTION="An end-user Qt4 GUI for the Bitcoin crypto-currency"
|
| 13 |
HOMEPAGE="http://bitcoin.org/"
|
| 14 |
SRC_URI="https://nodeload.github.com/bitcoin/bitcoin/tarball/v${PV/_/} -> bitcoin-v${PV}.tgz
|
| 15 |
eligius? ( http://luke.dashjr.org/programs/bitcoin/files/bitcoind/eligius/sendfee/0.7.0-eligius_sendfee.patch.xz )
|
| 16 |
"
|
| 17 |
|
| 18 |
LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
|
| 19 |
SLOT="0"
|
| 20 |
KEYWORDS="~amd64 ~arm ~x86"
|
| 21 |
IUSE="$IUSE 1stclassmsg dbus +eligius ipv6 +qrcode upnp"
|
| 22 |
|
| 23 |
RDEPEND="
|
| 24 |
>=dev-libs/boost-1.41.0[threads(+)]
|
| 25 |
dev-libs/openssl[-bindist]
|
| 26 |
qrcode? (
|
| 27 |
media-gfx/qrencode
|
| 28 |
)
|
| 29 |
upnp? (
|
| 30 |
net-libs/miniupnpc
|
| 31 |
)
|
| 32 |
sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
|
| 33 |
x11-libs/qt-gui:4
|
| 34 |
dbus? (
|
| 35 |
x11-libs/qt-dbus:4
|
| 36 |
)
|
| 37 |
"
|
| 38 |
DEPEND="${RDEPEND}
|
| 39 |
>=app-shells/bash-4.1
|
| 40 |
"
|
| 41 |
|
| 42 |
DOCS="doc/README"
|
| 43 |
|
| 44 |
S="${WORKDIR}/bitcoin-bitcoin-a76c22e"
|
| 45 |
|
| 46 |
src_prepare() {
|
| 47 |
cd src || die
|
| 48 |
use eligius && epatch "${WORKDIR}/0.7.0-eligius_sendfee.patch"
|
| 49 |
|
| 50 |
local filt= yeslang= nolang=
|
| 51 |
|
| 52 |
for lan in $LANGS; do
|
| 53 |
if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
|
| 54 |
ewarn "Language '$lan' no longer supported. Ebuild needs update."
|
| 55 |
fi
|
| 56 |
done
|
| 57 |
|
| 58 |
for ts in $(ls qt/locale/*.ts)
|
| 59 |
do
|
| 60 |
x="${ts/*bitcoin_/}"
|
| 61 |
x="${x/.ts/}"
|
| 62 |
if ! use "linguas_$x"; then
|
| 63 |
nolang="$nolang $x"
|
| 64 |
rm "$ts"
|
| 65 |
filt="$filt\\|$x"
|
| 66 |
else
|
| 67 |
yeslang="$yeslang $x"
|
| 68 |
fi
|
| 69 |
done
|
| 70 |
filt="bitcoin_\\(${filt:2}\\)\\.qm"
|
| 71 |
sed "/${filt}/d" -i 'qt/bitcoin.qrc'
|
| 72 |
einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
|
| 73 |
}
|
| 74 |
|
| 75 |
src_configure() {
|
| 76 |
OPTS=()
|
| 77 |
|
| 78 |
use dbus && OPTS+=("USE_DBUS=1")
|
| 79 |
if use upnp; then
|
| 80 |
OPTS+=("USE_UPNP=1")
|
| 81 |
else
|
| 82 |
OPTS+=("USE_UPNP=-")
|
| 83 |
fi
|
| 84 |
use qrcode && OPTS+=("USE_QRCODE=1")
|
| 85 |
use 1stclassmsg && OPTS+=("FIRST_CLASS_MESSAGING=1")
|
| 86 |
use ipv6 || OPTS+=("USE_IPV6=-")
|
| 87 |
|
| 88 |
OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
|
| 89 |
OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
|
| 90 |
|
| 91 |
eqmake4 "${PN}.pro" "${OPTS[@]}"
|
| 92 |
}
|
| 93 |
|
| 94 |
src_compile() {
|
| 95 |
# Workaround for bug #440034
|
| 96 |
share/genbuild.sh build/build.h
|
| 97 |
|
| 98 |
emake
|
| 99 |
}
|
| 100 |
|
| 101 |
src_test() {
|
| 102 |
cd src || die
|
| 103 |
emake -f makefile.unix "${OPTS[@]}" test_bitcoin
|
| 104 |
./test_bitcoin || die 'Tests failed'
|
| 105 |
}
|
| 106 |
|
| 107 |
src_install() {
|
| 108 |
qt4-r2_src_install
|
| 109 |
dobin ${PN}
|
| 110 |
insinto /usr/share/pixmaps
|
| 111 |
newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
|
| 112 |
make_desktop_entry ${PN} "Bitcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Network;P2P"
|
| 113 |
}
|