From 8e568bfd2551842a78247752caeedea76e2e4fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Tue, 31 Oct 2023 13:25:17 -0300 Subject: [PATCH] Fix TERMINFO path for Nix release builds on Linux ncurses in Nix is built with a TERMINFO path that references `/nix`. This causes the binaries fail when ran on non-nix systems, unless TERMINFO=/usr/share/terminfo is exported. This patches the binaries to use a more sensible default TERMINFO path. See also commit f76a7f4a --- flake.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 88f0674cd..145968a41 100644 --- a/flake.nix +++ b/flake.nix @@ -95,8 +95,13 @@ codesign_allocate = "${pkgs.darwin.binutils.bintools}/bin/codesign_allocate"; codesign = "${pkgs.darwin.sigtool}/bin/codesign"; in if pkgs.stdenv.isLinux - then pkgs.haskell.lib.dontCheck echidna-static - else pkgs.runCommand "echidna-stripNixRefs" {} '' + then pkgs.runCommand "echidna-stripNixRefs" {} '' + mkdir -p $out/bin + cp ${pkgs.haskell.lib.dontCheck echidna-static}/bin/echidna $out/bin/ + # fix TERMINFO path in ncurses + ${perl} -i -pe 's#(${pkgs.ncurses}/share/terminfo)#"/usr/share/terminfo" . "\x0" x (length($1) - 19)#e' $out/bin/echidna + chmod 555 $out/bin/echidna + '' else pkgs.runCommand "echidna-stripNixRefs" {} '' mkdir -p $out/bin cp ${pkgs.haskell.lib.dontCheck echidna-static}/bin/echidna $out/bin/ # get the list of dynamic libs from otool and tidy the output