diff mbox series

[bug#39309] .[PATCH] WIP gnu: add stack.

Message ID 87zh1s3554.fsf_-_@asu.edu
State New
Headers show
Series [bug#39309] .[PATCH] WIP gnu: add stack. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

John Soo Jan. 1, 2021, 6:04 p.m. UTC
Hi Tim and Guix!

Stack now builds but some tests fail!

Here are the updated patches :)

- John

Comments

John Soo Jan. 1, 2021, 6:18 p.m. UTC | #1
Well it looks like cryptonite-conduit was added since the last time I
worked on stack. The patch that adds it should be ignored.
diff mbox series

Patch

From 4085284414b279b064a9ac756bfaefe92c33e0de Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 26 Jan 2020 11:19:47 -0800
Subject: [PATCH 31/31] gnu: Add stack.

* gnu/packages/haskell-xyz.scm (stack): New variable.
---
 gnu/packages/haskell-apps.scm                 | 115 ++++++++++++++++++
 .../patches/stack-ghc8.8-compatibility.patch  |  27 ++++
 2 files changed, 142 insertions(+)
 create mode 100644 gnu/packages/patches/stack-ghc8.8-compatibility.patch

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index 19a0fc8a44..b7eb0380bf 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -37,6 +37,8 @@ 
   #:use-module (guix packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system haskell)
+  #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages gl)
@@ -864,6 +866,119 @@  test specifications defining a command to run, some input, and the expected
 output, stderr, and exit status.")
     (license license:gpl3+)))
 
+(define-public stack
+  (package
+    (name "stack")
+    (version "2.1.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/stack/stack-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1q2nagnc24fvyj3hwnpgyp3rqhxswhscyw4pw2dazqx34ad3d0zr"))
+       (patches (search-patches "stack-ghc8.8-compatibility.patch"))))
+    (build-system haskell-build-system)
+    ;; FIXME: Some tests fail to access root directory
+    (arguments `(#:tests? #f))
+    (inputs
+     `(("ghc-aeson" ,ghc-aeson)
+       ("ghc-annotated-wl-pprint" ,ghc-annotated-wl-pprint)
+       ("ghc-ansi-terminal" ,ghc-ansi-terminal)
+       ("ghc-async" ,ghc-async)
+       ("ghc-attoparsec" ,ghc-attoparsec)
+       ("ghc-base64-bytestring" ,ghc-base64-bytestring)
+       ("ghc-colour" ,ghc-colour)
+       ("ghc-conduit" ,ghc-conduit)
+       ("ghc-conduit-extra" ,ghc-conduit-extra)
+       ("ghc-cryptonite" ,ghc-cryptonite)
+       ("ghc-cryptonite-conduit" ,ghc-cryptonite-conduit)
+       ("ghc-echo" ,ghc-echo)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-extra" ,ghc-extra)
+       ("ghc-file-embed" ,ghc-file-embed)
+       ("ghc-filelock" ,ghc-filelock)
+       ("ghc-fsnotify" ,ghc-fsnotify)
+       ("ghc-generic-deriving" ,ghc-generic-deriving)
+       ("ghc-hackage-security" ,ghc-hackage-security)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-hi-file-parser" ,ghc-hi-file-parser)
+       ("ghc-hpack" ,ghc-hpack)
+       ("ghc-http-client" ,ghc-http-client)
+       ("ghc-http-client-tls" ,ghc-http-client-tls)
+       ("ghc-http-conduit" ,ghc-http-conduit)
+       ("ghc-http-download" ,ghc-http-download)
+       ("ghc-http-types" ,ghc-http-types)
+       ("ghc-memory" ,ghc-memory)
+       ("ghc-microlens" ,ghc-microlens)
+       ("ghc-mintty" ,ghc-mintty)
+       ("ghc-mono-traversable" ,ghc-mono-traversable)
+       ("ghc-mustache" ,ghc-mustache)
+       ("ghc-neat-interpolation" ,ghc-neat-interpolation)
+       ("ghc-network-uri" ,ghc-network-uri)
+       ("ghc-open-browser" ,ghc-open-browser)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-pantry" ,ghc-pantry)
+       ("ghc-path" ,ghc-path)
+       ("ghc-path-io" ,ghc-path-io)
+       ("ghc-persistent" ,ghc-persistent)
+       ("ghc-persistent-sqlite" ,ghc-persistent-sqlite)
+       ("ghc-persistent-template" ,ghc-persistent-template)
+       ("ghc-primitive" ,ghc-primitive)
+       ("ghc-project-template" ,ghc-project-template)
+       ("ghc-regex-applicative-text" ,ghc-regex-applicative-text)
+       ("ghc-resource-pool" ,ghc-resource-pool)
+       ("ghc-resourcet" ,ghc-resourcet)
+       ("ghc-retry" ,ghc-retry)
+       ("ghc-rio" ,ghc-rio)
+       ("ghc-rio-prettyprint" ,ghc-rio-prettyprint)
+       ("ghc-semigroups" ,ghc-semigroups)
+       ("ghc-split" ,ghc-split)
+       ("ghc-streaming-commons" ,ghc-streaming-commons)
+       ("ghc-tar" ,ghc-tar)
+       ("ghc-temporary" ,ghc-temporary)
+       ("ghc-terminal-size" ,ghc-terminal-size)
+       ("ghc-text-metrics" ,ghc-text-metrics)
+       ("ghc-th-reify-many" ,ghc-th-reify-many)
+       ("ghc-tls" ,ghc-tls)
+       ("ghc-typed-process" ,ghc-typed-process)
+       ("ghc-unicode-transforms" ,ghc-unicode-transforms)
+       ("ghc-unix-compat" ,ghc-unix-compat)
+       ("ghc-unliftio" ,ghc-unliftio)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)
+       ("ghc-vector" ,ghc-vector)
+       ("ghc-yaml" ,ghc-yaml)
+       ("ghc-zip-archive" ,ghc-zip-archive)
+       ("ghc-zlib" ,ghc-zlib)
+       ("ghc-githash" ,ghc-githash)
+       ("ghc-optparse-simple" ,ghc-optparse-simple)
+       ("ghc-hspec" ,ghc-hspec)
+       ("ghc-optparse-generic" ,ghc-optparse-generic)))
+    (native-inputs
+     `(("ghc-quickcheck" ,ghc-quickcheck)
+       ("ghc-raw-strings-qq" ,ghc-raw-strings-qq)
+       ("ghc-smallcheck" ,ghc-smallcheck)
+       ("hspec-discover" ,hspec-discover)))
+    (home-page "http://haskellstack.org")
+    (synopsis "Haskell Tool Stack")
+    (description
+     "Stack is a cross-platform program for developing Haskell projects.  It
+is aimed at Haskellers both new and experienced.
+
+It features:
+
+@itemize
+@item Installing GHC automatically, in an isolated location.
+@item Installing packages needed for your project.
+@item Building your project.
+@item Testing your project.
+@item Benchmarking your project.
+@end itemize")
+    (license license:bsd-3)))
+
 (define-public stylish-haskell
   (package
     (name "stylish-haskell")
diff --git a/gnu/packages/patches/stack-ghc8.8-compatibility.patch b/gnu/packages/patches/stack-ghc8.8-compatibility.patch
new file mode 100644
index 0000000000..1bfaa14b8b
--- /dev/null
+++ b/gnu/packages/patches/stack-ghc8.8-compatibility.patch
@@ -0,0 +1,27 @@ 
+This version of stack uses some language features that changed from 8.6 to
+8.8.
+
+diff --git a/src/Stack/Storage/User.hs.old b/src/Stack/Storage/User.hs
+index 3845b09..cfc17d5 100644
+--- a/src/Stack/Storage/User.hs
++++ b/src/Stack/Storage/User.hs
+@@ -10,6 +10,8 @@
+ {-# LANGUAGE TupleSections #-}
+ {-# LANGUAGE TypeFamilies #-}
+ {-# LANGUAGE UndecidableInstances #-}
++{-# LANGUAGE DerivingStrategies #-}
++{-# LANGUAGE StandaloneDeriving #-}
+ {-# OPTIONS_GHC -Wno-unused-top-binds -Wno-identities #-}
+
+ -- | Work with SQLite database used for caches across an entire user account.
+--- a/src/Stack/Storage/Project.hs.old
++++ b/src/Stack/Storage/Project.hs
+@@ -10,4 +10,6 @@
+ {-# LANGUAGE TupleSections #-}
+ {-# LANGUAGE TypeFamilies #-}
+ {-# LANGUAGE UndecidableInstances #-}
++{-# LANGUAGE DerivingStrategies #-}
++{-# LANGUAGE StandaloneDeriving #-}
+ {-# OPTIONS_GHC -Wno-unused-top-binds -Wno-identities #-}
+
+ -- | Work with SQLite database used for caches across a single project.
-- 
2.29.2