PKGBUILD 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Maintainer (aur): Eli Schwartz <eschwartz@archlinux.org>
  2. # Maintainer: bill-auger <bill-auger@programmer.net>
  3. # parabola changes and rationale:
  4. # - in libre because it is a dependency of 'parabola-laf'
  5. # - pin to strongly-coupled dependency versions
  6. # - do not install pacman hook (the version constraints handle that better)
  7. # NOTE: this version ($_commit) is the unreleased VCS tip from 2017 (the de-facto final release)
  8. # NOTE: for each qt5-base N.N.N release, build order:
  9. # (qt5-base-N.N.N) <- qt5-webkit <- qt5-styleplugins
  10. pkgname=qt5-styleplugins
  11. pkgver=5.0.0.20170311
  12. _commit=335dbece103e2cbf6c7cf819ab6672c2956b17b3
  13. pkgdesc='Additional style plugins for Qt5'
  14. pkgrel=49
  15. arch=('x86_64' 'aarch64')
  16. arch+=('armv7h' 'i686')
  17. url="https://github.com/qt/qtstyleplugins"
  18. license=('LGPL-2.1-only')
  19. depends=('qt5-base' 'gtk2')
  20. source=(
  21. "${pkgname}-${_commit}.tar.gz::${url}/archive/${_commit}.tar.gz"
  22. "0001-fix-build-against-Qt-5.15.patch"
  23. "0002-fix-gtk2-background.patch"
  24. "${pkgname}.hook"
  25. )
  26. sha512sums=('e8c2d0e9c6b0a47cab04ffd2e9384606638905b63a7c1580f9b629bbcc84ebff19743363ffee3dbd31c3de1dcda684211ad3052932b5aa0081e529afd9cbb14d'
  27. 'f5cedadceb7c4243ba69b5041c6c524223ce742ec9c2c483e706f31e32e9e03e4efb6ed54fa2aada867a7c0145a8f3ec1193377d177c6c77066b5f3ec191e9ce'
  28. 'c39b468c93eaada7d49df9547627fbf91d50292523566ef93287ce0e958b29e6c3635f6e77ad42c4f449a062cc63b68e9f2a24c89524165649f776d205fb5382'
  29. '5f976142d27eabacd1e1050bb39801d2e4cd68ec7459662e0352541d42d6a75740d3238b5120fb47641a125d6e3200f3a39c304497ac603457e3a97e641dabc2')
  30. _version_constraint() # (dep_pkgname [precision])
  31. {
  32. Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
  33. local dep_pkgname=$1
  34. declare -i req_precision=$2
  35. local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1)
  36. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  37. local def_precision=$(( n_dots + 1 ))
  38. local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
  39. local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
  40. local pkgver_rx='[0-9A-Za-z_]+'
  41. pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
  42. # but some pkgver have it (eg: 5.15.10+kde+r130)
  43. local subver_rx='\.'${pkgver_rx}
  44. local pkgrel_rx='[0-9]+'
  45. local garbage_rx='[^0-9].*'
  46. local capture_rx=${pkgver_rx}
  47. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  48. local version pkgrel has_dot_char version_min version_max constraint_string
  49. declare -i subver subver_inc pkgrel_inc
  50. if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
  51. then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision
  52. #unused=${BASH_REMATCH[2]} # discarded pkgver segments
  53. pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed
  54. has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
  55. subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
  56. version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
  57. subver_inc=$(( subver + 1 ))
  58. pkgrel_inc=$(( pkgrel + 1 ))
  59. version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
  60. echo ${version} )
  61. version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  62. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  63. echo ${subver_inc} )
  64. constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  65. Log "Applied version constraint: '${constraint_string}'"
  66. else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
  67. exit 1
  68. fi
  69. unset -f Log
  70. echo -n "${constraint_string}"
  71. }
  72. prepare() {
  73. cd qtstyleplugins-${_commit}
  74. for p in "$srcdir"/*.patch; do
  75. patch -p1 < "$p"
  76. done
  77. }
  78. build() {
  79. # NOTE: armv7h FTBS without specifying project file
  80. # Project ERROR: No module claims plugin type 'platformthemes'
  81. # Project ERROR: No module claims plugin type 'styles'
  82. local parabola_opts=( $(case "${CARCH}" in armv7h) echo qtstyleplugins.pro ;; esac) )
  83. cd qtstyleplugins-${_commit}
  84. qmake PREFIX='/usr' \
  85. CONFIG+='nostrip' \
  86. QMAKE_CFLAGS_RELEASE="$CFLAGS" \
  87. QMAKE_CXXFLAGS_RELEASE="$CXXFLAGS" ${parabola_opts[*]}
  88. make
  89. }
  90. package() {
  91. # pin to strongly-coupled dependency versions
  92. depends=( ${depends[*]/qt5-base/} $(_version_constraint qt5-base 3) )
  93. cd qtstyleplugins-${_commit}
  94. rm plugins/styles/libbb10styleplugin.so # bb10 is broken
  95. make INSTALL_ROOT="${pkgdir}" install
  96. # do not install AUR pacman hook (breakage warning)
  97. }