summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1679e43b9679c601af304a7a16852cd506434f50 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: Ailton Baúque <ailtonbauque@outlook.com>

pkgname=samora-lang
pkgver=1.20.4.r.
pkgrel=1
pkgdesc="Samora Lang - A Simple Interpreted Programming Language just for Educational Purposes"
arch=('x86_64' 'i686')
url="https://github.com/GraHms/Samora-Lang"
license=('MIT')
groups=()
depends=('go')
makedepends=('git' 'go')
checkdepends=()
optdepends=()
provides=('samora')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=

source=("git+$url")
noextract=()
md5sums=('SKIP')

pkgver(){
  cd "${srcdir}"
  printf "1.20.4.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${srcdir}/Samora-Lang"
  
  go mod download
}

build() {
  cd "${srcdir}/Samora-Lang"
  
  go build -v ./...
}

check() {
  cd "${srcdir}/Samora-Lang"
  
  go test -v ./...
}

package() {
  cd "${srcdir}/Samora-Lang"
  
  install -Dm755 samora "${pkgdir}/opt/${pkgname}/samora"
  #install -Dm755 LICENSE "${pkgdir}/usr/share/licences/${pkgname}/LICENSE"
  install -Dm755 README.md "${pkgdir}/usr/share/docs/${pkgname}/README.md"
}

post_install() {
  ln -s "/opt/${pkgname}/samora" "/usr/bin/samora"
}

post_remove() {
  rm -f "/usr/bin/samora"
}