[bug#78246,v2] gnu: Add symfpu.

Message ID e7a5602c83078a357568c0a7e6e53ad842ae4da6.1746463170.git.soeren@soeren-tempel.net
State New
Headers
Series [bug#78246,v2] gnu: Add symfpu. |

Commit Message

Sören Tempel May 5, 2025, 4:39 p.m. UTC
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/maths.scm (symfpu): New variable.
---
Change since v2:

* Make revision let-bound
* Fix git-version
* Use an install-plan
* Change license to gpl3+

 gnu/packages/maths.scm | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)


base-commit: 415e3d98d6faf5fd3d1b7b3daa2f20636e4ff822
  

Comments

Andreas Enge May 14, 2025, 12:56 p.m. UTC | #1
Hello Sören,

thanks a lot for your patch, which I have modified a little bit and
pushed. Next time when you send a v2, could you send the complete patch
set, even those which have (seemingly) not changed? Here for instance
the bitwuzla patch did not apply any more as such, since the context had
changed (the previous line from symfpu ended in "gpl3+))))" instead of
"gpl3))))"). And I think this will also help QA to apply all patches of
the v2.

I have also expanded a bit the descriptions and in particular made them
full sentences. And added a copyright line for you.

For bitwuzla, many of the native-inputs should instead be just regular
inputs (rule of thumb: everything that is just needed during the build,
such as pkg-config for configuring or googletest for the tests, should
be native; when cross-compiling, it is run on the build machine;
whereas libraries against which the project is linked should be regular,
they will be used during, well, the use of the package).

(To be honest, I am not totally sure my split between native and normal
inputs is correct; maybe the header only library symfpu should be a
native input? I have also removed python as an input; the build works
without, and I did not see python related in the output.)

I am closing this issue; please feel free to reopen it if something does
not work as expected.

Andreas
  

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index eb23a375b4..c139d46fee 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8218,6 +8218,54 @@  (define-public yices
 s-expression-based format.")
    (license license:gpl3+)))
 
+(define-public symfpu
+  (let ((commit "22d993d880f66b2e470c3928e0e61bdf61419702")
+        (revision "0"))
+    (package
+      (name "symfpu")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/martin-cs/symfpu")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1h20zzkyi225290kc6mzg8i4dwkj0p1vlwfgc9ycs61snlyd8gr8"))))
+      (build-system copy-build-system)
+      (arguments
+       (list
+        #:install-plan
+        #~`(("symfpu.pc" "lib/pkgconfig/symfpu.pc")
+            ("core" "include/symfpu/core")
+            ("utils" "include/symfpu/utils"))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-before 'install 'build-pkgconfig
+              (lambda* (#:key outputs #:allow-other-keys)
+                (with-output-to-file "symfpu.pc"
+                  (lambda _
+                    (format #t
+                     "prefix=~a~@
+                      exec_prefix=${prefix}~@
+                      includedir=${prefix}/include~@
+                      ~@
+                      ~@
+                      Name: symfpu~@
+                      Version: ~a~@
+                      Description: library for IEEE-754 floats~@
+                      Cflags: -I${includedir}~%"
+                     (assoc-ref outputs "out")
+                     #$version))))))))
+      (synopsis
+       "Concrete and symbolic implementation of IEEE-754 floating-point numbers")
+      (description
+       "This library provides a C++ implementation of concrete and symbolic semantics
+for floating point numbers as defined in IEEE Standard for Floating-Point Arithmetic.")
+      (home-page "https://github.com/martin-cs/symfpu")
+      (license license:gpl3+))))
+
 (define-public z3
   (package
     (name "z3")