summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 224a790d49ba6a28c44585c431432c4ab51f2a3a (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
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>

_pkgname=pugixml
pkgname=mingw-w64-${_pkgname}
_majordotminor=1.14
pkgver=${_majordotminor}
pkgrel=2
pkgdesc='Light-weight, simple and fast XML parser for C++ with XPath support (mingw-w64)'
arch=('any')
url='http://pugixml.org/'
license=('MIT')
depends=('mingw-w64-crt')
makedepends=('mingw-w64-cmake')
options=('!buildflags' 'staticlibs' '!strip')
source=("http://github.com/zeux/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-${pkgver}.tar.gz")
sha256sums=('2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015')

_srcdir="${_pkgname}-${_majordotminor}"
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
_flags=( -Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE='-DNDEBUG' )

build() {
  for _arch in ${_architectures}; do
		${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" \
      -DPUGIXML_BUILD_TESTS=OFF -DPUGIXML_BUILD_SHARED_AND_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON
		cmake --build "build-${_arch}"
  done
}

#check() {
#	for _arch in ${_architectures}; do
#		${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" -DPUGIXML_BUILD_TESTS=ON
#		cmake --build "build-${_arch}"
#		cmake --build "build-${_arch}" --target test
#	done
#}

package() {
  for _arch in ${_architectures}; do
    DESTDIR="${pkgdir}" cmake --install "build-${_arch}"

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