From patchwork Sun Jan 20 15:03:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Hondet X-Patchwork-Id: 770 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D235416A39; Sun, 20 Jan 2019 15:06:08 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6A11916A34 for ; Sun, 20 Jan 2019 15:06:08 +0000 (GMT) Received: from localhost ([127.0.0.1]:40941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glEfn-0004Gx-Ql for patchwork@mira.cbaines.net; Sun, 20 Jan 2019 10:06:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glEfl-0004Ej-Fn for guix-patches@gnu.org; Sun, 20 Jan 2019 10:06:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glEfj-0006qA-Mz for guix-patches@gnu.org; Sun, 20 Jan 2019 10:06:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39807) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glEfi-0006oM-JE for guix-patches@gnu.org; Sun, 20 Jan 2019 10:06:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1glEfh-0003db-UL for guix-patches@gnu.org; Sun, 20 Jan 2019 10:06:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34146] [PATCH] gnu: Add ghc-c2hs. Resent-From: Gabriel Hondet Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Jan 2019 15:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34146@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154799674713958 (code B ref -1); Sun, 20 Jan 2019 15:06:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2019 15:05:47 +0000 Received: from localhost ([127.0.0.1]:39088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glEfT-0003d3-3L for submit@debbugs.gnu.org; Sun, 20 Jan 2019 10:05:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glEfR-0003cn-2B for submit@debbugs.gnu.org; Sun, 20 Jan 2019 10:05:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:60418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glEfL-0006N9-PO for submit@debbugs.gnu.org; Sun, 20 Jan 2019 10:05:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glEfK-0004Ed-RC for guix-patches@gnu.org; Sun, 20 Jan 2019 10:05:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glEfI-0006Jp-TR for guix-patches@gnu.org; Sun, 20 Jan 2019 10:05:38 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glEfG-00065l-Tu for guix-patches@gnu.org; Sun, 20 Jan 2019 10:05:36 -0500 Received: by mail-wm1-x342.google.com with SMTP id f188so8482354wmf.5 for ; Sun, 20 Jan 2019 07:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=1LvoCEvnh2iNusXmHr7dTXKJPtByPR+QDCW0D8h6X1Q=; b=Gng3vgi77+a7JZcqQWg1Ct2KAqNVpRWa6H6Gwn+L7C+CCMtwFEurqWL9lbGEUzN+5U x7HwuMG8+tljx/aMml1nh1XYKtqobRlIPMCBUEPx7EjrpINk+deAyQpGOyBGPk8PlKTx gzk4+Y8FLsT81cdnrHSRfVvQ8oZiLQamKNUQthgTydAaJNzGYDw+smkI+caHNnSqGCvx euczjsxvdFGzcuVaYy05iWtmSvDw2ejm4W/f9TNQhdZqbEu6Oc6ORBR0KTycyTfNpqMy an2RwfW9kM8JpFuH5vJYyOouAENCWdCL6fxyuNQOaVdVD14/xFH0rde+jr4Rfo9vJCEr uFeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=1LvoCEvnh2iNusXmHr7dTXKJPtByPR+QDCW0D8h6X1Q=; b=JJIEIMzWXvofoM7xwHnjGgJ8nUfZKSMIkClCOFmqhDiNHI5PqwsTan891nV3u6yZp+ RFPmy6a81n3kANrwTElKp6R9YrJNWrJzOyfVMrCr6ifDcAqXeeJBo40R2K5GojsMagNa eKEmzU1RXxoRjvfAox0HrbOwLN+HG8bFFOz4GYGZzOFwxKg/Ny0LbHfHCJVt4mwdspeg 0r2CAUGSApgRMNLbVZ3Q+9wDgPYXriak4Nuw68W33LVMFInvEU6qtsYI9YbwQ1XW4pkR vCA27zDLwDh0xZ9v/HFVEJ/zW2yEJZl/6tYo3TWu23TGU6buuDLIlDPGsohJg57Dun8o aNEw== X-Gm-Message-State: AJcUukeke+IugVeJu75MCHcj7wHVp+yt6l7iv3mIVreoX9PhNIGWg7XH vN/D6Fyax87/kcl0r4jtxJ9hnfjN X-Google-Smtp-Source: ALg8bN5qOChgazB0SnGDse4PkhaLADvWY0eECr4RrIHfjyytRf9xJjDfwgas+IASXf/oAvu1Zdqr3Q== X-Received: by 2002:a1c:58ce:: with SMTP id m197mr22662232wmb.31.1547996725720; Sun, 20 Jan 2019 07:05:25 -0800 (PST) Received: from glht-aurore.gmail.com ([217.109.134.89]) by smtp.gmail.com with ESMTPSA id r12sm100939892wrq.3.2019.01.20.07.05.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 07:05:25 -0800 (PST) User-agent: mu4e 1.0; emacs 26.1 From: Gabriel Hondet Date: Sun, 20 Jan 2019 16:03:03 +0100 Message-ID: <875zujv07j.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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