From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 14 15:50:14 2021 Received: (at 42885) by debbugs.gnu.org; 14 Jan 2021 20:50:14 +0000 Received: from localhost ([127.0.0.1]:39424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l09ZO-0006OO-B5 for submit@debbugs.gnu.org; Thu, 14 Jan 2021 15:50:14 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l09ZM-0006OG-JH for 42885@debbugs.gnu.org; Thu, 14 Jan 2021 15:50:13 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1610657403; cv=none; d=zohomail.com; s=zohoarc; b=d43IREa89n+G4Bcwo4BjGKVD3PsE9fVMgV3XplvQ8JWxXzQgSTUIKJcHAcE/ReaSPoFstMAdnlaxgokZFZ75l0L8WU0gZFWyE6R+A4bzIBA0odtYS+uMaR/NnxoYMaUXxQwDloAn2xOoOTuTLmGXkxY38bZnT5b8An2q84J/DUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610657403; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=tCBEQ8omvaeEhqaM/fEIZlb4VLqaYetxRAsFKl+JbXE=; b=N+vYz799GCoNfb5MqW+fnZFLaL+Dlqr7cQigCU0u5sUzPyXveePssRLE0KHLccZMyltjii/kVJ5pixtYsioRwEtTdPUFc31QSoD4qSy0rZrOBRdPaFLHea3k1ySYhlhsnBISeOBVGC0xOT/ZHHo0ASz+Obp0JnjkQk+RUDmpNBs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1610657403; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type; bh=tCBEQ8omvaeEhqaM/fEIZlb4VLqaYetxRAsFKl+JbXE=; b=gnWgBRXQKNvdubB7mh2xE3Wt0NzfZR/7+RP8EIg7awuEuiZ2pnQ977rfLQy+mSo7 Zceq2LrgzTx1lOkVV68uYhzRudrGyhpRwG9RjAF6c5vSqy23BCGJGy/c2k0yBe5MvEU rZy7LT19enFIhFOikua0f3gV+jaTWYdVVLVb4ZH4= Received: from localhost (p54ad4ef9.dip0.t-ipconnect.de [84.173.78.249]) by mx.zohomail.com with SMTPS id 1610657401965676.9803526333802; Thu, 14 Jan 2021 12:50:01 -0800 (PST) References: <87y2lpvrrd.fsf@gnu.org> <87zh65csve.fsf@systemreboot.net> <871rjhfhtt.fsf@elephly.net> <87y2lj1moa.fsf@systemreboot.net> <877dt3ct7u.fsf@elephly.net> <87sgbq20kw.fsf@systemreboot.net> <874knwbtgv.fsf@systemreboot.net> <87a6xove66.fsf@elephly.net> <87y2l3zaa4.fsf@systemreboot.net> <87pn6eid4c.fsf@systemreboot.net> <7d55f6f8-ff58-c548-8bec-8508a71be2cf@brendan.scot> <87ft6zx1rh.fsf@systemreboot.net> <87a6wr29i2.fsf@systemreboot.net> <87blh6q835.fsf@systemreboot.net> <87blh5yg6o.fsf@elephly.net> <87zh4i6on4.fsf@systemreboot.net> <87eeioanm3.fsf_-_@gnu.org> <874kjjsgxr.fsf@systemreboot.net> User-agent: mu4e 1.4.13; emacs 27.1 From: Ricardo Wurmus To: Arun Isaac Subject: Re: bug#42885: [PATCH 0/4] gnu: calibre: Update to 4.22.0. In-reply-to: <874kjjsgxr.fsf@systemreboot.net> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 14 Jan 2021 21:49:58 +0100 Message-ID: <87k0sfckg9.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42885 Cc: 42885@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= , Brendan Tildesley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Arun Isaac writes: > I got a minimal swc (attached in my previous mail) working. This minimal > swc works for compiling typescript to javascript. But, I haven't figured > out how to use it to build web components. We can also try esbuild. > This is blocking packaging > mathjax v3, and thus calibre. I feel that if calibre can go ahead > without mathjax v3, it should. Then, we can close this issue and open a > separate one for web components and mathjax. I=E2=80=99ve been trying to package mathjax v3 for a while, but didn=E2=80= =99t get far enough to present anything yet. Here=E2=80=99s what I have: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=p.patch diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index 8434836c6f..e6ff5d619d 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -27,6 +27,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages lisp-xyz) + #:use-module (gnu packages node) #:use-module (gnu packages readline) #:use-module (gnu packages web) #:use-module (guix packages) @@ -270,6 +271,95 @@ of wicked-good-xpath together with xmldom.") (license (list license:expat license:lgpl2.0))))) +(define-public js-mathjax-3 + (package + (name "js-mathjax") + (version "3.1.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mathjax/MathJax-src") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0kqcb6pl0zfs4hf8zqb4l50kkfq7isv35vpy05m0lg0yr9w0w4ai")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) + (ice-9 match)) + (set-path-environment-variable + "PATH" '("bin") (map (match-lambda + ((_ . input) + input)) + %build-inputs)) + (copy-recursively (assoc-ref %build-inputs "source") + "source") + (chdir "source") + + ;; TODO: we can't build this because it depends on + ;; speech-rule-engine. + ;;(delete-file-recursively "ts/a11y") + (delete-file-recursively "components/src/a11y") + + ;;(delete-file-recursively "components/src/sre") + ;; This file copies a11y files, which we don't build (see above). + (delete-file "components/src/node-main/copy.json") + + (substitute* '("components/bin/build" + "components/bin/pack" + "components/bin/copy" + "components/bin/makeAll") + (("/usr/bin/env node") + (which "node"))) + + ;; Make the compiled files of the context menu available. + (mkdir-p "mj-context-menu/js") + (copy-recursively (string-append (assoc-ref %build-inputs "js-context-menu") + "/share/javascript/context-menu") + "mj-context-menu/js") + + (let ((esbuild (string-append (assoc-ref %build-inputs "esbuild") + "/bin/esbuild")) + (node (string-append (assoc-ref %build-inputs "node") + "/bin/node")) + (target (string-append %output "/share/javascript/mathjax"))) + + ;; Transpile TypeScript + (apply invoke esbuild + "--bundle" + "--tsconfig=tsconfig.json" + "--platform=node" + "--outdir=js" + (find-files "ts" "\\.ts$")) + + (setenv "HOME" "/tmp") + (with-directory-excursion "components" + ;; This requires network access + (substitute* "bin/makeAll" + (("processDir\\(fulldir, webpackLib\\);") "")) + (invoke node "bin/makeAll" "src")) + + ;; Build components + (invoke esbuild + "components/src/tex-chtml-full/tex-chtml-full.js" + "--bundle" + "--minify" + "--platform=node" + (string-append "--outfile=" target "/es5/mml-chtml.js")))))) + (native-inputs + `(("esbuild" ,esbuild) + ("node" ,node-10.22) + ("js-context-menu" ,js-context-menu))) + (home-page "https://www.mathjax.org/") + (synopsis "TODO") + (description "TODO") + (license license:asl2.0))) + (define-public js-respond (package (name "js-respond") --=-=-= Content-Type: text/plain -- Ricardo --=-=-=--