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: 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` 2. Generate an SQLite database of all QL systems in `packages.sqlite`
3. Generate an `imported.nix` file from the database 3. Generate an `imported.nix` file from the database
The maintainer's job there is to: The maintainer's job there is to:
1. Update the `import/main.lisp` file for new QL releases 1. Re-run the `ql-import.lisp` script
2. Re-run the `ql-import.lisp` script 2. Add missing native dependencies in `ql.nix`
3. Add missing native dependencies in `ql.nix` 3. For packages that still don't build, package them manually in `packages.nix`
4. 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 Also, the `imported.nix` file **must not be edited manually**! It should only be
generated as described in this section. generated as described in this section.

View File

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