-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathDockerfile-build
50 lines (42 loc) · 1.31 KB
/
Dockerfile-build
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
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM alpine:3.14
ARG BUILD_PACKAGES="\
clang \
make \
cmake \
lld \
curl \
pkgconfig"
RUN apk add --no-cache ${BUILD_PACKAGES}
ARG LMS_BUILD_PACKAGES=" \
gcc \
g++ \
musl-dev \
boost-dev \
ffmpeg-dev \
libconfig-dev \
taglib-dev \
wt-dev \
gtest-dev"
COPY --from=xx / /
ARG TARGETPLATFORM
RUN xx-apk add --no-scripts --no-cache ${LMS_BUILD_PACKAGES}
ARG PREFIX="/tmp/install"
# STB
ARG STB_VERSION=b42009b3b9d4ca35bc703f5310eedc74f584be58
RUN \
DIR=/tmp/stb && mkdir -p ${DIR} && cd ${DIR} && \
curl -sLO https://github.com/nothings/stb/archive/${STB_VERSION}.tar.gz && \
tar -x --strip-components=1 -f ${STB_VERSION}.tar.gz && \
mkdir -p ${PREFIX}/include/stb && \
cp ./*.h ${PREFIX}/include/stb
# LMS
COPY . /tmp/lms/
ARG LMS_BUILD_TYPE="Release"
RUN \
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
xx-info is-cross && export BUILD_TESTS=OFF || export BUILD_TESTS=ON && \
PKG_CONFIG_PATH=/$(xx-info)/usr/lib/pkgconfig cmake /tmp/lms/ -DCMAKE_INCLUDE_PATH=${PREFIX}/include -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} $(xx-clang --print-cmake-defines) -DCMAKE_PREFIX_PATH=/$(xx-info)/usr/lib/cmake -DBUILD_TESTING=${BUILD_TESTS} && \
VERBOSE=1 make -j$(nproc) && \
xx-verify src/lms/lms && \
xx-info is-cross || make test