PKGBUILD 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Maintainer (arch): Andreas Radke <andyrtr@archlinux.org>
  2. # Contributor: Art Gramlich <art@gramlich-net.com>
  3. # Contributor: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  4. # Contributor: Eli Schwartz <eschwartz@archlinux.org>
  5. # Contributor: bill-auger <bill-auger@programmer.net>
  6. # Maintainer: Parabola Hackers <dev@lists.parabola.nu>
  7. # parabola changes and rationale:
  8. #
  9. # Several Parabola packages depends on 'icu', and the 'icu' "sonames" change
  10. # frequently. If we don't rebuild all of the Parabola packages which depend on
  11. # 'icu', as soon as the new ArchLinux, ArchLinux32, and ArchLinuxARM 'icu'
  12. # packages are synchronized into the Parabola repositories, we have a problem.
  13. # The repo server synchronizes with the upstream repos un-attended; so this is
  14. # a wonderful surprise each time; and we must hustle to get the system sane
  15. # again. We could watch the upstream testing and staging repos of each upstream,
  16. # and start re-building everything in a Parabola staging repo; but that could
  17. # result in discarded work, if those exact versions are not the ones which are
  18. # eventually released into the main repos.
  19. #
  20. # At first nothing was done to fix or workaround that issue. In practice, once
  21. # a new 'icu' was synchronized, many users were upgrading before the Parabola
  22. # packages had the time to be rebuilt. For such users, it broke all the
  23. # installed Parabola packages that were depending on the old 'icu'. This means
  24. # that users had to find a way to downgrade packages manually or wait until
  25. # the package maintainers would finally have rebuilt all of the broken packages.
  26. #
  27. # Then such packages were modified to make them depend on the exact version of
  28. # the 'icu' packages they were built against. This way, once the new 'icu'
  29. # package was synchronized, users could not upgrade if they had packages that
  30. # were not rebuilt yet against the new 'icu' package. However this workaround
  31. # also prevents installing packages that depends on the new 'icu'.
  32. #
  33. # The correct fix would be to automatically build/re-build all Packages instead
  34. # of relying on ArchLinux. Still, a new staging repo would be required to hold
  35. # the new packages, until they all can be released together sanely. However we
  36. # don't have the tooling to run an automatic builder for all packages yet, even
  37. # if there is work in this direction.
  38. #
  39. # In the meantime, this version of 'icu' exists for Parabola packages to link
  40. # against at runtime. In this way, Parabola packages can depend only on the
  41. # shared-object dependencies (aka: "sodeps", eg: libicu*.so) exposed by 'icu',
  42. # which is usually provided by the upstream distribution's 'icu'; but may be
  43. # this package, if the dependent package has yet to be rebuilt against the
  44. # upgraded 'icu'.
  45. #
  46. # It is inspired by the awkward hack of versioned library dependencies, commonly
  47. # used temporarily, for extraordinary cases (e.g. in ArchLinux32 and the AUR as
  48. # 'icu65', in ArchLinux as 'electronNN', etc). The awkwardness is superficial
  49. # though. This scales elegantly to Parabola's needs, without consuming
  50. # increasing resources, which is the best definition of "not awkward".
  51. #
  52. # 'icu-compat' will usually be one major version behind core/icu. Dependent
  53. # PKGBUILDs of 'icu' can simply add the following "sodep" dependency:
  54. #
  55. # depends=('libicui18n.so')
  56. #
  57. # or whichever libicu*.so.* linkage is reported by:
  58. #
  59. # $ readelf -d /path/to/compiled/ELF/file | grep libicu
  60. #
  61. # Then, each time the upstream distribution upgrades 'icu', upgrade this package
  62. # as well, ensuring that it is always at the immediately preceding upstream
  63. # version. If some dependent is not yet re-built when it's 'icu' sodep becomes
  64. # more than one version behind upstream, this PKGBUILD could be renamed/re-built
  65. # as 'icu-compat-NN'. Of course, it would still be better to rebuild the
  66. # dependent(s) instead; but sometimes (especially for i686) the dependent may
  67. # have other problems, preventing rebuild.
  68. #
  69. # Though pacman will pull in the appropriate package automatically as needed,
  70. # the general recommendation is for all Parabola users to keep this package
  71. # installed always, as a catch-all for any dependent lacking the appropriate
  72. # sodep.
  73. #
  74. # This works well for 'icu', even for packages which link to both the older and
  75. # newer versions of libicu*.so, since 'icu' uses versioned symbols as reported
  76. # by:
  77. #
  78. # $ nm -D --demangle --with-symbol-versions /path/to/library
  79. #
  80. # However, caution must be taken before implementing the same hack for other
  81. # libraries. Currently, 'icu' is the only one which changes so often, has so
  82. # many dependents, _and_ supports this hack robustly.
  83. # parabola changes and rationale:
  84. # - remove all files other than libicu*.so.*
  85. # - depend on icu; this is needed because if the package is installed on its
  86. # own, ldconfig will create un-tracked symlinks which were supposed to be
  87. # installed by the icu package.
  88. pkgname=icu-compat-70
  89. pkgver=70.1
  90. pkgrel=1
  91. pkgrel+=.parabola1
  92. pkgdesc="International Components for Unicode library"
  93. pkgdesc+=" (compatibility libraries for the previous release)"
  94. arch=(x86_64)
  95. arch+=(armv7h i686)
  96. url="https://icu.unicode.org"
  97. license=('custom:icu')
  98. depends=('gcc-libs' 'sh')
  99. depends+=("icu>${pkgver}")
  100. conflicts=("icu<=${pkgver}")
  101. makedepends=('python')
  102. provides=(libicu{data,i18n,io,test,tu,uc}.so)
  103. source=(https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-src.tgz{,.asc})
  104. source_armv7h=(icudata-stdlibs.patch)
  105. # https://github.com/unicode-org/icu/releases/download/release-70-1/SHASUM512.txt
  106. sha512sums=('0b26ae7207155cb65a8fdb25f7b2fa4431e74b12bccbed0884a17feaae3c96833d12451064dd152197fd6ea5fd3adfd95594284a463e66c82e0d860f645880c9'
  107. 'SKIP')
  108. sha512sums_armv7h=('8f13898c2b2d69ef516ee0831a73e5865676795716e7becac4457e208642bfdffb42f2a9280e99dcc10303ad721f5dc2e10ef83c633bd723044e98cc72c6bc7b')
  109. #validpgpkeys=('BA90283A60D67BA0DD910A893932080F4FB419E3') # "Steven R. Loomis (filfla-signing) <srloomis@us.ibm.com>"
  110. #validpgpkeys+=('9731166CD8E23A83BEE7C6D3ACA5DBE1FD8FABF1') # "Steven R. Loomis (ICU Project) <srl@icu-project.org>"
  111. #validpgpkeys+=('FFA9129A180D765B7A5BEA1C9B432B27D1BA20D7') # "Fredrik Roubert <fredrik@roubert.name>"
  112. #validpgpkeys+=('E4098B78AFC94394F3F49AA903996C7C83F12F11') # "keybase.io/srl295 <srl295@keybase.io>"
  113. #validpgpkeys+=('4569BBC09DA846FC91CBD21CE1BBA44593CF2AE0') # "Steven R. Loomis (codesign-qormi) <srloomis@us.ibm.com>"
  114. validpgpkeys=('0E51E7F06EF719FBD072782A5F56E5AFA63CCD33') #"Craig Cornelius (For use with ICU releases) <ccornelius@google.com>"
  115. prepare() {
  116. case "${CARCH}" in
  117. armv7h)
  118. # ../../bin/genrb: error while loading shared libraries: ../../lib/libicudata.so.70: internal error
  119. cd icu/source
  120. patch -p2 -i ${srcdir}/icudata-stdlibs.patch
  121. sed -r -i 's/(for ac_prog in )clang(\+\+)? /\1/g' configure
  122. ;;
  123. esac
  124. }
  125. build() {
  126. cd icu/source
  127. ./configure --prefix=/usr \
  128. --sysconfdir=/etc \
  129. --mandir=/usr/share/man \
  130. --sbindir=/usr/bin
  131. make
  132. }
  133. check() {
  134. # one of the 'iotest' tests fails on armv7h
  135. [[ "${CARCH}" != armv7h ]] || return 0
  136. cd icu/source
  137. make -k check
  138. }
  139. package() {
  140. cd icu/source
  141. make -j1 DESTDIR="${pkgdir}" install
  142. # Install license
  143. install -Dm644 "${srcdir}"/icu/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
  144. # to avoid conflicts against the preferred 'icu' package, we remove all files
  145. # except the actual shared libraries
  146. rm -r "${pkgdir}"/usr/{bin,include,lib/{icu,pkgconfig},share}
  147. rm "${pkgdir}"/usr/lib/*.so
  148. }