Files
lidm/docs/PACKAGERS.md
javalsai 4a1b868b8e docs: linter & packagers guide & chores (#64)
add prettier, move most markdown into `docs/` and add a packagers guide

---

* lint(md): add prettier

* docs(packagers): add a guide

* docs(correctness): Index -> ToC

* docs: link to package maintainers guide

* docs: move install docs to `./docs`

* docs(fix): typo
2025-07-16 18:13:12 +02:00

3.3 KiB

This is a guide listing all possible options packagers have to tweak behavior of lidm and the extra stuff to package.

Components

If you want to package lidm for a distribution you have to package the binary and:

Preprocessor Defines

Most of the behavior that can be tweaked using preprocessor #defines, to include some simply add CPPFLAGS+='-D{{name}}={{value}}' to your make command. e.g:

make \
    CPPFLAGS+='-DSESSIONS_XSESSIONS=\"/var/empty\"' \
    CPPFLAGS+='-DSESSIONS_WAYLAND=\"/var/empty\"'

The list of possible #defines is:

Name Default Description Env Override?
PAM_SERVICE_FALLBACK "login" Name of the default PAM module to use. Defaults to the distro's "login". Yes (LIDM_PAM_SERVICE)
SESSIONS_XSESSIONS "/usr/share/xsessions" No
SESSIONS_WAYLAND "/usr/share/wayland-sessions" No
LIDM_CONF_PATH "/etc/lidm.ini" Path of the default configuration. Yes (LIDM_CONF)

Other Build Settings

Compiler

Lidm attempts to support being built by gcc and clang with preference over the first. However, if you wish to take advantage of LLVM's optimizations over GNU's you can change the compiler with make CC=clang or try any other compiler.

Compiler Flags

Compiler flags should be passed with CFLAGS, its -O3 -Wall by default so adding anything will overwrite this.

Target Directory

DESTDIR can be used to for installation recipes to install on alternative root directories. Along with PREFIX (defaults to /usr) for systems which don't use the common /usr structure. e.g. make install DESTDIR=$out PREFIX=

$ fd -t f . --base-directory $out
bin/lidm
etc/lidm.ini
share/man/man1/lidm.1
share/man/man5/lidm-config.5

Build Recipes for Packaging

To ease most of the installation process there's several make recipes to install man pages and service files, I encpurage you to check their source yourself, but:

  • make / make lidm: Builds the app binary.
  • make install: Attempts to install the binary, place a default config file in /etc/lidm.ini and install the man pages.
  • make install-service-(systemd|dinit|runit|openrc|s6)(|-etc): Just check the source, service files for different init systems and -etc variants for alternative paths.
  • make print-version: Outputs the current version in the Makefile for scripts that might want to extract that info.

You can choose to use these packages or create your own service files / etc. There's are merely suggestions on what to use.