From 0168fb4079d958472b8f655b63b913da311e8bd4 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Wed, 23 Jul 2025 20:32:14 +0200 Subject: [PATCH] Add binary build stuff to editor --- wip-duuqnd/editor/binary-build.lisp | 38 +++++++++++++++++++++++++++++ wip-duuqnd/editor/editor.asd | 5 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 wip-duuqnd/editor/binary-build.lisp diff --git a/wip-duuqnd/editor/binary-build.lisp b/wip-duuqnd/editor/binary-build.lisp new file mode 100644 index 0000000..14ee53a --- /dev/null +++ b/wip-duuqnd/editor/binary-build.lisp @@ -0,0 +1,38 @@ +(in-package #:editor) + +(defun batch-help () + (format t "Usage: c6le ~%") + (format t "This editor is intended to be used on a different terminal than it's started +from, please supply a terminal to run on. For testing on a terminal emulator, +open it, check which pts it's running on using \"ps\", run a command like +\"clear; while true; do sleep 1000;done\", then start the editor in another +terminal giving the pts as a command-line parameter.~%")) + +(defun main (arguments) + (format t "C64 Livecoding editor, v~A~%" + #.(asdf:component-version (asdf:find-system '#:user-side-compiler))) + (let ((tty (and (first arguments) + (probe-file (first arguments))))) + (unless tty + (batch-help) + (abort)) + (let ((*terminal-path* tty)) + (make-editor)) + (editor-loop))) + +(defun batch-main () + (restart-bind + ((abort + (lambda () + (sb-ext:exit :code -1)))) + (main (uiop:command-line-arguments)))) + +(defun build () + (assert (not (member :swank *features*))) + (usc:usc-init) + (sb-ext:save-lisp-and-die "c6le" + :toplevel #'batch-main + :executable t + :save-runtime-options t + :root-structures 'batch-main + :compression t)) diff --git a/wip-duuqnd/editor/editor.asd b/wip-duuqnd/editor/editor.asd index 999c9d4..c994b0a 100644 --- a/wip-duuqnd/editor/editor.asd +++ b/wip-duuqnd/editor/editor.asd @@ -1,8 +1,9 @@ ;;;; editor.asd (asdf:defsystem #:editor - :version "0.0.1" + :version "0.1.0" :serial t :depends-on (#:user-side-compiler #:trivial-gray-streams) :components ((:file "package") - (:file "editor"))) + (:file "editor") + (:file "binary-build")))