nixpkgs/pkgs/by-name/kb/kbd/search-paths.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

81 lines
2.5 KiB
Diff

Add /etc/kbd to the list of directories to search for the console
fonts, screen mappings, Unicode maps, keytable files, etc.
Without this patch, kbd will only look inside
/nix/store/<hash>-kbd-x.x.x/share.
--- a/src/libkeymap/analyze.l
+++ b/src/libkeymap/analyze.l
@@ -109,6 +109,9 @@ static const char *const include_dirpath1[] = {
NULL
};
static const char *const include_dirpath3[] = {
+ "/etc/kbd/" KEYMAPDIR "/include/",
+ "/etc/kbd/" KEYMAPDIR "/i386/include/",
+ "/etc/kbd/" KEYMAPDIR "/mac/include/",
DATADIR "/" KEYMAPDIR "/include/",
DATADIR "/" KEYMAPDIR "/i386/include/",
DATADIR "/" KEYMAPDIR "/mac/include/",
--- a/src/libkfont/context.c
+++ b/src/libkfont/context.c
@@ -13,5 +13,6 @@
/* search for the map file in these directories (with trailing /) */
static const char *const mapdirpath[] = {
+ "/etc/kbd/" TRANSDIR "/",
DATADIR "/" TRANSDIR "/",
NULL
};
@@ -28,5 +29,6 @@ static const char *const mapsuffixes[] = {
/* search for the font in these directories (with trailing /) */
static const char *const fontdirpath[] = {
+ "/etc/kbd/" FONTDIR "/",
DATADIR "/" FONTDIR "/",
NULL
};
@@ -42,5 +44,6 @@ static char const *const fontsuffixes[] = {
static const char *const unidirpath[] = {
+ "/etc/kbd/" UNIMAPDIR "/",
DATADIR "/" UNIMAPDIR "/",
NULL
};
@@ -55,5 +58,6 @@ static const char *const unisuffixes[] = {
/* hide partial fonts a bit - loading a single one is a bad idea */
const char *const partfontdirpath[] = {
+ "/etc/kbd/" FONTDIR "/" PARTIALDIR "/",
DATADIR "/" FONTDIR "/" PARTIALDIR "/",
NULL
};
--- a/src/loadkeys.c
+++ b/src/loadkeys.c
@@ -27,5 +27,6 @@
static const char *const dirpath1[] = {
+ "/etc/kbd/" KEYMAPDIR "/**",
DATADIR "/" KEYMAPDIR "/**",
KERNDIR "/",
NULL
--- a/src/resizecons.c
+++ b/src/resizecons.c
@@ -104,6 +104,7 @@ static void vga_set_verticaldisplayend_lowbyte(int);
const char *const dirpath[] = {
"",
+ "/etc/kbd/" VIDEOMODEDIR "/",
DATADIR "/" VIDEOMODEDIR "/",
NULL
};
--- a/src/setfont.c
+++ b/src/setfont.c
@@ -48,8 +48,8 @@ usage(void)
" -v Be verbose.\n"
" -C <cons> Indicate console device to be used.\n"
" -V Print version and exit.\n"
- "Files are loaded from the current directory or %s/*/.\n"),
- DATADIR);
+ "Files are loaded from the current directory or %s/*/ or %s/*/.\n"),
+ DATADIR, "/etc/kbd");
exit(EX_USAGE);
}