GNU bug report logs -
#56576
[PATCH] gnu: Add nuklear.
Previous Next
Reported by: Antero Mejr <antero <at> mailbox.org>
Date: Fri, 15 Jul 2022 14:58:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 07-08-2022 00:57, Antero Mejr via Guix-patches via wrote:
> + (invoke "gcc" "-O2" "-g" "-o" "stddoc" "stddoc.c")
For cross-compilation, you need to use #$(cc-for-target) instead of
"gcc", otherwise it will be compiled for the wrong architecture.
> + (with-input-from-file "stddoc.c"
> + (lambda _
> + (with-output-to-file "stddoc.c.html"
> + (lambda _
> + (invoke "./stddoc")))))))
Except when emulation is used, cross-compiled binaries cannot be run.
However, you can add 'this-package' to native-inputs (conditional on
cross-compilation, otherwise you get a loop) and run that stddoc:
(native-inputs (if (%current-target-system) (list this-package) '()))
[...]
(invoke #$(if (%current-target-system) "stddoc" "./stddoc"))
(untested!).
It includes Javascript and CSS from external sources:
> static void stddoc( FILE *in, FILE *out ) {
> fprintf(out, "%s\n", "<meta charset='utf-8' emacsmode='-*-
> markdown -*-'>");
> fprintf(out, "%s\n", "<link rel='stylesheet'
> href='https://casual-effects.com/m""arkdeep/latest/apidoc.css?'>");
>
I don't think this is good, privacy-wise, could you substitute them with
a local copy?
Also, on
<https://github.com/r-lyeh/stddoc.c/blob/6eef9deaf2e36bae812f50e448a8012b3e5efb14/stddoc.c#L111>,
it looks like it forgets to quote things like &. I don't know if that's
important in this particular case but often forgetting to quote things
can be pretty bad.
(Ignoring the return value of printf also isn't ideal, but less important)
> + (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.")
This seems misleading to me, the Markdown->HTML happens at runtime, via
the Javascript. Also, instead of mentioning the number 60, you could
refer to the Javascript package; that way, the user can check if their
language is in the list. I also don't think that the generator
'https://morgan3d.github.io/markdeep/latest/markdeep.js' counts as tiny.
stdout -> output, stdin -> input
Greetings,
Maxime
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]
This bug report was last modified 1 year and 42 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.