guix-glicid/glicid/utils.scm

44 lines
1.5 KiB
Scheme
Raw Normal View History

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-26 22:03:59 +01:00
;(define gcc10-instead-of-gcc
; ;; This is a procedure to replace GCC by GCC10,
; ;; recursively.
;; (package-input-rewriting/spec `((,gcc-toolchain . ,(const gcc-toolchain-10)))))
; (package-input-rewriting `((,gcc-toolchain . ,gcc-toolchain-10))))
2021-11-22 23:00:51 +01:00
2021-11-26 22:03:59 +01:00
(define (gcc10-instead-of-gcc packagetorewrite)
(let ((toolchaingcc (specification->package "gcc-toolchain@10"))
2021-11-26 22:31:30 +01:00
; (toolchaingfortran (specification->package "gfortran-toolchain@10.3.0"))
)
2021-11-26 22:03:59 +01:00
(package-with-c-toolchain packagetorewrite `(("toolchaingcc" ,toolchaingcc)
("toulchaingfortran",toolchaingfortran)))))