Skip to content

Commit

Permalink
Avoid using bundled Node from emsdk
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Oct 26, 2022
1 parent 7c2635d commit 265abc6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
FROM docker.io/emscripten/emsdk:3.1.24

# Enable detection of running in a container
ENV RUNNING_IN_CONTAINER=true
ENV RUNNING_IN_CONTAINER=true \
# Avoid using bundled Node from emsdk
PATH=$EMSDK:$EMSDK/upstream/emscripten:$EMSDK/upstream/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

RUN apt-get update \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -qqy \
build-essential \
autoconf \
build-essential \
libglib2.0-dev \
libtool \
nodejs \
pkgconf \
libglib2.0-dev \
# needed for Meson
ninja-build \
python3-pip \
&& pip3 install meson
&& pip3 install meson \
# Prefer the default system-installed version of Node.js
&& echo "NODE_JS = '$(which node)'" >> $EMSDK/.emscripten

ARG MESON_PATCH=https://github.com/kleisauke/wasm-vips/raw/master/build/patches/meson-emscripten.patch
RUN cd $(dirname `python3 -c "import mesonbuild as _; print(_.__path__[0])"`) \
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ echo "============================================="
echo "Environment"
echo "============================================="
emcc --version
node --version

cd $(dirname $(which emcc))

Expand Down
3 changes: 1 addition & 2 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ git pull
./emsdk activate tot

# Prefer the default system-installed version of Node.js
NODE=$(which node)
sed -i'.old' "/^NODE_JS/s/= .*/= '${NODE//\//\\/}'/" .emscripten
echo "NODE_JS = '$(which node)'" >> .emscripten

# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
Expand Down

0 comments on commit 265abc6

Please sign in to comment.