GNU bug report logs - #27049
[PATCH] gnu: Add mathjax.

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Tue, 23 May 2017 21:44:01 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 27049 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Brendan Tildesley <brendan.tildesley <at> openmailbox.org>,
 27049 <at> debbugs.gnu.org
Subject: Re: [PATCH 2/2] gnu: Add js-mathjax.
Date: Sat, 03 Jun 2017 15:30:22 +0200
Hi,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> These are WIP patches. Please provide feedback.
>
>> +         (setenv "PATH" (string-join (map (match-lambda
>> +                                            ((_ . input-path)
>> +                                             (string-append input-path "/bin")))
>> +                                          %build-inputs)
>> +                                     ":"))
>
> It would be nice if this was handled by the trivial-build-system
> itself. Almost all trivial-build-system packages I can think of need
> some variant of this.

You could use ‘set-path-environment-variable’ from (guix build utils) to
slightly simplify this.

>> +                (cond
>> +                 ((string-match "\\.js$" file)
>> +                  (mkdir-p (dirname install-path))
>> +                  (system (format #f "uglify-js ~a > ~a" file install-path)))
>
> I have to use `system' instead of `system*' here, because I need to make
> use of ">" to redirect output to a file.

That’s OK, though you could also use ‘open-input-pipe’ from (ice-9
popen):

  (let ((minified (open-pipe* OPEN_READ "uglify-js" file)))
    (call-with-output-file installed
      (lambda (port)
        (dump-port minified port))))

> While minifying some files, an ascii decoding error is reported. I'm yet
> to sort that out.

You might need to run that in a UTF-8 locale, which requires adding
glibc-utf8-locales as an input etc.

HTH!

Ludo’.




This bug report was last modified 7 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.