mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-05-02 07:05:38 +02:00
formatting
This commit is contained in:
parent
66a2647fd2
commit
a5b5e6d9d6
3 changed files with 133 additions and 157 deletions
|
@ -1,46 +1,33 @@
|
|||
(define-module (glicid utils)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix transformations)
|
||||
#:use-module (gnu packages gcc)
|
||||
#:use-module (glicid packages gcc)
|
||||
#:use-module (gnu packages commencement)
|
||||
#:use-module (gnu packages)
|
||||
#:export (latest-version)
|
||||
#:export (gcc11-instead-of-gcc)
|
||||
; #:export (gcc10-instead-of-gcc)
|
||||
#:export (transform-package)
|
||||
#:export (instead-of)
|
||||
|
||||
)
|
||||
;; helper function
|
||||
;; return latest version of 2 packages
|
||||
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix transformations)
|
||||
#:use-module (gnu packages gcc)
|
||||
#:use-module (glicid packages gcc)
|
||||
#:use-module (gnu packages commencement)
|
||||
#:use-module (gnu packages)
|
||||
#:export (latest-version)
|
||||
#:export (gcc11-instead-of-gcc)
|
||||
#:export (transform-package)
|
||||
#:export (instead-of)
|
||||
)
|
||||
(define (latest-version v1 v2) (if (string> (package-version v1) (package-version v2)) v1 v2))
|
||||
|
||||
(define gcc11-instead-of-gcc
|
||||
;; This is a procedure to replace GCC by GCC11,
|
||||
;; recursively.
|
||||
; (package-input-rewriting/spec `((,gcc-toolchain . ,(const gcc-toolchain-11)))))
|
||||
(package-input-rewriting `(
|
||||
(,gcc-toolchain . ,gcc-toolchain-11)
|
||||
(,gfortran-toolchain . ,gfortran-toolchain-11)
|
||||
)
|
||||
)
|
||||
(,gcc-toolchain . ,gcc-toolchain-11)
|
||||
(,gfortran-toolchain . ,gfortran-toolchain-11)
|
||||
))
|
||||
)
|
||||
|
||||
(define (transform-package original-package suffix)
|
||||
(package
|
||||
(inherit original-package)
|
||||
(name (string-append (package-name original-package) "-" suffix ))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define (instead-of package-a-spec package-b)
|
||||
(package-input-rewriting/spec `(
|
||||
(,package-a-spec . ,(const package-b)
|
||||
)
|
||||
; #:deep? #t
|
||||
)
|
||||
(package
|
||||
(inherit original-package)
|
||||
(name (string-append (package-name original-package) "-" suffix ))
|
||||
)
|
||||
)
|
||||
|
||||
(define (instead-of package-a-spec package-b)
|
||||
(package-input-rewriting/spec `(
|
||||
(,package-a-spec . ,(const package-b))
|
||||
))
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue