summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 81fea0c694fe9e85f184d94ee27f2d82c2d11ead (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
pkgname=mingw-w64-libgnurx
pkgver=2.5.1
pkgrel=6
arch=(any)
pkgdesc="regex functionality from glibc (mingw-w64)"
depends=('mingw-w64-crt')
makedepends=('mingw-w64-configure')
provides=('mingw-w64-regex')
conflicts=('mingw-w64-regex')
options=('!buildflags' '!strip' 'staticlibs')
license=('GPL')
url="https://sourceforge.net/projects/mingw/"
source=("http://download.sourceforge.net/mingw/Other/UserContributed/regex/mingw-regex-${pkgver}/mingw-libgnurx-${pkgver}-src.tar.gz"
        "mingw-w64-libgnurx-honor-destdir.patch")
md5sums=('35c8fed3101ca1f253e9b6b1966661f6'
         '2d87c59177adf5ec13dbcc02acc4a450')

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

prepare()
{
  cd "$srcdir/mingw-libgnurx-${pkgver}"
  patch -Np0 -i ../mingw-w64-libgnurx-honor-destdir.patch
}

build()
{
  cd "$srcdir/mingw-libgnurx-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-configure
    make
    popd
  done
  
}

package()
{
  for _arch in ${_architectures}; do
    cd "$srcdir/mingw-libgnurx-${pkgver}/build-${_arch}"
    install -d "$pkgdir"/usr/${_arch}/include
    make install DESTDIR="$pkgdir"
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
    rm -r "$pkgdir"/usr/${_arch}/man
  done
}