# 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 }