all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: 27049@debbugs.gnu.org
Subject: bug#27049: [PATCH 2/2] gnu: Add js-mathjax.
Date: Sat, 03 Jun 2017 15:30:22 +0200	[thread overview]
Message-ID: <87tw3xmc5t.fsf@gnu.org> (raw)
In-Reply-To: <b6247965.AEAAK4p8Z1kAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZMcyv@mailjet.com> (Arun Isaac's message of "Sat, 03 Jun 2017 02:07:58 +0530")

Hi,

Arun Isaac <arunisaac@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’.

      parent reply	other threads:[~2017-06-03 13:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170602203308.7606-1-arunisaac@systemreboot.net>
2017-06-02 20:33 ` bug#27049: [PATCH 2/2] gnu: Add js-mathjax Arun Isaac
2017-06-03 13:53   ` Ludovic Courtès
2017-06-04 18:57     ` Arun Isaac
     [not found]     ` <5f4eeea0.AEQALLKfIdMAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZNFgw@mailjet.com>
2017-06-05 10:10       ` Ludovic Courtès
2017-06-05 13:48         ` Arun Isaac
     [not found] ` <20170602203308.7606-2-arunisaac@systemreboot.net>
2017-06-02 20:37   ` Arun Isaac
     [not found]   ` <b6247965.AEAAK4p8Z1kAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZMcyv@mailjet.com>
2017-06-03 13:30     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tw3xmc5t.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=27049@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.