cl-micropm

A very minimalist, decentralized "package manager" for Common Lisp (<200 LOC)
Log | Files | Refs | Submodules | README | LICENSE

commit 3a953431cf9d4ebd7e91e7452940115bb2b3cb8e
parent d0a692edce66d375b689a359b90bb37e00f7d1a7
Author: Risto Stevcev <me@risto.codes>
Date:   Sun, 27 Jun 2021 02:44:05 +0200

Updated README

Diffstat:
MREADME.md | 87++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 71 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md @@ -3,37 +3,86 @@ A very minimalist "package manager" for Common Lisp. +## Install + +Make sure that you have docker installed on your system and that your user has permissions (is in +the `docker` group) + +Fetch the single-file executable from git and add the permissions: + +``` sh +curl -LO https://github.com/Risto-Stevcev/cl-micropm/raw/main/micropm-get +chmod +x ./micropm-get +``` + +Then you can also move the file into a path that your system can find, ie: + +``` sh +sudo mv ./micropm-get /usr/local/bin/ +``` + + ## Usage -Assuming you have a system with the name `mysystem`, you can get the dependencies like this: + +### Defining a system + +A system is how you set up your project to be used as a library to the rest of the world, similar to +NodeJS packages. An `asd` file (ie `monty-hall.asd`) is a system file, similar to NodeJS' +`package.json`. + +The library that's used to interact with systems is called the +[ASDF](https://common-lisp.net/project/asdf/asdf/) build system, and it's already included in most +Common Lisp compilers. If it's included with the Common Lisp compiler that you're using, but for +some reason you can't call asdf commands, then you may neet to also import it for it to be +available: `(require 'asdf)`. + +Here is an example of a system definition for a project called monty-hall in a file +`monty-hall.asd`: + +``` common-lisp +;; monty-hall.asd +(asdf:defsystem :monty-hall + :version "0.1.0" + :description "Monty hall problem simulator" + :author "Risto Stevcev <me@risto.codes>" + :serial t + :license "GNU GPL, version 3" + :components ((:file "monty-hall")) + :depends-on (#:alexandria #:arrow-macros)) +``` + +The first argument after the `defsystem` call is the name of the system (`:monty-hall`). It's then a +plist of various metadata about the project, as well as dependencies to foreign libraries, like +`#:alexandria` and ` #:arrow-macros`. You can view available libraries at +[quickref](https://quickref.common-lisp.net/index-per-library.html). + +In this case, system with the name `monty-hall`, you can get the dependencies by passing in the +system name like this: ```sh -$ ./get-deps.sh mysystem +$ micropm-get monty-hall ``` They'll be saved in the project-local `lisp-systems` folder. -Then just make sure to set `CL_SOURCE_REGISTRY` to point to that directory like this [.envrc](./envrc) +Then just make sure to set `CL_SOURCE_REGISTRY` to point to that directory, like this +[.envrc](./envrc), which gets copied by default `.envrc` when installing deps. Or optionally, use [direnv](direnv.net/) and just copy the [.envrc](./envrc), and it will load/unload the environment variable for all of your common lisp projects! -## Motivation - -There are a few attempts at a package manager for common lisp floating around, such as quicklisp, -qlot, and CLPM. The motivation to do this came from a few things I found that were lacking with -these: +## Goals -1. Dependendies should not be global, each project may have a local version that's different and may - want to pin that version. -2. It should be easy to work on projects that use different versions of a package, maybe even at the - same time, without too much hassle. -2. It should be easy to set up. -3. It should be easy to understand what it's doing and how it works. -4. It should be possible to just freeze the dependencies (separate fetching and loading). -5. It should be complete. Many of these seem to be in a forever beta stage. +- Dependendies should not be global, each project may have a local version that's different and may + want to pin that version. +- It should be easy to work on projects that use different versions of a package, maybe even at the + same time, without too much hassle. +- It should be easy to set up. +- It should be easy to understand what it's doing and how it works. +- It should be possible to just freeze the dependencies (separate fetching and loading commands). @@ -53,6 +102,12 @@ it could be updated via other means like directly cloning dependencies from a gi ultralisp. +## Roadmap + +- Support Ultralisp +- Self-destruct/uninstall command + + ## License See [LICENSE](./LICENSE)