[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#27449] [PATCH] gnu: Add js-respond.
From: |
Ludovic Courtès |
Subject: |
[bug#27449] [PATCH] gnu: Add js-respond. |
Date: |
Thu, 22 Jun 2017 18:13:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Ricardo Wurmus <address@hidden> skribis:
> * gnu/packages/javascript.scm (js-respond): New variable.
LGTM.
> + (build-system trivial-build-system)
> + (arguments
> + `(#:modules ((guix build utils))
> + #:builder
> + (begin
> + (use-modules (guix build utils)
> + (ice-9 match)
> + (ice-9 popen)
> + (srfi srfi-26))
> + (set-path-environment-variable
> + "PATH" '("bin") (map (match-lambda
> + ((_ . input)
> + input))
> + %build-inputs))
> + (let ((install-directory (string-append %output
> +
> "/share/javascript/respond/")))
> + (system* "tar" "xvf"
> + (assoc-ref %build-inputs "source")
> + "--strip" "1")
> + (mkdir-p install-directory)
> + (let* ((file "src/respond.js")
> + (installed (string-append install-directory
> "respond.min.js")))
> + (let ((minified (open-pipe* OPEN_READ "uglify-js" file)))
> + (call-with-output-file installed
> + (cut dump-port minified <>)))))
> + #t)))
Should we turn this into a ‘javascript-build-system’?
Thanks,
Ludo’.