summaryrefslogblamecommitdiff
path: root/net-p2p/c-lightning/c-lightning-24.05.ebuild
blob: e7dbd498ee755b381aefd26100c471d88af79e6f (plain) (tree)
1
2
3
4
5
6
7
8


                                                                  
      



                                  



                  




                       
                  

               

                
             
             
            


                     
              



              
            

                   
              
                
            
                 
                
                     

              




                          
                   






                       


                
                
                
          
                
         

             


               
              

                   
             
              

                 
                

             
                 
            




                   

                     
                 
          


              

                   
                  


                 
                  
                



                           
              
         




                          



                   
                  



                   
            




                   




                     
            
                     
                      




                    

               

                   

                            


                    


                  
             
             

           
          

                   







                     
                      
                  

                   
                

                 




                   

                         
                     


                         
              
                    

                 
              
            
          
                                  







                                 
                                
                 

                                  
                  







                              














                                                                                      
             











                                                          

                           
                            
                       






                                                                
                                        
















































                                                                            




























                                                                       
# 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.21.0
adler@1.0.2
aho-corasick@1.1.1
anyhow@1.0.75
asn1-rs-derive@0.4.0
asn1-rs-impl@0.1.0
asn1-rs@0.5.2
async-stream-impl@0.3.5
async-stream@0.3.5
async-trait@0.1.73
autocfg@1.1.0
axum-core@0.3.4
axum@0.6.20
backtrace@0.3.69
base64@0.13.1
base64@0.21.4
bech32@0.9.1
bitcoin-private@0.1.0
bitcoin@0.30.1
bitcoin_hashes@0.12.0
bitflags@1.3.2
bitflags@2.4.0
bumpalo@3.14.0
bytes@1.5.0
cc@1.0.83
cfg-if@1.0.0
data-encoding@2.4.0
der-parser@8.2.0
deranged@0.3.8
displaydoc@0.2.4
either@1.9.0
env_logger@0.10.0
equivalent@1.0.1
errno-dragonfly@0.1.2
errno@0.3.3
fastrand@2.0.1
fixedbitset@0.4.2
fnv@1.0.7
foreign-types-shared@0.1.1
foreign-types@0.3.2
futures-channel@0.3.28
futures-core@0.3.30
futures-executor@0.3.28
futures-io@0.3.28
futures-macro@0.3.28
futures-sink@0.3.28
futures-task@0.3.28
futures-util@0.3.28
futures@0.3.28
getrandom@0.2.10
gimli@0.28.0
h2@0.3.21
hashbrown@0.12.3
hashbrown@0.14.0
heck@0.4.1
hermit-abi@0.3.3
hex@0.4.3
hex_lit@0.1.1
home@0.5.5
http-body@0.4.5
http@0.2.9
httparse@1.8.0
httpdate@1.0.3
humantime@2.1.0
hyper-timeout@0.4.1
hyper@0.14.27
indexmap@1.9.3
indexmap@2.0.0
is-terminal@0.4.9
itertools@0.10.5
itoa@1.0.9
js-sys@0.3.64
lazy_static@1.4.0
libc@0.2.153
linux-raw-sys@0.4.7
log@0.4.20
matchers@0.1.0
matchit@0.7.3
memchr@2.6.3
mime@0.3.17
minimal-lexical@0.2.1
miniz_oxide@0.7.1
mio@0.8.10
multimap@0.8.3
nom@7.1.3
ntapi@0.3.7
nu-ansi-term@0.46.0
num-bigint@0.4.4
num-integer@0.1.45
num-traits@0.2.16
num_cpus@1.16.0
object@0.32.1
oid-registry@0.6.1
once_cell@1.18.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@1.1.1
percent-encoding@2.3.0
petgraph@0.6.4
pin-project-internal@1.1.3
pin-project-lite@0.2.13
pin-project@1.1.3
pin-utils@0.1.0
pkg-config@0.3.25
ppv-lite86@0.2.17
prettyplease@0.1.25
proc-macro2@1.0.78
prost-build@0.11.9
prost-derive@0.11.9
prost-types@0.11.9
prost@0.11.9
quote@1.0.35
rand@0.8.5
rand_chacha@0.3.1
rand_core@0.6.4
rcgen@0.10.0
redox_syscall@0.3.5
regex-automata@0.1.10
regex-automata@0.3.8
regex-syntax@0.6.29
regex-syntax@0.7.5
regex@1.9.5
ring@0.16.20
rustc-demangle@0.1.23
rusticata-macros@4.1.0
rustix@0.38.14
rustls-pemfile@1.0.3
rustls@0.20.9
rustversion@1.0.14
ryu@1.0.15
schannel@0.1.19
sct@0.7.0
secp256k1-sys@0.8.1
secp256k1@0.27.0
security-framework-sys@2.6.1
security-framework@2.6.1
serde@1.0.196
serde_derive@1.0.196
serde_json@1.0.113
sharded-slab@0.1.7
slab@0.4.9
smallvec@1.11.2
socket2@0.4.9
socket2@0.5.5
spin@0.5.2
syn@1.0.109
syn@2.0.48
sync_wrapper@0.1.2
synstructure@0.12.6
tempfile@3.8.0
termcolor@1.3.0
thiserror-impl@1.0.49
thiserror@1.0.49
thread_local@1.1.7
time-core@0.1.2
time-macros@0.2.15
time@0.3.29
tokio-io-timeout@1.2.0
tokio-macros@2.2.0
tokio-rustls@0.23.4
tokio-stream@0.1.14
tokio-test@0.4.3
tokio-util@0.7.10
tokio@1.36.0
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.4
unicode-ident@1.0.12
unicode-xid@0.2.4
untrusted@0.7.1
valuable@0.1.0
vcpkg@0.2.15
want@0.3.1
wasi@0.11.0+wasi-snapshot-preview1
wasm-bindgen-backend@0.2.87
wasm-bindgen-macro-support@0.2.87
wasm-bindgen-macro@0.2.87
wasm-bindgen-shared@0.2.87
wasm-bindgen@0.2.87
web-sys@0.3.64
webpki@0.22.1
which@4.4.2
winapi-i686-pc-windows-gnu@0.4.0
winapi-util@0.1.6
winapi-x86_64-pc-windows-gnu@0.4.0
winapi@0.3.9
windows-sys@0.48.0
windows-targets@0.48.5
windows_aarch64_gnullvm@0.48.5
windows_aarch64_msvc@0.48.5
windows_i686_gnu@0.48.5
windows_i686_msvc@0.48.5
windows_x86_64_gnu@0.48.5
windows_x86_64_gnullvm@0.48.5
windows_x86_64_msvc@0.48.5
x509-parser@0.14.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.34.0[${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
}