unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50062] Add cl-yxorp-cli
@ 2021-08-15  5:19 Charles via Guix-patches via
  2021-08-16  8:06 ` bug#50062: " Guillaume Le Vaillant
  0 siblings, 1 reply; 2+ messages in thread
From: Charles via Guix-patches via @ 2021-08-15  5:19 UTC (permalink / raw)
  To: 50062


[-- Attachment #1.1: Type: text/plain, Size: 61 bytes --]

let me know if something is wrong or could be better: thanks.

[-- Attachment #1.2: Type: text/html, Size: 72 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-cl-yxorp-cli.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-cl-yxorp-cli.patch, Size: 4346 bytes --]

From f7273b53facac11165e91af80a182837a85c064a Mon Sep 17 00:00:00 2001
From: Charles <charles.b.jackson@protonmail.com>
Date: Sat, 14 Aug 2021 23:54:03 -0500
Subject: [PATCH] gnu: Add cl-yxorp-cli.

* gnu/packages/lisp-xyz.scm (sbcl-yxorp, ecl-yxorp, cl-yxorp): New variables.
* gnu/packages/web.scm (cl-yxorp-cli): New variable.
---
 gnu/packages/lisp-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++++
 gnu/packages/web.scm      | 34 ++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 38cc7d6695..e88f920ec2 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -18243,6 +18243,47 @@ functions allow Lisp programs to explore the web.")
 (define-public cl-aserve
   (sbcl-package->cl-source-package sbcl-aserve))
 
+(define-public sbcl-yxorp
+  (let ((commit "d2e8f9304549e47ae5c7fa35a6b114804603eac9")
+        (revision "1"))
+    (package
+      (name "sbcl-yxorp")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/charJe/cl-yxorp")
+               (commit commit)))
+         (file-name (git-file-name "cl-yxorp" version))
+         (sha256
+          (base32 "1zz1j678vzwkf817h2z0pf0fcyf4mldv4hiv1wyam58hd4bcrjsw"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("cl+ssl" ,sbcl-cl+ssl)
+         ("cl-binding-arrows" ,sbcl-binding-arrows)
+         ("cl-str" ,sbcl-cl-str)
+         ("cl-usocket" ,sbcl-usocket)
+         ("flexi-streams" ,sbcl-flexi-streams)
+         ("trivial-garbage" ,sbcl-trivial-garbage)))
+      (home-page "https://github.com/charje/cl-yxorp")
+      (synopsis
+       "A reverse proxy server written in and configurable in Common Lisp.")
+      (description "It supports WebSocket, HTTP, HTTPS, HTTP to HTTPS
+redirecting, port and host forwarding configuration using a real programming
+language, HTTP header and body manipulation (also using a real programming
+language).")
+      (license license:agpl3))))
+
+(define-public ecl-yxorp
+  ;; Note that due to a bug in ECL this package does not build.
+  ;; The bug has already been fixed on the development branch,
+  ;; so this package will work work in the version after 21.2.1.
+  (sbcl-package->ecl-package sbcl-yxorp))x
+
+(define-public cl-yxorp
+  (sbcl-package->cl-source-package sbcl-yxorp))
+
 (define-public sbcl-rss
   ;; No release.
   (let ((commit "51d0145e91b86327ae5c36364f9c3048052e7a58"))
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index ff53333169..d499fa0299 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -141,6 +141,7 @@
   #:use-module (gnu packages libunistring)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lisp)
   #:use-module (gnu packages lisp-xyz)
   #:use-module (gnu packages lsof)
   #:use-module (gnu packages lua)
@@ -893,6 +894,39 @@ memory footprint compared to other webservers.  Its features include FastCGI,
 CGI, authentication, output compression, URL rewriting and many more.")
     (license license:bsd-3)))
 
+(define-public cl-yxorp-cli
+  (package
+    (inherit sbcl-yxorp)
+    (name "cl-yxorp-cli")
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f
+       #:strip-binaries? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'set-home
+           (lambda _
+             (setenv "HOME" "/tmp")
+             #t))
+         (replace 'build
+           (lambda _
+             (invoke
+              "sbcl" "--noinform"
+              "--disable-debugger"
+              "--no-userinit"
+              "--eval" "(require :asdf)"
+              "--eval" "(pushnew (uiop:getcwd) asdf:*central-registry*)"
+              "--load" "build.lisp")
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+               (mkdir-p bin)
+               (install-file"cl-yxorp" bin))
+             #t)))))
+    (inputs (cons (list "sbcl" sbcl) (package-inputs sbcl-yxorp)))))
+
 (define-public fcgi
   (package
     (name "fcgi")
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#50062: Add cl-yxorp-cli
  2021-08-15  5:19 [bug#50062] Add cl-yxorp-cli Charles via Guix-patches via
@ 2021-08-16  8:06 ` Guillaume Le Vaillant
  0 siblings, 0 replies; 2+ messages in thread
From: Guillaume Le Vaillant @ 2021-08-16  8:06 UTC (permalink / raw)
  To: Charles; +Cc: 50062-done

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Patches push as 6fcaf8533792a64bc00292326f960561de591200 and following
with some modifications:
 - removed article and period in synopsis
 - added a full sentence at the beginning of the description
 - moved cl-yxorp-cli from "web.scm" to "lisp-xyz.scm" because I got
   an undefined variable error for 'sbcl-yxorp' (I think this is because
   the mutual dependency between "web.scm" and "lisp-xyz.scm" prevents
   using '(inherit sbcl-yxorp)' in this case).
 - replaced '--disable-debugger' by '--non-interactive' in the command
   line for SBCL to be sure that we can't get stuck in SBCL

To find some of the "styling mistakes", you can use:
  ./pre-inst-env guix lint sbcl-yxorp

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-16  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15  5:19 [bug#50062] Add cl-yxorp-cli Charles via Guix-patches via
2021-08-16  8:06 ` bug#50062: " Guillaume Le Vaillant

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).