From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGWvS-00039e-5p for guix-patches@gnu.org; Wed, 09 May 2018 17:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGWvO-000439-2q for guix-patches@gnu.org; Wed, 09 May 2018 17:47:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGWvN-000431-W7 for guix-patches@gnu.org; Wed, 09 May 2018 17:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fGWvN-0000T2-P7 for guix-patches@gnu.org; Wed, 09 May 2018 17:47:01 -0400 Subject: [bug#31395] [PATCH 1/2] gnu: Add js-filesaver. References: <20180509214400.28846-1-mail@nicolasgoaziou.fr> In-Reply-To: <20180509214400.28846-1-mail@nicolasgoaziou.fr> Resent-Message-ID: From: Nicolas Goaziou Date: Wed, 9 May 2018 23:46:21 +0200 Message-Id: <20180509214622.28928-1-mail@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31395@debbugs.gnu.org * 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 ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2017 Efraim Flashner +;;; Copyright © 2018 Nicolas Goaziou ;;; ;;; 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., + ;; + (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