summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2025-03-08 18:55:29 +0800
committer宋文武 <iyzsong@member.fsf.org>2025-03-11 10:46:21 +0800
commit58f9ac3b6d4f5567423ff27edb7e3c96ad113b5a (patch)
treebcf519b16fbb6be88f6bb6798244f2265b96dc63
parent704f9c4f5372253f885ad605c96e9a829a5e0323 (diff)
gnu: Add argparse.
* gnu/packages/c.scm (argparse): New variable. Change-Id: I846cf9229c44f6e40b07dc9f82cd0327ebd02fcb
-rw-r--r--gnu/packages/c.scm33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index bd5f8ac20f..8efb782811 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1020,6 +1020,39 @@ consist of a set of LALR(1) parsing tables and a driver routine written in the
C programming language.")
(license license:public-domain)))
+(define-public argparse
+ (package
+ (name "argparse")
+ (version "1.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cofyc/argparse")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0zb0b2aikk4dasjzsyiyf2xn1hbld8gf8np3843zcg9wbxydd8zd"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:test-target "test"
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (inc (string-append out "/include"))
+ (lib (string-append out "/lib")))
+ (install-file "argparse.h" inc)
+ (install-file "libargparse.so" lib)))))))
+ (synopsis "Command line arguments parsing library")
+ (home-page "https://github.com/cofyc/argparse")
+ (description
+ "This C library provides high-level arguments parsing solutions inspired
+by Python's @code{argparse} module.")
+ (license license:expat)))
+
(define-public aws-c-common
(package
(name "aws-c-common")