summaryrefslogtreecommitdiff
path: root/system/json-c/APKBUILD
blob: e5c44cfe87ec8eb41e03635dd90a6d5570967955 (plain) (blame)
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: 
pkgname=json-c
pkgver=0.13.1
pkgrel=1
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
	fix-libdir.patch
	"

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 \
		--libdir=/lib \
		--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"/lib
	mv "$pkgdir"/lib/*.a "$subpkgdir"/lib/
}

sha512sums="e984db2a42b9c95b52c798b2e8dd1b79951a8dcba27370af30c43b9549fbb00008dbcf052a535c528209aaee38e6d1f760168b706905ae72f3e704ed20f8a1a1  json-c-0.13.1.tar.gz
939f2b02fe5beb5d85ebc3fd8463bee0cff6b7da98b48edb599e88dda7955b6ba65afc17f9e828025086a1b384aa99703be06b6613e405d9c48541cf52c380f0  fix-libdir.patch"