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.

+77 -41
+11 -40
pkgs/applications/editors/ed/default.nix
··· 1 - { lib, stdenv, fetchurl, lzip }: 2 - 3 - # Note: this package is used for bootstrapping fetchurl, and thus 4 - # cannot use fetchpatch! All mutable patches (generated by GitHub or 5 - # cgit) that are needed here should be included directly in Nixpkgs as 6 - # files. 1 + { lib, pkgs }: 7 2 8 - stdenv.mkDerivation rec { 9 - pname = "ed"; 10 - version = "1.19"; 11 - 12 - src = fetchurl { 13 - url = "mirror://gnu/ed/${pname}-${version}.tar.lz"; 14 - hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg="; 15 - }; 3 + lib.makeScope pkgs.newScope (self: 4 + let 5 + inherit (self) callPackage; 6 + in { 7 + sources = import ./sources.nix { 8 + inherit lib; 9 + inherit (pkgs) fetchurl; 10 + }; 16 11 17 - nativeBuildInputs = [ lzip ]; 18 - 19 - configureFlags = [ 20 - "CC=${stdenv.cc.targetPrefix}cc" 21 - ]; 22 - 23 - doCheck = true; 24 - 25 - meta = { 26 - description = "An implementation of the standard Unix editor"; 27 - longDescription = '' 28 - GNU ed is a line-oriented text editor. It is used to create, 29 - display, modify and otherwise manipulate text files, both 30 - interactively and via shell scripts. A restricted version of ed, 31 - red, can only edit files in the current directory and cannot 32 - execute shell commands. Ed is the "standard" text editor in the 33 - sense that it is the original editor for Unix, and thus widely 34 - available. For most purposes, however, it is superseded by 35 - full-screen editors such as GNU Emacs or GNU Moe. 36 - ''; 37 - license = lib.licenses.gpl3Plus; 38 - homepage = "https://www.gnu.org/software/ed/"; 39 - maintainers = [ ]; 40 - platforms = lib.platforms.unix; 41 - }; 42 - } 12 + ed = callPackage (self.sources.ed) { }; 13 + })
+30
pkgs/applications/editors/ed/generic.nix
··· 1 + { pname 2 + , version 3 + , src 4 + , patches ? [ ] 5 + , meta 6 + }: 7 + 8 + # Note: this package is used for bootstrapping fetchurl, and thus cannot use 9 + # fetchpatch! All mutable patches (generated by GitHub or cgit) that are needed 10 + # here should be included directly in Nixpkgs as files. 11 + 12 + { lib 13 + , stdenv 14 + , fetchurl 15 + , lzip 16 + }: 17 + 18 + stdenv.mkDerivation { 19 + inherit pname version src patches; 20 + 21 + nativeBuildInputs = [ lzip ]; 22 + 23 + configureFlags = [ 24 + "CC=${stdenv.cc.targetPrefix}cc" 25 + ]; 26 + 27 + doCheck = true; 28 + 29 + inherit meta; 30 + }
+34
pkgs/applications/editors/ed/sources.nix
··· 1 + { lib 2 + , fetchurl 3 + }: 4 + 5 + let 6 + meta = { 7 + description = "The GNU implementation of the standard Unix editor"; 8 + longDescription = '' 9 + GNU ed is a line-oriented text editor. It is used to create, display, 10 + modify and otherwise manipulate text files, both interactively and via 11 + shell scripts. A restricted version of ed, red, can only edit files in the 12 + current directory and cannot execute shell commands. Ed is the 'standard' 13 + text editor in the sense that it is the original editor for Unix, and thus 14 + widely available. For most purposes, however, it is superseded by 15 + full-screen editors such as GNU Emacs or GNU Moe. 16 + ''; 17 + license = lib.licenses.gpl3Plus; 18 + homepage = "https://www.gnu.org/software/ed/"; 19 + maintainers = with lib.maintainers; [ AndersonTorres ]; 20 + platforms = lib.platforms.unix; 21 + }; 22 + in 23 + { 24 + ed = let 25 + pname = "ed"; 26 + version = "1.19"; 27 + src = fetchurl { 28 + url = "mirror://gnu/ed/ed-${version}.tar.lz"; 29 + hash = "sha256-zi8uXEJHkKqW0J2suT2bv9wLfrYknJy3U4RS6Ox3zUg="; 30 + }; 31 + in import ./generic.nix { 32 + inherit pname version src meta; 33 + }; 34 + }
+2 -1
pkgs/top-level/all-packages.nix
··· 30991 30991 30992 30992 ecs-agent = callPackage ../applications/virtualization/ecs-agent { }; 30993 30993 30994 - ed = callPackage ../applications/editors/ed { }; 30994 + inherit (recurseIntoAttrs (callPackage ../applications/editors/ed { })) 30995 + ed; 30995 30996 30996 30997 edbrowse = callPackage ../applications/editors/edbrowse { }; 30997 30998