(define-module (andromeda packages haskell) #:use-module (gnu packages) #:use-module (gnu packages haskell) #:use-module (gnu packages llvm) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix utils)) (define-public ghc-9.12 (let ((base ghc-9.8)) (package (inherit base) (name "ghc-next") (version "9.12.2") (source (origin (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/ghc-" version "-src.tar.xz")) (sha256 (base32 "0czrhi8fdvzxbpviri2xjj6xdy50syjyjpbff72liws3vrfwsj8f")))) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases (replace 'check (lambda* (#:key (tests? #t) (parallel-tests? #f) (make-flags '()) #:allow-other-keys) (if tests? (apply invoke "_build/bin/hadrian" `(,@(if parallel-tests? (list (string-append "-j" (number->string (parallel-job-count)))) '()) ,@make-flags "test" ,(string-append "--broken-test=" (string-join (list "T15904" ; ld-wrapper, apparently "T16521" ; no idea "T7275" "toplevel_scc_1"))) "--skip-perf" "-a")) ; TODO: actually figure out test failures (format #t "test suite not run~%")))))))) (native-inputs (modify-inputs (package-native-inputs base) (replace "ghc" base) (replace "ghc-testsuite.tar.xz" (origin (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/ghc-" version "-testsuite.tar.xz")) (sha256 (base32 "1ahhyh5kwmi4ck2687mjawnp9syb7a0m47y096x896zznjnjw56g")) (patches (search-patches "ghc-testsuite-recomp015-execstack.patch")))) (replace "hadrian-bootstrap-sources.tar.gz" (origin (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/hadrian-bootstrap-sources/" "hadrian-bootstrap-sources-" (package-version base) ".tar.gz")) (sha256 (base32 "16hxy3jk213zjqm75sa0slslfz7b2f4iqycnnjisbdr7ias2x5nl")))))) (native-search-paths (list (search-path-specification (variable "GHC_PACKAGE_PATH") (files (list (string-append "lib/ghc-" version))) (file-pattern ".*\\.conf\\.d$") (file-type 'directory))))))) (define-public ghc-9.14 (let ((base ghc-9.12)) (package (inherit base) (name "ghc-next") (version "9.14.1") (source (origin (patches (list (local-file "../../patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff"))) (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/ghc-" version "-src.tar.xz")) (sha256 (base32 "0xqy20y6kpb10f99zains403va3ainiqf9wz52im8rgqkaf7g0ra")))) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases (replace 'check (lambda* (#:key (tests? #t) (parallel-tests? #f) (make-flags '()) #:allow-other-keys) (if tests? (apply invoke "_build/bin/hadrian" `(,@(if parallel-tests? (list (string-append "-j" (number->string (parallel-job-count)))) '()) ,@make-flags "test" ,(string-append "--broken-test=" ; marks broken tests that totally fail (string-join (list "callstack001" "callstack002" "T15904" "T25204" "T16521" "T27225" ; unpatched shebang in testsuite/tests/ghc-api/settings-escape/T25204.hs "T27225b" "T7275" "toplevel_scc_1"))) ,(string-append ; skips tests that only partially fail "--skip-test=" (string-join (list "CallerCc1" "scc001"))) "--skip-perf")) (format #t "test suite not run~%")))))))) (native-inputs (modify-inputs (package-native-inputs base) (replace "ghc" base) (prepend llvm-20) (prepend (specification->package "clang@20.1.8")) (replace "ghc-testsuite.tar.xz" (origin (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/ghc-" version "-testsuite.tar.xz")) (sha256 (base32 "1va5ls4ng32hq8236w2aq5k0gjwxzdmwgfjf6b8z7pgpy0hzrbl4")) (patches (append (search-patches "ghc-testsuite-recomp015-execstack.patch") (list (local-file "../../patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff")))))) (replace "hadrian-bootstrap-sources.tar.gz" (origin (method url-fetch) (uri (string-append "https://downloads.haskell.org/~ghc/" version "/hadrian-bootstrap-sources/" "hadrian-bootstrap-sources-" (package-version base) ".tar.gz")) (sha256 (base32 "11sz4wlibzbndpddfyd8gi1w5fkvq34xiq48kqnilgddvd5mj5yw")))))) (native-search-paths (list (search-path-specification (variable "GHC_PACKAGE_PATH") (files (list (string-append "lib/ghc-" version))) (file-pattern ".*\\.conf\\.d$") (file-type 'directory)))))))