[gentoo-dev] [PATCH 06/10] dev-lang/rust{,-bin}: -r100: Drop the `profiler` USE.

2024-11-06 Thread kangie
From: Matt Jolly 

We're the ones deviating from the norm. Including the profiler does not
noticably increase the build time (at least on amd64), nor does it
pull in additional dependencies.

What it _does_ do is break upstream build systems that assume
a standard rust configuration like upstream would ship (i.e. with
profiler). This is particularly challenging as -bin (obviously)
does not have this problem.

Closes: https://bugs.gentoo.org/941146
Signed-off-by: Matt Jolly 
---
 dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild |  5 -
 dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild |  5 -
 dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild |  5 -
 dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild | 16 
 dev-lang/rust-bin/rust-bin-1.79.0-r100.ebuild | 16 
 dev-lang/rust-bin/rust-bin-1.80.1-r100.ebuild | 17 -
 dev-lang/rust-bin/rust-bin-1.81.0-r100.ebuild |  4 +++-
 dev-lang/rust-bin/rust-bin-1.82.0-r100.ebuild |  3 ++-
 dev-lang/rust/rust-1.71.1-r100.ebuild | 13 +
 dev-lang/rust/rust-1.74.1-r100.ebuild | 13 +
 dev-lang/rust/rust-1.75.0-r100.ebuild | 13 +
 dev-lang/rust/rust-1.77.1-r100.ebuild | 13 +
 dev-lang/rust/rust-1.79.0-r100.ebuild | 13 +
 dev-lang/rust/rust-1.80.1-r100.ebuild | 11 ---
 dev-lang/rust/rust-1.81.0-r100.ebuild |  4 ++--
 dev-lang/rust/rust-1.82.0-r100.ebuild |  4 ++--
 16 files changed, 74 insertions(+), 81 deletions(-)

diff --git a/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild 
b/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
index 75c3e4c3db47..f6253e143ceb 100644
--- a/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
@@ -25,7 +25,8 @@ LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA"
 SLOT="${PV}"
 KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
 IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src 
rustfmt"
-REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+DEPEND=""
 
 RDEPEND="
>=app-eselect/eselect-rust-20190311
@@ -39,6 +40,8 @@ BDEPEND="
verify-sig? ( sec-keys/openpgp-keys-rust )
 "
 
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
 # stripping rust may break it (at least on x86_64)
 # https://github.com/rust-lang/rust/issues/112286
 RESTRICT="strip"
diff --git a/dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild 
b/dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild
index e3953894d833..72d99299f2f5 100644
--- a/dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild
@@ -35,7 +35,8 @@ LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
 SLOT="${PV}"
 KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv ~s390 sparc x86"
 IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src 
rustfmt"
-REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+DEPEND=""
 
 RDEPEND="
>=app-eselect/eselect-rust-20190311
@@ -49,6 +50,8 @@ BDEPEND="
verify-sig? ( sec-keys/openpgp-keys-rust )
 "
 
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
 # stripping rust may break it (at least on x86_64)
 # https://github.com/rust-lang/rust/issues/112286
 RESTRICT="strip"
diff --git a/dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild 
b/dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild
index 4b621acc54cf..2215bfe6392a 100644
--- a/dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild
@@ -35,7 +35,8 @@ LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
 SLOT="${PV}"
 KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv ~s390 sparc x86"
 IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src 
rustfmt"
-REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+DEPEND=""
 
 RDEPEND="
>=app-eselect/eselect-rust-20190311
@@ -49,6 +50,8 @@ BDEPEND="
verify-sig? ( sec-keys/openpgp-keys-rust )
 "
 
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
 # stripping rust may break it (at least on x86_64)
 # https://github.com/rust-lang/rust/issues/112286
 RESTRICT="strip"
diff --git a/dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild 
b/dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild
index 655805403a51..3eb7823bd8f0 100644
--- a/dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild
@@ -34,8 +34,9 @@ SRC_URI+=" mips? (
 LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
 SLOT="${PV}"
 KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix profiler rust-analyzer 
rust-src rustfmt"
-REQUIRED_USE="${LLVM_REQUIRED_USE} x86? ( cpu_flags_x86_sse2 )"
+IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src 
rustfmt"
+
+DEPEND=""
 
 RDEPEND="
>=app-eselect/eselect-rust-20190311
@@ -49,6 +50,8 @@ BDEPEND="
verify-sig? ( sec-keys/openpgp-keys-rust )
 "
 
+REQUIRED_USE="x86? ( cpu_flags

[gentoo-dev] [PATCH 02/10] cargo: update for rust eclass

2024-11-06 Thread kangie
From: Matt Jolly 

Inherit the rust eclass and take advantage of eclass features like
`RUST_MIN_VER`.

Also replace calls to `cargo` with the rust eclass exported ${CARGO}.

If used without llvm-r1 (typical usage) an || dependency on Rust
slots (between `RUST_M{AX,IN}_VER` if set) will be added.

If intending to use with llvm-r1 for a tight dependency, set
`RUST_NEEDS_LLVM` to automatically add a `llvm_slot_X` USE gated
Rust dependency for each slot in LLVM_COMPAT to BDEPEND.
This respects `RUST_M{AX,IN}_VER`.

Signed-off-by: Matt Jolly 
---
 eclass/cargo.eclass | 46 -
 1 file changed, 33 insertions(+), 13 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 499fe5498c96..c74c2b29045c 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -8,6 +8,7 @@
 # Doug Goldstein 
 # Georgy Yakovlev 
 # @SUPPORTED_EAPIS: 8
+# @PROVIDES: rust
 # @BLURB: common functions and variables for cargo builds
 
 case ${EAPI} in
@@ -18,23 +19,39 @@ esac
 if [[ -z ${_CARGO_ECLASS} ]]; then
 _CARGO_ECLASS=1
 
-# check and document RUST_DEPEND and options we need below in case conditions.
+if [[ -n ${RUST_NEEDS_LLVM} ]]; then
+   if [[ -z ${_LLVM_R1_ECLASS} ]]; then
+   die "Please inherit llvm-r1.eclass before cargo.eclass when 
using RUST_NEEDS_LLVM"
+   fi
+fi
+
+# Either the lowest slot supported by rust.eclass _or_
+# reference the changelog for a particular feature requirement
 # https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md
-RUST_DEPEND="virtual/rust"
+_CARGO_ECLASS_RUST_MIN_VER="1.71.1"
 
 case ${EAPI} in
8)
-   # 1.39 added --workspace
-   # 1.46 added --target dir
-   # 1.48 added term.progress config option
-   # 1.51 added split-debuginfo profile option
-   # 1.52 may need setting RUSTC_BOOTSTRAP envvar for some crates
-   # 1.53 added cargo update --offline, can be used to update 
vulnerable crates from pre-fetched registry without editing toml
-   RUST_DEPEND=">=virtual/rust-1.53"
+   if [[ -n ${RUST_MIN_VER} ]]; then
+   # This is _very_ unlikely given that we leverage the 
rust eclass but just in case cargo requires a newer version
+   # than the oldest in-tree in future.
+   if ver_test "${RUST_MIN_VER}" -lt 
"${_CARGO_ECLASS_RUST_MIN_VER}"; then
+   die "RUST_MIN_VERSION must be at least 
${_CARGO_ECLASS_RUST_MIN_VER}"
+   fi
+   else
+   RUST_MIN_VER=${_CARGO_ECLASS_RUST_MIN_VER}
+   fi
;;
 esac
 
-inherit flag-o-matic multiprocessing rust-toolchain toolchain-funcs
+inherit flag-o-matic multiprocessing rust rust-toolchain toolchain-funcs
+
+if [[ -n ${RUST_NEEDS_LLVM} ]]; then
+   # Generate llvm_slot_x USE-gated deps for each slot in LLVM_COMPAT
+   RUST_DEPEND="${RUST_LLVM_DEPEND}"
+else
+   RUST_DEPEND="$(rust_gen_dep)"
+fi
 
 [[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
 
@@ -531,6 +548,9 @@ cargo_src_configure() {
 # take affect due to Cargo limitations, so add these to your ebuild's RUSTFLAGS
 # if they seem important.
 cargo_env() {
+
+   debug-print-function ${FUNCNAME} "$@"
+
[[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
 
@@ -604,7 +624,7 @@ cargo_env() {
 cargo_src_compile() {
debug-print-function ${FUNCNAME} "$@"
 
-   set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
+   set -- ${CARGO} build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
cargo_env "${@}" || die "cargo build failed"
 }
@@ -618,7 +638,7 @@ cargo_src_compile() {
 cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
 
-   set -- cargo install $(has --path ${@} || echo --path ./) \
+   set -- ${CARGO} install $(has --path ${@} || echo --path ./) \
--root "${ED}/usr" \
${GIT_CRATES[@]:+--frozen} \
$(usex debug --debug "") \
@@ -636,7 +656,7 @@ cargo_src_install() {
 cargo_src_test() {
debug-print-function ${FUNCNAME} "$@"
 
-   set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
+   set -- ${CARGO} test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
cargo_env "${@}" || die "cargo test failed"
 }
-- 
2.47.0




[gentoo-dev] [PATCH 00/10] new eclass: rust; slotting dev-lang/rust{-bin}

2024-11-06 Thread kangie
From: Matt Jolly 

This patchset slots Rust, adds `rust.eclass`, a helper eclass for slotted Rust,
and updates `cargo.eclass` to take advantage of the new slotted Rust, requiring 
a
revbump of dependent packages.

The intent is to immediately deprecate and shortly remove legacy Rust slots
and the virtual package which do nothing but inflict pain on developers and 
users.

There are several example ebuilds using the new eclass attached.

These patches, along with a mega-commit containing required revbumps for
every cargo.eclass ebuild (a vast majority of the rust ecosystem) are
also available for comment as a PR. The intent is to merge the PR when
all cargo eclass packages have been revbumped and tested and the eclass
has been reviewed.

https://github.com/gentoo/gentoo/pull/39218

I'm about 100 cargo eclass ebuilds deep at this point. Please do not
merge anything that uses the Cargo eclass (or any new Rust packages,
really) until this is (hopefully) merged in a few days.

Some example ebuilds have been included to demonstrate usage of 
the eclass for anything more complex than just `inherit rust`.

Please let me know if you have any concerns or feedback and I'll address
them promptly.

Cheers,

Matt

Matt Jolly (10):
  rust.eclass: Introduce new eclass for slotted Rust
  cargo: update for rust eclass
  dev-lang/rust: port to llvm-r1 and slot (-r100)
  profiles/arch/mips: use.mask system-llvm on rust-1.71.1-r100
  dev-lang/rust-bin: llvm-r1 and slot (-r100)
  dev-lang/rust{,-bin}: -r100: Drop the `profiler` USE.
  www-client/chromium: example chromium with slotted rust
  www-client/firefox: add 132.0-r1 - rust and llvm-r1 eclasses
  gnome-base/librsvg: rust eclass
  net-libs/rustls-ffi: rust slot

 dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild |  233 +++
 dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild |  243 +++
 dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild |  243 +++
 dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild |  245 +++
 dev-lang/rust-bin/rust-bin-1.79.0-r100.ebuild |  248 +++
 dev-lang/rust-bin/rust-bin-1.80.1-r100.ebuild |  252 +++
 dev-lang/rust-bin/rust-bin-1.81.0-r100.ebuild |  249 +++
 dev-lang/rust-bin/rust-bin-1.82.0-r100.ebuild |  250 +++
 dev-lang/rust-common/Manifest |4 +
 .../rust-common/rust-common-1.81.0.ebuild |   42 +
 .../rust-common/rust-common-1.82.0.ebuild |   42 +
 dev-lang/rust/rust-1.71.1-r100.ebuild |  726 +
 dev-lang/rust/rust-1.74.1-r100.ebuild |  762 +
 dev-lang/rust/rust-1.75.0-r100.ebuild |  765 +
 dev-lang/rust/rust-1.77.1-r100.ebuild |  764 +
 dev-lang/rust/rust-1.79.0-r100.ebuild |  767 +
 dev-lang/rust/rust-1.80.1-r100.ebuild |  765 +
 dev-lang/rust/rust-1.81.0-r100.ebuild |  766 +
 dev-lang/rust/rust-1.82.0-r100.ebuild |  773 +
 eclass/cargo.eclass   |   46 +-
 eclass/rust.eclass|  480 ++
 gnome-base/librsvg/librsvg-2.58.2-r1.ebuild   |  421 +
 .../rustls-ffi/rustls-ffi-0.13.0-r1.ebuild|  107 ++
 profiles/arch/mips/package.use.mask   |4 +
 .../chromium/chromium-130.0.6723.91-r1.ebuild | 1387 +
 www-client/firefox/firefox-132.0-r1.ebuild| 1341 
 26 files changed, 11912 insertions(+), 13 deletions(-)
 create mode 100644 dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.79.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.80.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.81.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.82.0-r100.ebuild
 create mode 100644 dev-lang/rust-common/Manifest
 create mode 100644 dev-lang/rust-common/rust-common-1.81.0.ebuild
 create mode 100644 dev-lang/rust-common/rust-common-1.82.0.ebuild
 create mode 100644 dev-lang/rust/rust-1.71.1-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.74.1-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.75.0-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.77.1-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.79.0-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.80.1-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.81.0-r100.ebuild
 create mode 100644 dev-lang/rust/rust-1.82.0-r100.ebuild
 create mode 100644 eclass/rust.eclass
 create mode 100644 gnome-base/librsvg/librsvg-2.58.2-r1.ebuild
 create mode 100644 net-libs/rustls-ffi/rustls-ffi-0.13.0-r1.ebuild
 create mode 100644 www-client/chromium/chromium-130.0.6723.91-r1.ebuild
 create mode 100644 www-client/firefox/firefox-132.0-r1.ebuild

-- 
2.47.0




[gentoo-dev] [PATCH 04/10] profiles/arch/mips: use.mask system-llvm on rust-1.71.1-r100

2024-11-06 Thread kangie
From: Matt Jolly 

This requires a version of LLVM that is not keyworded for mips.

Signed-off-by: Matt Jolly 
---
 profiles/arch/mips/package.use.mask | 4 
 1 file changed, 4 insertions(+)

diff --git a/profiles/arch/mips/package.use.mask 
b/profiles/arch/mips/package.use.mask
index fa77510aa188..9dffa1399424 100644
--- a/profiles/arch/mips/package.use.mask
+++ b/profiles/arch/mips/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Matt Jolly  (2024-11-03)
+# Requires llvm 16 which is not keyworded
+=dev-lang/rust-1.71.1-r100 system-llvm
+
 # Felix Janda  (2024-10-20)
 # requires dev-libs/libcss and net-libs/libdom to be keyworded
 www-client/elinks libcss
-- 
2.47.0




[gentoo-dev] [PATCH 05/10] dev-lang/rust-bin: llvm-r1 and slot (-r100)

2024-11-06 Thread kangie
From: Matt Jolly 

Use the llvm-r1 eclass and our knowledge of the internal
LLVM used in -bin to add an appropriate `llvm_slot_{x}`
IUSE to each Rust-bin ebuild so that the Rust (and LLVM)
eclasses can select an appropriate slotted implementation.

`LLVM_OPTIONAL` is used as we don't need to consume LLVM,
we really just want the free IUSE.

Do some minor tidyup while touching _all_ of the ebuilds.

Signed-off-by: Matt Jolly 
---
 dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild | 230 
 dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild | 240 +
 dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild | 240 +
 dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild | 245 +
 dev-lang/rust-bin/rust-bin-1.79.0-r100.ebuild | 248 +
 dev-lang/rust-bin/rust-bin-1.80.1-r100.ebuild | 253 ++
 dev-lang/rust-bin/rust-bin-1.81.0-r100.ebuild | 247 +
 dev-lang/rust-bin/rust-bin-1.82.0-r100.ebuild | 249 +
 8 files changed, 1952 insertions(+)
 create mode 100644 dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.74.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.75.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.77.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.79.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.80.1-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.81.0-r100.ebuild
 create mode 100644 dev-lang/rust-bin/rust-bin-1.82.0-r100.ebuild

diff --git a/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild 
b/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
new file mode 100644
index ..75c3e4c3db47
--- /dev/null
+++ b/dev-lang/rust-bin/rust-bin-1.71.1-r100.ebuild
@@ -0,0 +1,230 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( 16 )
+LLVM_OPTIONAL="yes"
+
+inherit llvm-r1 multilib prefix rust-toolchain toolchain-funcs verify-sig 
multilib-minimal
+
+MY_P="rust-${PV}"
+# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep 
"xz_url.*rust-src"
+MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-08-03/rust-src-${PV}.tar.xz"
+GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}"; # 
omit leading slash
+
+DESCRIPTION="Language empowering everyone to build reliable and efficient 
software"
+HOMEPAGE="https://www.rust-lang.org/";
+SRC_URI="$(rust_all_arch_uris ${MY_P})
+   rust-src? ( ${MY_SRC_URI} )
+"
+# Keep this separate to allow easy commenting out if not yet built
+SRC_URI+=" sparc? ( 
${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz -> 
${MY_P}-sparc64-unknown-linux-gnu.sam.tar.xz ) "
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src 
rustfmt"
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+RDEPEND="
+   >=app-eselect/eselect-rust-20190311
+   dev-libs/openssl
+   sys-apps/lsb-release
+   sys-devel/gcc:*
+"
+
+BDEPEND="
+   prefix? ( dev-util/patchelf )
+   verify-sig? ( sec-keys/openpgp-keys-rust )
+"
+
+# stripping rust may break it (at least on x86_64)
+# https://github.com/rust-lang/rust/issues/112286
+RESTRICT="strip"
+
+QA_PREBUILT="
+   opt/${P}/bin/.*
+   opt/${P}/lib/.*.so
+   opt/${P}/libexec/.*
+   opt/${P}/lib/rustlib/.*/bin/.*
+   opt/${P}/lib/rustlib/.*/lib/.*
+"
+
+# An rmeta file is custom binary format that contains the metadata for the 
crate.
+# rmeta files do not support linking, since they do not contain compiled 
object files.
+# so we can safely silence the warning for this QA check.
+QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta"
+
+VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/rust.asc"
+
+pkg_pretend() {
+   if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then
+   die "${CHOST} is not supported by upstream Rust. You must use a 
hard float version."
+   fi
+}
+
+src_unpack() {
+   # sadly rust-src tarball does not have corresponding .asc file
+   # so do partial verification
+   if use verify-sig; then
+   for f in ${A}; do
+   if [[ -f ${DISTDIR}/${f}.asc ]]; then
+   verify-sig_verify_detached "${DISTDIR}/${f}" 
"${DISTDIR}/${f}.asc"
+   fi
+   done
+   fi
+
+   default_src_unpack
+
+   mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die
+}
+
+patchelf_for_bin() {
+   local filetype=$(file -b ${1})
+   if [[ ${filetype} == *ELF*interpreter* ]]; then
+   einfo "${1}'s interpreter changed"
+   patchelf ${1} --set-interpreter ${2} || die
+   elif [[ ${filetype} == *script* ]]; then
+   hprefixify ${1}
+  

[gentoo-dev] [PATCH 07/10] www-client/chromium: example chromium with slotted rust

2024-11-06 Thread kangie
From: Matt Jolly 

Signed-off-by: Matt Jolly 
---
 .../chromium/chromium-130.0.6723.91-r1.ebuild | 1387 +
 1 file changed, 1387 insertions(+)
 create mode 100644 www-client/chromium/chromium-130.0.6723.91-r1.ebuild

diff --git a/www-client/chromium/chromium-130.0.6723.91-r1.ebuild 
b/www-client/chromium/chromium-130.0.6723.91-r1.ebuild
new file mode 100644
index ..64ca7de51b11
--- /dev/null
+++ b/www-client/chromium/chromium-130.0.6723.91-r1.ebuild
@@ -0,0 +1,1387 @@
+# Copyright 2009-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# PACKAGING NOTES
+
+# This uses a gentoo-created tarball due to Google CI Failures.
+# Use 132 as a base for new official tarballs.
+
+GN_MIN_VER=0.2165
+# chromium-tools/get-chromium-toolchain-strings.py
+
+VIRTUALX_REQUIRED="pgo"
+
+CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr 
gu he
+   hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl 
sr
+   sv sw ta te th tr uk ur vi zh-CN zh-TW"
+
+LLVM_COMPAT=( 18 19 )
+RUST_NEEDS_LLVM="yes please"
+PYTHON_COMPAT=( python3_{11..13} )
+PYTHON_REQ_USE="xml(+)"
+RUST_MIN_VER=1.78.0
+
+inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing 
ninja-utils pax-utils
+inherit python-any-r1 qmake-utils readme.gentoo-r1 rust systemd 
toolchain-funcs virtualx xdg-utils
+
+DESCRIPTION="Open-source version of Google Chrome web browser"
+HOMEPAGE="https://www.chromium.org/";
+PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
+TEST_FONT=f26f29c9d3bfae588207bbc9762de8d142e58935c62a86f67332819b15203b35
+PATCH_V="${PV%%\.*}-2"
+SRC_URI="https://chromium-tarballs.distfiles.gentoo.org/${P}.tar.xz
+   
https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
+   test? (
+   
https://chromium-tarballs.distfiles.gentoo.org/${P}-testdata.tar.xz
+   https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> 
chromium-testfonts-${TEST_FONT:0:10}.tar.gz
+   )
+   ppc64? (
+   
https://gitlab.solidsilicon.io/public-development/open-source/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2
 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
+   )
+   pgo? ( 
https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar
 )"
+
+LICENSE="BSD"
+SLOT="0/stable"
+# Dev exists mostly to give devs some breathing room for beta/stable releases;
+# it shouldn't be keyworded but adventurous users can select it.
+if [[ ${SLOT} == "0/dev" ]]; then
+   KEYWORDS=""
+else
+   KEYWORDS="~amd64 ~arm64 ~ppc64"
+fi
+
+IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-png +system-zstd"
+IUSE="+X ${IUSE_SYSTEM_LIBS} bindist cups debug ffmpeg-chromium gtk4 +hangouts 
headless kerberos +official pax-kernel pgo +proprietary-codecs pulseaudio"
+IUSE+=" qt5 qt6 +screencast selinux test +vaapi +wayland +widevine 
cpu_flags_ppc_vsx3"
+RESTRICT="
+   !bindist? ( bindist )
+   !test? ( test )
+"
+
+REQUIRED_USE="
+   !headless? ( || ( X wayland ) )
+   pgo? ( X !wayland )
+   qt6? ( qt5 )
+   screencast? ( wayland )
+   ffmpeg-chromium? ( bindist proprietary-codecs )
+"
+
+COMMON_X_DEPEND="
+   x11-libs/libXcomposite:=
+   x11-libs/libXcursor:=
+   x11-libs/libXdamage:=
+   x11-libs/libXfixes:=
+   >=x11-libs/libXi-1.6.0:=
+   x11-libs/libXrandr:=
+   x11-libs/libXrender:=
+   x11-libs/libXtst:=
+   x11-libs/libxshmfence:=
+"
+
+COMMON_SNAPSHOT_DEPEND="
+   system-icu? ( >=dev-libs/icu-73.0:= )
+   >=dev-libs/libxml2-2.12.4:=[icu]
+   dev-libs/nspr:=
+   >=dev-libs/nss-3.26:=
+   dev-libs/libxslt:=
+   media-libs/fontconfig:=
+   >=media-libs/freetype-2.11.0-r1:=
+   system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] )
+   media-libs/libjpeg-turbo:=
+   system-png? ( media-libs/libpng:=[-apng(-)] )
+   system-zstd? ( >=app-arch/zstd-1.5.5:= )
+   >=media-libs/libwebp-0.4.0:=
+   media-libs/mesa:=[gbm(+)]
+   >=media-libs/openh264-1.6.0:=
+   sys-libs/zlib:=
+   x11-libs/libdrm:=
+   !headless? (
+   dev-libs/glib:2
+   >=media-libs/alsa-lib-1.0.19:=
+   pulseaudio? ( media-libs/libpulse:= )
+   sys-apps/pciutils:=
+   kerberos? ( virtual/krb5 )
+   vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
+   X? (
+   x11-base/xorg-proto:=
+   x11-libs/libX11:=
+   x11-libs/libxcb:=
+   x11-libs/libXext:=
+   )
+   x11-libs/libxkbcommon:=
+   wayland? (
+   dev-libs/libffi:=
+   dev-libs/wayland:=
+   screencast? ( media-video/pipewire:= )
+   )

[gentoo-dev] [PATCH 08/10] www-client/firefox: add 132.0-r1 - rust and llvm-r1 eclasses

2024-11-06 Thread kangie
From: Matt Jolly 

Firefox is a bit unusual in that the LTO via the USE=clang path
requires a strong dependency between the selected Rust and LLVM
slots, while building with GCC (and without LTO) does not.

Leverage llvm-r1 to add `llvm_slot_x` USE and use these to ensure
that an appropriate Rust impl is always available. The Rust dependency
is not gated by `clang?` so that if a user selects `llvm_slot_19`
portage will attempt to pick an appraopriate Rust impl.

This may pull LLVM in on a few more systems, but they likely had
it anyway.

Signed-off-by: Matt Jolly 
---
 www-client/firefox/firefox-132.0-r1.ebuild | 1341 
 1 file changed, 1341 insertions(+)
 create mode 100644 www-client/firefox/firefox-132.0-r1.ebuild

diff --git a/www-client/firefox/firefox-132.0-r1.ebuild 
b/www-client/firefox/firefox-132.0-r1.ebuild
new file mode 100644
index ..6a8687fea3bb
--- /dev/null
+++ b/www-client/firefox/firefox-132.0-r1.ebuild
@@ -0,0 +1,1341 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+FIREFOX_PATCHSET="firefox-132-patches-01.tar.xz"
+
+LLVM_COMPAT=( 17 18 19 )
+# This will also filter Rust versions in the non-llvm-r1 case, but this is 
fine.
+RUST_NEEDS_LLVM=1
+
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE="ncurses,sqlite,ssl"
+
+WANT_AUTOCONF="2.1"
+
+VIRTUALX_REQUIRED="manual"
+
+MOZ_ESR=
+
+MOZ_PV=${PV}
+MOZ_PV_SUFFIX=
+if [[ ${PV} =~ (_(alpha|beta|rc).*)$ ]] ; then
+   MOZ_PV_SUFFIX=${BASH_REMATCH[1]}
+
+   # Convert the ebuild version to the upstream Mozilla version
+   MOZ_PV="${MOZ_PV/_alpha/a}" # Handle alpha for SRC_URI
+   MOZ_PV="${MOZ_PV/_beta/b}"  # Handle beta for SRC_URI
+   MOZ_PV="${MOZ_PV%%_rc*}"# Handle rc for SRC_URI
+fi
+
+if [[ -n ${MOZ_ESR} ]] ; then
+   # ESR releases have slightly different version numbers
+   MOZ_PV="${MOZ_PV}esr"
+   HOMEPAGE="https://www.mozilla.com/firefox 
https://www.mozilla.org/firefox/enterprise/";
+   SLOT="esr"
+else
+   HOMEPAGE="https://www.mozilla.com/firefox";
+   SLOT="rapid"
+fi
+
+MOZ_PN="${PN%-bin}"
+MOZ_P="${MOZ_PN}-${MOZ_PV}"
+MOZ_PV_DISTFILES="${MOZ_PV}${MOZ_PV_SUFFIX}"
+MOZ_P_DISTFILES="${MOZ_PN}-${MOZ_PV_DISTFILES}"
+
+inherit autotools check-reqs desktop flag-o-matic gnome2-utils linux-info 
llvm-r1 multiprocessing \
+   optfeature pax-utils python-any-r1 rust readme.gentoo-r1 
toolchain-funcs virtualx xdg
+
+MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/releases/${MOZ_PV}";
+
+if [[ ${PV} == *_rc* ]] ; then
+   
MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/candidates/${MOZ_PV}-candidates/build${PV##*_rc}";
+fi
+
+PATCH_URIS=(
+   https://dev.gentoo.org/~juippis/mozilla/patchsets/${FIREFOX_PATCHSET}
+)
+
+DESCRIPTION="Firefox Web Browser"
+SRC_URI="${MOZ_SRC_BASE_URI}/source/${MOZ_P}.source.tar.xz -> 
${MOZ_P_DISTFILES}.source.tar.xz
+   ${PATCH_URIS[@]}"
+S="${WORKDIR}/${PN}-${PV%_*}"
+LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+
+IUSE="clang dbus debug eme-free hardened hwaccel jack +jumbo-build libproxy 
openh264 pgo"
+IUSE+=" pulseaudio sndio selinux +system-av1 +system-harfbuzz +system-icu 
+system-jpeg"
+IUSE+=" +system-jpeg +system-libevent +system-libvpx system-png +system-webp 
+telemetry valgrind"
+IUSE+=" wayland wifi +X"
+
+# Firefox-only IUSE
+IUSE+=" +gmp-autoupdate gnome-shell"
+
+# !jumbo-build? ( clang ) -> bmo#1914774, bgo#939004 - causes seemingly random 
compile crashes with gcc.
+# A side effect of supporting both the clang and non-clang path; 
LLVM_REQUIRED_USE here
+# prevents users from disabling all `llvm_slot_#` USE flags, ensuring that a 
suitable Rust can be selected.
+REQUIRED_USE="|| ( X wayland )
+   debug? ( !system-av1 )
+   !jumbo-build? ( clang )
+   wayland? ( dbus )
+   wifi? ( dbus )
+"
+
+FF_ONLY_DEPEND="!www-client/firefox:0
+   selinux? ( sec-policy/selinux-mozilla )"
+BDEPEND="${PYTHON_DEPS}
+   $(llvm_gen_dep '
+   sys-devel/clang:${LLVM_SLOT}
+   sys-devel/llvm:${LLVM_SLOT}
+   clang? (
+   sys-devel/lld:${LLVM_SLOT}
+   )
+   pgo? ( sys-libs/compiler-rt-sanitizers:${LLVM_SLOT}[profile] )
+   ')
+   ${RUST_LLVM_DEPS}
+   app-alternatives/awk
+   app-arch/unzip
+   app-arch/zip
+   >=dev-util/cbindgen-0.26.0
+   net-libs/nodejs
+   virtual/pkgconfig
+   amd64? ( >=dev-lang/nasm-2.14 )
+   x86? ( >=dev-lang/nasm-2.14 )
+   pgo? (
+   X? (
+   sys-devel/gettext
+   x11-base/xorg-server[xvfb]
+   x11-apps/xhost
+   )
+   !X? (
+   || (
+   gui-wm/tinywl
+   &2
+   return 1
+   fi
+
+   if use clang && ! tc-ld-is-mold ; then
+ 

[gentoo-dev] [PATCH 01/10] rust.eclass: Introduce new eclass for slotted Rust

2024-11-06 Thread kangie
From: Matt Jolly 

The rust eclass acts similarly to the llvm eclass.

It works with optional `RUST_{MAX,MIN}_SLOT` variables to
enable ebuilds to trivially generate (and enforce) dependencies
on an appropriate Rust SLOT.

A `RUST_NEEDS_LLVM` variable can be set to have the eclass read
`LLVM_COMPAT` and generate an llvm-r1-USE-gated dependency string
for use in the ebuild, storing the result in `RUST_LLVM_DEP` for
consumption. `llvm_gen_dep` is not suitable; see the eclass for
detail on why a `rust_llvm_gen_dep` was not implemented.

The default `rust_pkg_setup` will prefix the selected slot to
`PATH` and export `RUSTC` and `CARGO` variables pointing to that
slot for ease-of-use.

This should prevent issues like:

Bug: https://bugs.gentoo.org/907492
Bug: https://bugs.gentoo.org/942444
Signed-off-by: Matt Jolly 
---
 eclass/rust.eclass | 480 +
 1 file changed, 480 insertions(+)
 create mode 100644 eclass/rust.eclass

diff --git a/eclass/rust.eclass b/eclass/rust.eclass
new file mode 100644
index ..bf9c47cd7f4b
--- /dev/null
+++ b/eclass/rust.eclass
@@ -0,0 +1,480 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: rust.eclass
+# @MAINTAINER:
+# Matt Jolly 
+# @AUTHOR:
+# Matt Jolly 
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Utility functions to build against slotted Rust
+# @DESCRIPTION:
+# An eclass to reliably depend on a Rust or Rust/LLVM combination for
+# a given Rust slot. To use the eclass:
+#
+# 1. If required, set RUST_{MAX,MIN}_SLOT to the range of supported slots.
+# 2. Use rust_gen_deps to add appropriate dependencies. (rust_gen_llvm_deps 
for LLVM)
+# 3. Use rust_pkg_setup, get_rust_prefix or RUST_SLOT.
+
+# Example use for a package supporting Rust 1.72.0 to 1.82.0:
+# @CODE
+#
+# RUST_MAX_VER="1.82.0"
+# RUST_MIN_VER="1.72.0"
+#
+# inherit meson rust
+#
+# BDEPEND="
+#  $(rust_gen_deps)
+# "
+#
+# # only if you need to define one explicitly
+# pkg_setup() {
+#  rust_pkg_setup
+#  do-something-else
+# }
+# @CODE
+#
+# Example for a package needing Rust w/ a specific target:
+# @CODE
+# inherit meson rust
+#
+# RDEPEND="
+#  $(rust_gen_deps)
+# "
+# DEPEND=${RDEPEND}
+#
+# rust_check_deps() {
+#  local rust_slot rust_type
+#  { read -r RUST_SLOT; read -r RUST_TYPE; } <<< $(rust_check_usedep 
${RUST_SLOT} "clippy,${MULTILIB_USEDEP}")
+#   if [[ -n ${RUST_SLOT} ]] && [[ -n ${RUST_TYPE} ]]; then
+#  return 0
+#  else
+#  return 1
+#  fi
+# }
+# @CODE
+
+case ${EAPI} in
+   8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_RUST_ECLASS} ]]; then
+_RUST_ECLASS=1
+
+# == internal control knobs ==
+
+# @ECLASS_VARIABLE: _RUST_KNOWN_SLOTS
+# @INTERNAL
+# @DESCRIPTION:
+# Definitive list of Rust slots and the associated LLVM slot, newest first.
+declare -A -g -r _RUST_KNOWN_SLOTS=(
+   ["1.82.0"]=19
+   ["1.81.0"]=18
+   ["1.80.1"]=18
+   ["1.79.0"]=18
+   ["1.77.1"]=17
+   ["1.75.0"]=17
+   ["1.74.1"]=17
+   ["1.71.1"]=16
+)
+
+# @ECLASS_VARIABLE: _RUST_SLOTS_ORDERED
+# @INTERNAL
+# @DESCRIPTION:
+# Array of Rust slots, newest first.
+# While _RUST_KNOWN_SLOTS stores useful info about the relationship between 
Rust and LLVM slots,
+# this array is used to store the Rust slots in a more convenient order for 
iteration.
+declare -a -g -r _RUST_SLOTS_ORDERED=(
+   "1.82.0"
+   "1.81.0"
+   "1.80.1"
+   "1.79.0"
+   "1.77.1"
+   "1.75.0"
+   "1.74.1"
+   "1.71.1"
+)
+
+# == control variables ==
+
+# @ECLASS_VARIABLE: RUST_MAX_VER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Highest Rust slot supported by the package. Needs to be set before
+# rust_pkg_setup is called. If unset, no upper bound is assumed.
+
+# @ECLASS_VARIABLE: RUST_MIN_VER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Lowest Rust slot supported by the package. Needs to be set before
+# rust_pkg_setup is called. If unset, no lower bound is assumed.
+
+# @eclass-variable: RUST_NEEDS_LLVM
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set to a non-empty value generate a llvm_slot_${llvm_slot}? gated
+# dependency block for rust slots in LLVM_COMPAT. This is useful for
+# packages that need a tight coupling between Rust and LLVM but don't
+# really care _which_ version of Rust is selected. Combine with
+# RUST_MAX_VER and RUST_MIN_VER to limit the range of Rust versions
+# that are acceptable. Will `die` if llvm-r1 is not inherited or
+# an invalid combination of RUST and LLVM slots is detected; this probably
+# means that a LLVM slot in LLVM_COMPAT has had all of its Rust slots filtered.
+
+# @ECLASS_VARIABLE: RUST_LLVM_DEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This is an eclass-generated, llvm-r1 USE gated, Rust dependency string
+# for all LLVM implementations listed in LLVM_COMPAT, filtered by
+# RUST_MAX_VER and RUST_MIN_VER.
+
+# == global metadata ==
+
+_rust_set_globals() {
+

[gentoo-dev] [PATCH 10/10] net-libs/rustls-ffi: rust slot

2024-11-06 Thread kangie
From: Matt Jolly 

Signed-off-by: Matt Jolly 
---
 .../rustls-ffi/rustls-ffi-0.13.0-r1.ebuild| 107 ++
 1 file changed, 107 insertions(+)
 create mode 100644 net-libs/rustls-ffi/rustls-ffi-0.13.0-r1.ebuild

diff --git a/net-libs/rustls-ffi/rustls-ffi-0.13.0-r1.ebuild 
b/net-libs/rustls-ffi/rustls-ffi-0.13.0-r1.ebuild
new file mode 100644
index ..4f144686f120
--- /dev/null
+++ b/net-libs/rustls-ffi/rustls-ffi-0.13.0-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES="
+   aho-corasick@1.1.1
+   base64@0.21.5
+   cc@1.0.83
+   cfg-if@1.0.0
+   getrandom@0.2.11
+   libc@0.2.153
+   log@0.4.21
+   memchr@2.6.4
+   once_cell@1.19.0
+   regex-automata@0.3.9
+   regex-syntax@0.7.5
+   regex@1.9.6
+   ring@0.17.5
+   rustls-pemfile@2.1.1
+   rustls-pki-types@1.3.1
+   rustls-webpki@0.102.2
+   rustls@0.23.4
+   rustversion@1.0.14
+   spin@0.9.8
+   subtle@2.5.0
+   untrusted@0.9.0
+   wasi@0.11.0+wasi-snapshot-preview1
+   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
+   zeroize@1.7.0
+"
+
+inherit cargo flag-o-matic multilib-minimal rust-toolchain
+
+DESCRIPTION="C-to-rustls bindings"
+HOMEPAGE="https://github.com/rustls/rustls-ffi";
+SRC_URI="https://github.com/rustls/rustls-ffi/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
+SRC_URI+=" ${CARGO_CRATE_URIS}"
+
+LICENSE="|| ( Apache-2.0 MIT ISC )"
+# Dependent crate licenses
+LICENSE+=" BSD ISC MIT"
+# For Ring (see its LICENSE)
+LICENSE+=" ISC openssl SSLeay MIT"
+SLOT="0/${PV%.*}"
+KEYWORDS="~amd64"
+
+BDEPEND="dev-util/cargo-c"
+
+QA_FLAGS_IGNORED="usr/lib.*/librustls.*"
+
+src_prepare() {
+   default
+
+   multilib_copy_sources
+}
+
+src_configure() {
+   # bug #927231
+   filter-lto
+
+   multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+   local cargoargs=(
+   --library-type=cdylib
+   --prefix="${EPREFIX}"/usr
+   --libdir="${EPREFIX}/usr/$(get_libdir)"
+   --target="$(rust_abi)"
+   $(usev !debug '--release')
+   )
+
+   cargo cbuild "${cargoargs[@]}" || die "cargo cbuild failed"
+}
+
+multilib_src_test() {
+   local cargoargs=(
+   --prefix="${EPREFIX}"/usr
+   --libdir="${EPREFIX}/usr/$(get_libdir)"
+   --target="$(rust_abi)"
+   $(usex debug '--debug' '--release')
+   )
+
+   cargo ctest "${cargoargs[@]}" || die "cargo ctest failed"
+}
+
+multilib_src_install() {
+   local cargoargs=(
+   --library-type=cdylib
+   --prefix="${EPREFIX}"/usr
+   --libdir="${EPREFIX}/usr/$(get_libdir)"
+   --target="$(rust_abi)"
+   --destdir="${D}"
+   $(usex debug '--debug' '--release')
+   )
+
+   cargo cinstall "${cargoargs[@]}" || die "cargo cinstall failed"
+}
-- 
2.47.0




[gentoo-dev] [PATCH 09/10] gnome-base/librsvg: rust eclass

2024-11-06 Thread kangie
From: Matt Jolly 

Signed-off-by: Matt Jolly 
---
 gnome-base/librsvg/librsvg-2.58.2-r1.ebuild | 421 
 1 file changed, 421 insertions(+)
 create mode 100644 gnome-base/librsvg/librsvg-2.58.2-r1.ebuild

diff --git a/gnome-base/librsvg/librsvg-2.58.2-r1.ebuild 
b/gnome-base/librsvg/librsvg-2.58.2-r1.ebuild
new file mode 100644
index ..3668fbd0cdfe
--- /dev/null
+++ b/gnome-base/librsvg/librsvg-2.58.2-r1.ebuild
@@ -0,0 +1,421 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{10..13} )
+
+CRATES="
+   adler@1.0.2
+   aho-corasick@1.1.2
+   android-tzdata@0.1.1
+   android_system_properties@0.1.5
+   anes@0.1.6
+   anstream@0.6.11
+   anstyle-parse@0.2.3
+   anstyle-query@1.0.2
+   anstyle-wincon@3.0.2
+   anstyle@1.0.6
+   anyhow@1.0.79
+   approx@0.5.1
+   assert_cmd@2.0.13
+   autocfg@1.1.0
+   bit-set@0.5.3
+   bit-vec@0.6.3
+   bit_field@0.10.2
+   bitflags@1.3.2
+   bitflags@2.4.2
+   block@0.1.6
+   bstr@1.9.0
+   bumpalo@3.14.0
+   bytemuck@1.14.2
+   byteorder@1.5.0
+   cairo-rs@0.19.1
+   cairo-sys-rs@0.19.1
+   cast@0.3.0
+   cc@1.0.83
+   cfg-expr@0.15.6
+   cfg-if@1.0.0
+   chrono@0.4.33
+   ciborium-io@0.2.2
+   ciborium-ll@0.2.2
+   ciborium@0.2.2
+   clap@4.4.18
+   clap_builder@4.4.18
+   clap_complete@4.4.10
+   clap_derive@4.4.7
+   clap_lex@0.6.0
+   color_quant@1.1.0
+   colorchoice@1.0.0
+   const-cstr@0.3.0
+   core-foundation-sys@0.8.6
+   crc32fast@1.3.2
+   criterion-plot@0.5.0
+   criterion@0.5.1
+   crossbeam-deque@0.8.5
+   crossbeam-epoch@0.9.18
+   crossbeam-utils@0.8.19
+   crunchy@0.2.2
+   cssparser-macros@0.6.1
+   cssparser@0.31.2
+   cstr@0.2.11
+   data-url@0.3.1
+   deranged@0.3.11
+   derive_more@0.99.17
+   difflib@0.4.0
+   dlib@0.5.2
+   doc-comment@0.3.3
+   dtoa-short@0.3.4
+   dtoa@1.0.9
+   either@1.9.0
+   encoding_rs@0.8.33
+   equivalent@1.0.1
+   errno@0.3.8
+   exr@1.72.0
+   fastrand@2.0.1
+   fdeflate@0.3.4
+   flate2@1.0.28
+   float-cmp@0.9.0
+   flume@0.11.0
+   fnv@1.0.7
+   form_urlencoded@1.2.1
+   futf@0.1.5
+   futures-channel@0.3.30
+   futures-core@0.3.30
+   futures-executor@0.3.30
+   futures-io@0.3.30
+   futures-macro@0.3.30
+   futures-task@0.3.30
+   futures-util@0.3.30
+   fxhash@0.2.1
+   gdk-pixbuf-sys@0.19.0
+   gdk-pixbuf@0.19.0
+   getrandom@0.2.12
+   gif@0.12.0
+   gio-sys@0.19.0
+   gio@0.19.0
+   glib-macros@0.19.0
+   glib-sys@0.19.0
+   glib@0.19.0
+   gobject-sys@0.19.0
+   half@2.3.1
+   hashbrown@0.14.3
+   heck@0.4.1
+   hermit-abi@0.3.5
+   iana-time-zone-haiku@0.1.2
+   iana-time-zone@0.1.60
+   idna@0.5.0
+   image@0.24.8
+   indexmap@2.2.2
+   is-terminal@0.4.10
+   itertools@0.10.5
+   itertools@0.12.1
+   itoa@1.0.10
+   jpeg-decoder@0.3.1
+   js-sys@0.3.68
+   language-tags@0.3.2
+   lazy_static@1.4.0
+   lebe@0.5.2
+   libc@0.2.153
+   libloading@0.8.1
+   libm@0.2.8
+   linked-hash-map@0.5.6
+   linux-raw-sys@0.4.13
+   locale_config@0.3.0
+   lock_api@0.4.11
+   log@0.4.20
+   lopdf@0.32.0
+   mac@0.1.1
+   malloc_buf@0.0.6
+   markup5ever@0.11.0
+   matches@0.1.10
+   matrixmultiply@0.3.8
+   md5@0.7.0
+   memchr@2.7.1
+   minimal-lexical@0.2.1
+   miniz_oxide@0.7.2
+   nalgebra-macros@0.2.1
+   nalgebra@0.32.3
+   new_debug_unreachable@1.0.4
+   nom@7.1.3
+   normalize-line-endings@0.3.0
+   num-complex@0.4.5
+   num-conv@0.1.0
+   num-integer@0.1.46
+   num-rational@0.4.1
+   num-traits@0.2.18
+   objc-foundation@0.1.1
+   objc@0.2.7
+   objc_id@0.1.1
+   once_cell@1.19.0
+   oorandom@11.1.3
+   pango-sys@0.19.0
+   pango@0.19.0
+   pangocairo-sys@0.19.0
+   pangocairo@0.19.1
+   parking_lot@0.12.1
+   parking_lot_core@0.9.9
+   paste@1.0.14
+   percent-encoding@2.3.1
+   phf@0.10.1
+   phf@0.11.2
+   phf_codegen@0.10.0
+   phf_generator@0.10.0
+   phf_generator@0.11.2
+   phf_macros@0.11.2
+   phf_shared@0.10.0
+   phf_shared@0.11.2
+   pin-project-lite@0.2.13
+   pin-utils@0.1.0
+   pkg-config@0.3.29
+   plotters-backend@0.3.5
+   plotters-svg@0.3.5
+   plotters@0.3.5
+   png@0.17.11
+   powerfmt@0.2.0
+   ppv-lite86@0.2.17
+   precomputed-hash@0.1.1
+   predicates-core@1.0.6
+   predicates-tree@1.0.9
+   predicates@3.1.0
+   proc-macro-crate@3.1.0
+   proc-macro2@1.0.78
+   proptest@1.4.0
+   qoi

[gentoo-dev] Last Rites: x11-drivers/xf86-video-openchrome

2024-11-06 Thread Matt Turner
# Matt Turner  (2024-11-06)
# Driver for integrated GPU paired only with x86 VIA CPUs.
#
# Has not worked in Gentoo for more than two years (see bug #875233) without
# any actual users noticing.
#
# Removal on 2024-12-06. Bug #875233.
x11-drivers/xf86-video-openchrome


signature.asc
Description: PGP signature


[gentoo-dev] Last Rites: x11-drivers/xf86-video-omap

2024-11-06 Thread Matt Turner
# Matt Turner  (2024-11-06)
# Driver for integrated GPU paired only with Texas Instruments ARM CPUs.
#
# Not maintained upstream. No releases since 2016. No sign of users.
#
# Removal on 2024-12-06. Bug #924715.
x11-drivers/xf86-video-omap


signature.asc
Description: PGP signature


[gentoo-dev] Last Rites: x11-drivers/xf86-video-vboxvideo

2024-11-06 Thread Matt Turner
# Matt Turner  (2024-11-06)
# Replaced by kernel modesetting (CONFIG_DRM_VBOXVIDEO) and the
# xf86-video-modesetting driver in the Xserver. Bug #929007
#
# Removal on 2024-12-06. Bug #924715.
x11-drivers/xf86-video-vboxvideo


signature.asc
Description: PGP signature