From: kwshi <kwshi@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] new package: ghcup-0.1.17.4
Date: Sun, 05 Jun 2022 04:10:38 +0200 [thread overview]
Message-ID: <20220605021038.XIkyIFuLehswoNQtRUs1gOxtBIDADAwYChguW0XnyYs@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-35624@inbox.vuxu.org>
[-- 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
+}
next prev parent reply other threads:[~2022-06-05 2:10 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 6:23 [PR PATCH] " 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
2022-06-04 19:48 ` hasufell
2022-06-04 20:19 ` hasufell
2022-06-04 21:16 ` [PR REVIEW] " hasufell
2022-06-04 21:17 ` hasufell
2022-06-05 2:02 ` [PR PATCH] [Updated] " kwshi
2022-06-05 2:10 ` kwshi [this message]
2022-06-05 2:12 ` kwshi
2022-06-05 2:12 ` kwshi
2022-06-05 2:13 ` [PR REVIEW] " kwshi
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
2022-06-05 18:16 ` kwshi
2022-06-05 18:35 ` kwshi
2022-06-10 13:37 ` kwshi
2022-06-10 14:18 ` hasufell
2022-06-10 14:45 ` kwshi
2022-06-10 14:52 ` [PR PATCH] [Updated] " kwshi
2022-06-10 15:08 ` kwshi
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220605021038.XIkyIFuLehswoNQtRUs1gOxtBIDADAwYChguW0XnyYs@z \
--to=kwshi@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).