From 4af927f7e9b0b4759a175aeb89e2e992683b3ffb Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 14 Jun 2023 07:10:00 -0500 Subject: [PATCH] last bits to making compilation work --- Makefile | 2 +- README.org | 30 ++++++++++++++++++++++++++++++ build.lisp | 6 +++++- default.nix | 8 ++++++-- src/main.lisp | 11 ++++++++--- 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index bf99f72..8bc2a2c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: build-server build-server: - sbcl --eval '(asdf:load-asd "/home/chris/dev/tfcconnection/tfcserver.asd")' --eval '(ql:quickload :tfcserver)' --eval '(push :deploy-console *features*)' --eval "(asdf:make :tfcserver)" --eval '(quit)' + sbcl --load build.lisp serve: hugo server --noHTTPCache diff --git a/README.org b/README.org index e4f1e69..d8daac1 100644 --- a/README.org +++ b/README.org @@ -5,3 +5,33 @@ In an attempt at building a better/faster website than is possible with the curr To edit the campmap use this link http://umap.openstreetmap.fr/en/map/anonymous-edit/888075:134YBQNTmQ2pkJ76ur0PJ8KPuAc + +* Website +The website is built with Hugo. This gives us the ability of creating a very fast site with a lot of flexibility if you know what you're doing. + +* Server +The website has a few parts that need processing like forms, these are plugged into a server component that has a RESTFUL API like system and helps us to process info on the site much faster. + +The server is written in lisp. + +** Build +To build the server run make + +#+begin_src shell :results silent +make +#+end_src + +This drops the server binary in the =bin= folder with the libraries bundled next to it. + +** Nix +Because we use NixOS for our servers, we also have everything setup using Nix Flakes. To enter a development shell + +#+begin_src nix :results silent +nix develop +#+end_src + +To build it. + +#+begin_src nix :results silent +nix build +#+end_src diff --git a/build.lisp b/build.lisp index fa98957..1d09cfc 100644 --- a/build.lisp +++ b/build.lisp @@ -1,4 +1,8 @@ +(when (find-package :ql) (funcall (read-from-string "ql:quickload") :deploy)) (load (sb-ext:posix-getenv "ASDF")) (asdf:load-asd (pathname (truename "tfcserver.asd"))) -;; (ql:quickload :tfcserver) +(asdf:load-system "tfcserver") +(when (find-package :ql) (funcall (read-from-string "ql:quickload") :tfcserver)) +;; (push :deploy-console *features*) (asdf:make :tfcserver) +(quit) diff --git a/default.nix b/default.nix index bed777c..f00c36c 100644 --- a/default.nix +++ b/default.nix @@ -17,6 +17,7 @@ let clack jzon serapeum + deploy openssl openssl.out openssl.dev @@ -45,13 +46,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' - + mkdir -p $out/bin + cp tfcapi $out/bin + # wrapProgram $out/bin/tfcapi \ + # --prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH \ ''; meta = with lib; { name = "tfcconnection"; description = "TFC Connection Website"; - homepage = ""; + homepage = "https://tfcconnection.org"; license = licenses.gpl3; maintainers = [ "chriscochrun" ]; platforms = platforms.all; diff --git a/src/main.lisp b/src/main.lisp index 50e5606..bfb21a2 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -1,6 +1,11 @@ ;; (ql:quickload '(hunchentoot clack dexador com.inuoe.jzon serapeum bordeaux-threads)) -(asdf:load-systems '(hunchentoot clack dexador com.inuoe.jzon serapeum bordeaux-threads)) -;; (require '(hunchentoot clack dexador com.inuoe.jzon serapeum bordeaux-threads)) +;; (asdf:load-systems '(hunchentoot clack dexador com.inuoe.jzon serapeum bordeaux-threads)) +(require "hunchentoot") +(require "clack") +(require "dexador") +(require "com.inuoe.jzon") +(require "serapeum") +(require "bordeaux-threads") (defpackage tfc-server (:use :cl :uiop :com.inuoe.jzon :clack)) @@ -116,7 +121,7 @@ (if (listp content) (setq content (serapeum:mapconcat (lambda (x) (if (string= x "") - (coerce #\linefeed 'string) + (coerce #\Newline 'string) x)) content "")))) (if name (if (string/= name "image") (progn