Running Pre-Built Linux Software on Guix

Updates

  • Had a blast working on the game for Ludum Dare 51! If you missed it, check out the YouTube playlist of streams.
  • Mesche development is progressing! Working on an implementation of hygenic macros now.
  • The Emacs package in Guix now has --with-native-compilation turned on by default!
  • Support the channel! Buy Mastering Emacs with this link https://www.masteringemacs.org/r/systemcrafters

Running Pre-Built Linux Software on Guix

Today we’re going to try and get a pre-built program running in Guix! I decided to try this because a new Guix feature just got mentioned on Twitter today:

https://twitter.com/GuixHpc/status/1580565330144899074

It seems that Guix containers can now emulate the Linux Standard Base file system layout! This might help get some pre-built apps working without a lot of extra trouble.

Today we’ll experiment with getting Discord running in a Guix container. We’ll try the following to make it work:

  • Download and unpack the .tar.gz build of Discord
  • Start up a guix shell container with the new --emulate-fhs parameter
  • Figure out and install all necessary dependencies (if they exist on Guix)
  • Patch the binary if libraries aren’t being resolved correctly (hopefully not needed!)

If Discord doesn’t work, we’ll figure out another app to try!

Notes

Things we needed to do:

  • export LD_LIBRARY_PATH=$LIBRARY_PATH:/lib/nss
  • strace -ff -e trace=file ./Discord
  • LD_DEBUG=libs ./Discord

Guix Shell Documentation

The manifest file

Here’s the manifest file we were building to launch Discord:

(specifications->manifest
 '( ;; Library Dependencies
   "coreutils"
   "glib"
   "gcc:lib"
   "gtk+"
   "nss"
   "nss-certs"
   "ffmpeg"
   "alsa-lib"
   "cups"
   "atk"

   ;; export LD_LIBRARY_PATH=$LIBRARY_PATH:/lib/nss

   ;; Debugging Tools
   "glibc"
   "gdb"
   "strace"

   ;; Program Dependencies
   "gzip"
   "unzip"
   "wget"))

And here’s the command we used to execute it:

guix shell --container --emulate-fhs --network --preserve='^DISPLAY$' -m guix.scm
Subscribe to the System Crafters Newsletter!
Stay up to date with the latest System Crafters news and updates! Read the Newsletter page for more information.
Name (optional)
Email Address