From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:60564) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsAxE-0001Sf-Af for guix-patches@gnu.org; Mon, 29 Jul 2019 15:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsAxD-0003oz-7u for guix-patches@gnu.org; Mon, 29 Jul 2019 15:05:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40323) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsAxC-0003o6-C1 for guix-patches@gnu.org; Mon, 29 Jul 2019 15:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hsAxC-0000EI-5L for guix-patches@gnu.org; Mon, 29 Jul 2019 15:05:02 -0400 Subject: [bug#36841] [PATCH] build/cargo-build-system: Patch cargo checksums. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:60495) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsAwn-0001OI-8m for guix-patches@gnu.org; Mon, 29 Jul 2019 15:04:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsAwl-0003aY-DG for guix-patches@gnu.org; Mon, 29 Jul 2019 15:04:37 -0400 Received: from flashner.co.il ([178.62.234.194]:53098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsAwj-0003ZW-EN for guix-patches@gnu.org; Mon, 29 Jul 2019 15:04:34 -0400 From: Efraim Flashner Date: Mon, 29 Jul 2019 22:04:22 +0300 Message-Id: <20190729190422.6834-1-efraim@flashner.co.il> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36841@debbugs.gnu.org * 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-s= ystem.scm index f38de16cf7..8e1ee62f65 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2016 David Craven ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2019 Ivan Petkov +;;; Copyright =C2=A9 2019 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -121,6 +122,23 @@ directory =3D '" port) (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) #t) =20 +;; 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 sheba= ngs." + (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 =3D '" 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 pat= ch-cargo-checksums))) =20 (define* (cargo-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) --=20 2.22.0