only wrap elf binaries and not scripts

This commit is contained in:
xenia 2025-09-27 00:34:01 -04:00
parent 843f6f1b46
commit fc5b593038
1 changed files with 18 additions and 1 deletions

View File

@ -87,8 +87,25 @@ minimal.overrideAttrs (
export XDG_CACHE_HOME=$(mktemp -d) export XDG_CACHE_HOME=$(mktemp -d)
''; '';
preFixup = lib.optionalString (!isDarwin) '' # Disable automatic wrapping, and only wrap the ELF binaries:
#
# - bin/racket
# - lib/racket/gracket
# - bin/mred
# - bin/mzscheme
#
# This avoids effectively double-wrapping shell scripts generated by raco, because they will
# call into the wrapped ELF binaries
dontWrapGApps = true;
preFixup = (lib.optionalString (!isDarwin) ''
gappsWrapperArgs+=("--set" "LOCALE_ARCHIVE" "${glibcLocales}/lib/locale/locale-archive") gappsWrapperArgs+=("--set" "LOCALE_ARCHIVE" "${glibcLocales}/lib/locale/locale-archive")
'') + ''
wrapProgram $out/bin/racket "''${gappsWrapperArgs[@]}"
wrapProgram $out/bin/mred "''${gappsWrapperArgs[@]}"
wrapProgram $out/bin/mzscheme "''${gappsWrapperArgs[@]}"
wrapProgram $out/lib/racket/gracket "''${gappsWrapperArgs[@]}"
''; '';
passthru = passthru =