@@ -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)))