Nix expr: Use `lib.getExe`

This commit is contained in:
YoshiRulz 2024-12-31 16:51:06 +10:00
parent 2cb6d2c0fc
commit c50a4f4e6a
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 6 additions and 6 deletions

View File

@ -30,10 +30,10 @@
* call as `redirect-output-to-files /target/stdout.txt /target/stderr.txt /path/to/bin arg1 arg2...`
*/
redirectOutputToFiles = writeShellScript "redirect-output-to-files" ''
mktemp='${lib.getBin mktemp}/bin/mktemp'
mktemp='${lib.getExe' mktemp "mktemp"}'
o="$("$mktemp" -u)"
e="$("$mktemp" -u)"
'${lib.getBin mkfifo}/bin/mkfifo' "$o" "$e"
'${lib.getExe' mkfifo "mkfifo"}' "$o" "$e"
tee "$1" <"$o" &
shift
tee "$1" <"$e" | sed "s/.*/$(tput setaf 1)&$(tput sgr0)/" >&2 &
@ -112,7 +112,7 @@
fi
printf "(capturing output in %s/EmuHawkMono_last*.txt)\n" "$PWD" >&2
exec '${redirectOutputToFiles}' EmuHawkMono_laststdout.txt EmuHawkMono_laststderr.txt \
'${lib.getBin bizhawkAssemblies.mono}/bin/mono'${monoProfilerFlag} \
'${lib.getExe bizhawkAssemblies.mono}'${monoProfilerFlag} \
"$mainAppPath" --config=config.json "$@"
'';
in {
@ -137,7 +137,7 @@ in {
${if profileManagedCalls == false then "" else ''printf "Will write profiling results to %s/*.mlpd\n" "$PWD"
''}export MONO_PATH="$BIZHAWK_HOME/dll"
${lib.optionalString (!debugPInvokes) "# "}export MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll # pass `--arg debugPInvokes true` to nix-build to enable
exec '${lib.getBin bizhawkAssemblies.mono}/bin/mono'${monoProfilerFlag} \
exec '${lib.getExe bizhawkAssemblies.mono}'${monoProfilerFlag} \
"$BIZHAWK_HOME/DiscoHawk.exe" "$@"
'';
emuhawkNonNixOS = writeShellScript "emuhawk-mono-wrapper-non-nixos" ''exec '${nixGL}/bin/nixGL' '${emuhawk}' "$@"'';

View File

@ -114,7 +114,7 @@ in {
git
gnome-themes-extra gtk2-x11 libgdiplus libGL lua openal SDL2 udev zstd
buildConfig doCheck extraDefines extraDotnetBuildFlags;
mono = if mono != null
mono = lib.recursiveUpdate { meta.mainProgram = "mono"; } (if mono != null
then mono # allow older Mono if set explicitly
else if isVersionAtLeast "6.12.0.151" pkgs.mono.version
then pkgs.mono
@ -122,7 +122,7 @@ in {
(import (fetchzip {
url = "https://github.com/NixOS/nixpkgs/archive/23.05.tar.gz";
hash = "sha512-REPJ9fRKxTefvh1d25MloT4bXJIfxI+1EvfVWq644Tzv+nuq2BmiGMiBNmBkyN9UT5fl2tdjqGliye3gZGaIGg==";
}) { inherit system; }).mono;
}) { inherit system; }).mono);
monoBasic = fetchzip {
url = "https://download.mono-project.com/repo/debian/pool/main/m/mono-basic/libmono-microsoft-visualbasic10.0-cil_4.7-0xamarin3+debian9b1_all.deb";
nativeBuildInputs = [ dpkg ];