2017-07-30 00:21:44 +02:00
|
|
|
{ stdenv, fetchurl, autoreconfHook,
|
|
|
|
gzip, bzip2, pkgconfig, flex, check,
|
|
|
|
pam, coreutils
|
|
|
|
}:
|
2007-04-04 11:18:39 +02:00
|
|
|
|
2009-06-05 19:16:14 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2016-07-01 02:51:01 +02:00
|
|
|
name = "kbd-${version}";
|
2017-07-30 00:21:44 +02:00
|
|
|
version = "2.0.4";
|
2007-04-04 11:18:39 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-07 20:26:36 +02:00
|
|
|
url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz";
|
2017-07-30 00:21:44 +02:00
|
|
|
sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz";
|
2007-04-04 11:18:39 +02:00
|
|
|
};
|
|
|
|
|
2015-04-02 03:36:31 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-optional-progs"
|
|
|
|
"--enable-libkeymap"
|
|
|
|
"--disable-nls"
|
|
|
|
];
|
2015-03-09 02:14:19 +01:00
|
|
|
|
2017-07-30 00:21:44 +02:00
|
|
|
patches = [ ./search-paths.patch ];
|
2015-04-07 20:26:36 +02:00
|
|
|
|
|
|
|
postPatch =
|
2012-07-24 19:10:53 +02:00
|
|
|
''
|
2016-07-01 02:51:24 +02:00
|
|
|
# Add Neo keymap subdirectory
|
2015-08-16 01:46:50 +02:00
|
|
|
sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am
|
2015-03-09 02:14:19 +01:00
|
|
|
|
2018-10-09 01:21:28 +02: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 19:10:53 +02:00
|
|
|
# Fix the path to gzip/bzip2.
|
2015-04-02 03:36:31 +02:00
|
|
|
substituteInPlace src/libkeymap/findfile.c \
|
2012-07-24 19:10:53 +02:00
|
|
|
--replace gzip ${gzip}/bin/gzip \
|
2015-08-21 19:35:23 +02:00
|
|
|
--replace bzip2 ${bzip2.bin}/bin/bzip2 \
|
2015-01-30 14:22:09 +01:00
|
|
|
|
2012-07-24 19:10:53 +02:00
|
|
|
# We get a warning in armv5tel-linux and the fuloong2f, so we
|
|
|
|
# disable -Werror in it.
|
treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.
The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:
```
ISA: ARMv8 {-A, -R, -M}
/ \
Mode: Aarch32 Aarch64
| / \
Encoding: A64 A32 T32
```
At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.
The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.
[1]: https://developer.arm.com/products/architecture/a-profile
2018-03-20 03:41:06 +01:00
|
|
|
${stdenv.lib.optionalString (stdenv.isAarch32 || stdenv.hostPlatform.isMips) ''
|
2012-07-24 19:10:53 +02:00
|
|
|
sed -i s/-Werror// src/Makefile.am
|
|
|
|
''}
|
|
|
|
'';
|
2010-01-29 22:30:09 +01:00
|
|
|
|
2017-07-30 00:21:44 +02:00
|
|
|
postInstall = ''
|
2017-07-30 00:33:26 +02:00
|
|
|
for i in $out/bin/unicode_{start,stop}; do
|
|
|
|
substituteInPlace "$i" \
|
|
|
|
--replace /usr/bin/tty ${coreutils}/bin/tty
|
|
|
|
done
|
2017-07-30 00:21:44 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
2016-07-01 02:51:01 +02:00
|
|
|
buildInputs = [ check pam ];
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig flex ];
|
2015-03-09 02:14:19 +01:00
|
|
|
|
2016-07-01 02:51:01 +02:00
|
|
|
makeFlags = [ "setowner=" ];
|
2010-01-18 11:19:11 +01:00
|
|
|
|
2016-07-01 02:51:01 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-01-18 11:19:11 +01:00
|
|
|
homepage = ftp://ftp.altlinux.org/pub/people/legion/kbd/;
|
|
|
|
description = "Linux keyboard utilities and keyboard maps";
|
2016-07-01 02:51:01 +02:00
|
|
|
platforms = platforms.linux;
|
2017-04-29 06:24:34 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2010-01-18 11:19:11 +01:00
|
|
|
};
|
2007-04-04 11:18:39 +02:00
|
|
|
}
|