Skip to content

Instantly share code, notes, and snippets.

@navarroaxel
Last active July 23, 2020 02:10
Show Gist options
  • Save navarroaxel/40fea15bae01d6ffb0d2d4109474bdf1 to your computer and use it in GitHub Desktop.
Save navarroaxel/40fea15bae01d6ffb0d2d4109474bdf1 to your computer and use it in GitHub Desktop.
Arch Linux PKGBUILD for delta --hyperlinks
pkgname=git-delta
_name="${pkgname#*-}"
pkgver=0.3.0
pkgrel=3
pkgdesc='A syntax-highlighting pager for git and diff output'
arch=('i686' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url="https://github.com/dandavison/$_name"
license=('MIT')
depends=('git')
makedepends=('rust' 'clang' 'llvm')
source=("$url/archive/$pkgver.tar.gz"
master.patch::"https://github.com/dandavison/delta/compare/0.3.0...master.patch")
sha256sums=('4ff8d5864306f130be8e0da3d8013bcc4ece082835d4cc5395775c669111ed77' 'SKIP')
prepare() {
patch -d "$_name-$pkgver" -p1 -i ../master.patch
# Assist chroot builds with a persistent cargo cache (hat tip @ccorn for this patch)
if [ -d "$startdir/.cargo" ]; then
export CARGO_HOME="${CARGO_HOME:-$startdir/.cargo}"
else
msg2 "NOTE : If you're building in a (clean) chroot and want a persistant
cargo cache folder specific for this package, you can create
an empty '.cargo' directory next to the 'PKGBUILD'. This will
be recognized and used as CARGO_HOME (except when CARGO_HOME is
already set)."
fi
}
build() {
cd "$_name-$pkgver"
cargo build --release --locked
}
check() {
cd "$_name-$pkgver"
cargo test --locked
}
package() {
cd "$_name-$pkgver"
install -Dm755 "target/release/$_name" -t"$pkgdir/usr/bin/"
install -Dm644 README.md -t"$pkgdir/usr/share/doc/$_name/"
cp -a --no-preserve=ownership performance "$pkgdir/usr/share/doc/$_name/"
install -Dm644 LICENSE -t"$pkgdir/usr/share/licenses/$_name/"
install -Dm644 completion/completion.bash "$pkgdir/usr/share/bash-completion/completions/$_name"
install -Dm644 completion/completion.zsh "$pkgdir/usr/share/zsh/site-functions/_$_name"
}
pkgname=less
pkgver=551
_pkgver=563
pkgrel=3
pkgdesc='A terminal based program for viewing text files'
license=('GPL3')
arch=('x86_64')
url='http://www.greenwoodsoftware.com/less'
depends=('glibc' 'ncurses' 'pcre')
source=("http://www.greenwoodsoftware.com/$pkgname/$pkgname-$_pkgver.tar.gz"
"https://github.com/dandavison/less/commit/4e545aca.patch")
sha256sums=('SKIP' 'SKIP')
prepare() {
patch -d "$pkgname-$_pkgver" -p1 -i ../4e545aca.patch
}
build() {
cd $pkgname-$_pkgver
sh configure --prefix=/usr --sysconfdir=/etc --with-regex=pcre
make
}
package() {
cd $pkgname-$_pkgver
make DESTDIR="$pkgdir" install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment