From patchwork Fri Oct 7 15:21:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43204 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 A53E427BBEA; Fri, 7 Oct 2022 17:37:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 4B33F27BBE9 for ; Fri, 7 Oct 2022 17:37:45 +0100 (BST) Received: from localhost ([::1]:42136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogqM4-0002te-1u for patchwork@mira.cbaines.net; Fri, 07 Oct 2022 12:37:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogpBo-0002VV-1q for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogpBn-0005q7-Oi for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogpBn-0005oM-Jd for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v2 05/13] gnu: Add optionparser. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 15:23:03 +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.166515613122152 (code B ref 58261); Fri, 07 Oct 2022 15:23:03 +0000 Received: (at 58261) by debbugs.gnu.org; 7 Oct 2022 15:22:11 +0000 Received: from localhost ([127.0.0.1]:37165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogpAw-0005l9-Ue for submit@debbugs.gnu.org; Fri, 07 Oct 2022 11:22:11 -0400 Received: from mout01.posteo.de ([185.67.36.65]:34415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogpAs-0005j8-1W for 58261@debbugs.gnu.org; Fri, 07 Oct 2022 11:22:06 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7CCD6240027 for <58261@debbugs.gnu.org>; Fri, 7 Oct 2022 17:22:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665156120; bh=/c7J4GMpg3EpigGCGZauj5uHD1O8xyh2KTKaI4b9bmY=; h=From:To:Cc:Subject:Date:From; b=O0OgDJ57WpzKDQ3QUaAlDEIMNP+gtZsWoJF4dunBCsi7BjOAN0JI637hsqkOetZJc NnB435EBnoO60C5V7fgJEX2GsWALzLmZxRhpvHx8AOS9MDNqy3y4tEUw540pWsH185 dcM3siQyCATvWjb2aCZNN4HhzfbZy6UbQxHLxv/vFZwvokJdq5ii4GG21fkN71kG1b 77IotxHpzAlrMzKd8HOE/oKlhgoKMYEBnQ3bxu4MRe99klk7EFcRys018STZOB2ANT VFG5Dh5ybcvvJcjwPUksi2egpQzViX51+Lm0Yo7et4Kz+jWXyQVJgC6NM8dQ46JVWe tEHeSGfknc7Mg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MkX940CRVz6tmq; Fri, 7 Oct 2022 17:22:00 +0200 (CEST) From: David Elsing Date: Fri, 7 Oct 2022 15:21:42 +0000 Message-Id: <20221007152148.32591-6-david.elsing@posteo.net> In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cpp.scm (optionparser): New variable. --- gnu/packages/cpp.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index e99fdcecd8..d1c580a1fc 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2092,3 +2092,50 @@ (define-public tinydir (description "@code{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")))) + (outputs '("out" "doc")) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'chdir + (lambda _ (chdir "src"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (begin + (invoke "./example_arg") + (invoke "./testparse") + (invoke "./testprintusage") + (invoke "./testodr") + (invoke "./example"))))) + (replace 'install + (lambda _ + (install-file "optionparser.h" (string-append #$output "/include")))) + (add-after 'install 'install-doc + (lambda _ + (copy-recursively + "../html" + (string-append #$output:doc "/share/doc/optionparser/html"))))))) + (native-inputs (list doxygen)) + (home-page "https://optionparser.sourceforge.net/") + (synopsis "Header-only C++ library to parse command line options") + (description "This library can be used to handle the command line +arguments of a C++ program. 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)))