# Copyright 2010-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 RUST_MIN_VER="1.85" CRATES=" aho-corasick-1.1.4 android_system_properties-0.1.5 anyhow-1.0.101 arrayvec-0.7.6 autocfg-1.5.0 bech32-0.10.0-beta bitcoin-0.31.2 bitcoin-internals-0.2.0 bitcoin_hashes-0.13.0 bitflags-2.11.0 bumpalo-3.19.1 bytecount-0.6.9 bytes-1.11.1 cc-1.2.56 cfg-if-1.0.4 chacha20-0.10.0 chrono-0.4.43 cln-plugin-0.5.0 cln-rpc-0.5.0 core-foundation-sys-0.8.7 cpufeatures-0.3.0 equivalent-1.0.2 find-msvc-tools-0.1.9 fnv-1.0.7 foldhash-0.1.5 futures-0.3.32 futures-channel-0.3.32 futures-core-0.3.32 futures-executor-0.3.32 futures-io-0.3.32 futures-macro-0.3.32 futures-sink-0.3.32 futures-task-0.3.32 futures-util-0.3.32 getrandom-0.4.1 hashbrown-0.15.5 hashbrown-0.16.1 heck-0.5.0 hex-0.4.3 hex-conservative-0.1.2 hex_lit-0.1.1 iana-time-zone-0.1.65 iana-time-zone-haiku-0.1.2 id-arena-2.3.0 indexmap-2.13.0 itoa-1.0.17 js-sys-0.3.85 lazy_static-1.5.0 leb128fmt-0.1.0 libc-0.2.182 libmimalloc-sys-0.1.44 lock_api-0.4.14 log-0.4.29 log-panics-2.1.0 matchers-0.2.0 memchr-2.8.0 mimalloc-0.1.48 mio-1.1.1 nu-ansi-term-0.50.3 num-format-0.4.4 num-traits-0.2.19 once_cell-1.21.3 papergrid-0.17.0 parking_lot-0.12.5 parking_lot_core-0.9.12 pin-project-lite-0.2.16 prettyplease-0.2.37 proc-macro-error-attr2-2.0.0 proc-macro-error2-2.0.1 proc-macro2-1.0.106 quote-1.0.44 r-efi-5.3.0 rand-0.10.0 rand_core-0.10.0 redox_syscall-0.5.18 regex-automata-0.4.14 regex-syntax-0.8.9 rustversion-1.0.22 scopeguard-1.2.0 secp256k1-0.28.2 secp256k1-sys-0.9.2 semver-1.0.27 serde-1.0.228 serde_core-1.0.228 serde_derive-1.0.228 serde_json-1.0.149 sharded-slab-0.1.7 shlex-1.3.0 slab-0.4.12 smallvec-1.15.1 socket2-0.6.2 syn-2.0.116 tabled-0.20.0 tabled_derive-0.11.0 testing_table-0.3.0 thread_local-1.1.9 tokio-1.49.0 tokio-macros-2.6.0 tokio-stream-0.1.18 tokio-util-0.7.18 tracing-0.1.44 tracing-attributes-0.1.31 tracing-core-0.1.36 tracing-log-0.2.0 tracing-subscriber-0.3.22 unicode-ident-1.0.24 unicode-width-0.2.2 unicode-xid-0.2.6 valuable-0.1.1 wasi-0.11.1+wasi-snapshot-preview1 wasip2-1.0.1+wasi-0.2.4 wasip3-0.4.0+wasi-0.3.0-rc-2026-01-06 wasm-bindgen-0.2.108 wasm-bindgen-macro-0.2.108 wasm-bindgen-macro-support-0.2.108 wasm-bindgen-shared-0.2.108 wasm-encoder-0.244.0 wasm-metadata-0.244.0 wasmparser-0.244.0 windows-core-0.62.2 windows-implement-0.60.2 windows-interface-0.59.3 windows-link-0.2.1 windows-result-0.4.1 windows-strings-0.5.1 windows-sys-0.60.2 windows-sys-0.61.2 windows-targets-0.53.5 windows_aarch64_gnullvm-0.53.1 windows_aarch64_msvc-0.53.1 windows_i686_gnu-0.53.1 windows_i686_gnullvm-0.53.1 windows_i686_msvc-0.53.1 windows_x86_64_gnu-0.53.1 windows_x86_64_gnullvm-0.53.1 windows_x86_64_msvc-0.53.1 wit-bindgen-0.46.0 wit-bindgen-0.51.0 wit-bindgen-core-0.51.0 wit-bindgen-rust-0.51.0 wit-bindgen-rust-macro-0.51.0 wit-component-0.244.0 wit-parser-0.244.0 zmij-1.0.21 " # additional crates from cln-plugin, cln-rpc CRATES+=" async-stream-0.3.6 async-stream-impl-0.3.6 env_logger-0.10.2 hermit-abi-0.5.2 humantime-2.2.0 is-terminal-0.4.16 termcolor-1.4.1 tokio-test-0.4.4 winapi-util-0.1.9 " inherit cargo eapi9-ver DESCRIPTION="A Core Lightning plugin to automatically rebalance multiple channels" HOMEPAGE="https://github.com/daywalker90/sling" SRC_URI="${HOMEPAGE}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz $(cargo_crate_uris)" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86 " RDEPEND=" >=net-p2p/core-lightning-23.11 " PATCHES=( "${FILESDIR}/support-version-without-v.patch" ) efmt() { : ${1:?} ; local l ; while read -r l ; do "${!#}" "${l}" ; done < <(fmt "${@:1:$#-1}") } src_install() { cargo_src_install insinto /usr/libexec/c-lightning/plugins mv -- "${ED}/usr/bin/sling" "${ED}/usr/libexec/c-lightning/plugins/" || die } pkg_postinst() { if ver_replacing -lt 4.0.0 ; then efmt ewarn <<-EOF This version of ${CATEGORY}/${PN} drops the config variables sling-refresh-peers-interval and sling-refresh-gossmap-interval. You will need to remove these from your lightningd.conf if they are present. EOF fi }