[PATCH] Remove extraneous references

  • Done
  • quality assurance status badge
Details
One participant
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Ricardo Wurmus
Severity
normal
R
R
Ricardo Wurmus wrote on 6 Dec 2021 17:56
(address . bug-guix@gnu.org)
87h7blwty2.fsf@elephly.net
Hi Guix,

r-minimal keeps a record of build time inputs in a comment and in a
libtool script. I don’t know if I may remove them all, but some of them
seem to safe to remove, so that’s what the first patch does.

While I removed texlive-union references from r-minimal, I noticed that
python-nbconvert also does something undesirable: it retains references
to xelatex and bibtex, but takes these from the texlive-union of the
native-inputs. That seems like a mistake, so I added a regular
texlive-bin input and embedded a reference to *that* instead of the
texlive-union-wrapped scripts.

--
Ricardo
R
R
Ricardo Wurmus wrote on 6 Dec 2021 18:30
[PATCH 2/2] gnu: r-minimal: Remove extraneous references.
(address . 52333@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20211206173054.29439-2-rekado@elephly.net
* gnu/packages/statistics.scm (r-minimal)[arguments]: Remove references to
native build-time tools.
---
gnu/packages/statistics.scm | 39 ++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index cf7a64ec7a..599d6a8fc3 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -403,12 +403,49 @@ (define-public r-minimal
(arguments
`(#:tests? #f
,@(substitute-keyword-arguments (package-arguments r-with-tests)
+ ((#:disallowed-references refs '())
+ (cons perl refs))
((#:configure-flags flags)
;; Do not build the recommended packages. The build system creates
;; random temporary directories and embeds their names in some
;; package files. We build these packages with the r-build-system
;; instead.
- `(cons "--without-recommended-packages" ,flags)))))))
+ `(cons "--without-recommended-packages" ,flags))
+ ((#:phases phases '%standard-phases)
+ `(modify-phases ,phases
+ (add-after 'install 'remove-extraneous-references
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* (string-append out "/lib/R/etc/Makeconf")
+ (("^# configure.*")
+ "# Removed to avoid extraneous references\n"))
+ (substitute* (string-append out "/lib/R/bin/libtool")
+ (((string-append
+ "(-L)?("
+ (assoc-ref inputs "bzip2")
+ "|"
+ (assoc-ref inputs "perl")
+ "|"
+ (assoc-ref inputs "texlive")
+ "|"
+ (assoc-ref inputs "texlive-bin")
+ "|"
+ (assoc-ref inputs "texinfo")
+ "|"
+ (assoc-ref inputs "xz")
+ "|"
+ (format #false
+ "/gnu/store/[^-]+-(~{~a~^|~})-[^/]+"
+ '("glibc-utf8-locales"
+ "libselinux"
+ "libsepol"
+ "file"
+ "texlive-bin"
+ "util-macros"
+ "graphite2"))
+ "|"
+ "/gnu/store/[^-]+-glibc-[^-]+-static"
+ ")/lib")) ""))))))))))))
(define-public rmath-standalone
(package (inherit r-minimal)
--
2.34.0
R
R
Ricardo Wurmus wrote on 6 Dec 2021 18:30
[PATCH 1/2] gnu: python-nbconvert: Embed reference to texlive-bin, not texlive-union.
(address . 52333@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20211206173054.29439-1-rekado@elephly.net
* gnu/packages/python-xyz.scm (python-nbconvert)[inputs]: Add texlive-bin.
[arguments]: Embed reference to xelatex and bibtex from the texlive-bin, not
the texlive-union.
---
gnu/packages/python-xyz.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 81b99e1d2e..602833c4f4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12117,14 +12117,15 @@ (define-public python-nbconvert
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-paths-and-tests
- (lambda _
+ (lambda* (#:key inputs #:allow-other-keys)
;; Use pandoc binary from input.
(substitute* "nbconvert/utils/pandoc.py"
(("'pandoc'") (string-append "'" (which "pandoc") "'")))
;; Same for LaTeX.
- (substitute* "nbconvert/exporters/pdf.py"
- (("\"xelatex\"") (string-append "\"" (which "xelatex") "\""))
- (("\"bibtex\"") (string-append "\"" (which "bibtex") "\"")))
+ (let ((texlive (assoc-ref inputs "texlive-bin")))
+ (substitute* "nbconvert/exporters/pdf.py"
+ (("\"xelatex\"") (string-append "\"" texlive "/bin/xelatex\""))
+ (("\"bibtex\"") (string-append "\"" texlive "/bin/bibtex\""))))
;; Make sure tests are not skipped.
(substitute* (find-files "." "test_.+\\.py$")
(("@onlyif_cmds_exist\\(('(pandoc|xelatex)'(, )?)+\\)") ""))
@@ -12158,6 +12159,7 @@ (define-public python-nbconvert
(invoke "pytest" "-vv")))))))
(inputs
`(("pandoc" ,pandoc)
+ ("texlive-bin" ,texlive-bin)
;; XXX: Disabled, needs substitute*.
;;("inkscape" ,inkscape)
))
--
2.34.0
R
R
Ricardo Wurmus wrote on 7 Dec 2021 00:03
(address . 52333@debbugs.gnu.org)
87zgpduyga.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (4 lines)
> * gnu/packages/python-xyz.scm (python-nbconvert)[inputs]: Add texlive-bin.
> [arguments]: Embed reference to xelatex and bibtex from the texlive-bin, not
> the texlive-union.

This is a bad idea, because it breaks PDF conversion.

I still think that the texlive stuff should be a regular input, not a
native input, but however we do this: it’s not with this patch.

--
Ricardo
R
R
Ricardo Wurmus wrote on 15 Dec 2021 13:53
[PATCH] Remove extraneous references
(address . 52333-done@debbugs.gnu.org)
87fsquvxk1.fsf@elephly.net
I applied the change to r-minimal and discarded the other one.

--
Ricardo
Closed
?