PKGBUILD 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Maintainer: bill-auger <bill-auger@programmer.net>
  2. pkgname=calamares
  3. pkgver=3.2.20
  4. pkgrel=parabola2
  5. pkgdesc="Distribution-independent installer framework - Parabola edition"
  6. arch=(i686 x86_64)
  7. url=https://calamares.io/
  8. license=(GPL)
  9. depends=(boost-libs ckbcomp dmidecode gptfdisk hwinfo icu kconfig kcoreaddons ki18n
  10. kparts kpmcore libpwquality polkit-qt5 python solid qt5-base qt5ct qt5-svg yaml-cpp)
  11. makedepends=(boost extra-cmake-modules git kservice kwindowsystem qt5-tools)
  12. depends+=(os-prober) # FIXME: qemu+calamares+os-prober was buggy last build - try again
  13. # conflicts=(os-prober) # FIXME: qemu+calamares+os-prober is still buggy
  14. source=(git+https://git.parabola.nu/${pkgname}.git#tag=v${pkgver}-${pkgrel%%.*})
  15. sha256sums=('SKIP')
  16. _version_constraint() # (dep_pkgname [precision])
  17. {
  18. Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
  19. local dep_pkgname=$1
  20. declare -i req_precision=$2
  21. local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1)
  22. local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
  23. local def_precision=$(( n_dots + 1 ))
  24. local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
  25. local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
  26. local pkgver_rx='[0-9A-Za-z_]+'
  27. pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
  28. # but some pkgver have it (eg: 5.15.10+kde+r130)
  29. local subver_rx='\.'${pkgver_rx}
  30. local pkgrel_rx='[0-9]+'
  31. local garbage_rx='[^0-9].*'
  32. local capture_rx=${pkgver_rx}
  33. for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
  34. local version pkgrel has_dot_char version_min version_max constraint_string
  35. declare -i subver subver_inc pkgrel_inc
  36. if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
  37. then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision
  38. #unused=${BASH_REMATCH[2]} # discarded pkgver segments
  39. pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed
  40. has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
  41. subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
  42. version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
  43. subver_inc=$(( subver + 1 ))
  44. pkgrel_inc=$(( pkgrel + 1 ))
  45. version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
  46. echo ${version} )
  47. version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
  48. ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
  49. echo ${subver_inc} )
  50. constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
  51. Log "Applied version constraint: '${constraint_string}'"
  52. else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
  53. exit 1
  54. fi
  55. unset -f Log
  56. echo -n "${constraint_string}"
  57. }
  58. prepare()
  59. {
  60. cd "${srcdir}"/${pkgname}/
  61. sed -i "s|_BUILD_DATE_|$(date +%Y.%m)|" src/branding/parabola/branding.desc
  62. }
  63. build()
  64. {
  65. mkdir -p "${srcdir}"/${pkgname}/build
  66. cd "${srcdir}"/${pkgname}/build
  67. cmake -DCMAKE_BUILD_TYPE=Release \
  68. -DCMAKE_INSTALL_PREFIX=/usr \
  69. -DCMAKE_INSTALL_LIBDIR=lib \
  70. -DSKIP_MODULES="contextualprocess dracut dracutlukscfg dummycpp dummyprocess \
  71. dummypython dummypythonqt fsresizer hostinfo initramfs \
  72. initramfscfg interactiveterminal license netinstall networkcfg \
  73. notesqml oemid openrcdmcryptcfg packages plasmalnf plymouthcfg \
  74. preservefiles rawfs removeuser shellprocess tracking unpackfs \
  75. webview" ..
  76. make
  77. }
  78. package()
  79. {
  80. # pin to strongly-coupled dependency versions
  81. depends=( ${depends[*]/boost-libs/} $(_version_constraint 'boost-libs') )
  82. depends=( ${depends[*]/icu/} $(_version_constraint 'icu' ) )
  83. depends=( ${depends[*]/kpmcore/} $(_version_constraint 'kpmcore' ) )
  84. depends=( ${depends[*]/qt5-base/} $(_version_constraint 'qt5-base' ) )
  85. cd "${srcdir}"/${pkgname}/build
  86. make DESTDIR=${pkgdir} install
  87. }