1{ stdenv, fetchurl, ncurses, groff }:
2
3stdenv.mkDerivation rec {
4 name = "libedit-20160903-3.1";
5
6 src = fetchurl {
7 url = "http://thrysoee.dk/editline/${name}.tar.gz";
8 sha256 = "0rvmm8z6hal5bbp5pljp7yvkpqi4pkas1amizhvg35v0skkx5jqc";
9 };
10
11 outputs = [ "out" "dev" ];
12
13 # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
14 # NROFF = "${groff}/bin/nroff";
15
16 patches = [ ./01-cygwin.patch ];
17
18 propagatedBuildInputs = [ ncurses ];
19
20 configureFlags = [ "--enable-widec" ];
21
22 postInstall = ''
23 find $out/lib -type f | grep '\.\(la\|pc\)''$' | xargs sed -i \
24 -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
25 '';
26
27 meta = with stdenv.lib; {
28 homepage = http://www.thrysoee.dk/editline/;
29 description = "A port of the NetBSD Editline library (libedit)";
30 license = licenses.bsd3;
31 platforms = platforms.all;
32 };
33}