Skip to content

Commit 918090a

Browse files
authored
Merge pull request #1 from t-paul/update-to-master-branch
Update to OpenSCAD master branch
2 parents 91354b7 + 7b171a9 commit 918090a

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

Dockerfile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,14 @@ RUN emconfigure ./configure CFLAGS="-s USE_PTHREADS=1" --host none --with-gmp=/e
9494
RUN make && make install
9595

9696

97+
FROM emscripten/emsdk as doubleconversion
98+
COPY doubleconversion .
99+
RUN emcmake cmake -E env CXXFLAGS="-s USE_PTHREADS=1" cmake -B ../build . -DCMAKE_BUILD_TYPE=Release
100+
RUN cd ../build && make && make install
101+
102+
97103
FROM emscripten/emsdk as openscad
98-
RUN apt-get update && apt-get install pkg-config flex bison -y
104+
RUN apt-get update && apt-get install pkg-config flex bison gettext python-is-python3 -y
99105
# Dependencies
100106
COPY --from=boost /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
101107
COPY --from=gmp /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
@@ -106,22 +112,30 @@ COPY --from=harfbuzz /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/em
106112
COPY --from=fontconfig /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
107113
COPY --from=glib /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
108114
COPY --from=libzip /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
115+
COPY --from=doubleconversion /emsdk/upstream/emscripten/cache/sysroot /emsdk/upstream/emscripten/cache/sysroot
109116
# End Dependencies
110117

111118
COPY openscad .
112-
RUN export PKG_CONFIG_PATH="/emsdk/upstream/emscripten/cache/sysroot/lib/pkgconfig"
113-
RUN emcmake cmake -B ../build . -DNULLGL=ON \
119+
RUN export PKG_CONFIG_PATH="/emsdk/upstream/emscripten/cache/sysroot/lib/pkgconfig" && \
120+
emcmake cmake -B ../build . \
121+
-DWASM=ON \
122+
-DSNAPSHOT=ON \
123+
-DEXPERIMENTAL=ON \
124+
-DENABLE_CAIRO=OFF \
125+
-DUSE_MIMALLOC=OFF \
126+
-DBoost_USE_STATIC_RUNTIME=ON \
127+
-DBoost_USE_STATIC_LIBS=ON \
114128
-DCMAKE_BUILD_TYPE=Release \
115129
-DHARFBUZZ_INCLUDE_DIRS=/emsdk/upstream/emscripten/cache/sysroot/include/harfbuzz \
116130
-DFONTCONFIG_INCLUDE_DIR=/emsdk/upstream/emscripten/cache/sysroot/include/fontconfig \
117131
-DFONTCONFIG_LIBRARIES=libfontconfig.a
118132

119133
# Hack to fix build includes
120-
RUN sed -e "s|-isystem /emsdk/upstream/emscripten/cache/sysroot/include||g" -i ../build/CMakeFiles/OpenSCAD.dir/includes_C.rsp
121-
RUN sed -e "s|-isystem /emsdk/upstream/emscripten/cache/sysroot/include||g" -i ../build/CMakeFiles/OpenSCAD.dir/includes_CXX.rsp
134+
RUN sed -e "s|-isystem /emsdk/upstream/emscripten/cache/sysroot/include[^/]||g" -i ../build/CMakeFiles/OpenSCAD.dir/includes_C.rsp
135+
RUN sed -e "s|-isystem /emsdk/upstream/emscripten/cache/sysroot/include[^/]||g" -i ../build/CMakeFiles/OpenSCAD.dir/includes_CXX.rsp
122136
RUN sed -e "s|-lfontconfig|/emsdk/upstream/emscripten/cache/sysroot/lib/libglib-2.0.a /emsdk/upstream/emscripten/cache/sysroot/lib/libzip.a /emsdk/upstream/emscripten/cache/sysroot/lib/libz.a /emsdk/upstream/emscripten/cache/sysroot/lib/libfontconfig.a|g" -i ../build/CMakeFiles/OpenSCAD.dir/linklibs.rsp
123137

124138
# Add emscripten flags here
125139
RUN sed -e "s|em++|em++ -s USE_PTHREADS=1 -s NO_DISABLE_EXCEPTION_CATCHING -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=['FS'] -s EXPORTED_RUNTIME_METHODS=callMain -s EXPORT_ES6=1 -s ENVIRONMENT=web,worker -s MODULARIZE=1 -s EXPORT_NAME=OpenSCAD -s EXIT_RUNTIME=1|g" -i ../build/CMakeFiles/OpenSCAD.dir/link.txt
126140

127-
RUN cd ../build && make -j12
141+
RUN cd ../build && make -j12 VERBOSE=1

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ libs: libs/cgal \
3737
libs/gmp-6.1.2 \
3838
libs/mpfr-4.1.0 \
3939
libs/zlib \
40-
libs/libxml2
40+
libs/libxml2 \
41+
libs/doubleconversion
4142

4243
SINGLE_BRANCH_MAIN=--branch main --single-branch
4344
SINGLE_BRANCH=--branch master --single-branch
@@ -80,10 +81,11 @@ libs/zlib:
8081
libs/libxml2:
8182
git clone https://gitlab.gnome.org/GNOME/libxml2.git ${SHALLOW} ${SINGLE_BRANCH} $@
8283

84+
libs/doubleconversion:
85+
git clone https://github.com/google/double-conversion ${SHALLOW} ${SINGLE_BRANCH} $@
86+
8387
libs/openscad:
8488
git clone --recurse https://github.com/openscad/openscad.git ${SINGLE_BRANCH} $@
85-
git -C $@ checkout f4d57fb3b2da39953c843c0372b5a0a8730b3189
86-
git -C $@ apply ../../patches/openscad-2019.patch
8789

8890
libs/boost:
8991
git clone --recurse https://github.com/boostorg/boost.git ${SHALLOW} ${SINGLE_BRANCH} $@

0 commit comments

Comments
 (0)