aboutsummaryrefslogtreecommitdiffstats
path: root/community/helix/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/helix/APKBUILD')
-rw-r--r--community/helix/APKBUILD73
1 files changed, 73 insertions, 0 deletions
diff --git a/community/helix/APKBUILD b/community/helix/APKBUILD
new file mode 100644
index 00000000000..5f3c0bd6f56
--- /dev/null
+++ b/community/helix/APKBUILD
@@ -0,0 +1,73 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=helix
+pkgver=24.03
+pkgrel=0
+pkgdesc="A post-modern modal text editor"
+url="https://helix-editor.com/"
+arch="aarch64 armhf armv7 ppc64le x86 x86_64" # blocked by rust/cargo
+license="MPL-2.0"
+makedepends="cargo cargo-auditable"
+checkdepends="tree-sitter-rust tree-sitter-ruby"
+options="net"
+install="$pkgname.post-install"
+# This is needed just for tests.
+_tsrust_ver="0.20.4"
+source="https://github.com/helix-editor/helix/archive/$pkgver/helix-$pkgver.tar.gz
+ https://github.com/tree-sitter/tree-sitter-rust/archive/v$_tsrust_ver/tree-sitter-rust-$_tsrust_ver.tar.gz
+ runtime-dir-fhs-location.patch
+ "
+
+# Don't build tree-sitter languages, we provide them in standalone aports.
+export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1
+
+prepare() {
+ default_prepare
+
+ # This is needed for running tests.
+ mkdir -p runtime/grammars/sources
+ ln -s /usr/lib/tree-sitter/rust.so runtime/grammars/rust.so
+ ln -s /usr/lib/tree-sitter/ruby.so runtime/grammars/ruby.so
+ ln -s "$srcdir"/tree-sitter-rust-$_tsrust_ver runtime/grammars/sources/rust
+
+ cargo fetch --target="$CTARGET" --locked
+}
+
+build() {
+ cargo auditable build --frozen --release
+}
+
+check() {
+ # This is needed for following tests:
+ # helix-vcs::src::git::test::modified_file
+ # helix-vcs::src::git::test::symlink
+ # helix-vcs::src::git::test::unmodified_file
+ unset GIT_CEILING_DIRECTORIES
+
+ # XXX: test_treesitter_indent_cpp is somehow broken
+ cargo test --frozen --workspace -- \
+ --skip test_treesitter_indent_cpp
+}
+
+package() {
+ install -D -m755 target/release/hx -t "$pkgdir"/usr/bin/
+
+ install -D -m644 contrib/Helix.desktop -t "$pkgdir"/usr/share/applications/
+ install -D -m644 logo.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/Helix.svg
+
+ # Remove helix grammars and queries, use system ones instead.
+ rm -rf runtime/queries
+ rm -rf runtime/grammars
+
+ install -d -m755 "$pkgdir"/usr/share/"$pkgname"
+ cp -r runtime "$pkgdir"/usr/share/"$pkgname"
+
+ ln -Ts ../../../lib/tree-sitter "$pkgdir"/usr/share/$pkgname/runtime/grammars
+ ln -Ts ../../tree-sitter/queries "$pkgdir"/usr/share/$pkgname/runtime/queries
+}
+
+sha512sums="
+d9815e4dbcc897b4f6cd394a1e9060ed56832f18b2cf9542aa03b78f4d49213b2d74d748197b25df3d459dbeefb68915f67511b402504185d64908c10eb9377e helix-24.03.tar.gz
+f1b2e9537286921056eda4e96faa9f61131b9ca5684e7ab8aa7bd07e46d91e5eab18e6e292cfad7cdcb7ba195e80f7f1e35f04992cb8011bbd29dd2d95116f9d tree-sitter-rust-0.20.4.tar.gz
+0d72f5528106df006764a201caf7fefa860e67646198818fd744257050ac566082569b289f0a1815dd14f0b1364e344f8841e3c6757377d8452d8ebd5b022d29 runtime-dir-fhs-location.patch
+"