ledit: fix broken executable

Prior to this change ledit failed with a 127 exit code:

    $ ledit
    no bytecode file specified
    $ echo hello | ledit cat
    the file 'cat' has not the right magic number: expected Caml1999X036

Upstream builds ledit with `ocamlc -custom`, which attaches the program
to the end of the executable. Stripping drops it again.
With dontStrip the program stays in place:

    $ echo hello | ledit cat
    hello
    hello

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
This commit is contained in:
Matthias J. Kannwischer
2026-09-14 18:22:18 +08:00
parent 53b924654d
commit 0fc86dedef

View File

@@ -22,6 +22,8 @@ stdenv.mkDerivation {
strictDeps = true;
dontStrip = true;
nativeBuildInputs = with ocamlPackages; [
ocaml
findlib
@@ -33,6 +35,15 @@ stdenv.mkDerivation {
camlp-streams
];
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
echo hello | $out/bin/ledit -h /dev/null cat > ledit-check.out
grep -q hello ledit-check.out
runHook postInstallCheck
'';
meta = {
homepage = "http://pauillac.inria.fr/~ddr/ledit/";
description = "Line editor, allowing to use shell commands with control characters like in emacs";