diff mbox series

[bug#38596] gnu: Add PureScript.

Message ID 87k12cifxs.fsf@asu.edu
State Accepted
Headers show
Series [bug#38596] gnu: Add PureScript. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

John Soo April 18, 2020, 10:31 p.m. UTC
Hi,

Christopher Baines <mail@cbaines.net> writes:

> I've had an initial look through these now, sorry it's taken so long!

No problem. I was thinking I ought to do some qa and review, myself.

> ghc-utf8-light could do with a better description, something a little
> more informative.

I think I made this better as well as fixing some other descriptions
lacking full sentences.

> The ghc-sourcemap and ghc-mtl-compat tests are disabled, it would be
> good to at least add a comments as to why.

I added a comment for sourcemap. I realized mtl-compat's tests and
haddocks worked just fine so those are re-enabled.

> The ghc-protolude synopsis could potentially be more informative.

I think I added some more commentary there. It's a bit tricky since I
have not used protolude myself so I am not sure what to provide aside
from their stated description.

> I think adding specific versions of dependencies for purescript is OK,
> but only if they're justified, like if the package only builds with that
> version. The justification should also be noted in the purescript
> package description.

Ah, thanks. Would a comment above the dependencies suffice? The packages
won't be searchable since they are not define-public (yet?).


> I don't think it's necessary to go through all the custom versions of
> packages you've added, but it would be good to at least see if there's
> one case where the upstream specification is overly strict, and the
> slightly different version from Guix would work. That at least would
> provide an example of how to override versions going forward.

Ah thanks for the suggestion here. I found one that could be taken from
the existing package in (gnu packages haskell-xyz). The rest seemed to
be either pinned exactly or too strict to take from guix packages.

Thanks for your help and tools!

John

Comments

Christopher Baines April 21, 2020, 7:55 a.m. UTC | #1
John Soo <jsoo1@asu.edu> writes:

> Christopher Baines <mail@cbaines.net> writes:
>
>> I've had an initial look through these now, sorry it's taken so long!
>
> No problem. I was thinking I ought to do some qa and review, myself.
>
>> ghc-utf8-light could do with a better description, something a little
>> more informative.
>
> I think I made this better as well as fixing some other descriptions
> lacking full sentences.

Great :)

>> The ghc-sourcemap and ghc-mtl-compat tests are disabled, it would be
>> good to at least add a comments as to why.
>
> I added a comment for sourcemap. I realized mtl-compat's tests and
> haddocks worked just fine so those are re-enabled.

Cool.

>> The ghc-protolude synopsis could potentially be more informative.
>
> I think I added some more commentary there. It's a bit tricky since I
> have not used protolude myself so I am not sure what to provide aside
> from their stated description.

Sure, I think it's fine now.

Some really minor description things I missed earlier:

ghc-aeson-better-errors, ghc-transformers and ghc-websockets have URLs
in the description, @url could probably be used.

I'd also remove the following from the ghc-bower-json description, it
reads more like uninformative advertising to me and isn't really
relevant to this specific package:

  Bower is a package manager for the web (see http://bower.io).

>> I think adding specific versions of dependencies for purescript is OK,
>> but only if they're justified, like if the package only builds with that
>> version. The justification should also be noted in the purescript
>> package description.
>
> Ah, thanks. Would a comment above the dependencies suffice? The packages
> won't be searchable since they are not define-public (yet?).

Maybe it would be good to note why the package in Guix didn't work, like
I tried to use ghc-happy@1.19.12, and the build phase failed with some
type errors. That'll at least point out clearly that there's an
incompatability. I don't think much detail is needed, the following
would be fine.

     `(("ghc-happy" ,ghc-happy-1.19.9)  ; build fails with 1.19.12

>> I don't think it's necessary to go through all the custom versions of
>> packages you've added, but it would be good to at least see if there's
>> one case where the upstream specification is overly strict, and the
>> slightly different version from Guix would work. That at least would
>> provide an example of how to override versions going forward.
>
> Ah thanks for the suggestion here. I found one that could be taken from
> the existing package in (gnu packages haskell-xyz). The rest seemed to
> be either pinned exactly or too strict to take from guix packages.

Thanks, although my intent was more about adding something like this.

  #:phases
  (modify-phases %standard-phases
    (add-after 'unpack 'patch
      (lambda _
        (substitute* "purescript.cabal"
          (("clock .*$")
           "clock,\n"))
        #t)))))


Now I'm not sure quite how risky this is, the purescript tests aren't
being run, but given this is Haskell and it compiles, hopefully that
provides some guarantees.

What do you think?

Thanks,

Chris
diff mbox series

Patch

From 747006cfc8c3739912138d9c3ec5f60f204e8758 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 13 Dec 2019 09:21:50 -0800
Subject: [PATCH 21/21] gnu: Add purescript.

* gnu/packages/purescript.scm (purescript): New variable.
---
 gnu/packages/purescript.scm | 89 +++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/gnu/packages/purescript.scm b/gnu/packages/purescript.scm
index 75e540e219..cec530dcdf 100644
--- a/gnu/packages/purescript.scm
+++ b/gnu/packages/purescript.scm
@@ -101,3 +101,92 @@ 
        (sha256
         (base32
          "1xacvl5wf47cz61igb94zf961b9ks0yhr02myxgjf53clm70dg6j"))))))
+
+(define-public purescript
+  (package
+    (name "purescript")
+    (version "0.13.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://hackage/package/purescript/purescript-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0plqzlcfaw2ik2im7aq8yy1b1y88cnc8qd7wwaayndbdz060s9j4"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-glob" ,ghc-glob-0.9.3)
+       ("ghc-aeson" ,ghc-aeson)
+       ("ghc-aeson-better-errors" ,ghc-aeson-better-errors)
+       ("ghc-aeson-pretty" ,ghc-aeson-pretty)
+       ("ghc-ansi-terminal" ,ghc-ansi-terminal-0.8.2)
+       ("ghc-base-compat" ,ghc-base-compat)
+       ("ghc-blaze-html" ,ghc-blaze-html)
+       ("ghc-bower-json" ,ghc-bower-json)
+       ("ghc-boxes" ,ghc-boxes)
+       ("ghc-cheapskate" ,ghc-cheapskate)
+       ("ghc-clock" ,ghc-clock-0.7.2)
+       ("ghc-cryptonite" ,ghc-cryptonite)
+       ("ghc-data-ordlist" ,ghc-data-ordlist)
+       ("ghc-dlist" ,ghc-dlist)
+       ("ghc-edit-distance" ,ghc-edit-distance)
+       ("ghc-file-embed" ,ghc-file-embed)
+       ("ghc-fsnotify" ,ghc-fsnotify)
+       ("ghc-happy" ,ghc-happy)
+       ("ghc-language-javascript" ,ghc-language-javascript)
+       ("ghc-lifted-async" ,ghc-lifted-async)
+       ("ghc-lifted-base" ,ghc-lifted-base)
+       ("ghc-memory" ,ghc-memory)
+       ("ghc-microlens-platform" ,ghc-microlens-platform)
+       ("ghc-monad-control" ,ghc-monad-control)
+       ("ghc-monad-logger" ,ghc-monad-logger)
+       ("ghc-network" ,ghc-network-3.0.1.1)
+       ("ghc-parallel" ,ghc-parallel)
+       ("ghc-pattern-arrows" ,ghc-pattern-arrows)
+       ("ghc-protolude" ,ghc-protolude)
+       ("ghc-regex-tdfa" ,ghc-regex-tdfa)
+       ("ghc-safe" ,ghc-safe)
+       ("ghc-scientific" ,ghc-scientific)
+       ("ghc-semialign" ,ghc-semialign)
+       ("ghc-semigroups" ,ghc-semigroups)
+       ("ghc-sourcemap" ,ghc-sourcemap)
+       ("ghc-split" ,ghc-split)
+       ("ghc-stringsearch" ,ghc-stringsearch)
+       ("ghc-syb" ,ghc-syb)
+       ("ghc-these" ,ghc-these)
+       ("ghc-transformers-base" ,ghc-transformers-base)
+       ("ghc-transformers-compat" ,ghc-transformers-compat)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)
+       ("ghc-utf8-string" ,ghc-utf8-string)
+       ("ghc-vector" ,ghc-vector)
+       ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
+       ("ghc-http-types" ,ghc-http-types)
+       ("ghc-network" ,ghc-network)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-wai" ,ghc-wai)
+       ("ghc-wai-websockets" ,ghc-wai-websockets)
+       ("ghc-warp" ,ghc-warp)
+       ("ghc-websockets" ,ghc-websockets)
+       ("ghc-gitrev" ,ghc-gitrev)))
+    (native-inputs
+     `(("ghc-happy" ,ghc-happy-1.19.9)
+       ("ghc-hunit" ,ghc-hunit)
+       ("ghc-hspec" ,ghc-hspec)
+       ("hspec-discover" ,hspec-discover)
+       ("ghc-tasty" ,ghc-tasty)
+       ("ghc-tasty-hspec" ,ghc-tasty-hspec)))
+    (arguments
+     `(;; Tests require npm
+       #:tests? #f
+       ;; Haddock fails
+       #:haddock? #f
+       #:configure-flags '("--flags=release")))
+    (home-page "https://www.purescript.org/")
+    (synopsis "Haskell inspired programming language compiling to JavaScript")
+    (description
+     "A small strongly, statically typed programming language with
+expressive types, inspired by Haskell and compiling to JavaScript.")
+    (license license:bsd-3)))
-- 
2.26.0