# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=acme
pkgver=2019.08.19
pkgrel=1
pkgdesc='Assembler for the 6502, 6510, 65c02 and 65816 processors'
arch=(x86_64)
url='https://github.com/meonwax/acme'
license=(GPL)
source=("git+$url#commit=99fae48b1f")
makedepends=(git setconf)
conflicts=(plan9port)
sha256sums=(SKIP)

prepare() {
  cd $pkgname/src
  setconf Makefile CFLAGS "$CFLAGS -w"
  setconf Makefile LIBS "$LDFLAGS -lm"
}

build() {
  make -s -C $pkgname/src
}

package() {
  cd $pkgname

  # Documentation
  install -d "$pkgdir/usr/share/doc/acme"
  install -t "$pkgdir/usr/share/doc/acme" docs/*.txt

  # Executable
  install -Dm755 src/acme "$pkgdir/usr/bin/acme"

  # Joe syntax highlighting
  install -Dm644 contrib/joe_syntax/acme.jsf "$pkgdir/usr/share/joe/syntax/acme.jsf"
  install -Dm644 contrib/joe_syntax/INSTALL "$pkgdir/usr/share/doc/acme/joe.txt"
}

# vim: ts=2 sw=2 et:
