From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qG9QFRYLIWJYgAEAgWs5BA (envelope-from ) for ; Thu, 03 Mar 2022 19:38:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gGgKEhYLIWJ88QAAauVa8A (envelope-from ) for ; Thu, 03 Mar 2022 19:38:14 +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 E8FD8DAD9 for ; Thu, 3 Mar 2022 19:38:13 +0100 (CET) Received: from localhost ([::1]:40516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPqL6-0000NH-Sr for larch@yhetil.org; Thu, 03 Mar 2022 13:38:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPqKw-0000N1-DN for guix-patches@gnu.org; Thu, 03 Mar 2022 13:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPqKw-0008Ef-45 for guix-patches@gnu.org; Thu, 03 Mar 2022 13:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPqKw-0006cS-1d for guix-patches@gnu.org; Thu, 03 Mar 2022 13:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50217] [PATCH v9] 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: Thu, 03 Mar 2022 18:38:02 +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.164633267425432 (code B ref 50217); Thu, 03 Mar 2022 18:38:02 +0000 Received: (at 50217) by debbugs.gnu.org; 3 Mar 2022 18:37:54 +0000 Received: from localhost ([127.0.0.1]:43755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPqKj-0006c2-TL for submit@debbugs.gnu.org; Thu, 03 Mar 2022 13:37:54 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:35796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPqKh-0006bp-KT for 50217@debbugs.gnu.org; Thu, 03 Mar 2022 13:37:48 -0500 Received: by mail-wm1-f54.google.com with SMTP id v2-20020a7bcb42000000b0037b9d960079so5878913wmj.0 for <50217@debbugs.gnu.org>; Thu, 03 Mar 2022 10:37:47 -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=+vC5J2xxFCHvHpyIQZ8TwMAsT5gtNPfT3PDL2gyDOsA=; b=JxCH1m0J6eeCbYOi1MWN0ERUdlCEuGtQFzuKBQhdjSuRmvzxiVYS/R53AHW2KvZz/v Su8LynSVqBoZl1YYpBcWBtt9HOYOxaDeAlOKObCyqXFTnvDWQrtkRdJxbCZ375gfgj8w JavU7fn17nWvqFEvTHJTFkFfIYOc48/6kzMW0Q7nN8Xs2b8wPkYRmwfRgEJYIC3S4/8e 0jOCaDT2BCP8fmB0A6NJbQN1y9YtjBwPG2tZnYQWhBb8hOThpE/8tPeoZuI3cBOGI8CA ARB6G8uQ4HvRlr1gSrP2UTH7grZMwsux4cl1MnrAdbPFZ//SnOO3t+rDhR3S4m7B2lM1 Z4Yw== 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=+vC5J2xxFCHvHpyIQZ8TwMAsT5gtNPfT3PDL2gyDOsA=; b=YPWsAKbZ6VrYHGK8dbwbLeFTMHkAgZfj0qnn2DKvlQYII2rXJcId/Wbv7JHKBDsHgM jiJ5QDRsM9ueFYRTUXWJNVYgLWL2Wt0dxbLUkbHc8igaN/2LF/CaN9WWDC/SfUfcXvAU i7QPIefGlJ08GVjsOb6UhbjNRN49n+TvxpSQDNkZgd/sYJqdeVTr73zcoAAk6z+r1f7J z9hd2n1KNFRORkJGhcNqJD+iRaPhyI4pjT7iREToWIpBHfx/o0Gv0kds/2nz/FbCbl01 DZVwRkZJGVAvcmumC2jZsabpV963PYe4SAEHDa3LgGQBJuLw2w5BhwPKdOb9VaOEy8YC 4Ipg== X-Gm-Message-State: AOAM530m8BSMoaeWHyEgRDXQpduotlyFsXPq9XI+p8BTMrJmpT7bCz1m 9A8D+MgatXU6hjdFsTe+I/4g2OSCRSQ= X-Google-Smtp-Source: ABdhPJyFk0FvPuSkv84xfQ2lqp8GJz9mQgv8VAVXv2gWXoWtoRI8znJ7ctSMa0uGfAHd5HoNs3IRpg== X-Received: by 2002:a05:600c:384b:b0:381:10bc:9e43 with SMTP id s11-20020a05600c384b00b0038110bc9e43mr4860801wmr.181.1646332661586; Thu, 03 Mar 2022 10:37:41 -0800 (PST) Received: from localhost.localdomain ([2a02:ab88:3710:7c80:9130:5abf:96b3:dc0c]) by smtp.gmail.com with ESMTPSA id 9-20020a05600c268900b00381394d74a1sm2783207wmt.9.2022.03.03.10.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 10:37:41 -0800 (PST) From: Attila Lendvai Date: Thu, 3 Mar 2022 19:36:28 +0100 Message-Id: <20220303183627.29296-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=1646332694; 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=+vC5J2xxFCHvHpyIQZ8TwMAsT5gtNPfT3PDL2gyDOsA=; b=GGn+0WZR6RGySSJSOmhu3xtQPm455Mz9g3a5COKl/PAPLGmBOnwML3T7xg7ZoLk99zBqix J4S2iaQT4RMp+L/Acc1sSZY0XGQ+nCSMlmZulb5+gQ+BkAbpp1oOfJqNdkoAzHqp6637KP GXhG+0iupBk/Rfa9AGFgBp1vcGCUy9qPE+oMLFaY1AGzg6kjDtUPSWSEHQ+dgmMAaH9H2K z8iXi6RlegWpojsRQ42RFEeQy+aeNqJ/6/xo+NPst41eo9xgvXvP4UETWIhjhGvRQmzWws Cl9RSFZa7hc7YJdLqpbkfqIVi+r7L2wxfBP4dHpb+NJamjUOuwCFN/B4h9P3EA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646332694; a=rsa-sha256; cv=none; b=bbTuSgvmKXOyslYQ6qWFx+CMUBuonqn63j3GcK1ph6ZuiVVsMsg7HhN6K+Egs6wihrSaYg 3gg+b2k6JvXmVxNEZT31/6DQpFhqbSSiJLOT/S3qqcsNQsqXKxyCypS5c+voUjZGFLYWI0 XJp/cltz93WEjpnKYk2f9Tiqog+agCFZcaJJjKeWdvKcrcVv2bq1Dw0cXLBsFiMpv7eP2p h2sPjNUYuV0oZUAbVwNNsLFgC2TStGhcS0bsyBwD6S6+HIbcJWjyNGnnRVtvDQx+2v++ne LpGkgY3uMzI1e2kRbPTFvAx+X55qXlReH4wT96e5jYf0K81suenG6Siw/WjLZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JxCH1m0J; 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.04 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JxCH1m0J; 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: E8FD8DAD9 X-Spam-Score: 1.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: O9diLRo9TP7w Orignial work by muradm , 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 ;;; Copyright © 2021 Disseminate Dissent ;;; Copyright © 2022 Efraim Flashner +;;; Copyright © 2022 muradm +;;; Copyright © 2022 Attila Lendvai ;;; ;;; 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