[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/08: gnu: openfoam-org: Use 'git-fetch'.
From: |
guix-commits |
Subject: |
03/08: gnu: openfoam-org: Use 'git-fetch'. |
Date: |
Thu, 10 Aug 2023 18:54:34 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit caa30ff2f13a149810e564ab9b1737e057345032
Author: Ludovic Courtès <ludovic.courtes@inria.fr>
AuthorDate: Thu Aug 10 22:19:55 2023 +0200
gnu: openfoam-org: Use 'git-fetch'.
So far the source was taken from an auto-generated, unstable tarball at
github.com. This fixes that.
* gnu/packages/simulation.scm (openfoam-org)[source]: Switch to
'git-fetch'.
[arguments]: Add 'rename-self' phase.
---
gnu/packages/simulation.scm | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 1dd6dc63f7..db73812a41 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -84,6 +84,7 @@
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (ice-9 ftw)
+ #:use-module (ice-9 match)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1))
@@ -92,14 +93,15 @@
(name "openfoam-org")
(version "10.20230119")
(source (origin
- (method url-fetch)
- (uri (string-append "https://github.com/OpenFOAM/OpenFOAM-"
- (version-major version) "/archive/"
- (second (string-split version #\.))
- ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append "https://github.com/OpenFOAM/OpenFOAM-"
+ (version-major version)))
+ (commit (second (string-split version #\.)))))
(sha256
(base32
- "1aw2vb5s7frg942ngd5x5x2dm67liyg6czff56qi567mshccpy46"))
+ "0icvwg7s6vnkgmdiczivia9pbrgx8nanw9a4j080fzfvdv9vxhzp"))
+ (file-name (git-file-name name version))
(modules '((guix build utils)))
(snippet `(begin
;; patch shell paths
@@ -211,7 +213,24 @@
#~(modify-phases %standard-phases
(add-before 'build 'patch-HOME-path
(lambda _
- (setenv "HOME" "/tmp") #t))
+ (setenv "HOME" "/tmp")))
+ (add-before 'build 'rename-self
+ (lambda _
+ ;; The script 'bin/foamEtcFile' derives the version name based
+ ;; on the current directory name (!), so make sure to follow the
+ ;; expected naming convention.
+ (let ((here (canonicalize-path "."))
+ (target #$(string-append
+ "OpenFOAM-"
+ (string-map (match-lambda
+ (#\. #\-)
+ (chr chr))
+ (package-version this-package)))))
+ (chdir "..")
+ (format #t "renaming '~a' to '~a'~%"
+ here target)
+ (rename-file here target)
+ (chdir target))))
(add-before 'build 'patch-scotch
(lambda _
(substitute* "etc/config.sh/scotch"
- branch master updated (3775006f24 -> 56fddefc6d), guix-commits, 2023/08/10
- 01/08: gnu: libflame: Remove dependency on OpenBLAS., guix-commits, 2023/08/10
- 03/08: gnu: openfoam-org: Use 'git-fetch'.,
guix-commits <=
- 05/08: gnu: Add fritzing-parts., guix-commits, 2023/08/10
- 02/08: gnu: libflame: Remove input labels and use gexps., guix-commits, 2023/08/10
- 04/08: services: postgresql: Add more role fields., guix-commits, 2023/08/10
- 06/08: gnu: fritzing: Improve package style., guix-commits, 2023/08/10
- 07/08: gnu: Sort use-module alphabetically in (gnu packages engineering), guix-commits, 2023/08/10
- 08/08: services: syncthing: Use the new command line syntax., guix-commits, 2023/08/10