diff options
| author | Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | 2017-06-22 17:19:39 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2017-06-23 08:14:41 +0200 |
| commit | b37b48f8192678c1c0f72a62d3ad33c19da55d14 (patch) | |
| tree | ddfb907ddd67f5bdbc6185b551f64768163fc628 /gnu/packages/javascript.scm | |
| parent | 94820951d6b628dfe47778db76a38090761f3f35 (diff) | |
gnu: Add js-respond.
* gnu/packages/javascript.scm (js-respond): New variable.
Diffstat (limited to 'gnu/packages/javascript.scm')
| -rw-r--r-- | gnu/packages/javascript.scm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index 6746ad1d224..43bc0bbf6d8 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> | 2 | ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> |
| 3 | ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -83,3 +84,53 @@ and AsciiMath notation that works in all modern browsers. It requires no | |||
| 83 | plugins or software to be installed on the browser. So the page author can | 84 | plugins or software to be installed on the browser. So the page author can |
| 84 | write web documents that include mathematics and be confident that readers will | 85 | write web documents that include mathematics and be confident that readers will |
| 85 | be able to view it naturally and easily."))) | 86 | be able to view it naturally and easily."))) |
| 87 | |||
| 88 | (define-public js-respond | ||
| 89 | (package | ||
| 90 | (name "js-respond") | ||
| 91 | (version "1.4.2") | ||
| 92 | (source (origin | ||
| 93 | (method url-fetch) | ||
| 94 | (uri (string-append "https://github.com/scottjehl/Respond/" | ||
| 95 | "archive/" version ".tar.gz")) | ||
| 96 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 97 | (sha256 | ||
| 98 | (base32 | ||
| 99 | "0ds1ya2a185jp93mdn07159c2x8zczwi960ykrawpp62bwk2n93d")))) | ||
| 100 | (build-system trivial-build-system) | ||
| 101 | (arguments | ||
| 102 | `(#:modules ((guix build utils)) | ||
| 103 | #:builder | ||
| 104 | (begin | ||
| 105 | (use-modules (guix build utils) | ||
| 106 | (ice-9 match) | ||
| 107 | (ice-9 popen) | ||
| 108 | (srfi srfi-26)) | ||
| 109 | (set-path-environment-variable | ||
| 110 | "PATH" '("bin") (map (match-lambda | ||
| 111 | ((_ . input) | ||
| 112 | input)) | ||
| 113 | %build-inputs)) | ||
| 114 | (let ((install-directory (string-append %output | ||
| 115 | "/share/javascript/respond/"))) | ||
| 116 | (system* "tar" "xvf" | ||
| 117 | (assoc-ref %build-inputs "source") | ||
| 118 | "--strip" "1") | ||
| 119 | (mkdir-p install-directory) | ||
| 120 | (let* ((file "src/respond.js") | ||
| 121 | (installed (string-append install-directory "respond.min.js"))) | ||
| 122 | (let ((minified (open-pipe* OPEN_READ "uglify-js" file))) | ||
| 123 | (call-with-output-file installed | ||
| 124 | (cut dump-port minified <>))))) | ||
| 125 | #t))) | ||
| 126 | (home-page "https://github.com/scottjehl/Respond") | ||
| 127 | (native-inputs | ||
| 128 | `(("uglify-js" ,uglify-js) | ||
| 129 | ("source" ,source) | ||
| 130 | ("gzip" ,gzip) | ||
| 131 | ("tar" ,tar))) | ||
| 132 | (synopsis "Polyfill for min/max-width CSS3 Media Queries") | ||
| 133 | (description "The goal of this script is to provide a fast and lightweight | ||
| 134 | script to enable responsive web designs in browsers that don't support CSS3 | ||
| 135 | Media Queries.") | ||
| 136 | (license license:expat))) | ||
