unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: muradm <mail@muradm.net>
To: 50217@debbugs.gnu.org
Subject: [bug#50217] [PATCH v2] gnu: Add c2ffi-11.0.0.
Date: Fri, 27 Aug 2021 03:12:07 +0300	[thread overview]
Message-ID: <20210827001207.4105-1-mail@muradm.net> (raw)
In-Reply-To: <20210826210712.31273-1-mail@muradm.net>

* gnu/packages/cpp.scm (c2ffi): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ba921fac11..239e87bf84 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2020 Milkey Mouse <milkeymouse@meme.institute>
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;; Copyright © 2021 muradm <mail@muradm.net>
 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1250,3 +1251,42 @@ of reading and writing XML.")
     (description "Jsonnet is a templating language extending JSON
 syntax with variables, conditions, functions and more.")
     (license license:asl2.0)))
+
+(define-public c2ffi
+  (let ((commit "f50243926a0afb589de1078a073ac08910599582")
+        (revision "1")
+        (c2ffi-sha256 "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))
+    (package
+      (name "c2ffi")
+      (home-page "https://github.com/rpav/c2ffi")
+      (version (git-version "11.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference (url home-page) (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256 (base32 c2ffi-sha256))
+                (modules '((guix build utils)))
+                (snippet
+                 '(substitute* "CMakeLists.txt"
+                    ;; cmake-build-system default cmake version
+                    (("VERSION 3.17") "VERSION 3.16.5")
+                    ;; guix seems to be packaging LLVM libs separately
+                    ;; thus -lLLVM is not working, every used library should
+                    ;; be specified explicitly
+                    (("c2ffi PUBLIC clang-cpp LLVM")
+                     "c2ffi PUBLIC clang-cpp LLVMCore LLVMSupport LLVMMCParser LLVMOption LLVMBitReader LLVMProfileData")))))
+      (build-system cmake-build-system)
+      (arguments
+       '(;; llvm-11 at least seems to be built without RTTI
+         ;; llvm-12 on the other hand specifies -DLLVM_REQUIRES_RTTI=1
+         ;; may fail with this flag when c2ffi for llvm-12 released
+         ;; https://stackoverflow.com/q/11904519
+         #:configure-flags '("-DCMAKE_CXX_FLAGS=-fno-rtti")
+         #:tests? #f))
+      (inputs
+       `(("clang" ,clang-11)
+         ("llvm" ,llvm-11)))
+      (synopsis "Clang-based FFI wrapper generator")
+      (description "tool for extracting definitions from C, C++, and
+Objective C headers for use with foreign function call interfaces.")
+      (license license:gpl2))))
-- 
2.33.0





  reply	other threads:[~2021-08-27  0:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 21:07 [bug#50217] [PATCH] gnu: Add c2ffi-11.0.0 muradm
2021-08-27  0:12 ` muradm [this message]
2021-09-07 14:06   ` Ludovic Courtès
2021-10-25 15:14 ` [bug#50217] [PATCH v2] gnu: Add c2ffi Attila Lendvai
2022-01-12 17:13 ` [bug#50217] [PATCH v3] " Attila Lendvai
2022-02-14 12:31 ` [bug#50217] [PATCH v4] " Attila Lendvai
2022-02-14 15:30   ` Maxime Devos
2022-02-14 15:34   ` Maxime Devos
2022-02-14 15:41   ` Maxime Devos
2022-02-15 18:43 ` [bug#50217] [PATCH v5] " Attila Lendvai
2022-02-15 19:51 ` [bug#50217] [PATCH v6] " Attila Lendvai
2022-03-01  9:17 ` [bug#50217] [PATCH v7] " Attila Lendvai
2022-03-01  9:21 ` [bug#50217] [PATCH v8] " Attila Lendvai
2022-03-03 18:36 ` [bug#50217] [PATCH v9] " Attila Lendvai
2022-03-03 20:34   ` bug#50217: " Guillaume Le Vaillant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210827001207.4105-1-mail@muradm.net \
    --to=mail@muradm.net \
    --cc=50217@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).