Subject: [bug#56576] [PATCH 1/2] gnu: Add stddoc.

From: Antero Mejr <[email-masked]>
Date: Sat, 6 Aug 2022 18:57:42 -0400

* gnu/packages/documentation.scm (stddoc): New variable.
---
Need this to generate Nuklear's HTML doc from source (code comments).

 gnu/packages/documentation.scm | 42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 6f24149b5d..9b98db4d40 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -393,3 +393,45 @@ (define-public zeal
       (description "Zeal is a simple offline documentation browser
 inspired by Dash.")
       (license gpl3+))))
+
+(define-public stddoc
+  (let ((commit "6eef9deaf2e36bae812f50e448a8012b3e5efb14"))
+    (package
+      (name "stddoc")
+      (version "1.0.2")
+      (home-page "https://github.com/r-lyeh/stddoc.c")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "06phjp7wbf4x1sagxwfapgv6iyiixmijxxbg2clb48kyvjg5mlwn"))
+         (snippet #~(delete-file "stddoc.c.html"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;no tests
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda _
+                              (invoke "gcc" "-O2" "-g" "-o" "stddoc" "stddoc.c")
+                              (with-input-from-file "stddoc.c"
+                                (lambda _
+                                  (with-output-to-file "stddoc.c.html"
+                                    (lambda _
+                                      (invoke "./stddoc")))))))
+                          (replace 'install
+                            (lambda _
+                              (install-file "stddoc"
+                                            (string-append #$output "/bin"))
+                              (install-file "stddoc.c.html"
+                                            (string-append #$output
+                                                           "/share/doc")))))))
+      (synopsis "Documentation generator for 60 programming languages")
+      (description "@code{stddoc.c} is a tiny documentation generator for 60
+programming languages.  Markdeep code comments are extracted from stdin and
+printed into stdout as a HTML file.")
+      (license unlicense))))
-- 
2.37.1