changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: prelude/user packages init

changeset 388: dec30b6fd500
parent 387: 8252ee515756
child 389: 95b861dff3d8
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 31 May 2024 18:18:12 -0400
files: Containerfile lisp/bin/skel.lisp lisp/ffi/zstd/tests.lisp lisp/lib/cli/cli.asd lisp/lib/cli/tmux.lisp lisp/lib/cli/tools/pacman.lisp lisp/lib/cli/tools/tmux.lisp lisp/lib/packy/server.lisp lisp/lib/parse/parse.asd lisp/lib/pod/pkg.lisp lisp/lib/pod/pod.asd lisp/lib/pod/podman.lisp lisp/lib/pod/util.lisp lisp/lib/skel/core/obj.lisp lisp/lib/vc/git.lisp lisp/lib/vc/hg.lisp lisp/lib/vc/proto.lisp lisp/lib/vc/vc.asd lisp/prelude.asd lisp/prelude.lisp lisp/std/pkg.lisp lisp/user.asd lisp/user.lisp readme.org skelfile
description: prelude/user packages init
     2.1--- a/lisp/bin/skel.lisp	Thu May 30 18:31:53 2024 -0400
     2.2+++ b/lisp/bin/skel.lisp	Fri May 31 18:18:12 2024 -0400
     2.3@@ -91,16 +91,16 @@
     2.4     (":imports" (sk-imports *skel-project*))
     2.5     (":stash" (sk-stash *skel-project*))
     2.6     (":store" (sk-store *skel-project*))
     2.7-    (":config" (describe *skel-user-config*))
     2.8-    (":sys" (describe *skel-system-config*))
     2.9-    (":cache" (sk-cache *skel-user-config*))))
    2.10+    (":config" (describe *sk-user-config*))
    2.11+    (":sys" (describe *sk-system-config*))
    2.12+    (":cache" (sk-cache *sk-user-config*))))
    2.13 
    2.14 (defcmd skc-show
    2.15   (if $args 
    2.16       (mapc (lambda (x) (when-let ((ret (sk-slot-case x))) (println ret))) $args)
    2.17       (describe (if (boundp '*skel-project*) *skel-project*
    2.18-                    (if (boundp '*skel-user-config*) *skel-user-config*
    2.19-                        (if (boundp '*skel-system-config*) *skel-system-config*
    2.20+                    (if (boundp '*sk-user-config*) *sk-user-config*
    2.21+                        (if (boundp '*sk-system-config*) *sk-system-config*
    2.22                             (skel-error "skel config files not installed")))))))
    2.23 
    2.24 (defcmd skc-push
    2.25@@ -185,6 +185,9 @@
    2.26       (println "Welcome to SKEL")
    2.27       (sb-impl::toplevel-repl nil))))
    2.28 
    2.29+(defcmd skc-new
    2.30+  (trace! $args $opts))
    2.31+  
    2.32 (define-cli $cli
    2.33   :name "skel"
    2.34   :version "0.1.1"
    2.35@@ -203,8 +206,12 @@
    2.36   :cmds (make-cmds
    2.37 	  (:name init
    2.38 	   :description "initialize a skelfile in the current directory"
    2.39-	   :opts (make-opts (:name "name" :description "project name" :kind string))
    2.40-	   :thunk skc-init)
    2.41+           :opts (make-opts (:name "name" :description "project name" :kind string))
    2.42+           :thunk skc-init)
    2.43+          (:name new
    2.44+           :description "make a new skel project"
    2.45+           :opts (make-opts (:name "name" :description "project name" :kind string))
    2.46+           :thunk skc-new)
    2.47           (:name describe
    2.48            :description "describe a skelfile"
    2.49            :thunk skc-describe)
     3.1--- a/lisp/ffi/zstd/tests.lisp	Thu May 30 18:31:53 2024 -0400
     3.2+++ b/lisp/ffi/zstd/tests.lisp	Fri May 31 18:18:12 2024 -0400
     3.3@@ -3,3 +3,5 @@
     3.4 (in-package :zstd/tests)
     3.5 (defsuite :zstd)
     3.6 (in-suite :zstd)
     3.7+
     3.8+(deftest sanity () )
     4.1--- a/lisp/lib/cli/cli.asd	Thu May 30 18:31:53 2024 -0400
     4.2+++ b/lisp/lib/cli/cli.asd	Fri May 31 18:18:12 2024 -0400
     4.3@@ -10,7 +10,11 @@
     4.4                (:file "repl" :depends-on ("pkg"))
     4.5                (:file "prompt" :depends-on ("env" "ansi"))
     4.6                (:file "ed" :depends-on ("env"))
     4.7-               (:file "tmux" :depends-on ("pkg"))
     4.8+               (:module
     4.9+                "tools"
    4.10+                :components
    4.11+                ((:file "tmux")
    4.12+                 (:file "pacman")))
    4.13                (:file "clap" :depends-on ("shell" "progress" "spark" "repl" "prompt" "ed")))
    4.14   :in-order-to ((test-op (test-op "cli/tests"))))
    4.15 
     5.1--- a/lisp/lib/cli/tmux.lisp	Thu May 30 18:31:53 2024 -0400
     5.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3@@ -1,6 +0,0 @@
     5.4-;;; cli/tmux.lisp --- Tmux Control from Lisp
     5.5-
     5.6-;; Control Tmux from Lisp
     5.7-
     5.8-;;; Code:
     5.9-(in-package :cli/tmux)
     7.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2+++ b/lisp/lib/cli/tools/tmux.lisp	Fri May 31 18:18:12 2024 -0400
     7.3@@ -0,0 +1,6 @@
     7.4+;;; cli/tmux.lisp --- Tmux Control from Lisp
     7.5+
     7.6+;; Control Tmux from Lisp
     7.7+
     7.8+;;; Code:
     7.9+(in-package :cli/tmux)
     8.1--- a/lisp/lib/packy/server.lisp	Thu May 30 18:31:53 2024 -0400
     8.2+++ b/lisp/lib/packy/server.lisp	Fri May 31 18:18:12 2024 -0400
     8.3@@ -4,8 +4,10 @@
     8.4 
     8.5 ;;; Commentary:
     8.6 
     8.7-;; The server is responsible for provisioning downstream clients with
     8.8-;; packages from a registry.
     8.9+;; The server is responsible for provisioning connected clients with a package
    8.10+;; registry API.
    8.11+
    8.12+;; The server is HTTP/S compatible and based on NET/SRV protocol.
    8.13 
    8.14 ;;; Code:
    8.15 
     9.1--- a/lisp/lib/parse/parse.asd	Thu May 30 18:31:53 2024 -0400
     9.2+++ b/lisp/lib/parse/parse.asd	Fri May 31 18:18:12 2024 -0400
     9.3@@ -2,7 +2,7 @@
     9.4   :version "0.1.0"
     9.5   :maintainer "ellis <ellis@rwest.io>"
     9.6   :bug-tracker "https://lab.rwest.io/ellis/packy/issues"
     9.7-  :depends-on (:cl-ppcre :std :babel)
     9.8+  :depends-on (:cl-ppcre :std :babel :sb-cltl2)
     9.9   :components ((:file "pkg")
    9.10                (:file "bytes")
    9.11                (:file "lex")
    10.1--- a/lisp/lib/pod/pkg.lisp	Thu May 30 18:31:53 2024 -0400
    10.2+++ b/lisp/lib/pod/pkg.lisp	Fri May 31 18:18:12 2024 -0400
    10.3@@ -3,12 +3,20 @@
    10.4 ;; Pod is a Lisp system for interacting with container runtimes --
    10.5 ;; i.e. Podman/Libpod.
    10.6 
    10.7+;;; Commentary:
    10.8+
    10.9 ;; Podman supports a RESTful API which is described here:
   10.10 ;; https://docs.podman.io/en/latest/_static/api.html
   10.11 
   10.12-;; The API is the best way to interact with containers in almost all
   10.13-;; cases but there are a few utilities for initializing the podman
   10.14-;; server or spawning one in a user process when supported.
   10.15+;; The API is the best way to interact with containers in almost all cases but
   10.16+;; there are a few utilities for initializing the podman server or spawning
   10.17+;; one in a user process when supported.
   10.18+
   10.19+;; Once the podman API is up and running the functions in this library can be
   10.20+;; used to make requests such as starting a container or building an image.
   10.21+
   10.22+;; We also provide support for composing and parsing Containerfiles from Lisp
   10.23+;; for easy integration into applications.
   10.24 
   10.25 ;;; Code:
   10.26 (defpackage :pod
    11.1--- a/lisp/lib/pod/pod.asd	Thu May 30 18:31:53 2024 -0400
    11.2+++ b/lisp/lib/pod/pod.asd	Fri May 31 18:18:12 2024 -0400
    11.3@@ -1,5 +1,5 @@
    11.4 (defsystem :pod
    11.5-  :depends-on (:std :cli :obj :dat :net :flexi-streams :dexador)
    11.6+  :depends-on (:std :cli :obj :dat :net :flexi-streams)
    11.7   :components ((:file "pkg")
    11.8                (:file "err")
    11.9                (:module "obj"
    12.1--- a/lisp/lib/pod/podman.lisp	Thu May 30 18:31:53 2024 -0400
    12.2+++ b/lisp/lib/pod/podman.lisp	Fri May 31 18:18:12 2024 -0400
    12.3@@ -11,8 +11,10 @@
    12.4 ;; podman system service --time=0 tcp://localhost:8888 (inet-socket :stream :tcp)
    12.5 (defun podman-run-command ())
    12.6 
    12.7-(defun start-podman-service (addr &optional (time 0))
    12.8-  "Start the Libpod API on ADDR which should be a valid uri beginning
    12.9-with tcp:// or unix://."
   12.10-  (sb-ext:run-program *podman-exe* `("system" "service" ,addr ,(format nil "--time=~a" time))))
   12.11-
   12.12+(defun start-podman-service (addr &optional (protocol :unix) (time 0))
   12.13+  "Start the Libpod API on ADDR over PROTO which is either :TCP or :UNIX."
   12.14+  (declare ((member :unix :tcp) protocol))
   12.15+  (sb-ext:run-program *podman-exe* `("system"
   12.16+                                     "service"
   12.17+                                     ,(format nil "~(~a~)://~a" protocol addr)
   12.18+                                     ,(format nil "--time=~a" time))))
    13.1--- a/lisp/lib/pod/util.lisp	Thu May 30 18:31:53 2024 -0400
    13.2+++ b/lisp/lib/pod/util.lisp	Fri May 31 18:18:12 2024 -0400
    13.3@@ -23,7 +23,7 @@
    13.4     ;; TODO 2024-04-01: remove dependencies
    13.5     (let ((wrapped-stream (flexi-streams:make-flexi-stream (chunga::make-chunked-stream stream)
    13.6                                                            :external-format :utf8)))
    13.7-      (dex:request (format-libpod-api-local path) :method method :stream wrapped-stream))))
    13.8+      (req:request (format-libpod-api-local path) :method method :stream wrapped-stream))))
    13.9 
   13.10 (defun libpod-request-json (client path &optional (method :get))
   13.11   (dat/json:json-decode (libpod-request client path method)))
    14.1--- a/lisp/lib/skel/core/obj.lisp	Thu May 30 18:31:53 2024 -0400
    14.2+++ b/lisp/lib/skel/core/obj.lisp	Fri May 31 18:18:12 2024 -0400
    14.3@@ -231,7 +231,9 @@
    14.4    (auto-insert :initform nil :initarg :auto-insert :type form))
    14.5   (:documentation "Root configuration class for the SKEL system. This class doesn't need to be exposed externally, but specifies all shared fields of SK-*-CONFIG types."))
    14.6 
    14.7+(declaim (inline bound-string-p sk-dir))
    14.8 (defun bound-string-p (o s) (and (slot-boundp o s) (stringp (slot-value o s))))
    14.9+(defun sk-dir (o) (directory-namestring (sk-path o)))
   14.10 
   14.11 (defmethod load-ast ((self sk-config))
   14.12   ;; internal ast is never tagged
   14.13@@ -242,13 +244,13 @@
   14.14 	  (sb-int:doplist (k v) ast
   14.15             (when-let ((s (find-sk-symbol k)))
   14.16 	      (setf (slot-value self s) v))) ;; needs to be the correct package
   14.17-	  (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (sk-stash self))))
   14.18-	  (when (bound-string-p self 'store) (setf (sk-store self) (pathname (sk-store self))))
   14.19-	  (when (bound-string-p self 'cache) (setf (sk-cache self) (pathname (sk-cache self))))
   14.20-	  (when (bound-string-p self 'registry) (setf (sk-registry self) (pathname (sk-registry self))))
   14.21+	  (when (bound-string-p self 'stash) (setf (sk-stash self) (merge-pathnames (sk-stash self) (sk-dir self))))
   14.22+	  (when (bound-string-p self 'store) (setf (sk-store self) (merge-pathnames (sk-store self) (sk-dir self))))
   14.23+	  (when (bound-string-p self 'cache) (setf (sk-cache self) (merge-pathnames (sk-cache self) (sk-dir self))))
   14.24+	  (when (bound-string-p self 'registry) (setf (sk-registry self) (merge-pathnames (sk-registry self) (sk-dir self))))
   14.25 	  (when (bound-string-p self 'scripts) (setf (sk-scripts self)
   14.26 					             ;; TODO 2023-10-14: convert into list of script names
   14.27-					             (pathname (sk-scripts self))))
   14.28+					             (merge-pathnames (sk-scripts self) (sk-dir self))))
   14.29 	  (unless *keep-ast* (setf (ast self) nil))
   14.30 	  self)
   14.31 	;; invalid ast, signal error
    15.1--- a/lisp/lib/vc/git.lisp	Thu May 30 18:31:53 2024 -0400
    15.2+++ b/lisp/lib/vc/git.lisp	Fri May 31 18:18:12 2024 -0400
    15.3@@ -1,6 +1,6 @@
    15.4 (in-package :vc)
    15.5 
    15.6-(defvar *git-program* (find-exe "git"))
    15.7+(defvar *git-program* (cli:find-exe "git"))
    15.8 
    15.9 (defun run-git-command (cmd &optional args output (wait t))
   15.10   (unless (listp args) (setf args (list args)))
   15.11@@ -86,7 +86,7 @@
   15.12 
   15.13 (defmethod vc-status ((self git-repo) &key &allow-other-keys) (vc-run self "status"))
   15.14 
   15.15-(defmethod vc-branch ((self git-repo) &key cmd branch &allow-other-keys) (vc-run self "branch" cmd branch))
   15.16+(defmethod vc-branch ((self git-repo)) (vc-run self "branch"))
   15.17 
   15.18 (defmethod vc-diff ((a git-repo) (b git-repo) &key &allow-other-keys)
   15.19   (vc-run a "diff" (vc-repo-head a) (vc-repo-head b)))
    16.1--- a/lisp/lib/vc/hg.lisp	Thu May 30 18:31:53 2024 -0400
    16.2+++ b/lisp/lib/vc/hg.lisp	Fri May 31 18:18:12 2024 -0400
    16.3@@ -35,7 +35,7 @@
    16.4 (in-package :vc)
    16.5 
    16.6 (defvar *default-hg-client-buffer-size* 4096)
    16.7-(defvar *hg-program* (or (find-exe "rhg") (find-exe "hg")))
    16.8+(defvar *hg-program* (or (cli:find-exe "rhg") (cli:find-exe "hg")))
    16.9 
   16.10 (defun run-hg-command (cmd &optional args output (wait t))
   16.11   "Run an hg command."
   16.12@@ -120,7 +120,7 @@
   16.13 
   16.14 (defmethod vc-status ((self hg-repo) &key &allow-other-keys) (vc-run self "status"))
   16.15 
   16.16-(defmethod vc-branch ((self hg-repo) &key cmd branch &allow-other-keys) (vc-run self "branch" cmd branch))
   16.17+(defmethod vc-branch ((self hg-repo)) (vc-run self "branch"))
   16.18 
   16.19 (defmethod vc-diff ((a hg-repo) (b hg-repo) &key &allow-other-keys) 
   16.20   (vc-run a "diff" (vc-repo-head a) (vc-repo-head b)))
    17.1--- a/lisp/lib/vc/proto.lisp	Thu May 30 18:31:53 2024 -0400
    17.2+++ b/lisp/lib/vc/proto.lisp	Fri May 31 18:18:12 2024 -0400
    17.3@@ -18,21 +18,30 @@
    17.4 (defgeneric (setf vc-id) (self id)
    17.5   (:documentation "Set the ID of a vc object."))
    17.6 
    17.7-(defgeneric vc-clone (self remote &key &allow-other-keys))
    17.8+(defgeneric vc-clone (self remote &key &allow-other-keys)
    17.9+  (:documentation "Clone repo REMOTE into spec SELF."))
   17.10 
   17.11-(defgeneric vc-push (self remote &key &allow-other-keys))
   17.12+(defgeneric vc-push (self remote &key &allow-other-keys)
   17.13+  (:documentation "Push repo SELF to REMOTE."))
   17.14 
   17.15-(defgeneric vc-pull (self remote &key &allow-other-keys))
   17.16+(defgeneric vc-pull (self remote &key &allow-other-keys)
   17.17+  (:documentation "Pull repo REMOTE into spec SELF."))
   17.18 
   17.19-(defgeneric vc-commit (self msg &key &allow-other-keys))
   17.20+(defgeneric vc-commit (self msg &key &allow-other-keys)
   17.21+  (:documentation "Commit repo object SELF, supplied with message MSG."))
   17.22 
   17.23-(defgeneric vc-add (self &rest files))
   17.24+(defgeneric vc-add (self &rest files)
   17.25+  (:documentation "Add FILES to repo SELF."))
   17.26 
   17.27-(defgeneric vc-remove (self &rest files))
   17.28+(defgeneric vc-remove (self &rest files)
   17.29+  (:documentation "Remove FILES from repo SELF."))
   17.30 
   17.31-(defgeneric vc-addremove (self &rest files))
   17.32+(defgeneric vc-addremove (self &rest files)
   17.33+  (:documentation "Add any untracked files in the current directory and delete tracked files that
   17.34+are missing."))
   17.35 
   17.36-(defgeneric vc-branch (self &key cmd branch &allow-other-keys))
   17.37+(defgeneric vc-branch (self)
   17.38+  (:documentation "Return the name of the current branch."))
   17.39 
   17.40 (defgeneric vc-status (self &key &allow-other-keys))
   17.41 
    18.1--- a/lisp/lib/vc/vc.asd	Thu May 30 18:31:53 2024 -0400
    18.2+++ b/lisp/lib/vc/vc.asd	Fri May 31 18:18:12 2024 -0400
    18.3@@ -5,7 +5,8 @@
    18.4                (:file "err")
    18.5                (:file "proto")
    18.6                (:file "hg")
    18.7-               (:file "git"))
    18.8+               (:file "git")
    18.9+               (:file "vc"))
   18.10   :in-order-to ((test-op (test-op :vc/tests))))
   18.11 
   18.12 (defsystem :vc/tests
    19.1--- a/lisp/prelude.asd	Thu May 30 18:31:53 2024 -0400
    19.2+++ b/lisp/prelude.asd	Fri May 31 18:18:12 2024 -0400
    19.3@@ -1,6 +1,4 @@
    19.4 (pushnew :prelude *features*)
    19.5-(pushnew "PRELUDE" *modules* :test 'equal)
    19.6-
    19.7 (defsystem :prelude
    19.8   :depends-on (:std :cli
    19.9                :rocksdb :btrfs :uring
   19.10@@ -14,7 +12,6 @@
   19.11                :parse :pod :rdb :rt
   19.12                :nuklear :aud :cry :krypt
   19.13                :io :gui :log :dat :net)
   19.14+  :components ((:file "prelude"))
   19.15   :build-operation monolithic-compile-bundle-op
   19.16   :build-pathname "prelude")
   19.17-
   19.18-
    21.1--- a/lisp/std/pkg.lisp	Thu May 30 18:31:53 2024 -0400
    21.2+++ b/lisp/std/pkg.lisp	Fri May 31 18:18:12 2024 -0400
    21.3@@ -1,9 +1,12 @@
    21.4-(pushnew :std *features*)
    21.5-(pushnew "STD" *modules* :test 'equal)
    21.6+;;; std/pkg.lisp --- Standard Packages
    21.7+
    21.8+;;
    21.9 
   21.10+;;; Code:
   21.11+(pushnew :std *features*)
   21.12 (defpackage :std-user
   21.13-  (:use :cl :std/named-readtables :std/defpkg)
   21.14-  (:shadowing-import-from :std/defpkg :defpkg)
   21.15+  (:use :cl :std)
   21.16+  (:shadowing-import-from :std/defpkg :defpkg :define-lisp-package)
   21.17   (:export :defpkg :in-readtable :define-lisp-package))
   21.18 
   21.19 (in-package :std-user)
    22.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2+++ b/lisp/user.asd	Fri May 31 18:18:12 2024 -0400
    22.3@@ -0,0 +1,8 @@
    22.4+(pushnew :user *features*)
    22.5+(defsystem :user
    22.6+  :depends-on (:std :cli :doc :nlp
    22.7+               :obj :skel :syn :organ
    22.8+               :packy :parse :pod :rdb 
    22.9+               :krypt :gui)
   22.10+  :components ((:file "user"))
   22.11+  :build-pathname "user")
    23.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2+++ b/lisp/user.lisp	Fri May 31 18:18:12 2024 -0400
    23.3@@ -0,0 +1,8 @@
    23.4+;;; lisp/user.lisp --- CC Lisp User Environments
    23.5+
    23.6+;; Top-level namespaces accessible to user lisps.
    23.7+
    23.8+;;; Code:
    23.9+(in-package :std-user)
   23.10+(define-lisp-package :std)
   23.11+(defpkg :user (:use :std-lisp :std-user))
    25.1--- a/skelfile	Thu May 30 18:31:53 2024 -0400
    25.2+++ b/skelfile	Fri May 31 18:18:12 2024 -0400
    25.3@@ -10,7 +10,7 @@
    25.4 :imports ("lisp/skelfile" "rust/skelfile" "emacs/skelfile" "c/skelfile")
    25.5 :vc :hg
    25.6 :docs ((:org "readme"))
    25.7-:scripts "x.lisp"
    25.8+:scripts ((:lisp "x"))
    25.9 :env ((cc "clang"))
   25.10 :rules
   25.11 ((all (x compile std prelude build))