aboutsummaryrefslogtreecommitdiffstats
path: root/main/json-c/APKBUILD
blob: a4f4e6a82b92f91d4cff77a8bbdce9f0944eb1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=json-c
pkgver=0.12.1
pkgrel=3
pkgdesc="A JSON implementation in C"
url="https://github.com/json-c/json-c/wiki"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev autoconf automake libtool"
install=""
subpackages="$pkgname-static $pkgname-dev"
source="https://s3.amazonaws.com/${pkgname}_releases/releases/$pkgname-${pkgver}.tar.gz
	"

builddir="$srcdir"/json-c-$pkgver
prepare() {
	cd "$builddir"
	default_prepare
	autoreconf -f -v -i
}

build() {
	cd "$builddir"
	export CFLAGS="${CFLAGS} -Wno-error=unused-but-set-variable"
	./configure --prefix=/usr \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-shared \
		ac_cv_func_malloc_0_nonnull=yes \
		ac_cv_func_realloc_0_nonnull=yes
	make -j1
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install
}

static() {
	pkgdesc="Static json-c library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}

md5sums="55f7853f7d8cf664554ce3fa71bf1c7d  json-c-0.12.1.tar.gz"
sha256sums="2a136451a7932d80b7d197b10441e26e39428d67b1443ec43bbba824705e1123  json-c-0.12.1.tar.gz"
sha512sums="038676a0ce815e5174161fbd4339524feadc294d517f732fb408ad6aa7c4906423451c13386107569d9f24746a1a101564ca511e92e8276c5bf5b8c022ca42ed  json-c-0.12.1.tar.gz"