patch & packaging with nix

This commit is contained in:
Alan Daniels 2025-12-15 20:02:33 +11:00
parent 85b8a54597
commit 5029a3e3b8
4 changed files with 64 additions and 7 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

View file

@ -26,12 +26,12 @@
(in-package :cl-user)
(defpackage :cl-dates
(:use :cl :asdf))
;; (defpackage :cl-dates
;; (:use :cl :asdf))
(in-package :cl-dates)
;; (in-package :cl-dates)
(defsystem :cl-dates
(asdf:defsystem :cl-dates
:version "1.0"
:description "Date arithmetic library for Common Lisp"
:author "Sudhir Shenoy"
@ -48,7 +48,7 @@
(:file "calendar")
(:file "bus-date-arith")))
(defsystem :cl-dates-test
(asdf:defsystem :cl-dates-test
:description "Date arithmetic library tests"
:author "Sudhir Shenoy"
:license "BSD"
@ -60,6 +60,6 @@
(:file "test-parse-date")
(:file "test-hols")))))
(defmethod perform ((o test-op) (c (eql (find-system :cl-dates))))
(operate 'load-op :cl-dates-test)
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system :cl-dates))))
(asdf:operate 'asdf:load-op :cl-dates-test)
(funcall (intern (symbol-name :run-all-tests) (find-package :cl-dates-test))))

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1765472234,
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View file

@ -0,0 +1,29 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
pkgs = import nixpkgs {system = "x86_64-linux";};
cl-dates = pkgs.sbcl.buildASDFSystem {
pname = "cl-dates";
version = "latest";
src = ./.;
};
in {
packages.x86_64-linux.default = cl-dates;
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = [
(pkgs.sbcl.withPackages (ps: [
cl-dates
]))
];
};
};
}