summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuoi2023-10-20 17:40:52 +0800
committerKuoi2023-10-20 17:40:52 +0800
commit3f800fb18ae574f89f83168bb2b943affcb8992d (patch)
tree4a33b6083c35bc0bdbfa504c57d4584797332c8e
downloadaur-dbasic.tar.gz
init
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD37
2 files changed, 53 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0783fd140951
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = dbasic
+ pkgdesc = Modern implementation of the original Dartmouth BASIC compilers in the D programming language
+ pkgver = 0.92.0
+ pkgrel = 1
+ url = https://github.com/cpp-tutor/dbasic
+ arch = x86_64
+ license = MIT
+ makedepends = ldc
+ depends = gcc-libs
+ depends = glibc
+ depends = liblphobos
+ optdepends = clang: for compiling binary
+ source = https://github.com/cpp-tutor/dbasic/archive/refs/tags/v0.92.0.tar.gz
+ sha256sums = 02c2e4c7df8b4d7ef12c6c605cf8bc7d2c45e49483938b9a76f6fbb7a54f1ac2
+
+pkgname = dbasic
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..deaae21f7855
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
+
+pkgname=dbasic
+pkgver=0.92.0
+pkgrel=1
+pkgdesc="Modern implementation of the original Dartmouth BASIC compilers \
+ in the D programming language"
+arch=('x86_64')
+url="https://github.com/cpp-tutor/$pkgname"
+license=('MIT')
+depends=('gcc-libs' 'glibc' 'liblphobos')
+makedepends=('ldc')
+optdepends=('clang: for compiling binary')
+source=($url/archive/refs/tags/v${pkgver}.tar.gz)
+sha256sums=('02c2e4c7df8b4d7ef12c6c605cf8bc7d2c45e49483938b9a76f6fbb7a54f1ac2')
+prepare() {
+ cd "$pkgname-$pkgver"
+ # fix bison issue
+ cp -f autogen/Parser.d .
+ touch Parser.d
+ echo -e "dbasic 4 < \$1 > run_basic.ll && clang -O3 -Wno-override-module -o run_basic run_basic.ll /usr/share/$pkgname/runtime/basic_lib.c -lm && ./run_basic" > run-linux.sh
+ chmod +x run-linux.sh
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ make -f Makefile.llvm
+}
+
+
+package(){
+ cd "$pkgname-$pkgver"
+ install -Dm755 $pkgname $pkgdir/usr/bin/$pkgname
+ install -Dm755 run-linux.sh $pkgdir/usr/share/$pkgname/runtime/run-linux.sh
+ install -Dm755 runtime/basic_lib.c $pkgdir/usr/share/$pkgname/runtime/basic_lib.c
+ install -Dm644 README.md $pkgdir/usr/share/doc/$pkgname/README.md
+}