2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook,
|
2021-01-19 06:50:56 +00:00
|
|
|
gzip, bzip2, pkg-config, flex, check,
|
2017-07-29 22:21:44 +00:00
|
|
|
pam, coreutils
|
|
|
|
}:
|
2007-04-04 09:18:39 +00:00
|
|
|
|
2009-06-05 17:16:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "kbd";
|
2017-07-29 22:21:44 +00:00
|
|
|
version = "2.0.4";
|
2007-04-04 09:18:39 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
|
2017-07-29 22:21:44 +00:00
|
|
|
sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz";
|
2007-04-04 09:18:39 +00:00
|
|
|
};
|
|
|
|
|
2015-04-02 01:36:31 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-optional-progs"
|
|
|
|
"--enable-libkeymap"
|
|
|
|
"--disable-nls"
|
|
|
|
];
|
2015-03-09 01:14:19 +00:00
|
|
|
|
2017-07-29 22:21:44 +00:00
|
|
|
patches = [ ./search-paths.patch ];
|
2015-04-07 18:26:36 +00:00
|
|
|
|
|
|
|
postPatch =
|
2012-07-24 17:10:53 +00:00
|
|
|
''
|
2016-07-01 00:51:24 +00:00
|
|
|
# Add Neo keymap subdirectory
|
2015-08-15 23:46:50 +00:00
|
|
|
sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am
|
2015-03-09 01:14:19 +00:00
|
|
|
|
2018-10-08 23:21:28 +00:00
|
|
|
# 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
|
|
|
|
|
2012-07-24 17:10:53 +00:00
|
|
|
# Fix the path to gzip/bzip2.
|
2015-04-02 01:36:31 +00:00
|
|
|
substituteInPlace src/libkeymap/findfile.c \
|
2012-07-24 17:10:53 +00:00
|
|
|
--replace gzip ${gzip}/bin/gzip \
|
2015-08-21 17:35:23 +00:00
|
|
|
--replace bzip2 ${bzip2.bin}/bin/bzip2 \
|
2015-01-30 13:22:09 +00:00
|
|
|
|
2012-07-24 17:10:53 +00:00
|
|
|
# We get a warning in armv5tel-linux and the fuloong2f, so we
|
|
|
|
# disable -Werror in it.
|
2021-01-15 14:45:37 +00:00
|
|
|
${lib.optionalString (stdenv.isAarch32 || stdenv.hostPlatform.isMips) ''
|
2012-07-24 17:10:53 +00:00
|
|
|
sed -i s/-Werror// src/Makefile.am
|
|
|
|
''}
|
|
|
|
'';
|
2010-01-29 21:30:09 +00:00
|
|
|
|
2017-07-29 22:21:44 +00:00
|
|
|
postInstall = ''
|
2017-07-29 22:33:26 +00:00
|
|
|
for i in $out/bin/unicode_{start,stop}; do
|
|
|
|
substituteInPlace "$i" \
|
|
|
|
--replace /usr/bin/tty ${coreutils}/bin/tty
|
|
|
|
done
|
2017-07-29 22:21:44 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
2016-07-01 00:51:01 +00:00
|
|
|
buildInputs = [ check pam ];
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config flex ];
|
2015-03-09 01:14:19 +00:00
|
|
|
|
2016-07-01 00:51:01 +00:00
|
|
|
makeFlags = [ "setowner=" ];
|
2010-01-18 10:19:11 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "ftp://ftp.altlinux.org/pub/people/legion/kbd/";
|
2010-01-18 10:19:11 +00:00
|
|
|
description = "Linux keyboard utilities and keyboard maps";
|
2016-07-01 00:51:01 +00:00
|
|
|
platforms = platforms.linux;
|
2017-04-29 04:24:34 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2010-01-18 10:19:11 +00:00
|
|
|
};
|
2007-04-04 09:18:39 +00:00
|
|
|
}
|