forked from openscad/openscad-wasm
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.base
110 lines (84 loc) · 4.75 KB
/
Dockerfile.base
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
FROM emscripten/emsdk as boost
COPY boost .
RUN ./bootstrap.sh
RUN ./b2 toolset=emscripten cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++" release --disable-icu --with-regex --with-filesystem --with-system --with-program_options install link=static runtime-link=static --prefix=/emsdk/upstream/emscripten/cache/sysroot
FROM emscripten/emsdk as zlib
COPY zlib .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as libzip
COPY --from=zlib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY libzip .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as glib
COPY --from=zlib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY glib .
RUN apt-get update \
&& apt-get install -qqy \
build-essential \
prelink \
autoconf \
libtool \
texinfo \
pkgconf \
ninja-build \
python3-pip \
&& pip3 install git+https://github.com/kleisauke/meson@wasm-vips
RUN chmod +x build.sh; ./build.sh
FROM emscripten/emsdk as freetype
COPY --from=zlib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY freetype .
RUN emcmake cmake -B ../build . -DFT_REQUIRE_ZLIB=TRUE -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as libxml2
COPY libxml2 .
RUN emcmake cmake -B ../build . -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_ZLIB=OFF -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as fontconfig
RUN apt-get update && apt-get install pkg-config gperf automake libtool gettext autopoint -y
COPY --from=zlib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=freetype /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=libxml2 /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY fontconfig .
RUN FREETYPE_CFLAGS="-I/emsdk/upstream/emscripten/cache/sysroot/include/freetype2" FREETYPE_LIBS="-lfreetype -lz" emconfigure ./autogen.sh --host none --disable-docs --disable-shared --enable-static --sysconfdir=/ --localstatedir=/ --with-default-fonts=/fonts --enable-libxml2 --prefix=/emsdk/upstream/emscripten/cache/sysroot
RUN emmake make
RUN emmake make install
FROM emscripten/emsdk as harfbuzz
COPY --from=freetype /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY harfbuzz .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release -DHB_HAVE_FREETYPE=ON
RUN cd ../build && make && make install
FROM emscripten/emsdk as eigen
COPY eigen .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as cgal
COPY cgal .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as gmp
COPY gmp-6.1.2 .
RUN emconfigure ./configure --disable-assembly --host none --enable-cxx --prefix=/emsdk/upstream/emscripten/cache/sysroot
RUN make && make install
FROM emscripten/emsdk as mpfr
COPY --from=gmp /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY mpfr-4.1.0 .
RUN emconfigure ./configure --host none --with-gmp=/emsdk/upstream/emscripten/cache/sysroot --prefix=/emsdk/upstream/emscripten/cache/sysroot
RUN make && make install
FROM emscripten/emsdk as doubleconversion
COPY doubleconversion .
RUN emcmake cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
RUN cd ../build && make && make install
FROM emscripten/emsdk as openscad-base
RUN apt-get update && apt-get install pkg-config flex bison gettext python-is-python3 gpg -y
COPY --from=boost /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=gmp /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=mpfr /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=cgal /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=eigen /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=harfbuzz /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=fontconfig /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=glib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=libzip /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
COPY --from=doubleconversion /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot