GNU bug report logs - #50217
[PATCH] gnu: Add c2ffi-11.0.0.

Previous Next

Package: guix-patches;

Reported by: muradm <mail <at> muradm.net>

Date: Thu, 26 Aug 2021 21:08:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Guillaume Le Vaillant <glv <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50217 in the body.
You can then email your comments to 50217 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Thu, 26 Aug 2021 21:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to muradm <mail <at> muradm.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 26 Aug 2021 21:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add c2ffi-11.0.0.
Date: Fri, 27 Aug 2021 00:07:12 +0300
* gnu/packages/cpp.scm (c2ffi): New variable.
---
 gnu/packages/cpp.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ba921fac11..f2663b7e6e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2020 Brett Gilio <brettg <at> gnu.org>
 ;;; Copyright © 2020 Milkey Mouse <milkeymouse <at> meme.institute>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1250,3 +1251,43 @@ 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
+  (package
+    (name "c2ffi")
+    (home-page "https://github.com/rpav/c2ffi")
+    (version "11.0.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "llvm-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))
+              (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Fri, 27 Aug 2021 00:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: 50217 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: Add c2ffi-11.0.0.
Date: Fri, 27 Aug 2021 03:12:07 +0300
* 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 <at> gnu.org>
 ;;; Copyright © 2020 Milkey Mouse <milkeymouse <at> meme.institute>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 muradm <mail <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Tue, 07 Sep 2021 14:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: muradm <mail <at> muradm.net>
Cc: 50217 <at> debbugs.gnu.org
Subject: Re: bug#50217: [PATCH] gnu: Add c2ffi-11.0.0.
Date: Tue, 07 Sep 2021 16:06:18 +0200
Hello,

muradm <mail <at> muradm.net> skribis:

> * gnu/packages/cpp.scm (c2ffi): New variable.

Overall LGTM, modulo the following minor issues:

[...]

> +(define-public c2ffi
> +  (let ((commit "f50243926a0afb589de1078a073ac08910599582")
> +        (revision "1")
> +        (c2ffi-sha256 "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))

Normally, we only provide upstream releases.  If you think we need this
specific commit, could you add a comment explaining why?

Please leave the base32 sha256 string where it’s used, within the
(base32 …) expression (it’s a macro that decodes base32 at
compile-time.)

> +         #:tests? #f))

It would be best to run tests.  Alternatively, if this is not feasible,
please add a comment explaining why we’re skipping them.

> +      (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.")

Please write full sentences, as per
<https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html>.

> +      (license license:gpl2))))

Is it GPLv2-only?  Unless it’s explicitly stated, it’s probably
GPLv2-or-later (‘license:gpl2+’).

Could you send an updated patch?

Thanks!

Ludo’.




Added tag(s) moreinfo. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 24 Sep 2021 11:55:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Mon, 25 Oct 2021 15:18:02 GMT) Full text and rfc822 format available.

Message #16 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v2] gnu: Add c2ffi.
Date: Mon, 25 Oct 2021 17:14:06 +0200
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

as muradm didn't respond, i took the liberty to addressed the concerns.

i don't know how to credit the original author, so feel free to
fix that part.

let me know if there's anything else to fix.

 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 643b85a8db..08df093f92 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -18,6 +18,8 @@
 ;;; Copyright © 2020 Brett Gilio <brettg <at> gnu.org>
 ;;; Copyright © 2020 Milkey Mouse <milkeymouse <at> meme.institute>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1398,3 +1400,49 @@ (define-public simdjson
 validation.")
     (home-page "https://github.com/simdjson/simdjson")
     (license license:asl2.0)))
+
+(define-public c2ffi
+  (let ((commit "f50243926a0afb589de1078a073ac08910599582")
+        (revision "1"))
+    (package
+      (name "c2ffi")
+      (home-page "https://github.com/rpav/c2ffi")
+      ;; Upstream has no releases, only one branch per LLVM release. Let's put
+      ;; the LLVM version into the version string, use a revision as a
+      ;; human-readable differentiation of the versions that gets imported
+      ;; into Guix, and also use the commit hash to be specific.
+      (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 "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))
+                (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")
+         ;; Upstream has no tests.
+         #:tests? #f))
+      (inputs
+       `(("clang" ,clang-11)
+         ("llvm" ,llvm-11)))
+      (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.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Wed, 12 Jan 2022 17:15:01 GMT) Full text and rfc822 format available.

Message #19 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v3] gnu: Add c2ffi.
Date: Wed, 12 Jan 2022 18:13:31 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

v3 converts the input lists to the new format.

 gnu/packages/cpp.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 718fb20652..d7e2ff49e5 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -22,6 +22,8 @@
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo <at> nixo.xyz>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Nikolay Korotkiy <sikmir <at> disroot.org>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1452,3 +1454,48 @@ (define-public simdjson
 validation.")
     (home-page "https://github.com/simdjson/simdjson")
     (license license:asl2.0)))
+
+(define-public c2ffi
+  (let ((commit "f50243926a0afb589de1078a073ac08910599582")
+        (revision "1"))
+    (package
+      (name "c2ffi")
+      (home-page "https://github.com/rpav/c2ffi")
+      ;; Upstream has no releases, only one branch per LLVM release. Let's put
+      ;; the LLVM version into the version string, use a revision as a
+      ;; human-readable differentiation of the versions that gets imported
+      ;; into Guix, and also use the commit hash to be specific.
+      (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 "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))
+                (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
+       '(;; 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")
+         ;; Upstream has no tests.
+         #:tests? #f))
+      (native-inputs
+       (list clang-11 llvm-11))
+      (inputs
+       (list clang-11 llvm-11))
+      (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Mon, 14 Feb 2022 12:35:02 GMT) Full text and rfc822 format available.

Message #22 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v4] gnu: Add c2ffi.
Date: Mon, 14 Feb 2022 13:31:13 +0100
Orignial work by muradm <mail <at> 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 <at> dismail.de>
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Mon, 14 Feb 2022 15:31:02 GMT) Full text and rfc822 format available.

Message #25 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Attila Lendvai <attila <at> lendvai.name>, 50217 <at> debbugs.gnu.org
Subject: Re: [bug#50217] [PATCH v4] gnu: Add c2ffi.
Date: Mon, 14 Feb 2022 16:30:14 +0100
[Message part 1 (text/plain, inline)]
Attila Lendvai schreef op ma 14-02-2022 om 13:31 [+0100]:
> +           (replace 'check
> +             (lambda _
> +               (invoke "./bin/c2ffi" "--help"))))))

For cross-compiling c2ffi, this needs to respect #:tests?, because
tests cannot be run when cross-compiling.  This would be detected by
"./pre-inst-env guix lint".

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Mon, 14 Feb 2022 15:35:01 GMT) Full text and rfc822 format available.

Message #28 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Attila Lendvai <attila <at> lendvai.name>, 50217 <at> debbugs.gnu.org
Subject: Re: [bug#50217] [PATCH v4] gnu: Add c2ffi.
Date: Mon, 14 Feb 2022 16:34:14 +0100
[Message part 1 (text/plain, inline)]
Attila Lendvai schreef op ma 14-02-2022 om 13:31 [+0100]:
> +  (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)))

Isn't it the other way around?  Looking at the git repo, the git tag is
v12.0.0.0, not 12.0.0.0, and Guix strips version prefixes like "v", "V"
and "version-".  Also, IIUC, the current consensus is that home pages
and source git repos are separate things, even if sometimes their URL
coincides, so the URL may need to be copied into the 'url' field.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Mon, 14 Feb 2022 15:42:01 GMT) Full text and rfc822 format available.

Message #31 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Attila Lendvai <attila <at> lendvai.name>, 50217 <at> debbugs.gnu.org
Subject: Re: [bug#50217] [PATCH v4] gnu: Add c2ffi.
Date: Mon, 14 Feb 2022 16:41:41 +0100
[Message part 1 (text/plain, inline)]
Attila Lendvai schreef op ma 14-02-2022 om 13:31 [+0100]:
> +      (native-inputs
> +       (list clang-12 llvm-12))

Is clang (the C compiler) required to compile c2fii, or would the usual
gcc suffice?  If the former, I would add a comment

  ;; only supports compilation with clang, gcc does not work here

or the like.  Is the version of clang and LLVM used for compiling c2ffi
important?  If not, I would write (native-inputs (list clang llvm))
such that the default clang and LLVM version in Guix is used.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Tue, 15 Feb 2022 18:45:02 GMT) Full text and rfc822 format available.

Message #34 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v5] gnu: Add c2ffi.
Date: Tue, 15 Feb 2022 19:43:08 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

thank you for the excellent suggestions Maxime! and sorry for being
sloppy with guix lint and others!

v5 should address everything that you pointed out.

 gnu/packages/cpp.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 86138531c0..bc6d69e225 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -25,6 +25,8 @@
 ;;; Copyright © 2021 jgart <jgart <at> dismail.de>
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1717,3 +1719,47 @@ (define-public bloomberg-bde
 multi-threaded applications and network applications.")
       (home-page "https://github.com/bloomberg/bde")
       (license license:asl2.0))))
+
+(define-public c2ffi
+  (package
+    (name "c2ffi")
+    (version "12.0.0.0") ; The first element is the Clang/LLVM version
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rpav/c2ffi")
+             (commit (string-append "v" 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
+           ;; won't work, every used library must 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* (#:key tests? #:allow-other-keys)
+                               (when tests?
+                                 (invoke "./bin/c2ffi" "--help")))))))
+    (native-inputs
+     (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
+    (inputs
+     (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
+    (home-page "https://github.com/rpav/c2ffi")
+    (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Tue, 15 Feb 2022 19:53:02 GMT) Full text and rfc822 format available.

Message #37 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v6] gnu: Add c2ffi.
Date: Tue, 15 Feb 2022 20:51:47 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

v6: add a comment to clarify the versioning scheme.

 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 86138531c0..6e690b593d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -25,6 +25,8 @@
 ;;; Copyright © 2021 jgart <jgart <at> dismail.de>
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
+;;; Copyright © 2021 muradm <mail <at> muradm.net>
+;;; Copyright © 2021 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1717,3 +1719,49 @@ (define-public bloomberg-bde
 multi-threaded applications and network applications.")
       (home-page "https://github.com/bloomberg/bde")
       (license license:asl2.0))))
+
+(define-public c2ffi
+  (package
+    (name "c2ffi")
+    ;; As per the c2ffi README: the first three elements are encoding the
+    ;; required Clang/LLVM version, and the last one is the c2ffi revision.
+    (version "12.0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rpav/c2ffi")
+             (commit (string-append "v" 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
+           ;; won't work, every used library must 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* (#:key tests? #:allow-other-keys)
+                               (when tests?
+                                 (invoke "./bin/c2ffi" "--help")))))))
+    (native-inputs
+     (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
+    (inputs
+     (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
+    (home-page "https://github.com/rpav/c2ffi")
+    (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Tue, 01 Mar 2022 09:19:02 GMT) Full text and rfc822 format available.

Message #40 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v7] gnu: Add c2ffi.
Date: Tue,  1 Mar 2022 10:17:26 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

v7: rebased on master once again.

 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index de6b529302..f00dc22eab 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -26,6 +26,8 @@
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
 ;;; Copyright © 2022 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2022 muradm <mail <at> muradm.net>
+;;; Copyright © 2022 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1721,3 +1723,49 @@ (define-public bloomberg-bde
 multi-threaded applications and network applications.")
       (home-page "https://github.com/bloomberg/bde")
       (license license:asl2.0))))
+
+(define-public c2ffi
+  (package
+    (name "c2ffi")
+    ;; As per the c2ffi README: the first three elements are encoding the
+    ;; required Clang/LLVM version, and the last one is the c2ffi revision.
+    (version "12.0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rpav/c2ffi")
+             (commit (string-append "v" 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
+           ;; won't work, every used library must 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* (#:key tests? #:allow-other-keys)
+                               (when tests?
+                                 (invoke "./bin/c2ffi" "--help")))))))
+    (native-inputs
+     (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
+    (inputs
+     (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
+    (home-page "https://github.com/rpav/c2ffi")
+    (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Tue, 01 Mar 2022 09:23:01 GMT) Full text and rfc822 format available.

Message #43 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v8] gnu: Add c2ffi.
Date: Tue,  1 Mar 2022 10:21:12 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

v8: fix formatting.

 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index de6b529302..82b17e916a 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -26,6 +26,8 @@
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
 ;;; Copyright © 2022 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2022 muradm <mail <at> muradm.net>
+;;; Copyright © 2022 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1721,3 +1723,49 @@ (define-public bloomberg-bde
 multi-threaded applications and network applications.")
       (home-page "https://github.com/bloomberg/bde")
       (license license:asl2.0))))
+
+(define-public c2ffi
+  (package
+    (name "c2ffi")
+    ;; As per the c2ffi README: the first three elements are encoding the
+    ;; required Clang/LLVM version, and the last one is the c2ffi revision.
+    (version "12.0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rpav/c2ffi")
+             (commit (string-append "v" 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
+           ;; won't work, every used library must 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* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "./bin/c2ffi" "--help")))))))
+    (native-inputs
+     (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
+    (inputs
+     (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
+    (home-page "https://github.com/rpav/c2ffi")
+    (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





Information forwarded to guix-patches <at> gnu.org:
bug#50217; Package guix-patches. (Thu, 03 Mar 2022 18:38:02 GMT) Full text and rfc822 format available.

Message #46 received at 50217 <at> debbugs.gnu.org (full text, mbox):

From: Attila Lendvai <attila <at> lendvai.name>
To: 50217 <at> debbugs.gnu.org
Cc: Attila Lendvai <attila <at> lendvai.name>
Subject: [PATCH v9] gnu: Add c2ffi.
Date: Thu,  3 Mar 2022 19:36:28 +0100
Orignial work by muradm <mail <at> muradm.net>, fixes by Attila Lendvai.

* gnu/packages/cpp.scm (c2ffi): New variable.
---

v9 is a rebase once again. this time moving the package definition to
an alphabetical point to avoid frequent conflicts with other additions.


 gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 06d22088f6..c37df93bda 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -26,6 +26,8 @@
 ;;; Copyright © 2021 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2021 Disseminate Dissent <disseminatedissent <at> protonmail.com>
 ;;; Copyright © 2022 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2022 muradm <mail <at> muradm.net>
+;;; Copyright © 2022 Attila Lendvai <attila <at> lendvai.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -227,6 +229,52 @@ (define-public c++-gsl
     (home-page "https://github.com/microsoft/GSL/")
     (license license:expat)))
 
+(define-public c2ffi
+  (package
+    (name "c2ffi")
+    ;; As per the c2ffi README: the first three elements are encoding the
+    ;; required Clang/LLVM version, and the last one is the c2ffi revision.
+    (version "12.0.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rpav/c2ffi")
+             (commit (string-append "v" 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
+           ;; won't work, every used library must 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* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "./bin/c2ffi" "--help")))))))
+    (native-inputs
+     (list clang-12)) ; CMakeLists.txt invokes `clang -print-resource-dir`
+    (inputs
+     (list clang-12)) ; Compiled with gcc, but links against libclang-cpp.so
+    (home-page "https://github.com/rpav/c2ffi")
+    (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+)))
+
 (define-public libzen
   (package
     (name "libzen")
-- 
2.34.0





Reply sent to Guillaume Le Vaillant <glv <at> posteo.net>:
You have taken responsibility. (Thu, 03 Mar 2022 20:36:02 GMT) Full text and rfc822 format available.

Notification sent to muradm <mail <at> muradm.net>:
bug acknowledged by developer. (Thu, 03 Mar 2022 20:36:02 GMT) Full text and rfc822 format available.

Message #51 received at 50217-done <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Attila Lendvai <attila <at> lendvai.name>
Cc: 50217-done <at> debbugs.gnu.org
Subject: Re: [bug#50217] [PATCH v9] gnu: Add c2ffi.
Date: Thu, 03 Mar 2022 20:34:31 +0000
[Message part 1 (text/plain, inline)]
Patch pushed as 8c303758590e368fc6a67bfff8dd1721e70afd93.
I just slightly modified the commit message.
Thanks.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Apr 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.