1{ stdenv, fetchurl, autoreconfHook, gzip, bzip2, pkgconfig, check, pam }:
2
3stdenv.mkDerivation rec {
4 name = "kbd-2.0.3";
5
6 src = fetchurl {
7 url = "mirror://kernel/linux/utils/kbd/${name}.tar.xz";
8 sha256 = "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs";
9 };
10
11 /* Get the dvorak programmer keymap (present in X but not in kbd) */
12 dvpSrc = fetchurl {
13 url = "http://kaufmann.no/downloads/linux/dvp-1_2_1.map.gz";
14 sha256 = "0e859211cfe16a18a3b9cbf2ca3e280a23a79b4e40b60d8d01d0fde7336b6d50";
15 };
16
17 neoSrc = fetchurl {
18 name = "neo.map";
19 url = "https://svn.neo-layout.org/linux/console/neo.map?r=2455";
20 sha256 = "1wlgp09wq84hml60hi4ls6d4zna7vhycyg40iipyh1279i91hsx7";
21 };
22
23 configureFlags = [
24 "--enable-optional-progs"
25 "--enable-libkeymap"
26 "--disable-nls"
27 ];
28
29 patches = [ ./console-fix.patch ];
30
31 postPatch =
32 ''
33 mkdir -p data/keymaps/i386/neo
34 cat "$neoSrc" > data/keymaps/i386/neo/neo.map
35 sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am
36
37 # Add the dvp keyboard in the dvorak folder
38 ${gzip}/bin/gzip -c -d ${dvpSrc} > data/keymaps/i386/dvorak/dvp.map
39
40 # Fix the path to gzip/bzip2.
41 substituteInPlace src/libkeymap/findfile.c \
42 --replace gzip ${gzip}/bin/gzip \
43 --replace bzip2 ${bzip2}/bin/bzip2 \
44
45 # We get a warning in armv5tel-linux and the fuloong2f, so we
46 # disable -Werror in it.
47 ${stdenv.lib.optionalString (stdenv.isArm || stdenv.system == "mips64el-linux") ''
48 sed -i s/-Werror// src/Makefile.am
49 ''}
50 '';
51
52 buildInputs = [ autoreconfHook pkgconfig check pam ];
53
54 makeFlags = "setowner= ";
55
56 meta = {
57 homepage = ftp://ftp.altlinux.org/pub/people/legion/kbd/;
58 description = "Linux keyboard utilities and keyboard maps";
59 platforms = stdenv.lib.platforms.linux;
60 };
61}