因为对全部软件包逐一核对上游后发现 42 个的 `LICENSE=` 与上游实际授权不符,所以按上游的授权文件与源码文件头改正,并为其中被误标为开源、实为专有的软件补上 `RESTRICT`。 最严重的一类是专有软件被标成开源:`deepin-wine-helper` 与 `deepin-wine-plugin` 的 deb 内 copyright 写着 `All rights reserved by Wuhan Deepin Technology Co., Ltd.`,`app-misc/z-library` 的 deb control 写 `License: unknown`,`media-sound/qqmusic` 用的 `CC0-1.0` 是公共领域捐弃、与腾讯的服务协议完全相反。 `net-proxy/clash-rs` 此前只有 `LICENSE+=`、没有基底 `LICENSE=`,主程序的 Apache-2.0 完全没有声明。 `sys-kernel/xanmod-sources` 的 `LICENSE+=" CDDL"` 在 xanmod patch 与 genpatches 中都找不到依据,一并删除。 Signed-off-by: Zakk <zakk@gentoozh.org>
124 lines
4.7 KiB
Bash
124 lines
4.7 KiB
Bash
# Copyright 2025-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# Autogenerated by pycargoebuild 0.13.4
|
|
|
|
EAPI=8
|
|
|
|
CRATES="
|
|
"
|
|
|
|
declare -A GIT_CRATES=(
|
|
[boring-noise]='https://github.com/Watfaq/boring-noise;9ddf1b54d0c9679e7bc50e9151f72d526190db1a;boring-noise-%commit%'
|
|
[console-api]='https://github.com/tokio-rs/console;59e23edf17b0e42e87e315bfc9cbb8a6ba2f401f;console-%commit%/console-api'
|
|
[console-subscriber]='https://github.com/tokio-rs/console;59e23edf17b0e42e87e315bfc9cbb8a6ba2f401f;console-%commit%/console-subscriber'
|
|
[dhcproto-macros]='https://github.com/bluecatengineering/dhcproto;eece41c9a13b0e4912fb9a8f08401ab01b4123d4;dhcproto-%commit%/dhcproto-macros'
|
|
[dhcproto]='https://github.com/bluecatengineering/dhcproto;eece41c9a13b0e4912fb9a8f08401ab01b4123d4;dhcproto-%commit%'
|
|
[netstack-lwip]='https://github.com/eycorsican/netstack-lwip;f434fefd6c227c9dfbec84c364452ba6c1532779;netstack-lwip-%commit%'
|
|
[quinn-congestions]='https://github.com/proxy-rs/quinn-congestions;2bdc356f57a7fc3ae1a49ab963a221f42d61012f;quinn-congestions-%commit%'
|
|
[quinn-proto]='https://github.com/Tipuch/quinn;ce60e5b5c115db2a6053f4e0ca7fc52103cb76b9;quinn-%commit%/quinn-proto'
|
|
[quinn-udp]='https://github.com/Tipuch/quinn;ce60e5b5c115db2a6053f4e0ca7fc52103cb76b9;quinn-%commit%/quinn-udp'
|
|
[quinn]='https://github.com/Tipuch/quinn;ce60e5b5c115db2a6053f4e0ca7fc52103cb76b9;quinn-%commit%/quinn'
|
|
[rustls-acme]='https://github.com/rust-proxy/rustls-acme;cc306ff72acd5f4b47cda426137ae80d10a425ce;rustls-acme-%commit%'
|
|
[rustls]='https://github.com/Watfaq/rustls;e6e8e7e1a0d65f2f273eb7b5b6179896536ac174;rustls-%commit%/rustls'
|
|
[shadowquic-macros]='https://github.com/spongebob888/shadowquic;295034e1b6478706a4348565bfc3ecea8378da98;shadowquic-%commit%/shadowquic-macros'
|
|
[shadowquic]='https://github.com/spongebob888/shadowquic;295034e1b6478706a4348565bfc3ecea8378da98;shadowquic-%commit%/shadowquic'
|
|
[shadowsocks]='https://github.com/shadowsocks/shadowsocks-rust;c4d8d18527289d12470cad1ce718754c908a75fe;shadowsocks-rust-%commit%/crates/shadowsocks'
|
|
[sock2proc]='https://github.com/Watfaq/sock2proc;9f9e6304d62285115b2e4fa632527ae563bf0fcc;sock2proc-%commit%'
|
|
[tokio-rustls]='https://github.com/Watfaq/tokio-rustls;b26e3e2b7a0161d505fd12d6e545b16463f1a45f;tokio-rustls-%commit%'
|
|
[tuic-core]='https://github.com/Itsusinn/tuic;e4ae97bca5d5386ae964f09631e72c3bd392ca6b;tuic-%commit%/tuic-core'
|
|
[tuic-server]='https://github.com/Itsusinn/tuic;e4ae97bca5d5386ae964f09631e72c3bd392ca6b;tuic-%commit%/tuic-server'
|
|
[unix-udp-sock]='https://github.com/Watfaq/unix-udp-sock;847c80b519f0fd8cff5c887ae708429897d08671;unix-udp-sock-%commit%'
|
|
)
|
|
|
|
RUST_MIN_VER="1.95.0"
|
|
|
|
inherit cargo systemd
|
|
|
|
DESCRIPTION="Custom protocol, rule based network proxy"
|
|
HOMEPAGE="
|
|
https://watfaq.gitbook.io/clashrs-user-manual/
|
|
https://github.com/Watfaq/clash-rs/
|
|
"
|
|
SRC_URI="
|
|
https://github.com/Watfaq/clash-rs/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
|
|
https://github.com/gentoo-zh-drafts/${PN}/releases/download/v${PV}/${P}-crates.tar.xz
|
|
${CARGO_CRATE_URIS}
|
|
"
|
|
|
|
# Dependent crate licenses
|
|
LICENSE="Apache-2.0"
|
|
# Dependent crate licenses
|
|
LICENSE+="
|
|
0BSD Apache-2.0 BSD-2 BSD CC0-1.0 CDLA-Permissive-2.0 GPL-3+ ISC MIT
|
|
MPL-2.0 Unicode-3.0 Unlicense ZLIB
|
|
"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
|
|
IUSE="+lto +standard plus perf bench"
|
|
REQUIRED_USE="
|
|
debug? ( !lto )
|
|
"
|
|
|
|
BDEPEND="
|
|
llvm-core/clang
|
|
dev-libs/protobuf
|
|
"
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}/${PN}-0.10.2-remove-default-dashboard.patch"
|
|
)
|
|
|
|
gen_git_crate_dir() {
|
|
# https://github.com/gentoo/gentoo/blob/b09dd88412fe2d5eee5a8891e08bfa2d67848da3/eclass/cargo.eclass#L442
|
|
IFS=';' read -r crate_uri commit crate_dir <<<"${GIT_CRATES[$1]}"
|
|
echo "${WORKDIR}/${crate_dir//%commit%/${commit}}"
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
# Remove the [patch.crates-io] section and add path-based patches
|
|
sed -i '/^\[patch\.crates-io\]/,/^$/d' "${S}/Cargo.toml" || die
|
|
|
|
# Add new patch section with local paths
|
|
cat >> "${S}/Cargo.toml" <<-EOF || die
|
|
[patch.crates-io]
|
|
rustls = { path = "$(gen_git_crate_dir rustls)" }
|
|
tokio-rustls = { path = "$(gen_git_crate_dir tokio-rustls)" }
|
|
shadowquic = { path = "$(gen_git_crate_dir shadowquic)" }
|
|
shadowquic-macros = { path = "$(gen_git_crate_dir shadowquic-macros)" }
|
|
EOF
|
|
}
|
|
|
|
src_configure() {
|
|
local myfeatures=(
|
|
$(usev standard)
|
|
$(usev plus)
|
|
$(usev perf)
|
|
$(usev bench)
|
|
)
|
|
cargo_src_configure
|
|
}
|
|
|
|
src_compile() {
|
|
if use !debug; then
|
|
# let portage do the strip
|
|
export CARGO_PROFILE_RELEASE_STRIP=false
|
|
if use !lto; then
|
|
export CARGO_PROFILE_RELEASE_LTO=false
|
|
fi
|
|
fi
|
|
|
|
# enable unstable features
|
|
export RUSTC_BOOTSTRAP=1
|
|
cargo_src_compile --package=clash-rs --bin=clash-rs
|
|
}
|
|
|
|
src_install() {
|
|
dobin "$(cargo_target_dir)"/clash-rs
|
|
insinto "/etc/clash-rs"
|
|
doins "${FILESDIR}/config.example.yaml"
|
|
systemd_dounit "${FILESDIR}/clash-rs.service"
|
|
}
|