feat(third_party/lisp): Check in drakma HTTP client & deps

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.
This commit is contained in:
Vincent Ambo 2020-01-21 02:06:11 +00:00
parent e50c669310
commit 6de462f674
8 changed files with 188 additions and 0 deletions

31
third_party/lisp/chipz.nix vendored Normal file
View file

@ -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"
];
}

27
third_party/lisp/chunga.nix vendored Normal file
View file

@ -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"
];
}

17
third_party/lisp/cl-base64.nix vendored Normal file
View file

@ -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")
];
}

35
third_party/lisp/drakma.nix vendored Normal file
View file

@ -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"
];
}

15
third_party/lisp/puri.nix vendored Normal file
View file

@ -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")
];
}

10
third_party/lisp/sb-bsd-sockets.nix vendored Normal file
View file

@ -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)");
}

18
third_party/lisp/split-sequence.nix vendored Normal file
View file

@ -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"
];
}

35
third_party/lisp/usocket.nix vendored Normal file
View file

@ -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"
]);
}