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:
Pierre Neidhardt 2020-01-03 11:59:25 +01:00
parent 0aa203717e
commit ba42da245b
No known key found for this signature in database
GPG key ID: 9BDCF497A4BBCC7F
6 changed files with 52 additions and 52 deletions

View file

@ -85,10 +85,10 @@ (define-module (gnu packages bioinformatics)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages java)
#:use-module (gnu packages java-compression)
#:use-module (gnu packages javascript)
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages dlang)
#:use-module (gnu packages linux)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages logging)
#:use-module (gnu packages machine-learning)
#:use-module (gnu packages man)

View file

@ -62,6 +62,7 @@ (define-module (gnu packages cran)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages java)
#:use-module (gnu packages javascript)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages machine-learning)
#:use-module (gnu packages maths)
#:use-module (gnu packages mpi)

View file

@ -25,7 +25,6 @@ (define-module (gnu packages javascript)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages lisp)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages readline)
#:use-module (guix packages)
@ -453,50 +452,3 @@ (define-public mujs
C++ template mechanisms, or worry about marking and unmarking garbage collection
roots, or wrestle with obscure build systems.")
(license license:isc)))
(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")))

View file

@ -823,6 +823,53 @@ (define-public sbcl-cl-uglify-js
(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"))

View file

@ -103,7 +103,6 @@ (define-module (gnu packages web)
#:use-module (gnu packages guile)
#:use-module (gnu packages guile-xyz)
#:use-module (gnu packages java)
#:use-module (gnu packages javascript)
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
@ -111,6 +110,7 @@ (define-module (gnu packages web)
#:use-module (gnu packages libidn)
#:use-module (gnu packages libunistring)
#:use-module (gnu packages linux)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages lua)
#:use-module (gnu packages markup)
#:use-module (gnu packages ncurses)

View file

@ -44,8 +44,8 @@ (define %minify-build-system-modules
(define (default-uglify-js)
"Return the default package to minify JavaScript source files."
;; Lazily resolve the binding to avoid a circular dependency.
(let ((js-mod (resolve-interface '(gnu packages javascript))))
(module-ref js-mod 'uglify-js)))
(let ((mod (resolve-interface '(gnu packages lisp-xyz))))
(module-ref mod 'uglify-js)))
(define* (lower name
#:key source inputs native-inputs outputs system