gnu: Properly move lisp libraries to lisp-xyz, uglify-js to javascript and stumpwm to wm.

* gnu/local.mk: Include lisp-xyz.scm.
* gnu/packages/lisp-xyz.scm: New file.
* gnu/packages/lisp.scm: Move all lisp libraries to lisp-xyz.scm, uglify-js to
  javascript.scm and stumpwm to wm.scm.
* gnu/packages/javascript.scm: Add uglify-js.
* gnu/packages/wm.scm: Add stumpwm.
* gnu/packages/bioinformatics.scm: Find uglify-js in javascript.scm.
* gnu/packages/machine-learning.scm: Depend on lisp-xyz.scm instead of lisp.scm.
* gnu/packages/web.scm: Find uglify-js in javascript.scm.
* gnu/packages/web-browsers.scm: Depend on lisp-xyz.scm instead of lisp.scm.
* guix/build-system/minify.scm (default-uglify-js): Find uglify-js in
  javascript module instead of lisp.
This commit is contained in:
Pierre Neidhardt 2019-11-28 21:37:28 +01:00
parent 29e621a013
commit ac1ee30f4f
No known key found for this signature in database
GPG key ID: 9BDCF497A4BBCC7F
11 changed files with 7387 additions and 7323 deletions

View file

@ -308,6 +308,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/linux.scm \ %D%/packages/linux.scm \
%D%/packages/lirc.scm \ %D%/packages/lirc.scm \
%D%/packages/lisp.scm \ %D%/packages/lisp.scm \
%D%/packages/lisp-xyz.scm \
%D%/packages/llvm.scm \ %D%/packages/llvm.scm \
%D%/packages/lout.scm \ %D%/packages/lout.scm \
%D%/packages/logging.scm \ %D%/packages/logging.scm \

View file

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

View file

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

View file

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

7205
gnu/packages/lisp-xyz.scm Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -60,7 +60,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages gstreamer) #:use-module (gnu packages gstreamer)
#:use-module (gnu packages image) #:use-module (gnu packages image)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages lisp) #:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages maths) #:use-module (gnu packages maths)
#:use-module (gnu packages mpi) #:use-module (gnu packages mpi)
#:use-module (gnu packages ocaml) #:use-module (gnu packages ocaml)

View file

@ -38,6 +38,7 @@ (define-module (gnu packages web-browsers)
#:use-module (gnu packages libevent) #:use-module (gnu packages libevent)
#:use-module (gnu packages libidn) #:use-module (gnu packages libidn)
#:use-module (gnu packages lisp) #:use-module (gnu packages lisp)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages lua) #:use-module (gnu packages lua)
#:use-module (gnu packages gnome) #:use-module (gnu packages gnome)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)

View file

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

View file

@ -25,6 +25,8 @@
;;; Copyright © 2019 Ingo Ruhnke <grumbel@gmail.com> ;;; Copyright © 2019 Ingo Ruhnke <grumbel@gmail.com>
;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org> ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2019 John Soo <jsoo1@asu.edu> ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -46,12 +48,14 @@ (define-module (gnu packages wm)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system asdf)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system haskell) #:use-module (guix build-system haskell)
#:use-module (guix build-system meson) #:use-module (guix build-system meson)
#:use-module (guix build-system perl) #:use-module (guix build-system perl)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix utils)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages base) #:use-module (gnu packages base)
@ -73,6 +77,7 @@ (define-module (gnu packages wm)
#:use-module (gnu packages imagemagick) #:use-module (gnu packages imagemagick)
#:use-module (gnu packages libevent) #:use-module (gnu packages libevent)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages logging) #:use-module (gnu packages logging)
#:use-module (gnu packages lua) #:use-module (gnu packages lua)
#:use-module (gnu packages m4) #:use-module (gnu packages m4)
@ -87,6 +92,7 @@ (define-module (gnu packages wm)
#:use-module (gnu packages python) #:use-module (gnu packages python)
#:use-module (gnu packages serialization) #:use-module (gnu packages serialization)
#:use-module (gnu packages suckless) #:use-module (gnu packages suckless)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages textutils) #:use-module (gnu packages textutils)
#:use-module (gnu packages version-control) #:use-module (gnu packages version-control)
#:use-module (gnu packages video) #:use-module (gnu packages video)
@ -1485,3 +1491,118 @@ (define-public mako
(description "Mako is a lightweight notification daemon for Wayland (description "Mako is a lightweight notification daemon for Wayland
compositors that support the layer-shell protocol.") compositors that support the layer-shell protocol.")
(license license:expat))) ; MIT license (license license:expat))) ; MIT license
(define-public stumpwm
(package
(name "stumpwm")
(version "18.11")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/stumpwm/stumpwm.git")
(commit version)))
(file-name (git-file-name "stumpwm" version))
(sha256
(base32 "003g1fmh7446ws49866kzny4lrk1wf034dq5fa4m9mq1nzc7cwv7"))
(patches
;; This patch is included in the post-18.11 git master tree
;; and can be removed when we move to the next release.
(search-patches "stumpwm-fix-broken-read-one-line.patch"))))
(build-system asdf-build-system/sbcl)
(native-inputs `(("fiasco" ,sbcl-fiasco)
("texinfo" ,texinfo)))
(inputs `(("cl-ppcre" ,sbcl-cl-ppcre)
("clx" ,sbcl-clx)
("alexandria" ,sbcl-alexandria)))
(outputs '("out" "lib"))
(arguments
'(#:asd-system-name "stumpwm"
#:phases
(modify-phases %standard-phases
(add-after 'create-symlinks 'build-program
(lambda* (#:key outputs #:allow-other-keys)
(build-program
(string-append (assoc-ref outputs "out") "/bin/stumpwm")
outputs
#:entry-program '((stumpwm:stumpwm) 0))))
(add-after 'build-program 'create-desktop-file
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(xsessions (string-append out "/share/xsessions")))
(mkdir-p xsessions)
(call-with-output-file
(string-append xsessions "/stumpwm.desktop")
(lambda (file)
(format file
"[Desktop Entry]~@
Name=stumpwm~@
Comment=The Stump Window Manager~@
Exec=~a/bin/stumpwm~@
TryExec=~@*~a/bin/stumpwm~@
Icon=~@
Type=Application~%"
out)))
#t)))
(add-after 'install 'install-manual
(lambda* (#:key outputs #:allow-other-keys)
;; The proper way to the manual is bootstrapping a full autotools
;; build system and running ./configure && make stumpwm.info to
;; do some macro substitution. We can get away with much less.
(let* ((out (assoc-ref outputs "out"))
(info (string-append out "/share/info")))
(invoke "makeinfo" "stumpwm.texi.in")
(install-file "stumpwm.info" info)
#t))))))
(synopsis "Window manager written in Common Lisp")
(description "Stumpwm is a window manager written entirely in Common Lisp.
It attempts to be highly customizable while relying entirely on the keyboard
for input. These design decisions reflect the growing popularity of
productive, customizable lisp based systems.")
(home-page "https://github.com/stumpwm/stumpwm")
(license license:gpl2+)
(properties `((cl-source-variant . ,(delay cl-stumpwm))))))
(define-public sbcl-stumpwm
(deprecated-package "sbcl-stumpwm" stumpwm))
(define-public cl-stumpwm
(package
(inherit (sbcl-package->cl-source-package stumpwm))
(name "cl-stumpwm")))
(define-public stumpwm+slynk
(package
(inherit stumpwm)
(name "stumpwm-with-slynk")
(outputs '("out"))
(inputs
`(("stumpwm" ,stumpwm "lib")
("slynk" ,sbcl-slynk)))
(arguments
(substitute-keyword-arguments (package-arguments stumpwm)
((#:phases phases)
`(modify-phases ,phases
(replace 'build-program
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(program (string-append out "/bin/stumpwm")))
(build-program program outputs
#:entry-program '((stumpwm:stumpwm) 0)
#:dependencies '("stumpwm"
,@(@@ (gnu packages lisp-xyz) slynk-systems))
#:dependency-prefixes
(map (lambda (input) (assoc-ref inputs input))
'("stumpwm" "slynk")))
;; Remove unneeded file.
(delete-file (string-append out "/bin/stumpwm-exec.fasl"))
#t)))
(delete 'copy-source)
(delete 'build)
(delete 'check)
(delete 'create-asd-file)
(delete 'cleanup)
(delete 'create-symlinks)))))))
(define-public sbcl-stumpwm+slynk
(deprecated-package "sbcl-stumpwm-with-slynk" stumpwm+slynk))

View file

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