* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
@ 2022-02-15 6:48 ` kwshi
2022-03-13 15:02 ` prez
` (25 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-02-15 6:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.4
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
`[ci skip]` (on local machine, the build takes about 2-3 hours)
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 1386 bytes --]
From fca48f4d4836c583e3cc0c7a43ad57e1ce3d0e50 Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.4
---
srcpkgs/ghcup/template | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..adf9837fee21
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,24 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.4
+revision=1
+wrksrc="ghcup-hs-v$version"
+build_style='haskell-stack'
+make_build_args='--flag ghcup:tui --flag ghcup:internal-downloader'
+hostmakedepends='tar'
+makedepends='zlib-devel ncurses-libtinfo-devel openssl-devel'
+depends='zlib ncurses-libtinfo-libs openssl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='9bd500baceb90d082bcb33173f3b6356aa91549b4a37fad181eeb21e06b93e64'
+nopie_files='/usr/bin/ghcup'
+nocross='Cannot cross-compile yet with Haskell'
+
+post_install() {
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
2022-02-15 6:48 ` [PR PATCH] [Updated] " kwshi
@ 2022-03-13 15:02 ` prez
2022-06-04 17:55 ` kwshi
` (24 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: prez @ 2022-03-13 15:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1066120236
Comment:
Is there anything that keeps this from getting merged? Thanks.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
2022-02-15 6:48 ` [PR PATCH] [Updated] " kwshi
2022-03-13 15:02 ` prez
@ 2022-06-04 17:55 ` kwshi
2022-06-04 19:47 ` [PR REVIEW] " hasufell
` (23 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-04 17:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
New comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1146659322
Comment:
As of recently, the build has starting breaking for me, presumably because Void has updated its GHC to 9.0.2 (9836c283a4706e5d3e84f0024a852d0ee18acd0f), introducing some version-solving errors with ghcup's dependencies (which explicitly depend on a version of `base` older than the one included in GHC 9.0.2). I'm working on getting it fixed right now...
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (2 preceding siblings ...)
2022-06-04 17:55 ` kwshi
@ 2022-06-04 19:47 ` hasufell
2022-06-04 19:48 ` hasufell
` (22 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-04 19:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
New review comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889609016
Comment:
```suggestion
version=0.1.17.8
```
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (3 preceding siblings ...)
2022-06-04 19:47 ` [PR REVIEW] " hasufell
@ 2022-06-04 19:48 ` hasufell
2022-06-04 20:19 ` hasufell
` (21 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-04 19:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
New review comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889609160
Comment:
`curl` and `wget` are optional runtime dependencies.
Additionally, you need at least these **runtime dependencies** to install GHC via ghcup: `gcc gmp make ncurses ncurses-libtinfo-libs perl`
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (4 preceding siblings ...)
2022-06-04 19:48 ` hasufell
@ 2022-06-04 20:19 ` hasufell
2022-06-04 21:16 ` [PR REVIEW] " hasufell
` (20 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-04 20:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
New comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1146679760
Comment:
You should print a post-install message like arch: https://aur.archlinux.org/cgit/aur.git/tree/ghcup-hs-bin.install?h=ghcup-hs-bin
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (5 preceding siblings ...)
2022-06-04 20:19 ` hasufell
@ 2022-06-04 21:16 ` hasufell
2022-06-04 21:17 ` hasufell
` (19 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-04 21:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
New review comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889616575
Comment:
The internal downloader can cause issues with esoteric proxy configurations. In that case users can do
```sh
ghcup config set downloader Curl
```
to set the downloader back to curl, which can handle it. This should be a post-install message as well.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (6 preceding siblings ...)
2022-06-04 21:16 ` [PR REVIEW] " hasufell
@ 2022-06-04 21:17 ` hasufell
2022-06-05 2:02 ` [PR PATCH] [Updated] " kwshi
` (18 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-04 21:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 255 bytes --]
New comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1146686841
Comment:
Here's a patch to fix building with GHC-9.0.2: https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (7 preceding siblings ...)
2022-06-04 21:17 ` hasufell
@ 2022-06-05 2:02 ` kwshi
2022-06-05 2:10 ` kwshi
` (17 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.4
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 5812 bytes --]
From 7879f865d45768433d24e1150fdf8533f929d181 Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 85 +++++++++++++++++++
srcpkgs/ghcup/template | 28 ++++++
2 files changed, 113 insertions(+)
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..3584d70d3bcb
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,85 @@
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..35aeb7228895
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,28 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='curl zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+#make_build_args='--flag ghcup:tui --flag ghcup:internal-downloader'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (8 preceding siblings ...)
2022-06-05 2:02 ` [PR PATCH] [Updated] " kwshi
@ 2022-06-05 2:10 ` kwshi
2022-06-05 2:12 ` kwshi
` (16 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.4
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6538 bytes --]
From 2f90187128ca1929c670be2d964f9a5d5157a02b Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 85 +++++++++++++++++++
srcpkgs/ghcup/template | 27 ++++++
3 files changed, 120 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..3584d70d3bcb
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,85 @@
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..0f174ffae932
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,27 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (9 preceding siblings ...)
2022-06-05 2:10 ` kwshi
@ 2022-06-05 2:12 ` kwshi
2022-06-05 2:12 ` kwshi
` (15 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.4
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6538 bytes --]
From c4966a5a86a265c7ab4591f570ce8aa392a232f2 Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 85 +++++++++++++++++++
srcpkgs/ghcup/template | 27 ++++++
3 files changed, 120 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..3584d70d3bcb
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,85 @@
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..0f174ffae932
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,27 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (10 preceding siblings ...)
2022-06-05 2:12 ` kwshi
@ 2022-06-05 2:12 ` kwshi
2022-06-05 2:13 ` [PR REVIEW] " kwshi
` (14 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.4
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6640 bytes --]
From 7eb0685ab06e1886fc51d57835ff09dfde22e559 Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 86 +++++++++++++++++++
srcpkgs/ghcup/template | 27 ++++++
3 files changed, 121 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..978a7abc1ad0
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,86 @@
+patch given by hasufell, posted at https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..0f174ffae932
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,27 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (11 preceding siblings ...)
2022-06-05 2:12 ` kwshi
@ 2022-06-05 2:13 ` kwshi
2022-06-05 2:15 ` kwshi
` (13 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
New review comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889636811
Comment:
I've added such a post-install message in `INSTALL.msg` now.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (12 preceding siblings ...)
2022-06-05 2:13 ` [PR REVIEW] " kwshi
@ 2022-06-05 2:15 ` kwshi
2022-06-05 2:15 ` kwshi
` (12 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
New review comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889636867
Comment:
the runtime dependencies have been added, and optional curl/wget dependencies are mentioned in INSTALL.msg.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR REVIEW] new package: ghcup-0.1.17.4
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (13 preceding siblings ...)
2022-06-05 2:15 ` kwshi
@ 2022-06-05 2:15 ` kwshi
2022-06-05 17:53 ` [PR PATCH] [Updated] new package: ghcup-0.1.17.8 kwshi
` (11 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 2:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 152 bytes --]
New review comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#discussion_r889636873
Comment:
updated
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (14 preceding siblings ...)
2022-06-05 2:15 ` kwshi
@ 2022-06-05 17:53 ` kwshi
2022-06-05 18:16 ` kwshi
` (10 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 17:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.8
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6684 bytes --]
From a4ec3cb7a4b5a0937ec47837062fb9a873a4b3e7 Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 86 +++++++++++++++++++
srcpkgs/ghcup/template | 28 ++++++
3 files changed, 122 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..978a7abc1ad0
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,86 @@
+patch given by hasufell, posted at https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..8d0361c1a254
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,28 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+nocross='cannot cross compile haskell yet'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (15 preceding siblings ...)
2022-06-05 17:53 ` [PR PATCH] [Updated] new package: ghcup-0.1.17.8 kwshi
@ 2022-06-05 18:16 ` kwshi
2022-06-05 18:35 ` kwshi
` (9 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 18:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.8
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6661 bytes --]
From f5ed6cb7216cfb6f0a6f2201306b3c0a0c134a2c Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 86 +++++++++++++++++++
srcpkgs/ghcup/template | 28 ++++++
3 files changed, 122 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..978a7abc1ad0
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,86 @@
+patch given by hasufell, posted at https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..1ddf15795071
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,28 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+nocross='cannot cross compile haskell yet'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (16 preceding siblings ...)
2022-06-05 18:16 ` kwshi
@ 2022-06-05 18:35 ` kwshi
2022-06-10 13:37 ` kwshi
` (8 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-05 18:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.8
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6706 bytes --]
From 09303c6d4b85da080a43c99b7a4e6f28a467fa9b Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 86 +++++++++++++++++++
srcpkgs/ghcup/template | 29 +++++++
3 files changed, 123 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..978a7abc1ad0
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,86 @@
+patch given by hasufell, posted at https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..c854e78e25e9
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,29 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+archs='x86_64 i686'
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+nocross='cannot cross compile haskell yet'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'+system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (17 preceding siblings ...)
2022-06-05 18:35 ` kwshi
@ 2022-06-10 13:37 ` kwshi
2022-06-10 14:18 ` hasufell
` (7 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-10 13:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
New comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1152371629
Comment:
I've applied @hasufell's patch and gotten the build to work; compilation on/to non-`x86_64` architectures or musl unfortunately doesn't work currently because some of ghcup's dependencies are incompatible (e.g., haskell's `libarchive` package explicitly imports a glibc header). This package template is ready for review.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (18 preceding siblings ...)
2022-06-10 13:37 ` kwshi
@ 2022-06-10 14:18 ` hasufell
2022-06-10 14:45 ` kwshi
` (6 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: hasufell @ 2022-06-10 14:18 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
New comment by hasufell on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1152411910
Comment:
> I've applied @hasufell's patch and gotten the build to work; compilation on/to non-`x86_64` architectures or musl unfortunately doesn't work currently because some of ghcup's dependencies are incompatible (e.g., haskell's `libarchive` package explicitly imports a glibc header). This package template is ready for review.
That can't be. The ghcup binaries are built on alpine linux with musl.
There's a static libarchive option: `-f-system-libarchive`
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (19 preceding siblings ...)
2022-06-10 14:18 ` hasufell
@ 2022-06-10 14:45 ` kwshi
2022-06-10 14:52 ` [PR PATCH] [Updated] " kwshi
` (5 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-10 14:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
New comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1152441085
Comment:
> > I've applied @hasufell's patch and gotten the build to work; compilation on/to non-`x86_64` architectures or musl unfortunately doesn't work currently because some of ghcup's dependencies are incompatible (e.g., haskell's `libarchive` package explicitly imports a glibc header). This package template is ready for review.
>
> That can't be. The ghcup binaries are built on alpine linux with musl.
>
> There's a static libarchive option: `-f-system-libarchive`
Weird-- I've tried building with `-f-system-libarchive` and the error still appears. The relevant error message, I think, is
```
c/archive_platform.h:84:10: error:
fatal error: sys/cdefs.h: No such file or directory
84 | #include <sys/cdefs.h>
| ^~~~~~~~~~~~~
|
84 | #include <sys/cdefs.h>
```
Where all googled instances of `sys/cdefs.h` seem to point to GNU libc. The full error log on the workflow run is at https://github.com/void-linux/void-packages/runs/6742127441?check_suite_focus=true (`x86_64-musl` architecture run).
I'll do some more investigation to see what's going on.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (20 preceding siblings ...)
2022-06-10 14:45 ` kwshi
@ 2022-06-10 14:52 ` kwshi
2022-06-10 15:08 ` kwshi
` (4 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-10 14:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
There is an updated pull request by kwshi against master on the void-packages repository
https://github.com/kwshi/void-packages ghcup-0.1.17.4
https://github.com/void-linux/void-packages/pull/35624
new package: ghcup-0.1.17.8
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
A patch file from https://github.com/void-linux/void-packages/pull/35624.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghcup-0.1.17.4-35624.patch --]
[-- Type: text/x-diff, Size: 6707 bytes --]
From 19dc5727b2c217821d36f0c004f0a7b009bec61f Mon Sep 17 00:00:00 2001
From: Kye Shi <shi.kye@gmail.com>
Date: Mon, 14 Feb 2022 21:33:12 -0800
Subject: [PATCH] new package: ghcup-0.1.17.8
---
srcpkgs/ghcup/INSTALL.msg | 8 ++
.../ghcup-0.1.17.8-fix-ghc902-fromjson.patch | 86 +++++++++++++++++++
srcpkgs/ghcup/template | 29 +++++++
3 files changed, 123 insertions(+)
create mode 100644 srcpkgs/ghcup/INSTALL.msg
create mode 100644 srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
create mode 100644 srcpkgs/ghcup/template
diff --git a/srcpkgs/ghcup/INSTALL.msg b/srcpkgs/ghcup/INSTALL.msg
new file mode 100644
index 000000000000..100bbd0780b7
--- /dev/null
+++ b/srcpkgs/ghcup/INSTALL.msg
@@ -0,0 +1,8 @@
+ghcup comes with an internal downloader, but optionally depends on curl and/or
+wget for more advanced usages (e.g., proxying). To use curl/wget as downloader,
+first make sure they are installed, then run `ghcup config set downloader Curl`.
+
+Also, ghcup requires $GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin to be in your PATH
+(by default, $GHCUP_INSTALL_BASE_PREFIX is $HOME); make sure to update your
+shell launch scripts accordingly. Alternatively, when GHCUP_USE_XDG_DIRS is set,
+GHCUP uses XDG-ish directories.
diff --git a/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
new file mode 100644
index 000000000000..978a7abc1ad0
--- /dev/null
+++ b/srcpkgs/ghcup/patches/ghcup-0.1.17.8-fix-ghc902-fromjson.patch
@@ -0,0 +1,86 @@
+patch given by hasufell, posted at https://gist.github.com/hasufell/164af24885c6f066291c417a9850388d
+diff --git a/lib/GHCup/Types/JSON.hs b/lib/GHCup/Types/JSON.hs
+index 8d7cd3b..3dd05ee 100644
+--- a/lib/GHCup/Types/JSON.hs
++++ b/lib/GHCup/Types/JSON.hs
+@@ -79,37 +79,6 @@ instance FromJSON Tag where
+ instance ToJSON URI where
+ toJSON = toJSON . E.decodeUtf8With E.lenientDecode . serializeURIRef'
+
+-instance FromJSON URLSource where
+- parseJSON v =
+- parseGHCupURL v
+- <|> parseOwnSourceLegacy v
+- <|> parseOwnSourceNew1 v
+- <|> parseOwnSourceNew2 v
+- <|> parseOwnSpec v
+- <|> legacyParseAddSource v
+- <|> newParseAddSource v
+- where
+- parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
+- r :: URI <- o .: "OwnSource"
+- pure (OwnSource [Right r])
+- parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
+- r :: [URI] <- o .: "OwnSource"
+- pure (OwnSource (fmap Right r))
+- parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "OwnSource"
+- pure (OwnSource r)
+- parseOwnSpec = withObject "URLSource" $ \o -> do
+- r :: GHCupInfo <- o .: "OwnSpec"
+- pure (OwnSpec r)
+- parseGHCupURL = withObject "URLSource" $ \o -> do
+- _ :: [Value] <- o .: "GHCupURL"
+- pure GHCupURL
+- legacyParseAddSource = withObject "URLSource" $ \o -> do
+- r :: Either GHCupInfo URI <- o .: "AddSource"
+- pure (AddSource [r])
+- newParseAddSource = withObject "URLSource" $ \o -> do
+- r :: [Either GHCupInfo URI] <- o .: "AddSource"
+- pure (AddSource r)
+
+ instance FromJSON URI where
+ parseJSON = withText "URL" $ \t ->
+@@ -349,7 +318,40 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GHCupI
+ deriveToJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''URLSource
+ deriveJSON defaultOptions { sumEncoding = ObjectWithSingleField } ''Key
+ deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "k-") . T.pack . kebab $ str' } ''UserKeyBindings
+-deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
+-
+ deriveToJSON defaultOptions { fieldLabelModifier = kebab } ''Settings
+ deriveToJSON defaultOptions { fieldLabelModifier = drop 2 . kebab } ''KeyBindings -- move under key-bindings key
++
++instance FromJSON URLSource where
++ parseJSON v =
++ parseGHCupURL v
++ <|> parseOwnSourceLegacy v
++ <|> parseOwnSourceNew1 v
++ <|> parseOwnSourceNew2 v
++ <|> parseOwnSpec v
++ <|> legacyParseAddSource v
++ <|> newParseAddSource v
++ where
++ parseOwnSourceLegacy = withObject "URLSource" $ \o -> do
++ r :: URI <- o .: "OwnSource"
++ pure (OwnSource [Right r])
++ parseOwnSourceNew1 = withObject "URLSource" $ \o -> do
++ r :: [URI] <- o .: "OwnSource"
++ pure (OwnSource (fmap Right r))
++ parseOwnSourceNew2 = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "OwnSource"
++ pure (OwnSource r)
++ parseOwnSpec = withObject "URLSource" $ \o -> do
++ r :: GHCupInfo <- o .: "OwnSpec"
++ pure (OwnSpec r)
++ parseGHCupURL = withObject "URLSource" $ \o -> do
++ _ :: [Value] <- o .: "GHCupURL"
++ pure GHCupURL
++ legacyParseAddSource = withObject "URLSource" $ \o -> do
++ r :: Either GHCupInfo URI <- o .: "AddSource"
++ pure (AddSource [r])
++ newParseAddSource = withObject "URLSource" $ \o -> do
++ r :: [Either GHCupInfo URI] <- o .: "AddSource"
++ pure (AddSource r)
++
++deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "u-") . T.pack . kebab $ str' } ''UserSettings
++
diff --git a/srcpkgs/ghcup/template b/srcpkgs/ghcup/template
new file mode 100644
index 000000000000..c9258ced7f08
--- /dev/null
+++ b/srcpkgs/ghcup/template
@@ -0,0 +1,29 @@
+# Template file for 'ghcup'
+pkgname=ghcup
+version=0.1.17.8
+revision=1
+#archs='x86_64 i686'
+wrksrc="ghcup-hs-v$version"
+hostmakedepends='tar git cabal-install'
+makedepends='zlib-devel ncurses-libtinfo-devel libarchive-devel'
+depends='zlib ncurses-libtinfo-libs libarchive gcc gmp make perl'
+short_desc='Installer for the general purpose language Haskell'
+maintainer='Kye Shi <shi.kye@gmail.com>'
+license='LGPL-3.0-only'
+homepage='https://www.haskell.org/ghcup/'
+distfiles="https://gitlab.haskell.org/haskell/ghcup-hs/-/archive/v$version/ghcup-hs-v$version.tar.gz"
+checksum='15156760d8593045515002c8c91803cbf67c9eb4bab357c46d2fdedea8c63ab1'
+nopie_files='/usr/bin/ghcup'
+nocross='cannot cross compile haskell yet'
+
+do_build() {
+ cabal update --prefix="$PWD"
+ cabal build --prefix="$PWD" --project-file='cabal.ghc902.project' -f'+internal-downloader' -f'-system-libarchive' -f'+tui'
+}
+
+do_install() {
+ cabal install --prefix="$PWD" --install-method='copy' --installdir="$DESTDIR/usr/bin"
+ for sh in 'bash' 'fish' 'zsh'; do
+ vcompletion "scripts/shell-completions/$sh" "$sh"
+ done
+}
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (21 preceding siblings ...)
2022-06-10 14:52 ` [PR PATCH] [Updated] " kwshi
@ 2022-06-10 15:08 ` kwshi
2022-09-09 2:15 ` github-actions
` (3 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-06-10 15:08 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]
New comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1152441085
Comment:
> > I've applied @hasufell's patch and gotten the build to work; compilation on/to non-`x86_64` architectures or musl unfortunately doesn't work currently because some of ghcup's dependencies are incompatible (e.g., haskell's `libarchive` package explicitly imports a glibc header). This package template is ready for review.
>
> That can't be. The ghcup binaries are built on alpine linux with musl.
>
> There's a static libarchive option: `-f-system-libarchive`
Weird-- I've tried building with `-f-system-libarchive` and the error still appears. The relevant error message, I think, is
```
c/archive_platform.h:84:10: error:
fatal error: sys/cdefs.h: No such file or directory
84 | #include <sys/cdefs.h>
| ^~~~~~~~~~~~~
|
84 | #include <sys/cdefs.h>
```
Where all googled instances of `sys/cdefs.h` seem to point to GNU libc. The full error log on the workflow run is at https://github.com/void-linux/void-packages.
I've updated the package template to use `-f-system-libarchive`, and as you can see from the [CI logs](https://github.com/void-linux/void-packages/runs/6833102145?check_suite_focus=true) the same error still occurs; cabal is still trying to build the `libarchive` library, even though per my understanding it shouldn't (if we're using static libarchive).
I'll do some more investigation on alpine to see what might explain this disparity.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (22 preceding siblings ...)
2022-06-10 15:08 ` kwshi
@ 2022-09-09 2:15 ` github-actions
2022-09-09 22:10 ` kwshi
` (2 subsequent siblings)
26 siblings, 0 replies; 28+ messages in thread
From: github-actions @ 2022-09-09 2:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1241420534
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (23 preceding siblings ...)
2022-09-09 2:15 ` github-actions
@ 2022-09-09 22:10 ` kwshi
2022-12-09 2:32 ` github-actions
2022-12-24 1:52 ` [PR PATCH] [Closed]: " github-actions
26 siblings, 0 replies; 28+ messages in thread
From: kwshi @ 2022-09-09 22:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
New comment by kwshi on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1242518135
Comment:
bumping; still working on this!
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (24 preceding siblings ...)
2022-09-09 22:10 ` kwshi
@ 2022-12-09 2:32 ` github-actions
2022-12-24 1:52 ` [PR PATCH] [Closed]: " github-actions
26 siblings, 0 replies; 28+ messages in thread
From: github-actions @ 2022-12-09 2:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/35624#issuecomment-1343762823
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PR PATCH] [Closed]: new package: ghcup-0.1.17.8
2022-02-15 6:23 [PR PATCH] new package: ghcup-0.1.17.4 kwshi
` (25 preceding siblings ...)
2022-12-09 2:32 ` github-actions
@ 2022-12-24 1:52 ` github-actions
26 siblings, 0 replies; 28+ messages in thread
From: github-actions @ 2022-12-24 1:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
There's a closed pull request on the void-packages repository
new package: ghcup-0.1.17.8
https://github.com/void-linux/void-packages/pull/35624
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements):
**YES**:
1. System-wide: `ghcup` is meant to be installed system-wide, even though it
manages per-user installations of the Haskell toolchain (essentially
analogous to `rustup` for Rust or `opam` for OCaml)
2. Compiled: Yep
3. Required (by other packages): no, but it's a very useful tool for Haskell
developers, in the same way that rustup is useful for Rust devs,
npm/pnpm/yarn is for JS devs, etc.
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (`x86_64-glibc`)
- I couldn't test build this PR locally for other architectures because,
apparently, we can't cross-compile with Haskell yet.
^ permalink raw reply [flat|nested] 28+ messages in thread