summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiota2023-12-30 13:52:22 -0800
committerxiota2023-12-30 13:52:22 -0800
commit27fc963f37a72fd368577af6d35902016471dc5f (patch)
tree5ac2edf6bbac72d19066b9c45538eeb15b6dd9eb
parent3bbfb913c90b3fc406119ebd829215a3ffd6f251 (diff)
downloadaur-27fc963f37a72fd368577af6d35902016471dc5f.tar.gz
update depends, reorganize
-rw-r--r--.SRCINFO9
-rw-r--r--.gitignore4
-rw-r--r--[-rwxr-xr-x]PKGBUILD108
3 files changed, 102 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 71d9c6a5fe60..bf7aa9e11adf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,16 @@
pkgbase = vala-panel-appmenu-registrar
pkgdesc = Small utility to hold DBusMenu menus
pkgver = 0.7.6
- pkgrel = 1
+ pkgrel = 2
url = https://gitlab.com/vala-panel-project/vala-panel-appmenu
arch = i686
arch = x86_64
- license = LGPL3
+ license = LGPL-3.0-or-later
+ makedepends = git
makedepends = meson
- makedepends = glib2
depends = glib2
conflicts = vala-panel-appmenu-registrar-git
- source = git+https://gitlab.com/vala-panel-project/vala-panel-appmenu.git#tag=0.7.6
+ source = vala-panel-appmenu::git+https://gitlab.com/vala-panel-project/vala-panel-appmenu.git#tag=0.7.6
sha256sums = SKIP
pkgname = vala-panel-appmenu-registrar
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..018a3de08144
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!PKGBUILD
+!.SRCINFO
+!.gitignore
diff --git a/PKGBUILD b/PKGBUILD
index 8e91d7bae31c..90adec0ac741 100755..100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,28 +1,108 @@
-# Maintainer : Yamada Hayao <hayao@fascode.net>
+# Maintainer:
+# Contributor: Yamada Hayao <hayao@fascode.net>
# Contributer: rilian-la-te <ria.freelander@gmail.com>
-makedepends=('meson' 'glib2')
+# options
+if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then
+ : ${_autoupdate:=false}
+else
+ : ${_autoupdate:=true}
+fi
-_pkgbase="vala-panel-appmenu"
-pkgname="vala-panel-appmenu-registrar"
-_path="subprojects/registrar"
+: ${_build_git:=false}
+
+[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git"
+
+# basic info
+_name="vala-panel-appmenu"
+_pkgname="$_name-registrar"
+pkgname="$_pkgname${_pkgtype:-}"
pkgver=0.7.6
-pkgrel=1
+pkgrel=2
pkgdesc="Small utility to hold DBusMenu menus"
-conflicts=("vala-panel-appmenu-registrar-git")
-depends=('glib2')
url="https://gitlab.com/vala-panel-project/vala-panel-appmenu"
+license=('LGPL-3.0-or-later')
arch=('i686' 'x86_64')
-license=('LGPL3')
-source=("git+https://gitlab.com/vala-panel-project/${_pkgbase}.git#tag=${pkgver}")
-sha256sums=('SKIP')
+# main package
+_main_package() {
+ depends=(
+ 'glib2'
+
+ ## implicit
+ #gcc-libs
+ #glibc
+ )
+ makedepends=(
+ 'git'
+ 'meson'
+ )
+
+ if [ "${_build_git::1}" != "t" ] ; then
+ _main_stable
+ else
+ _main_git
+ fi
+}
+
+# stable package
+_main_stable() {
+ conflicts+=("$_pkgname-git")
+
+ _pkgsrc="$_name"
+ _path="subprojects/registrar"
+ source+=("$_pkgsrc"::"git+$url.git#tag=${pkgver%%.r*}")
+ sha256sums+=('SKIP')
+
+ prepare() {
+ : ${_pkgver:=${pkgver%%.r*}}
+ if [[ "${_autoupdate::1}" != "t" ]] ; then
+ return
+ fi
+
+ cd "$_pkgsrc"
+
+ local _tag=$(git tag | grep -Ev '^.*[A-Za-z]{2}.*$' | sort -V | tail -1)
+ _pkgver="${_tag:?}"
+ if [[ "${_pkgver:?}" != "${pkgver%%.r*}" ]] ; then
+ git checkout -f "$_tag"
+ git describe --long --tags
+ fi
+ }
+
+ pkgver() {
+ echo "${_pkgver:?}"
+ }
+}
+
+# git package
+_main_git() {
+ provides+=("$_pkgname=${pkgver%%.r*}")
+ conflicts+=("$_pkgname")
+
+ _pkgsrc="$_name"
+ _path="subprojects/registrar"
+ source+=("$_pkgsrc"::"git+$url.git")
+ sha256sums+=('SKIP')
+
+ pkgver() {
+ cd "$_pkgsrc"
+
+ git describe --long --tags --abbrev=8 --exclude='*[a-zA-Z][a-zA-Z]*' \
+ | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
+ }
+}
+
+# common functions
build() {
- meson build "${srcdir}/${_pkgbase}/${_path}" --prefix=/usr --libexecdir=lib
- meson compile -C build
+ arch-meson "$_pkgsrc/$_path" build
+ meson compile -C build
}
package() {
- DESTDIR="$pkgdir" meson install -C build --no-rebuild
+ meson install -C build --destdir "$pkgdir"
}
+
+# execute
+_main_package