mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-29 21:58:36 +02:00
32 lines
1.2 KiB
Scheme
32 lines
1.2 KiB
Scheme
(define-module (glicid utils)
|
|
#:use-module (guix packages)
|
|
#:use-module (guix transformations)
|
|
#:use-module (guix utils)
|
|
#:use-module (gnu packages gcc)
|
|
#:use-module (glicid packages gcc)
|
|
#:use-module (gnu packages commencement)
|
|
#:use-module (gnu packages)
|
|
)
|
|
|
|
(define-public (latest-version v1 v2)
|
|
(case (version-compare (package-version v1) (package-version v2))
|
|
((>) v1)
|
|
((=) v1)
|
|
((<) v2)))
|
|
|
|
(define-public gcc11-instead-of-gcc
|
|
(package-input-rewriting
|
|
`((,gcc-toolchain . ,gcc-toolchain-11)
|
|
(,gfortran-toolchain . ,gfortran-toolchain-11)
|
|
)))
|
|
|
|
(define-public (transform-package original-package suffix)
|
|
(package
|
|
(inherit original-package)
|
|
(name (string-append (package-name original-package) "-" suffix ))))
|
|
|
|
(define-public (instead-of package-a-spec package-b)
|
|
(package-input-rewriting/spec `( (,package-a-spec . ,(const package-b)))))
|
|
|
|
(define-public (touch filename)
|
|
(call-with-output-file file-name (const #t)))
|