summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d7d50c86fbd0a8baa5eb867a3039c413ab7abb3a (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Maintainer: Matt Quintanilla <matt at matt quintanilla . xyz>

_pkgname="libadapta"
pkgbase=libadapta-git
pkgname=(libadapta-git libadapta-docs-git libadapta-demos-git)
pkgver=r4088.5f2193a
pkgrel=2
pkgdesc="libAdapta is libAdwaita with theme support and a few extra."
url="https://github.com/xapp-project/libadapta"
arch=(x86_64 i686 pentium4 aarch64 armv7h)
license=(LGPL-2.1-or-later)
depends=(
  appstream
  fribidi
  glib2
  glibc
  graphene
  gtk4-git
  pango
)
makedepends=(
  gi-docgen
  git
  glib2-devel
  gobject-introspection
  meson
  sassc
  vala
)
checkdepends=(weston)

source=(git+https://github.com/xapp-project/libadapta.git)
sha256sums=('SKIP')

pkgver() {
  cd "libadapta"
  #git describe --tags | sed 's/-/+/g'
   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

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

  arch-meson libadapta 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_libadapta-git() {
  depends+=(libgtk-4.so)
  provides=(libadapta)
  conflicts=(libadapta)
  provides+=(libAdapta-1.so)

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

  cd "$pkgdir"

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

  _pick docs usr/share/doc
}

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

package_libadapta-docs-git() {
  pkgdesc+=" (documentation)"
  depends=()
  provides=(libadapta-docs)
  conflicts=(libadapta-docs)
  mv docs/* "$pkgdir"
}