nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 84 lines 1.9 kB view raw
1{ 2 lib, 3 fetchurl, 4 fetchpatch, 5 installShellFiles, 6 ncurses, 7 stdenv, 8}: 9 10stdenv.mkDerivation (finalAttrs: { 11 pname = "elvis"; 12 version = "2.2_0"; 13 14 src = fetchurl { 15 urls = [ 16 "http://www.the-little-red-haired-girl.org/pub/elvis/elvis-${finalAttrs.version}.tar.gz" 17 "http://www.the-little-red-haired-girl.org/pub/elvis/old/elvis-${finalAttrs.version}.tar.gz" 18 ]; 19 hash = "sha256-moRmsik3mEQQVrwnlzavOmFrqrovEZQDlsxg/3GSTqA="; 20 }; 21 22 patches = [ 23 (fetchpatch { 24 name = "0000-resolve-stdio-getline-naming-conflict.patch"; 25 url = "https://github.com/mbert/elvis/commit/076cf4ad5cc993be0c6195ec0d5d57e5ad8ac1eb.patch"; 26 hash = "sha256-DCo2caiyE8zV5ss3O1AXy7oNlJ5AzFxdTeBx2Wtg83s="; 27 }) 28 ]; 29 30 outputs = [ 31 "out" 32 "man" 33 ]; 34 35 nativeBuildInputs = [ installShellFiles ]; 36 37 buildInputs = [ ncurses ]; 38 39 configureFlags = [ 40 "--ioctl=termios" 41 "--libs=-lncurses" 42 ]; 43 44 strictDeps = false; 45 46 postPatch = '' 47 substituteInPlace configure \ 48 --replace-fail '-lcurses' '-lncurses' \ 49 --replace-fail 'if [ -f /usr/include/sys/wait.h ]' 'if true' 50 ''; 51 52 postConfigure = '' 53 echo >>config.h '#undef NEED_MEMMOVE' 54 echo >>config.h '#define NEED_IOCTL_H' 55 ''; 56 57 installPhase = '' 58 runHook preInstall 59 60 installBin elvis ref elvtags elvfmt 61 62 pushd doc 63 for page in *.man; do 64 installManPage $page 65 rm $page 66 done 67 popd 68 69 mkdir -p $out/share/doc/elvis-${finalAttrs.version}/ $out/share/elvis/ 70 cp -R data/* $out/share/elvis/ 71 cp doc/* $out/share/doc/elvis-${finalAttrs.version}/ 72 73 runHook postInstall 74 ''; 75 76 meta = { 77 homepage = "https://elvis.the-little-red-haired-girl.org/"; 78 description = "Vi clone for Unix and other operating systems"; 79 license = lib.licenses.free; 80 mainProgram = "elvis"; 81 maintainers = with lib.maintainers; [ ]; 82 platforms = lib.platforms.unix; 83 }; 84})