summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d858847ec2b5ffe4425cc0630bba423f9ce0e009 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgbase=libportal-inputcapture
pkgname=(
  libportal-inputcapture
  libportal-inputcapture-gtk3
  libportal-inputcapture-gtk4
  libportal-inputcapture-qt5
  libportal-inputcapture-qt6
  libportal-inputcapture-docs
)
pkgver=0.7.1+r21+gffd3f83
pkgrel=1
pkgdesc="GIO-style async APIs for most Flatpak portals with patches to support input capture for input-leap"
url="https://github.com/flatpak/libportal"
arch=(x86_64)
license=(LGPL3)
makedepends=(
  gi-docgen
  glib2-devel
  git
  gjs
  gobject-introspection
  gtk3
  gtk4
  meson
  qt5-base
  qt5-x11extras
  vala
  xdg-desktop-portal
)
checkdepends=(
  python-dbusmock
  python-pytest
  xorg-server-xvfb
)
#_commit=1add346fc9ebea5ca144e244bcb3b6b9ee90fddf  # tags/0.7.1^0
source=("git+https://github.com/flatpak/libportal")
b2sums=('SKIP')

pkgver() {
  cd libportal
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libportal
#  git cherry-pick -n 1add346fc9ebea5ca144e244bcb3b6b9ee90fddf
}

build() {
  arch-meson libportal build \
  -D backend-qt6=enabled
  meson compile -C build
}

#check() {
#  xvfb-run -s '-nolisten local' \
#    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_libportal-inputcapture() {
  depends=(
    libg{lib,object,io}-2.0.so
    xdg-desktop-portal
  )
  provides=('libportal.so' 'libportal')
  conflicts=('libportal')
  replaces=('libportal')

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

  cd "$pkgdir"

  _pick gtk3 usr/include/libportal-gtk3
  _pick gtk3 usr/lib{,/pkgconfig}/libportal-gtk3.*
  _pick gtk3 {usr/lib/girepository-1.0,usr/share/gir-1.0}/XdpGtk3-1.0.*
  _pick gtk3 usr/share/vala/vapi/libportal-gtk3.*

  _pick gtk4 usr/include/libportal-gtk4
  _pick gtk4 usr/lib{,/pkgconfig}/libportal-gtk4.*
  _pick gtk4 {usr/lib/girepository-1.0,usr/share/gir-1.0}/XdpGtk4-1.0.*
  _pick gtk4 usr/share/vala/vapi/libportal-gtk4.*

  _pick qt5 usr/include/libportal-qt5
  _pick qt5 usr/lib{,/pkgconfig}/libportal-qt5.*
  
  _pick qt6 usr/include/libportal-qt6
  _pick qt6 usr/lib{,/pkgconfig}/libportal-qt6.*

  _pick docs usr/share/doc
}

package_libportal-inputcapture-gtk3() {
  pkgdesc+=" - GTK 3 backend"
  depends=(
    libg{d,t}k-3.so
    libportal
  )
  provides=('libportal-gtk3.so' 'libportal-gtk3')
  conflicts=('libportal-gtk3')
  replaces=('libportal-gtk3')

  mv gtk3/* "$pkgdir"
}

package_libportal-inputcapture-gtk4() {
  pkgdesc+=" - GTK 4 backend"
  depends=(
    libgtk-4.so
    libportal
  )
  provides=('libportal-gtk4.so' 'libportal-gtk4')
  conflicts=('libportal-gtk4')
  replaces=('libportal-gtk4')

  mv gtk4/* "$pkgdir"
}

package_libportal-inputcapture-qt5() {
  pkgdesc+=" - Qt 5 backend"
  depends=(
    libportal
    qt5-base
    qt5-x11extras
  )
  provides=('libportal-qt5.so' 'libportal-qt5')
  conflicts=('libportal-qt5')
  replaces=('libportal-qt5')

  mv qt5/* "$pkgdir"
}

package_libportal-inputcapture-qt6() {
  pkgdesc+=" - Qt 6 backend"
  depends=(
    libportal
    qt6-base
  )
  provides=('libportal-qt6.so' 'libportal-qt6')
  conflicts=('libportal-qt6')
  replaces=('libportal-qt6')

  mv qt6/* "$pkgdir"
}

package_libportal-inputcapture-docs() {
  pkgdesc+=" - documentation"
  provides=('libportal-docs')
  conflicts=('libportal-docs')
  replaces=('libportal-docs')
  mv docs/* "$pkgdir"
}

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