summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey A.2024-03-08 21:04:52 +0300
committerSergey A.2024-03-08 21:04:52 +0300
commit801515df598f30c8c91ea453381cc34112ee2844 (patch)
treebe0dd9299e5a38c75e1d57ba19b7cb7fe5dbc78f
parenta1ec6ddce7ca61cf7fa7f7f21d486a7f87df7c3a (diff)
downloadaur-801515df598f30c8c91ea453381cc34112ee2844.tar.gz
chore: set RUSTFLAGS to use clang/mold for linking
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD11
2 files changed, 12 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7911952b6e46..63262ea35c0e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = aichat
pkgdesc = OpenAI, ChatGPT, ollama and more in your terminal
pkgver = 0.14.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/sigoden/aichat
arch = i686
arch = x86_64
@@ -9,6 +9,8 @@ pkgbase = aichat
license = MIT
license = APACHE
makedepends = cargo
+ makedepends = clang
+ makedepends = mold
depends = gcc-libs
conflicts = aichat-bin
conflicts = aichat-git
diff --git a/PKGBUILD b/PKGBUILD
index dd5516767246..393c85467a3e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,13 +2,13 @@
pkgname=aichat
pkgver=0.14.0
-pkgrel=1
+pkgrel=2
pkgdesc="OpenAI, ChatGPT, ollama and more in your terminal"
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/sigoden/aichat"
license=('MIT' 'APACHE')
depends=('gcc-libs')
-makedepends=('cargo')
+makedepends=('cargo' 'clang' 'mold')
conflicts=('aichat-bin' 'aichat-git')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('de554ef95d75a17b20f384b5f2ea07b3d2cd6112e87e9e038145d13285633468')
@@ -28,6 +28,13 @@ build() {
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
+ # https://github.com/rui314/mold?tab=readme-ov-file#how-to-use
+ export RUSTFLAGS="${RUSTFLAGS} \
+ -C linker=clang \
+ -C link-arg=-flto \
+ -C linker-plugin-lto \
+ -C link-arg=-fuse-ld=lld"
+
cargo build --release --frozen
}