net-libs/webkit-gtk: amd64 stable wrt bug #712260
[gentoo.git] / net-libs / libbitcoinconsensus / libbitcoinconsensus-0.19.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools
7
8 BITCOINCORE_COMMITHASH="58ba7c314d552cea8cb024960a8504577aee586f"
9 KNOTS_PV="${PV}.knots20200304"
10 KNOTS_P="bitcoin-${KNOTS_PV}"
11
12 DESCRIPTION="Bitcoin Core consensus library"
13 HOMEPAGE="https://bitcoincore.org/ https://bitcoinknots.org/"
14 SRC_URI="
15         https://github.com/bitcoin/bitcoin/archive/${BITCOINCORE_COMMITHASH}.tar.gz -> bitcoin-v${PV}.tar.gz
16         https://bitcoinknots.org/files/0.19.x/${KNOTS_PV}/${KNOTS_P}.patches.txz -> ${KNOTS_P}.patches.tar.xz
17 "
18
19 LICENSE="MIT"
20 SLOT="0"
21 KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
22 IUSE="+asm knots libressl"
23
24 DEPEND="
25         >dev-libs/libsecp256k1-0.1_pre20170321:=[recovery]
26         !libressl? ( dev-libs/openssl:0=[-bindist] )
27         libressl? ( dev-libs/libressl:0= )
28 "
29 RDEPEND="${DEPEND}"
30
31 DOCS=( doc/bips.md doc/release-notes.md doc/shared-libraries.md )
32
33 S="${WORKDIR}/bitcoin-${BITCOINCORE_COMMITHASH}"
34
35 pkg_pretend() {
36         if use knots; then
37                 elog "You are building ${PN} from Bitcoin Knots."
38                 elog "For more information, see:"
39                 elog "https://bitcoinknots.org/files/0.19.x/${KNOTS_PV}/${KNOTS_P}.desc.html"
40         else
41                 elog "You are building ${PN} from Bitcoin Core."
42                 elog "For more information, see:"
43                 elog "https://bitcoincore.org/en/2020/03/04/release-${PV}/"
44         fi
45 }
46
47 src_prepare() {
48         local knots_patchdir="${WORKDIR}/${KNOTS_P}.patches/"
49
50         eapply "${knots_patchdir}/${KNOTS_P}.syslibs.patch"
51
52         if use knots; then
53                 eapply "${knots_patchdir}/${KNOTS_P}.f.patch"
54                 eapply "${knots_patchdir}/${KNOTS_P}.branding.patch"
55                 eapply "${knots_patchdir}/${KNOTS_P}.ts.patch"
56         fi
57
58         eapply_user
59
60         echo '#!/bin/true' >share/genbuild.sh || die
61         mkdir -p src/obj || die
62         echo "#define BUILD_SUFFIX gentoo${PVR#${PV}}" >src/obj/build.h || die
63
64         eautoreconf
65         rm -r src/leveldb src/secp256k1 || die
66 }
67
68 src_configure() {
69         local my_econf=(
70                 $(use_enable asm)
71                 --without-qtdbus
72                 --without-qrencode
73                 --without-miniupnpc
74                 --disable-tests
75                 --disable-wallet
76                 --disable-zmq
77                 --with-libs
78                 --disable-util-cli
79                 --disable-util-tx
80                 --disable-util-wallet
81                 --disable-bench
82                 --without-daemon
83                 --without-gui
84                 --without-rapidcheck
85                 --disable-fuzz
86                 --disable-ccache
87                 --disable-static
88                 --with-system-libsecp256k1
89         )
90         econf "${my_econf[@]}"
91 }
92
93 src_install() {
94         default
95
96         find "${D}" -name '*.la' -delete || die
97 }