nixpkgs/pkgs/applications/editors/nano/default.nix

60 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, fetchFromGitHub
2015-03-25 23:21:44 +01:00
, ncurses
, texinfo
2015-03-25 23:21:44 +01:00
, gettext ? null
2015-03-26 05:48:13 +01:00
, enableNls ? true
, enableTiny ? false
2015-03-25 23:21:44 +01:00
}:
assert enableNls -> (gettext != null);
with stdenv.lib;
let
nixSyntaxHighlight = fetchFromGitHub {
owner = "seitz";
repo = "nanonix";
rev = "17e0de65e1cbba3d6baa82deaefa853b41f5c161";
sha256 = "1g51h65i31andfs2fbp1v3vih9405iknqn11fzywjxji00kjqv5s";
};
2017-03-19 22:36:48 +01:00
in stdenv.mkDerivation rec {
name = "nano-${version}";
2017-03-19 22:36:48 +01:00
version = "2.7.5";
src = fetchurl {
2016-09-02 23:26:02 +02:00
url = "mirror://gnu/nano/${name}.tar.xz";
2017-03-19 22:36:48 +01:00
sha256 = "1r37gqx7hppqbgsbclchiis8wzzpb9srm3q3dlvlii2gpkk28kd6";
};
2017-03-19 22:36:48 +01:00
nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext;
buildInputs = [ ncurses ];
2017-03-19 22:36:48 +01:00
outputs = [ "out" "info" ];
2017-03-19 22:36:48 +01:00
configureFlags = ''
--sysconfdir=/etc
2015-03-25 23:21:44 +01:00
${optionalString (!enableNls) "--disable-nls"}
${optionalString enableTiny "--enable-tiny"}
'';
2017-03-19 22:36:48 +01:00
postPatch = optionalString stdenv.isDarwin ''
2015-03-27 20:05:19 +01:00
substituteInPlace src/text.c --replace "__time_t" "time_t"
'';
postInstall = ''
cp ${nixSyntaxHighlight}/nix.nanorc $out/share/nano/
'';
2015-03-25 23:21:44 +01:00
meta = {
homepage = http://www.nano-editor.org/;
description = "A small, user-friendly console text editor";
license = licenses.gpl3Plus;
2016-10-29 22:41:48 +02:00
maintainers = with maintainers; [
jgeerds
joachifm
];
platforms = platforms.all;
};
}