about summary refs log tree commit diff
path: root/third_party/lisp/str.nix
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-03-23T14·20-0400
committerclbot <clbot@tvl.fyi>2024-03-31T19·18+0000
commitd5f57ac6e68f3acd79f1abc91d8ee9afc435018f (patch)
tree8e96aaf920b4c46d705137485d673adb74ffc4a7 /third_party/lisp/str.nix
parent87d5dd6371632edc9027a3e75ec6e1afc5b9d825 (diff)
feat(3p/lisp): Add str package and dependencies r/7825
Change-Id: Iffb66f4580517b1dbfee8c79e766552508695e5f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11252
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Autosubmit: aspen <root@gws.fyi>
Diffstat (limited to 'third_party/lisp/str.nix')
-rw-r--r--third_party/lisp/str.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/third_party/lisp/str.nix b/third_party/lisp/str.nix
new file mode 100644
index 000000000000..556f9cc30709
--- /dev/null
+++ b/third_party/lisp/str.nix
@@ -0,0 +1,49 @@
+{ depot, pkgs, ... }:
+
+let
+  inherit (depot.nix) buildLisp;
+  src = with pkgs; srcOnly lispPackages.str;
+in
+buildLisp.library {
+  name = "str";
+
+  deps = with depot.third_party.lisp; [
+    {
+      sbcl = buildLisp.bundled "uiop";
+      default = buildLisp.bundled "asdf";
+    }
+    cl-ppcre
+    cl-ppcre.unicode
+    cl-change-case
+  ];
+
+  srcs = [
+    (pkgs.runCommand "str.lisp" { } ''
+      substitute ${src}/str.lisp $out \
+        --replace-fail \
+          '(asdf:component-version (asdf:find-system "str"))' \
+          '"${pkgs.lispPackages.str.meta.version}"'
+    '')
+  ];
+
+  brokenOn = [
+    "ccl" # In REPLACE-USING: Shouldn't assign to variable I
+  ];
+
+  tests = {
+    name = "str-test";
+    srcs = [ (src + "/test/test-str.lisp") ];
+    deps = [
+      {
+        sbcl = depot.nix.buildLisp.bundled "uiop";
+        default = depot.nix.buildLisp.bundled "asdf";
+      }
+      depot.third_party.lisp.prove
+      depot.third_party.lisp.fiveam
+    ];
+
+    expression = ''
+      (fiveam:run! 'str::test-str)
+    '';
+  };
+}