Commit | Line | Data |
---|---|---|
df77a462 | 1 | ;;; GNU Guix --- Functional package management for GNU |
02dad49d | 2 | ;;; Copyright © 2013, 2014, 2016, 2019 Ludovic Courtès <ludo@gnu.org> |
ba6a996e | 3 | ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net> |
7f5c74d1 | 4 | ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
df77a462 LC |
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) | |
400457af | 24 | #:use-module (guix git-download) |
df77a462 | 25 | #:use-module (guix build-system gnu) |
4b4e1b4b | 26 | #:use-module (guix build-system cmake) |
02dad49d LC |
27 | #:use-module (guix licenses) |
28 | #:use-module (gnu packages texinfo)) | |
df77a462 | 29 | |
9495e736 RW |
30 | (define-public argtable |
31 | (package | |
32 | (name "argtable") | |
33 | (version "2.13") | |
34 | (source (origin | |
35 | (method url-fetch) | |
36 | (uri (string-append | |
de67e922 LF |
37 | "mirror://sourceforge/argtable/argtable/" |
38 | "argtable-" version "/argtable" | |
9495e736 RW |
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 | ||
df77a462 LC |
59 | (define-public popt |
60 | (package | |
61 | (name "popt") | |
62 | (version "1.16") | |
63 | (source (origin | |
64 | (method url-fetch) | |
98ca002a MB |
65 | (uri (list (string-append "http://rpm5.org/files/popt/popt-" |
66 | version ".tar.gz") | |
67 | ;; The rpm5.org domain does not resolve since 2019-06-13, | |
68 | ;; so fallback to Debians copy. | |
69 | (string-append "https://deb.debian.org/debian/pool/main" | |
70 | "/p/popt/popt_" version ".orig.tar.gz"))) | |
981bd6e6 MB |
71 | ;; Ensure the file name stays the same. |
72 | (file-name (string-append "popt-" version ".tar.gz")) | |
df77a462 LC |
73 | (sha256 |
74 | (base32 | |
75 | "1j2c61nn2n351nhj4d25mnf3vpiddcykq005w2h6kw79dwlysa77")))) | |
76 | (build-system gnu-build-system) | |
77 | (arguments | |
dc1d3cde KK |
78 | '(#:phases |
79 | (modify-phases %standard-phases | |
80 | (add-before 'configure 'patch-test | |
81 | (lambda _ | |
82 | (substitute* "test-poptrc.in" | |
83 | (("/bin/echo") (which "echo"))) | |
84 | (substitute* "testit.sh" ; don't expect old libtool names | |
85 | (("lt-test1") "test1")) | |
86 | #t))))) | |
07af3e5e | 87 | (home-page "http://rpm5.org/files/popt/") |
df77a462 LC |
88 | (synopsis "Command line option parsing library") |
89 | (description | |
90 | "This is the popt(3) command line option parsing library. While it is | |
91 | similar to getopt(3), it contains a number of enhancements, including: | |
92 | ||
93 | - popt is fully reentrant; | |
94 | ||
95 | - popt can parse arbitrary argv[] style arrays while getopt(3) makes this | |
96 | quite difficult; | |
97 | ||
98 | - popt allows users to alias command line arguments; | |
99 | ||
100 | - popt provides convience functions for parsing strings into argv[] style | |
101 | arrays.") | |
102 | (license x11))) | |
4b4e1b4b LC |
103 | |
104 | (define-public gflags | |
105 | (package | |
106 | (name "gflags") | |
7f5c74d1 | 107 | (version "2.2.2") |
400457af TGR |
108 | (source |
109 | (origin | |
110 | (method git-fetch) | |
111 | (uri (git-reference | |
112 | (url "https://github.com/gflags/gflags.git") | |
113 | (commit (string-append "v" version)))) | |
114 | (sha256 | |
115 | (base32 "147i3md3nxkjlrccqg4mq1kyzc7yrhvqv5902iibc7znkvzdvlp0")) | |
116 | (file-name (git-file-name name version)))) | |
4b4e1b4b LC |
117 | (build-system cmake-build-system) |
118 | (arguments | |
119 | '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" | |
120 | "-DBUILD_TESTING=ON"))) | |
121 | (home-page "https://gflags.github.io/gflags/") | |
122 | (synopsis "C++ library for command-line argument parsing") | |
123 | (description | |
124 | "Gflags is a C++ library to parse command-line flags. It differs from | |
125 | other such libraries in that command-line flag definitions can be scattered | |
126 | around the source code, and not just listed in one place such as @code{main}. | |
127 | This means that a single source-code file will define and use flags that are | |
128 | meaningful to that file. Any application that links in that file will get the | |
129 | flags, and the gflags library will automatically handle that flag | |
130 | appropriately.") | |
131 | (license bsd-3))) | |
ba6a996e RW |
132 | |
133 | (define-public gengetopt | |
134 | (package | |
135 | (name "gengetopt") | |
02dad49d | 136 | (version "2.23") |
ba6a996e RW |
137 | (source |
138 | (origin | |
139 | (method url-fetch) | |
140 | (uri (string-append "mirror://gnu/gengetopt/gengetopt-" | |
02dad49d | 141 | version ".tar.xz")) |
ba6a996e RW |
142 | (sha256 |
143 | (base32 | |
02dad49d | 144 | "1b44fn0apsgawyqa4alx2qj5hls334mhbszxsy6rfr0q074swhdr")))) |
ba6a996e RW |
145 | (build-system gnu-build-system) |
146 | (arguments | |
7d1986c4 MB |
147 | `(#:parallel-build? #f ; not supported |
148 | #:parallel-tests? #f)) ; likewise | |
02dad49d LC |
149 | (native-inputs |
150 | `(("texinfo" ,texinfo))) | |
ba6a996e RW |
151 | (synopsis "Create parsers for command line options") |
152 | (description | |
153 | "GNU Gengetopt is a program to generate a C/C++ function for parsing | |
154 | command-line options using the getopt_long function found in GNU | |
155 | libc, removing some of the tedium of this task for large programs | |
156 | that accept many options. The options parsed by the generated | |
157 | function may be in both short (e.g., \"-h\") and long (\"--help\") | |
158 | formats, as specified by the GNU coding standards. Additionally, the | |
159 | output of the standard options \"--help\" and \"--version\" is generated | |
160 | automatically.") | |
6fd52309 | 161 | (home-page "https://www.gnu.org/software/gengetopt/gengetopt.html") |
ba6a996e | 162 | (license gpl3+))) |