aboutsummaryrefslogtreecommitdiffstats
path: root/community/bitcoin/APKBUILD
blob: 0347bd739bd060d1db79abbcd9d8f9d21a992606 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=bitcoin
pkgver=22.0
pkgrel=1
pkgdesc="Decentralized P2P electronic cash system"
url="https://www.bitcoin.org/"
# x86: segfault in check
# mips64 blocked by boost -> old kernel
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/12327#note_137460
arch="all !armhf !x86 !mips64"
license="MIT"
makedepends="autoconf automake libtool boost-dev miniupnpc-dev
	qt5-qtbase-dev qt5-qttools-dev protobuf-dev libqrencode-dev libevent-dev chrpath zeromq-dev"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-qt $pkgname-cli $pkgname-tx $pkgname-tests $pkgname-bench
	$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/bitcoin/bitcoin/archive/v$pkgver.tar.gz
	ssize_t.patch
	use-c-locale.patch
	$pkgname.initd
	$pkgname.conf
	"

# temp allow textrels on rv64
case $CARCH in
	riscv64) options="$options textrels" ;;
esac

# secfixes:
#   0.21.1-r0:
#     - CVE-2021-3195

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--with-incompatible-bdb \
		--with-gui=qt5 \
		--with-utils \
		--disable-ccache \
		--disable-static \
		--enable-hardening \
		--disable-openssl-tests \
		--disable-wallet
	make
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir"
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m600 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf
	rm -f "$pkgdir"/usr/lib/*.la
}

qt() {
	pkgdesc="Bitcoin with a Qt frontend & QR Code support"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$pkgname-qt "$subpkgdir"/usr/bin/
}

cli() {
	pkgdesc="Bitcoin CLI"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$pkgname-cli "$subpkgdir"/usr/bin/
}

tx() {
	pkgdesc="Bitcoin TX (Transaction Tool)"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$pkgname-tx "$subpkgdir"/usr/bin/
}

tests() {
	pkgdesc="Bitcoin & Bitcoin-QT Unit Tests)"
	mkdir -p "$subpkgdir"/usr/bin
	chrpath -d "$pkgdir"/usr/bin/test_$pkgname
	mv "$pkgdir"/usr/bin/test_$pkgname-qt "$subpkgdir"/usr/bin/
	mv "$pkgdir"/usr/bin/test_$pkgname "$subpkgdir"/usr/bin/
}

bench() {
	pkgdesc="Bitcoin Benchmarking Tools)"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/bench_$pkgname "$subpkgdir"/usr/bin/
}

dev() {
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
	mv "$pkgdir"/usr/include "$subpkgdir"/usr/
}

sha512sums="
a39dcc6e89f42c9da2d9aad503071c615bde76b17c829d2b460754691ad07c3eef66c36555252d31ddc8f3b13d0e6893e40cfb042ba20ef19144bcd15d89ceb2  bitcoin-22.0.tar.gz
98aa5ad81bdb4ae961b791bc978c39117cdf2d83c2181f92bebbb0db107d9b6e86eda265fb3f93ff8a5ca8a7754d7148818b98095d57201dff9363d60b97e7dd  ssize_t.patch
6f3098a8da217c465b3d8ed66fd4d15f0a64f1aa813a18d72d0fa97cb612682d33554d6b4e9fbfd5c8c06950531ac15514cbafeb91ac0887c30f1527c3a20b13  use-c-locale.patch
c88ca4f0c8a3179dbac274db1719983352caa5074b236e59d8fe31ab45ffa99bd90c1a566c4459261a9dcdcc990b826f3466c77aa7a32cf9fb15529a510ac7fd  bitcoin.initd
726e7525d35b83f5f7548e050632e3d3c762cf6f924d6e347806caa103af4b36838263f7342a4127cd5bfb035d79254095ec63deb1d75975753a664e48f7cafd  bitcoin.conf
"