commit: 96c5d25f02e6eeccd84b38e98be4fae76a0e683f Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sun Apr 20 11:43:46 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sun Apr 20 11:45:21 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96c5d25f
net-proxy/mitmproxy-linux: Bump to 0.12.0 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> net-proxy/mitmproxy-linux/Manifest | 4 + .../mitmproxy-linux/mitmproxy-linux-0.12.0.ebuild | 105 +++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/net-proxy/mitmproxy-linux/Manifest b/net-proxy/mitmproxy-linux/Manifest index 636b43c2af3f..89f3ebb3a961 100644 --- a/net-proxy/mitmproxy-linux/Manifest +++ b/net-proxy/mitmproxy-linux/Manifest @@ -3,9 +3,13 @@ DIST compiler_builtins-0.1.146.crate 212475 BLAKE2B 9036a9e643ad310932c7943ce5e4 DIST dlmalloc-0.2.7.crate 84295 BLAKE2B 8ab86016f66e18fc367645ea3871babdb6077895abf59534514c1ff6a5f072cb06d86c8585798d90822f1e7a45180f5ec5cc82811a93e8bafc16e7b28d375faf SHA512 d3da8fb71e6f02ee3f4cbb9fd63170f7b6dc16aa2fcad5d19a718a0872dbc3596bc98d9ee6ae17dafcfd18d295582bd611c8bf86916aaa17a7849f4c6cc81f3e DIST fortanix-sgx-abi-0.5.0.crate 13334 BLAKE2B ccdfdd2e7a0592b0efcd4269695b7367e1e6fd2da7aac3b6e2b174375e787ec00134c3156286656155839367c031aabb748e50c15aa539ab3b3da22de3fef132 SHA512 4239bd0fe3a2c9e0b4a0e0eb82bacb417e1f798fb4d908bb5cc021ddfe6e41688f8ee16f9a18cda692ef78afb264a440af7444cfde43a0c29d0299781ea43ccb DIST getopts-0.2.21.crate 18457 BLAKE2B 10651e947e49acc768d99ae56ca5a7f37c1f61bbd1674e2ca58e3ae563fd64f3563d53ccdd0ae7a878710a39e13a99ac8c274974157db2c691f8c222de14992d SHA512 5515ae6ccb0f03efb783683f46cfd1755342c4e83bb673ff8914c7f9dea0dae333f8d9703865e992659a359067df0e8b0e2253de0d4b0c7707cbe7d73401bb1f +DIST hermit-abi-0.4.0.crate 16310 BLAKE2B efcd1dee7bcd6d185cbe0051c7bc7e2776857ffcfd2adc3fb101febd7c1bd75994b7e4a4a0a59c5b4628cc2521b4c1f043e98a0c44935d0180e7499667690ab8 SHA512 b1a21f6d54598185a8e8c29565ffc2e1bc5da57cf1c9d87ba643d23d7c23d53e8ad36ee2f5c1ec8a504334b6f98b0f17a832ff37877c7b7f9238b196f4034e6f +DIST libc-0.2.169.crate 757901 BLAKE2B 1012cf93d8975aa20fc3f2332e253426ff66be6aed63ace5292cc8568ee419b0f1a4b5b39ddbb78d9c2dfd8d72eb0d068c98faa229ab55556da5e674429f0e97 SHA512 c4566330a7967efc211edf31a23647d1a33aa51fc25aa4e9337716748c8fd4be0ae63679220ff2cf6e892f37d03bc5264c55e8f082eb82574a6ec1fa8e5e45ce DIST miniz_oxide-0.8.3.crate 61827 BLAKE2B ae8626de8711a8b7c2bce52d2e226a3e973ba6919ed33904883ae6287f848fcf40642afdb9ad71bba19db181fe9ea354c85cd81c1dad889588d5df8fcc99b9f2 SHA512 b79cd67a477851b18ed87c887bfd9f40f97059eb3fedbdc3a52eac66b5fcea42cae833eea39fd62becdb057b337f91d27f2087a407d02770feeaea934c0b1e1c 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_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 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.0.ebuild b/net-proxy/mitmproxy-linux/mitmproxy-linux-0.12.0.ebuild new file mode 100644 index 000000000000..c41db10a948c --- /dev/null +++ b/net-proxy/mitmproxy-linux/mitmproxy-linux-0.12.0.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=" + compiler_builtins@0.1.146 + dlmalloc@0.2.7 + fortanix-sgx-abi@0.5.0 + getopts@0.2.21 + hermit-abi@0.4.0 + libc@0.2.169 + miniz_oxide@0.8.3 + r-efi-alloc@1.0.0 + r-efi@4.5.0 + unwinding@0.2.5 + unicode-width@0.1.14 +" + +# 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" + +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" + +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 +}