(define-module (andromeda utils) #:use-module (andromeda packages haskell) #:use-module (gnu packages) #:use-module (guix packages) #:use-module (ice-9 match)) (define-public (from-ghc-to-ghc-9.14 name) (string-append "ghc-9.14" (string-drop name (string-length "ghc")))) (define-public (with-ghc-9.14 base) (package (inherit base) (name (from-ghc-to-ghc-9.14 (package-name base))) (arguments (append (list #:haskell ghc-9.14) (package-arguments base))) (inputs (map (match-lambda ((input-name input) (if (string-prefix? "ghc-" input-name) (list (from-ghc-to-ghc-9.14 input-name) (specification->package (from-ghc-to-ghc-9.14 input-name))) (if (string=? "hspec-discover" input-name) (list "ghc-9.14-hspec-discover-bootstrap" (specification->package "ghc-9.14-hspec-discover-bootstrap")) (list input-name input))))) (package-inputs base))) (native-inputs (map (match-lambda ((input-name input) (if (string-prefix? "ghc-" input-name) (list (from-ghc-to-ghc-9.14 input-name) (specification->package (from-ghc-to-ghc-9.14 input-name))) (list input-name input)))) (package-native-inputs base)))))