[PATCH] gnu: Add c2ffi-11.0.0.

OpenSubmitted by muradm.
Details
3 participants
  • Attila Lendvai
  • Ludovic Courtès
  • muradm
Owner
unassigned
Severity
normal
M
M
muradm wrote on 26 Aug 23:07 +0200
(address . guix-patches@gnu.org)
20210826210712.31273-1-mail@muradm.net
* gnu/packages/cpp.scm (c2ffi): New variable.--- gnu/packages/cpp.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
Toggle diff (58 lines)diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scmindex ba921fac11..f2663b7e6e 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,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
M
M
muradm wrote on 27 Aug 02:12 +0200
[PATCH v2] gnu: Add c2ffi-11.0.0.
(address . 50217@debbugs.gnu.org)
20210827001207.4105-1-mail@muradm.net
* gnu/packages/cpp.scm (c2ffi): New variable.--- gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
Toggle diff (57 lines)diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scmindex 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
L
L
Ludovic Courtès wrote on 7 Sep 16:06 +0200
Re: bug#50217: [PATCH] gnu: Add c2ffi-11.0.0.
(name . muradm)(address . mail@muradm.net)(address . 50217@debbugs.gnu.org)
87r1e04h0l.fsf_-_@gnu.org
Hello,
muradm <mail@muradm.net> skribis:
Toggle quote (2 lines)> * gnu/packages/cpp.scm (c2ffi): New variable.
Overall LGTM, modulo the following minor issues:
[...]
Toggle quote (5 lines)> +(define-public c2ffi> + (let ((commit "f50243926a0afb589de1078a073ac08910599582")> + (revision "1")> + (c2ffi-sha256 "17j73yb6v3lfvwwicl2f3yg141iz2dk1rf874qzqs5bkq64ldjsj"))
Normally, we only provide upstream releases. If you think we need thisspecific 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 atcompile-time.)
Toggle quote (2 lines)> + #: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.
Toggle quote (4 lines)> + (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.")
Toggle quote (2 lines)> + (license license:gpl2))))
Is it GPLv2-only? Unless it’s explicitly stated, it’s probablyGPLv2-or-later (‘license:gpl2+’).
Could you send an updated patch?
Thanks!
Ludo’.
L
L
Ludovic Courtès wrote on 24 Sep 13:54 +0200
control message for bug #50217
(address . control@debbugs.gnu.org)
877df6p4sw.fsf@gnu.org
tags 50217 + moreinfoquit
A
A
Attila Lendvai wrote on 25 Oct 17:14 +0200
[PATCH v2] gnu: Add c2ffi.
(address . 50217@debbugs.gnu.org)(name . Attila Lendvai)(address . attila@lendvai.name)
20211025151405.12198-1-attila@lendvai.name
Orignial work by muradm <mail@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 tofix that part.
let me know if there's anything else to fix.
gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
Toggle diff (65 lines)diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scmindex 643b85a8db..08df093f92 100644--- a/gnu/packages/cpp.scm+++ b/gnu/packages/cpp.scm@@ -18,6 +18,8 @@ ;;; 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>+;;; Copyright © 2021 Attila Lendvai <attila@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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 50217@debbugs.gnu.org