popt.scm 6.1 KB

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