2017-07-12 01:54:13 +00:00
|
|
|
{ stdenv, hostPlatform, fetchurl, fetchFromGitHub
|
2015-03-25 22:21:44 +00:00
|
|
|
, ncurses
|
2016-02-28 02:01:34 +00:00
|
|
|
, texinfo
|
2015-03-25 22:21:44 +00:00
|
|
|
, gettext ? null
|
2015-03-26 04:48:13 +00:00
|
|
|
, enableNls ? true
|
2015-03-25 22:24:27 +00:00
|
|
|
, enableTiny ? false
|
2015-03-25 22:21:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert enableNls -> (gettext != null);
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2010-07-28 11:55:54 +00:00
|
|
|
|
2017-01-18 11:05:30 +00:00
|
|
|
let
|
|
|
|
nixSyntaxHighlight = fetchFromGitHub {
|
|
|
|
owner = "seitz";
|
|
|
|
repo = "nanonix";
|
|
|
|
rev = "17e0de65e1cbba3d6baa82deaefa853b41f5c161";
|
|
|
|
sha256 = "1g51h65i31andfs2fbp1v3vih9405iknqn11fzywjxji00kjqv5s";
|
|
|
|
};
|
2017-03-19 21:36:48 +00:00
|
|
|
|
2017-01-18 11:05:30 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2015-03-25 22:17:51 +00:00
|
|
|
name = "nano-${version}";
|
2017-08-29 10:42:00 +00:00
|
|
|
version = "2.8.7";
|
2017-04-05 01:04:39 +00:00
|
|
|
|
2004-10-06 13:17:06 +00:00
|
|
|
src = fetchurl {
|
2016-09-02 21:26:02 +00:00
|
|
|
url = "mirror://gnu/nano/${name}.tar.xz";
|
2017-08-29 10:42:00 +00:00
|
|
|
sha256 = "0nhns59smd43mad2w6lnaxqnj4h6ifnlivi6cwydg646jm31gqzv";
|
2004-10-06 13:17:06 +00:00
|
|
|
};
|
2017-03-19 21:36:48 +00:00
|
|
|
|
2016-03-07 18:34:44 +00:00
|
|
|
nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext;
|
|
|
|
buildInputs = [ ncurses ];
|
2017-04-05 01:04:39 +00:00
|
|
|
|
2016-02-28 02:01:34 +00:00
|
|
|
outputs = [ "out" "info" ];
|
2017-04-05 01:04:39 +00:00
|
|
|
|
2015-03-25 22:17:51 +00:00
|
|
|
configureFlags = ''
|
|
|
|
--sysconfdir=/etc
|
2015-03-25 22:21:44 +00:00
|
|
|
${optionalString (!enableNls) "--disable-nls"}
|
2015-03-25 22:24:27 +00:00
|
|
|
${optionalString enableTiny "--enable-tiny"}
|
2015-03-27 19:05:19 +00:00
|
|
|
'';
|
|
|
|
|
2017-01-18 11:05:30 +00:00
|
|
|
postInstall = ''
|
|
|
|
cp ${nixSyntaxHighlight}/nix.nanorc $out/share/nano/
|
|
|
|
'';
|
|
|
|
|
2015-03-25 22:21:44 +00:00
|
|
|
meta = {
|
2017-05-21 15:53:39 +00:00
|
|
|
homepage = https://www.nano-editor.org/;
|
2008-02-18 14:59:48 +00:00
|
|
|
description = "A small, user-friendly console text editor";
|
2015-03-25 22:17:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2016-10-29 20:41:48 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
jgeerds
|
|
|
|
joachifm
|
|
|
|
];
|
2015-03-25 22:17:51 +00:00
|
|
|
platforms = platforms.all;
|
2008-01-30 19:49:42 +00:00
|
|
|
};
|
2015-03-25 22:17:51 +00:00
|
|
|
}
|