From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 12:14:50 2022 Received: (at 50217) by debbugs.gnu.org; 12 Jan 2022 17:14:50 +0000 Received: from localhost ([127.0.0.1]:58866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7hCu-0005cr-G5 for submit@debbugs.gnu.org; Wed, 12 Jan 2022 12:14:49 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:46951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7hCp-0005cU-JV for 50217@debbugs.gnu.org; Wed, 12 Jan 2022 12:14:42 -0500 Received: by mail-wr1-f44.google.com with SMTP id l25so5411318wrb.13 for <50217@debbugs.gnu.org>; Wed, 12 Jan 2022 09:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9B6FIR0lUiN/MPATitoSI82bdL+aHVDbeEZuZCfgiUY=; b=MZfOyWukkChfprZmvzdC5ILO5moJsoCY48UkWLyb2ziD5NIORvQc6q1uLD11UGV+i3 hwk9ujl4a0Eolf6iioxMCDNggTYj9rlCaeUPVYBOzsebaYVqrfG2LF1QDUJSce4KtX0d bhI8p6nrAbkkk0/FmJiryiQGOwxvS6Qfq53CvQD0xJvhkpmzAcj8cd4t2t2izlBMHxRw 22XCAhRfGk1TVJNVvD33Ow6Zyvf2D4iDc4wstbpE/MpXTzi1VrdmxR+y3lG3ANK2j4um zqjgl3f8n3FkakzLGvS6YFCK4pJj9Cbxe0Wpe8sTM9mVsGA53tDG97mb6zzdsnpplSF5 1ARA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=9B6FIR0lUiN/MPATitoSI82bdL+aHVDbeEZuZCfgiUY=; b=xoMeRolkyWJJ0SqJrtspcdY6ApBO1F5MBHJYuiPL58syWkh7I+cCz+fAp9ZPf9t1jJ 9x19Y5+z1Ln2HfCxGRmZ4H9kI7kkXHTCp6fO7TpUsgs4RMMnigF20NqOnzarKLyJ2XpQ cj2Dz0A5Y3ROrDuP5nxcgeM/CYmifsiLzi6cHB91Txz8uCJ59L7n5SWs9cQ5wQlv5yvg Mc/ftfv1AO8bxTACYMbvhNaSxN5/8yspyMKrJjrEF7Dtz58uOslA18aUQgHvgfQIJZix dBmzcN2ffPqypQo/tr20KoMs8tnDM3c3d7ujahK36wBVAnrZXKi43NVLaW1rosuUWFa2 EQYQ== X-Gm-Message-State: AOAM5336H1xUab94PaDcu+Z5ERbJTz6Yb/nce3j283H8GgfZDjXvc9rQ +5wgG0FoH8hKasE9DY6ALRaXM86qiw/HQA== X-Google-Smtp-Source: ABdhPJwh1PDbk+MEmM7Jq1lf3r99ptUk+LnLw0/MVmk1WnNjmaC0XYfuuPQa0pRw9mBqNjqBwLL3sg== X-Received: by 2002:a05:6000:1d91:: with SMTP id bk17mr595950wrb.684.1642007673512; Wed, 12 Jan 2022 09:14:33 -0800 (PST) Received: from lelap.home ([2a02:120b:2c72:1dc0:2e07:56d9:2bb8:283d]) by smtp.gmail.com with ESMTPSA id r132sm777876wma.34.2022.01.12.09.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 09:14:32 -0800 (PST) From: Attila Lendvai To: 50217@debbugs.gnu.org Subject: [PATCH v3] gnu: Add c2ffi. Date: Wed, 12 Jan 2022 18:13:31 +0100 Message-Id: <20220112171329.22695-1-attila@lendvai.name> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Orignial work by muradm , fixes by Attila Lendvai. * gnu/packages/cpp.scm (c2ffi): New variable. --- v3 converts the input lists to the new format. Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: nixo.xyz (xyz)] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (attila.lendvai[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.44 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.44 listed in wl.mailspike.net] 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Debbugs-Envelope-To: 50217 Cc: Attila Lendvai X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Orignial work by muradm , fixes by Attila Lendvai. * gnu/packages/cpp.scm (c2ffi): New variable. --- v3 converts the input lists to the new format. Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: nixo.xyz (xyz)] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (attila.lendvai[at]gmail.com) 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Orignial work by muradm , 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 ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Nikolay Korotkiy +;;; Copyright © 2021 muradm +;;; Copyright © 2021 Attila Lendvai ;;; ;;; 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