summaryrefslogtreecommitdiff
path: root/gnu/packages/javascript.scm
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-05-09 23:14:58 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-05-11 10:35:41 +0200
commit11b43f996e08fa4789fb245bfd516071cbbf37b2 (patch)
treec8af2d41cb6b34a10e35e0c16ffc6948d0a8bdaa /gnu/packages/javascript.scm
parent0bcb9258172eee531cec199ec0b33a8e622b3e06 (diff)
gnu: Add js-filesaver.
* gnu/packages/javascript.scm (js-filesaver): New variable.
Diffstat (limited to 'gnu/packages/javascript.scm')
-rw-r--r--gnu/packages/javascript.scm39
1 files changed, 39 insertions, 0 deletions
diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index a54d4ecabd3..e2742faa115 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -3,6 +3,7 @@
3;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> 3;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> 4;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
5;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> 5;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
6;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6;;; 7;;;
7;;; This file is part of GNU Guix. 8;;; This file is part of GNU Guix.
8;;; 9;;;
@@ -368,6 +369,44 @@ to ES5 without causing run-time errors in older engines. In many cases, this
368means that these shams cause many ES5 methods to silently fail.") 369means that these shams cause many ES5 methods to silently fail.")
369 (license license:expat))) 370 (license license:expat)))
370 371
372(define-public js-filesaver
373 (package
374 (name "js-filesaver")
375 (version "1.3.8")
376 (source (origin
377 (method url-fetch)
378 (uri (string-append "https://github.com/eligrey/FileSaver.js/"
379 "archive/" version ".tar.gz"))
380 (file-name (string-append name "-" version))
381 (sha256
382 (base32
383 "1rkhfqs5plaj628kzj7qgm5qahy4v7ihygifidqr6g6265mil97h"))))
384 (build-system minify-build-system)
385 (arguments
386 `(#:phases
387 (modify-phases %standard-phases
388 (add-after 'unpack 'fix-uglification
389 ;; Remove "export" keyword which prevents the file from being
390 ;; uglified by uglify-js. Moreover, that keyword is not present in
391 ;; the minified version of the library some projects are using,
392 ;; e.g.,
393 ;; <https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/blob/master/FileSaver.min.js>
394 (lambda _
395 (substitute* "src/FileSaver.js"
396 (("export ") ""))
397 #t)))))
398 (home-page
399 "https://eligrey.com/blog/saving-generated-files-on-the-client-side/")
400 (synopsis "HTML5 saveAs() FileSaver implementation")
401 (description "@file{FileSaver.js} implements the @code{saveAs()}
402FileSaver interface in browsers that do not natively support it.
403
404@file{FileSaver.js} is the solution to saving files on the
405client-side, and is perfect for webapps that need to generate files,
406or for saving sensitive information that shouldn't be sent to an
407external server.")
408 (license license:expat)))
409
371(define-public mujs 410(define-public mujs
372 (package 411 (package
373 (name "mujs") 412 (name "mujs")