1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="ncurses?"
10 inherit eutils distutils-r1 gnome2-utils
13 DESCRIPTION="User friendly Bitcoin client"
14 HOMEPAGE="https://electrum.org/"
15 SRC_URI="https://download.electrum.org/${PV}/${MY_P}.tar.gz"
20 LINGUAS="ar_SA cs_CZ da_DK de_DE el_GR eo_UY es_ES fr_FR hu_HU hy_AM id_ID it_IT ja_JP ky_KG lv_LV nl_NL pl_PL pt_BR pt_PT ro_RO ru_RU sk_SK sl_SI ta_IN th_TH vi_VN zh_CN"
22 IUSE="cli cosign +fiat greenaddress_it gtk3 ncurses qrcode +qt4 sync trustedcoin_com vkb"
24 for lingua in ${LINGUAS}; do
25 IUSE+=" linguas_${lingua}"
29 || ( cli gtk3 ncurses qt4 )
32 greenaddress_it? ( qt4 )
35 trustedcoin_com? ( qt4 )
40 dev-python/setuptools[${PYTHON_USEDEP}]
41 >=dev-python/ecdsa-0.9[${PYTHON_USEDEP}]
42 dev-python/slowaes[${PYTHON_USEDEP}]
43 dev-python/pbkdf2[${PYTHON_USEDEP}]
44 dev-python/requests[${PYTHON_USEDEP}]
45 dev-python/pyasn1[${PYTHON_USEDEP}]
46 dev-python/pyasn1-modules[${PYTHON_USEDEP}]
47 dev-python/tlslite[${PYTHON_USEDEP}]
48 dev-python/qrcode[${PYTHON_USEDEP}]
49 dev-python/socksipy[${PYTHON_USEDEP}]
50 dev-libs/protobuf[python,${PYTHON_USEDEP}]
51 dev-python/six[${PYTHON_USEDEP}]
53 dev-python/pygobject:3[${PYTHON_USEDEP}]
54 x11-libs/gtk+:3[introspection]
56 qrcode? ( media-gfx/zbar[python,v4l,${PYTHON_USEDEP}] )
58 dev-python/PyQt4[${PYTHON_USEDEP}]
60 ncurses? ( dev-lang/python )
63 S="${WORKDIR}/${MY_P}"
68 # Don't advise using PIP
69 sed -i "s/On Linux, try 'sudo pip install zbar'/Re-emerge Electrum with the qrcode USE flag/" lib/qrscanner.py || die
71 # Prevent icon from being installed in the wrong location
72 sed -i '/icons/d' setup.py || die
74 validate_desktop_entries
76 # Remove unrequested localization files:
77 for lang in ${LINGUAS}; do
78 use "linguas_${lang}" && continue
79 rm -r "lib/locale/${lang}" || die
83 # french is unfinished
85 $(usex linguas_es_ES '' spanish) \
86 $(usex linguas_pt_BR '' $(usex linguas_pt_PT '' portuguese)) \
88 $(usex linguas_ja_JP '' japanese) \
90 rm "lib/wordlist/${wordlist}.txt" || die
91 sed -i "/${wordlist}\\.txt/d" lib/mnemonic.py || die
94 # Remove unrequested GUI implementations:
97 $(usex cli '' stdio) \
98 $(usex gtk3 '' gtk ) \
100 $(usex ncurses '' text ) \
102 rm gui/"${gui}"* -r || die
106 sed -i "s/'electrum_gui\\.qt',//;/\"qt\\/themes/d" setup.py || die
107 local bestgui=$(usex gtk3 gtk $(usex ncurses text stdio))
108 sed -i "s/\(config.get('gui', \?\)'classic'/\1'${bestgui}'/" electrum || die
112 # btchipwallet requires python btchip module (and dev-python/pyusb)
113 # trezor requires python trezorlib module
115 $(usex cosign '' cosigner_pool ) \
116 $(usex fiat '' exchange_rate ) \
117 $(usex greenaddress_it '' greenaddress_instant) \
118 $(usex sync '' labels ) \
120 $(usex trustedcoin_com '' trustedcoin ) \
121 $(usex vkb '' virtualkeyboard ) \
123 rm plugins/"${plugin}"* || die
126 distutils-r1_src_prepare
130 doicon -s 128 icons/${PN}.png
131 distutils-r1_src_install
139 gnome2_icon_cache_update
143 gnome2_icon_cache_update