2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, pcre2
|
2022-07-18 16:21:45 +00:00
|
|
|
, uthash
|
|
|
|
, lua5_4
|
|
|
|
, makeWrapper
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mle";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.7.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "adsr";
|
|
|
|
repo = "mle";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "0rkk7mh6w5y1lrbdv7wmxdgl5cqzpzw0p26adazkqlfdyb6wbj9k";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
# Fix location of Lua 5.4 header and library
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
2022-07-18 16:21:45 +00:00
|
|
|
substituteInPlace Makefile --replace "-llua5.4" "-llua";
|
|
|
|
substituteInPlace mle.h --replace "<lua5.4/" "<";
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs tests/*
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [ pcre2 uthash lua5_4 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installFlags = [ "prefix=${placeholder "out"}" ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage mle.1
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Small, flexible, terminal-based text editor";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/adsr/mle";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ adsr ];
|
|
|
|
};
|
|
|
|
}
|