💾 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
⬅️ Previous capture (2020-11-07)
-=-=-=-=-=-=-
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.
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
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
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".
Create a build directory.
In your empty build directory, run CMake:
cmake {path_of_lagrange_sources}
Build it:
cmake --build .
Now you can run "lagrange", "lagrange.exe", or "Lagrange.app".
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.
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
Windows builds require MSYS2. Cygwin should also work, although hasn't been tested.
See more information about compiling on Windows
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 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: