summary refs log tree commit diff
path: root/gnu/packages/ruby.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-01-06 14:32:59 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-01-08 00:41:06 -0500
commitcc79e4b53910fb669b4031f04e25b2a85744411e (patch)
tree4eb9f74187be766b11fdfb62d9f7d88b34bffca9 /gnu/packages/ruby.scm
parentfcbe54c27afd3e6a2045825a342ec558b172261f (diff)
downloadguix-cc79e4b53910fb669b4031f04e25b2a85744411e.tar.gz
gnu: ruby-nokogiri: Make it reproducible.
Fixes <https://issues.guix.gnu.org/56389>.

* gnu/packages/ruby.scm (ruby-nokogiri) [arguments]: Use gexps.
[phases] {delete-mkmf.log}: New phase.

Reported-by: Wiktor Żelazny <wzelazny@vurv.cz>
Diffstat (limited to 'gnu/packages/ruby.scm')
-rw-r--r--gnu/packages/ruby.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 1e75341a43..801fe03dad 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -5062,11 +5062,19 @@ to reproduce user environments.")
     (arguments
      ;; Tests fail because Nokogiri can only test with an installed extension,
      ;; and also because many test framework dependencies are missing.
-     `(#:tests? #f
-       #:gem-flags (list "--" "--use-system-libraries"
-                         (string-append "--with-xml2-include="
-                                        (assoc-ref %build-inputs "libxml2")
-                                        "/include/libxml2" ))))
+     (list
+      #:tests? #f
+      #:gem-flags #~(list "--" "--use-system-libraries"
+                          (string-append "--with-xml2-include="
+                                         #$(this-package-input "libxml2")
+                                         "/include/libxml2" ))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'delete-mkmf.log
+            (lambda _
+              ;; This build log captures non-deterministic file names (see:
+              ;; https://github.com/sparklemotion/nokogiri/issues/2755).
+              (for-each delete-file (find-files #$output "^mkmf\\.log$")))))))
     (native-inputs (list ruby-hoe))
     (inputs (list zlib libxml2 libxslt))
     (propagated-inputs (list ruby-mini-portile-2 ruby-pkg-config))