PKGBUILD 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Maintainer (arch): Felix Yan <felixonmars@archlinux.org>
  2. # Maintainer (arch): Alexander F Rødseth <xyproto@archlinux.org>
  3. # Contributor: André Silva <emulatorman@hyperbola.info>
  4. # Contributor: SanskritFritz (gmail)
  5. # Contributor: Tobias T. <OldShatterhand at gmx-topmail dot de>
  6. # parabola changes and rationale:
  7. # - replace blacklisted 'qt5-webengine' back-end with 'qt5-webkit'
  8. # - pin to strongly-coupled dependency versions
  9. # - FIXME: freeze at this version? - bibletime v>=3 does not support webkit?
  10. pkgname=bibletime
  11. pkgver=2.11.2
  12. pkgrel=1
  13. pkgrel+=.parabola2
  14. pkgdesc='Bible study tool'
  15. pkgdesc+=', (webkit build)'
  16. arch=('x86_64')
  17. arch+=('i686' 'armv7h')
  18. url='http://www.bibletime.info/'
  19. license=('GPL2')
  20. depends=('sword' 'clucene' 'qt5-webengine' 'qt5-svg')
  21. depends=( ${depends[*]/qt5-webengine/qt5-webkit} )
  22. depends_i686=(icu69)
  23. makedepends=('cmake' 'qt5-tools')
  24. source=("$pkgname-$pkgver.tar.gz::https://github.com/bibletime/bibletime/archive/v$pkgver.tar.gz")
  25. source+=('webkit.patch')
  26. sha512sums=('951c72dea1e281c0403284b36d680452ffb9dec180097faec49bc8536ad9a9e3cb543060b9972beae415e94467dbff6edcc253a0fda217cbb17a94fce40ff553')
  27. sha512sums+=('6d64be9904729b9bdf7a0464af8ba9e230b400ee461aca6dc8c7060c8bdb870ad61494ae3cd6a2f32a7ef45605b88671350c83e6cf9406f334242c63139cdc0c')
  28. _version_constraint() # (dep_pkgname [precision])
  29. {
  30. Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
  31. local dep_pkgname=$1
  32. declare -i req_precision=$2
  33. local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1)
  34. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  35. local def_precision=$(( n_dots + 1 ))
  36. local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
  37. local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
  38. local pkgver_rx='[0-9A-Za-z_]+'
  39. pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
  40. # but some pkgver have it (eg: 5.15.10+kde+r130)
  41. local subver_rx='\.'${pkgver_rx}
  42. local pkgrel_rx='[0-9]+'
  43. local garbage_rx='[^0-9].*'
  44. local capture_rx=${pkgver_rx}
  45. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  46. local version pkgrel has_dot_char version_min version_max constraint_string
  47. declare -i subver subver_inc pkgrel_inc
  48. if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
  49. then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision
  50. #unused=${BASH_REMATCH[2]} # discarded pkgver segments
  51. pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed
  52. has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
  53. subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
  54. version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
  55. subver_inc=$(( subver + 1 ))
  56. pkgrel_inc=$(( pkgrel + 1 ))
  57. version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
  58. echo ${version} )
  59. version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  60. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  61. echo ${subver_inc} )
  62. constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  63. Log "Applied version constraint: '${constraint_string}'"
  64. else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
  65. exit 1
  66. fi
  67. unset -f Log
  68. echo -n "${constraint_string}"
  69. }
  70. prepare() {
  71. mkdir -p build
  72. cd bibletime-$pkgver
  73. echo "applying 'webkit.patch'"
  74. patch -p1 -i "${srcdir}"/webkit.patch
  75. }
  76. build() {
  77. cd build
  78. cmake ../bibletime-$pkgver \
  79. -DCMAKE_INSTALL_PREFIX=/usr \
  80. -DCMAKE_BUILD_TYPE=Release
  81. make
  82. }
  83. package() {
  84. # pin to strongly-coupled dependency versions
  85. depends=( ${depends[*]/sword/} $(_version_constraint sword 3) )
  86. make -C build DESTDIR="$pkgdir" install
  87. }