Elona is a freeware open-world Roguelike. Sadly it is for Windows only, but we can run it under Wine. Given that we are using Guix now, why not run it with the help of Guix? The benefit is obvious: we can pin the dependencies so that system updates won't break our game environment; we can isolate the game in a container, just in case; and, most importantly, hacking is fun!
Since it makes few sense to pack a Windows game as a Guix package, and also I don't know how to do it at all, let's simply prepare a perfect environment for Elona.
Manifest
Manifest for the environment is simple:
(use-modules (guix) (gnu packages) (gnu packages base)) (define-public elona-locales (make-glibc-utf8-locales glibc #:locales (list "en_US" "ja_JP" "zh_CN") #:name "elona-locales")) (concatenate-manifests (list (packages->manifest (list elona-locales)) (specifications->manifest '("coreutils" "wine64-staging" "grep"))))
Note that
- We need Wine, and
wine64-staging
seems to perform best at my site grep
is used later to search for locale path, see below.- We declare a smaller version of
locales
, namedelona-locales
.
Environment Script
Next, let's write the script used to enter Guix shell container. Inspired by (George 2023).
#!/usr/bin/env bash set -ex exec guix time-machine --channels=channels.scm -- shell \ --container \ --network \ --share=/dev/snd/seq \ --preserve='^DISPLAY$' --preserve='^XAUTHORITY$' \ --expose=$XAUTHORITY \ --expose=/sys/class/input \ --expose=/sys/devices \ --expose=/sys/dev \ --expose=/sys/bus/pci \ --preserve='XDG_RUNTIME_DIR' \ --expose="$XDG_RUNTIME_DIR/pulse" \ --expose=/dev/dri \ -m manifest.scm
Note that
--network
seems to be required for X11/Wine.- Even if the host is using
pipewire
, we still need to--expose="$XDG_RUNTIME_DIR/pulse"
for sound.
Run Script
export GUIX_LOCPATH=/gnu/store/$(ls -F /gnu/store | grep 'elona-locales.*/' | tail -n 1)lib/locale export LOCPATH=$GUIX_LOCPATH export LC_COLLATE=ja_JP.utf8 export LC_CTYPE=ja_JP.utf8 export WINEPREFIX=$(pwd)/prefix wine elona/elona.exe
Run script is pretty straightforward too:
- Set up Locale path. The grep trick is from (Żelazny and Tournier 2020).
- Export locale settings. This is based on (Chicken 2019).
- Export Wine setting.
- Run the game, and enjoy!
Wrap-up
I put the scripts in a public repo, with short documentation on how to use them.