1 # Copyright 2010-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools bash-completion-r1 db-use desktop gnome2-utils xdg-utils
9 BITCOINCORE_COMMITHASH="49e34e288005a5b144a642e197b628396f5a0765"
10 KNOTS_PV="${PV}.knots20180918"
11 KNOTS_P="bitcoin-${KNOTS_PV}"
13 DESCRIPTION="An end-user Qt GUI for the Bitcoin crypto-currency"
14 HOMEPAGE="https://bitcoincore.org/ https://bitcoinknots.org/"
16 https://github.com/bitcoin/bitcoin/archive/${BITCOINCORE_COMMITHASH}.tar.gz -> bitcoin-v${PV}.tar.gz
17 https://bitcoinknots.org/files/0.16.x/${KNOTS_PV}/${KNOTS_P}.patches.txz -> ${KNOTS_P}.patches.tar.xz
22 KEYWORDS="amd64 ~arm ~arm64 ~ppc x86 ~amd64-linux ~x86-linux"
24 IUSE="+asm +bip70 dbus kde +libevent knots libressl +qrcode test upnp +wallet zeromq"
25 RESTRICT="!test? ( test )"
28 >=dev-libs/boost-1.52.0:=[threads(+)]
29 >=dev-libs/libsecp256k1-0.0.0_pre20151118:=[recovery]
35 virtual/bitcoin-leveldb
36 bip70? ( dev-libs/protobuf:= )
40 libevent? ( dev-libs/libevent:= )
41 !libressl? ( dev-libs/openssl:0=[-bindist] )
42 libressl? ( dev-libs/libressl:0= )
46 upnp? ( >=net-libs/miniupnpc-1.9.20150916:= )
47 wallet? ( sys-libs/db:$(db_ver_to_slot "${DB_VER}")=[cxx] )
48 zeromq? ( net-libs/zeromq:= )
51 dev-qt/linguist-tools:5
54 media-gfx/imagemagick[png]
58 DOCS=( doc/bips.md doc/files.md doc/release-notes.md )
60 S="${WORKDIR}/bitcoin-${BITCOINCORE_COMMITHASH}"
64 elog "You are building ${PN} from Bitcoin Knots."
65 elog "For more information, see:"
66 elog "https://bitcoinknots.org/files/0.16.x/${KNOTS_PV}/${KNOTS_P}.desc.html"
68 elog "You are building ${PN} from Bitcoin Core."
69 elog "For more information, see:"
70 elog "https://bitcoincore.org/en/2018/09/18/release-${PV}/"
72 elog "Replace By Fee policy is now always enabled by default: Your node will"
73 elog "preferentially mine and relay transactions paying the highest fee, regardless"
74 elog "of receive order. To disable RBF, set mempoolreplacement=never in bitcoin.conf"
78 sed -i 's/^\(complete -F _bitcoind \)bitcoind \(bitcoin-qt\)$/\1\2/' contrib/bitcoind.bash-completion || die
80 # Save the generic icon for later
81 cp src/qt/res/src/bitcoin.svg bitcoin128.svg || die
83 local knots_patchdir="${WORKDIR}/${KNOTS_P}.patches/"
85 eapply "${FILESDIR}"/${PN}-0.16.3-boost-1.72-missing-include.patch
86 eapply "${knots_patchdir}/${KNOTS_P}.syslibs.patch"
89 eapply "${knots_patchdir}/${KNOTS_P}.f.patch"
90 eapply "${knots_patchdir}/${KNOTS_P}.branding.patch"
91 eapply "${knots_patchdir}/${KNOTS_P}.ts.patch"
96 echo '#!/bin/true' >share/genbuild.sh || die
97 mkdir -p src/obj || die
98 echo "#define BUILD_SUFFIX gentoo${PVR#${PV}}" >src/obj/build.h || die
101 rm -r src/leveldb src/secp256k1 || die
108 $(use_with dbus qtdbus)
110 $(use_with qrcode qrencode)
111 $(use_with upnp miniupnpc)
112 $(use_enable upnp upnp-default)
113 $(use_enable test tests)
115 $(use_enable zeromq zmq)
124 --with-system-leveldb
125 --with-system-libsecp256k1
126 --with-system-univalue
128 econf "${my_econf[@]}"
134 rm -f "${ED}/usr/bin/test_bitcoin" || die
136 insinto /usr/share/icons/hicolor/scalable/apps/
139 newins src/qt/res/src/bitcoin.svg bitcoinknots.svg
142 newmenu "contrib/debian/bitcoin-qt.desktop" "org.bitcoin.bitcoin-qt.desktop"
144 use libevent && dodoc doc/REST-interface.md doc/tor.md
146 use zeromq && dodoc doc/zmq.md
148 newbashcomp contrib/bitcoind.bash-completion ${PN}
151 insinto /usr/share/kservices5
152 doins contrib/debian/bitcoin-qt.protocol
153 dosym "../../kservices5/bitcoin-qt.protocol" "/usr/share/kde4/services/bitcoin-qt.protocol"
158 gnome2_icon_cache_update
159 xdg_desktop_database_update
165 if use libevent; then
166 elog "To have ${PN} automatically use Tor when it's running, be sure your"
167 elog "'torrc' config file has 'ControlPort' and 'CookieAuthentication' setup"
168 elog "correctly, and add your user to the 'tor' user group."