mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-17 04:20:44 +02:00
gnu: python: Move idle to a separate output.
idle is a programming environment that is not useful for building packages, but it is still useful for end users. This saves 5MB in the default output. * gnu/packages/python.scm (python-2.7)[outputs]: Add `idle'. [arguments]: Move idle files in the new output. (wrap-python): Do not wrap idle since it is in a different output.
This commit is contained in:
parent
8ce96d8447
commit
e4aa346d57
1 changed files with 25 additions and 3 deletions
|
@ -176,7 +176,8 @@
|
||||||
"Lib/test/test_subprocess.py"))
|
"Lib/test/test_subprocess.py"))
|
||||||
#t))))
|
#t))))
|
||||||
(outputs '("out"
|
(outputs '("out"
|
||||||
"tk")) ;tkinter; adds 50 MiB to the closure
|
"tk" ;tkinter; adds 50 MiB to the closure
|
||||||
|
"idle")) ;programming environment; weighs 5MB
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:test-target "test"
|
`(#:test-target "test"
|
||||||
|
@ -360,6 +361,27 @@
|
||||||
(install-file tkinter.so target)
|
(install-file tkinter.so target)
|
||||||
(delete-file tkinter.so)))))
|
(delete-file tkinter.so)))))
|
||||||
#t)))
|
#t)))
|
||||||
|
(add-after 'install 'move-idle
|
||||||
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
;; when idle is built, move it to a separate output to save some
|
||||||
|
;; space (5MB)
|
||||||
|
(let ((out (assoc-ref outputs "out"))
|
||||||
|
(idle (assoc-ref outputs "idle")))
|
||||||
|
(when idle
|
||||||
|
(for-each
|
||||||
|
(lambda (file)
|
||||||
|
(let ((target (string-append idle "/bin/" (basename file))))
|
||||||
|
(install-file file (dirname target))
|
||||||
|
(delete-file file)))
|
||||||
|
(find-files (string-append out "/bin") "^idle"))
|
||||||
|
(match (find-files out "^idlelib$" #:directories? #t)
|
||||||
|
((idlelib)
|
||||||
|
(let* ((len (string-length out))
|
||||||
|
(target (string-append idle "/"
|
||||||
|
(string-drop idlelib len)
|
||||||
|
"/site-packages")))
|
||||||
|
(mkdir-p (dirname target))
|
||||||
|
(rename-file idlelib target))))))))
|
||||||
(add-after 'install 'install-sitecustomize.py
|
(add-after 'install 'install-sitecustomize.py
|
||||||
,(customize-site version)))))
|
,(customize-site version)))))
|
||||||
(inputs
|
(inputs
|
||||||
|
@ -623,8 +645,8 @@ for more information.")))
|
||||||
(lambda (old new)
|
(lambda (old new)
|
||||||
(symlink (string-append python old)
|
(symlink (string-append python old)
|
||||||
(string-append bin "/" new)))
|
(string-append bin "/" new)))
|
||||||
`("python3" ,"pydoc3" ,"idle3" ,"pip3")
|
`("python3" ,"pydoc3" ,"pip3")
|
||||||
`("python" ,"pydoc" ,"idle" ,"pip"))
|
`("python" ,"pydoc" ,"pip"))
|
||||||
;; python-config outputs search paths based upon its location,
|
;; python-config outputs search paths based upon its location,
|
||||||
;; use a bash wrapper to avoid changing its outputs.
|
;; use a bash wrapper to avoid changing its outputs.
|
||||||
(let ((bash (string-append (assoc-ref %build-inputs "bash")
|
(let ((bash (string-append (assoc-ref %build-inputs "bash")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue