| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2016, 2019 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net> |
| 4 | ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
| 5 | ;;; |
| 6 | ;;; This file is part of GNU Guix. |
| 7 | ;;; |
| 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 9 | ;;; under the terms of the GNU General Public License as published by |
| 10 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 11 | ;;; your option) any later version. |
| 12 | ;;; |
| 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | ;;; GNU General Public License for more details. |
| 17 | ;;; |
| 18 | ;;; You should have received a copy of the GNU General Public License |
| 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | (define-module (gnu packages popt) |
| 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix download) |
| 24 | #:use-module (guix git-download) |
| 25 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (guix build-system cmake) |
| 27 | #:use-module (guix licenses) |
| 28 | #:use-module (gnu packages texinfo)) |
| 29 | |
| 30 | (define-public argtable |
| 31 | (package |
| 32 | (name "argtable") |
| 33 | (version "2.13") |
| 34 | (source (origin |
| 35 | (method url-fetch) |
| 36 | (uri (string-append |
| 37 | "mirror://sourceforge/argtable/argtable/" |
| 38 | "argtable-" version "/argtable" |
| 39 | (string-join (string-split version #\.) "-") |
| 40 | ".tar.gz")) |
| 41 | (sha256 |
| 42 | (base32 |
| 43 | "1gyxf4bh9jp5gb3l6g5qy90zzcf3vcpk0irgwbv1lc6mrskyhxwg")))) |
| 44 | (build-system gnu-build-system) |
| 45 | (home-page "http://argtable.sourceforge.net/") |
| 46 | (synopsis "Command line option parsing library") |
| 47 | (description |
| 48 | "Argtable is an ANSI C library for parsing GNU style command line |
| 49 | options. It enables a program's command line syntax to be defined in the |
| 50 | source code as an array of argtable structs. The command line is then parsed |
| 51 | according to that specification and the resulting values are returned in those |
| 52 | same structs where they are accessible to the main program. Both tagged (-v, |
| 53 | --verbose, --foo=bar) and untagged arguments are supported, as are multiple |
| 54 | instances of each argument. Syntax error handling is automatic and the library |
| 55 | also provides the means for generating a textual description of the command |
| 56 | line syntax.") |
| 57 | (license lgpl2.0+))) |
| 58 | |
| 59 | (define-public popt |
| 60 | (package |
| 61 | (name "popt") |
| 62 | (version "1.18") |
| 63 | (source (origin |
| 64 | (method url-fetch) |
| 65 | (uri (string-append "http://ftp.rpm.org/popt/releases" |
| 66 | "/popt-1.x/popt-" version ".tar.gz")) |
| 67 | (sha256 |
| 68 | (base32 |
| 69 | "1lf5zlj5rbg6s4bww7hbhpca97prgprnarx978vcwa0bl81vqnai")))) |
| 70 | (build-system gnu-build-system) |
| 71 | (arguments |
| 72 | '(#:phases |
| 73 | (modify-phases %standard-phases |
| 74 | (add-before 'configure 'patch-test |
| 75 | (lambda _ |
| 76 | (substitute* "tests/test-poptrc.in" |
| 77 | (("/bin/echo") (which "echo"))) |
| 78 | (substitute* "tests/testit.sh" ;don't expect old libtool names |
| 79 | (("lt-test1") "test1")) |
| 80 | #t))))) |
| 81 | (home-page "http://rpm5.org/files/popt/") |
| 82 | (synopsis "Command line option parsing library") |
| 83 | (description |
| 84 | "This is the popt(3) command line option parsing library. While it is |
| 85 | similar to getopt(3), it contains a number of enhancements, including: |
| 86 | |
| 87 | - popt is fully reentrant; |
| 88 | |
| 89 | - popt can parse arbitrary argv[] style arrays while getopt(3) makes this |
| 90 | quite difficult; |
| 91 | |
| 92 | - popt allows users to alias command line arguments; |
| 93 | |
| 94 | - popt provides convenience functions for parsing strings into argv[] style |
| 95 | arrays.") |
| 96 | (license x11))) |
| 97 | |
| 98 | (define-public gflags |
| 99 | (package |
| 100 | (name "gflags") |
| 101 | (version "2.2.2") |
| 102 | (source |
| 103 | (origin |
| 104 | (method git-fetch) |
| 105 | (uri (git-reference |
| 106 | (url "https://github.com/gflags/gflags") |
| 107 | (commit (string-append "v" version)))) |
| 108 | (sha256 |
| 109 | (base32 "147i3md3nxkjlrccqg4mq1kyzc7yrhvqv5902iibc7znkvzdvlp0")) |
| 110 | (file-name (git-file-name name version)))) |
| 111 | (build-system cmake-build-system) |
| 112 | (arguments |
| 113 | '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" |
| 114 | "-DBUILD_TESTING=ON"))) |
| 115 | (home-page "https://gflags.github.io/gflags/") |
| 116 | (synopsis "C++ library for command-line argument parsing") |
| 117 | (description |
| 118 | "Gflags is a C++ library to parse command-line flags. It differs from |
| 119 | other such libraries in that command-line flag definitions can be scattered |
| 120 | around the source code, and not just listed in one place such as @code{main}. |
| 121 | This means that a single source-code file will define and use flags that are |
| 122 | meaningful to that file. Any application that links in that file will get the |
| 123 | flags, and the gflags library will automatically handle that flag |
| 124 | appropriately.") |
| 125 | (license bsd-3))) |
| 126 | |
| 127 | (define-public gengetopt |
| 128 | (package |
| 129 | (name "gengetopt") |
| 130 | (version "2.23") |
| 131 | (source |
| 132 | (origin |
| 133 | (method url-fetch) |
| 134 | (uri (string-append "mirror://gnu/gengetopt/gengetopt-" |
| 135 | version ".tar.xz")) |
| 136 | (sha256 |
| 137 | (base32 |
| 138 | "1b44fn0apsgawyqa4alx2qj5hls334mhbszxsy6rfr0q074swhdr")))) |
| 139 | (build-system gnu-build-system) |
| 140 | (arguments |
| 141 | `(#:parallel-build? #f ; not supported |
| 142 | #:parallel-tests? #f)) ; likewise |
| 143 | (native-inputs |
| 144 | `(("texinfo" ,texinfo))) |
| 145 | (synopsis "Create parsers for command line options") |
| 146 | (description |
| 147 | "GNU Gengetopt is a program to generate a C/C++ function for parsing |
| 148 | command-line options using the getopt_long function found in GNU |
| 149 | libc, removing some of the tedium of this task for large programs |
| 150 | that accept many options. The options parsed by the generated |
| 151 | function may be in both short (e.g., \"-h\") and long (\"--help\") |
| 152 | formats, as specified by the GNU coding standards. Additionally, the |
| 153 | output of the standard options \"--help\" and \"--version\" is generated |
| 154 | automatically.") |
| 155 | (home-page "https://www.gnu.org/software/gengetopt/gengetopt.html") |
| 156 | (license gpl3+))) |