2021-11-02 22:43:20 +01:00
|
|
|
(define-module (glicid utils)
|
|
|
|
#:use-module (guix packages)
|
2021-11-22 23:00:51 +01:00
|
|
|
#:use-module (guix transformations)
|
|
|
|
#:use-module (gnu packages gcc)
|
|
|
|
#:use-module (glicid packages gcc)
|
|
|
|
#:use-module (gnu packages commencement)
|
2021-11-26 22:12:52 +01:00
|
|
|
#:use-module (gnu packages)
|
2021-11-02 22:43:20 +01:00
|
|
|
#:export (latest-version)
|
2021-11-22 23:00:51 +01:00
|
|
|
#:export (gcc11-instead-of-gcc)
|
|
|
|
#:export (gcc10-instead-of-gcc)
|
2021-11-26 22:12:52 +01:00
|
|
|
|
|
|
|
|
2021-11-02 22:43:20 +01:00
|
|
|
)
|
2021-11-02 22:23:00 +01:00
|
|
|
;; helper function
|
|
|
|
;; return latest version of 2 packages
|
|
|
|
|
2021-11-02 22:43:20 +01:00
|
|
|
(define (latest-version v1 v2) (if (string> (package-version v1) (package-version v2)) v1 v2))
|
2021-11-22 23:00:51 +01:00
|
|
|
|
|
|
|
(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)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-11-29 16:23:48 +01:00
|
|
|
(define (transform-package original-package suffix)
|
|
|
|
(package
|
|
|
|
(inherit original-package)
|
|
|
|
(name (string-append (package-name original-package) "-" suffix ))
|
|
|
|
)
|
|
|
|
)
|
2021-11-26 22:03:59 +01:00
|
|
|
|
2021-11-22 23:00:51 +01:00
|
|
|
|
2021-11-29 16:23:48 +01:00
|
|
|
(define (instead-of package-a-spec package-b)
|
|
|
|
(package-input-rewriting/spec `(
|
|
|
|
(,package-a-spec . ,(const package-b)
|
|
|
|
)
|
|
|
|
; #:deep? #t
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|