void-packages/srcpkgs/rustup/template
Đoàn Trần Công Danh 103ab731ab srcpkgs/r*: convert patches to -Np1
* runit is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

47 lines
1.3 KiB
Bash

# Template file for 'rustup'
pkgname=rustup
version=1.24.1
revision=1
# rustup doesn't recognize this target
archs="~armv*-musl"
build_style=cargo
build_helper=qemu
configure_args="--bin rustup-init --no-default-features
--features curl-backend,reqwest-backend,reqwest-default-tls,no-self-update"
hostmakedepends="pkg-config"
makedepends="openssl-devel zlib-devel libcurl-devel"
short_desc="Rust toolchain installer"
maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
license="Apache-2.0, MIT"
homepage="https://www.rustup.rs"
distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz"
checksum=e69bce5a4b1abe05489b19d2906c258b27f70ff8b13f59e5932527ae6b77c6a6
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|arm*|aarch64*)
configure_args+=" --features reqwest-rustls-tls"
;;
esac
post_build() {
RUSTUP="target/${RUST_TARGET}/release/rustup-init"
ln -sf "$RUSTUP" rustup
# generate shell completions
vtargetrun ./rustup completions zsh >rustup.zsh
vtargetrun ./rustup completions bash >rustup.bash
vtargetrun ./rustup completions fish >rustup.fish
}
do_install() {
vbin target/${RUST_TARGET}/release/rustup-init
vcompletion rustup.bash bash
vcompletion rustup.fish fish
vcompletion rustup.zsh zsh
vdoc README.md
vlicense LICENSE-APACHE
vlicense LICENSE-MIT
}