PKGBUILD 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Maintainer: bill-auger <bill-auger@programmer.net>
  2. # Contributor: Felix Yan <felixonmars@archlinux.org>
  3. # Contributor: Eli Schwartz <eschwartz@archlinux.org>
  4. # parabola changes and rationale:
  5. # - no libre changes
  6. # - in libre because it is a dependency of 'parabola-laf'
  7. pkgname=(qt5-styleplugins)
  8. pkgver=5.0.0.20170311
  9. _commit=335dbece103e2cbf6c7cf819ab6672c2956b17b3 # unreleased master branch tip
  10. pkgdesc='Additional style plugins for Qt5'
  11. pkgrel=32
  12. arch=(armv7h i686 x86_64)
  13. url="https://github.com/qt/qtstyleplugins"
  14. license=('LGPL')
  15. depends=('qt5-base' 'gtk2')
  16. source=(
  17. "${pkgname}-${_commit}.tar.gz::${url}/archive/${_commit}.tar.gz"
  18. "0001-fix-build-against-Qt-5.15.patch"
  19. "0002-fix-gtk2-background.patch"
  20. )
  21. sha512sums=(
  22. 'e8c2d0e9c6b0a47cab04ffd2e9384606638905b63a7c1580f9b629bbcc84ebff19743363ffee3dbd31c3de1dcda684211ad3052932b5aa0081e529afd9cbb14d'
  23. 'f5cedadceb7c4243ba69b5041c6c524223ce742ec9c2c483e706f31e32e9e03e4efb6ed54fa2aada867a7c0145a8f3ec1193377d177c6c77066b5f3ec191e9ce'
  24. 'c39b468c93eaada7d49df9547627fbf91d50292523566ef93287ce0e958b29e6c3635f6e77ad42c4f449a062cc63b68e9f2a24c89524165649f776d205fb5382'
  25. )
  26. _version_constraint() # (dep_pkgname [precision])
  27. {
  28. local dep_pkgname=$1
  29. local req_precision=$2
  30. local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1)
  31. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  32. local def_precision=$(( n_dots + 1 ))
  33. local is_reqprecision_valid=$( [[ "${req_precision}" =~ ^[1-${def_precision}]$ ]] && echo 1 || echo 0 )
  34. local precision=$( (( is_reqprecision_valid )) && echo ${req_precision} || echo ${def_precision} )
  35. local pkgver_rx='[^-\.\ ]+'
  36. local subver_rx='\.'${pkgver_rx}
  37. local pkgrel_rx='[^-\ ]+'
  38. local capture_rx=${pkgver_rx}
  39. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  40. if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx})$ ]]
  41. then local version=${BASH_REMATCH[1]}
  42. local pkgrel=${BASH_REMATCH[3]%%.*}
  43. local subver_inc=$(( ${version##*.} + 1 ))
  44. local pkgrel_inc=$(( pkgrel + 1 ))
  45. local version_min=$( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel} || \
  46. echo ${version} )
  47. local version_max=$( ( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  48. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  49. echo ${subver_inc} )
  50. local constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  51. echo "applied version constraint: '${constraint_string}'" >&2
  52. echo -n "${constraint_string}"
  53. else echo "ERROR: _version_constraint() error parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'" >&2
  54. exit 1
  55. fi
  56. }
  57. prepare() {
  58. cd qtstyleplugins-${_commit}
  59. for p in "$srcdir"/*.patch; do
  60. patch -p1 < "$p"
  61. done
  62. }
  63. build() {
  64. cd qtstyleplugins-${_commit}
  65. qmake PREFIX='/usr' \
  66. CONFIG+='nostrip' \
  67. QMAKE_CFLAGS_RELEASE="$CFLAGS" \
  68. QMAKE_CXXFLAGS_RELEASE="$CXXFLAGS"
  69. make
  70. }
  71. package() {
  72. cd qtstyleplugins-${_commit}
  73. make INSTALL_ROOT="${pkgdir}" install
  74. # pin to current 'qt5-base' libs
  75. local qt5_ver=$(pacman -S --print-format='%v' )
  76. depends=( ${depends[@]/qt5-base/} )
  77. depends+=($(_version_constraint 'qt5-base' 3))
  78. }