3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/kbd/default.nix
Daniel Barlow 9c50ae6898 lib, treewide: Add missing MIPS arches, and fix existing usage
Existing "mips64el" should be "mipsel".

This is just the barest minimum so that nixpkgs can recognize them as
systems - although required for building individual derivations onto
MIPS boards, it is not sufficient if you want to actually build nixos on
those targets
2018-02-23 20:43:42 -05:00

60 lines
1.5 KiB
Nix

{ stdenv, fetchurl, autoreconfHook,
gzip, bzip2, pkgconfig, flex, check,
pam, coreutils
}:
stdenv.mkDerivation rec {
name = "kbd-${version}";
version = "2.0.4";
src = fetchurl {
url = "mirror://kernel/linux/utils/kbd/${name}.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
# 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.
${stdenv.lib.optionalString (stdenv.isArm || stdenv.hostPlatform.isMips) ''
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 ];
nativeBuildInputs = [ autoreconfHook pkgconfig flex ];
makeFlags = [ "setowner=" ];
meta = with stdenv.lib; {
homepage = ftp://ftp.altlinux.org/pub/people/legion/kbd/;
description = "Linux keyboard utilities and keyboard maps";
platforms = platforms.linux;
license = licenses.gpl2Plus;
};
}