uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
81
pkgs/os-specific/linux/kbd/default.nix
Normal file
81
pkgs/os-specific/linux/kbd/default.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, nixosTests
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, flex
|
||||
, check
|
||||
, pam
|
||||
, coreutils
|
||||
, gzip
|
||||
, bzip2
|
||||
, xz
|
||||
, zstd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "kbd";
|
||||
version = "2.4.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
|
||||
sha256 = "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m";
|
||||
};
|
||||
|
||||
configureFlags = [
|
||||
"--enable-optional-progs"
|
||||
"--enable-libkeymap"
|
||||
"--disable-nls"
|
||||
];
|
||||
|
||||
patches = [
|
||||
./search-paths.patch
|
||||
];
|
||||
|
||||
postPatch =
|
||||
''
|
||||
# Renaming keymaps with name clashes, because loadkeys just picks
|
||||
# the first keymap it sees. The clashing names lead to e.g.
|
||||
# "loadkeys no" defaulting to a norwegian dvorak map instead of
|
||||
# the much more common qwerty one.
|
||||
pushd data/keymaps/i386
|
||||
mv qwertz/cz{,-qwertz}.map
|
||||
mv olpc/es{,-olpc}.map
|
||||
mv olpc/pt{,-olpc}.map
|
||||
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 = ''
|
||||
for i in $out/bin/unicode_{start,stop}; do
|
||||
substituteInPlace "$i" \
|
||||
--replace /usr/bin/tty ${coreutils}/bin/tty
|
||||
done
|
||||
'';
|
||||
|
||||
buildInputs = [ check pam ];
|
||||
NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isStatic "-laudit";
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config flex ];
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) keymap kbd-setfont-decompress kbd-update-search-paths-patch;
|
||||
};
|
||||
passthru.gzip = gzip;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://kbd-project.org/";
|
||||
description = "Linux keyboard tools and keyboard maps";
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ davidak ];
|
||||
};
|
||||
}
|
||||
85
pkgs/os-specific/linux/kbd/search-paths.patch
Normal file
85
pkgs/os-specific/linux/kbd/search-paths.patch
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
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,6 +13,7 @@
|
||||
/* search for the map file in these directories (with trailing /) */
|
||||
static const char *const mapdirpath[] = {
|
||||
"",
|
||||
+ "/etc/kbd/" TRANSDIR "/",
|
||||
DATADIR "/" TRANSDIR "/",
|
||||
NULL
|
||||
};
|
||||
@@ -28,6 +29,7 @@ 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,6 +44,7 @@ static char const *const fontsuffixes[] = {
|
||||
|
||||
static const char *const unidirpath[] = {
|
||||
"",
|
||||
+ "/etc/kbd/" UNIMAPDIR "/",
|
||||
DATADIR "/" UNIMAPDIR "/",
|
||||
NULL
|
||||
};
|
||||
@@ -55,6 +58,7 @@ 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,6 +27,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue