2021-11-02 22:43:20 +01:00
|
|
|
(define-module (glicid utils)
|
2021-12-03 09:56:33 +01:00
|
|
|
#: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)
|
|
|
|
)
|
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
|
|
|
|
(package-input-rewriting `(
|
2021-12-03 09:56:33 +01:00
|
|
|
(,gcc-toolchain . ,gcc-toolchain-11)
|
|
|
|
(,gfortran-toolchain . ,gfortran-toolchain-11)
|
|
|
|
))
|
2021-11-22 23:00:51 +01:00
|
|
|
)
|
|
|
|
|
2021-11-29 16:23:48 +01:00
|
|
|
(define (transform-package original-package suffix)
|
2021-12-03 09:56:33 +01:00
|
|
|
(package
|
|
|
|
(inherit original-package)
|
|
|
|
(name (string-append (package-name original-package) "-" suffix ))
|
|
|
|
)
|
2021-11-29 16:23:48 +01:00
|
|
|
)
|
2021-11-26 22:03:59 +01:00
|
|
|
|
2021-11-29 16:23:48 +01:00
|
|
|
(define (instead-of package-a-spec package-b)
|
2021-12-03 09:56:33 +01:00
|
|
|
(package-input-rewriting/spec `(
|
|
|
|
(,package-a-spec . ,(const package-b))
|
|
|
|
))
|
2021-11-29 16:23:48 +01:00
|
|
|
)
|