sbcl lisp executable clim gui game build


Protip, it's just (asdf:build :foobar/executable). 

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/

All The Files

~/common-lisp/foobar/README.org

#+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.

~/common-lisp/foobar/foobar.asd

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))

~/common-lisp/foobar/main.lisp

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))

There's still four days to join https://itch.io/jam/spring-lisp-game-jam-2024 and submit basically this.

https://codeberg.org/McCLIM/McCLIM has documentation and examples.

Get logos-lisp-legend

Comments

Log in with itch.io to leave a comment.

NB note/warning from a McCLIM dev about the above:

https://functional.cafe/@jackdaniel/112484865422197566