2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook,
|
2021-02-05 17:12:51 +00:00
|
|
|
gzip, bzip2, pkg-config, flex, check,
|
2020-04-24 23:36:52 +00:00
|
|
|
pam, coreutils
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "kbd";
|
|
|
|
version = "2.0.4";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
|
|
|
|
sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz";
|
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-optional-progs"
|
|
|
|
"--enable-libkeymap"
|
|
|
|
"--disable-nls"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./search-paths.patch ];
|
|
|
|
|
|
|
|
postPatch =
|
|
|
|
''
|
|
|
|
# Add Neo keymap subdirectory
|
|
|
|
sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am
|
|
|
|
|
|
|
|
# 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 dvorak/{no.map,dvorak-no.map}
|
|
|
|
mv fgGIod/trf{,-fgGIod}.map
|
|
|
|
mv colemak/{en-latin9,colemak}.map
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Fix the path to gzip/bzip2.
|
|
|
|
substituteInPlace src/libkeymap/findfile.c \
|
|
|
|
--replace gzip ${gzip}/bin/gzip \
|
|
|
|
--replace bzip2 ${bzip2.bin}/bin/bzip2 \
|
|
|
|
|
|
|
|
# We get a warning in armv5tel-linux and the fuloong2f, so we
|
|
|
|
# disable -Werror in it.
|
2021-02-05 17:12:51 +00:00
|
|
|
${lib.optionalString (stdenv.isAarch32 || stdenv.hostPlatform.isMips) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i s/-Werror// src/Makefile.am
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for i in $out/bin/unicode_{start,stop}; do
|
|
|
|
substituteInPlace "$i" \
|
|
|
|
--replace /usr/bin/tty ${coreutils}/bin/tty
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
buildInputs = [ check pam ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config flex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "setowner=" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "ftp://ftp.altlinux.org/pub/people/legion/kbd/";
|
|
|
|
description = "Linux keyboard utilities and keyboard maps";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
};
|
|
|
|
}
|