editline: Enable building with ncurses (#391425)

This commit is contained in:
jade
2025-03-20 13:58:15 -07:00
committed by GitHub
+21 -4
View File
@@ -5,15 +5,23 @@
autoreconfHook,
nix-update-script,
fetchpatch,
ncurses ? null,
# Enable `termcap` (`ncurses`) support.
enableTermcap ? false,
}:
stdenv.mkDerivation rec {
assert lib.assertMsg (
enableTermcap -> ncurses != null
) "`ncurses` must be provided when `enableTermcap` is enabled";
stdenv.mkDerivation (finalAttrs: {
pname = "editline";
version = "1.17.1";
src = fetchFromGitHub {
owner = "troglobit";
repo = "editline";
rev = version;
rev = finalAttrs.version;
sha256 = "sha256-0FeDUVCUahbweH24nfaZwa7j7lSfZh1TnQK7KYqO+3g=";
};
@@ -43,10 +51,19 @@ stdenv.mkDerivation rec {
})
];
configureFlags = [ (lib.enableFeature true "sigstop") ];
configureFlags = [
# Enable SIGSTOP (Ctrl-Z) behavior.
(lib.enableFeature true "sigstop")
# Enable ANSI arrow keys.
(lib.enableFeature true "arrow-keys")
# Use termcap library to query terminal size.
(lib.enableFeature enableTermcap "termcap")
];
nativeBuildInputs = [ autoreconfHook ];
propagatedBuildInputs = lib.optional enableTermcap ncurses;
outputs = [
"out"
"dev"
@@ -63,4 +80,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ oxalica ];
platforms = platforms.all;
};
}
})