Skip to content

Commit

Permalink
elvis: modernize (NixOS#341950)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksanaa authored Sep 20, 2024
2 parents 75d9568 + 1fec673 commit 5e5abe8
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 51 deletions.
49 changes: 0 additions & 49 deletions pkgs/applications/editors/elvis/default.nix

This file was deleted.

75 changes: 75 additions & 0 deletions pkgs/by-name/el/elvis/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
lib,
fetchurl,
fetchpatch,
installShellFiles,
ncurses,
stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "elvis";
version = "2.2_0";

src = fetchurl {
urls = [
"http://www.the-little-red-haired-girl.org/pub/elvis/elvis-${finalAttrs.version}.tar.gz"
"http://www.the-little-red-haired-girl.org/pub/elvis/old/elvis-${finalAttrs.version}.tar.gz"
];
hash = "sha256-moRmsik3mEQQVrwnlzavOmFrqrovEZQDlsxg/3GSTqA=";
};

patches = [
(fetchpatch {
name = "0000-resolve-stdio-getline-naming-conflict.patch";
url = "https://github.com/mbert/elvis/commit/076cf4ad5cc993be0c6195ec0d5d57e5ad8ac1eb.patch";
hash = "sha256-DCo2caiyE8zV5ss3O1AXy7oNlJ5AzFxdTeBx2Wtg83s=";
})
];

outputs = [
"out"
"man"
];

nativeBuildInputs = [ installShellFiles ];

buildInputs = [ ncurses ];

configureFlags = [ "--ioctl=termios" ];

strictDeps = false;

postPatch = ''
substituteInPlace configure \
--replace-fail '-lcurses' '-lncurses'
'';

installPhase = ''
runHook preInstall
installBin elvis ref elvtags elvfmt
pushd doc
for page in *.man; do
installManPage $page
rm $page
done
popd
mkdir -p $out/share/doc/elvis-${finalAttrs.version}/ $out/share/elvis/
cp -R data/* $out/share/elvis/
cp doc/* $out/share/doc/elvis-${finalAttrs.version}/
runHook postInstall
'';

meta = {
homepage = "http://elvis.the-little-red-haired-girl.org/";
description = "Vi clone for Unix and other operating systems";
license = lib.licenses.free;
mainProgram = "elvis";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
})
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29210,8 +29210,6 @@ with pkgs;
autoreconfHook = buildPackages.autoreconfHook269;
};

elvis = callPackage ../applications/editors/elvis { };

inherit (recurseIntoAttrs (callPackage ../applications/editors/emacs { }))
emacs28
emacs28-gtk2
Expand Down

0 comments on commit 5e5abe8

Please sign in to comment.