void-packages/srcpkgs/rust-bootstrap/template

104 lines
3.5 KiB
Bash

# Template file for 'rust-bootstrap'
pkgname=rust-bootstrap
reverts="1.83.0_1"
version=1.82.0
revision=2
short_desc="Rust programming language bootstrap toolchain"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0 OR MIT"
homepage="https://www.rust-lang.org/"
conflicts="rust>=0 rust-std>=0"
lib32disabled=yes
nostrip=yes
repository=bootstrap
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
depends="libexecinfo-devel"
fi
_bootstrap_url="https://static.rust-lang.org/dist"
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686) ;;
# See srcpkgs/rust-bootstrap/files/generating-distfiles.md for details
*) _bootstrap_url="https://repo-default.voidlinux.org/distfiles";;
esac
# hardcode platform triplets
# because this info isn't avaialble here without hacky workarounds
case "$XBPS_TARGET_MACHINE" in
i686)
distfiles="
${_bootstrap_url}/rustc-${version}-i686-unknown-linux-gnu.tar.xz
${_bootstrap_url}/rust-std-${version}-i686-unknown-linux-gnu.tar.xz"
checksum="
92bab38ce88b7738fb62a1bccf496b1b2975fe984cc4fc506903a03ed37e1e4a
c7ebb02b6ca349999b3b7dce768efaca5e0d9060f55397523e11a64cd10a9405"
;;
x86_64)
distfiles="
${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-gnu.tar.xz
${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-gnu.tar.xz"
checksum="
90b61494f5ccfd4d1ca9a5ce4a0af49a253ca435c701d9c44e3e44b5faf70cb8
2eca3d36f7928f877c334909f35fe202fbcecce109ccf3b439284c2cb7849594"
;;
x86_64-musl)
distfiles="
${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-musl.tar.xz
${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-musl.tar.xz"
checksum="
e08b8490246ae1b6278274f6dd0a648c590a42e0af6aaf220a030cdf1dadf30a
1c99a4c81f51b687ba55746c7d3f19b5b860fe4eff604d3c7d803e08c9cc89bb"
;;
# placeholders for user-supplied distfiles
ppc64le)
distfiles="
${_bootstrap_url}/rustc-${version}-powerpc64le-unknown-linux-gnu.tar.xz
${_bootstrap_url}/rust-std-${version}-powerpc64le-unknown-linux-gnu.tar.xz"
checksum="
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb"
;;
ppc64le-musl)
distfiles="
${_bootstrap_url}/rustc-${version}-powerpc64le-unknown-linux-musl.tar.xz
${_bootstrap_url}/rust-std-${version}-powerpc64le-unknown-linux-musl.tar.xz"
checksum="
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb"
;;
ppc64)
distfiles="
${_bootstrap_url}/rustc-${version}-powerpc64-unknown-linux-gnu.tar.xz
${_bootstrap_url}/rust-std-${version}-powerpc64-unknown-linux-gnu.tar.xz"
checksum="
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb"
;;
ppc)
distfiles="
${_bootstrap_url}/rustc-${version}-powerpc-unknown-linux-gnu.tar.xz
${_bootstrap_url}/rust-std-${version}-powerpc-unknown-linux-gnu.tar.xz"
checksum="
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb"
;;
*) broken="rust bootstrap binaries unavailable for ${XBPS_TARGET_MACHINE}";;
esac
do_install() {
for d in *; do
cd $d
./install.sh --prefix=/usr --destdir="${DESTDIR}"
cd ..
done
vlicense rustc-${version}-${RUST_TARGET}/COPYRIGHT
vlicense rustc-${version}-${RUST_TARGET}/LICENSE-APACHE
vlicense rustc-${version}-${RUST_TARGET}/LICENSE-MIT
rm -rf ${DESTDIR}/usr/share/doc/rust
rm -f ${DESTDIR}/usr/lib/rustlib/${RUST_TARGET}/bin/rust-ll*
}