GNU bug report logs - #72621
[PATCH] gnu: Add clasp.

Previous Next

Package: guix-patches;

Reported by: ashish.is <at> lostca.se

Date: Wed, 14 Aug 2024 12:51:01 UTC

Severity: normal

Tags: patch

Done: Guillaume Le Vaillant <glv <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72621 in the body.
You can then email your comments to 72621 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#72621; Package guix-patches. (Wed, 14 Aug 2024 12:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to ashish.is <at> lostca.se:
New bug report received and forwarded. Copy sent to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org. (Wed, 14 Aug 2024 12:51:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ashish.is <at> lostca.se
To: guix-patches <at> gnu.org
Cc: Ashish SHUKLA <ashish.is <at> lostca.se>
Subject: [PATCH] gnu: Add clasp.
Date: Wed, 14 Aug 2024 12:46:18 +0000
From: Ashish SHUKLA <ashish.is <at> lostca.se>

* gnu/packages/lisp.scm (clasp-cl): New variable.

Change-Id: I1d1dbc358c0e05577d3d535600c2f9863ad29fad
---
Hi,

This patch adds Clasp Common Lisp implementation[0] to Guix. Most of
it is inspired/based off the work in nixpkgs[1].

References:
[0] https://clasp-developers.github.io/
[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/clasp/default.nix

Thanks!

 gnu/packages/lisp.scm | 72 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 97f7dd357b..b41a66e4a9 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -28,6 +28,7 @@
 ;;; Copyright © 2023 Andrew Kravchuk <awkravchuk <at> gmail.com>
 ;;; Copyright © 2024 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug <at> proton.me>
+;;; Copyright © 2024 Ashish SHUKLA <ashish.is <at> lostca.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -367,6 +368,77 @@ (define-public ccl
 interface.")
     (license license:asl2.0)))
 
+(define-public clasp-cl
+  (package
+    (name "clasp")
+    (version "2.6.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/clasp-developers/clasp/releases/download/"
+                                  version "/clasp-" version ".tar.gz"))
+              (sha256 (base32 "10jjhcid6qp64gx29iyy5rqqijwy8hrvx66f0xabdj8w3007ky39"))))
+    (build-system gnu-build-system)
+    (inputs (list boost fmt gmp libelf libunwind clang-15 llvm-15
+                  `(,gcc "lib")))
+    (native-inputs (list sbcl ninja pkg-config binutils-gold))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'unpack 'patch-koga
+           (lambda* _
+             (call-with-port (open-file "src/koga/units.lisp" "a")
+               (lambda (p)
+                 (display "(defmethod configure-unit (c (u (eql :git))))\n" p)))))
+         (add-before 'configure 'set-configure-environment
+           (lambda* _
+             (setenv "SOURCE_DATE_EPOCH" "1")
+             (setenv "ASDF_OUTPUT_TRANSLATIONS"
+                     (string-append (getenv "PWD")
+                                    ":"
+                                    (getenv "PWD")
+                                    "/__fasls"))))
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (clang (assoc-ref inputs "clang"))
+                   (ld-flags
+                    (string-join
+                     (apply append
+                            (map (lambda (f)
+                                   (list "-L" f "-rpath" f))
+                                 (string-split (getenv "LIBRARY_PATH") #\:)))
+                     ",")))
+               (invoke "sbcl"
+                       "--script"
+                       "./koga"
+                       "--skip-sync"
+                       "--build-mode=bytecode-faso"
+                       (string-append "--cc=" clang "/bin/clang")
+                       (string-append "--cxx=" clang "/bin/clang++")
+                       (string-append "--ldflags=-Wl," ld-flags)
+                       "--reproducible-build"
+                       "--package-path=/"
+                       (string-append "--bin-path=" out "/bin")
+                       (string-append "--lib-path=" out "/lib")
+                       (string-append "--share-path=" out "/share")))))
+         (replace 'build
+           (lambda* _
+             (invoke "ninja" "-C" "build")))
+         (replace 'install
+           (lambda* _
+             (invoke "ninja" "-C" "build" "install"))))))
+    (home-page "https://clasp-developers.github.io/")
+    (synopsis "Common Lisp implementation based on LLVM and C++.")
+    (description "Clasp is a new Common Lisp implementation that seamlessly
+ interoperates with C++ libraries and programs using LLVM for compilation to
+ native code. This allows Clasp to take advantage of a vast array of
+ preexisting libraries and programs, such as out of the scientific computing
+ ecosystem. Embedding them in a Common Lisp environment allows you to make use
+ of rapid prototyping, incremental development, and other capabilities that
+ make it a powerful language.")
+    (license license:lgpl2.1)))
+
 (define-public cl-asdf
   (package
     (name "cl-asdf")

base-commit: ca5ff8aa8b50ac317003d76cc4ea2a621d5a3819
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#72621; Package guix-patches. (Thu, 15 Aug 2024 12:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 72621 <at> debbugs.gnu.org (full text, mbox):

From: Aleksej <lesikedelweiss <at> disroot.org>
To: 72621 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add clasp.
Date: Thu, 15 Aug 2024 14:12:58 +0300
Hi! I've applied your patch, and it seems to have some problems.

1) We already have the package with name "clasp", consider renaming it 
to something like "clasp-cl".

2) The license of clasp should be "lgpl2.1+", not "lgpl2.1".

3) After renaming run "guix lint" on the package, it has quite a lot of 
warnings.

4) I see you use gnu-build-system, and modify it a lot to use ninja. We 
have meson-build-system in GNU Guix, shouldn't it be used instead?

Also I've looked at clasp git repo, they have package definition for GNU 
Guix, maybe you should check it out!

-- 
Best regards,
Lesik Edelweiss





Reply sent to Guillaume Le Vaillant <glv <at> posteo.net>:
You have taken responsibility. (Thu, 15 Aug 2024 12:30:02 GMT) Full text and rfc822 format available.

Notification sent to ashish.is <at> lostca.se:
bug acknowledged by developer. (Thu, 15 Aug 2024 12:30:02 GMT) Full text and rfc822 format available.

Message #13 received at 72621-done <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: ashish.is <at> lostca.se
Cc: 72621-done <at> debbugs.gnu.org
Subject: Re: [bug#72621] [PATCH] gnu: Add clasp.
Date: Thu, 15 Aug 2024 12:29:02 +0000
[Message part 1 (text/plain, inline)]
Patch applied as 1e2aca13eedc71b869e43525549080ba153e2887 with some
minor modifications. And I renamed the package to "clasp-cl", as there
is already a different "clasp" package in "potassco.scm".
Thanks.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Sep 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.