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