lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, pcre2
5, uthash
6, lua5_4
7, makeWrapper
8, installShellFiles
9}:
10
11stdenv.mkDerivation rec {
12 pname = "mle";
13 version = "1.7.2";
14
15 src = fetchFromGitHub {
16 owner = "adsr";
17 repo = "mle";
18 rev = "v${version}";
19 sha256 = "0rkk7mh6w5y1lrbdv7wmxdgl5cqzpzw0p26adazkqlfdyb6wbj9k";
20 };
21
22 # Fix location of Lua 5.4 header and library
23 postPatch = ''
24 substituteInPlace Makefile --replace "-llua5.4" "-llua";
25 substituteInPlace mle.h --replace "<lua5.4/" "<";
26 patchShebangs tests/*
27 '';
28
29 nativeBuildInputs = [ makeWrapper installShellFiles ];
30
31 buildInputs = [ pcre2 uthash lua5_4 ];
32
33 doCheck = true;
34
35 installFlags = [ "prefix=${placeholder "out"}" ];
36
37 postInstall = ''
38 installManPage mle.1
39 '';
40
41 meta = with lib; {
42 description = "Small, flexible, terminal-based text editor";
43 homepage = "https://github.com/adsr/mle";
44 license = licenses.asl20;
45 platforms = platforms.unix;
46 maintainers = with maintainers; [ adsr ];
47 };
48}