# Maintainer: dec05eba <dec05eba at protonmail.com>
pkgname=sibs-git
pkgver=0.3.1.r0.gec6d760
pkgrel=1
pkgdesc='Simple build system for native languages'
arch=('any')
url='https://gitlab.com/DEC05EBA/sibs'
license=('GPL-3.0')
depends=('cmake' 'ninja' 'libgit2' 'curl' 'ccache' 'libarchive')
makedepends=('cmake' 'libgit2' 'curl' 'libarchive')
source=('git+https://gitlab.com/DEC05EBA/sibs.git')
md5sums=('SKIP')
provides=(sibs)
conflicts=(sibs)

prepare() {
    cd "$srcdir/$provides"
    git submodule update --init --recursive
}

build() {
    cd "$srcdir/$provides/cmake"
    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
    make
}

pkgver() {
  cd "$srcdir/$provides"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

check() {
    #cd "$srcdir/$provides"
    #./cmake/sibs test
    echo "Tests ignored for now..."
}

package() {
    cd "$srcdir/$provides/cmake"
    install -Dm644 "$srcdir/$provides/LICENSE" "$pkgdir/usr/share/licenses/$provides/LICENSE"
    install -Dm755 "$srcdir/$provides/cmake/sibs" "$pkgdir/usr/bin/sibs"
}