summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef2a4f0c2067385011f4780a0287d8def2158372 (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
pkgname=mingw-w64-gettext
pkgver=0.22.5
pkgrel=1
arch=('any')
pkgdesc='GNU internationalization library (mingw-w64)'
depends=('mingw-w64-termcap' 'mingw-w64-libunistring')
makedepends=('gettext' 'mingw-w64-configure')
options=(!strip !buildflags staticlibs)
license=('GPL-2.0-only' 'LGPL-2.0-only' 'GFDL-1.2-only' 'GPL-2.0-or-later')
url="http://www.gnu.org/software/gettext/"
source=(http://ftp.gnu.org/pub/gnu/gettext/gettext-${pkgver}.tar.gz{,.sig}
        intl.pc)
sha256sums=('ec1705b1e969b83a9f073144ec806151db88127f5e40fe5a94cb6c8fa48996a0'
            'SKIP'
            '0dc8a3e2c95d79aacaeaacd3c90e41c0f5d6ba9cfbc949a0ca55f4b0fd389d9c')
validpgpkeys=('462225C3B46F34879FC8496CD605848ED7E69871'  # Daiki Ueno
              '68D94D8AAEEAD48AE7DC5B904F494A942E4616C2'
              '9001B85AF9E1B83DF1BDA942F5BE8B267C6A406D') # Bruno Haible (Open Source Development)

_architectures='i686-w64-mingw32 x86_64-w64-mingw32'

prepare() {
  cd gettext-$pkgver
}

build() {
  cd gettext-${pkgver}
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    export CFLAGS=-fpermissive CXXFLAGS=-fpermissive
    export MINGW_LDFLAGS="-Wl,--enable-auto-import"
    LIBS="-lssp" ${_arch}-configure \
      --disable-java \
      --disable-native-java \
      --disable-csharp \
      --enable-threads=win32 \
      --without-emacs ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/${pkgname#mingw-w64-}-$pkgver/build-${_arch}"
    make DESTDIR="$pkgdir" install
    rm "$pkgdir/usr/${_arch}/bin/"{autopoint,gettext.sh,gettextize}
    rm -r "$pkgdir/usr/${_arch}/lib/gettext"
    rm -r "$pkgdir/usr/${_arch}/share"
    rm "$pkgdir"/usr/${_arch}/bin/*.exe
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
    # provide pkgconfig file for iconv library
    install -dm755 "$pkgdir/usr/${_arch}/lib/pkgconfig"
    install -m644 "$srcdir/intl.pc" "$pkgdir/usr/${_arch}/lib/pkgconfig"
    sed -i "$pkgdir/usr/${_arch}/lib/pkgconfig/intl.pc" \
      -e "s|@PREFIX[@]|/usr/${_arch}|g" \
      -e "s|@VERSION[@]|$pkgver|g"
  done
}