From 6142280fe5d4e26c6f907b08b1b84d74aa5a6492 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 9 Oct 2025 13:24:32 +0200 Subject: cJSON/1.7.18: Rely on DESTDIR Otherwise, the installation prefix would be /opt/spm/cjson-1.7.18 instead of /usr/local, which can cause issues for CMake projects relying on the .cmake files installed by cJSON on /usr/local/lib. --- cJSON/1.7.18/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cJSON') diff --git a/cJSON/1.7.18/Dockerfile b/cJSON/1.7.18/Dockerfile index 3c33760..f83aad4 100644 --- a/cJSON/1.7.18/Dockerfile +++ b/cJSON/1.7.18/Dockerfile @@ -1,5 +1,6 @@ FROM alpine as base -ARG PREFIX=/opt/spm/cjson-1.7.18 +ARG PREFIX=/usr/local +ARG DESTDIR=/opt/spm/cjson-1.7.18 RUN apk update && apk add \ git \ cmake \ @@ -10,10 +11,10 @@ RUN git clone --depth 1 -b v1.7.18 https://github.com/DaveGamble/cJSON WORKDIR /cJSON RUN cmake -B build \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_C_FLAGS="-ffunction-sections -fdata-sections" RUN cmake --build build/ --parallel $(nproc --all) -RUN cmake --install build/ +WORKDIR build +RUN make install DESTDIR=$DESTDIR FROM scratch -COPY --from=base /opt/spm/cjson-1.7.18 /opt/spm/cjson-1.7.18 +COPY --from=base /opt/spm/cjson-1.7.18/usr/local /opt/spm/cjson-1.7.18 -- cgit v1.2.3