summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fb1b1ea3364af94dca6e8fe642125d2a9683e80d (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
# Contributor: Filip Brcic <brcha@gna.org>
pkgname=mingw-w64-gettext
pkgver=0.19.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")
url="http://www.gnu.org/software/gettext/"
source=("http://ftp.gnu.org/pub/gnu/gettext/gettext-${pkgver}.tar.gz"{,.sig}
"00-relocatex-libintl-0.18.3.1.patch"
"05-always-use-libintl-vsnprintf.mingw.patch"
"06-dont-include-ctype-after-gnulibs-wctype.mingw.patch"
"07-fix-asprintf-conflict.mingw.patch"
"08-vs-compatible.patch")
md5sums=('0f3c108d64e8dcd9e6fbdff4ca722feb'
         'SKIP'
         '397d7d6d4abd15a70edb3c9f2bab4cd2'
         '27852a388b8cf38188dc392c244230ff'
         'f69747f43f279b8a81286cfe5916b82f'
         '3ebccf730ec3377b068027eb2283afb2'
         'f5b611172ae58f1e4589a8d0c1d53414')
validpgpkeys=('462225C3B46F34879FC8496CD605848ED7E69871') # Daiki Ueno

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

prepare() {
  cd gettext-$pkgver
  rm -f gettext-runtime/intl/canonicalize.c
  rm -f gettext-runtime/intl/relocatex.{h,c}
  rm -f MINGW-PATCHES/README-relocatex-libintl.txt
  patch -p1 -i ${srcdir}/00-relocatex-libintl-0.18.3.1.patch
  patch -p0 -i ${srcdir}/05-always-use-libintl-vsnprintf.mingw.patch
  patch -p0 -i ${srcdir}/06-dont-include-ctype-after-gnulibs-wctype.mingw.patch
  patch -p0 -i ${srcdir}/07-fix-asprintf-conflict.mingw.patch
  patch -p0 -i ${srcdir}/08-vs-compatible.patch
}

build() {
	cd gettext-${pkgver}
	unset LDFLAGS
	for _arch in ${_architectures}; do
		mkdir -p build-${_arch} && pushd build-${_arch}
		${_arch}-configure \
			--target=${_arch} \
			--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
		find "$pkgdir/usr/${_arch}" -name '*.exe' -exec rm {} \;
		find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
		find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
		rm "$pkgdir/usr/${_arch}/bin/"{autopoint,gettext.sh,gettextize}
		rm -r "$pkgdir/usr/${_arch}/lib/gettext"
		rm -r "$pkgdir/usr/${_arch}/share"
	done
}