summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 58f57b19242d797b5efd9b6bba490168b00f1e3e (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
# Maintainer:  Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>

_pkgname="datatype99"
pkgname="${_pkgname}-git"
pkgver=1.6.4.r9.g982a87b
pkgrel=1
pkgdesc="Algebraic data types for C99"
arch=('any')
url="https://github.com/hirrolot/${_pkgname}"
license=('MIT')
depends=('metalang99')
makedepends=('git')
checkdepends=('cmake>=3.16')
provides=("${_pkgname}=${pkgver%%.r*}")
conflicts=("${_pkgname}")
_pkgsrc="${_pkgname}"
source=("${_pkgsrc}::git+${url}.git"
        "${_pkgname}_cmake_system_libs.patch")
sha256sums=('SKIP'
            'ea01860c953b32ebd58cc92d6007a7f647a08f9899e3a55d8ad085c8f51932c6')

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

prepare() {
  cd "${srcdir}/${_pkgsrc}"
  patch -Np1 -i "${srcdir}/${_pkgname}_cmake_system_libs.patch"
}

check() {
  cd "${srcdir}/${_pkgsrc}"
  ./scripts/test.sh
}

package() {
  cd "${srcdir}/${_pkgsrc}"
  install -vDm644 "${_pkgname}.h" "${pkgdir}/usr/include/${_pkgname}.h"
  install -vDm644 "CHANGELOG.md"  "${pkgdir}/usr/share/doc/${_pkgname}/CHANGELOG.md"
  install -vDm644 "README.md"     "${pkgdir}/usr/share/doc/${_pkgname}/README.md"
  install -vDm644 "LICENSE"       "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}