summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: deaae21f785595bf6bc283262cf54a65e0eb927c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
}