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