summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9df5c5d5698c7560a0ad6a979b9f66f2551ea558 (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
67
68
69
70
71
72
73
74
75
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=opencl-clhpp-git
pkgver=2023.04.17.22.g0cc3a7d
pkgrel=1
pkgdesc='OpenCLTM API C++ bindings. (GIT Version)'
arch=('any')
url='http://khronosgroup.github.io/OpenCL-CLHPP'
license=('apache')
makedepends=(
  'git'
  'python'
  'cmake'
  'ruby'
  'doxygen'
)
provides=('opencl-clhpp')
conflicts=('opencl-clhpp')
source=(
  'git+https://github.com/KhronosGroup/OpenCL-CLHPP.git'
  'git+https://github.com/ThrowTheSwitch/CMock.git'
  'git+https://github.com/ThrowTheSwitch/Unity.git'
)
sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
)

pkgver() {
  cd OpenCL-CLHPP
  echo "$(git describe --long --tags | tr - . | tr -d v)"
}

prepare() {
  # fix output docs
  sed -e "s|OUTPUT_DIRECTORY       =|& \"${pkgdir}/usr/share/doc/OpenCL-CLHPP\"|g" \
      -e "s|/include|${srcdir}/OpenCL-CLHPP/include|g" \
    -i OpenCL-CLHPP/docs/Doxyfile.in

  cd OpenCL-CLHPP
  git config submodule.external/CMock.url "${srcdir}/CMock"
  git -c protocol.file.allow=always submodule update --init \
    external/CMock

  cd external/CMock
  git config submodule.vendor/unity.url "${srcdir}/Unity"
  git -c protocol.file.allow=always submodule update --init \
    vendor/unity

}

build() {
  cmake -S OpenCL-CLHPP -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_EXAMPLES=OFF \
    -DOPENCL_CLHPP_BUILD_TESTING=ON \
    -DBUILD_TESTING=ON

  cmake --build build
}

check() {
  cd build
  ctest --output-on-failure
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
  install -d "${pkgdir}/usr/share/doc/OpenCL-CLHPP"
  (cd build/docs; doxygen -u)
  cmake --build build --target docs
  install -Dm644 OpenCL-CLHPP/LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}