3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/editors/nano/default.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, fetchFromGitHub
2015-03-25 22:21:44 +00:00
, ncurses
, texinfo
2015-03-25 22:21:44 +00:00
, gettext ? null
2015-03-26 04:48:13 +00:00
, enableNls ? true
, enableTiny ? false
2015-03-25 22:21:44 +00:00
}:
assert enableNls -> (gettext != null);
with stdenv.lib;
let
nixSyntaxHighlight = fetchFromGitHub {
owner = "seitz";
repo = "nanonix";
rev = "bf8d898efaa10dce3f7972ff765b58c353b4b4ab";
sha256 = "0773s5iz8aw9npgyasb0r2ybp6gvy2s9sq51az8w7h52bzn5blnn";
};
2017-03-19 21:36:48 +00:00
in stdenv.mkDerivation rec {
pname = "nano";
version = "4.6";
2017-04-05 02:04:39 +01:00
src = fetchurl {
url = "mirror://gnu/nano/${pname}-${version}.tar.xz";
sha256 = "1s98jsvkfar6qmd5n5l1n1k59623dnc93ciyvlhxjkvpad0kmb4v";
};
2017-03-19 21:36:48 +00:00
nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext;
buildInputs = [ ncurses ];
2017-04-05 02:04:39 +01:00
outputs = [ "out" "info" ];
2017-04-05 02:04:39 +01:00
configureFlags = [
"--sysconfdir=/etc"
(stdenv.lib.enableFeature enableNls "nls")
(stdenv.lib.enableFeature enableTiny "tiny")
];
2015-03-27 19:05:19 +00:00
patches = [
(fetchurl {
# fix compilation on macOS, where 'st_mtim' is unknown
# upstream patch not in 4.6
url = "https://git.savannah.gnu.org/cgit/nano.git/patch/?id=f516cddce749c3bf938271ef3182b9169ac8cbcc";
sha256 = "0gqymvr5vxxypr7y3sm252rsi4gjqp597l01x0lkxyvxsn45a4sx";
})
];
postInstall = ''
cp ${nixSyntaxHighlight}/nix.nanorc $out/share/nano/
'';
enableParallelBuilding = true;
2015-03-25 22:21:44 +00:00
meta = {
homepage = https://www.nano-editor.org/;
description = "A small, user-friendly console text editor";
license = licenses.gpl3Plus;
2016-10-29 21:41:48 +01:00
maintainers = with maintainers; [
joachifm
];
platforms = platforms.all;
};
}