all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: 31395@debbugs.gnu.org
Subject: [bug#31395] [PATCH 1/2] gnu: Add js-filesaver.
Date: Wed,  9 May 2018 23:46:21 +0200	[thread overview]
Message-ID: <20180509214622.28928-1-mail@nicolasgoaziou.fr> (raw)
In-Reply-To: <20180509214400.28846-1-mail@nicolasgoaziou.fr>

* gnu/packages/javascript.scm (js-filesaver): New variable.
---
 gnu/packages/javascript.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm
index a54d4ecab..e2742faa1 100644
--- a/gnu/packages/javascript.scm
+++ b/gnu/packages/javascript.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -368,6 +369,44 @@ to ES5 without causing run-time errors in older engines.  In many cases, this
 means that these shams cause many ES5 methods to silently fail.")
     (license license:expat)))
 
+(define-public js-filesaver
+  (package
+    (name "js-filesaver")
+    (version "1.3.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/eligrey/FileSaver.js/"
+                                  "archive/" version ".tar.gz"))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32
+                "1rkhfqs5plaj628kzj7qgm5qahy4v7ihygifidqr6g6265mil97h"))))
+    (build-system minify-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-uglification
+           ;; Remove "export" keyword which prevents the file from being
+           ;; uglified by uglify-js.  Moreover, that keyword is not present in
+           ;; the minified version of the library some projects are using,
+           ;; e.g.,
+           ;; <https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/blob/master/FileSaver.min.js>
+           (lambda _
+             (substitute* "src/FileSaver.js"
+               (("export ") ""))
+             #t)))))
+    (home-page
+     "https://eligrey.com/blog/saving-generated-files-on-the-client-side/")
+    (synopsis "HTML5 saveAs() FileSaver implementation")
+    (description "@file{FileSaver.js} implements the @code{saveAs()}
+FileSaver interface in browsers that do not natively support it.
+
+@file{FileSaver.js} is the solution to saving files on the
+client-side, and is perfect for webapps that need to generate files,
+or for saving sensitive information that shouldn't be sent to an
+external server.")
+    (license license:expat)))
+
 (define-public mujs
   (package
     (name "mujs")
-- 
2.17.0

  reply	other threads:[~2018-05-09 21:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 21:44 [bug#31395] [PATCH 0/2] Add Snap! educational programming language Nicolas Goaziou
2018-05-09 21:46 ` Nicolas Goaziou [this message]
2018-05-09 21:46   ` [bug#31395] [PATCH 2/2] gnu: Add snap Nicolas Goaziou
2018-05-10  2:36     ` Eric Bavier
2018-05-10 13:10       ` Nicolas Goaziou
2018-05-10 13:47         ` Eric Bavier
2018-05-10 15:58           ` Nicolas Goaziou
2018-05-11  2:32             ` Eric Bavier
2018-05-11  8:46               ` bug#31395: " Nicolas Goaziou

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20180509214622.28928-1-mail@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=31395@debbugs.gnu.org \
    /path/to/YOUR_REPLY

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

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

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

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