interplane.Get Omega
Read in your language

omega-packages

aien-dev/omega-packages

Brought by drakestapleton

branch main Branches Tags History

omega-packages / aur / PKGBUILD

34 lines · 1259 bytes Raw Blame History
1# Maintainer: Drake Stapleton <drake@aienos.com>
2# omc, the Omega compiler, born from the 408-byte hand-written seed of aien-dev/omega-mv.
3# The build runs only seed programs plus sh, printf, sed, stat, cmp and sha256sum; no compiler.
4pkgname=omc
5_commit=e5b32567a7aff3ce594e3254a622a846a6cd190b
6_omcsha256=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
7pkgver=0.0.0+git.e5b32567
8pkgrel=1
9pkgdesc='Omega compiler, born from a 408-byte hand-written seed (AArch64 Linux only)'
10arch=('aarch64')
11url='https://github.com/aien-dev/omega-mv'
12license=('Apache-2.0')
13options=('!strip' '!debug')
14source=("omega-mv-${_commit}.tar.gz::https://github.com/aien-dev/omega-mv/archive/${_commit}.tar.gz")
15sha256sums=('c621b6cefe728d67a1a253a9d8991495406460d365dd91ea356451eb2254a95c')
16
17build() {
18 cd "omega-mv-${_commit}"
19 sh seed/omega-from-seed.sh
20 echo "${_omcsha256} seed/out/omc" | sha256sum -c -
21}
22
23check() {
24 cd "omega-mv-${_commit}"
25 printf 'global out uchar 4\nfn main to int\nput out 0 111\nput out 1 107\nput out 2 10\nw = write 1 out 0 3\nret 0\nend\n' > hello.om
26 ./seed/out/omc < hello.om > hello
27 chmod +x hello
28 test "$(./hello)" = ok
29}
30
31package() {
32 cd "omega-mv-${_commit}"
33 install -Dm755 seed/out/omc "${pkgdir}/usr/bin/omc"
34}