summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKr1ss2020-03-08 18:55:22 +0100
committerKr1ss2020-03-08 20:18:25 +0100
commit843ced09fa747c14cf8e62dee376b665215ac496 (patch)
tree0627e7936fbc69b363e78e07e461d1ef4d454a81
parent3c3564bd4f46656566f2d7947dd5b0834d27be2c (diff)
downloadaur-843ced09fa747c14cf8e62dee376b665215ac496.tar.gz
enable persistant CARGO_HOME folder
Hat tip to @ccorn, who proposed this patch in the AUR comments. Its purpose is to keep the cargo cache between chroot builds of the package so that it doesn't need to be reconstructed every time. This saves users' time and network resources.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD13
2 files changed, 13 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 64f437a6f3db..6aa2245a8dd4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = git-delta
pkgdesc = A syntax-highlighting pager for git and diff output
pkgver = 0.0.17
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/dandavison/delta
arch = x86_64
license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index c9488cdc9670..d8a44eecbc68 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=git-delta
_name="${pkgname#*-}"
pkgver=0.0.17
-pkgrel=1
+pkgrel=2
pkgdesc='A syntax-highlighting pager for git and diff output'
arch=('x86_64')
@@ -18,6 +18,17 @@ source=("$url/archive/$pkgver.tar.gz")
sha256sums=('ac1f26ac5ea10d43b300675189c49437dcae7a9fca7e51f615058ab0550d27e5')
+prepare() {
+ # Assist chroot builds with a persistent cargo cache (hat tip @ccorn for this patch)
+ msg2 "NOTE : If you're building in a (clean) chroot and want a persistant"
+ plain " cargo cache folder specific for this package, you can create"
+ plain " an empty '.cargo' directory next to the 'PKGBUILD'. This will"
+ plain " be recognized and used as CARGO_HOME."
+ if [ -d "$startdir/.cargo" ]; then
+ export CARGO_HOME="${CARGO_HOME:-$startdir/.cargo}"
+ fi
+}
+
build() {
cd "$_name-$pkgver"
cargo build --release --locked