[arch-commits] Commit in yaml-cpp/trunk (PKGBUILD)

Levente Polyak anthraxx at archlinux.org
Mon Feb 5 08:53:20 UTC 2018


    Date: Monday, February 5, 2018 @ 08:53:19
  Author: anthraxx
Revision: 289162

upgpkg: yaml-cpp 0.6.1-3 (fix conflicting files and enabled tests)

- enables tests
- quotes $pkgdir

Modified:
  yaml-cpp/trunk/PKGBUILD

----------+
 PKGBUILD |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-02-05 08:41:11 UTC (rev 289161)
+++ PKGBUILD	2018-02-05 08:53:19 UTC (rev 289162)
@@ -4,7 +4,7 @@
 
 pkgname=yaml-cpp
 pkgver=0.6.1
-pkgrel=2
+pkgrel=3
 pkgdesc="YAML parser and emitter in C++, written around the YAML 1.2 spec"
 url="https://github.com/jbeder/yaml-cpp"
 arch=('x86_64')
@@ -14,17 +14,30 @@
 source=(https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${pkgver}.tar.gz)
 sha512sums=('606482d1d38c6747e22604a24c119adb4b70287da7deadb94cc20d70df47122f1714ec9bfc8f566ecf075b94d48771df17430c50039cb984bdf1980f3b445791')
 
+prepare() {
+    mkdir -p yaml-cpp-yaml-cpp-$pkgver/build
+}
+
 build() {
-    cd yaml-cpp-yaml-cpp-$pkgver
-
-    cmake . -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF
+    cd yaml-cpp-yaml-cpp-$pkgver/build
+    cmake .. \
+        -DCMAKE_INSTALL_PREFIX=/usr \
+        -DBUILD_SHARED_LIBS=ON \
+        -DCMAKE_BUILD_TYPE=Release
     make
 }
 
+check() {
+    cd yaml-cpp-yaml-cpp-$pkgver/build
+    make test
+    test/run-tests
+}
+
 package() {
     cd yaml-cpp-yaml-cpp-$pkgver
 
-    make DESTDIR=$pkgdir install
-
-    install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
+    make -C build DESTDIR="$pkgdir" install
+    install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+    # avoid conflicting gtest/gmock files
+    rm -rf "$pkgdir"/usr/include/{gmock,gtest} "$pkgdir"/usr/lib/lib{gmock,gtest}*.so
 }



More information about the arch-commits mailing list