From 861c0f0c79c4bd182552eea519978c8a1446d634 Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 14 Jan 2021 22:57:07 +0100 Subject: feat(sterni/clhs): add cli to lookup symbols in the CLHS 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 --- users/sterni/clhs/default.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 users/sterni/clhs/default.nix (limited to 'users/sterni/clhs/default.nix') diff --git a/users/sterni/clhs/default.nix b/users/sterni/clhs/default.nix new file mode 100644 index 0000000000..8c42e5e75c --- /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; +} -- cgit 1.4.1