archrelease: copy trunk to community-any
[ArchLinux/community.git] / yaml-cpp / trunk / PKGBUILD
blobcacc44e05a1cfa299af8fd01ae3648749b717231
1 # Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
2 # Contributor: David Runge <dvzrv@archlinux.org>
3 # Contributor: Markus Martin <markus@archwyrm.net>
5 pkgname=yaml-cpp
6 pkgver=0.7.0
7 pkgrel=2
8 pkgdesc="YAML parser and emitter in C++, written around the YAML 1.2 spec"
9 url="https://github.com/jbeder/yaml-cpp"
10 arch=('x86_64')
11 license=('MIT')
12 depends=('gcc-libs' 'glibc')
13 provides=('libyaml-cpp.so')
14 makedepends=('cmake' 'ninja')
15 source=("https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${pkgver}.tar.gz"
16         https://patch-diff.githubusercontent.com/raw/jbeder/yaml-cpp/pull/1037.patch)
17 sha512sums=('2de0f0ec8f003cd3c498d571cda7a796bf220517bad2dc02cba70c522dddde398f33cf1ad20da251adaacb2a07b77844111f297e99d45a7c46ebc01706bbafb5'
18             'c20d5e9393496052c3326d78555345b83a2345831d4cbfec8cf50f9576f2731ddc456148815b23dba3765b61a1a69b0c05c9618f91751dad124dbe8f7ca19609')
20 prepare() {
21   cd "${pkgname}-${pkgname}-${pkgver}"
22   patch -Np1 -i "${srcdir}"/1037.patch
25 build() {
26   cd "${pkgname}-${pkgname}-${pkgver}"
27   cmake -GNinja \
28         -Bbuild \
29         -DCMAKE_INSTALL_PREFIX=/usr \
30         -DBUILD_SHARED_LIBS=ON \
31         -DYAML_BUILD_SHARED_LIBS=ON \
32         -DCMAKE_BUILD_TYPE=Release
33   ninja -C build
36 check() {
37   cd "${pkgname}-${pkgname}-${pkgver}"
38   ninja -C build test
39   build/test/yaml-cpp-tests
42 package() {
43   cd "${pkgname}-${pkgname}-${pkgver}"
44   DESTDIR="$pkgdir" ninja -C build install
45   install -vDm 644 {CONTRIBUTING,README}.md -t "$pkgdir/usr/share/doc/$pkgname"
46   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
47   rm -rf "${pkgdir}"/usr/{lib,lib/pkgconfig,include}/*{gtest,gmock}*
48   rm -rf "${pkgdir}"/usr/lib/cmake/GTest