all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27049: [PATCH] gnu: Add mathjax.
@ 2017-05-23 21:43 Arun Isaac
       [not found] ` <handler.27049.B.149557583819622.ack@debbugs.gnu.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Arun Isaac @ 2017-05-23 21:43 UTC (permalink / raw)
  To: 27049

* gnu/packages/web.scm (mathjax): New variable.
---
 gnu/packages/web.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index bcc20bfdd..84fa3c12f 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -4584,3 +4584,43 @@ allocations, it does not buffer data, it can be interrupted at anytime.
 Depending on your architecture, it only requires about 40 bytes of data per
 message stream (in a web server that is per connection).")
     (license l:expat)))
+
+(define-public mathjax
+  (package
+    (name "mathjax")
+    (version "2.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/mathjax/MathJax/archive/"
+             version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0sbib5lk0jrvbq6s72ag6ss3wjlz5wnk07ddxij1kp96yg3c1d1b"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+
+         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
+               (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar"))
+               (path (string-append (assoc-ref %build-inputs "gzip") "/bin")))
+           (mkdir-p install-dir)
+           (chdir install-dir)
+           (setenv "PATH" path)
+           (system* tar "xvf" (assoc-ref %build-inputs "source") "--strip" "1")))))
+    (native-inputs
+     `(("gzip" ,gzip)
+       ("tar" ,tar)))
+    (home-page "https://www.mathjax.org/")
+    (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath")
+    (description "MathJax is a JavaScript display engine for LaTeX, MathML,
+and AsciiMath notation that works in all modern browsers.  It requires no
+plugins or software to be installed on the browser.  So the page author can
+write web documents that include mathematics and be confident that readers will
+be able to view it naturally and easily.")
+    (license l:asl2.0)))
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.)
       [not found] ` <handler.27049.B.149557583819622.ack@debbugs.gnu.org>
@ 2017-05-24 10:09   ` Arun Isaac
  2017-05-24 13:16     ` Brendan Tildesley
  2017-05-28 19:41     ` Ludovic Courtès
  0 siblings, 2 replies; 18+ messages in thread
From: Arun Isaac @ 2017-05-24 10:09 UTC (permalink / raw)
  To: 27049



> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))

I don't know if this is the correct path to install mathjax to. Do we
have any conventions/standards for this? Should I just put it in
/share/mathjax ?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.)
  2017-05-24 10:09   ` bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.) Arun Isaac
@ 2017-05-24 13:16     ` Brendan Tildesley
  2017-05-28 19:41     ` Ludovic Courtès
  1 sibling, 0 replies; 18+ messages in thread
From: Brendan Tildesley @ 2017-05-24 13:16 UTC (permalink / raw)
  To: 27049

Arun Isaac 於 2017-05-24 20:09 寫道:
>
>> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
> I don't know if this is the correct path to install mathjax to. Do we
> have any conventions/standards for this? Should I just put it in
> /share/mathjax ?
>
>
>
I was wondering about this myself. Debian uses
/usr/share/javascript/mathjax, so I think we should use
/share/javascript/mathjax. a webapps directory implies that we intend to
categories "webapp" versus "non-webapp" packages, a functional
distinction that seems unimportant to the system as a whole. Debian has
a policy of naming JS packages like libjs-mathjax. On the other hand
Arch just calls it mathjax. Perhaps these things start to become an
issue once we have 20k+ packages, so I'm not sure there.

Once this is finalised, I can unbundle mathjax from Calibre, but then
the Calibre package will break if mathjax's path changes later on, so we
should sort this out now. Perhaps a way to solve it is to consider
future Javascript packages, and figure out what the most elegant way to
file them would be. I believe there are on the order of 100,000 JS
libraries out there in the wild, so I imagine we'll only be getting more
and more of them in due time. Perhaps a new gnu/packages/javascript.scm
file is ideal? After all, Mathjax is not just code for web browsers, but
is also used for MathML support in programs like Calibre's ebook-viewer.
Please take the time to think it through and set the convention for
future Javascript packages.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-23 21:43 bug#27049: [PATCH] gnu: Add mathjax Arun Isaac
       [not found] ` <handler.27049.B.149557583819622.ack@debbugs.gnu.org>
@ 2017-05-24 14:47 ` Brendan Tildesley
  2017-05-28 17:41   ` Ludovic Courtès
  2017-06-02 20:33 ` bug#27049: [PATCH 1/2] gnu: Add font-mathjax Arun Isaac
  2 siblings, 1 reply; 18+ messages in thread
From: Brendan Tildesley @ 2017-05-24 14:47 UTC (permalink / raw)
  To: 27049

Arun Isaac 於 2017-05-24 07:43 寫道:
> * gnu/packages/web.scm (mathjax): New variable.
> [...]
> +
> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
> +               (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar"))
> +               (path (string-append (assoc-ref %build-inputs "gzip") "/bin")))
> +           (mkdir-p install-dir)
> +           (chdir install-dir)
> +           (setenv "PATH" path)
> +           (system* tar "xvf" (assoc-ref %build-inputs "source") "--strip" "1")))))
This is installing many extraneous files like .gitignore, .npmignore,
README.md, CONTRIBUTING, LICENSE, docs/, test/, latest.js. It may be
best start with an 'unpack phase, and then install the needed files to
the output directory.
This package is around 178MiB like it is, and most of that due to the
fonts. Would it be better to break this into two packages, mathjax, and
font-mathjax?

Additionally, programs like Icecat will not be able to find the fonts
unless they are under share/font*, so we should also install
mathjax/fonts/HTML-CSS/TeX/otf  to share/fonts/opentype/mathjax. I think
Guix should automatically take care of making that into a hardlink in
the store so it isn't duplicated, symlink when installed (everything is
already a symlink anyway in Guix)

[*] http://docs.mathjax.org/en/latest/installation.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-24 14:47 ` bug#27049: [PATCH] gnu: Add mathjax Brendan Tildesley
@ 2017-05-28 17:41   ` Ludovic Courtès
  2017-05-28 18:44     ` Arun Isaac
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-05-28 17:41 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 27049

Hello,

Brendan Tildesley <brendan.tildesley@openmailbox.org> skribis:

> Arun Isaac 於 2017-05-24 07:43 寫道:
>> * gnu/packages/web.scm (mathjax): New variable.
>> [...]
>> +
>> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
>> +               (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar"))
>> +               (path (string-append (assoc-ref %build-inputs "gzip") "/bin")))
>> +           (mkdir-p install-dir)
>> +           (chdir install-dir)
>> +           (setenv "PATH" path)
>> +           (system* tar "xvf" (assoc-ref %build-inputs "source") "--strip" "1")))))
> This is installing many extraneous files like .gitignore, .npmignore,
> README.md, CONTRIBUTING, LICENSE, docs/, test/, latest.js. It may be
> best start with an 'unpack phase, and then install the needed files to
> the output directory.
> This package is around 178MiB like it is, and most of that due to the
> fonts. Would it be better to break this into two packages, mathjax, and
> font-mathjax?

Also, Arun: is this package really source code?  Or does it contain
“minified” code and also bundles all its dependencies (which would not
be okay)?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-28 17:41   ` Ludovic Courtès
@ 2017-05-28 18:44     ` Arun Isaac
  2017-05-29  7:47     ` Brendan Tildesley
       [not found]     ` <ba2e770a.AEUAKlldotwAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZKxqe@mailjet.com>
  2 siblings, 0 replies; 18+ messages in thread
From: Arun Isaac @ 2017-05-28 18:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049


Ludovic Courtès writes:

> Also, Arun: is this package really source code?  Or does it contain
> “minified” code and also bundles all its dependencies (which would not
> be okay)?

Good question! I had assumed it was the full source code without
checking carefully! I checked just now. The full source code is in the
"unpacked" directory of the tarball. The code in the top level directory
of the tarball is minified code. I think we should install only the
minified code to share/javascript/mathjax/.

And, like Brendan said, we should separate the fonts into a font-mathjax
package. And, these fonts should be symlinked into the js-mathjax
package.

I'm working on both packages. I'll send patches once they are ready.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.)
  2017-05-24 10:09   ` bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.) Arun Isaac
  2017-05-24 13:16     ` Brendan Tildesley
@ 2017-05-28 19:41     ` Ludovic Courtès
  2017-05-29 18:47       ` Arun Isaac
  1 sibling, 1 reply; 18+ messages in thread
From: Ludovic Courtès @ 2017-05-28 19:41 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 27049

Arun Isaac <arunisaac@systemreboot.net> skribis:

>> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
>
> I don't know if this is the correct path to install mathjax to. Do we
> have any conventions/standards for this? Should I just put it in
> /share/mathjax ?

Maybe share/javascript?  Does Node have an opinion on where JS should
live?  What does Debian do?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-28 17:41   ` Ludovic Courtès
  2017-05-28 18:44     ` Arun Isaac
@ 2017-05-29  7:47     ` Brendan Tildesley
       [not found]     ` <ba2e770a.AEUAKlldotwAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZKxqe@mailjet.com>
  2 siblings, 0 replies; 18+ messages in thread
From: Brendan Tildesley @ 2017-05-29  7:47 UTC (permalink / raw)
  Cc: 27049

Ludovic Courtès 於 2017-05-29 03:41 寫道:
> Hello,
>
> Brendan Tildesley <brendan.tildesley@openmailbox.org> skribis:
>
>> Arun Isaac 於 2017-05-24 07:43 寫道:
>> [...]
> Also, Arun: is this package really source code?  Or does it contain
> “minified” code and also bundles all its dependencies (which would not
> be okay)?
>
> Thanks,
> Ludo’.

It contains both. The jax/ directory contains minified code, and the
unpacked/ directory contains the human-readable source. I do not know
what the procedure is for minifying javascript. Do you think we should
delete the jax/ directory and reconstruct it for unpacked/ as apart of
the builder?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
       [not found]     ` <ba2e770a.AEUAKlldotwAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZKxqe@mailjet.com>
@ 2017-05-29  9:34       ` Ludovic Courtès
  2017-05-29 11:13         ` Jelle Licht
  0 siblings, 1 reply; 18+ messages in thread
From: Ludovic Courtès @ 2017-05-29  9:34 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 27049

Arun Isaac <arunisaac@systemreboot.net> skribis:

> Ludovic Courtès writes:
>
>> Also, Arun: is this package really source code?  Or does it contain
>> “minified” code and also bundles all its dependencies (which would not
>> be okay)?
>
> Good question! I had assumed it was the full source code without
> checking carefully! I checked just now. The full source code is in the
> "unpacked" directory of the tarball. The code in the top level directory
> of the tarball is minified code. I think we should install only the
> minified code to share/javascript/mathjax/.

Yes, but we should treat minified code as “object code”: we’d remove it
in a snippet and then minify from source.

ISTR that the common minifiers depend on a lot of Node packages, so this
may be a can of worms.  Maybe Jelle or Chris or Dave know more?

> And, like Brendan said, we should separate the fonts into a font-mathjax
> package. And, these fonts should be symlinked into the js-mathjax
> package.

Agreed.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29  9:34       ` Ludovic Courtès
@ 2017-05-29 11:13         ` Jelle Licht
  2017-05-29 12:05           ` Ludovic Courtès
  0 siblings, 1 reply; 18+ messages in thread
From: Jelle Licht @ 2017-05-29 11:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

2017-05-29 11:34 GMT+02:00 Ludovic Courtès <ludo@gnu.org>:

> Arun Isaac <arunisaac@systemreboot.net> skribis:
>
> > Ludovic Courtès writes:
> >
> >> Also, Arun: is this package really source code?  Or does it contain
> >> “minified” code and also bundles all its dependencies (which would not
> >> be okay)?
> >
> > Good question! I had assumed it was the full source code without
> > checking carefully! I checked just now. The full source code is in the
> > "unpacked" directory of the tarball. The code in the top level directory
> > of the tarball is minified code. I think we should install only the
> > minified code to share/javascript/mathjax/.
>
> Yes, but we should treat minified code as “object code”: we’d remove it
> in a snippet and then minify from source.
>
> ISTR that the common minifiers depend on a lot of Node packages, so this
> may be a can of worms.  Maybe Jelle or Chris or Dave know more?
>

The minifiers I use for work are usually designed as a plugin in a bigger
node packages, so they suffer from the bootstrap problem lots of node
packages have if you want to build them from source.
Maybe we could look for a smaller, standalone minifier package that we
could use for all minification needs in guix? I always used uglify-js from
before my guix days, so I am not sure how workable it would be to package.



> > And, like Brendan said, we should separate the fonts into a font-mathjax
> > package. And, these fonts should be symlinked into the js-mathjax
> > package.
>
> Agreed.
>
> Thanks!
>
> Ludo’.
>
>
- Jelle

[-- Attachment #2: Type: text/html, Size: 2309 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29 11:13         ` Jelle Licht
@ 2017-05-29 12:05           ` Ludovic Courtès
  2017-05-29 12:26             ` Jelle Licht
  0 siblings, 1 reply; 18+ messages in thread
From: Ludovic Courtès @ 2017-05-29 12:05 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 27049

Jelle Licht <jlicht@fsfe.org> skribis:

> 2017-05-29 11:34 GMT+02:00 Ludovic Courtès <ludo@gnu.org>:
>
>> Arun Isaac <arunisaac@systemreboot.net> skribis:
>>
>> > Ludovic Courtès writes:
>> >
>> >> Also, Arun: is this package really source code?  Or does it contain
>> >> “minified” code and also bundles all its dependencies (which would not
>> >> be okay)?
>> >
>> > Good question! I had assumed it was the full source code without
>> > checking carefully! I checked just now. The full source code is in the
>> > "unpacked" directory of the tarball. The code in the top level directory
>> > of the tarball is minified code. I think we should install only the
>> > minified code to share/javascript/mathjax/.
>>
>> Yes, but we should treat minified code as “object code”: we’d remove it
>> in a snippet and then minify from source.
>>
>> ISTR that the common minifiers depend on a lot of Node packages, so this
>> may be a can of worms.  Maybe Jelle or Chris or Dave know more?
>>
>
> The minifiers I use for work are usually designed as a plugin in a bigger
> node packages, so they suffer from the bootstrap problem lots of node
> packages have if you want to build them from source.
> Maybe we could look for a smaller, standalone minifier package that we
> could use for all minification needs in guix? I always used uglify-js from
> before my guix days, so I am not sure how workable it would be to package.

What smaller, standalone minifier would you suggest?  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29 12:05           ` Ludovic Courtès
@ 2017-05-29 12:26             ` Jelle Licht
  2017-05-29 16:04               ` Ludovic Courtès
  0 siblings, 1 reply; 18+ messages in thread
From: Jelle Licht @ 2017-05-29 12:26 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049

[-- Attachment #1: Type: text/plain, Size: 3014 bytes --]

2017-05-29 14:05 GMT+02:00 Ludovic Courtès <ludo@gnu.org>:

> Jelle Licht <jlicht@fsfe.org> skribis:
>
> > 2017-05-29 11:34 GMT+02:00 Ludovic Courtès <ludo@gnu.org>:
> >
> >> Arun Isaac <arunisaac@systemreboot.net> skribis:
> >>
> >> > Ludovic Courtès writes:
> >> >
> >> >> Also, Arun: is this package really source code?  Or does it contain
> >> >> “minified” code and also bundles all its dependencies (which would
> not
> >> >> be okay)?
> >> >
> >> > Good question! I had assumed it was the full source code without
> >> > checking carefully! I checked just now. The full source code is in the
> >> > "unpacked" directory of the tarball. The code in the top level
> directory
> >> > of the tarball is minified code. I think we should install only the
> >> > minified code to share/javascript/mathjax/.
> >>
> >> Yes, but we should treat minified code as “object code”: we’d remove it
> >> in a snippet and then minify from source.
> >>
> >> ISTR that the common minifiers depend on a lot of Node packages, so this
> >> may be a can of worms.  Maybe Jelle or Chris or Dave know more?
> >>
> >
> > The minifiers I use for work are usually designed as a plugin in a bigger
> > node packages, so they suffer from the bootstrap problem lots of node
> > packages have if you want to build them from source.
> > Maybe we could look for a smaller, standalone minifier package that we
> > could use for all minification needs in guix? I always used uglify-js
> from
> > before my guix days, so I am not sure how workable it would be to
> package.
>
> What smaller, standalone minifier would you suggest?  :-)
>

That is an interesting question. A cursory glance at the uglify-js leads me
to believe it could probably be packaged. The standard node-in-guix issues
apply though:
- We do not have a test framework packaged, so running tests to verify that
packages actually work is going to be difficult.
- We end up with a bare-bones package, as some features require problematic
packages (in this case source-maps seems non-trivial to get packaged, due
to a dependency on webpack). The package itself does not have knowledge of
these issues though, so any attempt to use these unsupported features would
lead to a crash.

The second point is less of an issue if this minifier packages is only used
internally as part of a build process.

Another issue with minifiers in general is that is Very Hard to write a
proper minifier. If we choose to not use the minifier as expected by the
package author, we will at some point run into issues that will be very
hard to report and get fixed upstream, as it will only be us experiencing
these issues due to our ... unique .. build procedure.


>
> Ludo’.
>

Maybe some sustainable progress could be made by abusing pars of guile's JS
frontend?
The process could go like this:
JavaScript source -> AST -> minify identifiers, tree shakers etc ->
Serialize AST to minified .js file.

- Jelle

[-- Attachment #2: Type: text/html, Size: 4030 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29 12:26             ` Jelle Licht
@ 2017-05-29 16:04               ` Ludovic Courtès
  2017-05-29 19:19                 ` Arun Isaac
  2017-05-30  0:55                 ` Mike Gerwitz
  0 siblings, 2 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-05-29 16:04 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 27049

Jelle Licht <jlicht@fsfe.org> skribis:

> That is an interesting question. A cursory glance at the uglify-js leads me
> to believe it could probably be packaged. The standard node-in-guix issues
> apply though:
> - We do not have a test framework packaged, so running tests to verify that
> packages actually work is going to be difficult.
> - We end up with a bare-bones package, as some features require problematic
> packages (in this case source-maps seems non-trivial to get packaged, due
> to a dependency on webpack). The package itself does not have knowledge of
> these issues though, so any attempt to use these unsupported features would
> lead to a crash.
>
> The second point is less of an issue if this minifier packages is only used
> internally as part of a build process.

OK.

> Another issue with minifiers in general is that is Very Hard to write a
> proper minifier. If we choose to not use the minifier as expected by the
> package author, we will at some point run into issues that will be very
> hard to report and get fixed upstream, as it will only be us experiencing
> these issues due to our ... unique .. build procedure.

Sure.  My suggestion would be to use an existing, established minifier,
only one that is relatively simple to package.  It could be one written
in a language other than JS (Ricardo mentioned ‘cl-uglify-js’ on IRC),
or it could be a simplistic minifier written in JS but with very few or
not dependencies, if that exists.

> Maybe some sustainable progress could be made by abusing pars of guile's JS
> frontend?
> The process could go like this:
> JavaScript source -> AST -> minify identifiers, tree shakers etc ->
> Serialize AST to minified .js file.

That would be an interesting exercise, but probably a more risky
approach.  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.)
  2017-05-28 19:41     ` Ludovic Courtès
@ 2017-05-29 18:47       ` Arun Isaac
  0 siblings, 0 replies; 18+ messages in thread
From: Arun Isaac @ 2017-05-29 18:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049


Ludovic Courtès writes:

> Arun Isaac <arunisaac@systemreboot.net> skribis:
>
>>> +         (let ((install-dir (string-append %output "/share/webapps/mathjax"))
>>
>> I don't know if this is the correct path to install mathjax to. Do we
>> have any conventions/standards for this? Should I just put it in
>> /share/mathjax ?
>
> Maybe share/javascript?

I think we should do /share/javascript/mathjax

> Does Node have an opinion on where JS should live?

I have never actually used Node, and don't know much about it. Looking
at
https://stackoverflow.com/questions/5926672/where-does-npm-install-packages
it seems that npm, by default, installs to /usr/local/lib/node and
/usr/local/lib/node_modules

> What does Debian do?

Debian puts it under /usr/share/javascript/mathjax/. Debian has both
minified code and the full "unpacked" source code installed.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29 16:04               ` Ludovic Courtès
@ 2017-05-29 19:19                 ` Arun Isaac
  2017-05-30  0:55                 ` Mike Gerwitz
  1 sibling, 0 replies; 18+ messages in thread
From: Arun Isaac @ 2017-05-29 19:19 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049


> Sure.  My suggestion would be to use an existing, established minifier,
> only one that is relatively simple to package.  It could be one written
> in a language other than JS (Ricardo mentioned ‘cl-uglify-js’ on IRC),
> or it could be a simplistic minifier written in JS but with very few or
> not dependencies, if that exists.

There are several js minifiers written in python. Here's one:

https://github.com/tikitu/jsmin/

I've never used it. I only found it five minutes ago with an internet
search. But, if appearances are anything, it looks relatively well
maintained.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH] gnu: Add mathjax.
  2017-05-29 16:04               ` Ludovic Courtès
  2017-05-29 19:19                 ` Arun Isaac
@ 2017-05-30  0:55                 ` Mike Gerwitz
  1 sibling, 0 replies; 18+ messages in thread
From: Mike Gerwitz @ 2017-05-30  0:55 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27049

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

On Mon, May 29, 2017 at 18:04:19 +0200, Ludovic Courtès wrote:
> Jelle Licht <jlicht@fsfe.org> skribis:
>> Another issue with minifiers in general is that is Very Hard to write a
>> proper minifier. If we choose to not use the minifier as expected by the
>> package author, we will at some point run into issues that will be very
>> hard to report and get fixed upstream, as it will only be us experiencing
>> these issues due to our ... unique .. build procedure.
>
> Sure.  My suggestion would be to use an existing, established minifier,
> only one that is relatively simple to package.  It could be one written
> in a language other than JS (Ricardo mentioned ‘cl-uglify-js’ on IRC),
> or it could be a simplistic minifier written in JS but with very few or
> not dependencies, if that exists.

Further, minifiers have various options and some methods are more
aggressive than others.  Last I checked a couple years ago, for example,
Closure Compiler broke GNU ease.js on its more aggressive setting.  The
break was obvious from running my test suite, but some breaks were
subtle and would have caused nightmares in production.  Perhaps things
have since improved.

My point is, though, that Jelle's concerns are shared.  Closure Compiler
is written by Google, and they tend to know what they're doing in this
area. ;)

I'm not saying I'm opposed; it sounds fine to me.  Just be careful!

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
https://mikegerwitz.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH 1/2] gnu: Add font-mathjax.
  2017-05-23 21:43 bug#27049: [PATCH] gnu: Add mathjax Arun Isaac
       [not found] ` <handler.27049.B.149557583819622.ack@debbugs.gnu.org>
  2017-05-24 14:47 ` bug#27049: [PATCH] gnu: Add mathjax Brendan Tildesley
@ 2017-06-02 20:33 ` Arun Isaac
  2017-06-03 13:51   ` Ludovic Courtès
  2 siblings, 1 reply; 18+ messages in thread
From: Arun Isaac @ 2017-06-02 20:33 UTC (permalink / raw)
  To: 27049

* gnu/packages/fonts.scm (font-mathjax): New variable.
---
 gnu/packages/fonts.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 73d76a461..15f70dddd 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017 Brendan Tildesley <brendan.tildesley@openmailbox.org>
+;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1227,3 +1228,46 @@ Ensuring readability and clarity at both large and small sizes, these icons
 have been optimized for beautiful display on all common platforms and display
 resolutions.")
    (license license:asl2.0)))
+
+(define-public font-mathjax
+  (package
+    (name "font-mathjax")
+    (version "2.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/mathjax/MathJax/archive/"
+             version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0sbib5lk0jrvbq6s72ag6ss3wjlz5wnk07ddxij1kp96yg3c1d1b"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (setenv "PATH" (string-join (map (match-lambda
+                                            ((_ . input-path)
+                                             (string-append input-path "/bin")))
+                                          %build-inputs)
+                                     ":"))
+         (let ((install-directory (string-append %output "/share/fonts/mathjax")))
+           (mkdir-p install-directory)
+           (zero? (system* "tar" "-C" install-directory "-xvf"
+                           (assoc-ref %build-inputs "source")
+                           "MathJax-2.7.1/fonts" "--strip" "2"))))))
+    (native-inputs
+     `(("gzip" ,gzip)
+       ("tar" ,tar)))
+    (home-page "https://www.mathjax.org/")
+    (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath")
+    (description "MathJax is a JavaScript display engine for LaTeX, MathML,
+and AsciiMath notation that works in all modern browsers.  It requires no
+plugins or software to be installed on the browser.  So the page author can
+write web documents that include mathematics and be confident that readers will
+be able to view it naturally and easily.")
+    (license license:asl2.0)))
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* bug#27049: [PATCH 1/2] gnu: Add font-mathjax.
  2017-06-02 20:33 ` bug#27049: [PATCH 1/2] gnu: Add font-mathjax Arun Isaac
@ 2017-06-03 13:51   ` Ludovic Courtès
  0 siblings, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-06-03 13:51 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 27049

Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

> * gnu/packages/fonts.scm (font-mathjax): New variable.

[...]

> +(define-public font-mathjax
> +  (package
> +    (name "font-mathjax")
> +    (version "2.7.1")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://github.com/mathjax/MathJax/archive/"
> +             version ".tar.gz"))
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "0sbib5lk0jrvbq6s72ag6ss3wjlz5wnk07ddxij1kp96yg3c1d1b"))))

Should it be:

  (source (package-source mathjax))

to make sure the two packages are kept in sync?

> +    (home-page "https://www.mathjax.org/")
> +    (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath")
> +    (description "MathJax is a JavaScript display engine for LaTeX, MathML,
> +and AsciiMath notation that works in all modern browsers.  It requires no
> +plugins or software to be installed on the browser.  So the page author can
> +write web documents that include mathematics and be confident that readers will
> +be able to view it naturally and easily.")
> +    (license license:asl2.0)))

I think the synopsis/description should be updated to mention that this
package simply provides the font used by MathJax, no?

Otherwise LGTM, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-06-03 13:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 21:43 bug#27049: [PATCH] gnu: Add mathjax Arun Isaac
     [not found] ` <handler.27049.B.149557583819622.ack@debbugs.gnu.org>
2017-05-24 10:09   ` bug#27049: Acknowledgement ([PATCH] gnu: Add mathjax.) Arun Isaac
2017-05-24 13:16     ` Brendan Tildesley
2017-05-28 19:41     ` Ludovic Courtès
2017-05-29 18:47       ` Arun Isaac
2017-05-24 14:47 ` bug#27049: [PATCH] gnu: Add mathjax Brendan Tildesley
2017-05-28 17:41   ` Ludovic Courtès
2017-05-28 18:44     ` Arun Isaac
2017-05-29  7:47     ` Brendan Tildesley
     [not found]     ` <ba2e770a.AEUAKlldotwAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZKxqe@mailjet.com>
2017-05-29  9:34       ` Ludovic Courtès
2017-05-29 11:13         ` Jelle Licht
2017-05-29 12:05           ` Ludovic Courtès
2017-05-29 12:26             ` Jelle Licht
2017-05-29 16:04               ` Ludovic Courtès
2017-05-29 19:19                 ` Arun Isaac
2017-05-30  0:55                 ` Mike Gerwitz
2017-06-02 20:33 ` bug#27049: [PATCH 1/2] gnu: Add font-mathjax Arun Isaac
2017-06-03 13:51   ` Ludovic Courtès

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.