diff mbox series

[bug#47851,PACKAGE] Add cl-svg, inferior-shell, fare-mop, cl-png

Message ID CAO+9K5qzK5QYDpj_u=xqTK+uL0NxSdDVcyvdW9+wXJ8u7hGkXg@mail.gmail.com
State Accepted
Headers show
Series [bug#47851,PACKAGE] Add cl-svg, inferior-shell, fare-mop, cl-png | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Sharlatan Hellseher April 17, 2021, 9:08 p.m. UTC
Hi Guix team!

Preparation list of patches for art generation system Weir
I've packed it but it's failed on ECL build with

;;; Warning: ;;; in file various.lisp, position 144 ;;; at
(DEFCONSTANT PII ...) ;;; ! The expression 6.283185307179586477l0 is
not of the expected type DOUBLE-FLOAT ;;; Warning: ;;; in file
various.lisp, position 195 ;;; at (DEFCONSTANT PI5 ...) ;;; ! The
expression 1.5707963267948966193l0 is not of the expected type
DOUBLE-FLOAT

Maintainer has not option for opening an issue.

For someone who has more knowledge in CL to check
https://github.com/Hellseher/guix-channel/blob/main/ffab/packages/lisp-xyz.scm#L1467

-- 
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.

Comments

Guillaume Le Vaillant April 19, 2021, 3:54 p.m. UTC | #1
Patches pushed as 1cef75faaebec55d0c5f1c03aed8deebff1dbad4 and
following with a few fixes. Thanks

Sharlatan Hellseher <sharlatanus@gmail.com> skribis:

> Hi Guix team!
>
> Preparation list of patches for art generation system Weir
> I've packed it but it's failed on ECL build with
>
> ;;; Warning: ;;; in file various.lisp, position 144 ;;; at
> (DEFCONSTANT PII ...) ;;; ! The expression 6.283185307179586477l0 is
> not of the expected type DOUBLE-FLOAT ;;; Warning: ;;; in file
> various.lisp, position 195 ;;; at (DEFCONSTANT PI5 ...) ;;; ! The
> expression 1.5707963267948966193l0 is not of the expected type
> DOUBLE-FLOAT
>
> Maintainer has not option for opening an issue.
>
> For someone who has more knowledge in CL to check
> https://github.com/Hellseher/guix-channel/blob/main/ffab/packages/lisp-xyz.scm#L1467

I think it's a bug in the "various.lisp" file. Inside it there is:

--8<---------------cut here---------------start------------->8---
(declaim (type double-float PII PI5))

(defconstant PII (the double-float #.(* PI 2d0)))
(defconstant PI5 (the double-float #.(* PI 0.5d0)))
--8<---------------cut here---------------end--------------->8---

However the Common Lisp spec indicates that 'pi' is a 'long-float'. It
works with SBCL because it implements 'double-float' and 'long-float' as
the same type (which is allowed according to the spec). However in ECL
the types are different ('long-float' has more precision than
'double-float').

Converting 'pi' to a 'double-float' should make the code work in both
SBCL and ECL (note: I've not tested):

--8<---------------cut here---------------start------------->8---
(declaim (type double-float PII PI5))

(defconstant PII (the double-float #.(* (float PI 1.0d0) 2d0)))
(defconstant PI5 (the double-float #.(* (float PI 1.0d0) 0.5d0)))
--8<---------------cut here---------------end--------------->8---
diff mbox series

Patch

From 9da7dd17ff3e5a86c3af91d3e764637bbfbb0df0 Mon Sep 17 00:00:00 2001
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Sat, 17 Apr 2021 21:44:09 +0100
Subject: [PATCH] gnu: Add cl-svg

* gnu/packages/lisp-xyz.scm (sbcl-cl-svg, cl-svg, ecl-cl-svg): New variables
---
 gnu/packages/lisp-xyz.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index bfa0c1a488..a0cd436066 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -9341,6 +9341,35 @@  Portable Network Graphics file format.")
 (define-public cl-png
   (sbcl-package->cl-source-package sbcl-png))
 
+(define-public sbcl-cl-svg
+  (let ((commit "1e988ebd2d6e2ee7be4744208828ef1b59e5dcdc")
+        (revision "1"))
+    (package
+      (name "sbcl-cl-svg")
+      (version (git-version "0.0.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/wmannis/cl-svg")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "11rmzimy6j7ln7q5y1h2kw1225rsfb6fpn89qjcq7h5lc8fay0wz"))))
+      (build-system asdf-build-system/sbcl)
+      (home-page "https://github.com/wmannis/cl-svg")
+      (synopsis "Write SVG file format")
+      (description
+       "This package provides Common Lisp system @code{CL-SVG} to produce
+Scalable Vector Graphics files.")
+      (license license:expat))))
+
+(define-public ecl-cl-svg
+  (sbcl-package->ecl-package sbcl-cl-svg))
+
+(define-public cl-svg
+  (sbcl-package->cl-source-package sbcl-fare-mop))
+
 (define-public sbcl-nodgui
   (let ((commit "4a9c2e7714b278fbe97d198c56f54ea87290001d")
         (revision "1"))
-- 
2.30.2