summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2024-10-09 01:25:47 +0200
committerYour Name2024-10-09 01:26:24 +0200
commitdbf0f1acfb5390394025a56352c1b4dcc1726e2f (patch)
tree20ee7f4052865c39280bc0958bb8a82eceb28444
downloadaur-dbf0f1acfb5390394025a56352c1b4dcc1726e2f.tar.gz
Initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD41
-rw-r--r--aider.bin8
3 files changed, 66 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a34dd337a7bb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = aider-chat-venv
+ pkgdesc = AI pair programming in your terminal
+ pkgver = 0.59.0
+ pkgrel = 1
+ url = https://github.com/Aider-AI/aider
+ arch = any
+ license = Apache-2.0
+ depends = python
+ provides = aider-chat
+ provides = aider-chat
+ conflicts = aider-chat
+ conflicts = aider-chat
+ options = !strip
+ source = aider.bin
+ b2sums = 717fa32e049ed4f21794997d74910be6c6c105ac0304aa98cfd0c59ce5e1212ea68a242d18bd698564fa1f5365cfe998d583bf4b95afbf39b2d4aa0b9dbb5bad
+
+pkgname = aider-chat-venv
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..911264f7a181
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Maintainer: AlphaJack <alphajack at tuta dot io>
+
+# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=superset-venv
+
+pkgname="aider-chat-venv"
+pkgver=0.59.0
+pkgrel=1
+pkgdesc="AI pair programming in your terminal"
+url="https://github.com/Aider-AI/aider"
+license=("Apache-2.0")
+arch=("any")
+provides=("aider-chat" "aider-chat")
+conflicts=("aider-chat" "aider-chat")
+depends=("python")
+makepkg=("jq")
+source=("aider.bin")
+b2sums=('717fa32e049ed4f21794997d74910be6c6c105ac0304aa98cfd0c59ce5e1212ea68a242d18bd698564fa1f5365cfe998d583bf4b95afbf39b2d4aa0b9dbb5bad')
+options=("!strip")
+
+pkgver(){
+ curl -s "https://api.github.com/repositories/638629097/releases/latest" | jq -r '.tag_name | sub("^v"; "")'
+}
+
+package() {
+ # binary
+ install -D -m 755 "$srcdir/aider.bin" "$pkgdir/usr/bin/aider"
+ # create virtual environment
+ export PIP_DISABLE_PIP_VERSION_CHECK=1
+ export PYTHONDONTWRITEBYTECODE=1
+ python -m venv "$pkgdir/usr/share/aider-chat/venv"
+ source "$pkgdir/usr/share/aider-chat/venv/bin/activate"
+ # install aider-chat and dependencies using pip
+ "$pkgdir/usr/share/aider-chat/venv/bin/"pip install -I aider-chat sounddevice soundfile
+ # remove references to pkgdir
+ find "$pkgdir/usr/share/aider-chat/venv/bin" -maxdepth 1 -type f -exec sed -i "s#${pkgdir}/#/#g" {} +
+ find "$pkgdir/usr/share/aider-chat/venv/pyvenv.cfg" -maxdepth 1 -type f -exec sed -i "s#${pkgdir}/#/#g" {} +
+ find "$pkgdir/usr/share/aider-chat/venv" -type f -name "*.py[co]" -delete
+ find "$pkgdir/usr/share/aider-chat/venv" -type d -name "__pycache__" -delete
+ # exit virtual environment
+ deactivate
+}
diff --git a/aider.bin b/aider.bin
new file mode 100644
index 000000000000..73880e6b0e76
--- /dev/null
+++ b/aider.bin
@@ -0,0 +1,8 @@
+#!/usr/share/aider-chat/venv/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from aider.main import main
+if __name__ == "__main__":
+ sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
+ sys.exit(main())