blob: 5bb2a2046ebe99c44412f93e8178482cf4243bf4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# Maintainer: MuntasirSZN <muntasir.joypurhat@gmail.com>
# Maintainer: cordx56 <cordx56@cordx.cx>
pkgname=rustowl-git
pkgver=r1.0
pkgrel=3
pkgdesc='Visualize Ownership and Lifetimes in Rust'
url='https://github.com/cordx56/rustowl'
license=('MPL-2.0')
makedepends=('git' 'rustup' 'zig=0.13.0')
arch=('any')
source=("git+https://github.com/cordx56/rustowl.git")
sha256sums=('SKIP')
conflicts=('rustowl-bin')
pkgver() {
cd "$srcdir/rustowl"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/rustowl"
export RUSTC_BOOTSTRAP=1
export RUSTUP_TOOLCHAIN=1.87.0
rustup component add rust-src rustc-dev llvm-tools
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "$srcdir/rustowl"
export CARGO_TARGET_DIR=target
export RUSTC_BOOTSTRAP=1
export RUSTUP_TOOLCHAIN=1.87.0
export RUSTOWL_RUNTIME_DIRS=/opt/rustowl
cargo build --frozen --release --all-features --target $(rustc --print=host-tuple)
}
check() {
cd "$srcdir/rustowl"
export RUSTC_BOOTSTRAP=1
export RUSTUP_TOOLCHAIN=1.87.0
cargo test --frozen --all-features
}
package() {
cd "$srcdir/rustowl"
find target -type d | grep -E 'rustowl-build-time-out$' | xargs -I % cp -r % ./
mkdir sysroot
ACTIVE_TOOLCHAIN="$(rustup show active-toolchain | awk '{ print $1 }')"
cp -r "$(rustc --print=sysroot)" sysroot/$ACTIVE_TOOLCHAIN
find sysroot -type f | grep -v -E '\.(rlib|so|dylib|dll)$' | xargs rm -rf
find sysroot -depth -type d -empty -exec rm -rf {} \;
install -d -m 755 "$pkgdir/opt/rustowl"
cp -a sysroot/ "$pkgdir/opt/rustowl/"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowl"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowlc"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/rustowl/LICENSE"
install -Dm644 rustowl-build-time-out/man/rustowl.1 "$pkgdir/usr/share/man/man1/rustowl.1"
install -Dm644 "rustowl-build-time-out/completions/rustowl.bash" "${pkgdir}/usr/share/bash-completion/completions/rustowl"
install -Dm644 "rustowl-build-time-out/completions/_rustowl" "${pkgdir}/usr/share/zsh/site-functions/_rustowl"
install -Dm644 "rustowl-build-time-out/completions/rustowl.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/rustowl.fish"
install -Dm644 "rustowl-build-time-out/completions/rustowl.elv" "${pkgdir}/usr/share/elvish/completions/rustowl.elv"
install -Dm644 "rustowl-build-time-out/completions/_rustowl.ps1" "${pkgdir}/usr/share/powershell/Modules/Rustowl/_rustowl.ps1"
}
|