depot/third_party/nixpkgs/pkgs/applications/editors/vim/common.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

44 lines
1.3 KiB
Nix

{ lib, fetchFromGitHub }:
rec {
version = "9.1.0377";
outputs = [ "out" "xxd" ];
src = fetchFromGitHub {
owner = "vim";
repo = "vim";
rev = "v${version}";
hash = "sha256-cfN/QbnpWIQmLtpXWPc1JnaaX+J10ietObN/B9lE1F0=";
};
enableParallelBuilding = true;
enableParallelInstalling = false;
hardeningDisable = [ "fortify" ];
# Use man from $PATH; escape sequences are still problematic.
postPatch = ''
substituteInPlace runtime/ftplugin/man.vim \
--replace "/usr/bin/man " "man "
'';
# man page moving is done in postFixup instead of postInstall otherwise fixupPhase moves it right back where it was
postFixup = ''
moveToOutput bin/xxd "$xxd"
moveToOutput share/man/man1/xxd.1.gz "$xxd"
for manFile in $out/share/man/*/man1/xxd.1*; do
# moveToOutput does not take full paths or wildcards...
moveToOutput "share/man/$(basename "$(dirname "$(dirname "$manFile")")")/man1/xxd.1.gz" "$xxd"
done
'';
meta = with lib; {
description = "The most popular clone of the VI editor";
homepage = "http://www.vim.org";
license = licenses.vim;
maintainers = with maintainers; [ das_j equirosa philiptaron ];
platforms = platforms.unix;
mainProgram = "vim";
outputsToInstall = [ "out" "xxd" ];
};
}