Skip to content

Commit df75cd2

Browse files

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

pkgs/tools/system/kanata/default.nix

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
, darwin
44
, rustPlatform
55
, fetchFromGitHub
6+
, jq
7+
, moreutils
68
, withCmd ? false
79
}:
810

@@ -17,10 +19,28 @@ rustPlatform.buildRustPackage rec {
1719
sha256 = "sha256-eDeGVmh1gI/DhiP6gxJyGH9G9LNH1NHW0+DNuOPUnBY=";
1820
};
1921

20-
cargoHash =
21-
if stdenv.isLinux
22-
then "sha256-gRJdfvb3Q+G7pXpOyKrgozrZPJJbDajC63Kk5QtgX00="
23-
else "sha256-i9eY8dvteOLYmM+ad1nw+fohec2SPGCGqColXNamEBo=";
22+
cargoHash = "sha256-Om9Thyr10wc39J6adSWgmXtvjckaEW0z68sWxUqa4wc=";
23+
24+
# the dependency native-windows-gui contains both README.md and readme.md,
25+
# which causes a hash mismatch on systems with a case-insensitive filesystem
26+
# this removes the readme files and updates cargo's checksum file accordingly
27+
depsExtraArgs = {
28+
nativeBuildInputs = [
29+
jq
30+
moreutils
31+
];
32+
33+
postBuild = ''
34+
pushd $name/native-windows-gui
35+
36+
rm --force --verbose README.md readme.md
37+
jq 'del(.files."README.md") | del(.files."readme.md")' \
38+
.cargo-checksum.json -c \
39+
| sponge .cargo-checksum.json
40+
41+
popd
42+
'';
43+
};
2444

2545
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
2646

0 commit comments

Comments
 (0)