From e858cf2eaf7904845321236d4f1b8932e874c2fb Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 25 Dec 2024 20:45:45 +0200 Subject: [PATCH] gnu: c2rust: Improve the package. * gnu/packages/c2rust.scm (c2rust)[source]: Add snippet to allow for newer versions of dependencies. [arguments]: Don't install the sources. Remove custom 'patch-deps phase. [native-inputs]: Replace cmake with cmake-minimal. Change-Id: I8ba137de54e767a36c772b98ac16101b9aa1bafb --- gnu/packages/c2rust.scm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gnu/packages/c2rust.scm b/gnu/packages/c2rust.scm index 170142184f..48711c8b52 100644 --- a/gnu/packages/c2rust.scm +++ b/gnu/packages/c2rust.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2024 Danny Milosavljevic +;;; Copyright © 2024 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -256,15 +257,21 @@ (define-public c2rust (uri (crate-uri "c2rust" version)) (file-name (string-append name "-" version ".tar.gz")) (sha256 - (base32 "1rg9cvvmh9zw89mz2bpyvqlwbfhzl5dw2hab9z6d5rasr8mir7nh")))) + (base32 "1rg9cvvmh9zw89mz2bpyvqlwbfhzl5dw2hab9z6d5rasr8mir7nh")) + (modules '((guix build utils))) + (snippet + '(begin (substitute* "Cargo.toml" + (("\"= ?([[:digit:]]+(\\.[[:digit:]]+)*)" _ version) + (string-append "\"^" version))))))) (build-system cargo-build-system) (native-inputs `(("tinycbor-src" ,%tinycbor-source) - ("cmake" ,cmake) + ("cmake" ,cmake-minimal) ("clang" ,clang))) (inputs (list llvm)) (arguments - `(#:cargo-inputs (("rust-anyhow" ,rust-anyhow-1) + `(#:install-source? #f + #:cargo-inputs (("rust-anyhow" ,rust-anyhow-1) ("rust-c2rust-build-paths" ,rust-c2rust-build-paths-0.18) ("rust-c2rust-transpile" ,rust-c2rust-transpile-0.18) ("rust-clap" ,rust-clap-3) @@ -277,11 +284,6 @@ (define-public c2rust ("rust-time-macros" ,rust-time-macros-0.2)) #:phases (modify-phases %standard-phases - (add-after 'unpack 'patch-deps - (lambda _ - ;; This is incorrect in the release to begin with. - (substitute* "Cargo.toml" - (("=0.2.6") "=0.2.18")))) (add-before 'build 'patch (lambda* (#:key inputs #:allow-other-keys) ;; The build process will slightly patch the sources.