all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#53456] [PATCH] gnu: Add fnlfmt.
@ 2022-01-22 21:28 Brandon Lucas
  2022-01-22 21:33 ` Maxime Devos
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Brandon Lucas @ 2022-01-22 21:28 UTC (permalink / raw)
  To: 53456; +Cc: Brandon Lucas

* gnu/packages/lua.scm (fnlfmt): New variable.
---
 gnu/packages/lua.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 99f09a26f1..50f97c3912 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020 Paul A. Patience <paul@apatience.com>
 ;;; Copyright © 2021 Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2022 Brandon Lucas <br@ndon.dk>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1208,3 +1209,48 @@ (define-public fennel
 simplicity, and reach of Lua with the flexibility of a Lisp syntax and macro
 system.")
     (license license:expat)))
+
+(define-public fnlfmt
+  (package
+    (name "fnlfmt")
+    (version "0.2.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://git.sr.ht/~technomancy/fnlfmt")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1rv0amqhy5ypi3pvxfaadn3k1cy4mjlc49wdzl2psz3i11w9gr36"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'build 'patch-makefile
+           ;; Use input fennel instead of bundled fennel.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "Makefile"
+               (("./fennel") (search-input-file inputs "/bin/fennel")))))
+         (add-after 'build 'patch-fnlfmt
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "fnlfmt"
+               (("/usr/bin/env .*lua") (search-input-file inputs "/bin/lua")))))
+         (replace 'install
+           ;; There is no install target; manually install the output file.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")) (bin (string-append out
+                                                          "/bin")))
+               (for-each (lambda (file)
+                           (install-file file bin))
+                         (find-files "." "fnlfmt"))))))))
+    (inputs (list fennel))
+    (propagated-inputs (list lua))
+    (home-page "https://git.sr.ht/~technomancy/fnlfmt")
+    (synopsis "Automatic formatting of Fennel code")
+    (description
+     "Fnlfmt is a tool for automatically formatting Fennel code in a consistent
+way, following established lisp conventions.")
+    (license license:lgpl3+)))
--
2.34.0






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

end of thread, other threads:[~2022-01-26 15:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 21:28 [bug#53456] [PATCH] gnu: Add fnlfmt Brandon Lucas
2022-01-22 21:33 ` Maxime Devos
2022-01-22 21:39 ` Maxime Devos
2022-01-22 21:41 ` Maxime Devos
2022-01-22 21:43 ` Maxime Devos
2022-01-22 21:46 ` Maxime Devos
2022-01-22 21:53 ` Maxime Devos
2022-01-23 20:50   ` Brandon
2022-01-23  0:16 ` [bug#53456] [PATCH v2 1/2] " Brandon Lucas
2022-01-23  0:19   ` [bug#53456] [PATCH v2 2/2] gnu: fennel: Update to 03c1c95 Brandon Lucas
2022-01-23 11:05   ` [bug#53456] [PATCH v2 1/2] gnu: Add fnlfmt Maxime Devos
2022-01-23 11:11   ` Maxime Devos
2022-01-23 12:14 ` [bug#53456] [PATCH v3 " Brandon Lucas
2022-01-23 12:14   ` [bug#53456] [PATCH v3 2/2] gnu: fennel: Update to 03c1c95 Brandon Lucas
2022-01-26 15:52   ` bug#53456: [PATCH] gnu: Add fnlfmt Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.