From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CMNyF5bpHWLjWQAAgWs5BA (envelope-from ) for ; Tue, 01 Mar 2022 10:38:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8D6JEJbpHWL1ZwAAG6o9tA (envelope-from ) for ; Tue, 01 Mar 2022 10:38:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CBA1A2DBC0 for ; Tue, 1 Mar 2022 10:38:29 +0100 (CET) Received: from localhost ([::1]:58428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOyxe-0000zT-OQ for larch@yhetil.org; Tue, 01 Mar 2022 04:38:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOyik-0002yV-6J for guix-patches@gnu.org; Tue, 01 Mar 2022 04:23:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOyij-0002BN-T9 for guix-patches@gnu.org; Tue, 01 Mar 2022 04:23:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOyij-0001xs-Q0 for guix-patches@gnu.org; Tue, 01 Mar 2022 04:23:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50217] [PATCH v8] gnu: Add c2ffi. References: <20210826210712.31273-1-mail@muradm.net> In-Reply-To: <20210826210712.31273-1-mail@muradm.net> Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Mar 2022 09:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50217 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: 50217@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 50217-submit@debbugs.gnu.org id=B50217.16461265247469 (code B ref 50217); Tue, 01 Mar 2022 09:23:01 +0000 Received: (at 50217) by debbugs.gnu.org; 1 Mar 2022 09:22:04 +0000 Received: from localhost ([127.0.0.1]:35432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOyhi-0001w2-0E for submit@debbugs.gnu.org; Tue, 01 Mar 2022 04:22:04 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]:45847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOyhg-0001vp-5S for 50217@debbugs.gnu.org; Tue, 01 Mar 2022 04:21:56 -0500 Received: by mail-ej1-f48.google.com with SMTP id qa43so3600439ejc.12 for <50217@debbugs.gnu.org>; Tue, 01 Mar 2022 01:21:56 -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=4nZtA+HyGswhkFi+w39yP2JK8eF46Xy+9VtKs62N/+s=; b=AUxnq3SknmbjDSrVPCeNQrfLlAVWiuZVeD7nglCxcNNgPjHPgCRz/mtmxJK/d7rshm YoORwChywESy24WmDaUwnUXsEZ43kwJL4EiL2lkIEKXGKTQxLldn7ZpNf4AICCWyP7hx nk2XwmPVfCt9cTJtt3pfiX3/Jgi0aHM+/WZ1RIlAMBg/dzeV60oUVk3L8R+s1qcc+70A Aht+/nLD4Dt1k6QoRNItLzt3yY8B70odkhPScJL+YwNQCiG6PsMxHcWILTnXxrKHVQxn xaOBNraF+4wP8IPNve1JjNJSCsnWYkHCnED8ahzOsnycudO8CqizfQ+u2z991KYtIXZu KdZw== 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=4nZtA+HyGswhkFi+w39yP2JK8eF46Xy+9VtKs62N/+s=; b=gyZk1emQ80R0AuIxmcNkIvUrQKUFck4gOqEqBlxMrDTv7qYm9D4vJQDXnkYWO4NHGp pgvsh4QZzYCYjmtoUkloOlV9/x90l+jpqOByiZnxAiOdxCDCndWpYHCH4fTbF4iTSetj QxlWdwqHkM3nGgJcsaZr6BTyqPN97ShnonbxEOUwciz3IZmdRljnAw7TvNYxF5vOaxRc 5icK0pu0aEXK7An82zId4Lu7J62T1l7UaArN5LvZfvaVV7I6KghR/KU/6x/aO3YsRMWz arNQFe0NQ2UUHYrDf86RMc0R+sSF+YZIGyKBb1gzt4aFMCaEnQmDGOF1luWZh4SpQOvD N4jA== X-Gm-Message-State: AOAM533tRDoNmd1o5G4dis5dBPWr4Gh0w/ONnuLAWJz7GXselL0BOhV+ o+rYeeO/aqHe8qJDgYiRSA0vzmqSxbs= X-Google-Smtp-Source: ABdhPJyb/+7VxP07GT6CS1mJ+1PUp9NlFa9tzTcI1zsB983XmM/kTNyq6QTn1Qt70RuB3KHRcjgThw== X-Received: by 2002:a17:906:255a:b0:6ce:3732:6f5f with SMTP id j26-20020a170906255a00b006ce37326f5fmr18190369ejb.565.1646126510528; Tue, 01 Mar 2022 01:21:50 -0800 (PST) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id p14-20020a05640210ce00b00413211746d4sm6893284edu.51.2022.03.01.01.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 01:21:50 -0800 (PST) From: Attila Lendvai Date: Tue, 1 Mar 2022 10:21:12 +0100 Message-Id: <20220301092110.6199-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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646127509; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4nZtA+HyGswhkFi+w39yP2JK8eF46Xy+9VtKs62N/+s=; b=CJ7wY3HEDTLI5cG4K/BLm99SSHU7wLhvvbtmzgR7y1Oz1b/hmdaMj6cqMvm2Y0bgChMWwm uUaESvVnSBIfcExt7GEXzqMwibH3YJ+u9OtvDtOX3ZnC/dkZ15q1f+dBecAdvmzJYzR3ke yrZgCqRnvnpjELi0MfWaJLjMRcGWnG7PZraXINnD/DWLkLEvmn7LRyE4puvJ9xk8UASYPp LpQd5dvAIMn3SSV+rSm5Cug2igTqmkyjt+0RC0FayYexzMXW9Rw5aa3Ic4MznRPnsophlk EF7HorwsujXUFVhhmrI9Bh/wvKbK54pP4EasGK0wKB7LIXDp8VgsT//26bFsjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646127509; a=rsa-sha256; cv=none; b=XkRn/HmnBijnNJSCjll5Eshukbss+3PlB07mAtXEAH4yo3y9/3SttbPbAW2A+kj92G60cS qjgtpePIlr4oBJ2DQHq1iaOCHZ58T5abNcEFxWdRcXAizbZjArzmJ0d8Vw4C1GbALe1EkV mUxMp7xeIXPkirJpbza7HW30SHVfh3BBLI8s83/F6G4bEADu191eMPMVPWrJouMEFv6sWU i5Os6zH8akdcVqp9UECB3VoLBsqICQUfTqR7RxxfGMb1lYe4MmNUa+ADCB3glZhcsJwrJs SKS6O5WA09C3nJZaw7UvZkzRipkFN9jGmgO0CmesIu8kHBpKrra3xh7+t7erMw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AUxnq3Sk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AUxnq3Sk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CBA1A2DBC0 X-Spam-Score: 1.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3wtsJwfPnXOF Orignial work by muradm , 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 ;;; Copyright © 2021 Disseminate Dissent ;;; Copyright © 2022 Efraim Flashner +;;; Copyright © 2022 muradm +;;; Copyright © 2022 Attila Lendvai ;;; ;;; 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