···
23
-
stdenv.mkDerivation rec {
26
+
stdenv.mkDerivation {
28
+
version = "2.8.0-unstable-2025-08-12";
__structuredAttrs = true;
30
-
url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
31
-
hash = "sha256-AfWAbafR009ZS3sqauGrIyFTRM8QZOjtzTqQ/vl3ahE=";
33
+
url = "https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git";
34
+
rev = "46295167a55643e941c8cdcfd2cb76bd138c851c";
35
+
hash = "sha256-m1aVfsEme/BnyJogOPvGcOrSJfli8B/TrGxOm4POt0w=";
# vlock is moved into its own output, since it depends on pam. This
···
47
-
"--enable-optional-progs"
48
-
"--enable-libkeymap"
50
-
(lib.enableFeature withVlock "vlock")
52
-
++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [
53
-
"ac_cv_func_malloc_0_nonnull=yes"
54
-
"ac_cv_func_realloc_0_nonnull=yes"
56
-
++ lib.optionals (!compress) [
57
-
"--disable-compress"
···
mv fgGIod/trf{,-fgGIod}.map
mv colemak/{en-latin9,colemak}.map
79
-
1i bindir := $(vlock)/bin' \
80
-
src/vlock/Makefile.in \
81
-
src/vlock/Makefile.am
83
-
+ lib.optionalString compress ''
84
-
# Fix paths to decompressors. Trailing space to avoid replacing `xz` in `".xz"`.
85
-
substituteInPlace src/libkbdfile/kbdfile.c \
86
-
--replace-fail 'gzip ' '${gzip}/bin/gzip ' \
87
-
--replace-fail 'bzip2 ' '${bzip2.bin}/bin/bzip2 ' \
88
-
--replace-fail 'xz ' '${xz.bin}/bin/xz ' \
89
-
--replace-fail 'zstd ' '${zstd.bin}/bin/zstd '
69
+
# Perl and Bash only used during build time
70
+
patchShebangs --build contrib/
74
+
"--enable-optional-progs"
75
+
"--enable-libkeymap"
77
+
(lib.enableFeature withVlock "vlock")
79
+
++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [
80
+
"ac_cv_func_malloc_0_nonnull=yes"
81
+
"ac_cv_func_realloc_0_nonnull=yes"
enableParallelBuilding = true;
95
-
for s in unicode_{start,stop}; do
96
-
substituteInPlace ''${!outputBin}/bin/$s \
97
-
--replace-fail /usr/bin/tty ${coreutils}/bin/tty
98
-
moveToOutput "bin/$s" "$scripts"
87
+
nativeBuildInputs = [
93
+
autoPatchelfHook # for patching dlopen()
96
+
nativeCheckInputs = [
++ lib.optionals withVlock [ pam ];
108
-
NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isStatic "-laudit";
109
-
nativeBuildInputs = [
110
+
substituteInPlace $out/bin/unicode_{start,stop} \
111
+
--replace-fail /usr/bin/tty ${coreutils}/bin/tty
113
+
moveToOutput bin/unicode_start $scripts
114
+
moveToOutput bin/unicode_stop $scripts
116
+
+ lib.optionalString withVlock ''
117
+
moveToOutput bin/vlock $vlock
118
+
moveToOutput etc/pam.d/vlock $vlock
116
-
outputChecks.out.disallowedRequisites = lib.optionals (!compress) [
121
+
outputChecks.out.disallowedRequisites = [
122
-
inherit (nixosTests) keymap kbd-setfont-decompress kbd-update-search-paths-patch;
updateScript = gitUpdater {
# No nicer place to find latest release.
url = "https://github.com/legionus/kbd.git";
135
+
systemString = if stdenv.buildPlatform.isAarch64 then "gnu64" else "aarch64-multiplatform";
137
+
pkgsCross.${systemString}.kbd;
138
+
inherit (nixosTests) keymap kbd-setfont-decompress kbd-update-search-paths-patch;
homepage = "https://kbd-project.org/";
description = "Linux keyboard tools and keyboard maps";
136
-
platforms = platforms.linux;
137
-
license = licenses.gpl2Plus;
138
-
maintainers = with maintainers; [ davidak ];
145
+
platforms = lib.platforms.linux;
146
+
license = lib.licenses.gpl2Plus;
147
+
maintainers = with lib.maintainers; [ davidak ];