about summary refs log tree commit diff
path: root/third_party/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/lisp')
-rw-r--r--third_party/lisp/alexandria.nix32
-rw-r--r--third_party/lisp/asdf.nix9
-rw-r--r--third_party/lisp/babel.nix31
-rw-r--r--third_party/lisp/bordeaux-threads.nix20
-rw-r--r--third_party/lisp/cffi.nix32
-rw-r--r--third_party/lisp/cl-ansi-text.nix19
-rw-r--r--third_party/lisp/cl-colors2.nix21
-rw-r--r--third_party/lisp/cl-plus-ssl.nix38
-rw-r--r--third_party/lisp/cl-ppcre.nix30
-rw-r--r--third_party/lisp/flexi-streams.nix34
-rw-r--r--third_party/lisp/sb-posix.nix10
-rw-r--r--third_party/lisp/trivial-features.nix12
-rw-r--r--third_party/lisp/trivial-garbage.nix12
-rw-r--r--third_party/lisp/trivial-gray-streams.nix16
-rw-r--r--third_party/lisp/uiop.nix10
15 files changed, 326 insertions, 0 deletions
diff --git a/third_party/lisp/alexandria.nix b/third_party/lisp/alexandria.nix
new file mode 100644
index 000000000000..dbe0554d6286
--- /dev/null
+++ b/third_party/lisp/alexandria.nix
@@ -0,0 +1,32 @@
+# Alexandria is one of the foundational Common Lisp libraries that
+# pretty much everything depends on:
+#
+# https://common-lisp.net/project/alexandria/
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://gitlab.common-lisp.net/alexandria/alexandria";
+  rev = "1224346a48770dc07a68ef3e612b9ac3d611eb07";
+};
+in pkgs.nix.buildLisp.library {
+  name = "alexandria";
+  srcs = map (f: src + ("/" + f)) [
+    "package.lisp"
+    "definitions.lisp"
+    "binding.lisp"
+    "strings.lisp"
+    "conditions.lisp"
+    "symbols.lisp"
+    "macros.lisp"
+    "functions.lisp"
+    "io.lisp"
+    "hash-tables.lisp"
+    "control-flow.lisp"
+    "lists.lisp"
+    "types.lisp"
+    "arrays.lisp"
+    "sequences.lisp"
+    "numbers.lisp"
+    "features.lisp"
+  ];
+}
diff --git a/third_party/lisp/asdf.nix b/third_party/lisp/asdf.nix
new file mode 100644
index 000000000000..3d41a1f36def
--- /dev/null
+++ b/third_party/lisp/asdf.nix
@@ -0,0 +1,9 @@
+# ASDF ships with SBCL. This package just exists to force it to load.
+{ pkgs, ... }:
+
+with pkgs;
+
+nix.buildLisp.library {
+  name = "asdf";
+  srcs = lib.singleton (builtins.toFile "asdf.lisp" "(require 'asdf)");
+}
diff --git a/third_party/lisp/babel.nix b/third_party/lisp/babel.nix
new file mode 100644
index 000000000000..ba367df9ad82
--- /dev/null
+++ b/third_party/lisp/babel.nix
@@ -0,0 +1,31 @@
+# Babel is an encoding conversion library for Common Lisp.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/cl-babel/babel.git";
+  rev = "ec9a17cdbdba3c1dd39609fc7961cfb3f0aa260e";
+};
+in pkgs.nix.buildLisp.library {
+  name = "babel";
+  deps = [ pkgs.third_party.lisp.alexandria ];
+
+  srcs = map (f: src + ("/src/" + f)) [
+    "packages.lisp"
+    "encodings.lisp"
+    "enc-ascii.lisp"
+    "enc-ebcdic.lisp"
+    "enc-ebcdic-int.lisp"
+    "enc-iso-8859.lisp"
+    "enc-unicode.lisp"
+    "enc-cp1251.lisp"
+    "enc-cp1252.lisp"
+    "jpn-table.lisp"
+    "enc-jpn.lisp"
+    "enc-gbk.lisp"
+    "enc-koi8.lisp"
+    "external-format.lisp"
+    "strings.lisp"
+    "gbk-map.lisp"
+    "sharp-backslash.lisp"
+  ];
+}
diff --git a/third_party/lisp/bordeaux-threads.nix b/third_party/lisp/bordeaux-threads.nix
new file mode 100644
index 000000000000..f1e458f4dc68
--- /dev/null
+++ b/third_party/lisp/bordeaux-threads.nix
@@ -0,0 +1,20 @@
+# This library is meant to make writing portable multi-threaded apps
+# in Common Lisp simple.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/sionescu/bordeaux-threads.git";
+  rev = "499b6d3f0ce635417d6096acf0a671d8bf3f6e5f";
+};
+in pkgs.nix.buildLisp.library {
+  name = "bordeaux-threads";
+  deps = [ pkgs.third_party.lisp.alexandria ];
+
+  srcs = map (f: src + ("/src/" + f)) [
+    "pkgdcl.lisp"
+    "bordeaux-threads.lisp"
+    "impl-sbcl.lisp"
+    "condition-variables.lisp"
+    "default-implementations.lisp"
+  ];
+}
diff --git a/third_party/lisp/cffi.nix b/third_party/lisp/cffi.nix
new file mode 100644
index 000000000000..556dee0676c0
--- /dev/null
+++ b/third_party/lisp/cffi.nix
@@ -0,0 +1,32 @@
+# CFFI purports to be the Common Foreign Function Interface.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/cffi/cffi.git";
+  rev = "5e838bf46d0089c43ebd3ea014a207c403e29c61";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cffi";
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    asdf
+    babel
+    trivial-features
+    uiop
+  ];
+
+  srcs = map (f: src + ("/src/" + f)) [
+    "cffi-sbcl.lisp"
+    "package.lisp"
+    "utils.lisp"
+    "libraries.lisp"
+    "early-types.lisp"
+    "types.lisp"
+    "enum.lisp"
+    "strings.lisp"
+    "structures.lisp"
+    "functions.lisp"
+    "foreign-vars.lisp"
+    "features.lisp"
+  ];
+}
diff --git a/third_party/lisp/cl-ansi-text.nix b/third_party/lisp/cl-ansi-text.nix
new file mode 100644
index 000000000000..88fcae318b7b
--- /dev/null
+++ b/third_party/lisp/cl-ansi-text.nix
@@ -0,0 +1,19 @@
+# Enables ANSI colors for printing.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/pnathan/cl-ansi-text.git";
+  rev = "257a5f19a2dc92d22f8fd772c0a78923b99b36a8";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cl-ansi-text";
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    cl-colors2
+  ];
+
+  srcs = map (f: src + ("/src/" + f)) [
+    "cl-ansi-text.lisp"
+    "define-colors.lisp"
+  ];
+}
diff --git a/third_party/lisp/cl-colors2.nix b/third_party/lisp/cl-colors2.nix
new file mode 100644
index 000000000000..44417d7d949c
--- /dev/null
+++ b/third_party/lisp/cl-colors2.nix
@@ -0,0 +1,21 @@
+
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://notabug.org/cage/cl-colors2.git";
+  rev = "795aedee593b095fecde574bd999b520dd03ed24";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cl-colors2";
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    cl-ppcre
+  ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "package.lisp"
+    "colors.lisp"
+    "colornames.lisp"
+    "hexcolors.lisp"
+  ];
+}
diff --git a/third_party/lisp/cl-plus-ssl.nix b/third_party/lisp/cl-plus-ssl.nix
new file mode 100644
index 000000000000..1945d8a2e9c7
--- /dev/null
+++ b/third_party/lisp/cl-plus-ssl.nix
@@ -0,0 +1,38 @@
+# Common Lisp bindings to OpenSSL
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/cl-plus-ssl/cl-plus-ssl.git";
+  rev = "29081992f6d7b4e3aa2c5eeece4cd92b745071f4";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cl-plus-ssl";
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    bordeaux-threads
+    cffi
+    flexi-streams
+    sb-posix
+    trivial-features
+    trivial-garbage
+    trivial-gray-streams
+    uiop
+  ];
+
+  native = [ pkgs.third_party.openssl ];
+
+  srcs = map (f: src + ("/src/" + f)) [
+    "package.lisp"
+    "reload.lisp"
+    "conditions.lisp"
+    "ffi.lisp"
+    "x509.lisp"
+    "ffi-buffer-all.lisp"
+    "ffi-buffer.lisp"
+    "streams.lisp"
+    "bio.lisp"
+    "random.lisp"
+    "context.lisp"
+    "verify-hostname.lisp"
+  ];
+}
diff --git a/third_party/lisp/cl-ppcre.nix b/third_party/lisp/cl-ppcre.nix
new file mode 100644
index 000000000000..5bf9240104a5
--- /dev/null
+++ b/third_party/lisp/cl-ppcre.nix
@@ -0,0 +1,30 @@
+# cl-ppcre is a Common Lisp regular expression library.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/edicl/cl-ppcre";
+  rev = "1ca0cd9ca0d161acd49c463d6cb5fff897596e2f";
+};
+in pkgs.nix.buildLisp.library {
+  name = "prove";
+
+  srcs = map (f: src + ("/" + f)) [
+    "packages.lisp"
+    "specials.lisp"
+    "util.lisp"
+    "errors.lisp"
+    "charset.lisp"
+    "charmap.lisp"
+    "chartest.lisp"
+    "lexer.lisp"
+    "parser.lisp"
+    "regex-class.lisp"
+    "regex-class-util.lisp"
+    "convert.lisp"
+    "optimize.lisp"
+    "closures.lisp"
+    "repetition-closures.lisp"
+    "scanner.lisp"
+    "api.lisp"
+  ];
+}
diff --git a/third_party/lisp/flexi-streams.nix b/third_party/lisp/flexi-streams.nix
new file mode 100644
index 000000000000..56a7f7b92e0e
--- /dev/null
+++ b/third_party/lisp/flexi-streams.nix
@@ -0,0 +1,34 @@
+# Flexible bivalent streams for Common Lisp
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/edicl/flexi-streams.git";
+  rev = "0fd872ae32022e834ef861a67d86879cf33a6b64";
+};
+in pkgs.nix.buildLisp.library {
+  name = "flexi-streams";
+  deps = [ pkgs.third_party.lisp.trivial-gray-streams ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "packages.lisp"
+    "mapping.lisp"
+    "ascii.lisp"
+    "koi8-r.lisp"
+    "iso-8859.lisp"
+    "code-pages.lisp"
+    "specials.lisp"
+    "util.lisp"
+    "conditions.lisp"
+    "external-format.lisp"
+    "length.lisp"
+    "encode.lisp"
+    "decode.lisp"
+    "in-memory.lisp"
+    "stream.lisp"
+    "output.lisp"
+    "input.lisp"
+    "io.lisp"
+    "strings.lisp"
+ ];
+}
+
diff --git a/third_party/lisp/sb-posix.nix b/third_party/lisp/sb-posix.nix
new file mode 100644
index 000000000000..5fc65d3f5920
--- /dev/null
+++ b/third_party/lisp/sb-posix.nix
@@ -0,0 +1,10 @@
+# SB-POSIX is an SBCL component. This package just forces it to be
+# loaded.
+{ pkgs, ... }:
+
+with pkgs;
+
+nix.buildLisp.library {
+  name = "sb-posix";
+  srcs = lib.singleton (builtins.toFile "sb-posix.lisp" "(require 'sb-posix)");
+}
diff --git a/third_party/lisp/trivial-features.nix b/third_party/lisp/trivial-features.nix
new file mode 100644
index 000000000000..c0ff0d2e2030
--- /dev/null
+++ b/third_party/lisp/trivial-features.nix
@@ -0,0 +1,12 @@
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/trivial-features/trivial-features.git";
+  rev = "b78b2df5d75bdf8fdfc69f0deec0a187d9664b0b";
+};
+in pkgs.nix.buildLisp.library {
+  name = "trivial-features";
+  srcs = [
+    (src + "/src/tf-sbcl.lisp")
+  ];
+}
diff --git a/third_party/lisp/trivial-garbage.nix b/third_party/lisp/trivial-garbage.nix
new file mode 100644
index 000000000000..8b2b6f0d3107
--- /dev/null
+++ b/third_party/lisp/trivial-garbage.nix
@@ -0,0 +1,12 @@
+# trivial-garbage provides a portable API to finalizers, weak
+# hash-tables and weak pointers
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/trivial-garbage/trivial-garbage.git";
+  rev = "dbc8e35acb0176b9a14fdc1027f5ebea93435a84";
+};
+in pkgs.nix.buildLisp.library {
+  name = "trivial-garbage";
+  srcs = [ (src + "/trivial-garbage.lisp") ];
+}
diff --git a/third_party/lisp/trivial-gray-streams.nix b/third_party/lisp/trivial-gray-streams.nix
new file mode 100644
index 000000000000..3d91f81209ef
--- /dev/null
+++ b/third_party/lisp/trivial-gray-streams.nix
@@ -0,0 +1,16 @@
+# Portability library for CL gray streams.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/trivial-gray-streams/trivial-gray-streams.git";
+  rev = "ebd59b1afed03b9dc8544320f8f432fdf92ab010";
+};
+in pkgs.nix.buildLisp.library {
+  name = "trivial-gray-streams";
+  srcs = [
+    (src + "/package.lisp")
+    (src + "/streams.lisp")
+  ];
+}
+
+
diff --git a/third_party/lisp/uiop.nix b/third_party/lisp/uiop.nix
new file mode 100644
index 000000000000..1a63041be676
--- /dev/null
+++ b/third_party/lisp/uiop.nix
@@ -0,0 +1,10 @@
+# UIOP ships with SBCL (due to ASDF). This package just exists to
+# force it to load.
+{ pkgs, ... }:
+
+with pkgs;
+
+nix.buildLisp.library {
+  name = "uiop";
+  srcs = lib.singleton (builtins.toFile "uiop.lisp" "(require 'uiop)");
+}