mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-17 12:30:38 +02:00
gnu: uglify-js: Move back next to sbcl-cl-uglify-js definition.
This fixes the bug which prevented uglify-js from being defined properly, and cascaded back to all Common Lisp packages. * gnu/packages/bioinformatics.scm: Replace javascript module with lisp-xyz. * gnu/packages/cran.scm: Use lisp-xyz module. * gnu/packages/javascript.scm (uglify-js): Move from here... * gnu/packages/lisp-xyz.scm: ... To here. * gnu/packages/web.scm: Replace javascript module with lisp-xyz. * guix/build-system/minify.scm: Find uglify-js in the lisp-xyz module.
This commit is contained in:
parent
0aa203717e
commit
ba42da245b
6 changed files with 52 additions and 52 deletions
|
@ -823,6 +823,53 @@ compressor. It works on data produced by @code{parse-js} to generate a
|
|||
(define-public cl-uglify-js
|
||||
(sbcl-package->cl-source-package sbcl-cl-uglify-js))
|
||||
|
||||
(define-public uglify-js
|
||||
(package
|
||||
(inherit sbcl-cl-uglify-js)
|
||||
(name "uglify-js")
|
||||
(build-system trivial-build-system)
|
||||
(arguments
|
||||
`(#:modules ((guix build utils))
|
||||
#:builder
|
||||
(let* ((bin (string-append (assoc-ref %outputs "out") "/bin/"))
|
||||
(script (string-append bin "uglify-js")))
|
||||
(use-modules (guix build utils))
|
||||
(mkdir-p bin)
|
||||
(with-output-to-file script
|
||||
(lambda _
|
||||
(format #t "#!~a/bin/sbcl --script
|
||||
(require :asdf)
|
||||
(push (truename \"~a/lib/sbcl\") asdf:*central-registry*)"
|
||||
(assoc-ref %build-inputs "sbcl")
|
||||
(assoc-ref %build-inputs "sbcl-cl-uglify-js"))
|
||||
;; FIXME: cannot use progn here because otherwise it fails to
|
||||
;; find cl-uglify-js.
|
||||
(for-each
|
||||
write
|
||||
'(;; Quiet, please!
|
||||
(let ((*standard-output* (make-broadcast-stream))
|
||||
(*error-output* (make-broadcast-stream)))
|
||||
(asdf:load-system :cl-uglify-js))
|
||||
(let ((file (cadr *posix-argv*)))
|
||||
(if file
|
||||
(format t "~a"
|
||||
(cl-uglify-js:ast-gen-code
|
||||
(cl-uglify-js:ast-mangle
|
||||
(cl-uglify-js:ast-squeeze
|
||||
(with-open-file (in file)
|
||||
(parse-js:parse-js in))))
|
||||
:beautify nil))
|
||||
(progn
|
||||
(format *error-output*
|
||||
"Please provide a JavaScript file.~%")
|
||||
(sb-ext:exit :code 1))))))))
|
||||
(chmod script #o755)
|
||||
#t)))
|
||||
(inputs
|
||||
`(("sbcl" ,sbcl)
|
||||
("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js)))
|
||||
(synopsis "JavaScript compressor")))
|
||||
|
||||
(define-public sbcl-cl-strings
|
||||
(let ((revision "1")
|
||||
(commit "c5c5cbafbf3e6181d03c354d66e41a4f063f00ae"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue