diff options
author | Kr1ss | 2020-03-08 18:55:22 +0100 |
---|---|---|
committer | Kr1ss | 2020-03-08 20:18:25 +0100 |
commit | 843ced09fa747c14cf8e62dee376b665215ac496 (patch) | |
tree | 0627e7936fbc69b363e78e07e461d1ef4d454a81 | |
parent | 3c3564bd4f46656566f2d7947dd5b0834d27be2c (diff) | |
download | aur-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-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 13 |
2 files changed, 13 insertions, 2 deletions
@@ -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 @@ -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 |