aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/misc/rlwrap/default.nix
blob: ac1431d3a1be40e8313486ec3e00c22015b32045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ lib, stdenv, fetchurl, readline }:

stdenv.mkDerivation rec {
  pname = "rlwrap";
  version = "0.43";

  src = fetchurl {
    url = "https://github.com/hanslub42/rlwrap/releases/download/v${version}/${pname}-${version}.tar.gz";
    sha256 = "0bzb7ylk2770iv59v2d0gypb21y2xn87m299s9rqm6rdi2vx11lf";
  };

  buildInputs = [ readline ];

  # Be high-bit-friendly
  preBuild = ''
    sed -i src/readline.c -e "s@[*]p [<] ' '@(*p >= 0) \\&\\& (*p < ' ')@"
  '';

  meta = {
    description = "Readline wrapper for console programs";
    homepage = "https://github.com/hanslub42/rlwrap";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ ];
  };
}