From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id yPtuMTUfzmUhKQEAqHPOHw:P1 (envelope-from ) for ; Thu, 15 Feb 2024 15:27:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id yPtuMTUfzmUhKQEAqHPOHw (envelope-from ) for ; Thu, 15 Feb 2024 15:27:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=apatience.com header.s=protonmail2 header.b="a0Mjr/Ej"; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708007221; 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=qPvRBlGWo092HAhWGefM5IJS0uOBDi7ZR9rEiOuS/t4=; b=jC5UWxOx8cYiJ/uiAUE3ENbuEmo4T7DOUjJ/KytCMtDO3FTFofjVgcaTX28+sYeCRAdtvL 8CmwQAorlO8DUQL6I/6tGDMe1edA6ktvAmXhVT0okif9tw/rOzVKFGRLj/xYMUTBRFfPdd 0fi57PRq2msBsxi64H3qmqpIHJjgF/zfD/Y3CmN/roRSyIysSSwIO28chTGkXP4+jk6n+Z KK/URcDrp7CLBXwkgIXouBolpsl38dZqOEw2WrNwSrWC4JB+Pb4QdqT9q2FdVaSkNOScKo qfS8nb236KlWhy+8syfQnYUYbZtnAgDFI5m6p0FvirjuBtG9OKfCsH+sDXiALA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=apatience.com header.s=protonmail2 header.b="a0Mjr/Ej"; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708007221; a=rsa-sha256; cv=none; b=kiQtSqX1r4isHLY1oSEv8HG01Ie3MzZChL/2aO7vXX7AnvMklIV2L0bWjFsgiz8Y/b5FBX 25Q5OEpn4NYvqVk4162TJn5qtBb6U0w7AQnBTvovXkwiTg2TJ10eq91GC9sHkQmMPG2FIX dVBIYVLOPsO+3fsG2uQNYAuigcfCYp/3efOnH9s8s8FvNcWiTItu8x7wYmOrbst/yOjnwC Ms58nrt6nUCua9MY9lKT2414Ie+J2dahrAYMYZniQ7plwIe7Nr0ZuRNUa6nMbPWLZK3LvL uWiLTsES1/t9jp3e/0gM4xPdKSK8w1QJ/uFp0hfrcvZlNAs7+rkhgVLPRmRaNg== 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 44C261198D for ; Thu, 15 Feb 2024 15:27:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rachJ-0001tT-9t; Thu, 15 Feb 2024 09:26:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rachH-0001t1-R4 for guix-patches@gnu.org; Thu, 15 Feb 2024 09:26:43 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rachH-0001Of-J1 for guix-patches@gnu.org; Thu, 15 Feb 2024 09:26:43 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1racha-0007aL-7f for guix-patches@gnu.org; Thu, 15 Feb 2024 09:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69126] [PATCH v2] gnu: Add type-safe. References: In-Reply-To: Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Feb 2024 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69126 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69126@debbugs.gnu.org Cc: "Paul A. Patience" Received: via spool by 69126-submit@debbugs.gnu.org id=B69126.170800719429121 (code B ref 69126); Thu, 15 Feb 2024 14:27:02 +0000 Received: (at 69126) by debbugs.gnu.org; 15 Feb 2024 14:26:34 +0000 Received: from localhost ([127.0.0.1]:54733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rach8-0007Zd-71 for submit@debbugs.gnu.org; Thu, 15 Feb 2024 09:26:34 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:24711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rach5-0007ZO-K2 for 69126@debbugs.gnu.org; Thu, 15 Feb 2024 09:26:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail2; t=1708007166; x=1708266366; bh=qPvRBlGWo092HAhWGefM5IJS0uOBDi7ZR9rEiOuS/t4=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=a0Mjr/EjB7RRLoChquv68vGpmFSSFNQAXKD0QCza4qbjA8hUJuh1IOyEgOwIx2xNk oJJrJV223x2H4obK+M//FcCwBR+osfLwF4HLg+3Cfm8juhdDOEH5s8cy8Meyfx/Bx2 1SyugRQObB0qvYqLgaKs8Lzwwxq4/no8TQDhE4ndf+0Xfe6OEMF7uo5YU6TXUJr23l 4xQc4rBdOyAWSgvRyF5/pdxZxV694+85eVbP6EIkqkT1I0H2QgfZDZa8vCCuLhZQJ8 3gZFtv8TssWcbJE65EZUhzX2kFY2Hlp6w1s5gzHgY0PtpVR/SoVEwhEa0llYtNymab 4zpY/f2qYuyrQ== Date: Thu, 15 Feb 2024 14:25:55 +0000 From: "Paul A. Patience" Message-ID: <6c2fafee4c064a64bc918781c106d4e67732d45d.1708006480.git.paul@apatience.com> Feedback-ID: 19227857:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.47 X-Spam-Score: -1.47 X-Migadu-Queue-Id: 44C261198D X-Migadu-Scanner: mx13.migadu.com X-TUID: OZDqKgF8zsvy * gnu/packages/cpp.scm (type-safe): New variable. Change-Id: I96a690b41af78e331744daacba1cf5ee77f8257a --- This patch addresses the issue raised by Skylar Ferris. gnu/packages/cpp.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 2456de5002..f7e502d1bf 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -3074,3 +3074,63 @@ (define-public debug-assert @code{DEBUG_ASSERT()} macro, which among other features can be selectively enabled in different parts of your code.") (license license:zlib)))) + +(define-public type-safe + (package + (name "type-safe") + (version "0.2.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/foonathan/type_safe") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0ijd5grkbzfcmkqydka5ncl7ab4rc3307qr0ywwgzqsifr3ks0fd")) + (modules '((guix build utils))) + ;; Remove bundled debug_assert. + ;; Keep external/external.cmake because it enables + ;; TYPE_SAFE_HAS_IMPORTED_TARGETS, required for installing the CMak= e + ;; config files. + (snippet #~(delete-file-recursively "external/debug_assert")))) + (build-system cmake-build-system) + (arguments + (list #:configure-flags + #~(list "-DTYPE_SAFE_BUILD_TEST_EXAMPLE=3DON" + "-DTYPE_SAFE_BUILD_DOC=3DOFF") ; needs standardese + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-dependencies + (lambda _ + (substitute* + (list "include/type_safe/detail/assert.hpp" + "include/type_safe/detail/force_inline.hpp") + (("#include ") + (string-append "#include <" + #$(this-package-input "debug-assert") + "/include/debug_assert.hpp>"))) + (substitute* "test/CMakeLists.txt" + (("^if\\(NOT EXISTS .*/catch\\.hpp\\)") "if(FALSE)") + (("^(target_include_directories\\(type_safe_test) .*" + all prefix) + (string-append all prefix " PRIVATE \"" + #$(this-package-native-input "catch2"= ) + "/include/catch2\")\n"))))) + (add-after 'install 'fix-cmake-config + (lambda _ + (substitute* (string-append + #$output + "/lib/cmake/type_safe/type_safe-config.cm= ake") + (("^(find_dependency\\(debug_assert)\\)" _ prefix) + (string-append prefix " PATHS \"" + #$(this-package-input "debug-assert") + "/lib/cmake/debug_assert\")")))))))) + (native-inputs (list catch2)) + (inputs (list debug-assert)) + (home-page "https://github.com/foonathan/type_safe") + (synopsis "C++ abstractions for preventing bugs via the type system") + (description "type_safe is a C++ header-only library which provides +abstractions for defining more appropriate types, thus allowing C++'s type +system to prevent more bugs.") + (license license:expat))) base-commit: 0191a95edf076b5cd24326d49e54ce13f2bdb0d4 --=20 2.41.0