From patchwork Fri Nov 4 20:25:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 44309 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0674F27BBEA; Fri, 4 Nov 2022 20:26:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9584927BBE9 for ; Fri, 4 Nov 2022 20:26:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1or3GQ-0007Cl-2q; Fri, 04 Nov 2022 16:26:06 -0400 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 1or3GN-0007C8-5c for guix-patches@gnu.org; Fri, 04 Nov 2022 16:26:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1or3GM-0001Uf-Pe for guix-patches@gnu.org; Fri, 04 Nov 2022 16:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1or3GM-0003SK-Kr for guix-patches@gnu.org; Fri, 04 Nov 2022 16:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59024] [PATCH] gnu: Add safeint. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Nov 2022 20:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59024 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59024@debbugs.gnu.org Cc: Antero Mejr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166759353613250 (code B ref -1); Fri, 04 Nov 2022 20:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Nov 2022 20:25:36 +0000 Received: from localhost ([127.0.0.1]:54930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1or3Fv-0003Rd-Uv for submit@debbugs.gnu.org; Fri, 04 Nov 2022 16:25:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:39582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1or3Ft-0003RV-U6 for submit@debbugs.gnu.org; Fri, 04 Nov 2022 16:25:34 -0400 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 1or3Ft-0006zM-CE for guix-patches@gnu.org; Fri, 04 Nov 2022 16:25:33 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1or3Fp-0001Rf-4o for guix-patches@gnu.org; Fri, 04 Nov 2022 16:25:32 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4N3sZB6Zx0z9sWV for ; Fri, 4 Nov 2022 21:25:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1667593522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tAwWXwVjDhDtVygO5V7LwkiB0fwc+ro9wrWRosVGCAo=; b=JQLqRkEkKS6ksxCjTDl4YnZO7q3TZRXMTHnRh/8j4ThNtiwdGnmmPwcz5knLhegrNGV455 v3NhYahJJfOWgz9gm6G1hjngkR+ds3wwUk+DHv/SQu97sfYKvEGdTdsTR1seL0798Dmmc4 CU029KLsB9vrqiPksnWtW36FhUyp4uvVZAkfAWhTqPcrkHAvADzNZ8B8U/4c73ZACoFA+x oAYjVeDjS7vZobzkG0T5cWNkZ9XnDRLcWQH4VksosDDV/+Cf9MeiCA2F1MR7q0arLLedtv UYBIZvYG2zMI8ExE72XqP+SG2GVZq7ITzEMAu2Pa1pcg2HiP2m5b1mksOwgkXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1667593520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tAwWXwVjDhDtVygO5V7LwkiB0fwc+ro9wrWRosVGCAo=; b=e/DDdnmWx268qlwJ59BKlEiUOpAb8yrnWGEKGZ17ilIh+n4LXLDhr696yJHn7RJbBxferV GJr6PxCZrdwAr5yIQj8Gv2l3qtvgX7VrMroatPmpLn1fTab81su230tKke29cM4+2ap2JH DQhoHvIvomOLurSLxS26ptQt/gE5/HP7WhNmcWfaZtwivEMlQ+kYjQXDfC25hJdioHxGcO KHzT2UKz+3Kia06jYpvIbaFyig0s9Te+TDj6nHX9oi4t4R7uJVDwW5I8dNc32klszFMR+a zJx6NNz2rulvCKyyRPJ3APyR4yxshT6jUZ/fp4eOjImVtnk05iGJRDdUPYBZmA== Date: Fri, 4 Nov 2022 20:25:12 +0000 Message-Id: <20221104202512.6140-1-antero@mailbox.org> MIME-Version: 1.0 X-MBO-RS-ID: 39dfabf1d5b7a569d43 X-MBO-RS-META: xigap1drjaua41iwyyjmd7zjyh7n9p6m X-Rspamd-Queue-Id: 4N3sZB6Zx0z9sWV Received-SPF: pass client-ip=80.241.56.171; envelope-from=antero@mailbox.org; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Sender: "Guix-patches" Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches X-Patchwork-Original-From: Antero Mejr via Guix-patches via From: Antero Mejr Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cpp.scm (safeint): New variable. --- gnu/packages/cpp.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 470f404066..4d58e01fa8 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2166,3 +2166,42 @@ (define-public optionparser command line options. It supports the short and long option formats of getopt(), getopt_long() and getopt_long_only().") (license license:expat))) + +(define-public safeint + (package + (name "safeint") + (version "3.0.27") + (home-page "https://github.com/dcleblanc/SafeInt") + (source (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "01d2dpdhyw3lghmamknb6g39w2gg0sv53pgxlrs2la8h694z6x7s")))) + (build-system cmake-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (replace 'install + (lambda _ + (let ((include-dir (string-append #$output + "/include"))) + (with-directory-excursion "../source" + (install-file "SafeInt.hpp" include-dir) + (install-file "safe_math.h" include-dir) + (install-file "safe_math_impl.h" include-dir))))) + (add-after 'install 'install-doc + (lambda _ + (let ((doc-dir (string-append #$output + "/share/doc/safeint"))) + (with-directory-excursion "../source" + (install-file "helpfile.md" doc-dir)))))))) + (synopsis "C and C++ library for managing integer overflows") + (description + "SafeInt is a class library for C++ that manages integer overflows. It +also includes a C library that checks casting, multiplication, division, +addition and subtraction for all combinations of signed and unsigned 32-bit and +64-bit integers.") + (license license:expat)))