summaryrefslogtreecommitdiff
path: root/net-p2p/c-lightning/c-lightning-24.08.2.ebuild
blob: 3cb1a929ac28651fdfd7ffa7fffcad82bc10f3f1 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# Copyright 2019-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..12} )
CRATES="
addr2line@0.22.0
adler@1.0.2
aho-corasick@1.1.3
anyhow@1.0.86
asn1-rs-derive@0.5.0
asn1-rs-impl@0.2.0
asn1-rs@0.6.1
async-stream-impl@0.3.5
async-stream@0.3.5
async-trait@0.1.81
autocfg@1.3.0
axum-core@0.3.4
axum@0.6.20
backtrace@0.3.73
base64@0.13.1
base64@0.21.7
base64@0.22.1
bech32@0.9.1
bitcoin-private@0.1.0
bitcoin@0.30.2
bitcoin_hashes@0.12.0
bitflags@1.3.2
bitflags@2.6.0
bumpalo@3.16.0
bytes@1.6.1
cc@1.1.7
cfg-if@1.0.0
data-encoding@2.6.0
der-parser@9.0.0
deranged@0.3.11
displaydoc@0.2.5
either@1.13.0
env_logger@0.10.2
equivalent@1.0.1
errno@0.3.9
fastrand@2.1.0
fixedbitset@0.4.2
fnv@1.0.7
foreign-types-shared@0.1.1
foreign-types@0.3.2
futures-channel@0.3.30
futures-core@0.3.30
futures-executor@0.3.30
futures-io@0.3.30
futures-macro@0.3.30
futures-sink@0.3.30
futures-task@0.3.30
futures-util@0.3.30
futures@0.3.30
getrandom@0.2.15
gimli@0.29.0
h2@0.3.26
hashbrown@0.12.3
hashbrown@0.14.5
heck@0.4.1
hermit-abi@0.3.9
hex@0.4.3
hex_lit@0.1.1
home@0.5.9
http-body@0.4.6
http@0.2.12
httparse@1.9.4
httpdate@1.0.3
humantime@2.1.0
hyper-timeout@0.4.1
hyper@0.14.30
indexmap@1.9.3
indexmap@2.2.6
is-terminal@0.4.12
itertools@0.10.5
itoa@1.0.11
js-sys@0.3.69
lazy_static@1.5.0
libc@0.2.155
linux-raw-sys@0.4.14
log@0.4.22
matchers@0.1.0
matchit@0.7.3
memchr@2.7.4
mime@0.3.17
minimal-lexical@0.2.1
miniz_oxide@0.7.4
mio@1.0.1
multimap@0.8.3
nom@7.1.3
ntapi@0.3.7
nu-ansi-term@0.46.0
num-bigint@0.4.6
num-conv@0.1.0
num-integer@0.1.46
num-traits@0.2.19
object@0.36.2
oid-registry@0.7.0
once_cell@1.19.0
openssl-probe@0.1.5
openssl-src@111.18.0+1.1.1n
openssl-sys@0.9.72
openssl@0.10.38
overload@0.1.1
pem@3.0.4
percent-encoding@2.3.1
petgraph@0.6.5
pin-project-internal@1.1.5
pin-project-lite@0.2.14
pin-project@1.1.5
pin-utils@0.1.0
pkg-config@0.3.25
powerfmt@0.2.0
ppv-lite86@0.2.17
prettyplease@0.1.25
proc-macro2@1.0.86
prost-build@0.11.9
prost-derive@0.11.9
prost-types@0.11.9
prost@0.11.9
quote@1.0.36
rand@0.8.5
rand_chacha@0.3.1
rand_core@0.6.4
rcgen@0.13.1
regex-automata@0.1.10
regex-automata@0.4.7
regex-syntax@0.6.29
regex-syntax@0.8.4
regex@1.10.5
ring@0.16.20
ring@0.17.8
rustc-demangle@0.1.24
rusticata-macros@4.1.0
rustix@0.38.34
rustls-pemfile@1.0.4
rustls-pki-types@1.7.0
rustls@0.20.9
rustversion@1.0.17
ryu@1.0.18
schannel@0.1.19
sct@0.7.1
secp256k1-sys@0.8.1
secp256k1@0.27.0
security-framework-sys@2.6.1
security-framework@2.6.1
serde@1.0.204
serde_derive@1.0.204
serde_json@1.0.121
sharded-slab@0.1.7
slab@0.4.9
smallvec@1.13.2
socket2@0.5.7
spin@0.5.2
spin@0.9.8
syn@1.0.109
syn@2.0.72
sync_wrapper@0.1.2
synstructure@0.13.1
tempfile@3.10.1
termcolor@1.4.1
thiserror-impl@1.0.63
thiserror@1.0.63
thread_local@1.1.8
time-core@0.1.2
time-macros@0.2.18
time@0.3.36
tokio-io-timeout@1.2.0
tokio-macros@2.4.0
tokio-rustls@0.23.4
tokio-stream@0.1.15
tokio-test@0.4.4
tokio-util@0.7.11
tokio@1.39.2
tonic-build@0.8.4
tonic@0.8.3
tower-layer@0.3.2
tower-service@0.3.2
tower@0.4.13
tracing-attributes@0.1.27
tracing-core@0.1.32
tracing-futures@0.2.5
tracing-log@0.2.0
tracing-subscriber@0.3.18
tracing@0.1.40
try-lock@0.2.5
unicode-ident@1.0.12
untrusted@0.7.1
untrusted@0.9.0
valuable@0.1.0
vcpkg@0.2.15
want@0.3.1
wasi@0.11.0+wasi-snapshot-preview1
wasm-bindgen-backend@0.2.92
wasm-bindgen-macro-support@0.2.92
wasm-bindgen-macro@0.2.92
wasm-bindgen-shared@0.2.92
wasm-bindgen@0.2.92
web-sys@0.3.69
webpki@0.22.4
which@4.4.2
winapi-i686-pc-windows-gnu@0.4.0
winapi-util@0.1.8
winapi-x86_64-pc-windows-gnu@0.4.0
winapi@0.3.9
windows-sys@0.52.0
windows-targets@0.52.6
windows_aarch64_gnullvm@0.52.6
windows_aarch64_msvc@0.52.6
windows_i686_gnu@0.52.6
windows_i686_gnullvm@0.52.6
windows_i686_msvc@0.52.6
windows_x86_64_gnu@0.52.6
windows_x86_64_gnullvm@0.52.6
windows_x86_64_msvc@0.52.6
x509-parser@0.16.0
yasna@0.5.2
"

inherit git-r3 bash-completion-r1 autotools toolchain-funcs systemd distutils-r1 cargo

DESCRIPTION="A specification compliant Lightning Network implementation in C"
HOMEPAGE="https://github.com/ElementsProject/lightning"
EGIT_REPO_URI="https://github.com/ElementsProject/lightning.git"
EGIT_COMMIT="v${PV}"
SRC_URI="${CARGO_CRATE_URIS}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="python"

DISTUTILS_OPTIONAL=True

BDEPEND="${PYTHON_DEPS}
	${DISTUTILS_DEPS}
	dev-python/mako:=[${PYTHON_USEDEP}]
	>=dev-python/grpcio-tools-1.64.1[${PYTHON_USEDEP}]
	app-text/asciidoc
	sys-apps/coreutils
	sys-devel/gettext
	app-text/lowdown
	virtual/rust[rustfmt]
	dev-libs/protobuf:=
	app-misc/jq"
DEPEND="dev-libs/libsodium:=
	dev-db/sqlite:3
	sys-libs/zlib:=
	python? (
		>=dev-python/recommonmark-0.7[${PYTHON_USEDEP}]
		>=dev-python/grpcio-1.34.0[${PYTHON_USEDEP}]
		>=dev-python/protobuf-python-3[${PYTHON_USEDEP}]
	)"
RDEPEND="${DEPEND}
	>=net-p2p/bitcoin-core-23.2[cli]
	acct-user/bitcoin"

PATCHES=(
	"${FILESDIR}/${PV}-build-do-not-Werror.patch"
	"${FILESDIR}/${PV}-build-do-not-refresh-external-modules.patch"
	"${FILESDIR}/${PV}-build-remove-deprecated-AM_ENABLE_MULTILIB.patch"
	"${FILESDIR}/${PV}-build-use-FHS-docdir.patch"
	"${FILESDIR}/${PV}-build-do-not-cargo-quiet.patch"
)

src_unpack () {
	git-r3_src_unpack
	cargo_src_unpack
}

src_prepare() {
	default

	export PYTEST=:
	export CC="$(tc-getCC)" CONFIGURATOR_CC="${CBUILD}-gcc"
	export PKG_CONFIG="$(tc-getPKG_CONFIG)"
	export CDEBUGFLAGS="-std=gnu11 -fstack-protector ${CFLAGS}"

	sed -i \
		-e "s:^VERSION=.*:VERSION=${PVR}:" \
		Makefile \
		|| die

	local externals=( libbacktrace libsodium libwally-core )

	for x in ${externals[@]} ; do
		pushd "external/${x}" > /dev/null || die
		eautoreconf
		popd > /dev/null || die
	done

	if use python ; then
		pushd "${S}/contrib/pyln-client" > /dev/null || die
		distutils-r1_src_prepare
		popd > /dev/null || die
	fi
}

src_configure() {
	./configure \
		--prefix="${EPREFIX}/usr" \
		--enable-compat \
		--enable-rust \
		--disable-static \
		--disable-valgrind \
		--disable-address-sanitizer \
		--disable-ub-sanitize \
		--disable-fuzzing \
		|| die "configure failed"
}

src_compile() {
	emake CDEBUGFLAGS="${CDEBUGFLAGS}" V=1

	if use python ; then
		pushd "${S}/contrib/pyln-client" > /dev/null || die
		distutils-r1_src_compile
		popd > /dev/null || die
	fi
}

src_install() {
	default

	if use python ; then
		pushd "${S}/contrib/pyln-client" > /dev/null || die
		distutils-r1_src_install
		popd > /dev/null || die
	fi

	systemd_dounit contrib/init/lightningd.service
	newbashcomp contrib/lightning-cli.bash-completion lightning-cli
}