···11-{ lib, stdenv, fetchurl, lzip }:
22-33-# Note: this package is used for bootstrapping fetchurl, and thus
44-# cannot use fetchpatch! All mutable patches (generated by GitHub or
55-# cgit) that are needed here should be included directly in Nixpkgs as
66-# files.
11+{ lib, pkgs }:
7288-stdenv.mkDerivation rec {
99- pname = "ed";
1010- version = "1.19";
1111-1212- src = fetchurl {
1313- url = "mirror://gnu/ed/${pname}-${version}.tar.lz";
1414- hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg=";
1515- };
33+lib.makeScope pkgs.newScope (self:
44+ let
55+ inherit (self) callPackage;
66+ in {
77+ sources = import ./sources.nix {
88+ inherit lib;
99+ inherit (pkgs) fetchurl;
1010+ };
16111717- nativeBuildInputs = [ lzip ];
1818-1919- configureFlags = [
2020- "CC=${stdenv.cc.targetPrefix}cc"
2121- ];
2222-2323- doCheck = true;
2424-2525- meta = {
2626- description = "An implementation of the standard Unix editor";
2727- longDescription = ''
2828- GNU ed is a line-oriented text editor. It is used to create,
2929- display, modify and otherwise manipulate text files, both
3030- interactively and via shell scripts. A restricted version of ed,
3131- red, can only edit files in the current directory and cannot
3232- execute shell commands. Ed is the "standard" text editor in the
3333- sense that it is the original editor for Unix, and thus widely
3434- available. For most purposes, however, it is superseded by
3535- full-screen editors such as GNU Emacs or GNU Moe.
3636- '';
3737- license = lib.licenses.gpl3Plus;
3838- homepage = "https://www.gnu.org/software/ed/";
3939- maintainers = [ ];
4040- platforms = lib.platforms.unix;
4141- };
4242-}
1212+ ed = callPackage (self.sources.ed) { };
1313+ })
+30
pkgs/applications/editors/ed/generic.nix
···11+{ pname
22+, version
33+, src
44+, patches ? [ ]
55+, meta
66+}:
77+88+# Note: this package is used for bootstrapping fetchurl, and thus cannot use
99+# fetchpatch! All mutable patches (generated by GitHub or cgit) that are needed
1010+# here should be included directly in Nixpkgs as files.
1111+1212+{ lib
1313+, stdenv
1414+, fetchurl
1515+, lzip
1616+}:
1717+1818+stdenv.mkDerivation {
1919+ inherit pname version src patches;
2020+2121+ nativeBuildInputs = [ lzip ];
2222+2323+ configureFlags = [
2424+ "CC=${stdenv.cc.targetPrefix}cc"
2525+ ];
2626+2727+ doCheck = true;
2828+2929+ inherit meta;
3030+}
+34
pkgs/applications/editors/ed/sources.nix
···11+{ lib
22+, fetchurl
33+}:
44+55+let
66+ meta = {
77+ description = "The GNU implementation of the standard Unix editor";
88+ longDescription = ''
99+ GNU ed is a line-oriented text editor. It is used to create, display,
1010+ modify and otherwise manipulate text files, both interactively and via
1111+ shell scripts. A restricted version of ed, red, can only edit files in the
1212+ current directory and cannot execute shell commands. Ed is the 'standard'
1313+ text editor in the sense that it is the original editor for Unix, and thus
1414+ widely available. For most purposes, however, it is superseded by
1515+ full-screen editors such as GNU Emacs or GNU Moe.
1616+ '';
1717+ license = lib.licenses.gpl3Plus;
1818+ homepage = "https://www.gnu.org/software/ed/";
1919+ maintainers = with lib.maintainers; [ AndersonTorres ];
2020+ platforms = lib.platforms.unix;
2121+ };
2222+in
2323+{
2424+ ed = let
2525+ pname = "ed";
2626+ version = "1.19";
2727+ src = fetchurl {
2828+ url = "mirror://gnu/ed/ed-${version}.tar.lz";
2929+ hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg=";
3030+ };
3131+ in import ./generic.nix {
3232+ inherit pname version src meta;
3333+ };
3434+}