From: Attila Lendvai <attila@lendvai.name>
To: 50217@debbugs.gnu.org
Cc: Attila Lendvai <attila@lendvai.name>
Subject: [bug#50217] [PATCH v4] gnu: Add c2ffi.
Date: Mon, 14 Feb 2022 13:31:13 +0100 [thread overview]
Message-ID: <20220214123112.20135-1-attila@lendvai.name> (raw)
In-Reply-To: <20210826210712.31273-1-mail@muradm.net>
Orignial work by muradm <mail@muradm.net>, fixes by Attila Lendvai.
* gnu/packages/cpp.scm (c2ffi): New variable.
---
new in v4:
- rebase to master
- upstream introduced releases, so let's use git tags
- use LLVM 12
- add a trivial test that invokes c2ffi --help
gnu/packages/cpp.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 86138531c0..b394c8e515 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -25,6 +25,8 @@
;;; Copyright © 2021 jgart <jgart@dismail.de>
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2021 Disseminate Dissent <disseminatedissent@protonmail.com>
+;;; Copyright © 2021 muradm <mail@muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila@lendvai.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1717,3 +1719,48 @@ (define-public bloomberg-bde
multi-threaded applications and network applications.")
(home-page "https://github.com/bloomberg/bde")
(license license:asl2.0))))
+
+(define-public c2ffi
+ (let ((git-tag "12.0.0.0"))
+ (package
+ (name "c2ffi")
+ (home-page "https://github.com/rpav/c2ffi")
+ (version (string-append "v" git-tag))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qq8dfismd20d9kfxpfvwz07v9mfvd0y7p5r3c92mk2pm4xnmzfy"))
+ (modules '((guix build utils)))
+ (snippet
+ '(substitute* "CMakeLists.txt"
+ ;; 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
+ '(;; If LLVM was built without RTTI, we need to also be built without
+ ;; it. See: https://stackoverflow.com/q/11904519
+ #:configure-flags '("-DCMAKE_CXX_FLAGS=-fno-rtti")
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (invoke "./bin/c2ffi" "--help"))))))
+ (native-inputs
+ (list clang-12 llvm-12))
+ (inputs
+ (list clang-12 llvm-12))
+ (synopsis "Clang-based FFI wrapper generator")
+ (description "@code{c2ffi} is a tool for extracting definitions from C, C++, and
+Objective C headers for use with foreign function call interfaces. It uses the
+@code{Clang/LLVM} infrastructure to extract the data, and emits it in various formats,
+including @code{json}.")
+ (license license:gpl2+))))
--
2.34.0
next prev parent reply other threads:[~2022-02-14 13:06 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 ` [bug#50217] [PATCH v2] " muradm
2021-09-07 14:06 ` [bug#50217] [PATCH] " 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 ` Attila Lendvai [this message]
2022-02-14 15:30 ` [bug#50217] [PATCH v4] " 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220214123112.20135-1-attila@lendvai.name \
--to=attila@lendvai.name \
--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 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.