commit: c5d398015f73879d957f880abb52662a1e2f5595
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Wed Oct 22 18:39:26 2025 +0000
Commit: orbea <orbea <AT> riseup <DOT> net>
CommitDate: Wed Oct 22 18:39:26 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=c5d39801
dev-util/rustup: new package, add 1.28.1, 1.28.2-r1
Signed-off-by: orbea <orbea <AT> riseup.net>
dev-util/rustup/Manifest | 4 +
...ustup-1.28.1-libressl-openssl-sys-0.9.106.patch | 10 ++
dev-util/rustup/files/symlink_rustup.sh | 162 +++++++++++++++++++++
dev-util/rustup/metadata.xml | 11 ++
dev-util/rustup/rustup-1.28.1.ebuild | 108 ++++++++++++++
dev-util/rustup/rustup-1.28.2-r1.ebuild | 107 ++++++++++++++
6 files changed, 402 insertions(+)
diff --git a/dev-util/rustup/Manifest b/dev-util/rustup/Manifest
new file mode 100644
index 0000000..89650d9
--- /dev/null
+++ b/dev-util/rustup/Manifest
@@ -0,0 +1,4 @@
+DIST rustup-1.28.1-crates.tar.xz 37037080 BLAKE2B
4ce72dcec7d718671db9482b63045aa0ee700a79e7ae7e03c04c520bbd4834cd20c5375d62bffaa4da4647b9b4514d7299d6d15b27d29d33ecd2541645409525
SHA512
e2285f2193678ed8f3e3f5defebb5fcf65d88171ba82f284d9e12361ce43e528313aeea41875df134bbf8784bb10d9227131726f7997421c715d3d6172455ff2
+DIST rustup-1.28.1.tar.gz 1011410 BLAKE2B
2a260ccfd10fc5f1fb19d5fe55670b02a3a9572c4342bd876f727e28f64446bd5891675f03deec7310b177f1b93b0c238123e8feb6ee4161494479c6ed7a38dc
SHA512
00d79f574c62c1668f41f0e82ca63ce4698d171ccf1b29b4e2d0af4455e2faac1f28ad9da6060c5a7ef97ef4ad20690c6b57e2a18cd36dcbf9930144f44ddbb4
+DIST rustup-1.28.2-crates.tar.xz 38997836 BLAKE2B
29848bbb571f99b763bccfa444461f8cc8cea8fa625c0846b7fb69d7fbd9c2f0f077ed61459cb502d03360d273c2733de7e9aff6372a56699cd6fc1482880351
SHA512
741766a08d6a78af79d7701efa1c1c2142932d796b3b29cf379dcc90427bdf97a61b1aa1d542f4b58f405aaf65ad4bcc9fed5f9f47453042088bbf8bc2921e04
+DIST rustup-1.28.2.tar.gz 1015225 BLAKE2B
ed7808b46bb58f3d1c15bef003a8046666429e68868b0b63686758213fa0569ae91aba1a518d70cffca59e95068722b5753e0e4ef55e51e42a934450539e92ad
SHA512
dc85f4551e9d3d9d105e4a5c8a7544b6944c82ca4db167a6993e1e0cea498221471b891cefc15e7f634a8528678bb8438dbddadb80a8afe19fbc69bb74817049
diff --git
a/dev-util/rustup/files/rustup-1.28.1-libressl-openssl-sys-0.9.106.patch
b/dev-util/rustup/files/rustup-1.28.1-libressl-openssl-sys-0.9.106.patch
new file mode 100644
index 0000000..7e40720
--- /dev/null
+++ b/dev-util/rustup/files/rustup-1.28.1-libressl-openssl-sys-0.9.106.patch
@@ -0,0 +1,10 @@
+--- a/build/main.rs.orig
++++ b/build/main.rs
+@@ -382,6 +382,7 @@
+ (3, 9, _) => ('3', '9', 'x'),
+ (4, 0, 0) => ('4', '0', '0'),
+ (4, 0, _) => ('4', '0', 'x'),
++ (_, _, _) => ('x', 'x', 'x'),
+ _ => version_error(),
+ };
+
diff --git a/dev-util/rustup/files/symlink_rustup.sh
b/dev-util/rustup/files/symlink_rustup.sh
new file mode 100644
index 0000000..8ab6608
--- /dev/null
+++ b/dev-util/rustup/files/symlink_rustup.sh
@@ -0,0 +1,162 @@
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+
+set -euo pipefail
+IFS=$'\n\t'
+
+SYMLINK_RUSTUP_VERSION="0.0.4"
+binpath="@GENTOO_PORTAGE_EPREFIX@/usr/bin/rustup-init"
+
+: "${CARGO_HOME:=${HOME}/.cargo}"
+: "${RUSTUP_HOME:=${HOME}/.rustup}"
+
+__err_exists="already exists, try using -u|--unsymlink option first"
+
+# dies with optional message
+die() {
+ [[ ${QUIET-no} ]] && echo -e "${NOCOLOR=\e[1;31m*\e[0m }ERROR: ${*}" >&2
+ exit 1
+} # die()
+
+
+# outputs gentoo-style green * prefixed message, a good one ofc
+good() {
+ [[ ${QUIET-no} ]] && echo -e "${NOCOLOR=\e[1;32m*\e[0m }${*}"
+ return 0
+} # good()
+
+
+# do I need to explain this?
+usage() {
+ echo "Usage: ${0} [<options>]"
+} # usage()
+
+# and this
+help() {
+ usage
+ echo
+ echo -n "Symlink system installation of rustup to"
+ echo " ${CARGO_HOME}"
+ echo
+ echo "Options:"
+ echo " -s, --symlink Setup rustup symlinks in ${CARGO_HOME}/bin"
+ echo " -C, --nocolor Disable colored output"
+ echo " -d, --debug Debug mode (sets -x shell option)"
+ echo " -V, --version Print version number"
+ echo " -u, --unsymlink Remove rustup symlinks from ${CARGO_HOME}/bin"
+ echo " -q, --quiet Quiet mode"
+} # help()
+
+
+symlink_rustup() {
+ local gentoo_rust tool
+ # rustup calls those proxies
+ # src/lib.rs TOOLS
+ local tools=(
+ rustc
+ rustdoc
+ cargo
+ rust-lldb
+ rust-gdb
+ rust-gdbgui
+ rls
+ cargo-clippy
+ clippy-driver
+ cargo-miri
+ )
+
+ # src/lib.rs DUP_TOOLS
+ # those can be installed via cargo and not with rust itself
+ local dup_tools=(
+ rust-analyzer
+ rustfmt
+ cargo-fmt
+ )
+
+ # we need rustup symlink too, so add it to final list
+ tools+=( "${dup_tools[@]}" rustup )
+
+ gentoo_rust="$(eselect --brief rust show 2>/dev/null)"
+
+ mkdir -p "${CARGO_HOME}/bin" || die
+
+ for tool in "${tools[@]}"; do
+ local symlink_path="${CARGO_HOME}/bin/${tool}"
+ if [[ -e "${symlink_path}" ]]; then
+ die "${symlink_path} ${__err_exists}"
+ else
+ ln -s ${QUIET--v} "${binpath}" "${symlink_path}" || die
+ fi
+ done
+
+ good "Setting gentoo ${gentoo_rust// /} as default toolchain"
+ [[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" -V
+ "${CARGO_HOME}/bin/rustup" ${QUIET--v} toolchain link gentoo "/usr"
+ "${CARGO_HOME}/bin/rustup" ${QUIET--v} default gentoo
+ [[ ${QUIET+set} != set ]] && "${CARGO_HOME}/bin/rustup" show
+
+ good "Prepend ${CARGO_HOME}/bin to your PATH to use rustup"
+ good "rustup selfupdate is disabled, it will be updated by portage"
+} # symlink_rustup()
+
+unsymlink_rustup() {
+ local symlinks
+ IFS= mapfile -d '' symlinks < <(find -L "${CARGO_HOME}/bin" \
+ -samefile "${binpath}" -print0 )
+ if [[ "${symlinks-}" ]]; then
+ rm -v "${symlinks[@]}" || die
+ else
+ die "already clean"
+ fi
+}
+
+main(){
+ [[ "$EUID" -eq 0 ]] && die "Running as root is not supported"
+ local me
+ me="$(basename "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
+
+ local symlink=no
+ local unsymlink=no
+
+ while [[ ${#} -gt 0 ]]; do
+ case ${1} in
+ -s|--symlink)
+ symlink=yes
+ ;;
+ -u|--unsymlink)
+ unsymlink=yes
+ ;;
+ -h|--help)
+ help
+ exit 0
+ ;;
+ -V|--version)
+ echo "${me} ${SYMLINK_RUSTUP_VERSION:-unknown}"
+ exit 0
+ ;;
+ -d|--debug)
+ set -x
+ ;;
+ -C|--nocolor)
+ NOCOLOR=
+ ;;
+ -q|--quiet)
+ QUIET=
+ ;;
+ -*)
+ usage >&2
+ exit 1
+ ;;
+ esac
+ shift
+ done
+ if [[ ${symlink} == yes ]]; then
+ symlink_rustup
+ elif [[ ${unsymlink} == yes ]]; then
+ unsymlink_rustup
+ else
+ help
+ fi
+} # main()
+
+
+main "${@}"
diff --git a/dev-util/rustup/metadata.xml b/dev-util/rustup/metadata.xml
new file mode 100644
index 0000000..f02a8b2
--- /dev/null
+++ b/dev-util/rustup/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>[email protected]</email>
+ <name>Rust Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rust-lang/rustup</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-util/rustup/rustup-1.28.1.ebuild
b/dev-util/rustup/rustup-1.28.1.ebuild
new file mode 100644
index 0000000..4df97cc
--- /dev/null
+++ b/dev-util/rustup/rustup-1.28.1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES=""
+RUST_MIN_VER="1.85.0"
+inherit cargo prefix shell-completion toolchain-funcs
+
+DESCRIPTION="Rust toolchain installer"
+HOMEPAGE="https://rust-lang.github.io/rustup/"
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rust-lang/${PN}.git"
+else
+ SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz ->
${P}.tar.gz
+ ${CARGO_CRATE_URIS}"
+ SRC_URI+="
https://github.com/gentoo-crate-dist/${PN}/releases/download/${PV}/${P}-crates.tar.xz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64"
+fi
+
+LICENSE="|| ( Apache-2.0 MIT )"
+# Dependent crate licenses
+LICENSE+=" Apache-2.0 BSD ISC MIT MPL-2.0 openssl Unicode-3.0"
+SLOT="0"
+# uses network
+RESTRICT="test"
+
+DEPEND="
+ app-arch/xz-utils
+ net-misc/curl:=[http2,ssl]
+ dev-libs/openssl:0=
+"
+RDEPEND="${DEPEND}"
+
+# rust does not use *FLAGS from make.conf, silence portage warning
+QA_FLAGS_IGNORED="usr/bin/rustup-init"
+
+eapply_crate() {
+ pushd "${ECARGO_HOME}/gentoo/${1:?}" > /dev/null || die
+ eapply "${2:?}"
+ popd > /dev/null || die
+}
+
+src_unpack() {
+ if [[ "${PV}" == 9999 ]]; then
+ git-r3_src_unpack
+ cargo_live_src_unpack
+ else
+ cargo_src_unpack
+ fi
+}
+
+src_prepare() {
+ eapply_crate openssl-sys-0.9.106
"${FILESDIR}/${PN}-1.28.1-libressl-openssl-sys-0.9.106.patch"
+ default
+}
+
+src_configure() {
+ # modeled after ci/run.bash upstream
+ # reqwest-rustls-tls requires ring crate, which is not very portable.
+ local myfeatures=(
+ no-self-update
+ curl-backend
+ reqwest-native-tls
+ )
+ case ${ARCH} in
+ ppc* | mips* | riscv* | s390*)
+ ;;
+ *) myfeatures+=( reqwest-rustls-tls )
+ ;;
+ esac
+ cargo_src_configure --no-default-features
+}
+
+src_compile() {
+ export OPENSSL_NO_VENDOR=true
+ cargo_src_compile
+}
+
+src_install() {
+ cargo_src_install
+ einstalldocs
+ newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)"
rustup-init-gentoo
+
+ if ! tc-is-cross-compiler; then
+ einfo "generating shell completion files"
+ ln -sf "${ED}/usr/bin/rustup-init" rustup || die
+
+ ./rustup completions bash > "${T}/${PN}" || die
+ dobashcomp "${T}/${PN}"
+ ./rustup completions zsh > "${T}/_${PN}" || die
+ dozshcomp "${T}/_${PN}"
+ else
+ ewarn "Shell completion files not installed! Install them
manually with '${PN} completions --help'"
+ fi
+}
+
+pkg_postinst() {
+ elog "No rustup toolchains installed by default"
+ elog "eselect activated system rust toolchain can be added to rustup by
running"
+ elog "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo"
+ elog "it will create symlinks to system-installed rustup in home
directory"
+ elog "and rustup updates will be managed by portage"
+ elog "please delete current rustup binaries from ~/.cargo/bin/ (if any)"
+ elog "before running rustup-init-gentoo"
+}
diff --git a/dev-util/rustup/rustup-1.28.2-r1.ebuild
b/dev-util/rustup/rustup-1.28.2-r1.ebuild
new file mode 100644
index 0000000..5c83fb5
--- /dev/null
+++ b/dev-util/rustup/rustup-1.28.2-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES=""
+RUST_MIN_VER="1.85.0"
+inherit cargo prefix shell-completion toolchain-funcs
+
+DESCRIPTION="Rust toolchain installer"
+HOMEPAGE="https://rust-lang.github.io/rustup/"
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rust-lang/${PN}.git"
+else
+ SRC_URI="https://github.com/rust-lang/${PN}/archive/${PV}.tar.gz ->
${P}.tar.gz
+ ${CARGO_CRATE_URIS}"
+ SRC_URI+="
https://github.com/gentoo-crate-dist/${PN}/releases/download/${PV}/${P}-crates.tar.xz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64"
+fi
+
+LICENSE="|| ( Apache-2.0 MIT )"
+# Dependent crate licenses
+LICENSE+="
+ Apache-2.0 BSD CDLA-Permissive-2.0 ISC MIT openssl Unicode-3.0 ZLIB
+"
+SLOT="0"
+# uses network
+RESTRICT="test"
+
+DEPEND="
+ app-arch/xz-utils
+ app-arch/zstd
+ net-misc/curl:=[http2,ssl]
+ dev-libs/openssl:0=
+"
+RDEPEND="${DEPEND}"
+
+# rust does not use *FLAGS from make.conf, silence portage warning
+QA_FLAGS_IGNORED="usr/bin/rustup-init"
+
+eapply_crate() {
+ pushd "${ECARGO_HOME}/gentoo/${1:?}" > /dev/null || die
+ eapply "${2:?}"
+ popd > /dev/null || die
+}
+
+src_unpack() {
+ if [[ "${PV}" == 9999 ]]; then
+ git-r3_src_unpack
+ cargo_live_src_unpack
+ else
+ cargo_src_unpack
+ fi
+}
+
+src_prepare() {
+ eapply_crate openssl-sys-0.9.107
"${FILESDIR}/${PN}-1.28.1-libressl-openssl-sys-0.9.106.patch"
+ default
+}
+
+src_configure() {
+ # modeled after ci/run.bash upstream
+ # reqwest-rustls-tls requires ring crate and/or aws-lc, which is not
+ # very portable and also compiles much vendored openssl code
+ local myfeatures=(
+ no-self-update
+ curl-backend
+ reqwest-native-tls
+ )
+ cargo_src_configure --no-default-features
+}
+
+src_compile() {
+ export OPENSSL_NO_VENDOR=true
+ export ZSTD_SYS_USE_PKG_CONFIG=1
+ cargo_src_compile
+}
+
+src_install() {
+ cargo_src_install
+ einstalldocs
+ newbin "$(prefixify_ro "${FILESDIR}"/symlink_rustup.sh)"
rustup-init-gentoo
+
+ if ! tc-is-cross-compiler; then
+ einfo "generating shell completion files"
+ ln -sf "${ED}/usr/bin/rustup-init" rustup || die
+
+ ./rustup completions bash > "${T}/${PN}" || die
+ dobashcomp "${T}/${PN}"
+ ./rustup completions zsh > "${T}/_${PN}" || die
+ dozshcomp "${T}/_${PN}"
+ else
+ ewarn "Shell completion files not installed! Install them
manually with '${PN} completions --help'"
+ fi
+}
+
+pkg_postinst() {
+ elog "No rustup toolchains installed by default"
+ elog "eselect activated system rust toolchain can be added to rustup by
running"
+ elog "helper script installed as ${EPREFIX}/usr/bin/rustup-init-gentoo"
+ elog "it will create symlinks to system-installed rustup in home
directory"
+ elog "and rustup updates will be managed by portage"
+ elog "please delete current rustup binaries from ~/.cargo/bin/ (if any)"
+ elog "before running rustup-init-gentoo"
+}