Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
60 lines
1.4 KiB
Plaintext
60 lines
1.4 KiB
Plaintext
#!@stdenv_shell@ -e
|
|
|
|
export NIXPKGS_DF_EXE="@dfExe@"
|
|
export NIXPKGS_DF_GAME=1
|
|
source @dfInit@
|
|
|
|
# All potential important files in DF 50 and below.
|
|
for path in dwarfort dwarfort.exe df *.so* libs raw data/init/* data/!(init|index|announcement); do
|
|
force_delete=0
|
|
if [[ "$path" == *fmod*.so* ]] && [ "${_NIXPKGS_DF_OPTS[fmod]}" -eq 0 ]; then
|
|
# Delete fmod plugins if we're using SDL_mixer.
|
|
force_delete=1
|
|
elif [[ "$path" == *mixer*.so* ]] && [ "${_NIXPKGS_DF_OPTS[fmod]}" -ne 0 ]; then
|
|
# Delete SDL_mixer plugins if we're using fmod.
|
|
force_delete=1
|
|
fi
|
|
|
|
if [ -e "$path" ] && [ "$force_delete" -eq 0 ]; then
|
|
update_path "$path"
|
|
else
|
|
cleanup_path "$path"
|
|
fi
|
|
done
|
|
|
|
# These need to be copied due to read only flags on older versions of DF.
|
|
for path in index announcement help dipscript; do
|
|
forcecopy_path "data/$path"
|
|
done
|
|
|
|
# If we're switching back from dfhack to vanilla, cleanup all dfhack
|
|
# links so Dwarf Fortress doesn't autoload its leftover libdfhooks.so.
|
|
# Otherwise, populate them.
|
|
dfhack_files=(
|
|
dfhack
|
|
dfhack-run
|
|
.dfhackrc
|
|
libdfhooks.so
|
|
dfhack-config/default
|
|
dfhack-config/init
|
|
hack/*
|
|
stonesense/*
|
|
*.init *.init-example
|
|
)
|
|
|
|
if [ "${NIXPKGS_DF_EXE##*/}" == dfhack ]; then
|
|
for i in "${dfhack_files[@]}"; do
|
|
if [ -e "$i" ]; then
|
|
update_path "$i"
|
|
else
|
|
cleanup_path "$i"
|
|
fi
|
|
done
|
|
else
|
|
for i in "${dfhack_files[@]}"; do
|
|
cleanup_path "$i"
|
|
done
|
|
fi
|
|
|
|
go "$@"
|