diff mbox series

[bug#58261,05/11] gnu: Add optionparser.

Message ID ee75f4c871c6ccf719e1da9108ae32d8e5f8e957.1664725832.git.david.elsing@posteo.net
State Accepted
Headers show
Series Add rdkit. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

David Elsing Oct. 3, 2022, 12:19 a.m. UTC
* gnu/packages/cpp.scm (optionparser): New variable.
---
 gnu/packages/cpp.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

Comments

Liliana Marie Prikler Oct. 4, 2022, 7:42 a.m. UTC | #1
Am Montag, dem 03.10.2022 um 00:19 +0000 schrieb David Elsing:
> * gnu/packages/cpp.scm (optionparser): New variable.
> ---
>  gnu/packages/cpp.scm | 50
> ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
> index 4819f36052..b30205109e 100644
> --- a/gnu/packages/cpp.scm
> +++ b/gnu/packages/cpp.scm
> @@ -2058,3 +2058,53 @@ (define-public tinydir
>      (description "tinydir is a header-only C library to portably
> read files
>  and directories.")
>      (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"))
The formattter doesn't know this, but I think in this case it might be
wiser to pull the "optionparser-" down a line on the same one with
version ".tar.gz"
> +              (sha256
> +               (base32
> +               
> "04gfxrdzwacaynb8scsz6rr7nh64n6yk6w9dh2qdhrxw4caqr0dk"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'configure)
> +          (add-before 'build 'chdir
> +            (lambda _ (chdir "src") #t))
> +          (replace 'build
> +            (lambda _
> +              (invoke "make" "-j" (number->string (parallel-job-
> count))
> +                      "example_arg" "testparse" "testprintusage"
> "testodr"
> +                      "example")
#:make-flags exist.  Also, this is a bad way to hide that you're
missing doxygen. 
> +              #t))
> +          (replace 'check
> +            (lambda* (#:key tests? #:allow-other-keys)
> +              (if tests?
> +                  (begin
> +                    (invoke "./example_arg")
> +                    (invoke "./testparse")
> +                    (invoke "./testprintusage")
> +                    (invoke "./testodr")
> +                    (invoke "./example"))
> +                  (format #t "test suite not run~%"))))
> +          (replace 'install
> +            (lambda _
> +              (install-file "optionparser.h" (string-append #$output
> "/include"))
> +              #t))
> +          (add-after 'install 'chdir-back
> +            (lambda _ (chdir "..") #t)))))
I'm pretty sure this shouldn't be needed.
> +    (home-page "https://optionparser.sourceforge.net/")
> +    (synopsis "Header-only C++ library to parse command line
> options")
> +    (description "The Lean Mean C++ Option Parser handles the
> program's
> +command line arguments (argc, argv).  It supports the short and long
> option
> +formats of getopt(), getopt_long() and getopt_long_only() but has a
> more
> +convenient interface.")
As always, cut down on the ads :)
> +    (license license:expat)))

Cheers
David Elsing Oct. 7, 2022, 3:11 p.m. UTC | #2
Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> writes:

> Am Montag, dem 03.10.2022 um 00:19 +0000 schrieb David Elsing:
>> * gnu/packages/cpp.scm (optionparser): New variable.
>> ---
>>  gnu/packages/cpp.scm | 50
>> ++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 50 insertions(+)
>> 
>> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
>> index 4819f36052..b30205109e 100644
>> --- a/gnu/packages/cpp.scm
>> +++ b/gnu/packages/cpp.scm
>> @@ -2058,3 +2058,53 @@ (define-public tinydir
>>      (description "tinydir is a header-only C library to portably
>> read files
>>  and directories.")
>>      (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"))
> The formattter doesn't know this, but I think in this case it might be
> wiser to pull the "optionparser-" down a line on the same one with
> version ".tar.gz"
Which formatter do you mean? Is it ok if I just use Emacs with the rules
in .dir-locals.el and guix lint? When I used guix style, lines sometimes
exceed 80 characters.
>> +              (sha256
>> +               (base32
>> +               
>> "04gfxrdzwacaynb8scsz6rr7nh64n6yk6w9dh2qdhrxw4caqr0dk"))))
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +     (list
>> +      #:phases
>> +      #~(modify-phases %standard-phases
>> +          (delete 'configure)
>> +          (add-before 'build 'chdir
>> +            (lambda _ (chdir "src") #t))
>> +          (replace 'build
>> +            (lambda _
>> +              (invoke "make" "-j" (number->string (parallel-job-
>> count))
>> +                      "example_arg" "testparse" "testprintusage"
>> "testodr"
>> +                      "example")
> #:make-flags exist.  Also, this is a bad way to hide that you're
> missing doxygen.
Oops, I don't remember why I did that, it is easier to just build the
documentation...
>> +              #t))
>> +          (replace 'check
>> +            (lambda* (#:key tests? #:allow-other-keys)
>> +              (if tests?
>> +                  (begin
>> +                    (invoke "./example_arg")
>> +                    (invoke "./testparse")
>> +                    (invoke "./testprintusage")
>> +                    (invoke "./testodr")
>> +                    (invoke "./example"))
>> +                  (format #t "test suite not run~%"))))
>> +          (replace 'install
>> +            (lambda _
>> +              (install-file "optionparser.h" (string-append #$output
>> "/include"))
>> +              #t))
>> +          (add-after 'install 'chdir-back
>> +            (lambda _ (chdir "..") #t)))))
> I'm pretty sure this shouldn't be needed.
>> +    (home-page "https://optionparser.sourceforge.net/")
>> +    (synopsis "Header-only C++ library to parse command line
>> options")
>> +    (description "The Lean Mean C++ Option Parser handles the
>> program's
>> +command line arguments (argc, argv).  It supports the short and long
>> option
>> +formats of getopt(), getopt_long() and getopt_long_only() but has a
>> more
>> +convenient interface.")
> As always, cut down on the ads :)
>> +    (license license:expat)))
>
> Cheers
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 4819f36052..b30205109e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2058,3 +2058,53 @@  (define-public tinydir
     (description "tinydir is a header-only C library to portably read files
 and directories.")
     (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"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (add-before 'build 'chdir
+            (lambda _ (chdir "src") #t))
+          (replace 'build
+            (lambda _
+              (invoke "make" "-j" (number->string (parallel-job-count))
+                      "example_arg" "testparse" "testprintusage" "testodr"
+                      "example")
+              #t))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (if tests?
+                  (begin
+                    (invoke "./example_arg")
+                    (invoke "./testparse")
+                    (invoke "./testprintusage")
+                    (invoke "./testodr")
+                    (invoke "./example"))
+                  (format #t "test suite not run~%"))))
+          (replace 'install
+            (lambda _
+              (install-file "optionparser.h" (string-append #$output "/include"))
+              #t))
+          (add-after 'install 'chdir-back
+            (lambda _ (chdir "..") #t)))))
+    (home-page "https://optionparser.sourceforge.net/")
+    (synopsis "Header-only C++ library to parse command line options")
+    (description "The Lean Mean C++ Option Parser handles the program's
+command line arguments (argc, argv).  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)))