Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 80890e6

Browse files
author
Chase
committed
macos-docker -> in-docker, add in-podman for Linux
1 parent dc4cf18 commit 80890e6

File tree

6 files changed

+69
-6
lines changed

6 files changed

+69
-6
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM emscripten/emsdk:3.1.73-arm64
1+
ARG ARCH=
2+
ARG VER=3.1.73
3+
FROM docker.io/emscripten/emsdk:${VER}${ARCH}
24

35
RUN apt update && apt-get install -y --no-install-recommends \
46
git \

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@ Clone the repo and enter the dev environment:
1616

1717
```bash
1818
git clone https://github.com/coparse-inc/lok-wasm
19-
./macos-docker
19+
./in-docker
20+
```
21+
22+
## Linux with Podman
23+
24+
Clone the repo and enter the dev environment:
25+
26+
```bash
27+
git clone https://github.com/coparse-inc/lok-wasm
28+
./in-podman
29+
```
30+
31+
## Linux with Docker
32+
33+
Clone the repo and enter the dev environment:
34+
35+
```bash
36+
git clone https://github.com/coparse-inc/lok-wasm
37+
./in-docker
2038
```
2139

2240
## Ubuntu/Debian/Pop_OS!

macos-docker renamed to in-docker

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/bin/sh
2-
docker build -q -t lok-wasm:3.1.73 .
2+
arch=$(uname -m)
3+
emsdk_version=3.1.73
4+
5+
if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
6+
docker build -t lok-wasm:$emsdk_version --build-arg ARCH=-arm64 --build-arg VER=$emsdk_version .
7+
else
8+
docker build -t lok-wasm:$emsdk_version --build-arg VER=$emsdk_version .
9+
fi
10+
mkdir -p .cache .npm
11+
312
exec docker run \
413
--rm \
514
-it \
@@ -12,5 +21,5 @@ exec docker run \
1221
-v $(pwd)/.npm:/.npm:rw \
1322
-u $(id -u):$(id -g) \
1423
-w / \
15-
lok-wasm:3.1.73 \
24+
lok-wasm:$emsdk_version \
1625
bash

in-podman

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
arch=$(uname -m)
3+
emsdk_version=3.1.73
4+
5+
if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
6+
podman build -t lok-wasm:$emsdk_version --build-arg ARCH=-arm64 --build-arg VER=$emsdk_version .
7+
else
8+
podman build -t lok-wasm:$emsdk_version --build-arg VER=$emsdk_version .
9+
fi
10+
mkdir -p .cache .npm
11+
12+
exec podman run \
13+
--rm \
14+
-it \
15+
--user 1000:100 \
16+
--userns=keep-id \
17+
-v $(pwd)/libreoffice-core:/home/emscripten/libreoffice-core:Z \
18+
-v $(pwd)/scripts:/home/emscripten/scripts:Z \
19+
-v $(pwd)/VERSION:/home/emscripten/VERSION:Z \
20+
-v $(pwd)/soffice_fccache.data:/home/emscripten/soffice_fccache.data:Z \
21+
-v $(pwd)/soffice_fccache.data.js.metadata:/home/emscripten/soffice_fccache.data.js.metadata:Z \
22+
-v $(pwd)/.cache:/home/emscripten/.cache:Z \
23+
-v $(pwd)/.npm:/home/emscripten/.npm:Z \
24+
-w /home/emscripten \
25+
lok-wasm:$emsdk_version \
26+
bash

scripts/build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ FCCAHCE_OUT="$BASE_DIR/libreoffice-core/instdir/program/$FCCACHE_FILE"
1010
QA_ENV_DIR="$BASE_DIR/qa-env"
1111

1212
# Add emscripten toolchain
13-
source "$BASE_DIR/emsdk/emsdk_env.sh"
13+
if [[ "$container" = "podman" ]]; then
14+
source "/emsdk/emsdk_env.sh"
15+
else
16+
source "$SCRIPT_DIR/../emsdk/emsdk_env.sh"
17+
fi
1418
cd "$BASE_DIR/libreoffice-core"
1519
echo "Building LOK"
1620
make || exit 1

scripts/configure

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE:-$0}")" &> /dev/null && pwd)
66

77
# Add emscripten toolchain
88
export EMSDK_QUIET=1
9-
source "$SCRIPT_DIR/../emsdk/emsdk_env.sh"
9+
if [[ "$container" = "podman" ]]; then
10+
source "/emsdk/emsdk_env.sh"
11+
else
12+
source "$SCRIPT_DIR/../emsdk/emsdk_env.sh"
13+
fi
1014
cd "$SCRIPT_DIR/../libreoffice-core"
1115

1216
# LOK requires GCC 12, which often isn't the default, check for gcc-12 and g++12 if necessary

0 commit comments

Comments
 (0)