# @kreijstal/eurooffice

Euro-Office's document editors running entirely in the browser, with x2t as WebAssembly (part eurooffice of: @kreijstal/eurooffice @kreijstal/eurooffice-fonts-1 @kreijstal/eurooffice-fonts-2 @kreijstal/eurooffice-sdkjs-common @kreijstal/eurooffice-web-apps-1 @kreijstal/eurooffice-web-apps-2 )

Upstream: https://github.com/Euro-Office

## Use

Pinned to this version, from a CDN:

    https://cdn.jsdelivr.net/npm/@kreijstal/eurooffice@9.3.5-rc.1.build.1/<file>
    https://unpkg.com/@kreijstal/eurooffice@9.3.5-rc.1.build.1/<file>

## Reproducing this build

Not everything here is compiled by us: the editors (`sdkjs/`, `web-apps/`) are Euro-Office's own build, taken from its Document Server package; the site around them and the fonts are Ranuts/document's; x2t, the converter, is built from source with the system emscripten. The script that produced these files is included as `build/build-eurooffice.sh`.

### Toolchain

- emscripten: `emcc 6.0.9-git (4e4223852a0835923411059a3929907d7df1232e)` from the Arch Linux package `emscripten 6.0.9-1`
  (installed at /usr/lib/emscripten; LLVM `clang version 24.0.0git`, Binaryen `wasm-opt version 132 (version_132-49-gd03c25ea43)`)
- Node.js v22.23.2, CMake 4.4.3, Arch Linux
- No emsdk: the script puts /usr/lib/emscripten first on PATH and unsets EMSDK/EM_CONFIG,
  so every object (including emscripten's own libc/libc++) comes from that one emcc
- For the site: Node.js and pnpm (Ranuts/document's lockfile, `pnpm install --frozen-lockfile`)
- x2t is built by `build/build-x2t-eurooffice.sh`: CryptPad's Dockerfile run stage by stage in bubblewrap (`build/dockerfile-in-bwrap.py`), with the emscripten above in place of the emsdk it pins

### Sources

| Source | Pin |
|---|---|
| Euro-Office Document Server package (sdkjs, web-apps) | [`euro-office-documentserver_9.3.5-rc.1_amd64.deb`](https://github.com/euro-office/DocumentServer/releases/tag/v9.3.5-rc.1), sha256 `ab457f9923bb181afe62368a25f4f1c6318ac9a940cf7948d1c2d85074136ba7` |
| [Ranuts/document](https://github.com/Ranuts/document) (the site, x2t loader, fonts) | `1301bb8bdac9092c4eb88a6f2f4ff5080cec68bd` + `build/ranuts-document.patch` |
| x2t recipe: [cryptpad/onlyoffice-x2t-wasm](https://github.com/cryptpad/onlyoffice-x2t-wasm) (Euro-Office core with emscripten changes) | `95f775fd3c42fae9e9af66ca072d3da3763e6c76` |
| Spell-check dictionaries (not in these packages) | [ONLYOFFICE/dictionaries](https://github.com/ONLYOFFICE/dictionaries) `d3223bbb777883db66ac3cd249f71c6ebdc992c7` |

`sdkjs/common/wasm/x2t/x2t.wasm` is published uncompressed; the site asks for `x2t.wasm.br`, its brotli copy, which the server maps to it. The fonts are each under their own license (`LICENSES/core-fonts-*` in the font packages).

### Steps

Run `build/build-x2t-eurooffice.sh` (about an hour), then `build/build-eurooffice.sh` (it finds the patch and helpers next to itself). The site lands in `~/git/ranuts-document-eo/dist`; this package is the part of it listed under its prefix in goldenlayouteditor's `cdn-apps.js`. Compare against `SHA256SUMS`.

The comment at the top of the build script, verbatim:

    Builds the office editor the .docx/.pptx tabs load (served at /office): Euro-Office's
    editors (github.com/Euro-Office, a fork of OnlyOffice under plain AGPL-3.0) running
    entirely in the browser, in the shell of github.com/Ranuts/document (AGPL-3.0):
      1. Ranuts/document at a tested commit, with ranuts-document.patch (saves made in
         the editor go to the embedding page; the site works under any path);
      2. its OnlyOffice build swapped for Euro-Office's, from the Document Server
         package, by eurooffice-into-ranuts.py (which carries the serverless glue over);
      3. x2t, the converter, built from Euro-Office's core by build-x2t-eurooffice.sh.
    Output: $OFFICE_SRC/dist (default ~/git/ranuts-document-eo/dist)

### Checksums of the published files

In `SHA256SUMS` (`sha256sum -c SHA256SUMS`).

## Licenses

`AGPL-3.0-only`. The license texts of everything compiled in are in `LICENSES/`.
