The `i3-rounded` package is derived from `i3`, but uses some old fork of
`i3` which does not have the `318-i3-dmenu-desktop.t` testcase. Make
the code in `postPatch` check whether that testcase is actually present,
so that the build of `i3-rounded` does not fail.
Some tests in the i3 testsuite are silently skipped if the dependencies
required to run those tests are missing. The problematic dependencies
turned out to be `xdotool`, `xorg.setxkbmap`, `xorg.xrandr`, `which`
(the latter is used to verify the presence of some tools). Add those
dependencies to `buildInputs`, so that all tests would be run.
Ideally such missing dependencies should be detected as test failures,
but it's hard to implement, because missing tools result just in `skip`
marks in the test log, and there are some tests which are skipped for
other reasons (e.g., tests which were written before the expected
behavior is actually implemented in i3).
The `checkPhase` script was stale and needed to be rewritten for the new
version of i3 (paths are different now, and `complete-run.pl` now
invokes `xvfb-run` internally). The code to check the log file for
errors might be unneeded for the new version (`complete-run.pl` seems to
return a non-zero exit code correctly on errors), but is left to catch
any possible regressions in the test runner behavior.
Also the `318-i3-dmenu-desktop.t` testcase was failing, because that
testcase was creating a temporary Perl script intended to shadow the
real `i3-msg` executable, but the `#!/usr/bin/env perl` shebang in that
script did not work in the build environment; this problem was not
really obvious, because `system('i3-msg', $cmd)` silently continued to
search for the `i3-msg` executable further in `$PATH` and launched the
real binary instead of the replacement script. The problematic shebang
needed to be replaced manually, because `patchShebangs` handles only
real shebangs on the first line of each executable file.
* workflows/check-nix-format: Enforce nixfmt on new/changed files
This makes the Nix format workflow check new/changed files instead of
just an allowlist.
This enforces that all PRs updated after this is merged are required to
have fully standard formatted Nix files!
* workflows/check-nix-format: determine changed files via base commit
The next commit will use this to have a simpler change
* workflows/check-nix-format: Only ensure for already formatted files
This prevents situations where contributors need to suddenly format a
huge file even if they only changed a small part of it (e.g.
all-packages.nix)