about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-21T02·06+0000
committerVincent Ambo <tazjin@google.com>2020-01-21T02·07+0000
commit6de462f674affc4407b89ffe356c2159efad353c (patch)
treefebc9f4d76a3ff5c9d9e74a90fb3504836609f39
parente50c669310811d45f1d89b50c359e9b1adbce21d (diff)
feat(third_party/lisp): Check in drakma HTTP client & deps r/436
This HTTP client has much fewer dependencies than some of the other
ones I've seen, and it'll be good enough for my demo purposes.
-rw-r--r--third_party/lisp/chipz.nix31
-rw-r--r--third_party/lisp/chunga.nix27
-rw-r--r--third_party/lisp/cl-base64.nix17
-rw-r--r--third_party/lisp/drakma.nix35
-rw-r--r--third_party/lisp/puri.nix15
-rw-r--r--third_party/lisp/sb-bsd-sockets.nix10
-rw-r--r--third_party/lisp/split-sequence.nix18
-rw-r--r--third_party/lisp/usocket.nix35
8 files changed, 188 insertions, 0 deletions
diff --git a/third_party/lisp/chipz.nix b/third_party/lisp/chipz.nix
new file mode 100644
index 0000000000..5a8c39dc05
--- /dev/null
+++ b/third_party/lisp/chipz.nix
@@ -0,0 +1,31 @@
+# Common Lisp library for decompressing deflate, zlib, gzip, and bzip2 data
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "froydnj";
+  repo = "chipz";
+  rev = "75dfbc660a5a28161c57f115adf74c8a926bfc4d";
+  sha256 = "0plx4rs39zbs4gjk77h4a2q11zpy75fh9v8hnxrvsf8fnakajhwg";
+};
+in pkgs.nix.buildLisp.library {
+  name = "chipz";
+  deps = with pkgs.third_party.lisp; [ asdf ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "chipz.asd"
+    "package.lisp"
+    "constants.lisp"
+    "conditions.lisp"
+    "dstate.lisp"
+    "types-and-tables.lisp"
+    "crc32.lisp"
+    "adler32.lisp"
+    "inflate-state.lisp"
+    "gzip.lisp"
+    "zlib.lisp"
+    "inflate.lisp"
+    "bzip2.lisp"
+    "decompress.lisp"
+    "stream.lisp"
+  ];
+}
diff --git a/third_party/lisp/chunga.nix b/third_party/lisp/chunga.nix
new file mode 100644
index 0000000000..b56fb3b90c
--- /dev/null
+++ b/third_party/lisp/chunga.nix
@@ -0,0 +1,27 @@
+# Portable chunked streams for Common Lisp
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "edicl";
+  repo = "chunga";
+  rev = "16330852d01dfde4dd97dee7cd985a88ea571e7e";
+  sha256 = "0jzn3nyb3f22gm983rfk99smqs3mhb9ivjmasvhq9qla5cl9pyhd";
+};
+in pkgs.nix.buildLisp.library {
+  name = "chunga";
+  deps = with pkgs.third_party.lisp; [
+    trivial-gray-streams
+  ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "packages.lisp"
+    "specials.lisp"
+    "util.lisp"
+    "known-words.lisp"
+    "conditions.lisp"
+    "read.lisp"
+    "streams.lisp"
+    "input.lisp"
+    "output.lisp"
+  ];
+}
diff --git a/third_party/lisp/cl-base64.nix b/third_party/lisp/cl-base64.nix
new file mode 100644
index 0000000000..c4dc9ca2c7
--- /dev/null
+++ b/third_party/lisp/cl-base64.nix
@@ -0,0 +1,17 @@
+# Base64 encoding for Common Lisp
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "http://git.kpe.io/cl-base64.git";
+  rev = "fc62a5342445d4ec1dd44e95f7dc513473a8c89a";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cl-base64";
+  srcs = [
+    (src + "/package.lisp")
+    (src + "/encode.lisp")
+    (src + "/decode.lisp")
+  ];
+}
+
+
diff --git a/third_party/lisp/drakma.nix b/third_party/lisp/drakma.nix
new file mode 100644
index 0000000000..ac2d257a49
--- /dev/null
+++ b/third_party/lisp/drakma.nix
@@ -0,0 +1,35 @@
+# Drakma is an HTTP client for Common Lisp.
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "edicl";
+  repo = "drakma";
+  rev = "87feb02bef00b11a753d5fb21a5fec526b0d0bbb";
+  sha256 = "01b80am2vrw94xmdj7f21qm7p5ys08mmpzv4nc4icql81hqr1w2m";
+};
+in pkgs.nix.buildLisp.library {
+  name = "drakma";
+  deps = with pkgs.third_party.lisp; [
+    asdf
+    chipz
+    chunga
+    cl-base64
+    cl-plus-ssl
+    cl-ppcre
+    flexi-streams
+    puri
+    usocket
+  ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "drakma.asd" # Required because the system definition is used
+    "packages.lisp"
+    "specials.lisp"
+    "conditions.lisp"
+    "util.lisp"
+    "read.lisp"
+    "cookies.lisp"
+    "encoding.lisp"
+    "request.lisp"
+  ];
+}
diff --git a/third_party/lisp/puri.nix b/third_party/lisp/puri.nix
new file mode 100644
index 0000000000..1ac22a3996
--- /dev/null
+++ b/third_party/lisp/puri.nix
@@ -0,0 +1,15 @@
+# Portable URI library
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "http://git.kpe.io/puri.git";
+  rev = "ef5afb9e5286c8e952d4344f019c1a636a717b97";
+};
+in pkgs.nix.buildLisp.library {
+  name = "puri";
+  srcs = [
+    (src + "/src.lisp")
+  ];
+}
+
+
diff --git a/third_party/lisp/sb-bsd-sockets.nix b/third_party/lisp/sb-bsd-sockets.nix
new file mode 100644
index 0000000000..d311f8590f
--- /dev/null
+++ b/third_party/lisp/sb-bsd-sockets.nix
@@ -0,0 +1,10 @@
+# SB-BSD-SOCKETS is an SBCL component. This package just forces it to
+# be loaded.
+{ pkgs, ... }:
+
+with pkgs;
+
+nix.buildLisp.library {
+  name = "sb-bsd-sockets";
+  srcs = lib.singleton (builtins.toFile "sb-bsd-sockets.lisp" "(require 'sb-bsd-sockets)");
+}
diff --git a/third_party/lisp/split-sequence.nix b/third_party/lisp/split-sequence.nix
new file mode 100644
index 0000000000..bccd0d6fcc
--- /dev/null
+++ b/third_party/lisp/split-sequence.nix
@@ -0,0 +1,18 @@
+# split-sequence is a library for, well, splitting sequences apparently.
+{ pkgs, ... }:
+
+let src = builtins.fetchGit {
+  url = "https://github.com/sharplispers/split-sequence.git";
+  rev = "41c0fc79a5a2871d16e5727969a8f699ef44d791";
+};
+in pkgs.nix.buildLisp.library {
+  name = "split-sequence";
+  srcs = map (f: src + ("/" + f)) [
+    "package.lisp"
+    "vector.lisp"
+    "list.lisp"
+    "extended-sequence.lisp"
+    "api.lisp"
+    "documentation.lisp"
+  ];
+}
diff --git a/third_party/lisp/usocket.nix b/third_party/lisp/usocket.nix
new file mode 100644
index 0000000000..16f2003a33
--- /dev/null
+++ b/third_party/lisp/usocket.nix
@@ -0,0 +1,35 @@
+# Usocket is a portable socket library
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "usocket";
+  repo = "usocket";
+  rev = "fdf4fd1e0051ce83340ccfbbc8a43a462bb19cf2";
+  sha256 = "0x746wr2324l6bn7skqzgkzcbj5kd0zp2ck0c8rldrw0rzabg826";
+};
+in pkgs.nix.buildLisp.library {
+  name = "usocket";
+  deps = with pkgs.third_party.lisp; [
+    asdf
+    sb-bsd-sockets
+    split-sequence
+  ];
+
+  srcs = [
+    # usocket also reads its version from ASDF, but there's further
+    # shenanigans happening there that I don't intend to support right
+    # now. Behold:
+    (builtins.toFile "usocket.asd" ''
+      (in-package :asdf)
+      (defsystem usocket
+        :version "0.8.3")
+    '')
+  ] ++
+  # Now for the regularly scheduled programming:
+  (map (f: src + ("/" + f)) [
+    "package.lisp"
+    "usocket.lisp"
+    "condition.lisp"
+    "backend/sbcl.lisp"
+  ]);
+}