summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2a4cb05aaf13f34ea7ea7e0f1e850ae26a66dc0e (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
# Maintainer: Pavel Cadersky <aur-ahshaev8@mess.cz>

pkgname=mingw-w64-c-ares
pkgver=1.34.3
pkgrel=1
pkgdesc="C library that performs DNS requests and name resolves asynchronously (mingw-w64)"
arch=('any')
url="https://c-ares.haxx.se/"
license=('MIT')
makedepends=('mingw-w64-cmake')
depends=('mingw-w64-crt')
options=('!strip' '!buildflags' 'staticlibs')
source=("https://github.com/c-ares/c-ares/releases/download/v${pkgver}/c-ares-${pkgver}.tar.gz")
sha256sums=('26e1f7771da23e42a18fdf1e58912a396629e53a2ac71b130af93bbcfb90adbe')

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

build() {
  cd "${srcdir}/c-ares-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake -DCMAKE_SHARED_LIBRARY_NAME_WITH_VERSION=ON ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/c-ares-${pkgver}/build-${_arch}"
    make DESTDIR="${pkgdir}" install

    # remove documentation
    rm -rf "$pkgdir"/usr/${_arch}/share/man
    rmdir "$pkgdir"/usr/${_arch}/share

    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.exe
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
  done
}