1{ lib, fetchFromGitHub }:
2rec {
3 version = "9.1.1475";
4
5 outputs = [
6 "out"
7 "xxd"
8 ];
9
10 src = fetchFromGitHub {
11 owner = "vim";
12 repo = "vim";
13 rev = "v${version}";
14 hash = "sha256-KKUzS0dS9K/jlfP+igyLX1Fwjb7Y5ZAzGLjqHvkA3bs=";
15 };
16
17 enableParallelBuilding = true;
18 enableParallelInstalling = false;
19
20 hardeningDisable = [ "fortify" ];
21
22 # Use man from $PATH; escape sequences are still problematic.
23 postPatch = ''
24 substituteInPlace runtime/ftplugin/man.vim \
25 --replace "/usr/bin/man " "man "
26 '';
27
28 # man page moving is done in postFixup instead of postInstall otherwise fixupPhase moves it right back where it was
29 postFixup = ''
30 moveToOutput bin/xxd "$xxd"
31 moveToOutput share/man/man1/xxd.1.gz "$xxd"
32 for manFile in $out/share/man/*/man1/xxd.1*; do
33 # moveToOutput does not take full paths or wildcards...
34 moveToOutput "share/man/$(basename "$(dirname "$(dirname "$manFile")")")/man1/xxd.1.gz" "$xxd"
35 done
36 '';
37
38 meta = with lib; {
39 description = "Most popular clone of the VI editor";
40 homepage = "https://www.vim.org";
41 license = licenses.vim;
42 maintainers = with maintainers; [
43 das_j
44 equirosa
45 philiptaron
46 ];
47 platforms = platforms.unix;
48 mainProgram = "vim";
49 outputsToInstall = [
50 "out"
51 "xxd"
52 ];
53 };
54}