summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f68232bc49e5b4d89f4fc6e50ce6b238d5f7451 (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
# Maintainer: Alexandros Theodotou <alex at zrythm dot org>
# note: need to export PATH="/usr/lib/llvm14/bin:$PATH" before using

pkgname=stoat-git
_pkgname=stoat
pkgver=v1.1.r29.g124b0e1
pkgrel=1
pkgdesc="STatic (LLVM) Object file Analysis Tool"
arch=('i686' 'x86_64')
url="https://github.com/fundamental/stoat"
license=('GPL3')
depends=('llvm14' 'ruby' 'binutils')
makedepends=('git' 'cmake' 'clang14')
provides=("$_pkgname")
source=("$_pkgname::git+https://github.com/fundamental/stoat.git")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  # https://reviews.llvm.org/D78882
  find ./src -type f -exec sed -i -e 's/getCalledValue/getCalledOperand/g' {} \;
}

build() {
  cd "${srcdir}/${_pkgname}"

  rm -rf build
  mkdir -p build
  cd build
  export PATH="/usr/lib/llvm14/bin:$PATH"
  CC=clang CXX=clang CFLAGS="-I/usr/lib/llvm14/include" LDFLAGS="-L /usr/lib/llvm14/lib" cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX="${pkgdir}/usr" ..
  make PREFIX="/usr"
}

package() {
  cd "${srcdir}/${_pkgname}/build"

  make install
}