The windows build & how to build LISP programs that require libffi on windows


Mid-jam, we finally figured out how to make a windows build! Since you can't upload new builds mid-jam, it has only been uploaded now and it is somewhat of a pain to build for the first time, due to the fact that libffi isn't very good with windows, but after that it's just as any other platform. Here's a little step by step tutorial on building this game (or any libffi-related LISP thing) on windows:

  1.  Download the normal version of your lisp compiler for windows (SBCL in this particular case) and install it
  2. Install MSYS2, a Unix-like environment for windows, that has the pacman package manage, which will be used to install needed dependencies
  3. Start MSYS via the mingw64 wrapper it has in the installation directory
    1. Install needed packages via pacman, libraries will likely have a mingw-w64-x86_64- prefix (it also has 32-bit versions of all those things, for that you'll need to run mingw32, but i have not tried it, should be mostly the same process). For this particular game, you'll need pacman -S gcc pkg-config libffi-devel mingw-w64-x86_64-{SDL2,SDL2_image,SDL2_ttf}. Note the gcc, pkg-config and libffi-devel packages, they are needed to compile LISP programs that use libffi, due to CFFI using pkg-config to find it and GCC to compile some kind of wrapper (don't quote me on the last one, I only know that it requires GCC to be there and compiles something)
  4. Download & Install quicklisp by running your LISP compiler using it's absolute system path (e.g. /c/Program\ Files/Steel\ Bank\ Common\ Lisp/1.4.14/sbcl.exe), loading the file you downloaded (with e.g. curl, into your home MSYS directory) and running (quicklisp-quickstart:install). This will install quicklisp into your MSYS home directory.  You probably also want to run (ql:add-to-init-file) so it'd be loaded on start
  5. Download/Clone the git repository of your game and put it in ~/quicklisp/local-projects
  6. Start your LISP compiler again, run (ql:quickload :system-name) and then (asdf:perform :program-op :system-name) (or (asdf:make :system-name) if you have appropriate configuration for that). You now have an .exe file of the game
  7. To bundle the libraries, load your system and check (cffi:list-foreign-libraries), then look for those in /mingw64/bin/

Now all you have to do is just pack it up and upload, and every time you want a new build, just re-do the 7th step :)

Files

o2-win.zip 16 MB
May 03, 2019

Get Operation "Operation"

Leave a comment

Log in with itch.io to leave a comment.