···11+{ fetchurl, stdenv, lib, ncurses
22+}:
33+44+stdenv.mkDerivation rec {
55+ pname = "readline";
66+ version = "8.1p${toString (builtins.length upstreamPatches)}";
77+88+ src = fetchurl {
99+ url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz";
1010+ sha256 = "00ibp0n9crbwx15k9vvckq5wsipw98b1px8pd8i34chy2gpb9kpq";
1111+ };
1212+1313+ outputs = [ "out" "dev" "man" "doc" "info" ];
1414+1515+ propagatedBuildInputs = [ncurses];
1616+1717+ patchFlags = [ "-p0" ];
1818+1919+ upstreamPatches =
2020+ (let
2121+ patch = nr: sha256:
2222+ fetchurl {
2323+ url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline81-${nr}";
2424+ inherit sha256;
2525+ };
2626+ in
2727+ import ./readline-8.1-patches.nix patch);
2828+2929+ patches =
3030+ [ ./link-against-ncurses.patch
3131+ ./no-arch_only-6.3.patch
3232+ ]
3333+ ++ upstreamPatches;
3434+3535+ meta = with lib; {
3636+ description = "Library for interactive line editing";
3737+3838+ longDescription = ''
3939+ The GNU Readline library provides a set of functions for use by
4040+ applications that allow users to edit command lines as they are
4141+ typed in. Both Emacs and vi editing modes are available. The
4242+ Readline library includes additional functions to maintain a
4343+ list of previously-entered command lines, to recall and perhaps
4444+ reedit those lines, and perform csh-like history expansion on
4545+ previous commands.
4646+4747+ The history facilities are also placed into a separate library,
4848+ the History library, as part of the build process. The History
4949+ library may be used without Readline in applications which
5050+ desire its capabilities.
5151+ '';
5252+5353+ homepage = "https://savannah.gnu.org/projects/readline/";
5454+5555+ license = licenses.gpl3Plus;
5656+5757+ maintainers = with maintainers; [ dtzWill ];
5858+5959+ platforms = platforms.unix;
6060+ branch = "8.1";
6161+ };
6262+}