PKGBUILD 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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-72
  90. pkgver=72.1
  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=('custom:icu')
  98. depends=('gcc-libs' 'sh')
  99. depends+=("icu>${pkgver}")
  100. makedepends=('python')
  101. provides=(libicu{data,i18n,io,test,tu,uc}.so)
  102. conflicts=("icu<=${pkgver}" icu${pkgver%%.*})
  103. options=('debug')
  104. source=(https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-src.tgz{,.asc})
  105. source_armv7h=(icudata-stdlibs.patch)
  106. sha512sums=('848c341b37c0ff077e34a95d92c6200d5aaddd0ee5e06134101a74e04deb08256a5e817c8aefab020986abe810b7827dd7b2169a60dacd250c298870518dcae8'
  107. 'SKIP')
  108. sha512sums_armv7h=('8f13898c2b2d69ef516ee0831a73e5865676795716e7becac4457e208642bfdffb42f2a9280e99dcc10303ad721f5dc2e10ef83c633bd723044e98cc72c6bc7b')
  109. # checksums may be checked against upstream:
  110. # $ curl -Ls https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/SHASUM512.txt | grep '\-src.tgz'
  111. #validpgpkeys=('BA90283A60D67BA0DD910A893932080F4FB419E3') # "Steven R. Loomis (filfla-signing) <srloomis@us.ibm.com>"
  112. #validpgpkeys+=('9731166CD8E23A83BEE7C6D3ACA5DBE1FD8FABF1') # "Steven R. Loomis (ICU Project) <srl@icu-project.org>"
  113. #validpgpkeys+=('FFA9129A180D765B7A5BEA1C9B432B27D1BA20D7') # "Fredrik Roubert <fredrik@roubert.name>"
  114. #validpgpkeys+=('E4098B78AFC94394F3F49AA903996C7C83F12F11') # "keybase.io/srl295 <srl295@keybase.io>"
  115. #validpgpkeys+=('4569BBC09DA846FC91CBD21CE1BBA44593CF2AE0') # "Steven R. Loomis (codesign-qormi) <srloomis@us.ibm.com>"
  116. #validpgpkeys=('0E51E7F06EF719FBD072782A5F56E5AFA63CCD33') #"Craig Cornelius (For use with ICU releases) <ccornelius@google.com>"
  117. validpgpkeys=('3DA35301A7C330257B8755754058F67406EAA6AB') # Craig Cornelius <ccornelius@google.com>
  118. prepare() {
  119. ## arch-specific patching ##
  120. case "${CARCH}" in
  121. armv7h)
  122. # ../../bin/genrb: error while loading shared libraries: ../../lib/libicudata.so.70: internal error
  123. cd icu/source
  124. patch -p2 -i ${srcdir}/icudata-stdlibs.patch
  125. sed -r -i 's/(for ac_prog in )clang(\+\+)? /\1/g' configure
  126. ;;
  127. esac
  128. }
  129. build() {
  130. cd icu/source
  131. ./configure --prefix=/usr \
  132. --sysconfdir=/etc \
  133. --mandir=/usr/share/man \
  134. --sbindir=/usr/bin
  135. make
  136. }
  137. check() {
  138. # v71 - the 'iotest' test fails on armv7h
  139. # v72 - the 'intltest' test fails on armv7h and i686
  140. [[ "${CARCH}" == x86_64 ]] || return 0
  141. cd icu/source
  142. make -k check
  143. }
  144. package() {
  145. cd icu/source
  146. make -j1 DESTDIR="${pkgdir}" install
  147. # Install license
  148. install -Dm644 "${srcdir}"/icu/LICENSE "${pkgdir}"/usr/share/licenses/icu/LICENSE
  149. mv "${pkgdir}"/usr/share/licenses/{icu,${pkgname}}
  150. # to avoid conflicts against the preferred 'icu' package, we remove all files
  151. # except the actual shared libraries
  152. rm -r "${pkgdir}"/usr/{bin,include,lib/{icu,pkgconfig},share}
  153. rm "${pkgdir}"/usr/lib/*.so
  154. }