commit: 2288dbd85d69bf94b26fcc7415e93c75135313a6 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sat May 31 04:34:44 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat May 31 05:10:15 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2288dbd8
net-proxy/mitmproxy-linux: Bump to 0.12.5 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> net-proxy/mitmproxy-linux/Manifest | 2 + .../mitmproxy-linux/mitmproxy-linux-0.12.5.ebuild | 105 +++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/net-proxy/mitmproxy-linux/Manifest b/net-proxy/mitmproxy-linux/Manifest index f6c847489570..fb9038ed9964 100644 --- a/net-proxy/mitmproxy-linux/Manifest +++ b/net-proxy/mitmproxy-linux/Manifest @@ -9,9 +9,11 @@ DIST miniz_oxide-0.8.3.crate 61827 BLAKE2B ae8626de8711a8b7c2bce52d2e226a3e973ba DIST mitmproxy_linux-0.11.5.tar.gz 1285776 BLAKE2B 5ba240481abab07e399fb94732c47e9d6f4ebb33a00d4966f44766d270123af43eceda7ae8b1d190b3e29f080568f4d92df52d785c5b60d67a6f1c3889032404 SHA512 faf99e52dbc0f52e95f108fa252c153e1c7a3177a9f2c990e768f5e0289f247dda4c85a150407ccc750a3e171f984d10b77ee9759138935f2d2631f09bd223e1 DIST mitmproxy_linux-0.12.0.tar.gz 1287742 BLAKE2B 781fe78970e0da6206e4a709ff06496874d06deeb38f224a7ead012336a3633981647f0f4d3f4a06b4531df490c10207a034876d063e32d1e4030e2aa2588375 SHA512 0b103d36d6420ca518286b27582dfdec7ee041b30a7745c2476150b699af51b053ee68176033ac6d4a7753260505d041eb3e281af7fd3eb541a6e05527a90765 DIST mitmproxy_linux-0.12.3.tar.gz 1287684 BLAKE2B 2aa69e752826824b1b4fe175171e185157053f54e5ce356b722c152ddc44e43f6296763f811d193ab9f03d32a4e2ac826f3d156df96ba1e226558585540ff6de SHA512 c3e9f19c4e70712c95c078b40b668a209d73cb830d363af779fa1fb4dd27f7d214ccb1bac141b878ec4a18f576862823b40e2a2e1474e92e7f0cc96e7e99c698 +DIST mitmproxy_linux-0.12.5.tar.gz 1287168 BLAKE2B 2d5a95dc0f0bba0f762bb7f341cce179f2008744677284cc4e291b06d8ee1fb192bae952155982adefbce1ba5abe0ae73fe756c37bb8815c73d1189a0f2d91ea SHA512 d7c0246e24047a77da887f9cf7cf340eaa2eac29633ece53781b66b3ce257f11237a632bfe8029fff9ae1ad95efc648352b4a275f8f031d8821be13a98006a4f DIST mitmproxy_rs-0.11.5-crates.tar.xz 50121936 BLAKE2B 1f4645c44c42b904c300661b4314c0245e16a6bec6cdc7198d38e0492cccc4704cfdf479c5943ab73b6806ad62f9385289b5a7e9cee582d3e0def8381dac5869 SHA512 70facfa58bc45e2e0ee854b8d3fbd53818a93b319a117019f4713ab15793e065ea263ad6edae5086938755433c20756c7d23c3b023451e4cc052f2a98f956f60 DIST mitmproxy_rs-0.12.0-crates.tar.xz 62765072 BLAKE2B 270793c1aaf313ad9d256963e67906dfba1e901d24c8549bc4ccd2b09b4dceeb85f8232f45a0859bc53f0a92907051a0ec8a50394a2afe04c94ef3b99659c2ef SHA512 5ad0978d88f487aceebe6d579d0a226388198d2afda31a918fa521a048def313697157391f7971703bebe0134015640aa9841557d943c742a5172fcdfce84d86 DIST mitmproxy_rs-0.12.3-crates.tar.xz 55236484 BLAKE2B d1279c3b64ec12f88d71ab053bdc460053558ff51e655f7b348f498874482f3a08a727c4f96f7e4382798865b71b7496791a2a026457f00f852893a422777f76 SHA512 235e1a7126e1aac94a8d6a88f20e56e048801971a12a6d2f8717a37607cefbc80c88d650647d8106d6e5d179e8a7400fa136cbdf732ecab5e9cdae1e92fd108c +DIST mitmproxy_rs-0.12.5-crates.tar.xz 48932336 BLAKE2B dfdb6fc0c789361e90bd14e7ae02d81705b98a69d7d6b91114eaaac317ca2971fb6d4ed8fe3eb4801826adf8f782727fbe018d71adf21b1634eecd6039619671 SHA512 f8cb08bd509112f67e1ff1b2e4af9f4e3117a9451e7fae0bef7428ee6f1c576732a1ace69898fa3379ebf9a5da4293014b3cf7dffdd6f0d16f36f5de433d5c0c DIST r-efi-4.5.0.crate 63921 BLAKE2B ea8c1c5f9d7ce0a3dc5b541dbd276895872143b6337aa2269914a89a4da1f9da278fa4a153cc3d30fd1a86f2b61abd2431ce0d607d38540bdfa642e3e09b03c3 SHA512 5a66e9425bcd4babed85e7a79d09fa5beee65a4d2cacb3916fcc12518d6b927f557630415bdc446ff21c31cd4c78fe7cea6031b5557ee8c98d6dbae6a5e0198d DIST r-efi-alloc-1.0.0.crate 13351 BLAKE2B aae3d9bf923e3757871caeac7b13c17917ad595ff7d281ba7a4dcae822aaa85c5aef8de208121fdbcdc1d80174e041d794c515a0a8866b37848ae173957ef29c SHA512 4c37970eb78ce19d85701f7b6e24b066b3dfa6dda6823701d1312561b48f4aab5aa2be6be3277ac753a8a046bfd04c8d90010415687426cd4de4c6d5db474b13 DIST unicode-width-0.1.14.crate 271615 BLAKE2B dd2e1504caedecb5d37c397ba05446d3d762b8b6833a8032ebbc213e324d53d89db5e96ed2f7223096e5754d800b39a54105906effc88d9437d7acb9e7beb81e SHA512 3c58a18776aa82cc13c761789a47901616cd98a30356f93d7eb05ae457314209d0a66213e2bbfa5eb8b59be6beacf62438234ce8daafa31b128dbf7d5d6fcadb diff --git a/net-proxy/mitmproxy-linux/mitmproxy-linux-0.12.5.ebuild b/net-proxy/mitmproxy-linux/mitmproxy-linux-0.12.5.ebuild new file mode 100644 index 000000000000..6ac6bfc6504f --- /dev/null +++ b/net-proxy/mitmproxy-linux/mitmproxy-linux-0.12.5.ebuild @@ -0,0 +1,105 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Extra crates required at runtime via rustc-build-sysroot crate. +# Note: versions are locked in /usr/lib/rust/*/lib/rustlib/src/rust/library/Cargo.lock. +CRATES=" + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] +" + +# Implied by crates above. +RUST_MIN_VER=1.86.0 +RUST_MAX_VER=1.86.0 + +declare -A GIT_CRATES=( + [boringtun]='https://github.com/cloudflare/boringtun;e3252d9c4f4c8fc628995330f45369effd4660a1;boringtun-%commit%/boringtun' +) + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=maturin +PYTHON_COMPAT=( python3_{12..13} ) +RUST_REQ_USE="llvm_targets_BPF(+),rust-src" + +inherit cargo distutils-r1 pypi + +DESCRIPTION="mitmproxy's Rust bits" +HOMEPAGE=" + https://github.com/mitmproxy/mitmproxy_rs/ + https://pypi.org/project/mitmproxy-rs/ +" +SRC_URI+=" + ${CARGO_CRATE_URIS} + https://github.com/gentoo-crate-dist/mitmproxy_rs/releases/download/v${PV}/mitmproxy_rs-${PV}-crates.tar.xz +" + +LICENSE="MIT" +# Dependent crate licenses +LICENSE+=" + 0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD ISC + LGPL-3+ MIT Unicode-3.0 WTFPL-2 ZLIB +" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +BDEPEND=" + dev-util/bpf-linker +" + +src_prepare() { + local PATCHES=( + # aya-ebpf overwrites libc functions with incompatible + # implementations that break everything, and therefore + # can only be used for bpf* targets + # https://github.com/aya-rs/aya/issues/1254 + "${FILESDIR}/${PN}-0.11.5-no-host-aya-ebpf.patch" + ) + + distutils-r1_src_prepare + + # replace upstream crate substitution with our crate substitution, sigh + local bor_dep=$(grep ^boringtun "${ECARGO_HOME}"/config.toml || die) + sed -i -e "/boringtun/s;^.*$;${bor_dep};" Cargo.toml || die + + # this only implicitly builds mitmproxy-linux-ebpf, and is broken + # https://github.com/mitmproxy/mitmproxy/issues/7663 + rm mitmproxy-linux/build.rs || die +} + +src_configure() { + # first, we must build mitmproxy-linux-ebpf for the bpf target + # bpf-linker requires BPF target that is only available in nightly + local -x RUSTC_BOOTSTRAP=1 + # no clue why this needs to be explicit + local -x RUSTFLAGS="-C linker=bpf-linker" + + local cmd=( + "${CARGO}" build + -Z build-std=core + --bins + --release + --target=bpfel-unknown-none + ) + + pushd mitmproxy-linux-ebpf >/dev/null || die + echo "${cmd[*]}" >&2 + "${cmd[@]}" || die "${cmd[*]} failed" + popd >/dev/null || die + + export OUT_DIR="${S}/target/bpfel-unknown-none/release" +} + +python_test() { + cargo_src_test --manifest-path mitmproxy-linux/Cargo.toml +}
