summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c53fa144e543800cffb7cf600d5d61bad5b05a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Maintainer: pingplug < aur at pingplug dot me >
# Contributor: Schala Zeal < schalaalexiazeal at gmail dot com >
# Contributor: ant32 < antreimer at gmail dot com >
# Contributor: Alexey Pavlov < Alexpux at gmail dot com >
# Contributor: Ray Donnelly < mingw dot android at gmail dot com >

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgname=mingw-w64-icu
pkgver=76.1
pkgrel=2
pkgdesc="International Components for Unicode library (mingw-w64)"
arch=('any')
url="https://icu.unicode.org/"
license=('LicenseRef-Unicode-3.0'
         'BSD-2-Clause'
         'BSD-3-Clause')
depends=('mingw-w64-crt')
makedepends=('mingw-w64-configure' 'autoconf-archive')
options=('!strip' 'staticlibs' '!buildflags')
source=("https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-src.tgz"{,.asc}
        "0015-debug.mingw.patch"
        "0016-icu-pkgconfig.patch"
        "0021-mingw-static-libraries-without-s.patch")
sha256sums=('dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e'
            'SKIP'
            '0181f9ff8b7dd0a423869d8772da0a4feea64188347eb0dee7eb059aea92131c'
            '87ebe8962f8c387714f2a697a664a0c49aed2331b988548069d0c211abc36e05'
            'd8612f40b1731d9a94290afcf80c896184a2f15b8ae8f23b3643c64f6cabfa2f')
validpgpkeys=("FFA9129A180D765B7A5BEA1C9B432B27D1BA20D7"
              "3DA35301A7C330257B8755754058F67406EAA6AB"
              "0E51E7F06EF719FBD072782A5F56E5AFA63CCD33"
              "4569BBC09DA846FC91CBD21CE1BBA44593CF2AE0"
              "E52F07877A5805F9AF4AB0ACD46C5610D06E7001")

prepare() {
  cd icu
  patch -p1 -i ../0015-debug.mingw.patch
  patch -p1 -i ../0016-icu-pkgconfig.patch
  patch -p1 -i ../0021-mingw-static-libraries-without-s.patch

  cd source
  autoreconf -fi
}

build() {
  cd icu/source
  mkdir -p nativebuild && pushd nativebuild
  CC=gcc CXX=g++ ../configure --enable-static --disable-shared
  make
  popd
  for _arch in ${_architectures}; do
    mkdir build-${_arch} && pushd build-${_arch}
    # add flag to prevent `error: unable to find numeric literal operator ‘operator""Q’`
    [[ $pkgname =~ .*-clang-.* ]] || export CFLAGS=-fext-numeric-literals CXXFLAGS=-fext-numeric-literals
    ${_arch}-configure \
      --with-cross-build=${PWD}/../nativebuild \
      --with-data-packaging=library \
      --disable-rpath \
      --enable-release \
      --disable-tests \
      --disable-samples
    make
    popd
  done
}

package() {
  mkdir -p "${pkgdir}/usr/bin"
  for _arch in ${_architectures}; do
    cd "${srcdir}/icu/source/build-${_arch}"
    make install DESTDIR="${pkgdir}"
    find "${pkgdir}/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
    find "${pkgdir}/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
    find "${pkgdir}/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
    ln -s "/usr/${_arch}/bin/icu-config" "${pkgdir}/usr/bin/${_arch}-icu-config"
  done
}

# vim:set ts=2 sw=2 et: