🗝
summary refs log tree commit diff
path: root/packages/cgit-syntect-bat
diff options
context:
space:
mode:
authormia <mia@mia.jetzt>2024-06-08 22:56:05 -0700
committermia <mia@mia.jetzt>2024-06-08 22:56:05 -0700
commit8cf813ff033bbc98a7dd40db6ac11e2e35c7e997 (patch)
treea451059194cbd4ba90993ebdaced4749448ec4df /packages/cgit-syntect-bat
downloadasylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.tar.gz
asylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.zip
initial commit
Diffstat (limited to 'packages/cgit-syntect-bat')
-rw-r--r--packages/cgit-syntect-bat/.gitignore1
-rw-r--r--packages/cgit-syntect-bat/PKGBUILD28
2 files changed, 29 insertions, 0 deletions
diff --git a/packages/cgit-syntect-bat/.gitignore b/packages/cgit-syntect-bat/.gitignore
new file mode 100644
index 0000000..7c0560f
--- /dev/null
+++ b/packages/cgit-syntect-bat/.gitignore
@@ -0,0 +1 @@
+/bat/
diff --git a/packages/cgit-syntect-bat/PKGBUILD b/packages/cgit-syntect-bat/PKGBUILD
new file mode 100644
index 0000000..f4f83c2
--- /dev/null
+++ b/packages/cgit-syntect-bat/PKGBUILD
@@ -0,0 +1,28 @@
+pkgname=cgit-syntect-bat
+pkgver=0.24.0
+pkgrel=1
+pkgdesc="syntax pack based on bat for cgit-syntect"
+arch=(any)
+url="https://github.com/sharkdp/bat"
+makedepends=(bat cgit-syntect)
+source=("git+$url#commit=v$pkgver")
+sha256sums=(SKIP)
+
+pkgver() {
+	bat --version | sed -n 's/^bat \([0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/p'
+}
+
+prepare() {
+	sed -i 's/bat .*//' bat/assets/create.sh # don't automatically build
+	sed -i 's/local submodule_prompt=unspecified/local submodule_prompt=y/' bat/assets/create.sh # don't prompt user
+	sed -i 's/^trap reverse_patches .*$//' bat/assets/create.sh # don't reverse patches
+}
+
+build() {
+	bat/assets/create.sh # prepare submodules and patches
+	MODE=compile cgit-syntect $srcdir/bat/assets/syntaxes syntax.packdump # compile syntaxes
+}
+
+package() {
+	install -Dm0755 -t "$pkgdir/usr/share/cgit-syntect" syntax.packdump
+}