Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.
/ lok-wasm Public archive

LibreOffice Kit WASM builds

License

Notifications You must be signed in to change notification settings

chase/lok-wasm

Repository files navigation

LOK WASM

This is a public project that forks LibreOffice to provide functionality and fixes that don't fit in the upstream project.

It also provides a simple to setup environment for working on LOK as a WASM-based app. This was originally developed for Macro and released to the public on 18 Feb 2024.

All changes are open sourced under the Mozilla Public License 2.0.

This project is not a part of the official LibreOffice project, nor endorsed by the Document Foundation.

Prerequisites

macOS

Install OrbStack

Clone the repo and enter the dev environment:

git clone https://github.com/coparse-inc/lok-wasm
./in-docker

Linux with Podman

Clone the repo and enter the dev environment:

git clone https://github.com/coparse-inc/lok-wasm
./in-podman

Linux with Docker

Clone the repo and enter the dev environment:

git clone https://github.com/coparse-inc/lok-wasm
./in-docker

Ubuntu/Debian/Pop_OS!

apt-get install -y --no-install-recommends \
  git \
  build-essential \
  zip \
  nasm \
  python3 \
  python3-dev \
  autoconf \
  gperf \
  xsltproc \
  libxml2-utils \
  bison \
  flex \
  pkg-config \
  ccache \
  openssh-server \
  cmake \
  sudo \
  locales \
  libnss3

Setup the repo:

git clone https://github.com/coparse-inc/lok-wasm
./scripts/setup

Building

# Run configure for the initial build or any configuration changes
./scripts/configure dev
# if you're using VS Code or clangd in vim, run this
./scripts/clangd
# Run build for any code changes
./scripts/build

QA Env

Make a build first, then:

./scripts/launch-qa

Debugging

Make a debug build:

# Clean the existing build
(cd libreoffice-core/ && make clean)
# Run configure for debug
./scripts/configure debug
# Run build for any code changes
./scripts/build

If you're debugging the QA environment with ./scripts/launch-qa, the included LOK C++ debugging extension should be included.

Otherwise use Chrome with the C/C++ WASM debugging tools extension installed.

Use Ctrl/Cmd+P in the Dev Tools to quickly navigate to the .cxx file you need to debug.

You can add breakpoints as necessary in the Dev Tools, but conditional breakpoints still aren't supported.
If you need to add a conditional breakpoint, use an if statement with a log to set a break point on inside of your code:

if (myCondition == true) {
    SAL_WARN("debug", "here");
}

Expand the LOK logs to see the full stack trace, clicking on the .cxx file will jump to the source for the file.

Docs