desktop/tinyxml/PKGBUILD
2018-01-31 00:22:54 +01:00

54 lines
1.5 KiB
Bash

pkgname=tinyxml
pkgver=2.6.2
pkgrel=2
pkgdesc="A simple, small, C++ XML parser that can be easily integrated into other programs"
url='http://www.grinninglizard.com/tinyxml/'
arch=('x86_64')
license=('zlib')
makedepends=('setconf')
source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}_${pkgver//./_}.tar.gz"
'entity.patch'
'tinyxml-2.5.3-stl.patch'
"$pkgname.pc")
md5sums=('c1b864c96804a10526540c664ade67f0'
'b6cc2d9330707373d920f760793c6311'
'6db8334398e0cdad7e3c6406206ff42a'
'9c6788d9e2e8485ffbd7d8e0e8da940d')
prepare() {
cd "$pkgname"
# Fix entity encoding
patch -p0 -i "$srcdir/entity.patch"
# Make TINYXML_USE_STL permanently defined in tinyxml.h
patch -p1 -i "$srcdir/$pkgname-2.5.3-stl.patch"
# Fix Makefile
setconf Makefile TINYXML_USE_STL YES
setconf Makefile RELEASE_CFLAGS "$CXXFLAGS -fPIC"
}
build() {
cd "$pkgname"
make
g++ -fPIC "$CXXFLAGS" -shared -o "lib${pkgname}.so.0.$pkgver" \
-Wl,-soname,"lib${pkgname}.so.0" $(ls *.o | grep -v xmltest)
}
package() {
cd "$pkgname"
install -d -m 0755 "$pkgdir"/usr/{lib,include}
install -m 0755 "lib${pkgname}.so.0.$pkgver" "$pkgdir"/usr/lib/
install -m 0644 "$pkgname.h" tinystr.h "$pkgdir"/usr/include
install -Dm644 readme.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "$srcdir/$pkgname.pc" "$pkgdir/usr/lib/pkgconfig/$pkgname.pc"
cd "$pkgdir/usr/lib"
ln -s "lib${pkgname}.so.0.$pkgver" "lib${pkgname}.so.0"
ln -s "lib${pkgname}.so.0.$pkgver" "lib${pkgname}.so"
}