summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2023-02-13 13:38:28 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2023-02-13 18:04:35 -0500
commitc7c29385fcafdbbd344e2d3fbb829183be5b96aa (patch)
tree854159eb508daa9c7e3aee1d35c8848393af466b
parentf2638f3a8c5d4c912ccc48c95be02955b459f034 (diff)
[libxfce4ui]: pin to current xfce4-session
-rw-r--r--libre/libxfce4ui/PKGBUILD41
1 files changed, 38 insertions, 3 deletions
diff --git a/libre/libxfce4ui/PKGBUILD b/libre/libxfce4ui/PKGBUILD
index dc69b7b21..d7523f9e3 100644
--- a/libre/libxfce4ui/PKGBUILD
+++ b/libre/libxfce4ui/PKGBUILD
@@ -12,7 +12,7 @@
pkgname=libxfce4ui
pkgver=4.18.2
pkgrel=1
-pkgrel+=.parabola2
+pkgrel+=.parabola3
pkgdesc="Widgets library for the Xfce desktop environment"
arch=('x86_64')
arch+=('armv7h' 'i686')
@@ -25,6 +25,41 @@ source=(https://archive.xfce.org/src/xfce/$pkgname/${pkgver%.*}/$pkgname-$pkgver
sha256sums=('ad602d0427e6c40c3eb53db393c607151a039aec58f1f197712c169c5fe49407')
+_version_constraint() # (dep_pkgname [precision])
+{
+ local dep_pkgname=$1
+ local req_precision=$2
+ local full_version=$(LANG=C pacman -Si ${dep_pkgname} | grep Version | cut -d ':' -f 2 | tr -d ' ')
+ local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
+ local def_precision=$(( n_dots + 1 ))
+ local is_reqprecision_valid=$( [[ "${req_precision}" =~ ^[1-${def_precision}]$ ]] && echo 1 || echo 0 )
+ local precision=$( (( is_reqprecision_valid )) && echo ${req_precision} || echo ${def_precision} )
+ local pkgver_rx='[^-\.\ ]+'
+ local subver_rx='\.'${pkgver_rx}
+ local pkgrel_rx='[^-\ ]+'
+ local capture_rx=${pkgver_rx}
+ for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
+
+ if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx})$ ]]
+ then local version=${BASH_REMATCH[1]}
+ local pkgrel=${BASH_REMATCH[3]%%.*}
+ local subver_inc=$(( ${version##*.} + 1 ))
+ local pkgrel_inc=$(( pkgrel + 1 ))
+ local version_min=$( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel} || \
+ echo ${version} )
+ local version_max=$( ( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
+ ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
+ echo ${subver_inc} )
+ local constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
+
+ echo "applied version constraint: '${constraint_string}'" >&2
+ echo -n "${constraint_string}"
+ else echo "ERROR: _version_constraint() error parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'" >&2
+ exit 1
+ fi
+}
+
+
build() {
cd $pkgname-$pkgver
@@ -38,8 +73,8 @@ build() {
}
package() {
- # pin to strongly-coupled dependency versions
- #depends+=( "xfce4-session=${pkgver}" )
+ # pin to current 'xfce4-session' (versions do not always align)
+ depends+=($(_version_constraint 'xfce4-session' 3))
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install