From patchwork Thu Oct 13 21:04:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43390 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 A13CD27BBEA; Thu, 13 Oct 2022 22:07:50 +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=-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=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 5D2AA27BBE9 for ; Thu, 13 Oct 2022 22:07:50 +0100 (BST) Received: from localhost ([::1]:42684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Qj-0005fa-H8 for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032O-Db for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P1-0007Ue-Pq for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P1-0005mq-Km for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 06/15] gnu: Add optionparser. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06: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.166569511522086 (code B ref 58261); Thu, 13 Oct 2022 21:06:03 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:15 +0000 Received: from localhost ([127.0.0.1]:35145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OF-0005k4-3k for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:15 -0400 Received: from mout02.posteo.de ([185.67.36.66]:34859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nv-0005hE-Qe for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5305B240101 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695090; bh=+HDnWYXbih95168h1mcdHXf9NLtQInYIOnII2JH5StA=; h=From:To:Cc:Subject:Date:From; b=Z/EcqLQyhKXhl+bA7XBXZEbYxngfRVbcj4y3CyRmrmei7IEdZxB5q8LwPgNdnAiB7 yM3p7LXVXK1JdLF2QzCj4lzX8BSHdUL8jOgZlG+FHL5Q+qp4JV5LEsZfOnVeyicMC0 7SnY8LQagxWBC1ENWrFUovFXuiXFFNfwSnlwWQuGIzzA7dOTL92taYU0SXNgUGABbV do8UHqtIriV/OA274BSgp4+EjGfHJCpTgkHJ4B7UVdRiI5+DfnsTpQpkG6UqzdeNcD MMcxhbs+uYnh3+8lOuHPtXcy2hCahQqxJwqHmgRkjRZf4IFzAagx2J7iyzXYIt4PaM P/urRC6qXRYgw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTs6ZhHz6tmH; Thu, 13 Oct 2022 23:04:49 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:15 +0000 Message-Id: <20221013210424.993-7-david.elsing@posteo.net> In-Reply-To: <20221007152148.32591-1-david.elsing@posteo.net> References: <20221007152148.32591-1-david.elsing@posteo.net> 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 | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 7871660611..51d146476f 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2134,3 +2134,51 @@ (define-public tinydir (description "@code{tinydir} is a header-only C wrapper for listing directory contents.") (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)))