summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e136da13281bf2663bd93bb45d47d8239b3f70a9 (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

# Maintainer: Gabriel Brown <gabriel.h.brown@gmail.com>

_gituser="chapel-lang"
_gitname="chapel"

pkgname=${_gitname}-git
pkgver=1.32.0.642.gf361e5dd2bd #autogenerated/written by pkgver()
pkgrel=1
pkgdesc="Programming language designed for productive parallel computing at scale"
url="https://chapel-lang.org/"
arch=('x86_64' 'arm')
license=('Apache')
depends=('python' 'perl' 'llvm' 'clang')
makedepends=('git' 'cmake')
source=("git+https://github.com/${_gituser}/${_gitname}.git")
sha256sums=('SKIP') # source is not static

pkgver() {
  cd "${srcdir}/${_gitname}"
  # get correct numerical version from internal file
  ver_file="CMakeLists.txt"
  major_ver=$(grep set\(CHPL_MAJOR_VERSION  ${ver_file} \
                   | cut -d ' ' -f 2 | cut -d ')' -f 1)
  minor_ver=$(grep set\(CHPL_MINOR_VERSION  ${ver_file} \
                   | cut -d ' ' -f 2 | cut -d ')' -f 1) 
  update_ver=$(grep set\(CHPL_PATCH_VERSION ${ver_file} \
                   | cut -d ' ' -f 2 | cut -d ')' -f 1) 
  ver_num="${major_ver}.${minor_ver}.${update_ver}"
  # keep second (correct) half of git describe result
  gitdescribe=$(git describe --long --tags --always)
  tail=$(echo ${gitdescribe} | cut -d '-' -f 2,3) # no version number
  # combine two pieces
  ver_hyphen="${ver_num}-${tail}"
  ver=$(echo ${ver_hyphen} | sed 's/\-/\./g')
  echo ${ver}
  # use below when git describe begins with correct version number
  #git describe --long --tags --always | sed 's/\-/\./g' 
}

build() {
        cd "${srcdir}/${_gitname}"
        ./configure --prefix=/usr
        make
}

check() {
        cd "${srcdir}/${_gitname}"
        export PATH="${srcdir}/${_gitname}/bin/linux64-x86_64:${PATH}"
        make check
}

package() {
        cd "${_gitname}"
        make DESTDIR="${pkgdir}" install
}