summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f7e80ef45c6ff249dc803ca940838db33417936c (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
# Maintainer: Angelo Theodorou <encelo at gmail dot com>

pkgname=tracy-git
pkgver=v0.11.0.r43.g60042d19
pkgrel=1
pkgdesc="Real-time, nanosecond resolution frame profiler"
arch=('i686' 'x86_64')
url="https://github.com/wolfpld/tracy"
license=('BSD-3-Clause')
depends=('wayland' 'libglvnd' 'libxkbcommon' 'freetype2' 'dbus' 'hicolor-icon-theme' 'intel-tbb' 'capstone')
makedepends=('pkgconf' 'git' 'cmake' 'wayland-protocols')
optdepends=('xdg-desktop-portal: file dialogs')
options=('!lto')
provides=('tracy')
conflicts=('tracy')
source=("git+$url")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}"/tracy
  ( set -o pipefail
    git describe --tags --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd tracy

  cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
  make -C build
  cmake -S capture -B capture/build -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CAPSTONE=OFF
  make -C capture/build
  cmake -S csvexport -B csvexport/build -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CAPSTONE=OFF
  make -C csvexport/build
  cmake -S import -B import/build -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CAPSTONE=OFF
  make -C import/build
  cmake -S profiler -B profiler/build -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CAPSTONE=OFF
  make -C profiler/build
  cmake -S update -B update/build -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CAPSTONE=OFF
  make -C update/build
}

package() {
  cd tracy
  install -Dm644 build/libTracyClient.a $pkgdir/usr/lib/libTracyClient.a
  install -Dm755 capture/build/tracy-capture $pkgdir/usr/bin/tracy-capture
  install -Dm755 csvexport/build/tracy-csvexport $pkgdir/usr/bin/tracy-csvexport
  install -Dm755 import/build/tracy-import-chrome $pkgdir/usr/bin/tracy-import-chrome
  install -Dm755 import/build/tracy-import-fuchsia $pkgdir/usr/bin/tracy-import-fuchsia
  install -Dm755 profiler/build/tracy-profiler $pkgdir/usr/bin/tracy
  install -Dm755 update/build/tracy-update $pkgdir/usr/bin/tracy-update

  mkdir -p $pkgdir/usr/include/Tracy/client
  mkdir -p $pkgdir/usr/include/Tracy/common
  mkdir -p $pkgdir/usr/include/Tracy/tracy

  cp -p public/client/*.{h,hpp} $pkgdir/usr/include/Tracy/client/
  cp -p public/common/*.{h,hpp} $pkgdir/usr/include/Tracy/common/
  cp -p public/tracy/*.{h,hpp} $pkgdir/usr/include/Tracy/tracy/

  install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 extra/desktop/tracy.desktop $pkgdir/usr/share/applications/tracy.desktop
  install -Dm644 icon/icon.svg $pkgdir/usr/share/icons/hicolor/scalable/apps/tracy.svg
  install -Dm644 extra/desktop/application-tracy.xml $pkgdir//usr/share/mime/packages/application-tracy.xml
  install -Dm644 icon/application-tracy.svg $pkgdir/usr/share/icons/hicolor/scalable/apps/application-tracy.svg
}