summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4598045b86a2fad2cbd540a1c9f3599090ade0c2 (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
# Maintainer: txtsd <aur.archlinux@ihavea.quest>
# Contributor: dreieck (https://aur.archlinux.org/account/dreieck/)

pkgname=libggml-git
_pkgname="${pkgname%-git}"
pkgver=r1410.8a3d799
pkgrel=2
pkgdesc='Tensor library for machine learning'
url='https://github.com/ggerganov/ggml'
license=('MIT')
arch=(x86_64)
depends=(
  clblast
  glibc
  openblas
)
makedepends=(
  cmake
  git
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
options=(lto)
source=("${_pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkgname}"

  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  local _cmake_options=(
    -B build
    -S "${_pkgname}"
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DGGML_ALL_WARNINGS=OFF
    -DGGML_ALL_WARNINGS_3RD_PARTY=OFF
    -DGGML_BUILD_EXAMPLES=ON
    -DGGML_BUILD_TESTS=ON
    -DGGML_LTO=ON
    -DGGML_RPC=ON
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="${pkgdir}" cmake --install build

  install -Dm644 "${_pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}