about summary refs log tree commit diff
path: root/users/sterni/clhs/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-01-14T21·57+0100
committersterni <sternenseemann@systemli.org>2021-01-17T13·17+0000
commit861c0f0c79c4bd182552eea519978c8a1446d634 (patch)
tree88e0906e2ae8d146bbb9e57359349514ee5440d9 /users/sterni/clhs/default.nix
parent80e1ece32931530a0a024db9828d197f3fdb1951 (diff)
feat(sterni/clhs): add cli to lookup symbols in the CLHS r/2122
Probably very similar to M-x sly-hyperspec-lookup: take a list of
common lisp symbols on the command line open the corresponding pages
in a local copy of the hyperspec in $BROWSER. Optionally the paths can
be printed to stdout.

Change-Id: I389e254f14eb0fc8fd8b18a4dbfe7adeeda9ba72
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users/sterni/clhs/default.nix')
-rw-r--r--users/sterni/clhs/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/users/sterni/clhs/default.nix b/users/sterni/clhs/default.nix
new file mode 100644
index 000000000000..8c42e5e75c1f
--- /dev/null
+++ b/users/sterni/clhs/default.nix
@@ -0,0 +1,37 @@
+{ pkgs, depot, ... }:
+
+let
+  inherit (pkgs) fetchzip writeText;
+  inherit (depot.nix) buildLisp;
+  inherit (builtins) replaceStrings;
+
+  clhsVersion = "7-0";
+
+  clhs = fetchzip {
+    name = "HyperSpec-${replaceStrings [ "-" ] [ "." ] clhsVersion}";
+    url = "ftp://ftp.lispworks.com/pub/software_tools/reference/HyperSpec-${clhsVersion}.tar.gz";
+    sha256 = "1zsi35245m5sfb862ibzy0pzlph48wvlggnqanymhgqkpa1v20ak";
+    stripRoot = false;
+  };
+
+  clhs-path = writeText "clhs-path.lisp" ''
+    (in-package :clhs-lookup.clhs-path)
+    (defparameter *clhs-path* (pathname "${clhs}/"))
+  '';
+
+  clhs-lookup = buildLisp.program {
+    name = "clhs-lookup";
+
+    deps = [
+      (buildLisp.bundled "uiop")
+    ];
+
+    srcs = [
+      ./packages.lisp
+      clhs-path
+      ./clhs-lookup.lisp
+    ];
+  };
+in {
+  inherit clhs clhs-lookup;
+}