# sway.stack -- the Sway desktop: the compositor, its tools, your programs. # stack-version: 1.14.371 # # WHAT THIS MACHINE NEVER BUILDS is in avoid.stack, included by every stack # here: the exclusions are a property of the machine, not of one stack. include avoid # Replay with: packagemanager stack sway --run # Entries run top to bottom; book deps are resolved from the BLFS book, # installed entries are skipped, the first failure stops the run. # git refs are pinned to releases -- true them up if a clone fails. # # THREE FILES, ONE COMMAND (1.14.320). This stack begins with the two it # stands on, in the order they have to be built: # # wayland.stack session, graphics, wayland, GTK4, seatd, wlroots # media.stack codecs, gstreamer, WebRTC, webkitgtk, mpv, yt-dlp # # and then does what only a Sway desktop needs. The applications that used # to live here (zathura, imv) are apps.stack now, and jq is in tools.stack: # none of them is part of the desktop, and none needs rebuilding with it. include wayland # 6b. the media chain, in its own stack so it can be rebuilt on its own. # # It sits HERE because webkitgtk needs gtk4, pango and libsoup3 from # wayland.stack, and mesa and ffmpeg from further up. include media # 7. audio: alsa-lib is wayland.stack's entry 1b (it has to be early); # the server comes after media.stack, so pipewire finds gstreamer book alsa-utils book pipewire book wireplumber # 8. SDL3 for the Sw* tools. # # SDL3 dlopens libasound rather than linking it, so ldd says nothing; the # name it will dlopen is in the binary, and that is what to look for. # the glob matters: SDL3 installs libSDL3.so.0. and a bare libSDL3.so # symlink only when the -devel side is there, so naming one path makes the # probe fail for the wrong reason book sdl3 expect="strings /usr/lib/libSDL3.so* 2>/dev/null | grep -q libasound" # --------------------------------------------------------------------- # THE COMPOSITOR AND ITS TOOLS # --------------------------------------------------------------------- # scdoc: the man-page generator every sway-family project uses. Not in # BLFS; SLFS has it (scdoc-1.11.5, from git.sr.ht -- the host seatd already # comes from). It was assumed present because sway's line below asks for # -Dman-pages=enabled; it was not, and grim stopped on # doc/meson.build:1:8: ERROR: Program 'scdoc' not found or not executable # Before sway, so a replay of this stack meets it in order. No dependencies. git scdoc url=https://git.sr.ht/~sircmpwn/scdoc ref=1.11.5 prog=scdoc build="make PREFIX=/usr" install="make PREFIX=/usr install" # needs=: book packages a git entry depends on -- nothing in the book orders # anything before a git build, so its dependencies must be named here. # the author's own options: man pages, swaybar, swaynag, bash completions git sway url=https://github.com/swaywm/sway ref=1.11 prog=sway needs=json-c,cairo,pango build="meson setup build --prefix=/usr --buildtype=release -Dman-pages=enabled -Dswaybar=true -Dswaynag=true -Dbash-completions=true; ninja -C build" install="ninja -C build install" git swaybg url=https://github.com/swaywm/swaybg ref=v1.2.1 prog=swaybg build="meson setup build --prefix=/usr --buildtype=release; ninja -C build" install="ninja -C build install" # SCREENSHOTS AND IDLE: grim, slurp, swayidle. None is a BLFS page; grim and # slurp are SLFS pages (the Sway book), swayidle is swaywm's own. Refs checked: # grim v1.5.0 -- SLFS 1.5.0 fetches it from gitlab.freedesktop.org. # NOT github.com/emersion/grim: that mirror stopped at # v1.4.0 in 2022 when grim moved away from GitHub. # slurp v1.5.0 -- git ls-remote on github.com/emersion/slurp; SLFS agrees # swayidle v1.9.0 -- git ls-remote on github.com/swaywm/swayidle # needs=libjpeg, not libjpeg-turbo: that is the book's ANCHOR for # libjpeg-turbo-3.2.0 (`packagemanager search jpeg` shows both). # Their options are asked for, not autodetected: jpeg (grim -t jpeg) and man # pages (scdoc is here already: sway builds its man pages with it). # # grim -g "$(slurp)" ~/shot.png a region, picked with the mouse # # swayidle -Dlogind=disabled: its logind half (before-sleep, lock on # `loginctl lock-session`) needs a logind SESSION, and sway here gets its # seat from seatd-, not elogind -- so auto-detection would find # libelogind, build it in, and have nothing to talk to at runtime. Timeouts # (`swayidle timeout 300 'swaymsg "output * power off"' resume ...`) are the # part that works without it. git grim url=https://gitlab.freedesktop.org/emersion/grim.git ref=v1.5.0 prog=grim needs=libpng,pixman,libjpeg build="meson setup build --prefix=/usr --buildtype=release -Djpeg=enabled -Dman-pages=enabled -Dbash-completions=true; ninja -C build" install="ninja -C build install" git slurp url=https://github.com/emersion/slurp ref=v1.5.0 prog=slurp needs=cairo,libxkbcommon build="meson setup build --prefix=/usr --buildtype=release -Dman-pages=enabled; ninja -C build" install="ninja -C build install" # wl-mirror: one output shown in a window -- the laptop screen on a # projector you are looking away from, or one display shared into a call. # Not in the book. Its wayland-protocols and wlr-protocols are git # submodules, which the clone recurses into, so nothing extra is needed for # them. WITH_GBM: frames come as dmabufs from mesa instead of being copied. # The example script wl-present is left out: it needs pipectl, which is not # here. git wl-mirror url=https://github.com/Ferdi265/wl-mirror ref=v0.18.5 prog=wl-mirror needs=mesa,libdrm build="cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DINSTALL_DOCUMENTATION=ON -DWITH_GBM=ON -DWITH_LIBDECOR=OFF; cmake --build build" install="cmake --install build" git swayidle url=https://github.com/swaywm/swayidle ref=v1.9.0 prog=swayidle build="meson setup build --prefix=/usr --buildtype=release -Dlogind=disabled -Dman-pages=enabled -Dbash-completions=true -Dzsh-completions=false -Dfish-completions=false; ninja -C build" install="ninja -C build install" # wl-clipboard: wl-copy and wl-paste. Not in the book either, and sway is # unusable without it once anything wants a clipboard from a script. git wl-clipboard url=https://github.com/bugaevc/wl-clipboard ref=v2.2.1 \ prog=wl-copy \ build="meson setup build --prefix=/usr --buildtype=release; ninja -C build" \ install="ninja -C build install" \ expect="wl-paste --version >/dev/null 2>&1" # wf-recorder: screen recording for a wlroots compositor. Not in the book. # # CHECKED against the repo at v0.6.0 (newest tag; master and two feature # branches also exist): # # * audio is CONDITIONAL. meson_options.txt has `pulse` and `pipewire` # as auto features and config.h.in has `#mesondefine HAVE_AUDIO`, which # gates src/audio.cpp -- so with neither library found at configure # time you get a recorder that cannot record sound. # * and `--help` lists `-a, --audio` EITHER WAY: that text is not inside # the #ifdef. So the probe checks what the binary LINKS, which is the # only honest answer to "was audio built in". # * `meson build` (as in the by-hand script) still works, but `meson # setup build` is the spelling meson documents now. # # Its codecs come from ffmpeg, which is entry 1b, and the default is # libx264 -- so gst10-plugins-ugly's x264 is not what it uses; ffmpeg's own # libx264 support is. git wf-recorder url=https://github.com/ammen99/wf-recorder.git \ ref=v0.6.0 prog=wf-recorder \ build="meson setup build --prefix=/usr --buildtype=release; ninja -C build" \ install="ninja -C build install" \ expect="ldd /usr/bin/wf-recorder 2>/dev/null | grep -qE 'libpulse|libpipewire'" # light: backlight and keyboard brightness. Not in the book. # # THE UPSTREAM MOVED. haikarainen/light on GitHub is gone -- checked, and # `git ls-remote` on it fails while three other GitHub URLs in this stack # answer, so it was the path and not the network. GitHub returns 401 for a # repository it does not have, which is why the clone asked for a username. # # gitlab.com/dpeukert/light is where it continued. Checked on the machine # this runs on: the URL answers and `git ls-remote --tags` prints NOTHING -- # the fork carries no tags at all, only `main`. So `ref=main` is not # laziness here, it is the only ref there is, and it means this entry # follows upstream: the commit that built is the one worth writing down if # a build ever breaks. # # git ls-remote --heads https://gitlab.com/dpeukert/light.git # # CFLAGS='-fcommon' IS NOT A WORKAROUND FOR A BROKEN PACKAGE. light's # helpers.h declares `light_loglevel` without `extern`, which every C # compiler accepted until GCC 10 made -fno-common the default; each object # then defines it and the link fails with # multiple definition of `light_loglevel' # -fcommon restores the pre-GCC-10 behaviour, which is what this code was # written against. The alternative is patching the header, and that is # upstream's call, not this stack's. # # IT HAS TO BE IN THE ENVIRONMENT, NOT ON THE CONFIGURE LINE. autogen.sh # here is not just autoreconf: it ends by running ./config.status --recheck # and then `make`, so the compile that fails happens BEFORE the ./configure # on this line is ever reached. Passing CFLAGS to that configure fixed # nothing and the link failed exactly as before. Exported, it reaches # autogen.sh's own configure run, which is the one that writes the Makefile. # # And `rm -f config.status` first: autogen.sh re-runs whatever config.status # is lying around, so a tree configured by hand earlier keeps its old flags # no matter what this line says. # # If that fails too, one of these: # - the new URL, if light moved: just fix url= below. # - the source you built from last time, as a tar entry: # tar light url=file:///path/to/light-1.2.2.tar.gz pkg=light-1.2.2.tar.gz \ # have=/usr/bin/light build="./autogen.sh; ./configure --prefix=/usr \ # --with-udev; make" install="make install" # - brightnessctl, which does the same job and DOES resolve (tag 0.5.1 # verified from here). It uses the same udev/video-group approach: # git brightnessctl url=https://github.com/Hummer12007/brightnessctl.git \ # ref=0.5.1 prog=brightnessctl build="make" \ # install="make install" expect="brightnessctl --version >/dev/null 2>&1" # # It writes to /sys/class/backlight/*/brightness, which root owns, so the # binary needs either setuid root or a udev rule putting those files in a # group you are in. --with-udev installs 90-backlight.rules, which chgrps # them to `video`; that is the one to prefer, and it means the desktop user # must be in `video` (cfg power puts them in the power group, not this one). git light url=https://gitlab.com/dpeukert/light.git ref=main prog=light \ build="export CFLAGS='-O2 -fcommon'; rm -f config.status; ./autogen.sh; ./configure --prefix=/usr --with-udev; make" \ install="make install" \ expect="light -V >/dev/null 2>&1" # foot, the terminal, and its two small libraries git tllist url=https://codeberg.org/dnkl/tllist ref=1.1.0 have=/usr/include/tllist.h build="meson setup build --prefix=/usr" install="ninja -C build install" git fcft url=https://codeberg.org/dnkl/fcft ref=3.3.2 have=/usr/include/fcft build="meson setup build --prefix=/usr --buildtype=release; ninja -C build" install="ninja -C build install" git foot url=https://codeberg.org/dnkl/foot ref=1.28.0 prog=foot build="meson setup build --prefix=/usr --buildtype=release; ninja -C build" install="ninja -C build install" # the rest of the fonts: icons, a patched terminal font, and Noto for # everything DejaVu does not cover. One step, because they are all "unpack # an archive into /usr/share/fonts and run fc-cache". cfg fonts tar dejavu-fonts url=https://downloads.sourceforge.net/dejavu/dejavu-fonts-ttf-2.37.tar.bz2 pkg=dejavu-fonts-ttf-2.37.tar.bz2 have=/usr/share/fonts/dejavu build="true" install="install -v -d -m755 /usr/share/fonts/dejavu; install -v -m644 ttf/*.ttf /usr/share/fonts/dejavu; fc-cache /usr/share/fonts/dejavu" # --------------------------------------------------------------------- # YOUR OWN PROGRAMS: the Sw* tools and the browser. SDL3's image and font # libraries are here because only these use them. # --------------------------------------------------------------------- git sdl3-image url=https://github.com/libsdl-org/SDL_image ref=release-3.2.4 submodules=no have=/usr/lib/libSDL3_image.so build="cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release; cmake --build build" install="cmake --install build" git sdl3-ttf url=https://github.com/libsdl-org/SDL_ttf ref=release-3.2.2 submodules=no have=/usr/lib/libSDL3_ttf.so build="cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release; cmake --build build" install="cmake --install build" # SDL3_mixer: sound and music for SDL3 programs. WAV/AIFF/VOC/AU, FLAC # (dr_flac), MP3 (dr_mp3), Ogg Vorbis (stb_vorbis) and MIDI (timidity) are # built in; libFLAC, mpg123, vorbisfile, opusfile, libxmp, game-music-emu, # fluidsynth and wavpack are used if they are installed and quietly left out # if not (only SDLMIXER_STRICT=ON makes a missing one an error). # submodules=no on all three: their external/ folders are copies of those # libraries for platforms without them (Android, MSVC), never built here. git sdl3-mixer url=https://github.com/libsdl-org/SDL_mixer ref=release-3.2.4 submodules=no have=/usr/lib/libSDL3_mixer.so build="cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DSDLMIXER_TESTS=OFF -DSDLMIXER_EXAMPLES=OFF; cmake --build build" install="cmake --install build" # Browser builds two programs, browser-mini and browser-big. It was the # entry `minibrowser` until 1.14.357; an existing p_minibrowser is renamed # with: packagemanager rename minibrowser browser --run git browser url=https://git.christianimmanuel.de/web-tools/Browser prog=browser-mini git swbr url=https://git.christianimmanuel.de/sway/SwBr prog=swbr git swov url=https://git.christianimmanuel.de/sway/SWOv prog=swov git swas url=https://git.christianimmanuel.de/sway/SwAS prog=swas # gitsync (repository Git-Server): publishes the projects listed in # ~/.config/gitsync/gitsync.conf to the git server. Only the laptop script # is installed -- index.php, apache/ and cron/ belong to the server. It is a # bash script: nothing to compile; git, rsync and ssh when it runs. # The repository is flat: gitsync, gitsync.conf and the Makefile at the top. # After the first run: packagemanager dev gitsync --hub ~/Git/Git-Server --run # make -C ~/Git/Git-Server/gitsync config (as you) git gitsync url=https://git.christianimmanuel.de/web-tools/Git-Server.git prog=gitsync needs=rsync,openssh build="true" install="make PREFIX=/usr install" cfg sway-session