Skip to content

Instantly share code, notes, and snippets.

@zacque0
Created April 13, 2022 14:19
Show Gist options
  • Save zacque0/c160a38c4b1194ba615dd23f4d88b099 to your computer and use it in GitHub Desktop.
Save zacque0/c160a38c4b1194ba615dd23f4d88b099 to your computer and use it in GitHub Desktop.
GNU Guix and SBCL CFFI

A simple note about how GNU Guix and SBCL CFFI can work together to easily write a wrapper around the shared library.

guix shell sbcl sbcl-cffi sbcl-slime-swank sqlite

Then you need to invoke from shell with preceding LD_LIBRARY_PATH=…:

LD_LIBRARY_PATH="$GUIX_ENVIRONMENT/lib" sbcl --eval '(require :asdf)' --eval '(asdf:load-system :swank)' --eval '(swank:create-server :dont-close t)' --eval '(asdf:load-system :cffi)'

Or with a makefile:

dev:
	sbcl --eval '(require :asdf)' --eval '(asdf:load-system :swank)' --eval '(swank:create-server :dont-close t)' --eval '(asdf:load-system :cffi)'
make dev LD_LIBRARY_PATH="$GUIX_ENVIRONMENT/lib"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment