summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorWojciech Kępka2021-11-30 08:57:53 +0100
committerWojciech Kępka2021-11-30 08:57:53 +0100
commit4a99d02449c3fc11b825e11a0a8bef52042d104a (patch)
tree6043de81f74f32e37cf35398974c15cb040f0542 /PKGBUILD
parent6a100d677bca541996ee9f9e951b60be99005224 (diff)
downloadaur-helix-git.tar.gz
Update to a specific revision
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD46
1 files changed, 27 insertions, 19 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9397d1d6b89..010efdd78fe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,47 +1,55 @@
# Maintainer: Wojciech Kępka (wojciech@wkepka.dev)
pkgname=helix-git
-pkgver=0
-pkgrel=4
+_pkgname=helix
+pkgver=r1775.c08d2fae
+pkgrel=1
pkgdesc="A text editor written in rust"
url="https://helix-editor.com"
+_git="https://github.com/helix-editor/${_pkgname}.git"
arch=(x86_64)
-makedepends=("cargo" "rust" "git")
+makedepends=('cargo')
depends=()
-provides=("hx")
-source=("git+https://github.com/helix-editor/helix.git")
+provides=('hx')
+conflicts=('helix')
+source=("${_pkgname}::git+${_git}")
sha256sums=('SKIP')
+_bin="hx"
+_lib_path="/usr/lib/${_pkgname}"
+_rt_path="${_lib_path}/runtime"
+
+
pkgver() {
cd helix
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
- cat > "hx" << EOF
+ cat > "$_bin" << EOF
#!/usr/bin/env sh
-HELIX_RUNTIME=/usr/lib/helix/runtime exec /usr/lib/helix/hx "\$@"
+HELIX_RUNTIME=${_rt_path} exec ${_lib_path}/${_bin} "\$@"
EOF
- chmod +x "hx"
+ chmod +x "$_bin"
- rm -rf helix
- git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix-editor/helix
+ rm -rf "${_pkgname}"
+ git clone --recurse-submodules --shallow-submodules -j8 "$_git"
}
build() {
- cd helix
- cargo build --release
+ cd "${_pkgname}"
+ cargo build --release --locked --all-features
}
check() {
- cd helix
+ cd "${_pkgname}"
cargo test --all-features
}
package() {
- cd helix
- mkdir -p "$pkgdir/usr/lib/helix/"
- cp -r "runtime" "$pkgdir/usr/lib/helix/"
- install -Dm 0777 "target/release/hx" "$pkgdir/usr/lib/helix/hx"
- install -Dm 0444 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- install -Dm 0777 "$srcdir/hx" "$pkgdir/usr/bin/hx"
+ cd "${_pkgname}"
+ mkdir -p "${pkgdir}${_lib_path}"
+ cp -r "runtime" "${pkgdir}${_lib_path}"
+ install -Dm 0755 "target/release/${_bin}" "${pkgdir}${_lib_path}/${_bin}"
+ install -Dm 0644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+ install -Dm 0777 "${srcdir}/${_bin}" "${pkgdir}/usr/bin/${_bin}"
}