Commit 4b77b148 authored by Natanael Copa's avatar Natanael Copa

main/jsoncpp: claim maintainership and use --default-library both

meson supports --default-library both which will build and install both
shared and static libraries. This way we avoid build same sources twice.
parent 532db1ca
# Contributor:
# Maintainer:
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=jsoncpp
pkgver=1.8.4
pkgrel=1
......@@ -8,7 +7,7 @@ url="https://github.com/open-source-parsers/jsoncpp"
arch="all"
license="Public-Domain"
makedepends="meson"
subpackages="$pkgname-dev $pkgname-static"
subpackages="$pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/open-source-parsers/jsoncpp/archive/$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver
......@@ -16,27 +15,24 @@ build() {
cd "$builddir"
# we cannot use cmake since jsoncpp is a dependency for cmake which
# means we would get circular buildtime deps
meson --prefix /usr --libdir /usr/lib --buildtype release --default-library shared . build-shared
ninja -C build-shared
meson --prefix /usr --libdir /usr/lib --buildtype release --default-library static . build-static
ninja -C build-static
meson --prefix /usr --libdir /usr/lib --buildtype release --default-library both . build
ninja -C build
}
check() {
cd "$builddir"
ninja -C build-shared test
ninja -C build-static test
ninja -C build test
}
package() {
cd "$builddir"
DESTDIR="$pkgdir" ninja -C build-shared install
cp "$builddir"/build-static/libjsoncpp.a "$pkgdir"/usr/lib
DESTDIR="$pkgdir" ninja -C build install
}
static() {
pkgdesc="JsonCpp static library"
mkdir -p "$subpkgdir"/usr/lib
cp "$builddir"/build-static/libjsoncpp.a "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}
sha512sums="f70361a3263dd8b9441374a9a409462be1426c0d6587c865171a80448ab73b3f69de2b4d70d2f0c541764e1e6cccc727dd53178347901f625ec6fb54fb94f4f1 jsoncpp-1.8.4.tar.gz"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment