💾 Archived View for skyjake.fi › lagrange › compiling.gmi captured on 2021-11-30 at 19:37:34. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2020-11-07)

➡️ Next capture (2024-06-20)

🚧 View Differences

-=-=-=-=-=-=-

How to compile

This page explains how to build Lagrange in a POSIX-compatible environment. The required tools are a C11 compiler (e.g., Clang or GCC), CMake and pkg-config.

See platform-specific notes below for additional requirements.

Compiling via CLI

Step 1

Download and extract a source tarball. Please note that the GitHub/Gitea-generated tarballs do not contain the “the_Foundation” submodule; check which tarball you are getting. Alternatively, you may also clone the repository and its submodules:

git clone --recursive --branch release \
  https://git.skyjake.fi/gemini/lagrange

Step 2

Check that you have the dependencies installed: SDL2, OpenSSL, libpcre, zlib, libunistring, GNU FriBidi. For example, on macOS this would do the trick (using Homebrew):

brew install cmake sdl2 openssl@1.1 pcre libunistring fribidi

Or on Ubuntu:

sudo apt install cmake libsdl2-dev libssl-dev libpcre3-dev \
  zlib1g-dev libunistring-dev libfribidi-dev

Step 3

Optionally, install the mpg123 decoder library for MPEG audio support. For example, the macOS Homebrew package is "mpg123" and on Ubuntu it is "libmpg123-dev".

Step 4

Create a build directory.

Step 5

In your empty build directory, run CMake:

cmake {path_of_lagrange_sources}

Step 6

Build it:

cmake --build .

Step 7

Now you can run "lagrange", "lagrange.exe", or "Lagrange.app".

Installing to a directory

To install to "/dest/path":

cmake {path_of_lagrange_sources} -DCMAKE_INSTALL_PREFIX=/dest/path
cmake --build . --target install

This will also install an XDG .desktop file for launching the app.

Compiling on macOS

When compiling on macOS there are a couple of things to note: Homebrew's OpenSSL needs to be manually added to pkg-config's search path, and SDL requires a small patch to enable smooth trackpad momentum scrolling to work as expected.

See more information about macOS build config

Compiling on Windows

Windows builds require MSYS2. Cygwin should also work, although hasn't been tested.

See more information about compiling on Windows

Compiling on Raspberry Pi 2/3

You should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console.

When running under X11, software rendering is the best choice and in that case the SDL from Raspbian etc. is sufficient.

The following build options are recommended on Raspberry Pi:

UI translations

UI translations are managed via Weblate in .po format.

Weblate has a separate working copy of the Lagrange repository. New and updated .po files have to be manually merged to the main repository.

At runtime, the app does not directly use the .po files. The Python script "compile.py" (under "po/") must be run to convert the strings into a format that gets loaded at runtime. After running "compile.py", the strings are stored in "res/lang/". When you run CMake, these will be combined with all other resources into the "resources.lgr" file.

Summarizing, the steps to update UI translations are:

Back to Lagrange