about summary refs log tree commit diff
path: root/third_party/lisp/uax-15.nix
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-24T17·36-0400
committerglittershark <grfn@gws.fyi>2020-07-26T21·55+0000
commitda8bc7635e746ba313801632c9001df9161d3605 (patch)
treeac6c185a78ff8751baecb49b9443e2a3427280e7 /third_party/lisp/uax-15.nix
parent273053dbf3287c02dda60b442cf138a412d8f75b (diff)
feat(3p/lisp): Add postmodern r/1485
Change-Id: If6ffd9a2344dc98e95312ddcce14ba5c2519d004
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1420
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to '')
-rw-r--r--third_party/lisp/uax-15.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/third_party/lisp/uax-15.nix b/third_party/lisp/uax-15.nix
new file mode 100644
index 0000000000..664be63f06
--- /dev/null
+++ b/third_party/lisp/uax-15.nix
@@ -0,0 +1,46 @@
+{ depot, pkgs, ... }:
+
+let
+  inherit (pkgs) runCommand;
+  inherit (depot.nix.buildLisp) bundled;
+
+  src = pkgs.fetchFromGitHub {
+    owner = "sabracrolleton";
+    repo = "uax-15";
+    rev = "a62fc7253663fac6467fc6b6bb69a73a0e8dfaa0";
+    sha256 = "028kc3yfi29qjxs2nyr7dbrr2rcrr8lwpvbxvrq3g8bcwamc4jz4";
+  };
+
+  # src = ../../../uax-15;
+
+in depot.nix.buildLisp.library {
+  name = "uax-15";
+
+  deps = with pkgs.lisp; [
+    split-sequence
+    cl-ppcre
+    (bundled "uiop")
+    (bundled "asdf")
+  ];
+
+  srcs = [
+    "${src}/uax-15.asd"
+    "${src}/src/package.lisp"
+    "${src}/src/utilities.lisp"
+    "${src}/src/trivial-utf-16.lisp"
+    (runCommand "precomputed-tables.lisp" {} ''
+      substitute ${src}/src/precomputed-tables.lisp precomputed-tables.lisp \
+        --replace "(asdf:system-source-directory (asdf:find-system 'uax-15 nil))" \
+                  '"${src}/"'
+
+      sed -i precomputed-tables.lisp \
+        -e '17i(defvar *canonical-decomp-map*)' \
+        -e '17i(defvar *compatible-decomp-map*)' \
+        -e '17i(defvar *canonical-combining-class*)'
+
+      cp precomputed-tables.lisp $out
+    '')
+    "${src}/src/normalize-backend.lisp"
+    "${src}/src/uax-15.lisp"
+  ];
+}