kbd: add system-wise search paths for NixOS

+87 -7
+10 -7
pkgs/os-specific/linux/kbd/default.nix
··· 1 - { stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, check, pam }: 1 + { stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, flex, check, pam }: 2 2 3 3 stdenv.mkDerivation rec { 4 - name = "kbd-2.0.3"; 4 + name = "kbd-${version}"; 5 + version = "2.0.3"; 5 6 6 7 src = fetchurl { 7 8 url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz"; ··· 26 27 "--disable-nls" 27 28 ]; 28 29 29 - patches = [ ./console-fix.patch ]; 30 + patches = [ ./console-fix.patch ./search-paths.patch ]; 30 31 31 32 postPatch = 32 33 '' ··· 49 50 ''} 50 51 ''; 51 52 52 - buildInputs = [ autoreconfHook pkgconfig check pam ]; 53 + buildInputs = [ check pam ]; 54 + nativeBuildInputs = [ autoreconfHook pkgconfig flex ]; 53 55 54 - makeFlags = "setowner= "; 56 + makeFlags = [ "setowner=" ]; 55 57 56 - meta = { 58 + meta = with stdenv.lib; { 57 59 homepage = ftp://ftp.altlinux.org/pub/people/legion/kbd/; 58 60 description = "Linux keyboard utilities and keyboard maps"; 59 - platforms = stdenv.lib.platforms.linux; 61 + platforms = platforms.linux; 62 + licenses = licenses.gpl2Plus; 60 63 }; 61 64 }
+77
pkgs/os-specific/linux/kbd/search-paths.patch
··· 1 + diff -ru3 kbd-2.0.3-old/src/libkeymap/analyze.l kbd-2.0.3/src/libkeymap/analyze.l 2 + --- kbd-2.0.3-old/src/libkeymap/analyze.l 2016-07-03 02:31:28.258958092 +0300 3 + +++ kbd-2.0.3/src/libkeymap/analyze.l 2016-07-03 02:44:53.042592223 +0300 4 + @@ -99,6 +99,9 @@ 5 + static const char *const include_dirpath0[] = { "", 0 }; 6 + static const char *const include_dirpath1[] = { "", "../include/", "../../include/", 0 }; 7 + static const char *const include_dirpath3[] = { 8 + + "/etc/kbd/" KEYMAPDIR "/include/", 9 + + "/etc/kbd/" KEYMAPDIR "/i386/include/", 10 + + "/etc/kbd/" KEYMAPDIR "/mac/include/", 11 + DATADIR "/" KEYMAPDIR "/include/", 12 + DATADIR "/" KEYMAPDIR "/i386/include/", 13 + DATADIR "/" KEYMAPDIR "/mac/include/", 0 14 + diff -ru3 kbd-2.0.3-old/src/loadkeys.c kbd-2.0.3/src/loadkeys.c 15 + --- kbd-2.0.3-old/src/loadkeys.c 2016-07-03 02:31:28.260958091 +0300 16 + +++ kbd-2.0.3/src/loadkeys.c 2016-07-03 02:34:34.123871103 +0300 17 + @@ -26,7 +26,7 @@ 18 + #include "keymap.h" 19 + 20 + static const char *progname = NULL; 21 + -static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; 22 + +static const char *const dirpath1[] = { "", "/etc/kbd/" KEYMAPDIR "/**", DATADIR "/" KEYMAPDIR "/**", 0 }; 23 + static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; 24 + 25 + static void __attribute__ ((noreturn)) 26 + diff -ru3 kbd-2.0.3-old/src/loadunimap.c kbd-2.0.3/src/loadunimap.c 27 + --- kbd-2.0.3-old/src/loadunimap.c 2016-07-03 02:31:28.259958091 +0300 28 + +++ kbd-2.0.3/src/loadunimap.c 2016-07-03 02:33:06.803911971 +0300 29 + @@ -28,7 +28,7 @@ 30 + extern char *progname; 31 + extern int force; 32 + 33 + -static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; 34 + +static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; 35 + static const char *const unisuffixes[] = { "", ".uni", ".sfm", 0 }; 36 + 37 + #ifdef MAIN 38 + diff -ru3 kbd-2.0.3-old/src/mapscrn.c kbd-2.0.3/src/mapscrn.c 39 + --- kbd-2.0.3-old/src/mapscrn.c 2016-07-03 02:31:28.260958091 +0300 40 + +++ kbd-2.0.3/src/mapscrn.c 2016-07-03 02:33:21.119905270 +0300 41 + @@ -25,7 +25,7 @@ 42 + static int ctoi (char *); 43 + 44 + /* search for the map file in these directories (with trailing /) */ 45 + -static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; 46 + +static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; 47 + static const char *const mapsuffixes[] = { "", ".trans", "_to_uni.trans", ".acm", 0 }; 48 + 49 + #ifdef MAIN 50 + diff -ru3 kbd-2.0.3-old/src/resizecons.c kbd-2.0.3/src/resizecons.c 51 + --- kbd-2.0.3-old/src/resizecons.c 2016-07-03 02:31:28.260958091 +0300 52 + +++ kbd-2.0.3/src/resizecons.c 2016-07-03 02:33:32.253900060 +0300 53 + @@ -100,7 +100,7 @@ 54 + static void vga_set_cursor(int, int); 55 + static void vga_set_verticaldisplayend_lowbyte(int); 56 + 57 + -const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0}; 58 + +const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; 59 + const char *const suffixes[] = { "", 0 }; 60 + 61 + int 62 + diff -ru3 kbd-2.0.3-old/src/setfont.c kbd-2.0.3/src/setfont.c 63 + --- kbd-2.0.3-old/src/setfont.c 2016-07-03 02:31:28.260958091 +0300 64 + +++ kbd-2.0.3/src/setfont.c 2016-07-03 02:33:54.315889734 +0300 65 + @@ -51,10 +51,10 @@ 66 + int debug = 0; 67 + 68 + /* search for the font in these directories (with trailing /) */ 69 + -const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; 70 + +const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; 71 + const char *const fontsuffixes[] = { "", ".psfu", ".psf", ".cp", ".fnt", 0 }; 72 + /* hide partial fonts a bit - loading a single one is a bad idea */ 73 + -const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; 74 + +const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; 75 + const char *const partfontsuffixes[] = { "", 0 }; 76 + 77 + static inline int