git » sysprof.git » main » tree

[main] / PKGBUILD

# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy.carrier@aur.archlinux.org>
# Contributor: Eric Belanger <belanger@astro.umontreal.ca>
# Contributor: aeolist <aeolist@hotmail.com>
# Contributor: Gabriel Rauter <rauter.gabriel@gmail.com>

pkgbase=sysprof
pkgname=(
  sysprof
  libsysprof-capture
)
pkgver=46.0
pkgrel=1
pkgdesc="Kernel based performance profiler"
url="https://wiki.gnome.org/Apps/Sysprof"
license=(GPL-3.0-or-later)
arch=(armv7h)
depends=(
  cairo
  gcc-libs
  glib2
  glibc
  graphene
  gtk4
  hicolor-icon-theme
  json-glib
  libadwaita
  libdex
  libpanel
  libunwind
  pango
  polkit
  systemd-libs
)
makedepends=(
  git
  meson
  python-packaging
  yelp-tools
)
_commit=594a3037c0e7cc1bf97f162a392aa4f8989c9dce  # tags/46.0^0
source=(
  "git+https://gitlab.gnome.org/GNOME/sysprof.git#commit=$_commit"
)
b2sums=('SKIP')

pkgver() {
  cd sysprof
  git describe --tags | sed -r 's/\.([a-z])/\1/;s/([a-z])\./\1/;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd sysprof
}

build() {
  # Ensure static library is non-LTO compatible
  CFLAGS+=" -ffat-lto-objects"

  arch-meson sysprof build
  meson compile -C build
}

#check() {
#  meson test -C build --print-errorlogs
#}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_sysprof() {
  depends+=(libsysprof-capture)
  groups=(gnome-extra)

  meson install -C build --destdir "$pkgdir"

  cd "$pkgdir"

  _pick capture usr/lib/libsysprof-capture-*
  _pick capture usr/lib/pkgconfig/sysprof-capture-*
  _pick capture usr/include/sysprof-*/sysprof-{address,capture,clock,collector,macros}.h
  _pick capture usr/include/sysprof-*/sysprof-{platform,version,version-macros}.h
  _pick capture usr/include/sysprof-*/sysprof-capture-{condition,cursor,reader,types,writer}.h
}

package_libsysprof-capture() {
  pkgdesc+=" - capture library"
  depends=()
  license=(BSD-2-Clause-Patent)

  mv capture/* "$pkgdir"

  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 \
    sysprof/src/libsysprof-capture/COPYING
}

# vim:set sw=2 sts=-1 et: