aboutsummaryrefslogblamecommitdiffstats
path: root/main/json-c/APKBUILD
blob: 8c857e8e2355be2c553cf7e4cea8558691180714 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                   
           
        



                                           

                                       
                                                                                



                      

         






                                                                                          
                                           
                                         

                                  
                         

 



                          
           
                                               

                                                    

 
                                                                                                                                                                 
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=json-c
pkgver=0.15
pkgrel=1
pkgdesc="A JSON implementation in C"
url="https://github.com/json-c/json-c/wiki"
arch="all"
license="MIT"
makedepends="cmake doxygen"
subpackages="$pkgname-dev $pkgname-doc"
source="https://s3.amazonaws.com/json-c_releases/releases/json-c-$pkgver.tar.gz"

# secfixes:
#   0.14-r1:
#     - CVE-2020-12762

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DBUILD_STATIC_LIBS=False \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	make -C build
	make -C build doc
}

check() {
	make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	mv doc/html "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="dc01298bcc78f0f31a34f5fcfe45c0feebfd88518e97fb4f96f1a652f71ccdd303415a4c7bf5b573bdcbcca80428281f0dfccefc6545ea3a7f18dbb819332f34  json-c-0.15.tar.gz"