summaryrefslogtreecommitdiff
path: root/slcl/0.4.0/Dockerfile
blob: 3977f72b20fe962dde907e92cfe4f175c7f6703f (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
FROM alpine as base
RUN apk update && apk add \
	git \
	cmake \
	make \
	gcc \
	pkgconf \
	musl-dev
COPY --from=zlib:1.3.1 /opt/spm/zlib-1.3.1/ /usr/local/
COPY --from=libcjson:1.7.18 /opt/spm/cjson-1.7.18/ /usr/local/
COPY --from=libsodium:1.0.20 /opt/spm/libsodium-1.0.20/ /usr/local/
COPY --from=libjpeg:9f /opt/spm/libjpeg-9f/ /usr/local/
COPY --from=libpng:1.6.50 /opt/spm/libpng-1.6.50/ /usr/local/
COPY --from=libimagemagick:6.9.13-30-jpeg-png /opt/spm/imagemagick-6.9.13-30-jpeg-png /usr/local/
ARG PREFIX=/opt/spm/slcl-0.4.0
RUN git clone --depth 1 -b v0.4.0 --recursive \
	https://gitea.privatedns.org/xavi/slcl
WORKDIR /slcl/patches
COPY 0001-thumbnail-CMakeLists.txt-Link-ImageMagick-dependenci.patch .
WORKDIR /slcl
RUN git apply patches/0001-thumbnail-CMakeLists.txt-Link-ImageMagick-dependenci.patch
RUN LDFLAGS='-static -Wl,--gc-sections' cmake -B build \
	-DCMAKE_BUILD_TYPE=Release \
	-DTHUMBNAIL=ON \
	-DCMAKE_INSTALL_PREFIX=$PREFIX
RUN cmake --build build -j$(nproc)
RUN cmake --install build
WORKDIR $PREFIX/bin
RUN strip slcl usergen thumbnail
FROM scratch
COPY --from=base /opt/spm/slcl-0.4.0/bin/slcl /opt/spm/slcl-0.4.0/bin/slcl
COPY --from=base /opt/spm/slcl-0.4.0/bin/usergen /opt/spm/slcl-0.4.0/bin/usergen
COPY --from=base /opt/spm/slcl-0.4.0/bin/thumbnail /opt/spm/slcl-0.4.0/bin/thumbnail