lisp-modules: make ql-import.lisp automatically pull the latest Quicklisp dist

This commit is contained in:
Kasper Gałkowski 2023-03-02 18:44:32 +01:00
parent 5f2e4cf4be
commit 092acca8b3
2 changed files with 24 additions and 12 deletions

View file

@ -81,16 +81,15 @@ nix-shell --run 'sbcl --script ql-import.lisp'
The script will:
1. Download the Quicklisp `systems.txt` and `releases.txt` files
1. Download the latest Quicklisp `systems.txt` and `releases.txt` files
2. Generate an SQLite database of all QL systems in `packages.sqlite`
3. Generate an `imported.nix` file from the database
The maintainer's job there is to:
1. Update the `import/main.lisp` file for new QL releases
2. Re-run the `ql-import.lisp` script
3. Add missing native dependencies in `ql.nix`
4. For packages that still don't build, package them manually in `packages.nix`
1. Re-run the `ql-import.lisp` script
2. Add missing native dependencies in `ql.nix`
3. For packages that still don't build, package them manually in `packages.nix`
Also, the `imported.nix` file **must not be edited manually**! It should only be
generated as described in this section.

View file

@ -2,7 +2,9 @@
(:use :common-lisp
:org.lispbuilds.nix/database/sqlite
:org.lispbuilds.nix/repository/quicklisp
:org.lispbuilds.nix/api))
:org.lispbuilds.nix/api)
(:local-nicknames
(:http :dexador)))
(in-package org.lispbuilds.nix/main)
@ -18,12 +20,22 @@
:init-file (resource "init" "sql")
:url "packages.sqlite"))
;; Check http://beta.quicklisp.org/dist/quicklisp.txt for updates
(defvar *quicklisp*
(make-instance
'quicklisp-repository
:dist-url
"https://beta.quicklisp.org/dist/quicklisp/2023-02-15/"))
(defvar *quicklisp* nil)
(defun get-quicklisp-version ()
(let ((response (http:get "http://beta.quicklisp.org/dist/quicklisp.txt")))
(subseq
(second (uiop:split-string response :separator '(#\Newline)))
9)))
(defun init-quicklisp ()
(setf *quicklisp*
(make-instance
'quicklisp-repository
:dist-url
(format nil
"https://beta.quicklisp.org/dist/quicklisp/~a/"
(get-quicklisp-version)))))
(defun run-importers ()
(ignore-errors (delete-file "packages.sqlite"))
@ -38,5 +50,6 @@
(defun main ()
(format t "~%")
(init-quicklisp)
(run-importers)
(gen-nix-file))