Skip to content

Commit 3dae2c8

Browse files
authored
Merge pull request #519 from MrAnno/image-threadsafe-json-c
docker: temporarily build and use thread-safe json-c library
2 parents f9fca58 + 5c6dfed commit 3dae2c8

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

docker/alpine.dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ RUN [ $DEBUG = false ] || patch -d axoflow/axosyslog -p1 -i APKBUILD-debug.patch
4747
RUN mkdir packages \
4848
&& abuild-keygen -n -a -i \
4949
&& printf 'export JOBS=$(nproc)\nexport MAKEFLAGS=-j$JOBS\n' >> .abuild/abuild.conf \
50+
&& cd axoflow/json-c && abuild -r && cd - \
5051
&& cd axoflow/axosyslog \
5152
&& if [ "$PKG_TYPE" = "snapshot" ]; then \
5253
tarball_filename="$(ls axosyslog-*.tar.*)"; \
@@ -81,6 +82,7 @@ RUN apk add --repository /tmp/axoflow -U --upgrade --no-cache \
8182
jemalloc \
8283
libdbi-drivers \
8384
tzdata \
85+
json-c \
8486
axosyslog \
8587
axosyslog-add-contextual-data \
8688
axosyslog-amqp \
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
2+
# Maintainer: László Várady <laszlo.varady@axoflow.com>
3+
pkgname=json-c
4+
pkgver=0.18
5+
pkgrel=99
6+
pkgdesc="A JSON implementation in C"
7+
url="https://github.com/json-c/json-c/wiki"
8+
arch="all"
9+
license="MIT"
10+
makedepends="cmake doxygen samurai"
11+
subpackages="$pkgname-dev $pkgname-doc"
12+
source="https://s3.amazonaws.com/json-c_releases/releases/json-c-$pkgver.tar.gz"
13+
14+
build() {
15+
if [ "$CBUILD" != "$CHOST" ]; then
16+
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
17+
fi
18+
cmake -B build -G Ninja \
19+
-DCMAKE_INSTALL_PREFIX=/usr \
20+
-DCMAKE_INSTALL_LIBDIR=lib \
21+
-DBUILD_SHARED_LIBS=ON \
22+
-DBUILD_STATIC_LIBS=ON \
23+
-DCMAKE_BUILD_TYPE=MinSizeRel \
24+
-DENABLE_THREADING=ON \
25+
$CMAKE_CROSSOPTS
26+
cmake --build build --target all doc
27+
}
28+
29+
check() {
30+
cmake --build build --target test
31+
}
32+
33+
package() {
34+
DESTDIR="$pkgdir" cmake --install build
35+
mkdir -p "$pkgdir"/usr/share/doc/$pkgname
36+
mv doc/html "$pkgdir"/usr/share/doc/$pkgname
37+
}
38+
39+
sha512sums="
40+
4763f2352414dac3599bc2183b4fa57dbfaac0ca24de890097bd7d0bdda93c91efa280f6566e949e6d94212ef39a63fc76c5f9d0c54ff3d04b13c859717dba5a json-c-0.18.tar.gz
41+
"

0 commit comments

Comments
 (0)