Skip to content

Commit

Permalink
Fix TERMINFO path for Nix release builds (#731)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elopez authored Mar 7, 2022
1 parent a729ef9 commit f76a7f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macos-release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in
macdylibbundler
darwin.sigtool
darwin.cctools
perl
];
} ''
mkdir -p $out/bin
Expand All @@ -22,6 +23,9 @@ in
-d $out/bin \
-p '@executable_path'
# fix TERMINFO path in ncurses binary
perl -i -pe 's#(${pkgs.ncurses}/share/terminfo)#"/usr/share/terminfo" . "\x0" x (length($1) - 19)#e' $out/bin/libncursesw.6.dylib
# re-sign the binaries since the load paths were modified
codesign -s - -f $out/bin/*
tar -czvf $out/echidna-${echidna.version}-${stdenv.system}.tar.gz -C $out/bin .
Expand Down

0 comments on commit f76a7f4

Please sign in to comment.