[PATCH] gnu: lisp: Add lfe.

  • Done
  • quality assurance status badge
Details
2 participants
  • jgart
  • Maxim Cournoyer
Owner
unassigned
Submitted by
jgart
Severity
normal
J
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20221228015219.16759-1-jgart@dismail.de
* gnu/packages/lisp.scm (lfe): New variable.
---
gnu/packages/lisp.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 753952152e..5919a6017e 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -66,6 +66,7 @@ (define-module (gnu packages lisp)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
#:use-module (gnu packages ed)
+ #:use-module (gnu packages erlang)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
@@ -1228,6 +1229,40 @@ (define-public picolisp
(inherit picolisp32)
(name "picolisp")))))
+(define-public lfe
+ (package
+ (name "lfe")
+ (version "2.0.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/lfe/lfe")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0a5cfnk3021idvv4bv2lvnksjy9d0yyd13bnj793ks86j5f3hdv5"))))
+ (build-system gnu-build-system)
+ (propagated-inputs (list erlang))
+ (arguments
+ (list #:tests? #f
+ #:make-flags
+ #~(list (string-append "PREFIX=" #$output))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ ;; https://github.com/lfe/lfe/pull/449
+ (add-after 'unpack 'patch-gcc
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "Makefile"
+ (("cc") #$(cc-for-target))))))))
+ (synopsis "Lisp Flavoured Erlang")
+ (description "LFE, Lisp Flavoured Erlang, is a lisp syntax front-end
+to the Erlang compiler. Code produced with LFE is compatible with normal
+Erlang code. An @code{lfe} evaluator and shell is also included.")
+ (home-page "https://lfe.io/")
+ (license license:asl2.0)))
+
(define-public janet
(package
(name "janet")
--
2.38.1
J
[PATCH v2] gnu: lisp: Add lfe.
(address . 60372@debbugs.gnu.org)(name . jgart)(address . jgart@dismail.de)
20221228040545.30885-1-jgart@dismail.de
* gnu/packages/lisp.scm (lfe): New variable.

Here's a v2 but this a WIP as the tests are disabled. Unless we can
merge this and enable the tests later after we figure out whether we
want to do that with rebar-build-system or via a custom phase?

I have an issue open here asking about running the tests:


I tried running the tests by manually calling rebar but I get a homeless-shelter write error.

For test commands that I tried see the following section in the lfe project's CI:


If anyone would like to collaborate on this patch feel free to make
changes and just list me as co-author with you.

all best,

jgart
---
gnu/packages/lisp.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 753952152e..67105a5c93 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -66,6 +66,7 @@ (define-module (gnu packages lisp)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
#:use-module (gnu packages ed)
+ #:use-module (gnu packages erlang)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
@@ -1228,6 +1229,40 @@ (define-public picolisp
(inherit picolisp32)
(name "picolisp")))))
+(define-public lfe
+ (package
+ (name "lfe")
+ (version "2.0.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/lfe/lfe")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0a5cfnk3021idvv4bv2lvnksjy9d0yyd13bnj793ks86j5f3hdv5"))))
+ (build-system gnu-build-system)
+ (inputs (list erlang))
+ (arguments
+ (list #:tests? #f
+ #:make-flags
+ #~(list (string-append "PREFIX=" #$output))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ ;; https://github.com/lfe/lfe/pull/449
+ (add-after 'unpack 'patch-gcc
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "Makefile"
+ (("cc") #$(cc-for-target))))))))
+ (synopsis "Lisp Flavoured Erlang")
+ (description "LFE, Lisp Flavoured Erlang, is a lisp syntax front-end
+to the Erlang compiler. Code produced with LFE is compatible with normal
+Erlang code. An @code{lfe} evaluator and shell is also included.")
+ (home-page "https://lfe.io/")
+ (license license:asl2.0)))
+
(define-public janet
(package
(name "janet")
--
2.38.1
M
M
Maxim Cournoyer wrote on 21 Mar 2023 15:25
Re: bug#60372: [PATCH] gnu: lisp: Add lfe.
(name . jgart)(address . jgart@dismail.de)(address . 60372@debbugs.gnu.org)
87y1nqp4eo.fsf_-_@gmail.com
Hi,

jgart <jgart@dismail.de> writes:

Toggle quote (2 lines)
> * gnu/packages/lisp.scm (lfe): New variable.

I think that should go in (gnu packages erlang). Also, the convention
is to use just 'gnu: ' as prefix, not 'gnu: module:'.

Toggle quote (10 lines)
> Here's a v2 but this a WIP as the tests are disabled. Unless we can
> merge this and enable the tests later after we figure out whether we
> want to do that with rebar-build-system or via a custom phase?
>
> I have an issue open here asking about running the tests:
>
> https://github.com/lfe/lfe/issues/450
>
> I tried running the tests by manually calling rebar but I get a homeless-shelter write error.

You could try setting HOME to /tmp. Search for existing set-HOME
phases in the code base.

Toggle quote (58 lines)
> For test commands that I tried see the following section in the lfe project's CI:
>
> https://github.com/lfe/lfe/blob/develop/.github/workflows/cicd.yml#L36
>
> If anyone would like to collaborate on this patch feel free to make
> changes and just list me as co-author with you.
>
> all best,
>
> jgart
> ---
> gnu/packages/lisp.scm | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> index 753952152e..67105a5c93 100644
> --- a/gnu/packages/lisp.scm
> +++ b/gnu/packages/lisp.scm
> @@ -66,6 +66,7 @@ (define-module (gnu packages lisp)
> #:use-module (gnu packages compression)
> #:use-module (gnu packages dbm)
> #:use-module (gnu packages ed)
> + #:use-module (gnu packages erlang)
> #:use-module (gnu packages fontutils)
> #:use-module (gnu packages gcc)
> #:use-module (gnu packages gettext)
> @@ -1228,6 +1229,40 @@ (define-public picolisp
> (inherit picolisp32)
> (name "picolisp")))))
>
> +(define-public lfe
> + (package
> + (name "lfe")
> + (version "2.0.1")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/lfe/lfe")
> + (commit version)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "0a5cfnk3021idvv4bv2lvnksjy9d0yyd13bnj793ks86j5f3hdv5"))))
> + (build-system gnu-build-system)
> + (inputs (list erlang))
> + (arguments
> + (list #:tests? #f
> + #:make-flags
> + #~(list (string-append "PREFIX=" #$output))
> + #:phases
> + #~(modify-phases %standard-phases
> + (delete 'configure)
> + ;; https://github.com/lfe/lfe/pull/449
> + (add-after 'unpack 'patch-gcc
> + (lambda* (#:key inputs #:allow-other-keys)
> + (substitute* "Makefile"
> + (("cc") #$(cc-for-target))))))))

You can set 'cc' as a Make flag; that'd be more elegant.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 21 Mar 2023 15:26
control message for bug #60372
(address . control@debbugs.gnu.org)
87wn3ap4e7.fsf@gmail.com
tags 60372 + moreinfo
quit
J
Re: bug#60372: [PATCH] gnu: lisp: Add lfe.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 60372@debbugs.gnu.org)
f013ad62925a4e9535fca12264c1b40b@dismail.de
Hi Maxim,

Thanks for the review.

I think this will need to be written in terms of the rebar-build-system:


Otherwise, it might be painful to run the tests. Even upstream is unsure of how to run the tests if building with a Makefile.

Just leaving this additional note here for when I get back to this.

all best,

jgart
J
J
jgart wrote 4 days ago
(address . 60372-done@debbugs.gnu.org)
a6a955297ed0ce88087c8ab945a2c91d9f70156f@dismail.de
This is already resolved
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 60372@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 60372
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch