From 1533a9aef5ff0cedce866600c9bb8327c4373f99 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 25 Mar 2015 23:17:51 +0100 Subject: [PATCH 1/3] nano: bump to 2.4.0 Also set license, platforms, and add myself as maintainer. Changes in this version include a fully functional undo system, vim-compatible file locking, linter support, formatter support, and improved highlighter flexibility. --- pkgs/applications/editors/nano/default.nix | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index caea8758d958..2e48eadb0a23 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -1,22 +1,22 @@ { stdenv, fetchurl, ncurses, gettext }: -stdenv.mkDerivation (rec { - pname = "nano"; - version = "2.3.6"; - - name = "${pname}-${version}"; - +stdenv.mkDerivation rec { + name = "nano-${version}"; + version = "2.4.0"; src = fetchurl { url = "mirror://gnu/nano/${name}.tar.gz"; - sha256 = "a74bf3f18b12c1c777ae737c0e463152439e381aba8720b4bc67449f36a09534"; + sha256 = "1gbm9bcv4k55y01r5q8a8a9s3yrrgq3z5jxxiij3wl404r8gnxjh"; }; - buildInputs = [ ncurses gettext ]; + configureFlags = '' + --sysconfdir=/etc + ''; - configureFlags = "sysconfdir=/etc"; - - meta = { + meta = with stdenv.lib; { homepage = http://www.nano-editor.org/; description = "A small, user-friendly console text editor"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ joachifm ]; + platforms = platforms.all; }; -}) +} From e1f6d349ec0435b116e1fe810c95f12076f60d54 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 25 Mar 2015 23:21:44 +0100 Subject: [PATCH 2/3] nano: make NLS optional --- pkgs/applications/editors/nano/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index 2e48eadb0a23..1c0238451995 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -1,4 +1,12 @@ -{ stdenv, fetchurl, ncurses, gettext }: +{ stdenv, fetchurl +, ncurses +, gettext ? null +, enableNls ? false +}: + +assert enableNls -> (gettext != null); + +with stdenv.lib; stdenv.mkDerivation rec { name = "nano-${version}"; @@ -7,12 +15,13 @@ stdenv.mkDerivation rec { url = "mirror://gnu/nano/${name}.tar.gz"; sha256 = "1gbm9bcv4k55y01r5q8a8a9s3yrrgq3z5jxxiij3wl404r8gnxjh"; }; - buildInputs = [ ncurses gettext ]; + buildInputs = [ ncurses ] ++ optional enableNls gettext; configureFlags = '' --sysconfdir=/etc + ${optionalString (!enableNls) "--disable-nls"} ''; - meta = with stdenv.lib; { + meta = { homepage = http://www.nano-editor.org/; description = "A small, user-friendly console text editor"; license = licenses.gpl3Plus; From cf74e83057999ef669b79aea687d5c28bf4e445a Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 25 Mar 2015 23:24:27 +0100 Subject: [PATCH 3/3] nano: add option to do tiny build Enabling tiny build reduces the binary to 107K on my system (more than 50% size reduction). --- pkgs/applications/editors/nano/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index 1c0238451995..84c1a79591bc 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -2,6 +2,7 @@ , ncurses , gettext ? null , enableNls ? false +, enableTiny ? false }: assert enableNls -> (gettext != null); @@ -19,6 +20,7 @@ stdenv.mkDerivation rec { configureFlags = '' --sysconfdir=/etc ${optionalString (!enableNls) "--disable-nls"} + ${optionalString enableTiny "--enable-tiny"} ''; meta = {