PKGBUILD 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Maintainer (arch): Evangelos Foutras <evangelos@foutrelis.com>
  2. # Contributor: Xavier Devlamynck <magicrhesus@ouranos.be>
  3. # Contributor: André Silva <emulatorman@hyperbola.info>
  4. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  5. # Contributor: bill-auger <bill-auger@programmer.net>
  6. # parabola changes and rationale
  7. # - rebranded "about" modal
  8. # - pin to strongly-coupled dependency versions
  9. pkgname=libxfce4ui
  10. pkgver=4.18.6
  11. pkgrel=1
  12. _pkgver_i686=4.18.6
  13. _pkgrel_i686=1.0
  14. eval "[[ -v _pkgver_${CARCH} ]] && pkgver=\$_pkgver_${CARCH}" # our different arches do not
  15. eval "[[ -v _pkgrel_${CARCH} ]] && pkgrel=\$_pkgrel_${CARCH}" # always roll at the same speed
  16. pkgrel+=.parabola2
  17. pkgdesc="Widgets library for the Xfce desktop environment"
  18. arch=('x86_64')
  19. arch+=('armv7h' 'i686')
  20. url="https://www.xfce.org/"
  21. license=('GPL2')
  22. depends=('libxfce4util' 'gtk3' 'xfconf' 'libsm' 'startup-notification'
  23. 'libgtop' 'libepoxy' 'hicolor-icon-theme')
  24. makedepends=('intltool' 'gobject-introspection' 'vala')
  25. source=(https://archive.xfce.org/src/xfce/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2)
  26. sha256sums=('77dd99206cc8c6c7f69c269c83c7ee6a037bca9d4a89b1a6d9765e5a09ce30cd')
  27. _sha256sum_i686='77dd99206cc8c6c7f69c269c83c7ee6a037bca9d4a89b1a6d9765e5a09ce30cd'
  28. eval "[[ -v _sha256sum_${CARCH} ]] && sha256sums[0]=\$_sha256sum_${CARCH}" # upstream source-ball
  29. _version_constraint() # (dep_pkgname [precision])
  30. {
  31. Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
  32. PkgVersion()
  33. {
  34. if [[ "${dep_pkgname}" =~ / ]]
  35. then pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1
  36. else pacman -Ss ^${dep_pkgname}$ | head -n 1 | cut -d ' ' -f 2
  37. fi
  38. }
  39. local dep_pkgname=$1
  40. declare -i req_precision=$2
  41. local full_version=$(PkgVersion)
  42. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  43. local def_precision=$(( n_dots + 1 ))
  44. local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
  45. local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
  46. local epoch_rx='[0-9]+:'
  47. local pkgver_rx='[0-9A-Za-z_]+'
  48. pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
  49. # but some pkgver have it (eg: 5.15.10+kde+r130)
  50. local subver_rx='\.'${pkgver_rx}
  51. local pkgrel_rx='[0-9]+'
  52. local garbage_rx='[^0-9].*'
  53. local capture_rx=${pkgver_rx}
  54. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  55. local epoch version pkgrel has_dot_char version_min version_max constraint_string
  56. declare -i subver subver_inc pkgrel_inc
  57. if [[ "${full_version}" =~ ^(${epoch_rx})*(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
  58. then epoch=${BASH_REMATCH[1]} # optional epoch
  59. version=${BASH_REMATCH[2]} # pkgver cut to the requested precision
  60. #unused=${BASH_REMATCH[3]} # discarded pkgver segments
  61. pkgrel=${BASH_REMATCH[4]} # pkgrel with non-numerics right-trimmed
  62. has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
  63. subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
  64. version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
  65. version=${epoch}${version}
  66. subver_inc=$(( subver + 1 ))
  67. pkgrel_inc=$(( pkgrel + 1 ))
  68. version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
  69. echo ${version} )
  70. version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  71. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  72. echo ${subver_inc} )
  73. constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  74. Log "Applied version constraint: '${constraint_string}'"
  75. else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
  76. exit 1
  77. fi
  78. unset -f Log
  79. echo -n "${constraint_string}"
  80. }
  81. build() {
  82. cd $pkgname-$pkgver
  83. ./configure \
  84. --prefix=/usr \
  85. --sysconfdir=/etc \
  86. --localstatedir=/var \
  87. --disable-debug \
  88. --with-vendor-info='Parabola GNU/Linux-libre'
  89. make
  90. }
  91. package() {
  92. # pin to current 'xfce4-session' (versions do not always align)
  93. depends+=( $(_version_constraint 'xfce4-session' 3) )
  94. cd $pkgname-$pkgver
  95. make DESTDIR="$pkgdir" install
  96. }