Skip to content

Commit 82822b2

Browse files
committed
Use newer emsdk with proper webview support, tune some options
1 parent b380565 commit 82822b2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Dockerfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# NOTE: python3-distutils should not be needed when emsdk > 1.39.13 is used,
2+
# so remove it when updating emsdk
13
FROM debian:buster
24
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/force-unsafe-io
35
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -23,19 +25,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2325
autoconf \
2426
m4 \
2527
gperf \
26-
wget && \
28+
wget \
29+
python3-distutils && \
2730
rm -rf /var/lib/apt/lists/*
2831

2932
RUN pip install ply
3033

3134
RUN git clone https://github.com/emscripten-core/emsdk.git && \
3235
cd emsdk && \
33-
./emsdk install 1.39.11 && \
34-
./emsdk activate 1.39.11
35-
36-
# Patch emscripten; needed until https://github.com/emscripten-core/emscripten/pull/10846 is merged and released
37-
RUN wget https://raw.githubusercontent.com/emscripten-core/emscripten/d68250f1e6059168bd1f791921445527c7548e29/src/preamble.js -O /emsdk/upstream/emscripten/src/preamble.js && \
38-
wget https://raw.githubusercontent.com/emscripten-core/emscripten/d68250f1e6059168bd1f791921445527c7548e29/src/URIUtils.js -O /emsdk/upstream/emscripten/src/URIUtils.js
36+
./emsdk install 1.39.13 && \
37+
./emsdk activate 1.39.13
3938

4039
ENV PATH=$PATH:/emsdk:/emsdk/upstream/emscripten:/emsdk/node/12.9.1_64bit/bin
4140
WORKDIR /code

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
BASE_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
55
DIST_DIR:=$(BASE_DIR)dist/libraries
66

7-
GLOBAL_CFLAGS:=-O3
7+
GLOBAL_CFLAGS:=-O3 -s ENVIRONMENT=web,webview -s DOUBLE_MODE=0
88

99
all: subtitleoctopus
1010

@@ -308,6 +308,8 @@ EMCC_COMMON_ARGS = \
308308
--preload-file assets/fonts.conf \
309309
-s ALLOW_MEMORY_GROWTH=1 \
310310
-s FORCE_FILESYSTEM=1 \
311+
-s ENVIRONMENT=web,webview \
312+
-s DOUBLE_MODE=0 \
311313
--llvm-lto 1 \
312314
--no-heap-copy \
313315
-o $@
@@ -335,6 +337,8 @@ dist/js/subtitles-octopus-worker-legacy.js: src/subtitles-octopus-worker.bc src/
335337
--post-js src/post-worker.js \
336338
-s WASM=0 \
337339
-s LEGACY_VM_SUPPORT=1 \
340+
-s MIN_CHROME_VERSION=27 \
341+
-s MIN_SAFARI_VERSION=60005 \
338342
$(EMCC_COMMON_ARGS)
339343

340344
dist/js/subtitles-octopus.js: src/subtitles-octopus.js

0 commit comments

Comments
 (0)