summaryrefslogtreecommitdiff
path: root/andromeda/packages/haskell.scm
blob: c4509acc827c63e1404e5377880dbc44643c88a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
(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")
      (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")
      (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)))))))