summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 490275b215d615ad5ac6c9f2d29a0cceae27c3f8 (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
_username=vorot93
_reponame=rstd
_pkgbase=rstd
pkgname=${_pkgbase}-git
pkgdesc="Rust standard library implemented in C++."
pkgver=r35.dc9a481
pkgrel=1
arch=('i686' 'x86_64')
url="https://github.com/$_username/${_reponame/}"
provides=('rstd')
makedepends=('meson')
depends=('glibmm' 'boost')
license=('MIT')
options=('!staticlibs')
source=("git+https://github.com/${_username}/${_reponame}${_ref}")
sha256sums=('SKIP')

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

build() {
  if [ -d ${srcdir}/build ]; then
    cd ${srcdir}/build
    if ! mesonconf; then
      cd ${srcdir}
      rm -rf ${srcdir}/build
    fi
  fi

  if [ ! -d ${srcdir}/build ]; then
    cd ${srcdir}/${_reponame}
    meson --prefix=/usr --buildtype=release ${srcdir}/build
    cd ..
  fi

  cd ${srcdir}/build
}

package() {
  cd ${srcdir}/build

  DESTDIR="${pkgdir}" ninja install
}