blob: 1fca1582163ed243c2df7b7e03278a6a82befb6d (
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
# Maintainer:
# Contributer: Yamada Hayao <hayao@fascode.net>
# Contributer: rilian-la-te <ria.freelander@gmail.com>
## options
: ${_autoupdate:=false}
: ${_build_mate:=true}
: ${_build_xfce:=true}
: ${_build_vala:=true}
: ${_build_budgie:=true}
: ${_build_registrar:=true}
: ${_build_translator:=true}
: ${_build_git:=false}
unset _pkgtype
[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git"
## basic info
_pkgname="vala-panel-appmenu"
pkgbase="$_pkgname${_pkgtype:-}"
pkgver=24.05
pkgrel=3
pkgdesc="Global Menu plugin"
url="https://gitlab.com/vala-panel-project/vala-panel-appmenu"
license=('LGPL-3.0-or-later')
arch=('i686' 'x86_64')
_main_package() {
makedepends+=(
'git'
'meson'
'vala'
'gobject-introspection'
)
if [ "${_build_git::1}" != "t" ]; then
_update_version
_main_stable
else
_main_git
fi
}
# stable package
_main_stable() {
_pkgsrc="$_pkgname"
source+=("$_pkgsrc"::"git+$url.git#tag=$_pkgver")
sha256sums+=('SKIP')
pkgver() {
echo "${_pkgver:?}"
}
}
# git package
_main_git() {
_pkgsrc="$_pkgname"
source+=("$_pkgsrc"::"git+$url.git")
sha256sums+=('SKIP')
pkgver() {
cd "$_pkgsrc"
git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
| sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}
}
# common functions
prepare() {
sed -e 's&^.*if mate_found or vala_panel_found or budgie_found.*$&if true&' \
-i "$_pkgsrc/data/meson.build"
sed -E -e "s&(importer_dep = dependency)\('appmenu-glib-translator'&\1('_appmenu_glib_translator_'&" \
-i "$_pkgsrc/lib/meson.build"
}
build() {
sed -i 's/nb //' "${srcdir}/vala-panel-appmenu/po/LINGUAS"
_build_registrar
meson "${_opts[@]}" build "$_pkgsrc"
meson compile -C build
DESTDIR="$srcdir/fakeinstall" meson install -C build
}
_build_registrar() {
[ "${_build_registrar::1}" != "t" ] && return
local _path_reg="subprojects/registrar"
arch-meson "$_pkgsrc/$_path_reg" build_registrar
meson compile -C build_registrar
}
_package_vala-panel-appmenu-registrar() {
pkgdesc="Small utility to hold DBusMenu menus"
depends=('glib2')
meson install -C build_registrar --destdir "$pkgdir"
}
_package_appmenu-glib-translator() {
pkgdesc="GLib library to translate DBusMenu menus into GMenuModels"
depends=(
'dconf'
'gdk-pixbuf2'
)
conflicts+=('vala-panel-appmenu-common')
install -dm755 "$pkgdir"/{usr/lib,usr/share}
mv "$srcdir"/fakeinstall/usr/include "$pkgdir"/usr/
mv "$srcdir"/fakeinstall/usr/lib/pkgconfig "$pkgdir"/usr/lib/
mv "$srcdir"/fakeinstall/usr/lib/libappmenu-glib-translator* "$pkgdir"/usr/lib/
mv "$srcdir"/fakeinstall/usr/share/{gir-1.0,glib-2.0,vala} "$pkgdir"/usr/share/
}
_package_vala-panel-appmenu() {
pkgdesc="metapackage - vala panel appmenu collection"
arch=('any')
depends=(
"${_depends_meta[@]}"
"vala-panel-appmenu-locale${_pkgtype:-}"
)
}
_package_vala-panel-appmenu-locale() {
pkgdesc="Translations for vala-panel-appmenu"
arch=('any')
depends=()
conflicts+=('vala-panel-appmenu-common')
install -dm755 "$pkgdir"/usr/share
mv "$srcdir"/fakeinstall/usr/share/locale "$pkgdir"/usr/share/
}
_package_vala-panel-appmenu-budgie() {
pkgdesc+=" for budgie-panel"
depends=(
"appmenu-glib-translator${_pkgtype:-}"
'budgie-desktop'
)
install -dm755 "$pkgdir"/usr/lib
mv "$srcdir"/fakeinstall/usr/lib/budgie-desktop "$pkgdir"/usr/lib/
}
_package_vala-panel-appmenu-mate() {
pkgdesc+=" for mate-panel"
depends=(
"appmenu-glib-translator${_pkgtype:-}"
'mate-panel'
)
install -dm755 "$pkgdir"/{usr/lib,usr/share}
mv "$srcdir"/fakeinstall/usr/lib/mate-panel "$pkgdir"/usr/lib/
mv "$srcdir"/fakeinstall/usr/share/mate-panel "$pkgdir"/usr/share/
}
_package_vala-panel-appmenu-valapanel() {
pkgdesc+=" for vala-panel"
depends=(
"appmenu-glib-translator${_pkgtype:-}"
'vala-panel'
)
install -dm755 "$pkgdir"/{usr/lib,usr/share}
mv "$srcdir"/fakeinstall/usr/lib/vala-panel "$pkgdir"/usr/lib/
mv "$srcdir"/fakeinstall/usr/share/vala-panel "$pkgdir"/usr/share/
}
_package_vala-panel-appmenu-xfce() {
pkgdesc+=" for xfce4-panel"
depends=(
"appmenu-glib-translator${_pkgtype:-}"
'xfce4-panel'
'xfconf'
)
install -dm755 "$pkgdir"/{usr/lib,usr/share}
mv "$srcdir"/fakeinstall/usr/lib/xfce4 "$pkgdir"/usr/lib/
mv "$srcdir"/fakeinstall/usr/share/xfce4 "$pkgdir"/usr/share/
}
# subpackages
_opts=(
--prefix=/usr
--libdir=lib
--libexecdir=lib
-Dauto_features=disabled
)
pkgname=(
"vala-panel-appmenu${_pkgtype:-}"
"vala-panel-appmenu-locale${_pkgtype:-}"
)
if [[ "${_build_registrar::1}" == "t" ]]; then
pkgname+=("vala-panel-appmenu-registrar${_pkgtype:-}")
_depends_meta+=("vala-panel-appmenu-registrar${_pkgtype:-}")
fi
if [[ "${_build_translator::1}" == "t" ]]; then
pkgname+=("appmenu-glib-translator${_pkgtype:-}")
_depends_meta+=("appmenu-glib-translator${_pkgtype:-}")
fi
if [[ "${_build_mate::1}" == "t" ]]; then
_opts+=(-Dmate=enabled)
pkgname+=("vala-panel-appmenu-mate${_pkgtype:-}")
depends+=('mate-panel')
_depends_meta+=("vala-panel-appmenu-mate${_pkgtype:-}")
fi
if [[ "${_build_xfce::1}" == "t" ]]; then
_opts+=(-Dxfce=enabled)
pkgname+=("vala-panel-appmenu-xfce${_pkgtype:-}")
depends+=('xfce4-panel' 'xfconf')
_depends_meta+=("vala-panel-appmenu-xfce${_pkgtype:-}")
fi
if [[ "${_build_vala::1}" == "t" ]]; then
_opts+=(-Dvalapanel=enabled)
pkgname+=("vala-panel-appmenu-valapanel${_pkgtype:-}")
depends+=("vala-panel${_pkgtype:-}")
_depends_meta+=("vala-panel-appmenu-valapanel${_pkgtype:-}")
fi
if [[ "${_build_budgie::1}" == "t" ]]; then
_opts+=(-Dbudgie=enabled)
pkgname+=("vala-panel-appmenu-budgie${_pkgtype:-}")
depends+=('budgie-desktop')
_depends_meta+=("vala-panel-appmenu-budgie${_pkgtype:-}")
fi
for _p in "${pkgname[@]}"; do
if [ -z "${_pkgtype:-}" ]; then
_conflicts=(
'appmenu-glib-translator-git'
'vala-panel-git'
'vala-panel-appmenu-budgie-git'
'vala-panel-appmenu-common-git'
'vala-panel-appmenu-jayatana-git'
'vala-panel-appmenu-locale-git'
'vala-panel-appmenu-mate-git'
'vala-panel-appmenu-registrar-git'
'vala-panel-appmenu-valapanel-git'
'vala-panel-appmenu-xfce-git'
)
else
_conflicts=(
'appmenu-glib-translator'
'vala-panel'
'vala-panel-appmenu-budgie'
'vala-panel-appmenu-common'
'vala-panel-appmenu-jayatana'
'vala-panel-appmenu-locale'
'vala-panel-appmenu-mate'
'vala-panel-appmenu-registrar'
'vala-panel-appmenu-valapanel'
'vala-panel-appmenu-xfce'
)
fi
eval "package_$_p() {
$(declare -f "_package_${_p#${_pkgtype:-}}")
_package_${_p#${_pkgtype:-}}
conflicts+=(${_conflicts[@]})
chmod -R u+rwX,go+rX,go-w \"\$pkgdir\"
}"
done
# update version
_update_version() {
: ${_pkgver:=${pkgver%%.r*}}
if [[ "${_autoupdate::1}" != "t" ]]; then
return
fi
local _response=$(curl -Ssf "$url/-/tags?format=atom")
local _tag=$(
printf '%s' "$_response" \
| grep '"https://.*/tags/.*"' \
| sed -E 's@^.*/tags/(.*)".*$@\1@' \
| grep -Ev '[a-z]{2}' | sort -rV | head -1
)
local _pkgver_new="${_tag#v}"
# update _pkgver
if [ "$_pkgver" != "${_pkgver_new:?}" ]; then
_pkgver="${_pkgver_new:?}"
fi
}
# execute
_main_package
|