community/tinyxml2: improve abuild

This commit is contained in:
prspkt 2018-04-23 15:45:47 +00:00 committed by Natanael Copa
parent 046e47a7f5
commit b11714826b

View File

@ -3,32 +3,37 @@
pkgname=tinyxml2 pkgname=tinyxml2
pkgver=6.2.0 pkgver=6.2.0
pkgrel=0 pkgrel=0
pkgdesc="A simple, small, efficient, C++ XML parser" pkgdesc="Simple, small and efficient C++ XML parser"
url="http://www.grinninglizard.com/tinyxml2/" url="http://www.grinninglizard.com/tinyxml2"
arch="all" arch="all"
license="zlib" license="zlib"
makedepends="cmake" makedepends="cmake"
subpackages="$pkgname-dev" subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/leethomason/$pkgname/archive/$pkgver.tar.gz" source="$pkgname-$pkgver.tar.gz::https://github.com/leethomason/tinyxml2/archive/$pkgver.tar.gz"
builddir="$srcdir/"$pkgname-$pkgver
build() { build() {
cd "$builddir" cd "$builddir"
mkdir -p build && cd build if [ "$CBUILD" != "$CHOST" ]; then
cmake .. \ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
${CMAKE_CROSSOPTS}
make make
} }
check() { check() {
cd "$builddir"/build cd "$builddir"
make test make test
} }
package() { package() {
cd "$builddir"/build cd "$builddir"
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
} }