From patchwork Sat Jan 22 21:28:56 2022
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: Brandon
X-Patchwork-Id: 36753
Return-Path:
X-Original-To: patchwork@mira.cbaines.net
Delivered-To: patchwork@mira.cbaines.net
Received: by mira.cbaines.net (Postfix, from userid 113)
id EE76D27BBEA; Sat, 22 Jan 2022 21:30:47 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net
X-Spam-Level:
X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID,
DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,
URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
by mira.cbaines.net (Postfix) with ESMTPS id 0CE5627BBE9
for ; Sat, 22 Jan 2022 21:30:47 +0000 (GMT)
Received: from localhost ([::1]:59488 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1nBNyA-00030D-4E
for patchwork@mira.cbaines.net; Sat, 22 Jan 2022 16:30:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60784)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1nBNxT-0002zx-3Q
for guix-patches@gnu.org; Sat, 22 Jan 2022 16:30:03 -0500
Received: from debbugs.gnu.org ([209.51.188.43]:45181)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1nBNxS-0001uh-QM
for guix-patches@gnu.org; Sat, 22 Jan 2022 16:30:02 -0500
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1nBNxS-0007LX-Lt
for guix-patches@gnu.org; Sat, 22 Jan 2022 16:30:02 -0500
X-Loop: help-debbugs@gnu.org
Subject: [bug#53456] [PATCH] gnu: Add fnlfmt.
Resent-From: Brandon Lucas
Original-Sender: "Debbugs-submit"
Resent-CC: guix-patches@gnu.org
Resent-Date: Sat, 22 Jan 2022 21:30:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 53456
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 53456@debbugs.gnu.org
Cc: Brandon Lucas
X-Debbugs-Original-To: guix-patches@gnu.org
Received: via spool by submit@debbugs.gnu.org id=B.164288695128151
(code B ref -1); Sat, 22 Jan 2022 21:30:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 21:29:11 +0000
Received: from localhost ([127.0.0.1]:38084 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1nBNwd-0007Jy-76
for submit@debbugs.gnu.org; Sat, 22 Jan 2022 16:29:11 -0500
Received: from lists.gnu.org ([209.51.188.17]:60798)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from
) id 1nBNwb-0007Jr-PM
for submit@debbugs.gnu.org; Sat, 22 Jan 2022 16:29:10 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60710)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from
) id 1nBNwb-0002RX-KZ
for guix-patches@gnu.org; Sat, 22 Jan 2022 16:29:09 -0500
Received: from mail-4317.proton.ch ([185.70.43.17]:14572)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from
) id 1nBNwY-0001ok-Er
for guix-patches@gnu.org; Sat, 22 Jan 2022 16:29:09 -0500
Date: Sat, 22 Jan 2022 21:28:56 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndon.dk;
s=protonmail; t=1642886941;
bh=SXyc/PzCc/xRjq1e6HMKGNsbCvFOwWru0NTefSw5PM8=;
h=Date:To:From:Cc:Reply-To:Subject:Message-ID:From:To:Cc;
b=VQ9izC04W19AVFhv9n/pa8e6bjgCrO3kV4rv8Z/IpoHk/vqkMTj4w6ccJ/FRhq08i
LW/LoMv3DY9PL8z783jlSsxNkJRIhUVAg1Ghmo2/VCuK+HbrM3PJOgDdMryJgnJoU4
G4vl+mAALXGRwVn3gQ6H04DQG2pk3X2DWYawmJF2dqDVZMeUIYQ8Ctupeic8FHfDAn
nphs+Qc3ISE7tGs+WW2PD83h6nS8tGCK0KMKujegU4wQj9rU7Rg/eyr+0NTghbgDmN
mNxSqLu8DxjRN/TXbCl45wEvjnBm3Yg4BzSmi16rQY7GWeSAYQVJ3jkB7fyLCHCfs5
kHFh64VHMeSTQ==
From: Brandon Lucas
Message-ID: <20220122212723.396566-1-br@ndon.dk>
MIME-Version: 1.0
Received-SPF: pass client-ip=185.70.43.17; envelope-from=br@ndon.dk;
helo=mail-4317.proton.ch
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Reply-To: Brandon Lucas
Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org
Sender: "Guix-patches"
X-getmail-retrieved-from-mailbox: Patches
* gnu/packages/lua.scm (fnlfmt): New variable.
---
gnu/packages/lua.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
--
2.34.0
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
;;; Copyright © 2021 Vinícius dos Santos Oliveira
;;; Copyright © 2021 Greg Hogan
+;;; Copyright © 2022 Brandon Lucas
;;;
;;; 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+)))