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

38 lines
941 B
Nix
Raw Normal View History

2015-03-25 15:21:44 -07:00
{ stdenv, fetchurl
, ncurses
, gettext ? null
2015-03-25 21:48:13 -07:00
, enableNls ? true
, enableTiny ? false
2015-03-25 15:21:44 -07:00
}:
assert enableNls -> (gettext != null);
with stdenv.lib;
stdenv.mkDerivation rec {
name = "nano-${version}";
2015-07-18 02:44:54 -07:00
version = "2.4.2";
src = fetchurl {
url = "mirror://gnu/nano/${name}.tar.gz";
2015-07-18 02:44:54 -07:00
sha256 = "1fb5gzdm3jdx1f2vyanjvdmppaz082lf4kinyffnssgmzhc7zkf8";
};
2015-03-25 15:21:44 -07:00
buildInputs = [ ncurses ] ++ optional enableNls gettext;
configureFlags = ''
--sysconfdir=/etc
2015-03-25 15:21:44 -07:00
${optionalString (!enableNls) "--disable-nls"}
${optionalString enableTiny "--enable-tiny"}
'';
2015-03-27 12:05:19 -07:00
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace src/text.c --replace "__time_t" "time_t"
'';
2015-03-25 15:21:44 -07:00
meta = {
homepage = http://www.nano-editor.org/;
description = "A small, user-friendly console text editor";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ joachifm ];
platforms = platforms.all;
};
}