all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#36841] [PATCH] build/cargo-build-system: Patch cargo checksums.
@ 2019-07-29 19:04 Efraim Flashner
  2019-07-30  1:44 ` Ivan Petkov
  0 siblings, 1 reply; 8+ messages in thread
From: Efraim Flashner @ 2019-07-29 19:04 UTC (permalink / raw)
  To: 36841

* guix/build/cargo-build-system.scm (patch-cargo-checksums): New phase.
(%standard-phases): Add 'patch-cargo-checksums after
'patch-generated-file-shebangs.
---
 guix/build/cargo-build-system.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index f38de16cf7..8e1ee62f65 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
+;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -121,6 +122,23 @@ directory = '" port)
   (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
   #t)
 
+;; After patching the 'patch-generated-file-shebangs phase any vendored crates
+;; will have a mismatch on their checksum.
+(define* (patch-cargo-checksums #:key
+                                (vendor-dir "guix-vendor")
+                                #:allow-other-keys)
+  "Patch the checksums of the vendored crates after patching their shebangs."
+  (for-each
+    (lambda (filename)
+      (delete-file filename)
+      (let* ((dir (dirname filename)))
+        (display (string-append
+                   "patch-cargo-checksums: generate-checksums for "
+                   dir "\n"))
+        (generate-checksums dir)))
+    (find-files "guix-vendor" ".cargo-checksum.json"))
+  #t)
+
 (define* (build #:key
                 skip-build?
                 (cargo-build-flags '("--release"))
@@ -162,7 +180,8 @@ directory = '" port)
     (replace 'configure configure)
     (replace 'build build)
     (replace 'check check)
-    (replace 'install install)))
+    (replace 'install install)
+    (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums patch-cargo-checksums)))
 
 (define* (cargo-build #:key inputs (phases %standard-phases)
                       #:allow-other-keys #:rest args)
-- 
2.22.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-08-04  8:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-29 19:04 [bug#36841] [PATCH] build/cargo-build-system: Patch cargo checksums Efraim Flashner
2019-07-30  1:44 ` Ivan Petkov
2019-07-30  5:59   ` bug#36841: " Efraim Flashner
2019-07-30  8:17   ` [bug#36841] " Efraim Flashner
2019-07-30 10:46     ` [bug#36841] [PATCH v3] " Efraim Flashner
2019-08-01  3:00       ` Ivan Petkov
2019-08-01 11:15         ` Efraim Flashner
2019-08-04  8:57           ` Efraim Flashner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.