From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH 1/2] gnu: Add femtolisp. Date: Tue, 13 Sep 2016 21:30:07 +0200 Message-ID: <87mvjbegxs.fsf@elephly.net> References: <20160913190416.1462-1-ng0@we.make.ritual.n0.is> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjtPU-00083V-Aa for guix-devel@gnu.org; Tue, 13 Sep 2016 15:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjtPM-0000sb-5T for guix-devel@gnu.org; Tue, 13 Sep 2016 15:30:21 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:21323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjtPL-0000sH-Td for guix-devel@gnu.org; Tue, 13 Sep 2016 15:30:16 -0400 In-reply-to: <20160913190416.1462-1-ng0@we.make.ritual.n0.is> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: ng0 Cc: guix-devel@gnu.org ng0 writes: > * gnu/packages/lisp.scm (femtolisp): New variable. > --- > gnu/packages/lisp.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > > diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm > index 8ee249d..4e2ecdb 100644 > --- a/gnu/packages/lisp.scm > +++ b/gnu/packages/lisp.scm > @@ -487,3 +487,56 @@ in the early 80's. It was converted to C by Blake McBride and supports much of > the InterLisp Standard.") > (home-page "https://github.com/blakemcbride/LISPF4.git") > (license license:expat)))) > + > +(define-public femtolisp > + (let* ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b") > + (revision "1")) > + (package > + (name "femtolisp") > + (version (string-append "0.0.0-" revision "-" (string-take commit 7))) > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/JeffBezanson/femtolisp.git") > + (commit commit))) > + (file-name (string-append name "-" version "-checkout")) > + (sha256 > + (base32 > + "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja")))) > + (build-system gnu-build-system) > + (arguments > + `(#:make-flags '("CC=gcc") > + #:tests? #f ; No make check But it does have a “test” target, no? How about “#:test-target "test"” instead of disabling the tests? > + #:phases > + (modify-phases %standard-phases > + (delete 'configure) ; No configure script > + ;; We have to remove the 'test phase because it requires > + ;; the flisp binary to be present. Instead we run > + ;; bootstrap.sh after the 'install phase. I find this strange. More about this below. > + (add-before 'build 'patch-makefile > + (lambda _ > + (substitute* "Makefile" > + (("default: release test") "default: release")) > + #t)) This may not be necessary when you pass “release” as one of the “#:make-flags”. > + (replace 'install ; Makefile has no 'install phase > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (bin (string-append out "/bin"))) > + (install-file "flisp" bin) > + #t))) > + ;; The flisp binary is now available, run bootstrap to > + ;; generate flisp.boot and afterwards runs make test. > + (add-after 'install 'bootstrap-gen-and-test > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (bin (string-append out "/bin"))) > + (and > + (zero? (system* "./bootstrap.sh")) > + (install-file "flisp.boot" bin)))))))) “install-file” has an unspecified return value. I’m a little surprised to see “bootstrap.sh” to be used *after* installation. That’s very odd. Could the tests not be fixed in another way, e.g. by overriding the location of the binary? > + (synopsis "Scheme-like lisp implementation") > + (description > + "@code{femtolisp} is a scheme-like lisp implementation with a > +simple, elegant Scheme dialect. It is a lisp-1 with lexical scope. > +The core is 12 builtin special forms and 33 builtin functions.") “Scheme-like”. I think the sentence on “lisp-1” can be removed, because if it’s Scheme-like it’s unlikely to be a lisp-2. > + (home-page "https://github.com/JeffBezanson/femtolisp") > + (license license:bsd-3)))) ~~ Ricardo