Posted May 22, 2024 by screwtape
#lisp #tutorial #mcclim #clim #sbcl #build #executable #gui #minimal #very minimal
This post includes all the files for a working example.
The Difficult Thing: You must have gotten https://codeberg.org/McCLIM/McCLIM using https://www.quicklisp.org/beta/
#+TITLE: Critically important lisp clim GUI build demo This directory is all there is to it. Since guis like common lisp interface manager are intricate, let's agree to use sbcl in this case. 1. Start sbcl $ sbcl 2. We must have required :asdf * (require "asdf") 3. Build the executable * (asdf:operate 'asdf:build-op :foobar/executable) 4. We're done. Since I'm on openbsd, I needed a user with write access to install(1) the new sbcl bin in /usr/local $ install \ /home/screwtape/common-lisp/foobar/foobar-command \ /usr/local/bin/ 5. Run the very minimal gui application in a term $ foobar-command
Thanks to @theruran@hackers.town for prompting me to write this eg, which is a great example should some spring lisp game jam participants want for it.
* Improvements
This is for asdf experts. The "foobar" system should have an :in-order-to :build-op that redirects build-op to the "foobar/executable" system. See fare's example. Then, the build code would be:
1. sbcl
* (asdf:build :foobar)
Which has less noise. (asdf:build :foobar/executable) probably works in the first place as well.
This is Another System Definition Facility for common lisp.
(defsystem "foobar" :class :package-inferred-system :depends-on (:foobar/main)) (defsystem "foobar/executable" :build-operation program-op :build-pathname "foobar-command" :entry-point "foobar::start-foobar" :depends-on ("foobar" "mcclim") :components ((:file "main"))) (register-system-packages :foobar/main '(:foobar))
Listen, it's very minimal.
(uiop:define-package :foobar (:mix :clim :clim-lisp :cl)) (in-package :foobar) (defun start-foobar () (define-application-frame test () ()) (find-application-frame 'test) (read-line))
https://codeberg.org/McCLIM/McCLIM has documentation and examples.