Date: Wednesday, April 26, 2023 @ 13:03:53
Author: heftig
Revision: 1448791
20230424-2: enable LTO (shrinks code), debug and put the proc-macro-srv in its
proper place
Modified:
rust-analyzer/trunk/PKGBUILD
----------+
PKGBUILD | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2023-04-26 12:59:38 UTC (rev 1448790)
+++ PKGBUILD 2023-04-26 13:03:53 UTC (rev 1448791)
@@ -4,7 +4,7 @@
pkgname=rust-analyzer
_pkgver=2023-04-24
pkgver=${_pkgver//-}
-pkgrel=1
+pkgrel=2
pkgdesc='Rust compiler front-end for IDEs'
arch=('x86_64')
url=https://rust-analyzer.github.io/
@@ -14,6 +14,12 @@
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver")
b2sums=('SKIP')
+# Use LTO
+export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
+
+# Use debug
+export CARGO_PROFILE_RELEASE_DEBUG=2
+
prepare() {
cd $pkgname
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
@@ -21,11 +27,12 @@
build() {
cd $pkgname
- CFG_RELEASE=1 cargo build --release --locked --offline
+ CFG_RELEASE=1 cargo build --release --frozen --offline
}
package() {
cd $pkgname
- install -Dt "$pkgdir"/usr/bin target/release/$pkgname{,-proc-macro-srv}
+ install -Dt "$pkgdir"/usr/bin target/release/$pkgname
+ install -Dt "$pkgdir"/usr/lib target/release/$pkgname-proc-macro-srv
install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE-MIT
}