PKGBUILD 8.4 KB

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