Merge pull request #124971 from oxalica/fix/kbd-paths
kbd: patch paths to decompressors
This commit is contained in:
commit
26648d29d4
@ -201,6 +201,7 @@ in
|
||||
jitsi-meet = handleTest ./jitsi-meet.nix {};
|
||||
k3s = handleTest ./k3s.nix {};
|
||||
kafka = handleTest ./kafka.nix {};
|
||||
kbd-setfont-decompress = handleTest ./kbd-setfont-decompress.nix {};
|
||||
keepalived = handleTest ./keepalived.nix {};
|
||||
keepassxc = handleTest ./keepassxc.nix {};
|
||||
kerberos = handleTest ./kerberos/default.nix {};
|
||||
|
21
nixos/tests/kbd-setfont-decompress.nix
Normal file
21
nixos/tests/kbd-setfont-decompress.nix
Normal file
@ -0,0 +1,21 @@
|
||||
import ./make-test-python.nix ({ lib, pkgs, ... }:
|
||||
{
|
||||
name = "kbd-setfont-decompress";
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ oxalica ];
|
||||
|
||||
machine = { ... }: {};
|
||||
|
||||
testScript = ''
|
||||
machine.succeed("gzip -cd ${pkgs.terminus_font}/share/consolefonts/ter-v16b.psf.gz >font.psf")
|
||||
machine.succeed("gzip <font.psf >font.psf.gz")
|
||||
machine.succeed("bzip2 <font.psf >font.psf.bz2")
|
||||
machine.succeed("xz <font.psf >font.psf.xz")
|
||||
machine.succeed("zstd <font.psf >font.psf.zst")
|
||||
# setfont returns 0 even on error.
|
||||
assert machine.succeed("PATH= ${pkgs.kbd}/bin/setfont font.psf.gz 2>&1") == ""
|
||||
assert machine.succeed("PATH= ${pkgs.kbd}/bin/setfont font.psf.bz2 2>&1") == ""
|
||||
assert machine.succeed("PATH= ${pkgs.kbd}/bin/setfont font.psf.xz 2>&1") == ""
|
||||
assert machine.succeed("PATH= ${pkgs.kbd}/bin/setfont font.psf.zst 2>&1") == ""
|
||||
'';
|
||||
})
|
@ -8,6 +8,10 @@
|
||||
, check
|
||||
, pam
|
||||
, coreutils
|
||||
, gzip
|
||||
, bzip2
|
||||
, xz
|
||||
, zstd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -38,6 +42,13 @@ stdenv.mkDerivation rec {
|
||||
mv fgGIod/trf{,-fgGIod}.map
|
||||
mv colemak/{en-latin9,colemak}.map
|
||||
popd
|
||||
|
||||
# Fix paths to decompressors. Trailing space to avoid replacing `xz` in `".xz"`.
|
||||
substituteInPlace src/libkbdfile/kbdfile.c \
|
||||
--replace 'gzip ' '${gzip}/bin/gzip ' \
|
||||
--replace 'bzip2 ' '${bzip2.bin}/bin/bzip2 ' \
|
||||
--replace 'xz ' '${xz.bin}/bin/xz ' \
|
||||
--replace 'zstd ' '${zstd.bin}/bin/zstd '
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
@ -50,7 +61,9 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ check pam ];
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config flex ];
|
||||
|
||||
passthru.tests = nixosTests.keymap;
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) keymap kbd-setfont-decompress;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://kbd-project.org/";
|
||||
|
Loading…
Reference in New Issue
Block a user