From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6OrUNPwxOmMS0QAAbAwnHQ (envelope-from ) for ; Mon, 03 Oct 2022 02:51:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4CDuM/wxOmP3mgAAG6o9tA (envelope-from ) for ; Mon, 03 Oct 2022 02:51:08 +0200 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 8CCA8DFC1 for ; Mon, 3 Oct 2022 02:51:08 +0200 (CEST) Received: from localhost ([::1]:54420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of9fn-0001DS-QA for larch@yhetil.org; Sun, 02 Oct 2022 20:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of9Ci-0007se-GF for guix-patches@gnu.org; Sun, 02 Oct 2022 20:21:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49313) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1of9Ci-0001y2-6E for guix-patches@gnu.org; Sun, 02 Oct 2022 20:21:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1of9Ci-00074L-1Z for guix-patches@gnu.org; Sun, 02 Oct 2022 20:21:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH 05/11] gnu: Add optionparser. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Oct 2022 00:21:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58261 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58261@debbugs.gnu.org Cc: David Elsing Received: via spool by 58261-submit@debbugs.gnu.org id=B58261.166475641727011 (code B ref 58261); Mon, 03 Oct 2022 00:21:04 +0000 Received: (at 58261) by debbugs.gnu.org; 3 Oct 2022 00:20:17 +0000 Received: from localhost ([127.0.0.1]:48371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of9Bw-00071Q-BB for submit@debbugs.gnu.org; Sun, 02 Oct 2022 20:20:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]:34411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of9Bs-000704-AV for 58261@debbugs.gnu.org; Sun, 02 Oct 2022 20:20:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CE6E724010A for <58261@debbugs.gnu.org>; Mon, 3 Oct 2022 02:20:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1664756406; bh=gYnMOh2FiyERh7dOyYlCmlD+UqV1KYV3gyVbsNS0gh4=; h=From:To:Cc:Subject:Date:From; b=LjJAsBqw5Um9KwUr2cKg2D7RjOd1lCVTWSVyOl0h6yiOYkvJSC2Tl1uB681BP92Ht +1wFXaNB3K4raB8mT9Az2vtL6lFQ/arCoN8UtBLkwMWkzgeSIPv9FdR8dNoXKvLTiW Rt4Oel+V/YjbVPMw0ekrOJo7r8VhkVoqUJGFbv8BQPFs3wp+v0J+i5+yz9CF0+J/kv gr5W2IK9HrAVyCiHMt98/yjDRvHj9URu84pO+IB4G3RYcMn0yreQ7yF2TGx7511IIi 7wFHRZk+RkbO8sQJoJ6jx2mqSXlRz1wQT5t+DIDIO3mUW3t/WuRFwQb8rJKpsvjPgc x2cyVZqwPlUdw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MghLG3JVxz6tmX; Mon, 3 Oct 2022 02:20:06 +0200 (CEST) From: David Elsing Date: Mon, 3 Oct 2022 00:19:50 +0000 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 02 Oct 2022 20:50:23 -0400 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=1664758268; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=X7AMFvvD0N/ZbI7qFjGYRpodX/9ExPt9mElJbIe/4qY=; b=uPoYo9PyHaUk2PLxYyu12xs2zJiZIVLSOTDDDonf1nUacFkMxPD5lhHQ4k1a9eBVqv+KGV BE2vEQMuKWEc8nYjli1JWoTOoDcTf+VZRWt1FaDSgGtTSuCdd296vpq65ymgi9KVzM8rV4 x+7Byxr45wMgcpJMIvafdVrVkZYazfy/IukWT10159jco4n+daKCnUQ8/9lp3fhzKTbM7k wtCXOcvFw9frTrRuODCvS4JEKbkg1w/nv38z5MlZ7kFjbEkzQ6mstOR7+uLfAcWUvM3OY1 5XmDo1dX56sU0STMwc/ZQFho3f8XIKywG4r7PtkiFnTCWtSeuItr0qzRztYJ0g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664758268; a=rsa-sha256; cv=none; b=fwS6veXNlkOyztTuNlZXbHCSUiCk09bobjFruCHyB6Be+ttd1YAw8xxst/BgJlZfqSlCau ey2X7uqAzqoQrSh7asaIj6EQE2GzsKP3zF3iQHHzN1qDykmiCdlXjAddUgMEaRXZwReyzH qwXIUNO3BJalsWT+Gf37XNfmdb+/Xd3vntYYi7Ug7uVaMv8Jn6JzmsUHarSsjRvUr1ZaQk EXsyXrXj65TpyIyJioywOHuyLO5XOM1+s+eu5fdTM6KmxeeczcpjFmm85X3Nb6QjkOAIz7 3QY0veBEV8O2531oqNabPfMbzZ0N74KXfYCZsRzSGUK//oT2XiOto4XnVkFNPA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=LjJAsBqw; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=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: 7.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=LjJAsBqw; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=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: 8CCA8DFC1 X-Spam-Score: 7.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: z2Inz0oQIj15 * gnu/packages/cpp.scm (optionparser): New variable. --- gnu/packages/cpp.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 4819f36052..b30205109e 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2058,3 +2058,53 @@ (define-public tinydir (description "tinydir is a header-only C library to portably read files and directories.") (license license:bsd-2))) + +(define-public optionparser + (package + (name "optionparser") + (version "1.7") + (source (origin + (method url-fetch) + (uri + (string-append "mirror://sourceforge/optionparser/optionparser-" + version ".tar.gz")) + (sha256 + (base32 + "04gfxrdzwacaynb8scsz6rr7nh64n6yk6w9dh2qdhrxw4caqr0dk")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'chdir + (lambda _ (chdir "src") #t)) + (replace 'build + (lambda _ + (invoke "make" "-j" (number->string (parallel-job-count)) + "example_arg" "testparse" "testprintusage" "testodr" + "example") + #t)) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (begin + (invoke "./example_arg") + (invoke "./testparse") + (invoke "./testprintusage") + (invoke "./testodr") + (invoke "./example")) + (format #t "test suite not run~%")))) + (replace 'install + (lambda _ + (install-file "optionparser.h" (string-append #$output "/include")) + #t)) + (add-after 'install 'chdir-back + (lambda _ (chdir "..") #t))))) + (home-page "https://optionparser.sourceforge.net/") + (synopsis "Header-only C++ library to parse command line options") + (description "The Lean Mean C++ Option Parser handles the program's +command line arguments (argc, argv). It supports the short and long option +formats of getopt(), getopt_long() and getopt_long_only() but has a more +convenient interface.") + (license license:expat))) -- 2.37.0