From patchwork Tue Apr 25 02:06:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 49481 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 9D8AA27BBE9; Tue, 25 Apr 2023 03:08:33 +0100 (BST) 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 13D0E27BBE2 for ; Tue, 25 Apr 2023 03:08:31 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pr86K-0005pi-HS; Mon, 24 Apr 2023 22:08:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pr868-0005ba-6J for guix-patches@gnu.org; Mon, 24 Apr 2023 22:08:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pr867-0003Yp-KC for guix-patches@gnu.org; Mon, 24 Apr 2023 22:08:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pr867-0001RY-0f; Mon, 24 Apr 2023 22:08:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63061] [PATCH 2/3] gnu: Add s7-bootstrap. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: jgart@dismail.de, guix-patches@gnu.org Resent-Date: Tue, 25 Apr 2023 02:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63061 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63061@debbugs.gnu.org Cc: jgart@dismail.de X-Debbugs-Original-Xcc: jgart@dismail.de Received: via spool by 63061-submit@debbugs.gnu.org id=B63061.16823884295475 (code B ref 63061); Tue, 25 Apr 2023 02:08:02 +0000 Received: (at 63061) by debbugs.gnu.org; 25 Apr 2023 02:07:09 +0000 Received: from localhost ([127.0.0.1]:50834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr85F-0001Q9-3v for submit@debbugs.gnu.org; Mon, 24 Apr 2023 22:07:09 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:53528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr85D-0001Pj-1M for 63061@debbugs.gnu.org; Mon, 24 Apr 2023 22:07:08 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Q553R49JKz9spK for <63061@debbugs.gnu.org>; Tue, 25 Apr 2023 04:06:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1682388419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6GyELN5V4YkGJLf51qE0t9L6AwAUimRIhMXhwgwF4hk=; b=T0WwS/FS0t9kNQm1FdqdnpECVLF7rB3WGfi2OGx45MCNuplqGcyks1DLM4L3wY2O9itDI2 pjFPaw15M7z0dmP4ocbGe8qUv0/L0v0tVkEYtdjieJp5nby3g6oqdvx3kPTQeRMxI5nPLt G0axmEK80fj60xm4WcVKYbp2HhJbUSNc7z4159syl5mKGrzwW0+QROfibh//54qZpcwskn H47aQtbZffRcJNMvCQb4NSvPpxY9XN5gQaOsyc1+mdM/nXwZfZBiA66DR9ui1/d35y36AU Y+Dxa6uXOtTuDteP8q4NFUk0ZYVCUI/QQlhtyWgsw6aQe6D0ZgbLp3oO9eIVRg== Date: Tue, 25 Apr 2023 02:06:52 +0000 Message-Id: <20230425020653.10035-2-antero@mailbox.org> In-Reply-To: <20230425020653.10035-1-antero@mailbox.org> References: <20230425020653.10035-1-antero@mailbox.org> MIME-Version: 1.0 X-MBO-RS-META: egz91woaoftegw9nf6ukuiywoyjdgxjo X-MBO-RS-ID: 8b50c65dbfeadc0eb19 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: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches X-Patchwork-Original-From: Antero Mejr via Guix-patches via From: Antero Mejr Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/lisp.scm (s7-bootstrap): New variable. --- gnu/packages/lisp.scm | 96 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 4f1243e8c0..1b05417bc9 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -57,6 +57,7 @@ (define-module (gnu packages lisp) #:use-module (guix build-system haskell) #:use-module (guix build-system trivial) #:use-module (gnu packages admin) + #:use-module (gnu packages algebra) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bdw-gc) @@ -83,6 +84,7 @@ (define-module (gnu packages lisp) #:use-module (gnu packages maths) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) + #:use-module (gnu packages notcurses) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages perl) #:use-module (gnu packages readline) @@ -93,7 +95,8 @@ (define-module (gnu packages lisp) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (gnu packages xorg) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1)) (define-public cl-asdf (package @@ -1477,3 +1480,94 @@ (define-public eisl license:expat ;; cii/LICENSE license:gpl2+ ;; nana/gdb/test.c and others under nana/ license:bsd-3)))) ;; bench/* + +(define-public s7-bootstrap + ;; Need s7-bootstrap to build libc_s7.so (for the REPL) and run tests + (let ((commit "a5b4bb49f8bcd7c33ae2366065fc8c254b734460") ;no releases + (revision "0")) + (hidden-package + (package + (name "s7-bootstrap") + (version (git-version "23.3" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://cm-gitlab.stanford.edu/bil/s7.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "03n1axdlypzmbgzrhlwfqwa1xiw36hi25j2hwc7vw77mz90cd9f8")))) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;no tests in bootstrap + #:phases #~(modify-phases %standard-phases + (delete 'configure) ;no configure + (replace 'build + (lambda _ + ;; using build commands from s7 home page + (invoke #$(cc-for-target) "s7.c" "-o" "repl" + "-I." "-O2" "-g" + "-DWITH_MAIN" + (string-append + "-DS7_LOAD_PATH=\"" + #$output "/share/s7/scm\"") + "-ldl" "-lm" + "-Wl,-export-dynamic") + (invoke #$(cc-for-target) "s7.c" "-o" "nrepl" + "-I." "-O2" "-g" + "-DWITH_MAIN" "-DWITH_NOTCURSES" + (string-append + "-DS7_LOAD_PATH=\"" + #$output "/share/s7/scm\"") + "-ldl" "-lm" "-lnotcurses-core" + "-Wl,-export-dynamic") + (invoke #$(cc-for-target) "libarb_s7.c" + "-I." "-O2" "-g" + "-shared" "-o" "libarb_s7.so" + "-larb" "-lflint" "-lmpc" "-fPIC") + (invoke #$(cc-for-target) "notcurses_s7.c" + "-I." "-O2" "-g" + "-shared" "-o" "libnotcurses_s7.so" + "-lnotcurses-core" "-fPIC") + ;; Need s7.o and ffitest for tests + (invoke #$(cc-for-target) "-c" "s7.c" "-o" + "s7.o" "-I." "-O2" "-ldl" "-lm") + (invoke #$(cc-for-target) "-o" "ffitest" + "ffitest.c" "-g2" "s7.o" "-lm" "-I." + "-ldl" "-Wl,-export-dynamic"))) + (add-before 'check 'install-scm + ;; scm files need to be installed before testing + (lambda _ + (for-each (lambda (x) + (install-file + x (string-append + #$output "/share/s7/scm/"))) + (find-files "." "\\.scm")))) + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin")) + (share (string-append #$output + "/share/s7/")) + (doc (string-append #$output + "/share/doc/s7/")) + (lib (string-append #$output "/lib")) + (inc (string-append #$output "/include/"))) + (install-file "repl" bin) + (install-file "nrepl" bin) + (install-file "ffitest" bin) + (install-file "libarb_s7.so" lib) + (install-file "libnotcurses_s7.so" lib) + (install-file "s7.c" share) + (install-file "s7.h" inc) + (install-file "s7.html" doc))))))) + (inputs (list arb flint mpc notcurses)) + (home-page "https://ccrma.stanford.edu/software/snd/snd/s7.html") + (synopsis "Scheme interpreter intended as an extension language") + (description + "s7 is a Scheme interpreter intended as an extension language for +other applications. It exists as just two files, @code{s7.c} and @code{s7.h}, +that may be copied into the source tree of another application. There are no +libraries, no run-time init files, and no configuration scripts. It can also +be built as a stand-alone REPL interpreter.") + (license license:bsd-0)))))