ed: refactor

A crazy refactor that factors the sources to a separate file, in order to
accomodate extra sources in parallel to the stable one.
This commit is contained in:
Anderson Torres 2023-07-29 00:35:01 -03:00
parent f8579c6c72
commit 9d5713843f
4 changed files with 77 additions and 41 deletions

View File

@ -1,42 +1,13 @@
{ lib, stdenv, fetchurl, lzip }:
{ lib, pkgs }:
# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
# cgit) that are needed here should be included directly in Nixpkgs as
# files.
lib.makeScope pkgs.newScope (self:
let
inherit (self) callPackage;
in {
sources = import ./sources.nix {
inherit lib;
inherit (pkgs) fetchurl;
};
stdenv.mkDerivation rec {
pname = "ed";
version = "1.19";
src = fetchurl {
url = "mirror://gnu/ed/${pname}-${version}.tar.lz";
hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg=";
};
nativeBuildInputs = [ lzip ];
configureFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
doCheck = true;
meta = {
description = "An implementation of the standard Unix editor";
longDescription = ''
GNU ed is a line-oriented text editor. It is used to create,
display, modify and otherwise manipulate text files, both
interactively and via shell scripts. A restricted version of ed,
red, can only edit files in the current directory and cannot
execute shell commands. Ed is the "standard" text editor in the
sense that it is the original editor for Unix, and thus widely
available. For most purposes, however, it is superseded by
full-screen editors such as GNU Emacs or GNU Moe.
'';
license = lib.licenses.gpl3Plus;
homepage = "https://www.gnu.org/software/ed/";
maintainers = [ ];
platforms = lib.platforms.unix;
};
}
ed = callPackage (self.sources.ed) { };
})

View File

@ -0,0 +1,30 @@
{ pname
, version
, src
, patches ? [ ]
, meta
}:
# Note: this package is used for bootstrapping fetchurl, and thus cannot use
# fetchpatch! All mutable patches (generated by GitHub or cgit) that are needed
# here should be included directly in Nixpkgs as files.
{ lib
, stdenv
, fetchurl
, lzip
}:
stdenv.mkDerivation {
inherit pname version src patches;
nativeBuildInputs = [ lzip ];
configureFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
doCheck = true;
inherit meta;
}

View File

@ -0,0 +1,34 @@
{ lib
, fetchurl
}:
let
meta = {
description = "The GNU implementation of the standard Unix editor";
longDescription = ''
GNU ed is a line-oriented text editor. It is used to create, display,
modify and otherwise manipulate text files, both interactively and via
shell scripts. A restricted version of ed, red, can only edit files in the
current directory and cannot execute shell commands. Ed is the 'standard'
text editor in the sense that it is the original editor for Unix, and thus
widely available. For most purposes, however, it is superseded by
full-screen editors such as GNU Emacs or GNU Moe.
'';
license = lib.licenses.gpl3Plus;
homepage = "https://www.gnu.org/software/ed/";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
in
{
ed = let
pname = "ed";
version = "1.19";
src = fetchurl {
url = "mirror://gnu/ed/ed-${version}.tar.lz";
hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg=";
};
in import ./generic.nix {
inherit pname version src meta;
};
}

View File

@ -30991,7 +30991,8 @@ with pkgs;
ecs-agent = callPackage ../applications/virtualization/ecs-agent { };
ed = callPackage ../applications/editors/ed { };
inherit (recurseIntoAttrs (callPackage ../applications/editors/ed { }))
ed;
edbrowse = callPackage ../applications/editors/edbrowse { };