unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / Atom feed
* [bug#42885] [PATCH 0/4] gnu: calibre: Update to 4.22.0.
@ 2020-08-16  6:55 Brendan Tildesley
  2020-08-21  9:20 ` [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0 Brendan Tildesley
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-16  6:55 UTC (permalink / raw)
  To: 42885






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

* [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import.
       [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
@ 2020-08-16  7:03   ` Brendan Tildesley
  2020-08-16  7:03     ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Brendan Tildesley
                       ` (3 more replies)
  2020-08-22 23:24   ` [bug#42885] ([PATCH 2/4] gnu: calibre: Update to 4.23.0 (new release) Brendan Tildesley
  2020-08-25  1:59   ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-3 Brendan Tildesley
  2 siblings, 4 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-16  7:03 UTC (permalink / raw)
  To: 42885

---
 gnu/packages/ebook.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index d290b19f5f..aab4155d3d 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2017, 2019 Brendan Tildesley <mail@brendan.scot>
+;;; Copyright © 2017, 2019, 2020 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
@@ -28,7 +28,6 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
-  #:use-module (gnu packages)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
-- 
2.28.0





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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
@ 2020-08-16  7:03     ` Brendan Tildesley
  2020-08-24  1:05       ` Leo Famulari
  2020-08-16  7:03     ` [bug#42885] [PATCH 3/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-16  7:03 UTC (permalink / raw)
  To: 42885

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

diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index d5ff5bffee..d6a66a1482 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,6 +129,45 @@ 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.")))
 
+(define-public mathjax-bin
+  (package
+    (name "mathjax")
+    (version "3.0.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mathjax/MathJax")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1zd0chn0cjahi28qv3nzshwljz2hgmj6lizyvvd8qs89gsx0z3h9"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (let ((install-directory (string-append %output "/lib/node_modules/mathjax")))
+           (mkdir-p install-directory)
+           (copy-recursively (string-append (assoc-ref %build-inputs "source"))
+                             install-directory)))))
+    (home-page "https://www.mathjax.org/")
+    (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath (prebuilt)")
+    (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.
+
+The package is derived from not the true source but the built version of
+MathJax 3 for distribution by upstream. This package should eventually be
+replaced my a package built directly from the source at
+https://github.com/mathjax/MathJax-src.")
+    (license license:asl2.0)))
+
 (define-public js-respond
   (package
     (name "js-respond")
-- 
2.28.0





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

* [bug#42885] [PATCH 3/4] gnu: calibre: Update to 4.22.0.
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
  2020-08-16  7:03     ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Brendan Tildesley
@ 2020-08-16  7:03     ` Brendan Tildesley
  2020-08-16  7:03     ` [bug#42885] [PATCH 4/4] gnu: calibre: Add wrap phase for qtwebengine Brendan Tildesley
  2020-08-24  1:01     ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Leo Famulari
  3 siblings, 0 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-16  7:03 UTC (permalink / raw)
  To: 42885

* gnu/packages/ebook.scm (calbre): Update to 4.22.0. Replace MathJax 2
input with newly required MathJax 3.
---
 gnu/packages/ebook.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index aab4155d3d..a434f56bc1 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -82,7 +82,7 @@
 (define-public calibre
   (package
     (name "calibre")
-    (version "4.18.0")
+    (version "4.22.0")
     (source
       (origin
         (method url-fetch)
@@ -91,7 +91,7 @@
                             version ".tar.xz"))
         (sha256
          (base32
-          "0w9pcfvskjh4v00vjw3i6hzrafy863pgsmmqdx4lffip3p856brw"))
+          "0d0wmd3ijk8px1d662igal4lfmpyzynfzs6ms1bb9nf42mq2pxai"))
         (modules '((guix build utils)))
         (snippet
           '(begin
@@ -126,7 +126,7 @@
        ("hunspell" ,hunspell)
        ("hyphen" ,hyphen)
        ("icu4c" ,icu4c)
-       ("js-mathjax" ,js-mathjax)
+       ("mathjax" ,mathjax-bin)
        ("libmtp" ,libmtp)
        ("libpng" ,libpng)
        ("libusb" ,libusb)
@@ -243,8 +243,8 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "python2" "setup.py" "mathjax""--system-mathjax"
                      "--path-to-mathjax" (string-append
-                                          (assoc-ref inputs "js-mathjax")
-                                          "/share/javascript/mathjax"))
+                                          (assoc-ref inputs "mathjax")
+                                          "/lib/node_modules/mathjax/es5"))
              (invoke "python2" "setup.py" "rapydscript")))
          (add-after 'install 'install-man-pages
            (lambda* (#:key outputs #:allow-other-keys)
-- 
2.28.0





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

* [bug#42885] [PATCH 4/4] gnu: calibre: Add wrap phase for qtwebengine.
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
  2020-08-16  7:03     ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Brendan Tildesley
  2020-08-16  7:03     ` [bug#42885] [PATCH 3/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
@ 2020-08-16  7:03     ` Brendan Tildesley
  2020-08-24  1:01     ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Leo Famulari
  3 siblings, 0 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-16  7:03 UTC (permalink / raw)
  To: 42885

* gnu/packages/ebook.scm (calibre): [arguments]: Copy the wrap phase
from Anki to wrap QTWEBENGINEPROCESS_PATH. This fixes the 'Could not
find QtWebEngineProcess error' when opening a book with the
ebook-viewer.
---
 gnu/packages/ebook.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index a434f56bc1..31864a0786 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -165,7 +165,10 @@
        ("qtwebengine" ,qtwebengine)
        ("sqlite" ,sqlite)))
     (arguments
-     `(#:python ,python-2
+     `(#:modules ((guix build python-build-system)
+                  (guix build utils)
+                  (ice-9 match))
+       #:python ,python-2
        ;; Calibre is using setuptools by itself, but the setup.py is not
        ;; compatible with the shim wrapper (taken from pip) we are using.
        #:use-setuptools? #f
@@ -252,6 +255,35 @@
               "man-pages"
               (string-append (assoc-ref outputs "out") "/share/man"))
              #t))
+         ;; wrap phase copied from anki package.
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+                   ;; List of paths to the site-packages directories of Python
+                   ;; library inputs.
+                   (site-packages
+                    (map (lambda (pyinput)
+                           (string-append
+                            (cdr pyinput)
+                            "/lib/python2.7/site-packages"))
+                         (filter (match-lambda
+                                   ((label . _)
+                                    (string-prefix? "python2-" label)))
+                                 inputs)))
+                   (qtwebengineprocess
+                    (string-append (assoc-ref inputs "qtwebengine")
+                                   "/lib/qt5/libexec/QtWebEngineProcess")))
+               ;; The program fails to find the QtWebEngineProcess program, so
+               ;; we set QTWEBENGINEPROCESS_PATH to help it.  PYTHONPATH is
+               ;; wrapped to avoid declaring Python libraries as propagated
+               ;; inputs.
+               (for-each (lambda (program)
+                           (wrap-program program
+                             `("QTWEBENGINEPROCESS_PATH" =
+                               (,qtwebengineprocess))
+                             `("PYTHONPATH" = ,site-packages)))
+                         (find-files bin ".")))
+             #t))
          ;; The font TTF files are used in some miscellaneous tests, so we
          ;; unbundle them here to avoid patching the tests.
          (add-after 'install 'unbundle-font-liberation
-- 
2.28.0





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

* [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0.
  2020-08-16  6:55 [bug#42885] [PATCH 0/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
@ 2020-08-21  9:20 ` Brendan Tildesley
  2020-08-22 17:30   ` Leo Famulari
       [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
  2020-09-07  3:11 ` [bug#42885] Regarding Patch 4 Prafulla Giri
  2 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-21  9:20 UTC (permalink / raw)
  To: 42885

* gnu/packages/ebook.scm (calibre): Update to 4.23.0.
---
 gnu/packages/ebook.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 31864a0786..72a0d3b22a 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -82,7 +82,7 @@
 (define-public calibre
   (package
     (name "calibre")
-    (version "4.22.0")
+    (version "4.23.0")
     (source
       (origin
         (method url-fetch)
@@ -91,7 +91,7 @@
                             version ".tar.xz"))
         (sha256
          (base32
-          "0d0wmd3ijk8px1d662igal4lfmpyzynfzs6ms1bb9nf42mq2pxai"))
+          "064mnmz2w4xa2kydh5vzhlgvmyzlwjhm2wm58vwkdqzh7i3m3phn"))
         (modules '((guix build utils)))
         (snippet
           '(begin
-- 
2.28.0





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

* [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0.
  2020-08-21  9:20 ` [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0 Brendan Tildesley
@ 2020-08-22 17:30   ` Leo Famulari
  0 siblings, 0 replies; 38+ messages in thread
From: Leo Famulari @ 2020-08-22 17:30 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 42885

On Fri, Aug 21, 2020 at 07:20:14PM +1000, Brendan Tildesley wrote:
> * gnu/packages/ebook.scm (calibre): Update to 4.23.0.

Thanks! Can you send an updated patch series? I don't think we should
update to 4.22.0 and then immediately to 4.23.0.




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

* [bug#42885] ([PATCH 2/4] gnu: calibre: Update to 4.23.0 (new release)
       [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
@ 2020-08-22 23:24   ` Brendan Tildesley
  2020-08-25  1:59   ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-3 Brendan Tildesley
  2 siblings, 0 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-22 23:24 UTC (permalink / raw)
  To: 42885

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

Calibre 4.23.0 was released. This just replaces the second patch. the 
others should still apply without conflict.

[-- Attachment #2: 0002-gnu-calibre-Update-to-4.23.0.patch --]
[-- Type: text/x-patch, Size: 1989 bytes --]

From d3b70c4c2329abbe6d210b9993a99306d93c5f29 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Sun, 16 Aug 2020 16:16:19 +1000
Subject: [PATCH 2/3] gnu: calibre: Update to 4.23.0.

* gnu/packages/ebook.scm (calbre): Update to 4.23.0. Replace MathJax 2
input with newly required MathJax 3.
---
 gnu/packages/ebook.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index aab4155d3d..f1698900f3 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -82,7 +82,7 @@
 (define-public calibre
   (package
     (name "calibre")
-    (version "4.18.0")
+    (version "4.23.0")
     (source
       (origin
         (method url-fetch)
@@ -91,7 +91,7 @@
                             version ".tar.xz"))
         (sha256
          (base32
-          "0w9pcfvskjh4v00vjw3i6hzrafy863pgsmmqdx4lffip3p856brw"))
+          "064mnmz2w4xa2kydh5vzhlgvmyzlwjhm2wm58vwkdqzh7i3m3phn"))
         (modules '((guix build utils)))
         (snippet
           '(begin
@@ -126,7 +126,7 @@
        ("hunspell" ,hunspell)
        ("hyphen" ,hyphen)
        ("icu4c" ,icu4c)
-       ("js-mathjax" ,js-mathjax)
+       ("mathjax" ,mathjax-bin)
        ("libmtp" ,libmtp)
        ("libpng" ,libpng)
        ("libusb" ,libusb)
@@ -243,8 +243,8 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "python2" "setup.py" "mathjax""--system-mathjax"
                      "--path-to-mathjax" (string-append
-                                          (assoc-ref inputs "js-mathjax")
-                                          "/share/javascript/mathjax"))
+                                          (assoc-ref inputs "mathjax")
+                                          "/lib/node_modules/mathjax/es5"))
              (invoke "python2" "setup.py" "rapydscript")))
          (add-after 'install 'install-man-pages
            (lambda* (#:key outputs #:allow-other-keys)
-- 
2.28.0


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

* [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import.
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
                       ` (2 preceding siblings ...)
  2020-08-16  7:03     ` [bug#42885] [PATCH 4/4] gnu: calibre: Add wrap phase for qtwebengine Brendan Tildesley
@ 2020-08-24  1:01     ` Leo Famulari
  3 siblings, 0 replies; 38+ messages in thread
From: Leo Famulari @ 2020-08-24  1:01 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 42885

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

On Sun, Aug 16, 2020 at 05:03:15PM +1000, Brendan Tildesley wrote:
> ---
>  gnu/packages/ebook.scm | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
> index d290b19f5f..aab4155d3d 100644
> --- a/gnu/packages/ebook.scm
> +++ b/gnu/packages/ebook.scm
> @@ -2,7 +2,7 @@
>  ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
>  ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
> -;;; Copyright © 2017, 2019 Brendan Tildesley <mail@brendan.scot>
> +;;; Copyright © 2017, 2019, 2020 Brendan Tildesley <mail@brendan.scot>
>  ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
>  ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
> @@ -28,7 +28,6 @@
>    #:use-module (guix download)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> -  #:use-module (gnu packages)
>    #:use-module (guix build-system python)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages compression)

I pushed this patch as 29f61501f309a719be91a47fd43872437435cd1a

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-16  7:03     ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Brendan Tildesley
@ 2020-08-24  1:05       ` Leo Famulari
  2020-08-24  4:25         ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Leo Famulari @ 2020-08-24  1:05 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 42885

On Sun, Aug 16, 2020 at 05:03:16PM +1000, Brendan Tildesley wrote:
> * gnu/packages/javascript.scm: (mathjax-bin): New variable

> +    (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.
> +
> +The package is derived from not the true source but the built version of
> +MathJax 3 for distribution by upstream. This package should eventually be
> +replaced my a package built directly from the source at
> +https://github.com/mathjax/MathJax-src.")

I'm not really familiar with the state of JavaScript in Guix. However,
Guix generally only includes packages built from source.

Is this a case where the package has bene "minified"? Or, in what way is
not built from source?




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  1:05       ` Leo Famulari
@ 2020-08-24  4:25         ` Arun Isaac
  2020-08-24  5:12           ` Brendan Tildesley
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-08-24  4:25 UTC (permalink / raw)
  To: Leo Famulari, Brendan Tildesley; +Cc: 42885

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


>> +The package is derived from not the true source but the built version of
>> +MathJax 3 for distribution by upstream. This package should eventually be
>> +replaced my a package built directly from the source at
>> +https://github.com/mathjax/MathJax-src.")
>
> I'm not really familiar with the state of JavaScript in Guix. However,
> Guix generally only includes packages built from source.

If I understand correctly, we already have a mathjax package built from
source. See js-mathjax.

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  4:25         ` Arun Isaac
@ 2020-08-24  5:12           ` Brendan Tildesley
  2020-08-24  6:44             ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-24  5:12 UTC (permalink / raw)
  To: Arun Isaac, Leo Famulari; +Cc: 42885

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

On August 24, 2020 2:25:16 PM GMT+10:00, Arun Isaac <arunisaac@systemreboot.net> wrote:
>
>>> +The package is derived from not the true source but the built
>version of
>>> +MathJax 3 for distribution by upstream. This package should
>eventually be
>>> +replaced my a package built directly from the source at
>>> +https://github.com/mathjax/MathJax-src.")
>>
>> I'm not really familiar with the state of JavaScript in Guix.
>However,
>> Guix generally only includes packages built from source.
>
>If I understand correctly, we already have a mathjax package built from
>source. See js-mathjax.

Mathjax 3 is a complete rewrite of mathjax 2. I had thought js-mathjax was just the component files too and not truely built from source. Maybe I was wrong. Currently, building this from the true source requires a huge number of js packages and we haven't got a npm importer and full JavaScript bootstrap yet so I wasn't sure what to do. If you like we can ignore this and I can modify calibre to disable mathjax for now since I don't think it works with the old mathjax 2. I would like to work on getting more JavaScript in to guix properly 

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  5:12           ` Brendan Tildesley
@ 2020-08-24  6:44             ` Arun Isaac
  2020-08-24  7:27               ` Brendan Tildesley
                                 ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Arun Isaac @ 2020-08-24  6:44 UTC (permalink / raw)
  To: Brendan Tildesley, Leo Famulari; +Cc: 42885

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


> I had thought js-mathjax was just the component files too and not
> truely built from source. Maybe I was wrong. Currently, building this
> from the true source requires a huge number of js packages and we
> haven't got a npm importer and full JavaScript bootstrap yet so I
> wasn't sure what to do.

True. js-mathjax is not truly built from source. A true source build
will properly depend on a huge number of other js packaces. js-mathjax
only redoes the minification step. In light of this, perhaps we should
remove js-mathjax from Guix. But, I'm not sure.

> If you like we can ignore this and I can modify calibre to disable
> mathjax for now since I don't think it works with the old mathjax 2. I
> would like to work on getting more JavaScript in to guix properly

Yes, disabling mathjax for calibre is a good way to go if the
functionality is not too critical. But, I don't know much about
calibre. So, someone else should take a call.

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  6:44             ` Arun Isaac
@ 2020-08-24  7:27               ` Brendan Tildesley
  2020-08-24  7:41               ` Brendan Tildesley
  2020-09-04 13:10               ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Ricardo Wurmus
  2 siblings, 0 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-24  7:27 UTC (permalink / raw)
  To: Arun Isaac, Leo Famulari; +Cc: 42885

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

On August 24, 2020 4:44:37 PM GMT+10:00, Arun Isaac <arunisaac@systemreboot.net> wrote:
>
>> I had thought js-mathjax was just the component files too and not
>> truely built from source. Maybe I was wrong. Currently, building this
>> from the true source requires a huge number of js packages and we
>> haven't got a npm importer and full JavaScript bootstrap yet so I
>> wasn't sure what to do.
>
>True. js-mathjax is not truly built from source. A true source build
>will properly depend on a huge number of other js packaces. js-mathjax
>only redoes the minification step. In light of this, perhaps we should
>remove js-mathjax from Guix. But, I'm not sure.
>
>> If you like we can ignore this and I can modify calibre to disable
>> mathjax for now since I don't think it works with the old mathjax 2.
>I
>> would like to work on getting more JavaScript in to guix properly
>
>Yes, disabling mathjax for calibre is a good way to go if the
>functionality is not too critical. But, I don't know much about
>calibre. So, someone else should take a call.


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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  6:44             ` Arun Isaac
  2020-08-24  7:27               ` Brendan Tildesley
@ 2020-08-24  7:41               ` Brendan Tildesley
  2020-09-04  9:02                 ` Ludovic Courtès
  2020-09-04 13:10               ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Ricardo Wurmus
  2 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-24  7:41 UTC (permalink / raw)
  To: Arun Isaac, Leo Famulari; +Cc: 42885

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

On August 24, 2020 4:44:37 PM GMT+10:00, Arun Isaac <arunisaac@systemreboot.net> wrote:
>
>> I had thought js-mathjax was just the component files too and not
>> truely built from source. Maybe I was wrong. Currently, building this
>> from the true source requires a huge number of js packages and we
>> haven't got a npm importer and full JavaScript bootstrap yet so I
>> wasn't sure what to do.
>
>True. js-mathjax is not truly built from source. A true source build
>will properly depend on a huge number of other js packaces. js-mathjax
>only redoes the minification step. In light of this, perhaps we should
>remove js-mathjax from Guix. But, I'm not sure.
>
>> If you like we can ignore this and I can modify calibre to disable
>> mathjax for now since I don't think it works with the old mathjax 2.
>I
>> would like to work on getting more JavaScript in to guix properly
>
>Yes, disabling mathjax for calibre is a good way to go if the
>functionality is not too critical. But, I don't know much about
>calibre. So, someone else should take a call.

Its just for rendering math in the eBook-viewer for books that include it. It shouldn't be essential. The reason I felt OK adding it is because its not like its actually proprietary, its just we haven't gotten around to integrating JavaScript into guix yet fully, and it doesn't look like that will happen any time soon.

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-3.
       [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
  2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
  2020-08-22 23:24   ` [bug#42885] ([PATCH 2/4] gnu: calibre: Update to 4.23.0 (new release) Brendan Tildesley
@ 2020-08-25  1:59   ` Brendan Tildesley
  2 siblings, 0 replies; 38+ messages in thread
From: Brendan Tildesley @ 2020-08-25  1:59 UTC (permalink / raw)
  To: 42885; +Cc: arunisaac, leo

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

This replaces the second patch, renaming mathjax-bin to mathjax-3 since 
its not actually binary.

[-- Attachment #2: 0002-gnu-Add-mathjax-3.patch --]
[-- Type: text/x-patch, Size: 2822 bytes --]

From 77e2312306c6684cdfc72f90e6be1a008e5e676f Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Sun, 16 Aug 2020 16:14:02 +1000
Subject: [PATCH 2/4] gnu: Add mathjax-3.

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

diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index d5ff5bffee..57e8302094 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,6 +129,45 @@ 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.")))
 
+(define-public mathjax-3
+  (package
+    (name "mathjax")
+    (version "3.0.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mathjax/MathJax")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1zd0chn0cjahi28qv3nzshwljz2hgmj6lizyvvd8qs89gsx0z3h9"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (let ((install-directory (string-append %output "/lib/node_modules/mathjax")))
+           (mkdir-p install-directory)
+           (copy-recursively (string-append (assoc-ref %build-inputs "source"))
+                             install-directory)))))
+    (home-page "https://www.mathjax.org/")
+    (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath (prebuilt)")
+    (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.
+
+The package is derived from not the true source but the built version of
+MathJax 3 for distribution by upstream. This package should eventually be
+replaced my a package built directly from the source at
+https://github.com/mathjax/MathJax-src.")
+    (license license:asl2.0)))
+
 (define-public js-respond
   (package
     (name "js-respond")
-- 
2.28.0


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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  7:41               ` Brendan Tildesley
@ 2020-09-04  9:02                 ` Ludovic Courtès
  2020-09-04 11:59                   ` Andreas Enge
  2020-09-04 18:13                   ` Arun Isaac
  0 siblings, 2 replies; 38+ messages in thread
From: Ludovic Courtès @ 2020-09-04  9:02 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 42885, Arun Isaac, Leo Famulari

Hello there!

Arun, Leo, what’s the status of this patch series?

  https://issues.guix.gnu.org/42885

Can it be applied?

Brendan, to make it clear what the latest version of the patch series is
(next time), consider adding a “v2” etc. suffix to the subject, like so:

  git format-patch --subject-prefix="PATCH v2" …

Thanks,
Ludo’.




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-04  9:02                 ` Ludovic Courtès
@ 2020-09-04 11:59                   ` Andreas Enge
  2020-09-04 18:13                   ` Arun Isaac
  1 sibling, 0 replies; 38+ messages in thread
From: Andreas Enge @ 2020-09-04 11:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42885, Arun Isaac, Brendan Tildesley, Leo Famulari

Hello,

On Fri, Sep 04, 2020 at 11:02:46AM +0200, Ludovic Courtès wrote:
> Arun, Leo, what’s the status of this patch series?
>   https://issues.guix.gnu.org/42885

why is the variable called mathjax-bin? Should it not be mathjax?

By the way, there is a version 3.1.0 now.

Andreas





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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-08-24  6:44             ` Arun Isaac
  2020-08-24  7:27               ` Brendan Tildesley
  2020-08-24  7:41               ` Brendan Tildesley
@ 2020-09-04 13:10               ` Ricardo Wurmus
  2 siblings, 0 replies; 38+ messages in thread
From: Ricardo Wurmus @ 2020-09-04 13:10 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885, mail, leo


Arun Isaac <arunisaac@systemreboot.net> writes:

>> I had thought js-mathjax was just the component files too and not
>> truely built from source. Maybe I was wrong. Currently, building this
>> from the true source requires a huge number of js packages and we
>> haven't got a npm importer and full JavaScript bootstrap yet so I
>> wasn't sure what to do.
>
> True. js-mathjax is not truly built from source. A true source build
> will properly depend on a huge number of other js packaces. js-mathjax
> only redoes the minification step. In light of this, perhaps we should
> remove js-mathjax from Guix. But, I'm not sure.

js-mathjax does not contain minified JavaScript.  The code is in
editable and readable form although it is not in the form that upstream
uses for development.  In this case I still consider it to be actual
source code, because for the purposes of Guix this is the preferred
format (given that we have no way of building the sources in the format
that is used by upstream).

-- 
Ricardo




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-04  9:02                 ` Ludovic Courtès
  2020-09-04 11:59                   ` Andreas Enge
@ 2020-09-04 18:13                   ` Arun Isaac
  2020-09-04 19:43                     ` Ricardo Wurmus
  1 sibling, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-04 18:13 UTC (permalink / raw)
  To: Ludovic Courtès, Brendan Tildesley
  Cc: Ricardo Wurmus, 42885, Leo Famulari


> Arun, Leo, what’s the status of this patch series?
>
>   https://issues.guix.gnu.org/42885
>
> Can it be applied?

Ricardo has clarified that we may consider the existing js-mathjax 2.7.2
package to have been built from source even though it isn't the form
upstream uses for development. No problems there.

But, like Brendan said, mathjax 3 is quite a different beast. With
mathjax 2, the source was in javascript, and our build system had merely
to minify it. But mathjax 3 is written in typescript that gets compiled
into javascript and then combined into "web component files" (this is
the first I'm hearing of web components and I'm not entirely clear what
they are). Since we don't have a typescript build system, packaging
mathjax 3 may be non-trivial. So, we should proceed with updating
calibre without mathjax support.

> Brendan, to make it clear what the latest version of the patch series is
> (next time), consider adding a “v2” etc. suffix to the subject, like so:
>
>   git format-patch --subject-prefix="PATCH v2" …

You could also do the slightly shorter

git format-patch -v2 ...

Cheers!




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-04 18:13                   ` Arun Isaac
@ 2020-09-04 19:43                     ` Ricardo Wurmus
  2020-09-09  6:36                       ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Ricardo Wurmus @ 2020-09-04 19:43 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari


Arun Isaac <arunisaac@systemreboot.net> writes:

>> Arun, Leo, what’s the status of this patch series?
>>
>>   https://issues.guix.gnu.org/42885
>>
>> Can it be applied?
>
> Ricardo has clarified that we may consider the existing js-mathjax 2.7.2
> package to have been built from source even though it isn't the form
> upstream uses for development. No problems there.
>
> But, like Brendan said, mathjax 3 is quite a different beast. With
> mathjax 2, the source was in javascript, and our build system had merely
> to minify it. But mathjax 3 is written in typescript that gets compiled
> into javascript and then combined into "web component files" (this is
> the first I'm hearing of web components and I'm not entirely clear what
> they are). Since we don't have a typescript build system, packaging
> mathjax 3 may be non-trivial. So, we should proceed with updating
> calibre without mathjax support.

There may be a way to transpile the TypeScript sources with swc, a
babel-like transpiler with TypeScript support; it’s written in Rust, so
there may be a way to work around the JavaScript packaging problem.

-- 
Ricardo




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

* [bug#42885] Regarding Patch 4
  2020-08-16  6:55 [bug#42885] [PATCH 0/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
  2020-08-21  9:20 ` [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0 Brendan Tildesley
       [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
@ 2020-09-07  3:11 ` Prafulla Giri
  2020-09-07  3:40   ` Prafulla Giri
  2 siblings, 1 reply; 38+ messages in thread
From: Prafulla Giri @ 2020-09-07  3:11 UTC (permalink / raw)
  To: 42885


[-- Attachment #1.1: Type: text/plain, Size: 1034 bytes --]

Hey there Mr. Tildesley,

Without knowing that this was going on, I worked on, and sent a patch to
fix the QtWebEngineProcess issue yesterday:
https://issues.guix.gnu.org/43249

My patch also fixes this issue, but without appending things to PYTHONPATH.
And it works just the same.

Since you say, sir, that you copied the wrap-phase from Anki to fix the
issue, and I manually poked around with things, grepping the output of
`env` and stuff to deal with it - I wonder if I have stumbled upon the bare
minimum changes necessary to resolve this issue.

I would like to request that you, and other esteemed contributors, test my
patch. And, if it seems good to you, I would like to request that you
incorporate my patch in this change set.

Attached are the wrappers for `ebook-viewer`: with your patch applied, and
with my patch applied, for anyone to compare.

Please do let me know if there are any insufficiencies in my solution, or
if it does not work for anybody else (I did use --pure option with `guix
environment`).

Thank you

[-- Attachment #1.2: Type: text/html, Size: 1322 bytes --]

[-- Attachment #2: ebook-viewer_MrTildesley --]
[-- Type: application/octet-stream, Size: 7547 bytes --]

[-- Attachment #3: ebook-viewer_peanutbutterandcrackers --]
[-- Type: application/octet-stream, Size: 4457 bytes --]

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

* [bug#42885] Regarding Patch 4
  2020-09-07  3:11 ` [bug#42885] Regarding Patch 4 Prafulla Giri
@ 2020-09-07  3:40   ` Prafulla Giri
  0 siblings, 0 replies; 38+ messages in thread
From: Prafulla Giri @ 2020-09-07  3:40 UTC (permalink / raw)
  To: 42885

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

I just realized that the PYTHONPATH set by the default %standard-phase
'wrap of python-build-environment is (most likely) a superset of the manual
PYTHONPATH set by the custom phase 'wrap phase added after 'install in
patch no. 4. As such, perhaps it is redundant, too?

On Mon, Sep 7, 2020 at 8:56 AM Prafulla Giri <pratheblackdiamond@gmail.com>
wrote:

> Hey there Mr. Tildesley,
>
> Without knowing that this was going on, I worked on, and sent a patch to
> fix the QtWebEngineProcess issue yesterday:
> https://issues.guix.gnu.org/43249
>
> My patch also fixes this issue, but without appending things to
> PYTHONPATH. And it works just the same.
>
> Since you say, sir, that you copied the wrap-phase from Anki to fix the
> issue, and I manually poked around with things, grepping the output of
> `env` and stuff to deal with it - I wonder if I have stumbled upon the bare
> minimum changes necessary to resolve this issue.
>
> I would like to request that you, and other esteemed contributors, test my
> patch. And, if it seems good to you, I would like to request that you
> incorporate my patch in this change set.
>
> Attached are the wrappers for `ebook-viewer`: with your patch applied, and
> with my patch applied, for anyone to compare.
>
> Please do let me know if there are any insufficiencies in my solution, or
> if it does not work for anybody else (I did use --pure option with `guix
> environment`).
>
> Thank you
>

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-04 19:43                     ` Ricardo Wurmus
@ 2020-09-09  6:36                       ` Arun Isaac
  2020-09-09  7:19                         ` Ricardo Wurmus
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-09  6:36 UTC (permalink / raw)
  To: Ricardo Wurmus
  Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari

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


> There may be a way to transpile the TypeScript sources with swc, a
> babel-like transpiler with TypeScript support; it’s written in Rust, so
> there may be a way to work around the JavaScript packaging problem.

I am packaging swc for Guix. I'm running into some unstable feature
issues with Rust, but otherwise things are going well. I will report on
further progress by tonight.

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-09  6:36                       ` Arun Isaac
@ 2020-09-09  7:19                         ` Ricardo Wurmus
  2020-09-09 19:48                           ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Ricardo Wurmus @ 2020-09-09  7:19 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari


Arun Isaac <arunisaac@systemreboot.net> writes:

>> There may be a way to transpile the TypeScript sources with swc, a
>> babel-like transpiler with TypeScript support; it’s written in Rust, so
>> there may be a way to work around the JavaScript packaging problem.
>
> I am packaging swc for Guix. I'm running into some unstable feature
> issues with Rust, but otherwise things are going well. I will report on
> further progress by tonight.

Oh, me too.

I’m currently at rust-napi@0.4.

-- 
Ricardo




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-09  7:19                         ` Ricardo Wurmus
@ 2020-09-09 19:48                           ` Arun Isaac
  2020-09-17 10:14                             ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-09 19:48 UTC (permalink / raw)
  To: Ricardo Wurmus
  Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari

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


>> I am packaging swc for Guix. I'm running into some unstable feature
>> issues with Rust, but otherwise things are going well. I will report on
>> further progress by tonight.
>
> Oh, me too.

Oops, hopefully we haven't duplicated too much work.

Packaging rust programs is a much deeper rabbit hole than I imagined!
But, I'm making progress, and will hopefully be done given some more
time. Will keep you posted.

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-09 19:48                           ` Arun Isaac
@ 2020-09-17 10:14                             ` Arun Isaac
  2020-09-17 11:24                               ` Ricardo Wurmus
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-17 10:14 UTC (permalink / raw)
  To: Ricardo Wurmus
  Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari

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


Hi,

I have finished packaging swc. I am now mid-way through cleaning up and
committing my changes. Considering the number of commits, that alone
might take a couple more days. I will push my changes to a wip-swc
branch and let you know.

But, I also have some bad news. swc is not entirely written in rust. Its
CLI, swc-cli, is a separate package and uses node. So, packaging that
may be yet another deep rabbit hole.

Regards,
Arun

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

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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-17 10:14                             ` Arun Isaac
@ 2020-09-17 11:24                               ` Ricardo Wurmus
  2020-09-21 10:36                                 ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Ricardo Wurmus @ 2020-09-17 11:24 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari


Hi Arun,

> I have finished packaging swc. I am now mid-way through cleaning up and
> committing my changes. Considering the number of commits, that alone
> might take a couple more days. I will push my changes to a wip-swc
> branch and let you know.

Wow, thank you very much!

> But, I also have some bad news. swc is not entirely written in rust. Its
> CLI, swc-cli, is a separate package and uses node. So, packaging that
> may be yet another deep rabbit hole.

I expected as much, but I was hoping that we could invoke it some other
way, much like we invoke uglify-js (the Common Lisp package) with a
little custom wrapper.

-- 
Ricardo




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-17 11:24                               ` Ricardo Wurmus
@ 2020-09-21 10:36                                 ` Arun Isaac
  2020-09-21 11:08                                   ` Brendan Tildesley
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-21 10:36 UTC (permalink / raw)
  To: Ricardo Wurmus
  Cc: 42885, Ludovic Courtès, Brendan Tildesley, Leo Famulari


I have pushed my commits to a new wip-swc branch. A few questions and
discussion points below.

Considering that only the source of rust dependencies is used, should
those packages successfully build on their own? In the wip-swc branch, I
have only verified that the rust-swc package builds. There may be some
dependencies which fail to build on their own.
  
Related to the previous question, what is the purpose of the
#:skip-build? argument? Should it be set to #t for all dependency
packages?

While working on this patchset, I hacked the crate importer a bit to
make my life easier. In particular, I modified it to correctly append
the version to the package variable name. This requires a slightly more
general recursive importer than we have currently. The current recursive
importer assumes that we will package only one version for each
package. That assumption does not stand for rust crates.

We also don't always need to put the minor version into the package
variable name. For example, rust-syn-1 is sufficient. rust-syn-1.0 is
not required. The exact rules follow from
https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
I improved the crate importer to better understand these version
requirement rules and put packages of the correct version into the
#:cargo-inputs and #:cargo-development-inputs fields.

I will send patches for these crate importer improvements separately
after this patchset is approved.

We also need some automated way to "garbage collect" old versions of
packages in crates-io.scm. crates-io.scm is getting quite large, and I
suspect many packages in there are old versions that are not really
necessary.

> I expected as much, but I was hoping that we could invoke it some other
> way, much like we invoke uglify-js (the Common Lisp package) with a
> little custom wrapper.

That is a good idea. But, I have never written any rust. Perhaps someone
who is more familiar with rust should write it.




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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-21 10:36                                 ` Arun Isaac
@ 2020-09-21 11:08                                   ` Brendan Tildesley
  2020-09-22  5:39                                     ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-09-21 11:08 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885

On 21/9/20 8:36 pm, Arun Isaac wrote:
> ...
> While working on this patchset, I hacked the crate importer a bit to
> make my life easier. In particular, I modified it to correctly append
> the version to the package variable name. This requires a slightly more
> general recursive importer than we have currently. The current recursive
> importer assumes that we will package only one version for each
> package. That assumption does not stand for rust crates.
Are you aware of this importer: https://issues.guix.gnu.org/issue/38408/ ?





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

* [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3).
  2020-09-21 11:08                                   ` Brendan Tildesley
@ 2020-09-22  5:39                                     ` Arun Isaac
  2020-09-29 23:56                                       ` [bug#42885] Merge wip-swc Brendan Tildesley
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-22  5:39 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 42885

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


>> While working on this patchset, I hacked the crate importer a bit to
>> make my life easier.

> Are you aware of this importer: https://issues.guix.gnu.org/issue/38408/ ?

Oh, I wasn't aware of this importer. It seems to address my
concerns. So, I'll just wait for it to get merged into master.

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

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

* [bug#42885] Merge wip-swc
  2020-09-22  5:39                                     ` Arun Isaac
@ 2020-09-29 23:56                                       ` Brendan Tildesley
  2020-09-30  5:38                                         ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-09-29 23:56 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885


BTW, is it possible for your wip-swc branch to be merged into master? I 
found my self building a package of my own starting from this branch 
because it includes the rust packages I needed. Is there any reason it 
can't be done? It would be convenient for me at least.





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

* [bug#42885] Merge wip-swc
  2020-09-29 23:56                                       ` [bug#42885] Merge wip-swc Brendan Tildesley
@ 2020-09-30  5:38                                         ` Arun Isaac
  2020-10-12  7:23                                           ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-09-30  5:38 UTC (permalink / raw)
  To: Brendan Tildesley, Ricardo Wurmus; +Cc: 42885

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


> BTW, is it possible for your wip-swc branch to be merged into master?

I think it can be done. I was just waiting for someone to review and
approve it.

@Ricardo: Shall I go ahead and merge?

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

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

* [bug#42885] Merge wip-swc
  2020-09-30  5:38                                         ` Arun Isaac
@ 2020-10-12  7:23                                           ` Arun Isaac
  2020-10-12 22:17                                             ` Brendan Tildesley
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-10-12  7:23 UTC (permalink / raw)
  To: Brendan Tildesley, Ricardo Wurmus; +Cc: 42885


I have merged wip-swc into master. Should this bug report be closed now?
Is there any pending work here related to calibre? We need a typescript
build system that uses swc. But, we should handle that in a separate bug
report.

Thanks!




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

* [bug#42885] Merge wip-swc
  2020-10-12  7:23                                           ` Arun Isaac
@ 2020-10-12 22:17                                             ` Brendan Tildesley
  2020-10-13 18:44                                               ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Brendan Tildesley @ 2020-10-12 22:17 UTC (permalink / raw)
  To: Arun Isaac, Ricardo Wurmus; +Cc: 42885

On 12/10/20 5:23 pm, Arun Isaac wrote:
> I have merged wip-swc into master. Should this bug report be closed now?
> Is there any pending work here related to calibre? We need a typescript
> build system that uses swc. But, we should handle that in a separate bug
> report.
>
> Thanks!

Thank you very much.

I'm kind of worried how long it will take to get that build system. Even 
if we have it, will it really succeed at building MathJax so easily? If 
it's going to take a while, I'm tempted to just update Calibre without 
mathjax support. In theory I'm willing to do work to help but it all 
seems rather advanced for me, so i'm glad to see you make progress. 
What's the next step?

Calibre 5+ is out now which is on python3. I could even create a 
calibre-next so that both calibre@4.18.0 exists and calibre will be 
calibre@5.0.1, utilizing Guix's design.





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

* [bug#42885] Merge wip-swc
  2020-10-12 22:17                                             ` Brendan Tildesley
@ 2020-10-13 18:44                                               ` Arun Isaac
  2020-10-13 21:22                                                 ` Ricardo Wurmus
  0 siblings, 1 reply; 38+ messages in thread
From: Arun Isaac @ 2020-10-13 18:44 UTC (permalink / raw)
  To: Brendan Tildesley, Ricardo Wurmus; +Cc: 42885


> Thank you very much.

:-)

> I'm kind of worried how long it will take to get that build system. Even 
> if we have it, will it really succeed at building MathJax so easily? If 
> it's going to take a while, I'm tempted to just update Calibre without 
> mathjax support. In theory I'm willing to do work to help but it all 
> seems rather advanced for me, so i'm glad to see you make progress. 
> What's the next step?

True, I have similar concerns too. The next step, like Ricardo said, is
to write a simple rust script that uses rust-swc to compile typescript
to javascript. I am unfamiliar with both rust and typescript. So, if I
am to do it, I would need some time. If someone else volunteers to do
it, that would be great.

> Calibre 5+ is out now which is on python3. I could even create a 
> calibre-next so that both calibre@4.18.0 exists and calibre will be 
> calibre@5.0.1, utilizing Guix's design.

I think we shouldn't let the typescript build system and mathjax block
calibre. If I understand correctly, calibre depends on mathjax only
optionally. So, you should go ahead with your work on calibre regardless
of what happens with mathjax.




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

* [bug#42885] Merge wip-swc
  2020-10-13 18:44                                               ` Arun Isaac
@ 2020-10-13 21:22                                                 ` Ricardo Wurmus
  2020-10-19 18:45                                                   ` Arun Isaac
  0 siblings, 1 reply; 38+ messages in thread
From: Ricardo Wurmus @ 2020-10-13 21:22 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42885, Brendan Tildesley


Arun Isaac <arunisaac@systemreboot.net> writes:

>> I'm kind of worried how long it will take to get that build system. Even 
>> if we have it, will it really succeed at building MathJax so easily? If 
>> it's going to take a while, I'm tempted to just update Calibre without 
>> mathjax support. In theory I'm willing to do work to help but it all 
>> seems rather advanced for me, so i'm glad to see you make progress. 
>> What's the next step?
>
> True, I have similar concerns too. The next step, like Ricardo said, is
> to write a simple rust script that uses rust-swc to compile typescript
> to javascript. I am unfamiliar with both rust and typescript. So, if I
> am to do it, I would need some time. If someone else volunteers to do
> it, that would be great.

I looked at this today, but my rust-foo is very, very weak.
I tried to compile this:

  https://github.com/swc-project/swc/blob/master/examples/usage.rs

jlicht told me on IRC that we also have a package for esbuild now, which
could also be used for transpiling TypeScript to JS.

-- 
Ricardo




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

* [bug#42885] Merge wip-swc
  2020-10-13 21:22                                                 ` Ricardo Wurmus
@ 2020-10-19 18:45                                                   ` Arun Isaac
  0 siblings, 0 replies; 38+ messages in thread
From: Arun Isaac @ 2020-10-19 18:45 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 42885, Brendan Tildesley


[-- Attachment #1.1: Type: text/plain, Size: 815 bytes --]


> I looked at this today, but my rust-foo is very, very weak.
> I tried to compile this:
>
>   https://github.com/swc-project/swc/blob/master/examples/usage.rs

I managed to get this working. Please see the attached tarball. The
steps to test are:

Unpack the tarball and change directory.
Clone the swc git repo.
Build and run using cargo.

--8<---------------cut here---------------start------------->8---
tar xvf miniswc.tar.gz
cd miniswc
git clone https://github.com/swc-project
cargo run
--8<---------------cut here---------------end--------------->8---

src/main.rs in the tarball is a slightly modified version of
examples/usage.rs in the swc git repo. On running, it transpiles the
file foo.ts and outputs to stdout.

The next step is to see if this is any good for building MathJax from
source.

Cheers!


[-- Attachment #1.2: miniswc.tar.gz --]
[-- Type: application/octet-stream, Size: 883 bytes --]

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

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

end of thread, other threads:[~2020-10-19 18:46 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16  6:55 [bug#42885] [PATCH 0/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
2020-08-21  9:20 ` [bug#42885] [PATCH] gnu: calibre: Update to 4.23.0 Brendan Tildesley
2020-08-22 17:30   ` Leo Famulari
     [not found] ` <handler.42885.B.159756092810548.ack@debbugs.gnu.org>
2020-08-16  7:03   ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Brendan Tildesley
2020-08-16  7:03     ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Brendan Tildesley
2020-08-24  1:05       ` Leo Famulari
2020-08-24  4:25         ` Arun Isaac
2020-08-24  5:12           ` Brendan Tildesley
2020-08-24  6:44             ` Arun Isaac
2020-08-24  7:27               ` Brendan Tildesley
2020-08-24  7:41               ` Brendan Tildesley
2020-09-04  9:02                 ` Ludovic Courtès
2020-09-04 11:59                   ` Andreas Enge
2020-09-04 18:13                   ` Arun Isaac
2020-09-04 19:43                     ` Ricardo Wurmus
2020-09-09  6:36                       ` Arun Isaac
2020-09-09  7:19                         ` Ricardo Wurmus
2020-09-09 19:48                           ` Arun Isaac
2020-09-17 10:14                             ` Arun Isaac
2020-09-17 11:24                               ` Ricardo Wurmus
2020-09-21 10:36                                 ` Arun Isaac
2020-09-21 11:08                                   ` Brendan Tildesley
2020-09-22  5:39                                     ` Arun Isaac
2020-09-29 23:56                                       ` [bug#42885] Merge wip-swc Brendan Tildesley
2020-09-30  5:38                                         ` Arun Isaac
2020-10-12  7:23                                           ` Arun Isaac
2020-10-12 22:17                                             ` Brendan Tildesley
2020-10-13 18:44                                               ` Arun Isaac
2020-10-13 21:22                                                 ` Ricardo Wurmus
2020-10-19 18:45                                                   ` Arun Isaac
2020-09-04 13:10               ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-bin (MathJax 3) Ricardo Wurmus
2020-08-16  7:03     ` [bug#42885] [PATCH 3/4] gnu: calibre: Update to 4.22.0 Brendan Tildesley
2020-08-16  7:03     ` [bug#42885] [PATCH 4/4] gnu: calibre: Add wrap phase for qtwebengine Brendan Tildesley
2020-08-24  1:01     ` [bug#42885] [PATCH 1/4] gnu: ebook.scm: remove duplicate module import Leo Famulari
2020-08-22 23:24   ` [bug#42885] ([PATCH 2/4] gnu: calibre: Update to 4.23.0 (new release) Brendan Tildesley
2020-08-25  1:59   ` [bug#42885] [PATCH 2/4] gnu: Add mathjax-3 Brendan Tildesley
2020-09-07  3:11 ` [bug#42885] Regarding Patch 4 Prafulla Giri
2020-09-07  3:40   ` Prafulla Giri

unofficial mirror of guix-patches@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-patches/1 guix-patches/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-patches guix-patches/ https://yhetil.org/guix-patches \
		guix-patches@gnu.org
	public-inbox-index guix-patches

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.patches


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git