PKGBUILD 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. local dep_pkgname=$1
  31. local req_precision=$2
  32. local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1)
  33. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  34. local def_precision=$(( n_dots + 1 ))
  35. local is_reqprecision_valid=$( [[ "${req_precision}" =~ ^[1-${def_precision}]$ ]] && echo 1 || echo 0 )
  36. local precision=$( (( is_reqprecision_valid )) && echo ${req_precision} || echo ${def_precision} )
  37. local pkgver_rx='[^-\.\ ]+'
  38. local subver_rx='\.'${pkgver_rx}
  39. local pkgrel_rx='[^-\ ]+'
  40. local capture_rx=${pkgver_rx}
  41. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  42. if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx})$ ]]
  43. then local version=${BASH_REMATCH[1]}
  44. local pkgrel=${BASH_REMATCH[3]%%.*}
  45. local subver_inc=$(( ${version##*.} + 1 )) # right-trims from any non-numeric
  46. local pkgrel_inc=$(( pkgrel + 1 ))
  47. local version_min=$( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel} || \
  48. echo ${version} )
  49. local version_max=$( ( (( ! is_reqprecision_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  50. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  51. echo ${subver_inc} )
  52. local constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  53. echo "applied version constraint: '${constraint_string}'" >&2
  54. else echo "ERROR: _version_constraint() error parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'" >&2
  55. exit 1
  56. fi
  57. echo -n "${constraint_string}"
  58. }
  59. prepare() {
  60. mkdir -p build
  61. cd bibletime-$pkgver
  62. echo "applying 'webkit.patch'"
  63. patch -p1 -i "${srcdir}"/webkit.patch
  64. }
  65. build() {
  66. cd build
  67. cmake ../bibletime-$pkgver \
  68. -DCMAKE_INSTALL_PREFIX=/usr \
  69. -DCMAKE_BUILD_TYPE=Release
  70. make
  71. }
  72. package() {
  73. make -C build DESTDIR="$pkgdir" install
  74. # pin to strongly-coupled dependency versions
  75. depends=( ${depends[*]/sword/$(_version_constraint sword 3)} )
  76. }