2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, ncurses }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libedit";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "20221030-3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz";
|
2023-03-27 19:17:25 +00:00
|
|
|
sha256 = "sha256-8JJaWt9LG/EW7hl2a32qdmkXrsGYdHlDscTt9npL4rs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
|
|
|
|
# NROFF = "${groff}/bin/nroff";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# GCC automatically include `stdc-predefs.h` while Clang does not do
|
|
|
|
# this by default. While Musl is ISO 10646 compliant, doesn't define
|
|
|
|
# __STDC_ISO_10646__. This definition is in `stdc-predefs.h` that's
|
|
|
|
# why libedit builds just fine with GCC and Musl.
|
|
|
|
# There is a DR to fix this issue with Clang which is not merged
|
|
|
|
# yet.
|
|
|
|
# https://reviews.llvm.org/D137043
|
2024-01-25 14:12:00 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE =
|
|
|
|
lib.optionalString (stdenv.targetPlatform.isMusl && stdenv.cc.isClang)
|
|
|
|
"-D__STDC_ISO_10646__=201103L";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [ ./01-cygwin.patch ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ ncurses ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
find $out/lib -type f | grep '\.\(la\|pc\)''$' | xargs sed -i \
|
|
|
|
-e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.thrysoee.dk/editline/";
|
|
|
|
description = "A port of the NetBSD Editline library (libedit)";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|