all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#34146] [PATCH] gnu: Add ghc-c2hs.
@ 2019-01-20 15:03 Gabriel Hondet
  2019-01-23 22:34 ` bug#34146: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Hondet @ 2019-01-20 15:03 UTC (permalink / raw)
  To: 34146

[-- Attachment #1: Type: text/plain, Size: 2805 bytes --]


* gnu/packages/haskell.scm (ghc-c2hs): New variable.
---
 gnu/packages/haskell.scm | 56 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index a3ce2a3e4..c7587af7c 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -11405,4 +11405,60 @@ from a shell.  The @code{tldr} pages are a community effort to simplify the
 man pages with practical examples.")
     (license license:bsd-3)))
 
+(define-public ghc-c2hs
+  (package
+    (name "ghc-c2hs")
+    (version "0.28.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/c2hs/c2hs-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1nplgxfin139x12sb656f5870rpdclrhzi8mq8pry035qld15pci"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-language-c" ,ghc-language-c)
+       ("ghc-dlist" ,ghc-dlist)))
+    (native-inputs
+     `(("ghc-test-framework" ,ghc-test-framework)
+       ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
+       ("ghc-hunit" ,ghc-hunit)
+       ("ghc-shelly" ,ghc-shelly)
+       ("ghc-text" ,ghc-text)
+       ("gcc" ,gcc)))
+    (arguments
+     `(#:tests? #f ;some tests fail because of syntax errors
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'set-cc
+           ;; add a cc executable in the path, needed for some tests to pass
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((gcc (assoc-ref inputs "gcc"))
+                   (tmpbin (tmpnam))
+                   (curpath (getenv "PATH")))
+               (mkdir-p tmpbin)
+               (symlink (which "gcc") (string-append tmpbin "/cc"))
+               (setenv "PATH" (string-append tmpbin ":" curpath)))
+             #t))
+         (add-after 'check 'remove-cc
+           ;; clean the tmp dir made in 'set-cc
+           (lambda _
+             (let* ((cc-path (which "cc"))
+                    (cc-dir (dirname cc-path)))
+               (delete-file-recursively cc-dir)
+               #t))))))
+    (home-page "https://github.com/haskell/c2hs")
+    (synopsis
+     "C->Haskell FFI tool that gives some cross-language type safety")
+    (description "C->Haskell assists in the development of Haskell bindings to
+C libraries.  It extracts interface information from C header files and
+generates Haskell code with foreign imports and marshaling.  Unlike writing
+foreign imports by hand (or using hsc2hs), this ensures that C functions are
+imported with the correct Haskell types.")
+    (license license:gpl2)))
+
 ;;; haskell.scm ends here
-- 
2.20.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#34146: [PATCH] gnu: Add ghc-c2hs.
  2019-01-20 15:03 [bug#34146] [PATCH] gnu: Add ghc-c2hs Gabriel Hondet
@ 2019-01-23 22:34 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-01-23 22:34 UTC (permalink / raw)
  To: Gabriel Hondet; +Cc: 34146-done

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

Gabriel Hondet <gabrielhondet@gmail.com> skribis:

> * gnu/packages/haskell.scm (ghc-c2hs): New variable.

Applied with the changes below.

It’d be nice to report the test failures upstream since it could be
fairly problematic for such a tool to fail to parse C headers.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1137 bytes --]

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 02af900354..b8ea36852b 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -11429,7 +11429,10 @@ man pages with practical examples.")
        ("ghc-text" ,ghc-text)
        ("gcc" ,gcc)))
     (arguments
-     `(#:tests? #f ;some tests fail because of syntax errors
+     `(;; XXX: Test failures are induced by a parse error in <bits/floatn.h>
+       ;; of glibc 2.28.
+       #:tests? #f
+
        #:phases
        (modify-phases %standard-phases
          (add-before 'check 'set-cc
@@ -11450,8 +11453,7 @@ man pages with practical examples.")
                (delete-file-recursively cc-dir)
                #t))))))
     (home-page "https://github.com/haskell/c2hs")
-    (synopsis
-     "C->Haskell FFI tool that gives some cross-language type safety")
+    (synopsis "Create Haskell bindings to C libraries")
     (description "C->Haskell assists in the development of Haskell bindings to
 C libraries.  It extracts interface information from C header files and
 generates Haskell code with foreign imports and marshaling.  Unlike writing

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-23 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-20 15:03 [bug#34146] [PATCH] gnu: Add ghc-c2hs Gabriel Hondet
2019-01-23 22:34 ` bug#34146: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.