Documentation of the haskell code for Defect Process, a 2d hack n' slash game on Steam. The partial source code is available on GitHub.
[Brief Overview] | [Cross-platform Notes] | [Additional Links]
.dllfiles are copied into the same directory as the
mt.exe -manifest defect-process.exe.manifest -outputresource:defect-process.exe
ResourceHacker.exe -open defect-process.exe -save defect-process.exe -action addoverwrite -res icon.ico -mask ICONGROUP,MAINICON,
ldd defect-processlists the library files used, which are copied into the local
./libif not already provided by the Steam Linux Runtime (e.g. SDL2 will be preinstalled).
./libdirectory is done by adding the following lines to
ld-options: - -Wl,-rpath=$ORIGIN/liband running
patchelf --set-rpath '$$ORIGIN/lib' defect-process.
otool -L defect-processlists the dylib files used, which are copied into the local
./libif not already provided by the standard macOS environment (e.g. libSystem).
./libdirectory is done by running:
install_name_tool -add_rpath @executable_path/lib defect-process
otool -Lon that file to check for which dylib paths for that dylib itself need updating:
# Updating dylib paths for lib/libSDL2_image-2.0.0.dylib install_name_tool -change /usr/lib/libz.1.dylib @executable_path/lib/libz.1.dylib lib/libSDL2_image-2.0.0.dylib install_name_tool -change /usr/local/opt/jpeg/lib/libjpeg.9.dylib @executable_path/lib/libjpeg.9.dylib lib/libSDL2_image-2.0.0.dylib ...The
install_name_toolsteps need to be done recursively for every dependency/dependency of dependency/etc. Depending on the permissions of the
install_name_toolmay need to be run with
LC_ID_DYLIBneeds to be set for the SDL2 libraries by running:
sudo install_name_tool -id @rpath/libSDL2-2.0.0.dylib lib/libSDL2-2.0.0.dylib sudo install_name_tool -id @rpath/libSDL2_image-2.0.0.dylib lib/libSDL2_image-2.0.0.dylib sudo install_name_tool -id @rpath/libSDL2_ttf-2.0.0.dylib lib/libSDL2_ttf-2.0.0.dylibThe CLI version of cabal-macosx is used to put the binary and assets into an application bundle. Copying
Info.plistinto the bundle enables DPI awareness and setting the icon image.