PKGBUILD 4.8 KB

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