about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-22T00·23+0000
committerVincent Ambo <tazjin@google.com>2020-01-22T00·23+0000
commitfe3ea06cbc32c9b727549a6505e69234f3072f6f (patch)
tree0fca475404528540bcf1bef98f9360ba67c828a2
parent6de462f674affc4407b89ffe356c2159efad353c (diff)
feat(third_party/lisp): Add derivations for hunchentoot & deps r/437
-rw-r--r--third_party/lisp/cl-fad.nix25
-rw-r--r--third_party/lisp/hunchentoot.nix61
-rw-r--r--third_party/lisp/md5.nix18
-rw-r--r--third_party/lisp/rfc2388.nix17
-rw-r--r--third_party/lisp/sb-rotate-byte.nix10
5 files changed, 131 insertions, 0 deletions
diff --git a/third_party/lisp/cl-fad.nix b/third_party/lisp/cl-fad.nix
new file mode 100644
index 0000000000..474e4b6963
--- /dev/null
+++ b/third_party/lisp/cl-fad.nix
@@ -0,0 +1,25 @@
+# Portable pathname library
+{ pkgs, ...}:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "edicl";
+  repo = "cl-fad";
+  rev = "c13d81c4bd9ba3a172631fd05dd213ab90e7d4cb";
+  sha256 = "1gc8i82v6gks7g0lnm54r4prk2mklidv2flm5fvbr0a7rsys0vpa";
+};
+in pkgs.nix.buildLisp.library {
+  name = "cl-fad";
+
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    bordeaux-threads
+    sb-posix
+  ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "packages.lisp"
+    "fad.lisp"
+    "path.lisp"
+    "temporary-files.lisp"
+  ];
+}
diff --git a/third_party/lisp/hunchentoot.nix b/third_party/lisp/hunchentoot.nix
new file mode 100644
index 0000000000..726eb222e5
--- /dev/null
+++ b/third_party/lisp/hunchentoot.nix
@@ -0,0 +1,61 @@
+# Hunchentoot is a web framework for Common Lisp.
+{ pkgs, ...}:
+
+let
+  src = pkgs.third_party.fetchFromGitHub {
+    owner = "edicl";
+    repo = "hunchentoot";
+    rev = "585b45b6b873f2da421fdf456b61860ab5868207";
+    sha256 = "13nazwix067mdclq9vgjhsi2vpr57a8dz51dd5d3h99ccsq4mik5";
+  };
+  url-rewrite = pkgs.nix.buildLisp.library {
+    name = "url-rewrite";
+
+    srcs = map (f: src + ("/url-rewrite/" + f)) [
+      "packages.lisp"
+      "specials.lisp"
+      "primitives.lisp"
+      "util.lisp"
+      "url-rewrite.lisp"
+    ];
+  };
+in pkgs.nix.buildLisp.library {
+  name = "hunchentoot";
+
+  deps = with pkgs.third_party.lisp; [
+    alexandria
+    bordeaux-threads
+    chunga
+    cl-base64
+    cl-fad
+    rfc2388
+    cl-plus-ssl
+    cl-ppcre
+    flexi-streams
+    md5
+    trivial-backtrace
+    usocket
+    url-rewrite
+  ];
+
+  srcs = map (f: src + ("/" + f)) [
+    "hunchentoot.asd"
+    "packages.lisp"
+    "compat.lisp"
+    "specials.lisp"
+    "conditions.lisp"
+    "mime-types.lisp"
+    "util.lisp"
+    "log.lisp"
+    "cookie.lisp"
+    "reply.lisp"
+    "request.lisp"
+    "session.lisp"
+    "misc.lisp"
+    "headers.lisp"
+    "set-timeouts.lisp"
+    "taskmaster.lisp"
+    "acceptor.lisp"
+    "easy-handlers.lisp"
+  ];
+}
diff --git a/third_party/lisp/md5.nix b/third_party/lisp/md5.nix
new file mode 100644
index 0000000000..3787e23175
--- /dev/null
+++ b/third_party/lisp/md5.nix
@@ -0,0 +1,18 @@
+# MD5 hash implementation
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "pmai";
+  repo = "md5";
+  rev = "b1412600f60d526ee34a7ba1596ec483da7894ab";
+  sha256 = "0lzip6b6xg7gd70xl1xmqp24fvxqj6ywjnz9lmx7988zpj20nhl2";
+};
+in pkgs.nix.buildLisp.library {
+  name = "md5";
+
+  deps = with pkgs.third_party.lisp; [
+    sb-rotate-byte
+  ];
+
+  srcs = [ (src + "/md5.lisp") ];
+}
diff --git a/third_party/lisp/rfc2388.nix b/third_party/lisp/rfc2388.nix
new file mode 100644
index 0000000000..863bb3f9ac
--- /dev/null
+++ b/third_party/lisp/rfc2388.nix
@@ -0,0 +1,17 @@
+# Implementation of RFC2388 (multipart/form-data)
+{ pkgs, ... }:
+
+let src = pkgs.third_party.fetchFromGitHub {
+  owner = "jdz";
+  repo = "rfc2388";
+  rev = "591bcf7e77f2c222c43953a80f8c297751dc0c4e";
+  sha256 = "0phh5n3clhl9ji8jaxrajidn22d3f0aq87mlbfkkxlnx2pnw694k";
+};
+in pkgs.nix.buildLisp.library {
+  name = "rfc2388";
+
+  srcs = map (f: src + ("/" + f)) [
+    "packages.lisp"
+    "rfc2388.lisp"
+  ];
+}
diff --git a/third_party/lisp/sb-rotate-byte.nix b/third_party/lisp/sb-rotate-byte.nix
new file mode 100644
index 0000000000..38e2397b4d
--- /dev/null
+++ b/third_party/lisp/sb-rotate-byte.nix
@@ -0,0 +1,10 @@
+# SB-ROTATE-BYTE is an SBCL component. This package just forces it to
+# be loaded.
+{ pkgs, ... }:
+
+with pkgs;
+
+nix.buildLisp.library {
+  name = "sb-rotate-byte";
+  srcs = lib.singleton (builtins.toFile "sb-rotate-byte.lisp" "(require 'sb-rotate-byte)");
+}