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