diff mbox series

[bug#46352,1/4] gnu: Add dyncall.

Message ID 20210206213511.11551-1-brown121407@posteo.ro
State New
Headers show
Series Update Raku (Perl 6) | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Alexandru-Sergiu Marton Feb. 6, 2021, 9:35 p.m. UTC
* gnu/packages/c.scm (dyncall): New variable.
---
 gnu/packages/c.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

Ludovic Courtès March 20, 2021, 9:03 p.m. UTC | #1
Hi,

Alexandru-Sergiu Marton <brown121407@posteo.ro> skribis:

> * gnu/packages/c.scm (dyncall): New variable.

LGTM, except that it only builds static libraries.

Could we arrange to instead only build shared libraries, as we usually do?

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index d9e5e4d7de..db9938003f 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -11,6 +11,7 @@ 
 ;;; Copyright © 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -614,3 +615,41 @@  event stream encoding, a binary format for bidirectional client-server
 communication.")
     (home-page "https://github.com/awslabs/aws-c-event-stream")
     (license license:asl2.0)))
+
+(define-public dyncall
+  (package
+    (name "dyncall")
+    (version "1.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://www.dyncall.org/r" version
+                                  "/dyncall-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1mq832l2w17mvxd1sq50my8ykjfyzd52kizm0h3mc89l4k0590g8"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list (string-append "CC=" ,(cc-for-target)))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((bash (string-append (assoc-ref inputs "bash")
+                                        "/bin/bash"))
+                   (out (assoc-ref outputs "out")))
+               (invoke bash "./configure"
+                       (string-append "--prefix=" out)))))
+         (replace 'check
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((make (string-append (assoc-ref inputs "make")
+                                        "/bin/make")))
+               (invoke make "tests"
+                       (string-append "CC=" ,(cc-for-target)))))))))
+    (synopsis "Library for calling C functions dynamically")
+    (description "The dyncall library encapsulates architecture-, OS- and
+compiler-specific function call semantics in a virtual bind argument
+parameters from left to right and then call interface allowing programmers to
+call C functions in a completely dynamic manner.")
+    (home-page "https://www.dyncall.org/")
+    (license license:isc)))