# HG changeset patch # User Richard Westhaver # Date 1726973902 14400 # Node ID cc89b337384bdd725b841b2edf3e444d4752ba24 # Parent a53be64410c54da426e28df303819c7efdc2c98d skel upgrades, added skel/net diff -r a53be64410c5 -r cc89b337384b emacs.sk --- a/emacs.sk Sat Sep 21 18:18:14 2024 -0400 +++ b/emacs.sk Sat Sep 21 22:58:22 2024 -0400 @@ -2,4 +2,26 @@ :name "core/emacs" :path "emacs" ;; :components ((:org "babel")) -:rules () \ No newline at end of file +:bind ((dotemacs (merge-pathnames ".emacs.d/" (user-homedir-pathname))) + (config () (directory "emacs/*.el")) + (lib () (directory "emacs/lib/*.el"))) +:rules +((install () + (mapcar + (lambda (el) + (std:with-open-files + ((in el :direction :input) + (out (merge-pathnames (file-namestring el) dotemacs) :direction :output)) + (std:copy-stream in out :finish-output t))) + config) + (mapcar + (lambda (el) + (std:with-open-files + ((in el :direction :input) + (out (merge-pathnames (file-namestring el) + (ensure-directories-exist + (merge-pathnames "lib/" dotemacs))) + :direction :output)) + (std:copy-stream in out :finish-output t))) + lib))) + diff -r a53be64410c5 -r cc89b337384b lisp.sk --- a/lisp.sk Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp.sk Sat Sep 21 22:58:22 2024 -0400 @@ -3,7 +3,8 @@ :src "lisp" :description "CC Lisp Core" :components -((:lisp-system "prelude.asd") - (:lisp-system "user.asd") - (:lisp-system "core.asd") - (:lisp-system "std/std.asd")) +((:asd "prelude") + (:asd "user") + (:asd "core") + (:mod "std" (:asd "std"))) + diff -r a53be64410c5 -r cc89b337384b lisp/bin/skel.lisp --- a/lisp/bin/skel.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/bin/skel.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -59,7 +59,7 @@ #P".") :load t))) -#+tools +#+gui (defcmd skc-view (if *args* (let ((stuff (loop for a in *args* @@ -132,7 +132,7 @@ (defcmd skc-show (if *args* (mapc (lambda (x) (when-let ((ret (sk-slot-case x))) (println ret))) *args*) - (describe (if (boundp '*skel-project*) *skel-project* + (sk-print (if (boundp '*skel-project*) *skel-project* (if (boundp '*skel-user-config*) *skel-user-config* (if (boundp '*skel-system-config*) *skel-system-config* (skel-simple-error "skel config files not installed"))))))) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/asd.lisp --- a/lisp/lib/skel/comp/asd.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/asd.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -12,7 +12,7 @@ ;;; Code: (in-package :skel/comp/asd) -(defclass sk-lisp-system (sk-module asdf:system) +(defclass sk-lisp-system (sk-mod asdf:system) ;; these slots are inferred in ASDF:SYSTEM. Since we are primarily concerned ;; with generating ASDF:SYSTEM definitions rather than parsing them we restore them here. ((serial :initform nil :type boolean :accessor sk-lisp-system-serial) @@ -43,9 +43,12 @@ (defmethod sk-load ((self sk-lisp-system) &key force force-not verbose version) (asdf:load-system self :force force :force-not force-not :verbose verbose :version version)) -(defmethod sk-load-component ((kind (eql :lisp-system)) (form pathname) &optional (path *default-pathname-defaults*)) +(defmethod sk-load-component ((kind (eql :asd)) (form pathname) &optional (path *default-pathname-defaults*)) (declare (ignore kind)) - (parse-sk-lisp-system (pathname-name form) (merge-pathnames form path))) + (let* ((type (pathname-type form)) + (name (namestring (if type (pathname-name form) form))) + (fname (if type form (make-pathname :name name :type "asd")))) + (parse-sk-lisp-system name (merge-pathnames fname path)))) (defmethod sk-compile ((self sk-lisp-system) &key force force-not verbose version &allow-other-keys) (asdf:compile-system self :force force :force-not force-not :verbose verbose :version version)) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/cargo.lisp --- a/lisp/lib/skel/comp/cargo.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/cargo.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -12,7 +12,7 @@ (defparameter *default-cargo-manifest* "Cargo.toml") (defparameter *cargo-manifest-extension* "toml") -(defclass sk-rust-system (sk-module) +(defclass sk-rust-system (sk-mod) ()) (defclass sk-rust-component (sk-component) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/container.lisp --- a/lisp/lib/skel/comp/container.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/container.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -29,7 +29,7 @@ (declare (ignore kind)) (sk-convert (deserialize (make-pathname :name *default-containerfile* :type (namestring name) - :directory path) + :directory (namestring path)) :containerfile))) (defmethod sk-write-file ((self sk-containerfile) &key path) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/dir-locals.lisp --- a/lisp/lib/skel/comp/dir-locals.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/dir-locals.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -16,4 +16,4 @@ (defmethod sk-load-component ((kind (eql :dir-locals)) (form pathname) &optional (path *default-pathname-defaults*)) (declare (ignore kind)) (sk-new :dir-locals :ast (read-sxp-file (make-pathname :name (namestring form) :type "el" - :directory path)))) + :directory (namestring path))))) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/makefile.lisp --- a/lisp/lib/skel/comp/makefile.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/makefile.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -39,9 +39,9 @@ ;; https://www.gnu.org/software/make/manual/html_node/Makefile-Contents.html (defclass makefile (skel sk-meta) - ((directives :initform (make-array 0 :element-type 'sk-command :adjustable t :fill-pointer 0) - :type (vector sk-command) :accessor mk-directives) - (variables :initform (make-hash-table) + ((directives :initform (make-array 0 :adjustable t :fill-pointer 0) + :type (vector list) :accessor mk-directives) + (variables :initform (make-hash-table) :type (hash-table) :accessor mk-vars) (explicit :initform (make-array 0 :element-type 'sk-rule :adjustable t :fill-pointer 0) :type (vector sk-rule) :accessor mk-erules) @@ -54,7 +54,7 @@ (vector-push-extend self (mk-irules place)) (vector-push-extend self (mk-erules place)))) -(defmethod push-mk-directive ((self sk-command) (place makefile)) +(defmethod push-mk-directive ((self list) (place makefile)) (vector-push-extend self (mk-directives place))) (defmethod push-mk-var ((self cons) (place makefile)) @@ -67,7 +67,8 @@ (with-slots (directives variables explicit implicit) self ;; directives (loop for d across directives - do (sk-writeln d s)) + do (write d :stream s) + do (terpri s)) ;; variables (maphash (lambda (x y) (format s "~A=~A~%" x y)) variables) ;; explicit rules @@ -75,7 +76,8 @@ do (format s "~A:~A;~A~%" (sk-rule-target exp) (sk-rule-source exp) - (sk-write-string (sk-rule-recipe exp)))) + (when-let ((recipe (sk-rule-recipe exp))) + (sk-write-string recipe)))) ;; TODO implicit rules (loop for imp across implicit do (format s "~A:~A;~A~%" diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/comp/org.lisp --- a/lisp/lib/skel/comp/org.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/comp/org.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -18,7 +18,7 @@ (defmethod sk-load-component ((kind (eql :org)) (form pathname) &optional (path *default-pathname-defaults*)) (declare (ignore kind)) (let* ((name (namestring form)) - (p (make-pathname :name name :type "org" :directory path)) + (p (make-pathname :name name :type "org" :directory (namestring path))) (comp (sk-convert (org-parse :document p)))) (setf (sk-name comp) name) (setf (sk-path comp) p) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/core/obj.lisp --- a/lisp/lib/skel/core/obj.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/core/obj.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -65,17 +65,50 @@ ;;; Module -;; Again just like ASDF, we define a SK-MODULE class which subclasses -;; SK-COMPONENT. The SK-MODULE class is used for components which have +;; Again just like ASDF, we define a SK-MOD class which subclasses +;; SK-COMPONENT. The SK-MOD class is used for components which have ;; sub-components themselves. -(defclass sk-module (sk-component sk-meta) +(defclass sk-mod (sk-component sk-meta) ((components :initarg :components :accessor sk-components))) +(defun make-sk-mod (form) + "Make a new SK-MOD." + (if (listp form) + (apply #'make-instance 'sk-mod + (let ((name (pop form)) + (components + (mapcar + (lambda (f) + (sk-load-component (car f) (cdr f))) + form))) + `(:name ,name :components ,components))) + (make-instance 'sk-mod :name form :components nil))) + +(defmethod sk-new ((self (eql :mod)) &key form path) + (let ((mod (make-sk-mod form))) + (when path (setf (sk-path mod) path)) + mod)) + +(defmethod sk-load-component ((kind (eql :mod)) (form t) &optional (path *default-pathname-defaults*)) + (sk-new kind :form form :path path)) + ;;; Script + +;; Scripts are always assumed to point to an executable file. They can be ran +;; directly with SK-RUN. + (defclass sk-script (sk-component sk-meta sxp) ((kind :initform nil :initarg :kind :type (or null script-designator) :accessor sk-kind))) +(defmethod sk-new ((self (eql :script)) &key form path) + (let ((script (make-sk-script form))) + (setf (sk-path script) path) + script)) + +(defmethod sk-load-component ((kind (eql :script)) (form t) &optional (path *default-pathname-defaults*)) + (sk-new kind :form form :path path)) + (defmethod write-sxp-stream ((self sk-script) stream &key (pretty t) (case :downcase) &allow-other-keys) (write `(,(sk-path self)) :stream stream :pretty pretty :case case :readably t :array t :escape t)) @@ -102,25 +135,7 @@ (defmethod print-object ((self sk-script) stream) (print-unreadable-object (self stream :type t) - (format stream "~A :~A ~A" (format-sxhash (id self)) (sk-kind self) (sk-name self)))) - -;;; Snippet -(defstruct sk-snippet - (name "" :type string) - (form "" :type form)) - -(defmethod sk-new ((self (eql :snippet)) &key name form) - (declare (ignore self)) - (make-sk-snippet :name name :form form)) - -;;; Abbrev -(defstruct sk-abbrev - (match nil :type form) - (expansion nil :type form)) - -(defmethod sk-new ((self (eql :abbrev)) &key match expansion) - (declare (ignore self)) - (make-sk-abbrev :match match :expansion expansion)) + (format stream ":~A ~A" (sk-kind self) (sk-name self)))) ;;; Config (defclass sk-config (skel sxp) @@ -165,9 +180,14 @@ (when (bound-string-p self 'store) (setf (sk-store self) (merge-pathnames (sk-store self) (sk-dir self)))) (when (bound-string-p self 'cache) (setf (sk-cache self) (merge-pathnames (sk-cache self) (sk-dir self)))) (when (bound-string-p self 'registry) (setf (sk-registry self) (merge-pathnames (sk-registry self) (sk-dir self)))) - (when (bound-string-p self 'scripts) (setf (sk-scripts self) - ;; TODO 2023-10-14: convert into list of script names - (merge-pathnames (sk-scripts self) (sk-dir self)))) + ;; SCRIPTS + (if (bound-string-p self 'scripts) + (if-let* ((path (probe-file (pathname (the simple-string (sk-scripts self)))))) + (setf (sk-scripts self) + (if (directory-path-p path) + (find-files path) + (list path))) + (warn! (format nil "ignoring missing scripts directory: ~A" (sk-scripts self))))) (unless *keep-ast* (setf (ast self) nil)) self) ;; invalid ast, signal error @@ -240,51 +260,27 @@ (defvar *skel-user-config* nil) (defvar *skel-system-config* nil) -;;; Command -(defclass sk-command (skel) - ((body :initform nil :initarg :body :accessor sk-body))) - -(defmethod sk-new ((self (eql :command)) &key body) - (make-instance 'sk-command :body body)) - -(defmethod sk-write ((self sk-command) stream) - (if (stringp (sk-body self)) (format stream "~A" (sk-body self)))) - -(defmethod sk-write-string ((self sk-command)) - (with-output-to-string (s) - (sk-write self s))) +;;; Rule +(defstruct (sk-rule (:constructor %make-sk-rule (target source recipe))) +"Maps a SOURCE to a corresponding TARGET +via the special form stored in RECIPE." + (target "" :type string) + (source nil :type list) + (recipe nil :type list)) -(defmethod sk-writeln ((self sk-command) stream) - (sk-write self stream) - (format stream "~%")) - -(defmethod write-sxp-stream ((self sk-command) stream &key (pretty t) (case :downcase) &allow-other-keys) - (write `(,@(sk-body self)) :stream stream :pretty pretty :case case :readably t :array t :escape t)) - -(defmethod sk-run ((self sk-command)) - (mapcar (lambda (x) (funcall x :output t)) - (sk-body self))) - -;;; Rule -(defclass sk-rule (skel) - ;; RESEARCH 2024-05-11: consider more options for extending target slot - ((target :initarg :target :type string :accessor sk-rule-target) - (source :initform nil :initarg :source :type list :accessor sk-rule-source) - (recipe :initform (make-instance 'sk-command) :initarg :recipe :type sk-command :accessor sk-rule-recipe)) - (:documentation "Skel rules. Maps a SOURCE to a corresponding TARGET -via the special form stored in RECIPE.")) +(declaim (inline make-sk-rule)) +(defun make-sk-rule (target &optional source recipe) + (%make-sk-rule (string target) source recipe)) (defmethod sk-new ((self (eql :rule)) &rest args) (declare (ignore self)) (apply #'sk-new 'sk-rule args)) -(defmethod write-sxp-stream ((self sk-rule) stream &key (pretty t) (case :downcase) &allow-other-keys) - (write `(,(sk-rule-target self) ,(sk-rule-source self) ,@(sk-body (sk-rule-recipe self))) :stream stream :pretty pretty :case case :readably t :array t :escape t)) +(defmethod id ((self sk-rule)) + (sxhash (list (sk-rule-target self) (sk-rule-source self)))) -(defun make-sk-rule (target source recipe) - "Make a new SK-RULE." - (let ((r (make-instance 'sk-command :body recipe))) - (make-instance 'sk-rule :target (format nil "~(~a~)" target) :source source :recipe r))) +(defmethod write-sxp-stream ((self sk-rule) stream &key (pretty t) (case :downcase) &allow-other-keys) + (write `(,(sk-rule-target self) ,(sk-rule-source self) ,@(sk-rule-recipe self)) :stream stream :pretty pretty :case case :readably t :array t :escape t)) (defmethod print-object ((self sk-rule) stream) (print-unreadable-object (self stream :type t) @@ -299,20 +295,20 @@ (etypecase x ((or symbol function) (funcall x :output t)) (t (eval x)))) - (sk-body recipe)))) + recipe))) (defmethod sk-write ((self sk-rule) stream) (with-slots (target source recipe) self - (write-string target) ;; target isn't typep SK-OBJECT - (sk-write-string source) - (sk-write-string recipe))) + (write-string (sk-rule-target target) stream) ;; target isn't typep SK-OBJECT + (write (sk-rule-source self) :stream stream) + (write (sk-rule-recipe self) :stream stream))) (defun sk-run-with-sources (obj rule) (when-let ((sources (sk-rule-source rule))) (mapcar (lambda (src) (if-let* ((sr (sk-find-rule src obj))) - ;; check if we need to rerun sources + ;; TODO: check if we need to rerun sources (sk-make obj sr) (warn! "unhandled source:" src "for rule:" rule))) sources)) @@ -368,7 +364,6 @@ (store :initarg :store :accessor sk-store :type pathname) (components :initform #() :initarg :components :accessor sk-components :type (vector sk-component)) (bind :initarg :bind :initform nil :accessor sk-bind :type list) - ;; (env :initarg :env :initform nil :accessor sk-env :type list) (phases :initarg :phases :initform (make-hash-table) :accessor sk-phases @@ -377,10 +372,6 @@ :initform (make-array 0 :element-type 'sk-rule :adjustable t) :accessor sk-rules :type (vector sk-rule)) - (scripts :initarg :scripts - :initform (make-array 0 :element-type 'sk-script :adjustable t) - :accessor sk-scripts - :type (vector sk-script)) (include :initarg :include :initform (make-array 0 :element-type 'pathname :adjustable t) :accessor sk-include @@ -388,12 +379,11 @@ (defmethod print-object ((self sk-project) stream) (print-unreadable-object (self stream :type t) - (format stream "~A [c=~A;i=~A;r=~A;s=~A] :id ~A" + (format stream "~A [c=~A;i=~A;r=~A] :id ~A" (sk-name self) (length (sk-components self)) (length (sk-include self)) (length (sk-rules self)) - (length (sk-scripts self)) (format-sxhash (id self))))) (defmethod sk-new ((self (eql :project)) &rest args) @@ -433,6 +423,12 @@ (let ((*default-pathname-defaults* (make-pathname :defaults (namestring *skel-path*)))) (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (the simple-string (sk-stash self))))) (when (bound-string-p self 'store) (setf (sk-store self) (pathname (the simple-string (sk-store self))))) + ;; VC + (when-let ((vc (sk-vc self))) + (etypecase vc + ((or sk-vc-meta null) nil) + (vc-designator (setf (sk-vc self) (make-sk-vc-meta vc))) + (list (setf (sk-vc self) (apply #'make-sk-vc-meta vc))))) ;; INCLUDE (when-let ((include (sk-include self))) (setf (sk-include self) (map 'vector @@ -446,18 +442,12 @@ (when (slot-boundp self 'components) (setf (sk-components self) (map 'vector (lambda (c) - (sk-load-component (car c) (pathname (cadr c)) (namestring *default-pathname-defaults*))) + (sk-load-component + (car c) + (let ((val (cadr c))) + (if (listp val) val (pathname val))) + *default-pathname-defaults*)) (sk-components self))))) - ;; SCRIPTS - (if (bound-string-p self 'scripts) - (if-let* ((path (probe-file (pathname (the simple-string (sk-scripts self)))))) - (setf (sk-scripts self) - (if (directory-path-p path) - (find-files path) - (list path))) - (warn! (format nil "ignoring missing scripts directory: ~A" (sk-scripts self))))) - (when-let ((scripts (sk-scripts self))) - (setf (sk-scripts self) (map 'vector #'make-sk-script scripts))) ;; ;; ENV ;; ;; TODO ;; (when-let ((env (sk-env self))) @@ -539,14 +529,7 @@ recipe)) (make-sk-rule target source recipe)))) (coerce rules 'list))) - '(vector sk-rule)))) - ;; VC - (when-let ((vc (sk-vc self))) - (etypecase vc - ((or sk-vc-meta null) nil) - (vc-designator (setf (sk-vc self) (make-sk-vc-meta vc))) - (list (setf (sk-vc self) (apply #'make-sk-vc-meta vc))))) - + '(vector sk-rule)))) (unless *keep-ast* (setf (ast self) nil)) (setf (id self) (sxhash (cons (sk-name self) (sk-version self)))) self) @@ -630,5 +613,17 @@ (defmethod sk-call ((self sk-project) (arg t)) (sk-make self (sk-find-rule arg self))) +(defmethod sk-call ((self sk-project) (arg (eql :compile))) + (loop for c across (sk-components self) + collect (sk-compile self))) + +(defmethod sk-call ((self sk-project) (arg (eql :build))) + (loop for c across (sk-components self) + collect (sk-build self))) + +(defmethod sk-call ((self sk-project) (arg (eql :load))) + (loop for c across (sk-components self) + collect (sk-load self))) + (defmethod sk-call* ((self sk-project) &rest args) (mapcar (lambda (arg) (sk-call self arg)) args)) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/core/pkg.lisp --- a/lisp/lib/skel/core/pkg.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/core/pkg.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -80,7 +80,7 @@ :sk-snippets :sk-snippet :sk-abbrevs :sk-abbrev :sk-user-config :sk-system-config :*skel-user-config* :*skel-system-config* - :sk-src :sk-component :sk-components :sk-module + :sk-src :sk-component :sk-components :sk-mod :sk-parent :sk-phases)) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/core/print.lisp --- a/lisp/lib/skel/core/print.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/core/print.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -24,5 +24,15 @@ (sb-ext:defglobal *sk-print-dispatch-table* (sb-pretty::make-pprint-dispatch-table #() nil nil)) -(defmethod sk-print ((self skel)) - (pprint (cons (keywordicate (class-name (class-of self))) (format-sxhash (obj/id:id self))))) +(defmethod sk-print ((self skel) &key (stream t) (id t) &allow-other-keys) + (if id + (format stream "~S ~A~%" (keywordicate (class-name (class-of self))) (format-sxhash (obj/id:id self))) + (format stream "~S~%" (keywordicate (class-name (class-of self))))) + (mapcar + (lambda (slot) + (let ((name (sb-mop:slot-definition-name slot))) + (when (slot-boundp self name) + (when-let ((val (slot-value self name))) + (format stream ":~A ~A~%" name val))))) + (sb-mop:class-direct-slots (class-of self))) + self) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/core/proto.lisp --- a/lisp/lib/skel/core/proto.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/core/proto.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -15,7 +15,7 @@ (:documentation "Call SELF with ARG.")) (defgeneric sk-call* (self &rest args) (:documentation "Call SELF with ARGS.")) -(defgeneric sk-print (self) +(defgeneric sk-print (self &key &allow-other-keys) (:documentation "Print object SELF.")) (defgeneric sk-load (self &key &allow-other-keys) (:documentation "Load or reload object SELF.")) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/net/client.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/lib/skel/net/client.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -0,0 +1,6 @@ +;;; client.lisp --- Skel Network Client + +;; + +;;; Code: +(in-package :skel/net/client) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/net/pkg.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/lib/skel/net/pkg.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -0,0 +1,10 @@ +;;; skel/net/pkg.lisp --- Skel Networking + +;; + +;;; Code: +(defpackage :skel/net/client + (:use :cl :std :net :skel/core/proto :skel/core/obj)) + +(defpackage :skel/net/server + (:use :cl :std :net :skel/core/proto :skel/core/obj)) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/net/server.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/lib/skel/net/server.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -0,0 +1,6 @@ +;;; server.lisp --- Skel Network Server + +;; + +;;; Code: +(in-package :skel/net/server) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/pkg.lisp --- a/lisp/lib/skel/pkg.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/pkg.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -41,6 +41,10 @@ (:use-reexport :skel/comp/asd :skel/comp/cargo :skel/comp/makefile :skel/comp/container :skel/comp/dir-locals :skel/comp/org)) +(pkg:defpkg :skel/net + (:use :cl :std) + (:use-reexport :skel/net/client :skel/net/server)) + (pkg:defpkg :skel (:nicknames :sk) (:use :cl :std) @@ -48,4 +52,4 @@ (pkg:defpkg :sk-user (:use :cl :std :std-user :cl-user :log :sb-debug :sb-ext :net/proto/dns :net/fetch :cli/tools/sbcl :pod :cli/clap) - (:use :skel :skel/core :skel/comp)) + (:use :skel :skel/core :skel/comp :skel/net)) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/skel.asd --- a/lisp/lib/skel/skel.asd Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/skel.asd Sat Sep 21 22:58:22 2024 -0400 @@ -8,7 +8,7 @@ :pod :net :box (:feature :ext :krypt) (:feature :ext :packy) - (:feature :tools :clouseau)) + (:feature :gui :clouseau)) :serial t :components ((:module "core" @@ -33,21 +33,24 @@ (:file "org") (:file "dir-locals") (:file "makefile"))) + (:module "net" + :components + ((:file "pkg") + (:file "server") + (:file "client"))) (:file "pkg") (:module "tools" :components ((:file "pkg") - (:file "deploy") - (:file "viz")) - :if-feature :tools) + (:file "deploy" :if-feature :deploy) + (:file "viz" :if-feature :gui))) (:module "ext" :components ((:file "pkg") (:file "asdf") - (:file "inspect" :if-feature :clouseau) + (:file "inspect" :if-feature :gui) (:file "krypt") - (:file "packy") - (:file "net")) + (:file "packy")) :if-feature :ext)) :in-order-to ((test-op (test-op "skel/tests")))) diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/tests.lisp --- a/lisp/lib/skel/tests.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/tests.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -43,16 +43,19 @@ "Make sure makefiles are making out ok." (with-tmp-file (f :name "" :type "mk") (flet ((mk (&optional path) (make-instance 'makefile :name (gensym) - :path (or path (pathname *tmp*)) :description "barfood")) + :path (or + (when path (merge-pathnames path *tmp*)) + *tmp*) + :description "barfood")) (src (path) (list path)) - (cmd (body) (make-instance 'sk-command :body body)) - (rule (tr sr) (make-sk-rule tr sr nil))) + (cmd (&rest body) body) + (rule (tr sr) (make-sk-rule (file-namestring tr) sr))) (is (null (sk-write-file (mk) :if-exists :supersede :path (tmp-path "mk")))) (let* ((tr1 (tmp-path "t1")) (tr2 (tmp-path "t2")) (sr (src (tmp-path "s1"))) (r1 (rule tr1 sr)) - (r2 (rule sr tr2)) + (r2 (rule (car sr) (src tr2))) (mk1 (mk "test.mk"))) (is (push-mk-rule r1 mk1)) (is (push-mk-rule r2 mk1)) @@ -63,8 +66,9 @@ (is (push-mk-var '(a b) mk1)) (is (push-mk-var '(b c) mk1)) ;; FIXME - (is (null (sk-write-file mk1 :if-exists :supersede :path (pathname (tmp-path "mk"))))) - )))) + (is + (null + (sk-write-file mk1 :if-exists :supersede :path (merge-pathnames (tmp-path "mk") *tmp*)))))))) (deftest vm () "EXPERIMENTAL" diff -r a53be64410c5 -r cc89b337384b lisp/lib/skel/tools/pkg.lisp --- a/lisp/lib/skel/tools/pkg.lisp Sat Sep 21 18:18:14 2024 -0400 +++ b/lisp/lib/skel/tools/pkg.lisp Sat Sep 21 22:58:22 2024 -0400 @@ -1,9 +1,11 @@ (in-package :sk-user) +#+gui (defpkg :skel/tools/viz (:use :cl :std :skel :dat/dot :obj/graph) (:export :sk-view)) +#+deploy (defpkg :skel/tools/deploy (:use :cl :std :skel) (:export))