From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sFZ9DeH+1GUrcAEA62LTzQ:P1 (envelope-from ) for ; Tue, 20 Feb 2024 20:34:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sFZ9DeH+1GUrcAEA62LTzQ (envelope-from ) for ; Tue, 20 Feb 2024 20:34:57 +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=cLx9uVR0; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708457697; 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=mjdr2Qiz5+akJ2ZE3A4FraIo/dnAxo1XBtHaVxF6VQ0=; b=TzCHd2JDaibZ68GES58qxkl5rOt3gATnPJrw7kiACpEBvPXMVyVxZ4xjPCTO015WEcbRk1 pVqw9Axo0qvgap1op9p181sglgu3/EFOlzgFQB/GgwDVF0sXdwnNlbxUb4EDpWqCEm1uQx EREXS5kgQ9ZX+wnEm6DiTOi4uMVXGjh3SOnN1s3SeAJ50cwNEzsrR7ZSljDiFKywO54UQI XoHV40YmBhZdZzjZNYeeqIO8zVAVX2A80HiN3QaJg+FakFRi99V9GHALpz+urD94cQuCoc nvMRxMoaEGzQFFxt7kT9aVG//qIkKFEDVrUgDaWMVP96VVT1xOXLJsI3HOK7cg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=apatience.com header.s=protonmail2 header.b=cLx9uVR0; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708457697; a=rsa-sha256; cv=none; b=TYdxQjnslXJg2gr3bynG3izXvLSEmrfslIagUsKjqm28NV2tzoEXosKij98HaXJeUFUecL DGhUM99jv2l+6uDUMl4bfKua16vhE1aS305jZOeYTofTraWXRoSZZ2UpBfMJ/xFZsGn87v U/1aMiEqVx3/bbjuPIK16SnaKjdmY1C2pD+aK7WhokCgd10tuvUw2GjivJX46bSYIZtWwm HhusSpRVdx/yqExe3vJ38w7c6ZHAxo27Xyrp4cJnM2kajojmoAtRXTAmLGJJjqmVvQwc5z ndMUS1Xe5AfaQTTKIRbomrDwS1FVGopFi3KUzDMH8C9yx0WFo72OG2NNvqX0kg== 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 84F1E21863 for ; Tue, 20 Feb 2024 20:34:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcVtA-0007cW-82; Tue, 20 Feb 2024 14:34:48 -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 1rcVt5-0007Rr-5o for guix-patches@gnu.org; Tue, 20 Feb 2024 14:34:44 -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 1rcVt3-0007z4-LN for guix-patches@gnu.org; Tue, 20 Feb 2024 14:34:42 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcVtP-0002KW-Ez for guix-patches@gnu.org; Tue, 20 Feb 2024 14:35:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69126] [PATCH v3 2/2] gnu: Add type-safe. Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Feb 2024 19:35:03 +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.17084576688891 (code B ref 69126); Tue, 20 Feb 2024 19:35:03 +0000 Received: (at 69126) by debbugs.gnu.org; 20 Feb 2024 19:34:28 +0000 Received: from localhost ([127.0.0.1]:46600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcVsp-0002JK-Nk for submit@debbugs.gnu.org; Tue, 20 Feb 2024 14:34:28 -0500 Received: from mail-4323.proton.ch ([185.70.43.23]:61727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcVsn-0002J4-2L for 69126@debbugs.gnu.org; Tue, 20 Feb 2024 14:34:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail2; t=1708457637; x=1708716837; bh=mjdr2Qiz5+akJ2ZE3A4FraIo/dnAxo1XBtHaVxF6VQ0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=cLx9uVR0B8lV45GTifQ2VZBpJfkoCtMwcU25GLVfc5Jww2/Xq4FLmJ7O5Gf1uPuCx xIbcZLg69EUZ+HVtmKFVYI7tJoSuET/oneNWSua/GrFNUZ6CrfTu4N3fWS1QDbGnJ/ cwrTrODQ+t3Fl66p6FN0TPYBBvJmOTwh64OSdiKcsKU0kZrPcwCdHnhv8q5d2Y7CeE XWVzRIVjkQklKrqtIZYAnx/J+FJ2dRDEB1fYKWcFAjrVpceqtBXRDttjDNX+Cf2reK XYFQjXFTrdtIPi+CX5W41NtCwkTqPUiJIyWfN5eaOc4zfDb+oxATDlxySrREYtzleR TjYW6VDyZLgjg== Date: Tue, 20 Feb 2024 19:33:33 +0000 From: "Paul A. Patience" Message-ID: <6c2fafee4c064a64bc918781c106d4e67732d45d.1708457406.git.paul@apatience.com> In-Reply-To: References: 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-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -2.61 X-Spam-Score: -2.61 X-Migadu-Queue-Id: 84F1E21863 X-TUID: MlX/CTp5q34W * gnu/packages/cpp.scm (type-safe): New variable. Change-Id: I96a690b41af78e331744daacba1cf5ee77f8257a --- 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))) --=20 2.41.0