git » libadwaita.git » main » tree

[main] / PKGBUILD

# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>

pkgbase=libadwaita
pkgname=(
  libadwaita
  libadwaita-demos
  libadwaita-docs
)
pkgver=1.5.0
pkgrel=1
epoch=1
pkgdesc="Building blocks for modern adaptive GNOME applications"
url="https://gnome.pages.gitlab.gnome.org/libadwaita/"
arch=(armv7h)
license=(LGPL-2.1-or-later)
depends=(
  appstream
  fribidi
  glib2
  glibc
  graphene
  gtk4
  pango
)
makedepends=(
  gi-docgen
  git
  gobject-introspection
  meson
  sassc
  vala
)
checkdepends=(weston)
_commit=6eed5e87efdcb6c599caaad64cbf1b68603ee6e7  # tags/1.5.0^0
source=("git+https://gitlab.gnome.org/GNOME/libadwaita.git#commit=$_commit")
b2sums=('SKIP')

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

prepare() {
  cd $pkgname
}

build() {
  local meson_options=(
    -D gtk_doc=true
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() (
  export XDG_RUNTIME_DIR="$PWD/runtime-dir" WAYLAND_DISPLAY=wayland-5

  mkdir -p -m 700 "$XDG_RUNTIME_DIR"
  weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY --idle-time=0 &
  _w=$!

  trap "kill $_w; wait" EXIT

  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_libadwaita() {
  depends+=(libgtk-4.so)
  provides+=(libadwaita-1.so)

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

  cd "$pkgdir"

  _pick demo usr/bin/adwaita-1-demo
  _pick demo usr/share/applications/org.gnome.Adwaita1.Demo.desktop
  _pick demo usr/share/icons/hicolor/*/apps/org.gnome.Adwaita1.Demo[-.]*
  _pick demo usr/share/metainfo/org.gnome.Adwaita1.Demo.metainfo.xml

  _pick docs usr/share/doc
}

package_libadwaita-demos() {
  pkgdesc+=" (demo applications)"
  depends=(
    glib2
    glibc
    gtk4
    hicolor-icon-theme
    libadwaita
  )
  mv demo/* "$pkgdir"
}

package_libadwaita-docs() {
  pkgdesc+=" (documentation)"
  depends=()
  mv docs/* "$pkgdir"
}

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