52 lines
1.4 KiB
Bash
52 lines
1.4 KiB
Bash
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
|
||
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
|
||
# Maintainer: Orhun Parmaksız <orhun@archlinux.org>
|
||
# Contributor: Sergey A. <murlakatamenka@disroot.org>
|
||
|
||
pkgname=rust-analyzer
|
||
_pkgver=2025-01-28
|
||
pkgver=${_pkgver//-}
|
||
pkgrel=1
|
||
pkgdesc='Rust compiler front-end for IDEs'
|
||
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
|
||
url=https://rust-analyzer.github.io/
|
||
license=('MIT OR Apache-2.0')
|
||
depends=(
|
||
gcc-libs
|
||
rust-src
|
||
)
|
||
makedepends=(git)
|
||
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver")
|
||
b2sums=('a0b93a18b937d8349c6dd92b9d9c715e17b111e46884cf299fef8b5143d56d337f5c1154ceb2bced37865fa702ed3a49cbc4007bba2f16865d3dd19e005be7e0')
|
||
|
||
# Use LTO
|
||
export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
|
||
|
||
# Use debug
|
||
export CARGO_PROFILE_RELEASE_DEBUG=2
|
||
|
||
case "${CARCH}" in
|
||
powerpc)
|
||
# fails to link otherwise due to 32bit limitations
|
||
export RUSTFLAGS="-C opt-level=2"
|
||
export CARGO_PROFILE_RELEASE_LTO=false
|
||
export CARGO_PROFILE_RELEASE_DEBUG=0
|
||
;;
|
||
esac
|
||
|
||
prepare() {
|
||
cd $pkgname
|
||
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
||
}
|
||
|
||
build() {
|
||
cd $pkgname
|
||
CFG_RELEASE=1 cargo build --release --locked --offline
|
||
}
|
||
|
||
package() {
|
||
cd $pkgname
|
||
install -Dt "$pkgdir"/usr/bin target/release/$pkgname
|
||
install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE-MIT
|
||
}
|