summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f31b80dab04130d0c3a7691698054860b11ccb4 (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
66
# Maintainer: Ailton Baúque <ailtonbauque@outlook.com>

latest_tag=$(curl -s "https://api.github.com/repos/GraHms/Samora-Lang/tags" | jq -r '.[0].name')
latest_tag=${latest_tag#v}

pkgver="${latest_tag}.r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
pkgname=samora-lang
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(){
#}

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

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

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"
}