hackport 0.8.4.0 → 0.8.5.0
raw patch · 88 files changed
+1047/−1099 lines, 88 filesdep +data-default-classdep −ghc-compactdep ~basedep ~directorydep ~time
Dependencies added: data-default-class
Dependencies removed: ghc-compact
Dependency ranges changed: base, directory, time
Files
- .github/workflows/haskell.yml +9/−4
- .gitmodules +1/−1
- CHANGELOG.md +27/−0
- cabal/Cabal-syntax/Cabal-syntax.cabal +6/−7
- cabal/Cabal-tests/Cabal-tests.cabal +1/−1
- cabal/Cabal/Cabal.cabal +2/−2
- cabal/cabal-install-solver/src/Distribution/Solver/Modular/Linking.hs +4/−0
- cabal/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs +3/−0
- cabal/cabal-install/cabal-install.cabal +5/−2
- cabal/cabal-install/src/Distribution/Client/Compat/Tar.hs +68/−0
- cabal/cabal-install/src/Distribution/Client/ProjectPlanning.hs +3/−0
- cabal/cabal-install/src/Distribution/Client/Tar.hs +8/−28
- cabal/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs +13/−11
- hackage-security/.github/workflows/haskell-ci.yml +66/−88
- hackage-security/.github/workflows/haskell.yml +22/−15
- hackage-security/cabal.haskell-ci +23/−1
- hackage-security/example-client/example-client.cabal +16/−8
- hackage-security/example-client/src/Prelude.hs +0/−27
- hackage-security/hackage-repo-tool/ChangeLog.md +4/−0
- hackage-security/hackage-repo-tool/hackage-repo-tool.cabal +19/−21
- hackage-security/hackage-repo-tool/src/Hackage/Security/RepoTool/Util/IO.hs +0/−14
- hackage-security/hackage-repo-tool/src/Main.hs +0/−5
- hackage-security/hackage-repo-tool/src/Prelude.hs +0/−27
- hackage-security/hackage-root-tool/Main.hs +0/−5
- hackage-security/hackage-root-tool/hackage-root-tool.cabal +12/−4
- hackage-security/hackage-security-HTTP/ChangeLog.md +5/−0
- hackage-security/hackage-security-HTTP/hackage-security-HTTP.cabal +14/−6
- hackage-security/hackage-security-HTTP/src/Hackage/Security/Client/Repository/HttpLib/HTTP.hs +0/−7
- hackage-security/hackage-security-curl/hackage-security-curl.cabal +12/−4
- hackage-security/hackage-security-http-client/ChangeLog.md +4/−0
- hackage-security/hackage-security-http-client/hackage-security-http-client.cabal +12/−4
- hackage-security/hackage-security/ChangeLog.md +14/−0
- hackage-security/hackage-security/hackage-security.cabal +34/−62
- hackage-security/hackage-security/src/Hackage/Security/Client.hs +2/−19
- hackage-security/hackage-security/src/Hackage/Security/Client/Formats.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Client/Repository.hs +1/−6
- hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Cache.hs +2/−2
- hackage-security/hackage-security/src/Hackage/Security/Client/Repository/HttpLib.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Local.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Remote.hs +1/−7
- hackage-security/hackage-security/src/Hackage/Security/Client/Verify.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/JSON.hs +1/−6
- hackage-security/hackage-security/src/Hackage/Security/Key.hs +1/−28
- hackage-security/hackage-security/src/Hackage/Security/Key/Env.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Common.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/FileInfo.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/FileMap.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Header.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Cache.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Index.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Repo.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Mirrors.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Paths.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Patterns.hs +2/−24
- hackage-security/hackage-security/src/Hackage/Security/TUF/Root.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Signed.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Snapshot.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Targets.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/TUF/Timestamp.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Trusted.hs +2/−3
- hackage-security/hackage-security/src/Hackage/Security/Trusted/TCB.hs +29/−34
- hackage-security/hackage-security/src/Hackage/Security/Util/Base64.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/Checked.hs +5/−32
- hackage-security/hackage-security/src/Hackage/Security/Util/Exit.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/IO.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/JSON.hs +2/−16
- hackage-security/hackage-security/src/Hackage/Security/Util/Lens.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/Path.hs +2/−24
- hackage-security/hackage-security/src/Hackage/Security/Util/Pretty.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/Some.hs +1/−14
- hackage-security/hackage-security/src/Hackage/Security/Util/Stack.hs +1/−1
- hackage-security/hackage-security/src/Hackage/Security/Util/TypedEmbedded.hs +1/−1
- hackage-security/hackage-security/src/MyPrelude.hs +0/−31
- hackage-security/hackage-security/src/Text/JSON/Canonical.hs +1/−9
- hackage-security/precompute-fileinfo/precompute-fileinfo.cabal +3/−4
- hackport.cabal +31/−18
- src/Data/Trie.hs +0/−17
- src/Hackport/Command/MakeEbuild.hs +5/−0
- src/Hackport/Completion.hs +18/−19
- src/Hackport/Util.hs +5/−0
- src/Merge.hs +57/−0
- src/Merge/Dependencies.hs +119/−106
- src/Portage/Dependency/Types.hs +4/−0
- src/Portage/GHCCore.hs +314/−261
- src/Portage/Tables.hs +0/−37
- src/Portage/Use.hs +1/−1
- tests/spec/Merge/UtilsSpec.hs +4/−0
- tests/spec/Portage/GHCCoreSpec.hs +1/−1
.github/workflows/haskell.yml view
@@ -17,11 +17,10 @@ matrix: os: [ubuntu-latest] ghc-version:- [ "8.8"- , "8.10"- , "9.0"+ [ "9.0" , "9.2" , "9.4"+ , "9.6" ] steps:@@ -30,7 +29,7 @@ submodules: 'recursive' - name: Set up GHC ${{ matrix.ghc-version }}- uses: haskell/actions/setup@v2+ uses: haskell-actions/setup@v2 id: setup with: ghc-version: ${{ matrix.ghc-version }}@@ -74,3 +73,9 @@ - name: Run tests run: cabal test all --test-option=--color --test-show-details=streaming --jobs=1++ - name: Check cabal file+ run: cabal check++ - name: Build documentation+ run: cabal haddock all
.gitmodules view
@@ -4,4 +4,4 @@ branch = 3.8 [submodule "hackage-security"] path = hackage-security- url = https://github.com/gentoo-haskell/hackage-security.git+ url = https://github.com/haskell/hackage-security.git
CHANGELOG.md view
@@ -1,3 +1,30 @@+## v0.8.5.0 (2023-02-05)++Release v0.8.5.0++- Add a warning for when a particular component of a package is unbuildable+ for the automatically-chosen GHC version. This is upgraded to a fatal error+ if any of the libraries in the package are unbuildable. (This should help a+ bit to prevent #116 from biting people).++- Add support for USE flags when resolving 'pkgconfig' dependencies in cabal to + portage dependencies.++- Update supported GHC versions when resolving the minimal GHC required for a+ package:+ - Versions 8.10.6 and earlier were removed+ - Added 9.2.7, 9.2.8, 9.4.5, 9.4.6, 9.4.7, 9.4.8, 9.6.3, and 9.6.4++ (Not defaulting to very old GHC versions will help avoid #116 as well).++- Stop adding special slot numbers to `dev-haskell/quickcheck` and + `dev-haskell/hdbd`. The functionality for adding special slot numbers for+ packages was scrapped.++ (See: https://github.com/gentoo-haskell/gentoo-haskell/issues/1502)++- Update bundled `hackage-security` to newer commit.+ ## v0.8.4.0 (2023-06-03) Release v0.8.4.0
cabal/Cabal-syntax/Cabal-syntax.cabal view
@@ -1,6 +1,7 @@ cabal-version: 1.22 name: Cabal-syntax version: 3.8.1.0+x-revision: 2 copyright: 2003-2022, Cabal Development Team (see AUTHORS file) license: BSD3 license-file: LICENSE@@ -29,21 +30,21 @@ build-depends: array >= 0.4.0.1 && < 0.6,- base >= 4.6 && < 5,+ base >= 4.9 && < 5, binary >= 0.7 && < 0.9, bytestring >= 0.10.0.0 && < 0.12, containers >= 0.5.0.0 && < 0.7, deepseq >= 1.3.0.1 && < 1.5, directory >= 1.2 && < 1.4, filepath >= 1.3.0.1 && < 1.5,- mtl >= 2.1 && < 2.3,+ mtl >= 2.1 && < 2.4, parsec >= 3.1.13.0 && < 3.2, pretty >= 1.1.1 && < 1.2, text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1), time >= 1.4.0.1 && < 1.13, -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity -- See also https://github.com/ekmett/transformers-compat/issues/35- transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6)+ transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7) if os(windows) build-depends: Win32 >= 2.3.0.0 && < 2.14@@ -51,11 +52,9 @@ build-depends: unix >= 2.6.0.0 && < 2.8 ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates-- if impl(ghc >= 8.0)- ghc-options: -Wcompat -Wnoncanonical-monad-instances+ ghc-options: -Wcompat -Wnoncanonical-monad-instances - if impl(ghc >= 8.0) && impl(ghc < 8.8)+ if impl(ghc < 8.8) ghc-options: -Wnoncanonical-monadfail-instances exposed-modules:
cabal/Cabal-tests/Cabal-tests.cabal view
@@ -160,7 +160,7 @@ , clock >=0.8 && <0.9 , optparse-applicative >=0.13.2.0 && <0.17 , stm >=2.4.5.0 && <2.6- , tar >=0.5.0.3 && <0.6+ , tar >=0.5.0.3 && <0.7 , tree-diff >=0.1 && <0.3 ghc-options: -Wall -rtsopts -threaded
cabal/Cabal/Cabal.cabal view
@@ -299,8 +299,8 @@ build-depends: -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity -- See also https://github.com/ekmett/transformers-compat/issues/35- transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6),- mtl >= 2.1 && < 2.3,+ transformers (>= 0.3 && < 0.4) || (>= 0.4.1.0 && < 0.7),+ mtl >= 2.1 && < 2.4, text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1), parsec >= 3.1.13.0 && < 3.2
cabal/cabal-install-solver/src/Distribution/Solver/Modular/Linking.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} @@ -11,6 +12,9 @@ import Distribution.Solver.Compat.Prelude hiding (get,put) import Control.Exception (assert)+#if MIN_VERSION_mtl(2,3,0)+import Control.Monad+#endif import Control.Monad.Reader import Control.Monad.State import Data.Map ((!))
cabal/cabal-install-solver/src/Distribution/Solver/Modular/Validate.hs view
@@ -12,6 +12,9 @@ -- assignment returned by exploration of the tree should be a complete valid -- assignment, i.e., actually constitute a solution. +#if MIN_VERSION_mtl(2,3,0)+import Control.Monad+#endif import Control.Monad.Reader import Data.Either (lefts) import Data.Function (on)
cabal/cabal-install/cabal-install.cabal view
@@ -42,7 +42,9 @@ ghc-options: -Wall -Wcompat -Wnoncanonical-monad-instances -Wincomplete-uni-patterns -Wincomplete-record-updates if impl(ghc < 8.8) ghc-options: -Wnoncanonical-monadfail-instances- if impl(ghc >=8.10)+ if impl(ghc >=9.0)+ -- Warning: even though introduced with GHC 8.10, -Wunused-packages+ -- gives false positives with GHC 8.10. ghc-options: -Wunused-packages common base-dep@@ -100,6 +102,7 @@ Distribution.Client.Compat.Prelude Distribution.Client.Compat.Process Distribution.Client.Compat.Semaphore+ Distribution.Client.Compat.Tar Distribution.Client.Config Distribution.Client.Configure Distribution.Client.Dependency@@ -219,7 +222,7 @@ process >= 1.2.3.0 && < 1.7, random >= 1.2 && < 1.3, stm >= 2.0 && < 2.6,- tar >= 0.5.0.3 && < 0.6,+ tar >= 0.5.0.3 && < 0.7, time >= 1.5.0.1 && < 1.13, zlib >= 0.5.3 && < 0.7, hackage-security >= 0.6.2.0 && < 0.7,
+ cabal/cabal-install/src/Distribution/Client/Compat/Tar.hs view
@@ -0,0 +1,68 @@+{-# LANGUAGE CPP #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++{- FOURMOLU_DISABLE -}+module Distribution.Client.Compat.Tar+ ( extractTarGzFile+#if MIN_VERSION_tar(0,6,0)+ , Tar.Entry+ , Tar.Entries+ , Tar.GenEntries (..)+ , Tar.GenEntryContent (..)+ , Tar.entryContent+#else+ , Tar.Entries (..)+ , Tar.Entry (..)+ , Tar.EntryContent (..)+#endif+ ) where+{- FOURMOLU_ENABLE -}++import Distribution.Client.Compat.Prelude+import Prelude ()++import qualified Codec.Archive.Tar as Tar+import qualified Codec.Archive.Tar.Check as Tar+#if MIN_VERSION_tar(0,6,0)+#else+import qualified Codec.Archive.Tar.Entry as Tar+#endif+import qualified Data.ByteString.Lazy as BS+import qualified Distribution.Client.GZipUtils as GZipUtils++instance (Exception a, Exception b) => Exception (Either a b) where+ toException (Left e) = toException e+ toException (Right e) = toException e++ fromException e =+ case fromException e of+ Just e' -> Just (Left e')+ Nothing -> case fromException e of+ Just e' -> Just (Right e')+ Nothing -> Nothing++{- FOURMOLU_DISABLE -}+extractTarGzFile+ :: FilePath+ -- ^ Destination directory+ -> FilePath+ -- ^ Expected subdir (to check for tarbombs)+ -> FilePath+ -- ^ Tarball+ -> IO ()+extractTarGzFile dir expected tar =+#if MIN_VERSION_tar(0,6,0)+ Tar.unpackAndCheck+ ( \x ->+ SomeException <$> Tar.checkEntryTarbomb expected x+ <|> SomeException <$> Tar.checkEntrySecurity x+ )+ dir+#else+ Tar.unpack dir+ . Tar.checkTarbomb expected+#endif+ . Tar.read+ . GZipUtils.maybeDecompress+ =<< BS.readFile tar+{- FOURMOLU_ENABLE -}
cabal/cabal-install/src/Distribution/Client/ProjectPlanning.hs view
@@ -170,6 +170,9 @@ import qualified Text.PrettyPrint as Disp import qualified Data.Map as Map import qualified Data.Set as Set+#if MIN_VERSION_mtl(2,3,0)+import Control.Monad+#endif import Control.Monad.State as State import Control.Exception (assert) import Data.List (groupBy, deleteBy)
cabal/cabal-install/src/Distribution/Client/Tar.hs view
@@ -14,10 +14,11 @@ -- Reading, writing and manipulating \"@.tar@\" archive files. -- ------------------------------------------------------------------------------module Distribution.Client.Tar (- -- * @tar.gz@ operations++module Distribution.Client.Tar+ ( -- * @tar.gz@ operations createTarGzFile,- extractTarGzFile,+ TarComp.extractTarGzFile, -- * Other local utils buildTreeRefTypeCode,@@ -31,12 +32,11 @@ import Distribution.Client.Compat.Prelude import Prelude () -import qualified Data.ByteString.Lazy as BS-import qualified Codec.Archive.Tar as Tar+import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar-import qualified Codec.Archive.Tar.Check as Tar-import qualified Codec.Compression.GZip as GZip-import qualified Distribution.Client.GZipUtils as GZipUtils+import qualified Codec.Compression.GZip as GZip+import qualified Data.ByteString.Lazy as BS+import qualified Distribution.Client.Compat.Tar as TarComp -- for foldEntries... import Control.Exception (throw)@@ -51,26 +51,6 @@ -> IO () createTarGzFile tar base dir = BS.writeFile tar . GZip.compress . Tar.write =<< Tar.pack base [dir]--extractTarGzFile :: FilePath -- ^ Destination directory- -> FilePath -- ^ Expected subdir (to check for tarbombs)- -> FilePath -- ^ Tarball- -> IO ()-extractTarGzFile dir expected tar =- Tar.unpack dir . Tar.checkTarbomb expected . Tar.read- . GZipUtils.maybeDecompress =<< BS.readFile tar--instance (Exception a, Exception b) => Exception (Either a b) where- toException (Left e) = toException e- toException (Right e) = toException e-- fromException e =- case fromException e of- Just e' -> Just (Left e')- Nothing -> case fromException e of- Just e' -> Just (Right e')- Nothing -> Nothing- -- | Type code for the local build tree reference entry type. We don't use the -- symbolic link entry type because it allows only 100 ASCII characters for the
cabal/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs view
@@ -2,17 +2,17 @@ tests ) where -import Distribution.Client.Tar ( filterEntries- , filterEntriesM- )-import Codec.Archive.Tar ( Entries(..)- , foldEntries- )-import Codec.Archive.Tar.Entry ( EntryContent(..)- , simpleEntry- , Entry(..)- , toTarPath- )+import Codec.Archive.Tar+ ( foldEntries+ )+import Codec.Archive.Tar.Entry+ ( simpleEntry+ , toTarPath+ )+import Distribution.Client.Tar+ ( filterEntries+ , filterEntriesM+ ) import Test.Tasty import Test.Tasty.HUnit@@ -20,6 +20,8 @@ import qualified Data.ByteString.Lazy as BS import qualified Data.ByteString.Lazy.Char8 as BS.Char8 import Control.Monad.Writer.Lazy (runWriterT, tell)++import Distribution.Client.Compat.Tar tests :: [TestTree] tests = [ testCase "filterEntries" filterTest
hackage-security/.github/workflows/haskell-ci.yml view
@@ -6,16 +6,20 @@ # # haskell-ci regenerate #-# For more information, see https://github.com/haskell-CI/haskell-ci+# For more information, see https://github.com/andreasabel/haskell-ci #-# version: 0.15.20220812+# version: 0.17.20240106 #-# REGENDATA ("0.15.20220812",["github","cabal.project"])+# REGENDATA ("0.17.20240106",["github","cabal.project"]) # name: Haskell-CI on:- - push- - pull_request+ push:+ branches:+ - master+ pull_request:+ branches:+ - master jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }}@@ -23,21 +27,31 @@ timeout-minutes: 60 container:- image: buildpack-deps:bionic+ image: buildpack-deps:focal continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include:- - compiler: ghc-9.4.1+ - compiler: ghc-9.8.1 compilerKind: ghc- compilerVersion: 9.4.1+ compilerVersion: 9.8.1 setup-method: ghcup allow-failure: false- - compiler: ghc-9.2.4+ - compiler: ghc-9.6.3 compilerKind: ghc- compilerVersion: 9.2.4+ compilerVersion: 9.6.3 setup-method: ghcup allow-failure: false+ - compiler: ghc-9.4.8+ compilerKind: ghc+ compilerVersion: 9.4.8+ setup-method: ghcup+ allow-failure: false+ - compiler: ghc-9.2.8+ compilerKind: ghc+ compilerVersion: 9.2.8+ setup-method: ghcup+ allow-failure: false - compiler: ghc-9.0.2 compilerKind: ghc compilerVersion: 9.0.2@@ -51,70 +65,39 @@ - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4- setup-method: hvr-ppa+ setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5- setup-method: hvr-ppa+ setup-method: ghcup allow-failure: false - compiler: ghc-8.4.4 compilerKind: ghc compilerVersion: 8.4.4- setup-method: hvr-ppa+ setup-method: ghcup allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2- setup-method: hvr-ppa+ setup-method: ghcup allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2- setup-method: hvr-ppa- allow-failure: false- - compiler: ghc-7.10.3- compilerKind: ghc- compilerVersion: 7.10.3- setup-method: hvr-ppa- allow-failure: false- - compiler: ghc-7.8.4- compilerKind: ghc- compilerVersion: 7.8.4- setup-method: hvr-ppa- allow-failure: false- - compiler: ghc-7.6.3- compilerKind: ghc- compilerVersion: 7.6.3- setup-method: hvr-ppa- allow-failure: false- - compiler: ghc-7.4.2- compilerKind: ghc- compilerVersion: 7.4.2- setup-method: hvr-ppa+ setup-method: ghcup allow-failure: false fail-fast: false steps: - name: apt run: | apt-get update- apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5- if [ "${{ matrix.setup-method }}" = ghcup ]; then- mkdir -p "$HOME/.ghcup/bin"- curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"- chmod a+x "$HOME/.ghcup/bin/ghcup"- "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;- "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)- "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)- else- apt-add-repository -y 'ppa:hvr/ghc'- apt-get update- apt-get install -y "$HCNAME"- mkdir -p "$HOME/.ghcup/bin"- curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"- chmod a+x "$HOME/.ghcup/bin/ghcup"- "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)- fi+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev+ mkdir -p "$HOME/.ghcup/bin"+ curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"+ chmod a+x "$HOME/.ghcup/bin/ghcup"+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)+ "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }}@@ -126,25 +109,18 @@ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER- if [ "${{ matrix.setup-method }}" = ghcup ]; then- HC=$HOME/.ghcup/bin/$HCKIND-$HCVER- echo "HC=$HC" >> "$GITHUB_ENV"- echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"- echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"- echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"- else- HC=$HCDIR/bin/$HCKIND- echo "HC=$HC" >> "$GITHUB_ENV"- echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"- echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"- echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"- fi-+ HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')+ echo "HC=$HC" >> "$GITHUB_ENV"+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"- if [ $((HCNUMVER > 90401)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi+ echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" echo "GHCJSARITH=0" >> "$GITHUB_ENV" env:@@ -173,19 +149,7 @@ repository hackage.haskell.org url: http://hackage.haskell.org/ EOF- if $HEADHACKAGE; then cat >> $CABAL_CONFIG <<EOF- repository head.hackage.ghc.haskell.org- url: https://ghc.gitlab.haskell.org/head.hackage/- secure: True- root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d- 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329- f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89- key-threshold: 3- active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override- EOF- fi- cat >> $CABAL_CONFIG <<EOF program-default-options ghc-options: $GHCJOBS +RTS -M3G -RTS EOF@@ -201,14 +165,14 @@ - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin- curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz- echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -+ curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz+ echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout- uses: actions/checkout@v2+ uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist@@ -271,10 +235,9 @@ if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package hackage-security-HTTP" >> cabal.project ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <<EOF+ constraints: base-compat >= 0.12.2+ allow-newer: containers EOF- if $HEADHACKAGE; then- echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project- fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(example-client|hackage-repo-tool|hackage-root-tool|hackage-security|hackage-security-HTTP|hackage-security-curl|hackage-security-http-client)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local@@ -282,8 +245,8 @@ run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan- - name: cache- uses: actions/cache@v2+ - name: restore cache+ uses: actions/cache/restore@v3 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store@@ -319,7 +282,7 @@ ${CABAL} -vnormal check - name: haddock run: |- $CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all+ if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi - name: unconstrained build run: | rm -f cabal.project.local@@ -327,7 +290,22 @@ - name: prepare for constraint sets run: | rm -f cabal.project.local+ - name: constraint set containers-0.7+ run: |+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all --dry-run ; fi+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then cabal-plan topo | sort ; fi+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' --dependencies-only -j2 all ; fi+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all ; fi+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all ; fi - name: constraint set no-lukko run: |+ if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' all --dry-run ; fi+ if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-plan topo | sort ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' --dependencies-only -j2 all ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' all ; fi+ - name: save cache+ uses: actions/cache/save@v3+ if: always()+ with:+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}+ path: ~/.cabal/store
hackage-security/.github/workflows/haskell.yml view
@@ -1,6 +1,12 @@ name: MacOS, Ubuntu, Windows -on: [push, pull_request]+on:+ push:+ branches:+ - master+ pull_request:+ branches:+ - master jobs: build:@@ -9,32 +15,33 @@ strategy: fail-fast: false matrix:- ghc: ['9.4.1', '9.2.4', '9.0.2', '8.10.7']+ ghc: ['9.8.1', '9.6.3', '9.4.7'] os: [ubuntu-latest, macOS-latest, windows-latest] steps:- - uses: actions/checkout@v2- - uses: haskell/actions/setup@v1+ - uses: actions/checkout@v3++ - uses: haskell-actions/setup@v2+ id: setup with:- ghc-version: ${{ matrix.ghc }}- cabal-version: '3.8.1.0'+ ghc-version: ${{ matrix.ghc }}+ # cabal-version: '3.8.1.0'+ cabal-update: true - name: Cache- uses: actions/cache@v1+ uses: actions/cache@v3 env:- cache-name: cache-cabal+ cache-name: haskell.yml with:- path: ~/.cabal- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}- restore-keys: |- ${{ runner.os }}-build-${{ env.cache-name }}-- ${{ runner.os }}-build-- ${{ runner.os }}-+ path: ${{ steps.setup.outputs.cabal-store }}+ key: ${{ runner.os }}-${{ env.cache-name }}-ghc-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project') }}+ restore-keys: ${{ runner.os }}-${{ env.cache-name }}-ghc-${{ matrix.ghc }}- - name: Install dependencies run: |- cabal update cabal build --only-dependencies --enable-tests --enable-benchmarks -vnormal+nowrap all+ - name: Build run: cabal build --enable-tests --enable-benchmarks -j1 -vnormal+nowrap all+ - name: Run tests run: cabal test -j1 -vnormal+nowrap all
hackage-security/cabal.haskell-ci view
@@ -1,5 +1,27 @@-ghc-head: True+branches: master +-- Andreas, 2023-07-01: We use some haddock features that are new in 8.6.+haddock: >= 8.6++-- -- Andreas, 2023-02-20: see https://github.com/haskell/hackage-security/pull/291+-- -- unconstrained build with head.hackage produces failing build plans+-- unconstrained: < 9.6+--+-- Andreas, 2023-07-01+-- Ryan GI Scott suggests this instead:+-- see https://github.com/haskell-CI/haskell-ci/issues/643#issuecomment-1466195957+raw-project+ constraints:+ base-compat >= 0.12.2+ constraint-set no-lukko ghc: >=8.2 constraints: hackage-security -lukko++constraint-set containers-0.7+ ghc: >= 8.2 && < 9.8+ constraints: containers >= 0.7+ tests: True+ run-tests: True+raw-project+ allow-newer: containers
hackage-security/example-client/example-client.cabal view
@@ -12,9 +12,17 @@ cabal-version: >=1.10 tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 flag use-network-uri description: Are we using network-uri?@@ -27,14 +35,14 @@ executable example-client main-is: Main.hs- other-modules: Prelude ExampleClient.Options+ other-modules: ExampleClient.Options - build-depends: base >= 4.5 && < 4.18,+ build-depends: base >= 4.9 && < 4.20, bytestring >= 0.9,- directory >= 1.1,+ directory >= 1.2, filepath >= 1.2, optparse-applicative >= 0.11,- time >= 1.2,+ time >= 1.5, hackage-security >= 0.5, hackage-security-HTTP, hackage-security-curl,@@ -57,7 +65,7 @@ build-depends: network >= 2.5 && < 2.6 if flag(Cabal-syntax)- build-depends: Cabal-syntax >= 3.7 && < 3.9+ build-depends: Cabal-syntax >= 3.7 && < 3.12 else build-depends: Cabal >= 1.12 && < 3.7, Cabal-syntax < 3.7
− hackage-security/example-client/src/Prelude.hs
@@ -1,27 +0,0 @@--- | Smooth over differences between various ghc versions by making older--- preludes look like 4.8.0-{-# LANGUAGE PackageImports #-}-{-# LANGUAGE CPP #-}-module Prelude (- module P-#if !MIN_VERSION_base(4,8,0)- , Applicative(..)- , Monoid(..)- , (<$>)- , (<$)- , traverse-#endif- ) where--#if MIN_VERSION_base(4,8,0)-import "base" Prelude as P-#else-#if MIN_VERSION_base(4,6,0)-import "base" Prelude as P-#else-import "base" Prelude as P hiding (catch)-#endif-import Control.Applicative-import Data.Monoid-import Data.Traversable (traverse)-#endif
hackage-security/hackage-repo-tool/ChangeLog.md view
@@ -1,3 +1,7 @@+Unreleased+----------+* Drop support for GHC 7.+ 0.1.1.3 ------- * Compat release for `Cabal-syntax-3.8.1.0`
hackage-security/hackage-repo-tool/hackage-repo-tool.cabal view
@@ -1,6 +1,7 @@ cabal-version: 1.12 name: hackage-repo-tool version: 0.1.1.3+x-revision: 5 build-type: Simple synopsis: Manage secure file-based package repositories@@ -23,9 +24,17 @@ bug-reports: https://github.com/haskell/hackage-security/issues tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 extra-source-files: ChangeLog.md README.md@@ -38,10 +47,6 @@ description: Are we using @network-uri@? manual: False -flag use-old-time- description: Are we using @old-time@?- manual: False- flag Cabal-syntax description: Are we using Cabal-syntax? manual: False@@ -55,29 +60,22 @@ Hackage.Security.RepoTool.Layout.Keys Hackage.Security.RepoTool.Paths Hackage.Security.RepoTool.Util.IO- Prelude -- For boot libraries we try to accomodate the versions bundled with -- the respective GHC release- build-depends: base >= 4.5 && < 4.18,- bytestring >= 0.9 && < 0.12,- directory >= 1.1 && < 1.4,+ build-depends: base >= 4.9 && < 4.20,+ bytestring >= 0.9 && < 0.13,+ directory >= 1.2 && < 1.4, filepath >= 1.3 && < 1.5,- time >= 1.4 && < 1.13+ time >= 1.5 && < 1.13 if !os(windows)- build-depends: unix >= 2.5 && < 2.8-- if flag(use-old-time)- build-depends: directory < 1.2- , old-time == 1.1.*- else- build-depends: directory >= 1.2+ build-depends: unix >= 2.5 && < 2.9 -- For non-boot libraries we try to support single major versions -- to reduce the risk of semantic differences build-depends: microlens >= 0.4.11.2 && < 0.5, optparse-applicative >= 0.15.1 && < 0.18,- tar >= 0.5 && < 0.6,+ tar >= 0.5 && < 0.7, zlib >= 0.6 && < 0.7, hackage-security >= 0.6 && < 0.7 @@ -90,7 +88,7 @@ build-depends: network >= 2.5 && < 2.6 if flag(Cabal-syntax)- build-depends: Cabal-syntax >= 3.7 && < 3.10+ build-depends: Cabal-syntax >= 3.7 && < 3.12 else build-depends: Cabal >= 1.14 && < 1.26 || >= 2.0 && < 2.6
hackage-security/hackage-repo-tool/src/Hackage/Security/RepoTool/Util/IO.hs view
@@ -34,11 +34,7 @@ import qualified System.Posix.Files as Posix #endif -#if MIN_VERSION_directory(1,2,0) import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)-#else-import System.Time (ClockTime (TOD))-#endif -- | Get the modification time of the specified file --@@ -50,13 +46,8 @@ -- from POSIX seconds, so there shouldn't be loss of precision. -- NB: Apparently, this has low clock resolution on GHC < 7.8. -- I don't think we care.-#if MIN_VERSION_directory(1,2,0) fromInteger . floor . utcTimeToPOSIXSeconds <$> Directory.getModificationTime (toFilePath fp)-#else- Directory.getModificationTime (toFilePath fp) >>= \(TOD s _) ->- return (fromInteger s)-#endif where fp :: Path Absolute fp = anchorTargetPath' opts repoLoc targetPath@@ -123,11 +114,6 @@ deriving (Typeable) instance Exception TarGzError where-#if MIN_VERSION_base(4,8,0) displayException (TarGzError path e) = path ++ ": " ++ displayException e deriving instance Show TarGzError-#else-instance Show TarGzError where- show (TarGzError path e) = path ++ ": " ++ show e-#endif
hackage-security/hackage-repo-tool/src/Main.hs view
@@ -77,11 +77,6 @@ putStrLn $ displayException e exitFailure -#if !MIN_VERSION_base(4,8,0)-displayException :: Exception e => e -> String-displayException = show-#endif- {------------------------------------------------------------------------------- Creating keys -------------------------------------------------------------------------------}
− hackage-security/hackage-repo-tool/src/Prelude.hs
@@ -1,27 +0,0 @@--- | Smooth over differences between various ghc versions by making older--- preludes look like 4.8.0-{-# LANGUAGE PackageImports #-}-{-# LANGUAGE CPP #-}-module Prelude (- module P-#if !MIN_VERSION_base(4,8,0)- , Applicative(..)- , Monoid(..)- , (<$>)- , (<$)- , traverse-#endif- ) where--#if MIN_VERSION_base(4,8,0)-import "base" Prelude as P-#else-#if MIN_VERSION_base(4,6,0)-import "base" Prelude as P-#else-import "base" Prelude as P hiding (catch)-#endif-import Control.Applicative-import Data.Monoid-import Data.Traversable (traverse)-#endif
hackage-security/hackage-root-tool/Main.hs view
@@ -49,11 +49,6 @@ putStrLn $ displayException e exitFailure -#if !MIN_VERSION_base(4,8,0)-displayException :: Exception e => e -> String-displayException = show-#endif- {------------------------------------------------------------------------------- Creating keys -------------------------------------------------------------------------------}
hackage-security/hackage-root-tool/hackage-root-tool.cabal view
@@ -16,9 +16,17 @@ cabal-version: >=1.10 tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 extra-source-files: ChangeLog.md@@ -30,7 +38,7 @@ executable hackage-root-tool main-is: Main.hs- build-depends: base >= 4.4 && < 5,+ build-depends: base >= 4.9 && < 5, filepath >= 1.2 && < 1.5, optparse-applicative >= 0.11 && < 0.18, hackage-security >= 0.5 && < 0.7
hackage-security/hackage-security-HTTP/ChangeLog.md view
@@ -1,3 +1,8 @@+Unreleased+----------+* Drop support for GHC 7.++ 0.1.1.1 ------- * Add support for hackage-security-0.6
hackage-security/hackage-security-HTTP/hackage-security-HTTP.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: hackage-security-HTTP version: 0.1.1.1-x-revision: 2+x-revision: 7 synopsis: Hackage security bindings against the HTTP library description: The hackage security library provides a 'HttpLib' abstraction to allow to bind against different HTTP@@ -18,9 +18,17 @@ build-type: Simple tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 extra-source-files: ChangeLog.md@@ -35,8 +43,8 @@ library exposed-modules: Hackage.Security.Client.Repository.HttpLib.HTTP- build-depends: base >= 4.5 && < 4.18,- bytestring >= 0.9 && < 0.12,+ build-depends: base >= 4.9 && < 4.20,+ bytestring >= 0.9 && < 0.13, HTTP >= 4000.2.19 && < 4000.5, mtl >= 2.1 && < 2.4, zlib >= 0.5 && < 0.7,
hackage-security/hackage-security-HTTP/src/Hackage/Security/Client/Repository/HttpLib/HTTP.hs view
@@ -133,17 +133,10 @@ instance Pretty InvalidProxy where pretty (InvalidProxy p) = "Invalid proxy " ++ show p -#if MIN_VERSION_base(4,8,0) deriving instance Show UnexpectedResponse deriving instance Show InvalidProxy instance Exception UnexpectedResponse where displayException = pretty instance Exception InvalidProxy where displayException = pretty-#else-instance Show UnexpectedResponse where show = pretty-instance Show InvalidProxy where show = pretty-instance Exception UnexpectedResponse-instance Exception InvalidProxy-#endif {------------------------------------------------------------------------------- Additional operations
hackage-security/hackage-security-curl/hackage-security-curl.cabal view
@@ -16,9 +16,17 @@ cabal-version: >=1.10 tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 flag use-network-uri description: Are we using network-uri?@@ -26,7 +34,7 @@ library exposed-modules: Hackage.Security.Client.Repository.HttpLib.Curl- build-depends: base >= 4.5 && < 4.18,+ build-depends: base >= 4.9 && < 4.20, bytestring >= 0.9, process >= 1.1, hackage-security
hackage-security/hackage-security-http-client/ChangeLog.md view
@@ -1,3 +1,7 @@+Unreleased+----------+* Drop support for GHC 7.+ 0.1.1 ----- * Implement updated HttpLib API from hackage-security 0.5
hackage-security/hackage-security-http-client/hackage-security-http-client.cabal view
@@ -15,9 +15,17 @@ cabal-version: >=1.10 tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 flag use-network-uri description: Are we using network-uri?@@ -25,7 +33,7 @@ library exposed-modules: Hackage.Security.Client.Repository.HttpLib.HttpClient- build-depends: base >= 4.5 && < 4.18,+ build-depends: base >= 4.9 && < 4.20, bytestring >= 0.9, http-client >= 0.4 && < 0.8, http-types >= 0.8,
hackage-security/hackage-security/ChangeLog.md view
@@ -1,5 +1,19 @@ See also http://pvp.haskell.org/faq +Unreleased+----------++* Drop support for GHC 7.+* Drop flag `use-old-time` and support for `old-time`, require `time ≥ 1.5`.++0.6.2.4+-------++* Allow `tar-0.6`+* Drop support for GHC < 7.8 in favor of `PatternSynonyms`+* Drop flags `base48`, `mtl21`, `old-directory` and support for GHC 7.8, `mtl < 2.2` and `directory < 1.2`+* Tested with GHC 7.10 - 9.8+ 0.6.2.3 -------
hackage-security/hackage-security/hackage-security.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: hackage-security-version: 0.6.2.3+version: 0.6.2.4 synopsis: Hackage security library description: The hackage security library provides both server and@@ -31,9 +31,17 @@ build-type: Simple tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 extra-source-files: ChangeLog.md@@ -42,10 +50,6 @@ type: git location: https://github.com/haskell/hackage-security.git -flag base48- description: Are we using @base@ 4.8 or later?- manual: False- flag use-network-uri description: Are we using @network-uri@? manual: False@@ -55,16 +59,6 @@ manual: False default: False -flag old-directory- description: Use @directory@ < 1.2 and @old-time@- manual: False- default: False--flag mtl21- description: Use @mtl@ < 2.2 and @mtl-compat@- manual: False- default: False- flag lukko description: Use @lukko@ for file-locking, otherwise use @GHC.IO.Handle.Lock@ manual: True@@ -115,46 +109,36 @@ Hackage.Security.Util.Lens Hackage.Security.Util.Stack Hackage.Security.Util.TypedEmbedded- MyPrelude- -- We support ghc 7.4 (bundled with Cabal 1.14) and up- build-depends: base >= 4.5 && < 4.18,++ build-depends: base >= 4.9 && < 4.20, base16-bytestring >= 0.1.1 && < 1.1, base64-bytestring >= 1.0 && < 1.3,- bytestring >= 0.9 && < 0.12,- containers >= 0.4 && < 0.7,+ bytestring >= 0.9 && < 0.13,+ containers >= 0.4 && < 0.8,+ cryptohash-sha256 >= 0.11 && < 0.12,+ directory >= 1.2.2 && < 1.4, ed25519 >= 0.0 && < 0.1, filepath >= 1.2 && < 1.5,+ mtl >= 2.2 && < 2.4, parsec >= 3.1 && < 3.2, pretty >= 1.0 && < 1.2,- cryptohash-sha256 >= 0.11 && < 0.12, -- 0.4.2 introduces TarIndex, 0.4.4 introduces more -- functionality, 0.5.0 changes type of serialise- tar >= 0.5 && < 0.6,- template-haskell >= 2.7 && < 2.20,- time >= 1.2 && < 1.13,+ tar >= 0.5 && < 0.7,+ template-haskell >= 2.7 && < 2.22,+ time >= 1.5 && < 1.13, transformers >= 0.3 && < 0.7, zlib >= 0.5 && < 0.7, -- whatever versions are bundled with ghc: ghc-prim- if flag(old-directory)- build-depends: directory >= 1.1.0.2 && < 1.2,- old-time >= 1 && < 1.2- else- build-depends: directory >= 1.2 && < 1.4 - if flag(mtl21)- build-depends: mtl >= 2.1 && < 2.2,- mtl-compat >= 0.2 && < 0.3- else- build-depends: mtl >= 2.2 && < 2.4- if flag(lukko) build-depends: lukko >= 0.1 && < 0.2 else build-depends: base >= 4.10 if flag(Cabal-syntax) && impl(ghc >= 8.2)- build-depends: Cabal-syntax >= 3.7 && < 3.10+ build-depends: Cabal-syntax >= 3.7 && < 3.12 else build-depends: Cabal >= 1.14 && < 1.26 || >= 2.0 && < 2.6@@ -175,6 +159,7 @@ NamedFieldPuns NoImplicitPrelude NoMonomorphismRestriction+ PatternSynonyms RankNTypes RecordWildCards ScopedTypeVariables@@ -183,25 +168,19 @@ TypeFamilies TypeOperators ViewPatterns- other-extensions: BangPatterns+ other-extensions:+ AllowAmbiguousTypes+ BangPatterns CPP+ DeriveLift OverlappingInstances PackageImports+ RoleAnnotations+ StaticPointers UndecidableInstances - -- use the new stage1/cross-compile-friendly DeriveLift extension for GHC 8.0+- if impl(ghc >= 8.0)- other-extensions: DeriveLift- else- other-extensions: TemplateHaskell- ghc-options: -Wall - if flag(base48)- build-depends: base >= 4.8- else- build-depends: base < 4.8, old-locale == 1.0.*- -- The URI type got split out off the network package after version 2.5, and -- moved to a separate network-uri package. Since we don't need the rest of -- network here, it would suffice to rely only on network-uri:@@ -241,13 +220,6 @@ else build-depends: network >= 2.5 && < 2.6 - if impl(ghc >= 7.8)- other-extensions: RoleAnnotations-- if impl(ghc >= 7.10)- other-extensions: AllowAmbiguousTypes- StaticPointers- test-suite TestSuite type: exitcode-stdio-1.0 main-is: TestSuite.hs@@ -271,8 +243,8 @@ zlib if flag(Cabal-syntax) && impl(ghc >= 8.2)- build-depends: Cabal >= 3.7 && < 3.10,- Cabal-syntax >= 3.7 && < 3.10+ build-depends: Cabal >= 3.7 && < 3.12,+ Cabal-syntax >= 3.7 && < 3.12 else build-depends: Cabal >= 1.14 && < 1.26 || >= 2.0 && < 2.6@@ -280,11 +252,11 @@ Cabal-syntax < 3.7 -- dependencies exclusive to test-suite- build-depends: tasty >= 1.2 && < 1.5,+ build-depends: tasty >= 1.2 && < 1.6, tasty-hunit == 0.10.*, tasty-quickcheck == 0.10.*, QuickCheck >= 2.11 && <2.15,- aeson == 1.4.* || == 1.5.* || == 2.0.* || == 2.1.*,+ aeson >= 1.4 && < 1.6 || >= 2.0 && < 2.3, vector >= 0.12 && <0.14, unordered-containers >=0.2.8.0 && <0.3, temporary >= 1.2 && < 1.4
hackage-security/hackage-security/src/Hackage/Security/Client.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE StaticPointers #-}-#endif+ -- | Main entry point into the Hackage Security framework for clients module Hackage.Security.Client ( -- * Checking for updates@@ -41,7 +40,7 @@ , LocalFileCorrupted(..) ) where -import MyPrelude hiding (log)+import Prelude hiding (log) import Control.Arrow (first) import Control.Exception import Control.Monad@@ -333,11 +332,7 @@ -- | Get all cached info (if any) getCachedInfo ::-#if __GLASGOW_HASKELL__ < 800- (Applicative m, MonadIO m)-#else MonadIO m-#endif => Repository down -> m CachedInfo getCachedInfo rep = do (cachedRoot, cachedKeyEnv) <- readLocalRoot rep@@ -360,9 +355,6 @@ return (trustLocalFile signedRoot, rootKeys (signed signedRoot)) readLocalFile :: ( FromJSON ReadJSON_Keys_Layout (Signed a), MonadIO m-#if __GLASGOW_HASKELL__ < 800- , Applicative m-#endif ) => Repository down -> KeyEnv -> CachedFile -> m (Maybe (Trusted a)) readLocalFile rep cachedKeyEnv file = do@@ -952,21 +944,12 @@ } deriving (Typeable) -#if MIN_VERSION_base(4,8,0) deriving instance Show InvalidPackageException deriving instance Show LocalFileCorrupted deriving instance Show InvalidFileInIndex instance Exception InvalidPackageException where displayException = pretty instance Exception LocalFileCorrupted where displayException = pretty instance Exception InvalidFileInIndex where displayException = pretty-#else-instance Show InvalidPackageException where show = pretty-instance Show LocalFileCorrupted where show = pretty-instance Show InvalidFileInIndex where show = pretty-instance Exception InvalidPackageException-instance Exception LocalFileCorrupted-instance Exception InvalidFileInIndex-#endif instance Pretty InvalidPackageException where pretty (InvalidPackageException pkgId) = "Invalid package " ++ display pkgId
hackage-security/hackage-security/src/Hackage/Security/Client/Formats.hs view
@@ -17,7 +17,7 @@ , formatsLookup ) where -import MyPrelude+import Prelude import Hackage.Security.Util.Stack import Hackage.Security.Util.TypedEmbedded
hackage-security/hackage-security/src/Hackage/Security/Client/Repository.hs view
@@ -30,7 +30,7 @@ , mustCache ) where -import MyPrelude+import Prelude import Control.Exception import Data.Typeable (Typeable) import qualified Codec.Archive.Tar.Index as Tar@@ -385,13 +385,8 @@ SomeRemoteError :: Exception e => e -> SomeRemoteError deriving (Typeable) -#if MIN_VERSION_base(4,8,0) deriving instance Show SomeRemoteError instance Exception SomeRemoteError where displayException = pretty-#else-instance Exception SomeRemoteError-instance Show SomeRemoteError where show = pretty-#endif instance Pretty SomeRemoteError where pretty (SomeRemoteError ex) = displayException ex
hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Cache.hs view
@@ -15,12 +15,12 @@ , lockCacheWithLogger ) where -import MyPrelude+import Prelude import Control.Exception import Control.Monad import Control.Monad.IO.Class import Data.Maybe-import Codec.Archive.Tar (Entries(..))+import Codec.Archive.Tar (Entries, pattern Done, pattern Fail, pattern Next) import Codec.Archive.Tar.Index (TarIndex, IndexBuilder, TarEntryOffset) import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Index as TarIndex
hackage-security/hackage-security/src/Hackage/Security/Client/Repository/HttpLib.hs view
@@ -11,7 +11,7 @@ , bodyReaderFromBS ) where -import MyPrelude+import Prelude import Data.IORef import Network.URI hiding (uriPath, path) import qualified Data.ByteString as BS
hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Local.hs view
@@ -5,7 +5,7 @@ , withRepository ) where -import MyPrelude+import Prelude import Hackage.Security.Client.Formats import Hackage.Security.Client.Repository import Hackage.Security.Client.Repository.Cache
hackage-security/hackage-security/src/Hackage/Security/Client/Repository/Remote.hs view
@@ -27,7 +27,7 @@ , fileSizeWithinBounds ) where -import MyPrelude+import Prelude import Control.Concurrent import Control.Exception import Control.Monad (when, unless)@@ -498,13 +498,8 @@ expected (FileSizeExact n) = "exactly " ++ show n expected (FileSizeBound n) = "at most " ++ show n -#if MIN_VERSION_base(4,8,0) deriving instance Show FileTooLarge instance Exception FileTooLarge where displayException = pretty-#else-instance Exception FileTooLarge-instance Show FileTooLarge where show = pretty-#endif {------------------------------------------------------------------------------- Information about remote files@@ -687,4 +682,3 @@ BS.L.take (fromIntegral deltaSeek) existing , temp ]-
hackage-security/hackage-security/src/Hackage/Security/Client/Verify.hs view
@@ -10,7 +10,7 @@ , liftIO ) where -import MyPrelude+import Prelude import Control.Exception import Control.Monad (join, void) import Control.Monad.IO.Class (MonadIO, liftIO)
hackage-security/hackage-security/src/Hackage/Security/JSON.hs view
@@ -38,7 +38,7 @@ , module Hackage.Security.Util.JSON ) where -import MyPrelude+import Prelude import Control.Arrow (first, second) import Control.Exception import Control.Monad (unless, liftM)@@ -84,13 +84,8 @@ | DeserializationErrorFileType String String deriving (Typeable) -#if MIN_VERSION_base(4,8,0) deriving instance Show DeserializationError instance Exception DeserializationError where displayException = pretty-#else-instance Show DeserializationError where show = pretty-instance Exception DeserializationError-#endif instance Pretty DeserializationError where pretty (DeserializationErrorMalformed str) =
hackage-security/hackage-security/src/Hackage/Security/Key.hs view
@@ -25,7 +25,7 @@ , verify ) where -import MyPrelude+import Prelude import Control.Monad import Data.Functor.Identity import Data.Typeable (Typeable)@@ -37,10 +37,6 @@ import qualified Data.ByteString.Base16 as Base16 import qualified Data.ByteString.Lazy as BS.L -#if !MIN_VERSION_base(4,7,0)-import qualified Data.Typeable as Typeable-#endif- import Hackage.Security.Util.JSON import Hackage.Security.Util.Some import Hackage.Security.Util.TypedEmbedded@@ -277,26 +273,3 @@ case tag of "ed25519" -> return . Some $ KeyTypeEd25519 _otherwise -> expected "valid key type" (Just tag)--{-------------------------------------------------------------------------------- Orphans-- Pre-7.8 (base 4.7) we cannot have Typeable instance for higher-kinded types.- Instead, here we provide some instance for specific instantiations.--------------------------------------------------------------------------------}--#if !MIN_VERSION_base(4,7,0)-tyConKey, tyConPublicKey, tyConPrivateKey :: Typeable.TyCon-tyConKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "Key"-tyConPublicKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "PublicKey"-tyConPrivateKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "PrivateKey"--instance Typeable (Some Key) where- typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConKey []]--instance Typeable (Some PublicKey) where- typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConPublicKey []]--instance Typeable (Some PrivateKey) where- typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConPrivateKey []]-#endif
hackage-security/hackage-security/src/Hackage/Security/Key/Env.hs view
@@ -12,7 +12,7 @@ , union ) where -import MyPrelude hiding (lookup, null)+import Prelude hiding (lookup, null) import Control.Monad import Data.Map (Map) import qualified Data.Map as Map
hackage-security/hackage-security/src/Hackage/Security/TUF/Common.hs view
@@ -6,7 +6,7 @@ , KeyThreshold(..) ) where -import MyPrelude+import Prelude import Hackage.Security.JSON {-------------------------------------------------------------------------------
hackage-security/hackage-security/src/Hackage/Security/TUF/FileInfo.hs view
@@ -13,7 +13,7 @@ , Int54 ) where -import MyPrelude hiding (lookup)+import Prelude hiding (lookup) import Data.Map (Map) import qualified Crypto.Hash.SHA256 as SHA256 import qualified Data.Map as Map
hackage-security/hackage-security/src/Hackage/Security/TUF/FileMap.hs view
@@ -18,7 +18,7 @@ , fileMapChanges ) where -import MyPrelude hiding (lookup)+import Prelude hiding (lookup) import Control.Arrow (second) import Data.Map (Map) import qualified Data.Map as Map
hackage-security/hackage-security/src/Hackage/Security/TUF/Header.hs view
@@ -12,7 +12,7 @@ , versionIncrement ) where -import MyPrelude+import Prelude import Data.Time import Data.Typeable (Typeable)
hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Cache.hs view
@@ -4,7 +4,7 @@ , cabalCacheLayout ) where -import MyPrelude+import Prelude import Hackage.Security.TUF.Paths import Hackage.Security.Util.Path
hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Index.hs view
@@ -9,7 +9,7 @@ , indexLayoutPkgPrefs ) where -import MyPrelude+import Prelude import Distribution.Package import Distribution.Text
hackage-security/hackage-security/src/Hackage/Security/TUF/Layout/Repo.hs view
@@ -5,7 +5,7 @@ , cabalLocalRepoLayout ) where -import MyPrelude+import Prelude import Distribution.Package import Distribution.Text
hackage-security/hackage-security/src/Hackage/Security/TUF/Mirrors.hs view
@@ -9,7 +9,7 @@ , describeMirror ) where -import MyPrelude+import Prelude import Control.Monad.Except import Network.URI
hackage-security/hackage-security/src/Hackage/Security/TUF/Paths.hs view
@@ -14,7 +14,7 @@ , anchorCachePath ) where -import MyPrelude+import Prelude import Hackage.Security.Util.Path import Hackage.Security.Util.Pretty
hackage-security/hackage-security/src/Hackage/Security/TUF/Patterns.hs view
@@ -3,12 +3,9 @@ -- NOTE: This module was developed to prepare for proper delegation (#39). -- It is currently unused. {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 800 {-# LANGUAGE DeriveLift #-} {-# LANGUAGE StandaloneDeriving #-}-#else-{-# LANGUAGE TemplateHaskell #-}-#endif+ module Hackage.Security.TUF.Patterns ( -- * Patterns and replacements FileName@@ -26,7 +23,7 @@ , qqd ) where -import MyPrelude+import Prelude import Control.Monad (guard) import Language.Haskell.TH (Q, Exp) import System.FilePath.Posix@@ -274,28 +271,9 @@ Left err -> fail $ "Invalid delegation: " ++ err Right del -> TH.lift del -#if __GLASGOW_HASKELL__ >= 800 deriving instance TH.Lift (Pattern a) deriving instance TH.Lift (Replacement a) deriving instance TH.Lift Delegation-#else-instance TH.Lift (Pattern a) where- lift (PatFileConst fn) = [| PatFileConst fn |]- lift (PatFileExt e) = [| PatFileExt e |]- lift PatFileAny = [| PatFileAny |]- lift (PatDirConst d p) = [| PatDirConst d p |]- lift (PatDirAny p) = [| PatDirAny p |]--instance TH.Lift (Replacement a) where- lift (RepFileConst fn) = [| RepFileConst fn |]- lift (RepFileExt e ) = [| RepFileExt e |]- lift RepFileAny = [| RepFileAny |]- lift (RepDirConst d r) = [| RepDirConst d r |]- lift (RepDirAny r) = [| RepDirAny r |]--instance TH.Lift Delegation where- lift (Delegation pat repl) = [| Delegation pat repl |]-#endif {------------------------------------------------------------------------------- JSON
hackage-security/hackage-security/src/Hackage/Security/TUF/Root.hs view
@@ -6,7 +6,7 @@ , RoleSpec(..) ) where -import MyPrelude+import Prelude import Hackage.Security.JSON import Hackage.Security.Key import Hackage.Security.Key.Env (KeyEnv)
hackage-security/hackage-security/src/Hackage/Security/TUF/Signed.hs view
@@ -27,7 +27,7 @@ , toPreSignatures ) where -import MyPrelude+import Prelude import Control.Monad import Data.Functor.Identity import qualified Data.ByteString as BS
hackage-security/hackage-security/src/Hackage/Security/TUF/Snapshot.hs view
@@ -3,7 +3,7 @@ Snapshot(..) ) where -import MyPrelude+import Prelude import Control.Monad.Except import Control.Monad.Reader
hackage-security/hackage-security/src/Hackage/Security/TUF/Targets.hs view
@@ -8,7 +8,7 @@ , targetsLookup ) where -import MyPrelude+import Prelude import Hackage.Security.JSON import Hackage.Security.Key import Hackage.Security.Key.Env (KeyEnv)
hackage-security/hackage-security/src/Hackage/Security/TUF/Timestamp.hs view
@@ -3,7 +3,7 @@ Timestamp(..) ) where -import MyPrelude+import Prelude import Control.Monad.Except import Control.Monad.Reader
hackage-security/hackage-security/src/Hackage/Security/Trusted.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE StaticPointers #-}-#endif+ module Hackage.Security.Trusted ( module Hackage.Security.Trusted.TCB -- * Derived functions@@ -12,7 +11,7 @@ , trustedFileInfoEqual ) where -import MyPrelude+import Prelude import Data.Function (on) import Data.Time import Hackage.Security.TUF
hackage-security/hackage-security/src/Hackage/Security/Trusted/TCB.hs view
@@ -16,17 +16,11 @@ , signaturesVerified , verifyRole' , verifyFingerprints-#if __GLASGOW_HASKELL__ >= 710 -- * Re-exports , StaticPtr-#else- -- * Fake static pointers- , StaticPtr- , static-#endif ) where -import MyPrelude+import Prelude import Control.Exception import Control.Monad (when, unless) import Control.Monad.Except (Except, runExcept, throwError)@@ -38,18 +32,8 @@ import Hackage.Security.Util.Pretty import qualified Hackage.Security.Util.Lens as Lens -#if __GLASGOW_HASKELL__ >= 710 import GHC.StaticPtr-#else--- Fake static pointers for ghc < 7.10. This means Trusted offers no--- additional type safety, but that's okay: we can still verify the code--- with ghc 7.10 and get the additional checks.-newtype StaticPtr a = StaticPtr { deRefStaticPtr :: a } -static :: a -> StaticPtr a-static = StaticPtr-#endif- -- | Trusted values -- -- Trusted values originate in only two ways:@@ -167,7 +151,10 @@ -- | Errors thrown during role validation data VerificationError = -- | Not enough signatures signed with the appropriate keys- VerificationErrorSignatures TargetPath+ VerificationErrorSignatures TargetPath -- what were we verifying?+ Integer -- threshold+ [KeyId] -- trusted keys+ [KeyId] -- found signing keys -- | The file is expired | VerificationErrorExpired TargetPath@@ -206,21 +193,21 @@ type VerificationHistory = [Either RootUpdated VerificationError] -#if MIN_VERSION_base(4,8,0) deriving instance Show VerificationError deriving instance Show RootUpdated instance Exception VerificationError where displayException = pretty instance Exception RootUpdated where displayException = pretty-#else-instance Exception VerificationError-instance Show VerificationError where show = pretty-instance Show RootUpdated where show = pretty-instance Exception RootUpdated-#endif +indentedLines :: [String] -> String+indentedLines = unlines . map (" " ++)+ instance Pretty VerificationError where- pretty (VerificationErrorSignatures file) =- pretty file ++ " does not have enough signatures signed with the appropriate keys"+ pretty (VerificationErrorSignatures file threshold trusted sigs) =+ pretty file ++ " does not have enough signatures signed with the appropriate keys\n"+ ++ "Expected at least " ++ show threshold ++ " signatures from:\n"+ ++ indentedLines (map keyIdString trusted)+ ++ "Found signatures from:\n"+ ++ indentedLines (map keyIdString sigs) pretty (VerificationErrorExpired file) = pretty file ++ " is expired" pretty (VerificationErrorVersion file) =@@ -235,7 +222,7 @@ "Could not deserialize " ++ pretty file ++ ": " ++ pretty err pretty (VerificationErrorLoop es) = "Verification loop. Errors in order:\n"- ++ unlines (map ((" " ++) . either pretty pretty) es)+ ++ indentedLines (map (either pretty pretty) es) instance Pretty RootUpdated where pretty RootUpdated = "Root information updated"@@ -291,8 +278,9 @@ -- was invalid we would already have thrown an error constructing Signed. -- (Similarly, if two signatures were made by the same key, the FromJSON -- instance for Signatures would have thrown an error.)- unless (length (filter isRoleSpecKey sigs) >= fromIntegral threshold) $- throwError $ VerificationErrorSignatures targetPath+ let nSigs = length (filter isRoleSpecKey sigs)+ unless (nSigs >= fromIntegral threshold) $+ throwError $ VerificationErrorSignatures targetPath (fromIntegral threshold) trustedKeys signingKeys -- Everything is A-OK! return $ SignaturesVerified signed@@ -300,6 +288,10 @@ isRoleSpecKey :: Signature -> Bool isRoleSpecKey Signature{..} = signatureKey `elem` roleSpecKeys + trustedKeys, signingKeys :: [KeyId]+ trustedKeys = map someKeyId roleSpecKeys+ signingKeys = map (someKeyId . signatureKey) sigs+ -- | Variation on 'verifyRole' that uses key IDs rather than keys -- -- This is used during the bootstrap process.@@ -314,9 +306,12 @@ (KeyThreshold threshold) targetPath Signed{signatures = Signatures sigs, ..} =- if length (filter isTrustedKey sigs) >= fromIntegral threshold+ if length (filter isTrustedKey signingKeys) >= fromIntegral threshold then Right $ SignaturesVerified signed- else Left $ VerificationErrorSignatures targetPath+ else Left $ VerificationErrorSignatures targetPath (fromIntegral threshold) fingerprints signingKeys where- isTrustedKey :: Signature -> Bool- isTrustedKey Signature{..} = someKeyId signatureKey `elem` fingerprints+ signingKeys :: [KeyId]+ signingKeys = map (someKeyId . signatureKey) sigs++ isTrustedKey :: KeyId -> Bool+ isTrustedKey key = key `elem` fingerprints
hackage-security/hackage-security/src/Hackage/Security/Util/Base64.hs view
@@ -4,7 +4,7 @@ , toByteString ) where -import MyPrelude+import Prelude import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as C8 -- only called on B64-enc strings import qualified Data.ByteString.Base64 as B64
hackage-security/hackage-security/src/Hackage/Security/Util/Checked.hs view
@@ -1,15 +1,10 @@ {-# LANGUAGE CPP #-}-{-# OPTIONS_GHC -fno-warn-unused-binds #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -Wno-redundant-constraints #-}-#endif--#if __GLASGOW_HASKELL__ >= 708-{-# LANGUAGE RoleAnnotations #-}+{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE IncoherentInstances #-}-#endif+{-# LANGUAGE RoleAnnotations #-} -{-# LANGUAGE DeriveDataTypeable#-}+{-# OPTIONS_GHC -Wno-unused-binds #-}+{-# OPTIONS_GHC -Wno-redundant-constraints #-} -- | Checked exceptions module Hackage.Security.Util.Checked (@@ -25,16 +20,12 @@ , internalError ) where -import MyPrelude+import Prelude import Control.Exception (Exception, IOException) import qualified Control.Exception as Base import Data.Typeable (Typeable) -#if __GLASGOW_HASKELL__ >= 708 import GHC.Prim (coerce)-#else-import Unsafe.Coerce (unsafeCoerce)-#endif {------------------------------------------------------------------------------- Basic infrastructure@@ -43,9 +34,7 @@ -- | Checked exceptions class Throws e where -#if __GLASGOW_HASKELL__ >= 708 type role Throws representational-#endif unthrow :: forall a e proxy . proxy e -> (Throws e => a) -> a unthrow _ x = unWrap (coerceWrap (Wrap x :: Wrap e a))@@ -56,22 +45,10 @@ -- | Determine if an exception is asynchronous, based on its type. isAsync :: Exception e => e -> Bool-#if MIN_VERSION_base(4, 7, 0) isAsync e = case Base.fromException $ Base.toException e of Just Base.SomeAsyncException{} -> True Nothing -> False-#else--- Earlier versions of GHC had no SomeAsyncException. We have to--- instead make up a list of async exceptions.-isAsync e =- let se = Base.toException e- in case () of- ()- | Just (_ :: Base.AsyncException) <- Base.fromException se -> True- | show e == "<<timeout>>" -> True- | otherwise -> False-#endif -- | 'Base.catch', but immediately rethrows asynchronous exceptions -- (as determined by 'isAsync').@@ -131,11 +108,7 @@ newtype Wrap e a = Wrap { unWrap :: Throws e => a } coerceWrap :: Wrap e a -> Wrap (Catch e) a-#if __GLASGOW_HASKELL__ >= 708 coerceWrap = coerce-#else-coerceWrap = unsafeCoerce-#endif data Proxy a = Proxy
hackage-security/hackage-security/src/Hackage/Security/Util/Exit.hs view
@@ -1,6 +1,6 @@ module Hackage.Security.Util.Exit where -import MyPrelude+import Prelude import Control.Monad (liftM) import Control.Monad.Except (ExceptT, runExceptT, throwError)
hackage-security/hackage-security/src/Hackage/Security/Util/IO.hs view
@@ -9,7 +9,7 @@ , timedIO ) where -import MyPrelude+import Prelude import Control.Concurrent (threadDelay) import Control.Exception import Data.Time
hackage-security/hackage-security/src/Hackage/Security/Util/JSON.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ < 710-{-# LANGUAGE OverlappingInstances #-}-#endif+ -- | module Hackage.Security.Util.JSON ( -- * Type classes@@ -23,7 +21,7 @@ , Int54 ) where -import MyPrelude+import Prelude import Control.Monad (liftM) import Data.Maybe (catMaybes) import Data.Map (Map)@@ -32,10 +30,6 @@ import Network.URI import qualified Data.Map as Map -#if !MIN_VERSION_time(1,5,0)-import System.Locale (defaultTimeLocale)-#endif- import Hackage.Security.Util.Path {-------------------------------------------------------------------------------@@ -120,16 +114,12 @@ fromJSON val = expected' "int" val instance-#if __GLASGOW_HASKELL__ >= 710 {-# OVERLAPPABLE #-}-#endif (Monad m, ToJSON m a) => ToJSON m [a] where toJSON = liftM JSArray . mapM toJSON instance-#if __GLASGOW_HASKELL__ >= 710 {-# OVERLAPPABLE #-}-#endif (ReportSchemaErrors m, FromJSON m a) => FromJSON m [a] where fromJSON (JSArray as) = mapM fromJSON as fromJSON val = expected' "array" val@@ -143,10 +133,6 @@ case parseTimeM False defaultTimeLocale "%FT%TZ" str of Just time -> return time Nothing -> expected "valid date-time string" (Just str)-#if !MIN_VERSION_time(1,5,0)- where- parseTimeM _trim = parseTime-#endif instance ( Monad m , ToObjectKey m k
hackage-security/hackage-security/src/Hackage/Security/Util/Lens.hs view
@@ -14,7 +14,7 @@ , set ) where -import MyPrelude+import Prelude import Control.Applicative import Data.Functor.Identity
hackage-security/hackage-security/src/Hackage/Security/Util/Path.hs view
@@ -83,16 +83,12 @@ , IO.hSeek ) where -import MyPrelude+import Prelude import Control.Monad import Data.List (isPrefixOf) import System.IO (IOMode(..), BufferMode(..), Handle, SeekMode(..)) import System.IO.Unsafe (unsafeInterleaveIO)-#if MIN_VERSION_directory(1,2,0) import Data.Time (UTCTime)-#else-import System.Time (ClockTime)-#endif import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BS.L import qualified System.FilePath as FP.Native@@ -239,21 +235,7 @@ toAbsoluteFilePath :: Path root -> IO FilePath instance FsRoot Relative where- toAbsoluteFilePath p = go (unPathNative p)- where- go :: FilePath -> IO FilePath-#if MIN_VERSION_directory(1,2,2)- go = Dir.makeAbsolute-#else- -- copied implementation from the directory package- go = (FP.Native.normalise <$>) . absolutize- absolutize path -- avoid the call to `getCurrentDirectory` if we can- | FP.Native.isRelative path- = (FP.Native.</> path)- . FP.Native.addTrailingPathSeparator <$>- Dir.getCurrentDirectory- | otherwise = return path-#endif+ toAbsoluteFilePath p = Dir.makeAbsolute (unPathNative p) instance FsRoot Absolute where toAbsoluteFilePath = return . unPathNative@@ -371,11 +353,7 @@ filePath <- toAbsoluteFilePath path Dir.doesDirectoryExist filePath -#if MIN_VERSION_directory(1,2,0) getModificationTime :: FsRoot root => Path root -> IO UTCTime-#else-getModificationTime :: FsRoot root => Path root -> IO ClockTime-#endif getModificationTime path = do filePath <- toAbsoluteFilePath path Dir.getModificationTime filePath
hackage-security/hackage-security/src/Hackage/Security/Util/Pretty.hs view
@@ -3,7 +3,7 @@ Pretty(..) ) where -import MyPrelude+import Prelude -- | Produce a human-readable string class Pretty a where
hackage-security/hackage-security/src/Hackage/Security/Util/Some.hs view
@@ -13,30 +13,17 @@ , SomePretty(..) -- ** Type checking , typecheckSome-#if !MIN_VERSION_base(4,7,0)- -- ** Compatibility with base < 4.7- , tyConSome-#endif ) where -import MyPrelude-#if MIN_VERSION_base(4,7,0)+import Prelude import Data.Typeable (Typeable)-#else-import qualified Data.Typeable as Typeable-#endif import Hackage.Security.Util.TypedEmbedded import Hackage.Security.Util.Pretty data Some f = forall a. Some (f a) -#if MIN_VERSION_base(4,7,0) deriving instance Typeable Some-#else-tyConSome :: Typeable.TyCon-tyConSome = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Util.Some" "Some"-#endif {------------------------------------------------------------------------------- Equality on Some types
hackage-security/hackage-security/src/Hackage/Security/Util/Stack.hs view
@@ -3,7 +3,7 @@ (:-)(..) ) where -import MyPrelude+import Prelude data h :- t = h :- t deriving (Eq, Show)
hackage-security/hackage-security/src/Hackage/Security/Util/TypedEmbedded.hs view
@@ -7,7 +7,7 @@ , AsType(..) ) where -import MyPrelude+import Prelude -- | Type equality proofs --
− hackage-security/hackage-security/src/MyPrelude.hs
@@ -1,31 +0,0 @@--- | Smooth over differences between various ghc versions by making older--- preludes look like 4.8.0-{-# LANGUAGE CPP #-}-module MyPrelude (- module P-#if !MIN_VERSION_base(4,8,0)- , Applicative(..)- , Monoid(..)- , (<$>)- , (<$)- , Traversable(traverse)- , displayException-#endif- ) where--#if MIN_VERSION_base(4,8,0)-import Prelude as P-#else-#if MIN_VERSION_base(4,6,0)-import Prelude as P-#else-import Prelude as P hiding (catch)-#endif-import Control.Applicative-import Control.Exception (Exception)-import Data.Monoid-import Data.Traversable (Traversable(traverse))--displayException :: Exception e => e -> String-displayException = show-#endif
hackage-security/hackage-security/src/Text/JSON/Canonical.hs view
@@ -30,21 +30,16 @@ , prettyCanonicalJSON ) where -import MyPrelude+import Prelude import Text.ParserCombinators.Parsec ( CharParser, (<|>), (<?>), many, between, sepBy , satisfy, char, string, digit, spaces , parse ) import Text.PrettyPrint hiding (char) import qualified Text.PrettyPrint as Doc-#if !(MIN_VERSION_base(4,7,0))-import Control.Applicative ((<$>), (<$), pure, (<*>), (<*), (*>))-#endif import Control.Arrow (first) import Data.Bits (Bits)-#if MIN_VERSION_base(4,7,0) import Data.Bits (FiniteBits)-#endif import Data.Char (isDigit, digitToInt) import Data.Data (Data) import Data.Function (on)@@ -83,9 +78,7 @@ , Ord , Real , Ix-#if MIN_VERSION_base(4,7,0) , FiniteBits-#endif , Bits , Storable , PrintfArg@@ -353,4 +346,3 @@ go [] = [] go [y] = [p <+> y, r] go (y:ys) = (p <+> y) : go ys-
hackage-security/precompute-fileinfo/precompute-fileinfo.cabal view
@@ -15,13 +15,12 @@ cabal-version: >=1.10 tested-with:- GHC==9.4.1, GHC==9.2.4, GHC==9.0.2,- GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,- GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+ GHC==9.6.3, GHC==9.4.5, GHC==9.2.8, GHC==9.0.2,+ GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2 executable precompute-fileinfo main-is: Main.hs- build-depends: base >= 4.4,+ build-depends: base >= 4.9, bytestring >= 0.9, containers >= 0.4, deepseq >= 1.3,
hackport.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: hackport-version: 0.8.4.0+version: 0.8.5.0 license: GPL-3.0-or-later license-file: LICENSE author: Henning Günther, Duncan Coutts, Lennart Kolmodin@@ -14,11 +14,10 @@ that are generated from a hackage repo of Cabal packages. tested-with:- , GHC == 8.8.4- , GHC == 8.10.7 , GHC == 9.0.2- , GHC == 9.2.7- , GHC == 9.4.5+ , GHC == 9.2.8+ , GHC == 9.4.8+ , GHC == 9.6.4 source-repository head type: git@@ -29,6 +28,11 @@ manual: True default: False +flag doctests+ description: Build doctests+ default: True+ manual: True+ flag gentoo-tests description: Build tests that require a running Gentoo system manual: True@@ -44,6 +48,11 @@ default: False manual: True +flag threads+ description: Enable threading and rtsopts+ default: True+ manual: True+ -- Turn off all warnings (for external libs and doctests-v2) common no-warnings ghc-options: -Wno-default -Wno-incomplete-uni-patterns@@ -71,7 +80,6 @@ hs-source-dirs: cabal/Cabal-syntax/src build-depends: , array >=0.4.0.1- , array >=0.4.0.1 , base >=4.6 && <5 , binary >=0.7 , bytestring >=0.10.0.0@@ -427,13 +435,13 @@ hs-source-dirs: hackage-security/hackage-security/src build-depends: , hackport-external-libs-Cabal-syntax- , base >=4.5+ , base >=4.9 , base16-bytestring >=0.1.1 , base64-bytestring >=1.0 , bytestring >=0.9 , containers >=0.4 , cryptohash-sha256 >=0.11- , directory >=1.2+ , directory >=1.2.2 , ed25519 >=0.0 , filepath >=1.2 , ghc-prim@@ -445,7 +453,7 @@ , pretty >=1.0 , tar >=0.5 , template-haskell >=2.7- , time >=1.2+ , time >=1.5 , transformers >=0.3 , zlib >=0.5 @@ -454,15 +462,15 @@ Hackage.Security.Client.Formats Hackage.Security.Client.Repository Hackage.Security.Client.Repository.Cache- Hackage.Security.Client.Repository.HttpLib Hackage.Security.Client.Repository.Local Hackage.Security.Client.Repository.Remote+ Hackage.Security.Client.Repository.HttpLib Hackage.Security.Client.Verify Hackage.Security.JSON Hackage.Security.Key.Env -- Hackage.Security.Server- Hackage.Security.TUF.FileMap Hackage.Security.Trusted+ Hackage.Security.TUF.FileMap Hackage.Security.Util.Checked Hackage.Security.Util.Path Hackage.Security.Util.Pretty@@ -494,7 +502,6 @@ Hackage.Security.Util.Lens Hackage.Security.Util.Stack Hackage.Security.Util.TypedEmbedded- MyPrelude default-extensions: DefaultSignatures@@ -509,6 +516,7 @@ NamedFieldPuns NoImplicitPrelude NoMonomorphismRestriction+ PatternSynonyms RankNTypes RecordWildCards ScopedTypeVariables@@ -519,10 +527,14 @@ ViewPatterns other-extensions:+ AllowAmbiguousTypes BangPatterns CPP+ DeriveLift OverlappingInstances PackageImports+ RoleAnnotations+ StaticPointers UndecidableInstances library hackport-external-libs-cabal-install-solver@@ -670,6 +682,7 @@ Distribution.Client.Compat.Prelude -- Distribution.Client.Compat.Process Distribution.Client.Compat.Semaphore+ Distribution.Client.Compat.Tar Distribution.Client.Config -- Distribution.Client.Configure Distribution.Client.Dependency@@ -786,12 +799,12 @@ , binary , bytestring , containers+ , data-default-class , deepseq , directory , dlist , extensible-exceptions , filepath- , ghc-compact , lifted-base , monad-control , mtl@@ -856,7 +869,6 @@ Portage.Overlay Portage.PackageId Portage.Resolve- Portage.Tables Portage.Use Portage.Version Status@@ -867,9 +879,10 @@ executable hackport import: warnings- ghc-options: -threaded +RTS -N -RTS -with-rtsopts=-N+ if flag(threads)+ ghc-options: -threaded -rtsopts -with-rtsopts=-N if flag(profile)- ghc-prof-options: -fprof-cafs -fprof-auto -rtsopts+ ghc-prof-options: -prof-cafs -prof-auto -rtsopts main-is: Main.hs default-language: Haskell2010 hs-source-dirs: exe@@ -1021,7 +1034,7 @@ other-modules: Paths_hackport - if !flag(cabal-v1)+ if !flag(doctests) || !flag(cabal-v1) buildable: False test-suite doctests-v2@@ -1038,7 +1051,7 @@ -- cabal-install should already be installed if this is being built... , doctest:doctest >=0.8 - if flag(cabal-v1)+ if !flag(doctests) || flag(cabal-v1) buildable: False test-suite spec
src/Data/Trie.hs view
@@ -7,19 +7,16 @@ , singleton , lookup , toList- , buildCompact ) where import Control.Applicative import Control.Monad-import Control.Monad.IO.Class import Data.Binary import qualified Data.DList as DList import Data.DList (DList) import qualified Data.Foldable as F import qualified Data.Map.Strict as Map import Data.Map.Strict (Map)-import GHC.Compact import GHC.Generics import Prelude hiding (lookup)@@ -67,17 +64,3 @@ where go (k:ks) = Nothing :< Map.singleton k (go ks) go [] = Just x :< Map.empty---- | Build a 'Trie' within a compact region-buildCompact :: (MonadIO m, Ord k)- => (a -> ([k], b))- -> [a]- -> m (Compact (Trie k b))-buildCompact _ [] = liftIO $ compact mempty-buildCompact f (x:xs) = do- ct <- buildCompact f xs- cs <- liftIO $ compactAdd ct (f x)- let (t,(s,b)) = (getCompact ct, getCompact cs)- cq <- liftIO $ compactAdd ct $ t <> singleton s b- pure cq-
src/Hackport/Command/MakeEbuild.hs view
@@ -1,7 +1,12 @@+{-# LANGUAGE CPP #-}+ module Hackport.Command.MakeEbuild ( makeEbuildAction ) where +#if MIN_VERSION_mtl(2,3,0)+import Control.Monad+#endif import qualified Distribution.Simple.PackageDescription as Cabal import Distribution.Parsec (simpleParsec) import qualified Distribution.Verbosity as V
src/Hackport/Completion.hs view
@@ -13,7 +13,6 @@ import Data.Maybe (catMaybes) import qualified Data.Set as Set import Data.Set (Set)-import GHC.Compact import qualified Options.Applicative as Opt import System.Exit (ExitCode(..)) import System.FilePath@@ -89,33 +88,33 @@ -- This is used exclusively for shell completion for the @merge@ -- subcommand. cabalPackageCompleter :: Opt.Completer-cabalPackageCompleter = Opt.mkCompleter $ \s ->- runEnv (go s) () $ GlobalEnv V.silent Nothing Nothing- where- go s = withHackportContext $ \_ repoContext -> do- Just trie <- runMaybeT $ choice- [ -- Check to see if there is an existing cache.- readTrie- -- Otherwise, create a new trie from the Hackage database- , lift $ createTrie repoContext- ]+cabalPackageCompleter = Opt.mkCompleter $ \s -> do+ Just trie <- runMaybeT $ choice+ [ -- Check to see if there is an existing cache.+ readTrie+ -- Otherwise, create a new trie from the Hackage database+ , lift $ runEnv createTrie () $ GlobalEnv V.silent Nothing Nothing+ ] - let endings = map fst $ maybe [] Trie.toList- $ Trie.lookup (getCompact trie) s+ let endings = map fst $ maybe [] Trie.toList+ $ Trie.lookup trie s - pure $ map (s ++) endings+ pure $ map (s ++) endings + where+ -- A (Trie Char ()) is useful for storing/searching a list of strings- createTrie repoContext = do+ createTrie :: Env () (Trie Char ())+ createTrie = withHackportContext $ \_ repoContext -> do pkgs <- allPV repoContext- trie <- Trie.buildCompact (,()) pkgs- writeTrie (getCompact trie)+ let trie = foldMap (\s -> Trie.singleton s ()) pkgs+ writeTrie trie pure trie readTrie :: MonadIO m- => MaybeT m (Compact (Trie Char ()))+ => MaybeT m (Trie Char ()) readTrie = MaybeT $ liftIO $ optional- $ trieFile >>= decodeFile >>= compact+ $ trieFile >>= decodeFile writeTrie :: MonadIO m => Trie Char () -> m () writeTrie t = do
src/Hackport/Util.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ module Hackport.Util ( getPortageDir , withHackportContext@@ -5,6 +7,9 @@ , hackportDir ) where +#if MIN_VERSION_mtl(2,3,0)+import Control.Monad+#endif import Control.Monad.Trans.Control import Data.Maybe (fromJust) import qualified Network.URI as NU
src/Merge.hs view
@@ -16,6 +16,7 @@ import Control.Applicative import Control.Monad+import Control.Monad.Writer import Control.Exception.Lifted import qualified Data.Text as T import qualified Data.Text.IO as T@@ -392,6 +393,12 @@ debug $ "buildDepends pkgDesc0: " ++ show (map prettyShow (Merge.exeAndLibDeps pkgDesc0)) debug $ "buildDepends pkgDesc: " ++ show (map prettyShow (Merge.buildDepends pkgDesc)) + -- <https://github.com/gentoo-haskell/hackport/issues/116>+ warnings <- errorWarnOnUnbuildable+ (prettyShow cat)+ (prettyShow merged_cabal_pkg_name)+ pkgDesc0+ notice $ "Accepted depends: " ++ show (map prettyShow accepted_deps) notice $ "Skipped depends: " ++ show (map prettyShow skipped_deps) notice $ "Dead flags: " ++ show (map pp_fa irresolvable_flag_assignments)@@ -463,6 +470,8 @@ fetchDigestAndCheck (overlayPath </> prettyShow cat </> prettyShow norm_pkgName) $ Portage.fromCabalPackageId cat cabal_pkgId + forM_ warnings $ notice . ("\n" ++)+ -- | Run @ebuild@ and @pkgcheck@ commands in the directory of the -- newly-generated ebuild. --@@ -584,3 +593,51 @@ when metadataNeedsWriting $ do notice $ "Writing " ++ emeta liftIO $ T.writeFile mpath updatedMetaText++-- <https://github.com/gentoo-haskell/hackport/issues/116>+-- TODO: Make it so this is automatically fixed instead of requiring manual+-- intervention+errorWarnOnUnbuildable+ :: String -- Category name+ -> String -- Package name+ -> Cabal.PackageDescription+ -> Env env [String]+errorWarnOnUnbuildable cn pn pkgdesc = execWriterT $ do+ let lib = Cabal.library pkgdesc -- Main library+ subLibs = Cabal.subLibraries pkgdesc -- sub-libraries+ exes = Cabal.executables pkgdesc -- executables+ tests = Cabal.testSuites pkgdesc -- test-suites+ ubLib = findUnbuildable Cabal.libName Cabal.libBuildInfo lib+ ubSubLibs = findUnbuildable Cabal.libName Cabal.libBuildInfo subLibs+ ubExes = findUnbuildable Cabal.exeName Cabal.buildInfo exes+ ubTests = findUnbuildable Cabal.testName Cabal.testBuildInfo tests+ ubErrs = execWriter $ do+ forM_ ubLib $ \_ ->+ tell ["main library"]+ forM_ ubSubLibs $ \l ->+ tell ["sub-library: " ++ Cabal.showLibraryName l]+ ubWarns = execWriter $ do+ forM_ ubExes $ \e ->+ tell ["executable: " ++ Cabal.unUnqualComponentName e]+ forM_ ubTests $ \t ->+ tell ["test-suite: " ++ Cabal.unUnqualComponentName t]++ unless (null ubWarns) $ tell $ pure $ unlines+ $ [ "WARNING: The following components are unbuildable!" ]+ ++ map (" - " ++) ubWarns++ unless (null ubErrs) $ error $ unlines+ $ [ "FATAL: The following library components are unbuildable!" ]+ ++ map (" - " ++) ubErrs+ ++ [ ""+ , "You can edit the .cabal file to make the needed components buildable,"+ , "then merge the package manually:"+ , " $ cabal get " ++ pn+ , " $ cd " ++ pn ++ "*/"+ , " # fix " ++ pn ++ ".cabal"+ , " $ hackport make-ebuild " ++ cn ++ " " ++ pn ++ ".cabal"+ ]++ where+ findUnbuildable toName toBuildable+ = fmap toName . mfilter (not . Cabal.buildable . toBuildable)
src/Merge/Dependencies.hs view
@@ -20,6 +20,7 @@ ) where import Control.DeepSeq (NFData(..))+import Data.Default.Class import Data.Maybe ( isJust, isNothing ) import qualified Data.List as L #if !MIN_VERSION_base(4,11,0)@@ -42,7 +43,6 @@ import qualified Portage.Overlay as Portage import qualified Portage.PackageId as Portage import qualified Portage.Use as Portage-import qualified Portage.Tables as Portage import qualified Cabal2Ebuild as C2E import qualified Portage.GHCCore as GHCCore@@ -155,8 +155,8 @@ ], dep_e = S.singleton "${RDEPEND}", rdep = Portage.DependAllOf- [ Portage.set_build_slot ghc_dep- , Portage.set_build_slot $ add_profile $ raw_haskell_deps+ [ ghc_dep+ , add_profile $ raw_haskell_deps , extra_libs , Portage.DependAllOf pkg_config_libs ]@@ -171,8 +171,8 @@ ], dep_e = S.singleton "${RDEPEND}", rdep = Portage.DependAllOf- [ Portage.set_build_slot ghc_dep- , Portage.set_build_slot $ raw_haskell_deps+ [ ghc_dep+ , raw_haskell_deps , extra_libs , Portage.DependAllOf pkg_config_libs ]@@ -312,7 +312,10 @@ , ("m", any_c_p "virtual" "libc") , ("asound", any_c_p "media-libs" "alsa-lib") , ("sqlite3", at_least_c_p_v "dev-db" "sqlite" [3,0])- , ("stdc++", any_c_p_s_u "sys-devel" "gcc" Portage.AnySlot [Portage.mkUse (Portage.Use "cxx")])+ , ("stdc++", Portage.DependAnyOf+ [ any_c_p_s_u "sys-devel" "gcc" Portage.AnySlot [Portage.mkUse (Portage.Use "cxx")]+ , any_c_p "sys-devel" "clang"+ ]) , ("crack", any_c_p "sys-libs" "cracklib") , ("exif", any_c_p "media-libs" "libexif") , ("IL", any_c_p "media-libs" "devil")@@ -387,6 +390,9 @@ , ("SDL2_mixer", any_c_p "media-libs" "sdl2-mixer") , ("blas", any_c_p "virtual" "blas") , ("lapack", any_c_p "virtual" "lapack")+ , ("libbrotlidec", any_c_p "app-arch" "brotli")+ , ("libbrotlienc", any_c_p "app-arch" "brotli")+ , ("libarchive", at_least_c_p_v "app-arch" "libarchive" [3,5,2]) ] ---------------------------------------------------------------@@ -468,121 +474,128 @@ resolvePkgConfig :: Portage.Overlay -> Cabal.PkgconfigDependency -> Maybe Portage.Dependency resolvePkgConfig _overlay (Cabal.PkgconfigDependency cabal_pn _cabalVersion) = do- (cat,portname, slot) <- lookup (Cabal.unPkgconfigName cabal_pn) pkgconfig_table- return $ any_c_p_s_u cat portname slot []+ (cat, portname, Portage.DAttr slot usedep) <- lookup (Cabal.unPkgconfigName cabal_pn) pkgconfig_table+ return $ any_c_p_s_u cat portname slot usedep -pkgconfig_table :: [(String, (String, String, Portage.SlotDepend))]+pkgconfig_table :: [(String, (String, String, Portage.DAttr))] pkgconfig_table = [- ("alsa", ("media-libs", "alsa-lib", Portage.AnySlot))- ,("atk", ("dev-libs", "atk", Portage.AnySlot))- ,("gconf-2.0", ("gnome-base", "gconf", Portage.AnySlot))+ ("alsa", ("media-libs", "alsa-lib", def))+ ,("atk", ("app-accessibility", "at-spi2-core", Portage.DAttr (Portage.AnySlot) [Portage.mkUse $ Portage.Use "introspection"]))+ ,("gconf-2.0", ("gnome-base", "gconf", def)) - ,("gio-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("gio-unix-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("glib-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("gmodule-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("gmodule-export-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("gmodule-no-export-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))- ,("gobject-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))+ ,("gio-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gio-unix-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("glib-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gmodule-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gmodule-export-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gmodule-no-export-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gobject-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") [])) ,("gobject-introspection-1.0", ("dev-libs", "gobject-introspection",- Portage.AnySlot))- ,("gthread-2.0", ("dev-libs", "glib", Portage.GivenSlot "2"))+ def))+ ,("gthread-2.0", ("dev-libs", "glib", Portage.DAttr (Portage.GivenSlot "2") [])) - ,("gtk+-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gdk-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gdk-3.0", ("x11-libs", "gtk+", Portage.GivenSlot "3"))- ,("gdk-pixbuf-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gdk-pixbuf-xlib-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gdk-x11-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gtk+-unix-print-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))- ,("gtk+-x11-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))+ ,("gtk+-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gdk-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gdk-3.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "3") []))+ ,("gdk-pixbuf-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gdk-pixbuf-xlib-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gdk-x11-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gtk+-unix-print-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gtk+-x11-2.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "2") [])) - ,("gtk+-3.0", ("x11-libs", "gtk+", Portage.GivenSlot "3"))- ,("webkitgtk-3.0", ("net-libs", "webkit-gtk", Portage.GivenSlot "3"))+ ,("gtk+-3.0", ("x11-libs", "gtk+", Portage.DAttr (Portage.GivenSlot "3") []))+ ,("webkitgtk-3.0", ("net-libs", "webkit-gtk", Portage.DAttr (Portage.GivenSlot "3") [])) - ,("cairo", ("x11-libs", "cairo", Portage.AnySlot)) -- need [svg] for dev-haskell/cairo- ,("cairo-gobject", ("x11-libs", "cairo", Portage.AnySlot)) -- need [glib] for dev-haskell/cairo- ,("cairo-ft", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-ps", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-png", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-pdf", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-svg", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-xlib", ("x11-libs", "cairo", Portage.AnySlot))- ,("cairo-xlib-xrender", ("x11-libs", "cairo", Portage.AnySlot))+ ,("gtk4", ("gui-libs", "gtk", Portage.DAttr (Portage.GivenSlot "4") [Portage.mkUse $ Portage.Use "introspection"]))+ ,("gtk4-x11", ("gui-libs", "gtk", Portage.DAttr (Portage.GivenSlot "4") [Portage.mkUse $ Portage.Use "introspection", Portage.mkUse $ Portage.Use "X"])) - ,("javascriptcoregtk-4.0", ("net-libs", "webkit-gtk", Portage.GivenSlot "4"))- ,("webkit2gtk-4.0", ("net-libs", "webkit-gtk", Portage.GivenSlot "4"))+ ,("cairo", ("x11-libs", "cairo", def))+ ,("cairo-gobject", ("x11-libs", "cairo", Portage.DAttr (Portage.AnySlot) [Portage.mkUse $ Portage.Use "glib"])) -- need [glib] for dev-haskell/cairo+ ,("cairo-ft", ("x11-libs", "cairo", def))+ ,("cairo-ps", ("x11-libs", "cairo", def))+ ,("cairo-png", ("x11-libs", "cairo", def))+ ,("cairo-pdf", ("x11-libs", "cairo", def))+ ,("cairo-svg", ("x11-libs", "cairo", def))+ ,("cairo-xlib", ("x11-libs", "cairo", def))+ ,("cairo-xlib-xrender", ("x11-libs", "cairo", def)) - ,("pangocairo", ("x11-libs", "pango", Portage.AnySlot))- ,("pangoft2", ("x11-libs", "pango", Portage.AnySlot))- ,("pango", ("x11-libs", "pango", Portage.AnySlot))- ,("pangoxft", ("x11-libs", "pango", Portage.AnySlot))- ,("pangox", ("x11-libs", "pango", Portage.AnySlot))+ ,("javascriptcoregtk-4.0", ("net-libs", "webkit-gtk", Portage.DAttr (Portage.GivenSlot "4") []))+ ,("webkit2gtk-4.0", ("net-libs", "webkit-gtk", Portage.DAttr (Portage.GivenSlot "4") [])) - ,("libglade-2.0", ("gnome-base", "libglade", Portage.AnySlot))- ,("libsoup-2.4", ("net-libs", "libsoup", Portage.GivenSlot "2.4"))- ,("gnome-vfs-2.0", ("gnome-base", "gnome-vfs", Portage.AnySlot))- ,("gnome-vfs-module-2.0", ("gnome-base", "gnome-vfs", Portage.AnySlot))- ,("webkit-1.0", ("net-libs","webkit-gtk", Portage.GivenSlot "2"))- ,("gtksourceview-3.0", ("x11-libs", "gtksourceview", Portage.GivenSlot "3.0"))+ ,("pangocairo", ("x11-libs", "pango", def))+ ,("pangoft2", ("x11-libs", "pango", def))+ ,("pango", ("x11-libs", "pango", Portage.DAttr (Portage.AnySlot) [Portage.mkUse $ Portage.Use "introspection"]))+ ,("pangoxft", ("x11-libs", "pango", def))+ ,("pangox", ("x11-libs", "pango", def)) - ,("gstreamer-0.10", ("media-libs", "gstreamer", Portage.AnySlot))- ,("gstreamer-base-0.10", ("media-libs", "gstreamer", Portage.AnySlot))- ,("gstreamer-check-0.10", ("media-libs", "gstreamer", Portage.AnySlot))- ,("gstreamer-controller-0.10", ("media-libs", "gstreamer", Portage.AnySlot))- ,("gstreamer-dataprotocol-0.10", ("media-libs", "gstreamer", Portage.AnySlot))- ,("gstreamer-net-0.10", ("media-libs", "gstreamer", Portage.AnySlot))+ ,("libglade-2.0", ("gnome-base", "libglade", def))+ ,("libsoup-2.4", ("net-libs", "libsoup", Portage.DAttr (Portage.GivenSlot "2.4") []))+ ,("gnome-vfs-2.0", ("gnome-base", "gnome-vfs", def))+ ,("gnome-vfs-module-2.0", ("gnome-base", "gnome-vfs", def))+ ,("webkit-1.0", ("net-libs","webkit-gtk", Portage.DAttr (Portage.GivenSlot "2") []))+ ,("gtksourceview-3.0", ("x11-libs", "gtksourceview", Portage.DAttr (Portage.GivenSlot "3.0") [])) - ,("gstreamer-app-0.10", ("media-libs", "gst-plugins-base", Portage.AnySlot))- ,("gstreamer-audio-0.10", ("media-libs", "gst-plugins-base", Portage.AnySlot))- ,("gstreamer-video-0.10", ("media-libs", "gst-plugins-base", Portage.AnySlot))- ,("gstreamer-plugins-base-0.10", ("media-libs", "gst-plugins-base", Portage.AnySlot))+ ,("gstreamer-0.10", ("media-libs", "gstreamer", def))+ ,("gstreamer-base-0.10", ("media-libs", "gstreamer", def))+ ,("gstreamer-check-0.10", ("media-libs", "gstreamer", def))+ ,("gstreamer-controller-0.10", ("media-libs", "gstreamer", def))+ ,("gstreamer-dataprotocol-0.10", ("media-libs", "gstreamer", def))+ ,("gstreamer-net-0.10", ("media-libs", "gstreamer", def)) - ,("gtksourceview-2.0", ("x11-libs", "gtksourceview", Portage.GivenSlot "2.0"))- ,("librsvg-2.0", ("gnome-base","librsvg", Portage.AnySlot))- ,("vte", ("x11-libs","vte", Portage.GivenSlot "0"))- ,("gtkglext-1.0", ("x11-libs","gtkglext", Portage.AnySlot))+ ,("gstreamer-app-0.10", ("media-libs", "gst-plugins-base", def))+ ,("gstreamer-audio-0.10", ("media-libs", "gst-plugins-base", def))+ ,("gstreamer-video-0.10", ("media-libs", "gst-plugins-base", def))+ ,("gstreamer-plugins-base-0.10", ("media-libs", "gst-plugins-base", def)) - ,("curl", ("net-misc", "curl", Portage.AnySlot))- ,("libxml2", ("dev-libs", "libxml2", Portage.AnySlot))- ,("libgsasl", ("virtual", "gsasl", Portage.AnySlot))- ,("libzip", ("dev-libs", "libzip", Portage.AnySlot))- ,("gnutls", ("net-libs", "gnutls", Portage.AnySlot))- ,("libidn", ("net-dns", "libidn", Portage.AnySlot))- ,("libxml-2.0", ("dev-libs", "libxml2", Portage.AnySlot))- ,("yaml-0.1", ("dev-libs", "libyaml", Portage.AnySlot))- ,("QtCore", ("dev-qt", "qtcore", Portage.AnySlot))- ,("lua", ("dev-lang", "lua", Portage.AnySlot))- ,("QtDeclarative", ("dev-qt", "qtdeclarative", Portage.AnySlot))- ,("QtGui", ("dev-qt", "qtgui", Portage.AnySlot))- ,("QtOpenGL", ("dev-qt", "qtopengl", Portage.AnySlot))- ,("QtScript", ("dev-qt", "qtscript", Portage.AnySlot))- ,("ImageMagick", ("media-gfx", "imagemagick", Portage.AnySlot))- ,("MagickWand", ("media-gfx", "imagemagick", Portage.AnySlot))- ,("ncurses", ("sys-libs", "ncurses", Portage.AnySlot))- ,("ncursesw", ("sys-libs", "ncurses", Portage.AnySlot))- ,("panel", ("sys-libs", "ncurses", Portage.AnySlot))- ,("panelw", ("sys-libs", "ncurses", Portage.AnySlot))- ,("libssh2", ("net-libs", "libssh2", Portage.AnySlot))- ,("SDL_image", ("media-libs", "sdl-image", Portage.AnySlot))- ,("libzmq", ("net-libs", "zeromq", Portage.AnySlot))- ,("taglib_c", ("media-libs", "taglib", Portage.AnySlot))- ,("libcurl", ("net-misc", "curl", Portage.AnySlot))- ,("libpq", ("dev-db", "postgresql", Portage.AnySlot))- ,("poppler-glib", ("app-text", "poppler", Portage.AnySlot))- ,("gsl", ("sci-libs", "gsl", Portage.AnySlot))- ,("libvirt", ("app-emulation", "libvirt", Portage.AnySlot))+ ,("gtksourceview-2.0", ("x11-libs", "gtksourceview", Portage.DAttr (Portage.GivenSlot "2.0") []))+ ,("librsvg-2.0", ("gnome-base","librsvg", def))+ ,("vte", ("x11-libs","vte", Portage.DAttr (Portage.GivenSlot "0") []))+ ,("gtkglext-1.0", ("x11-libs","gtkglext", def)) - ,("Qt5Core", ("dev-qt", "qtcore", Portage.GivenSlot "5"))- ,("Qt5Gui", ("dev-qt", "qtgui", Portage.GivenSlot "5"))- ,("Qt5Qml", ("dev-qt", "qtdeclarative", Portage.GivenSlot "5"))- ,("Qt5Quick", ("dev-qt", "qtdeclarative", Portage.GivenSlot "5"))- ,("Qt5Widgets", ("dev-qt", "qtwidgets", Portage.GivenSlot "5"))+ ,("curl", ("net-misc", "curl", def))+ ,("libxml2", ("dev-libs", "libxml2", def))+ ,("libgsasl", ("net-misc", "gsasl", def))+ ,("libzip", ("dev-libs", "libzip", def))+ ,("gnutls", ("net-libs", "gnutls", def))+ ,("libidn", ("net-dns", "libidn", def))+ ,("libxml-2.0", ("dev-libs", "libxml2", def))+ ,("yaml-0.1", ("dev-libs", "libyaml", def))+ ,("QtCore", ("dev-qt", "qtcore", def))+ ,("lua", ("dev-lang", "lua", def))+ ,("QtDeclarative", ("dev-qt", "qtdeclarative", def))+ ,("QtGui", ("dev-qt", "qtgui", def))+ ,("QtOpenGL", ("dev-qt", "qtopengl", def))+ ,("QtScript", ("dev-qt", "qtscript", def))+ ,("ImageMagick", ("media-gfx", "imagemagick", def))+ ,("MagickWand", ("media-gfx", "imagemagick", def))+ ,("ncurses", ("sys-libs", "ncurses", def))+ ,("ncursesw", ("sys-libs", "ncurses", def))+ ,("panel", ("sys-libs", "ncurses", def))+ ,("panelw", ("sys-libs", "ncurses", def))+ ,("libssh2", ("net-libs", "libssh2", def))+ ,("SDL_image", ("media-libs", "sdl-image", def))+ ,("libzmq", ("net-libs", "zeromq", def))+ ,("taglib_c", ("media-libs", "taglib", def))+ ,("libcurl", ("net-misc", "curl", def))+ ,("libpq", ("dev-db", "postgresql", def))+ ,("poppler-glib", ("app-text", "poppler", def))+ ,("gsl", ("sci-libs", "gsl", def))+ ,("libvirt", ("app-emulation", "libvirt", def)) - ,("sdl2", ("media-libs", "libsdl2", Portage.AnySlot))- ,("SDL2_image", ("media-libs", "sdl2-image", Portage.AnySlot))- ,("SDL2_mixer", ("media-libs", "sdl2-mixer", Portage.AnySlot))- ,("zlib", ("sys-libs", "zlib", Portage.AnySlot))- ,("libpcre", ("dev-libs", "libpcre", Portage.AnySlot))+ ,("Qt5Core", ("dev-qt", "qtcore", Portage.DAttr (Portage.GivenSlot "5") []))+ ,("Qt5Gui", ("dev-qt", "qtgui", Portage.DAttr (Portage.GivenSlot "5") []))+ ,("Qt5Qml", ("dev-qt", "qtdeclarative", Portage.DAttr (Portage.GivenSlot "5") []))+ ,("Qt5Quick", ("dev-qt", "qtdeclarative", Portage.DAttr (Portage.GivenSlot "5") []))+ ,("Qt5Widgets", ("dev-qt", "qtwidgets", Portage.DAttr (Portage.GivenSlot "5") []))++ ,("sdl2", ("media-libs", "libsdl2", def))+ ,("SDL2_image", ("media-libs", "sdl2-image", def))+ ,("SDL2_mixer", ("media-libs", "sdl2-mixer", def))+ ,("zlib", ("sys-libs", "zlib", def))+ ,("libpcre", ("dev-libs", "libpcre", def))+ ,("graphene-gobject-1.0", ("media-libs", "graphene", Portage.DAttr (Portage.AnySlot) [Portage.mkUse $ Portage.Use "introspection"]))+ ,("harfbuzz", ("media-libs", "harfbuzz", def))+ ,("harfbuzz-gobject", ("media-libs", "harfbuzz", Portage.DAttr (Portage.AnySlot) [Portage.mkUse $ Portage.Use "introspection"]))+ ,("x11", ("x11-libs", "libX11", def)) ]
src/Portage/Dependency/Types.hs view
@@ -24,6 +24,7 @@ import Portage.Use import Control.DeepSeq (NFData(..))+import Data.Default.Class -- | Type of SLOT dependency of a dependency. data SlotDepend = AnySlot -- ^ nothing special@@ -111,6 +112,9 @@ instance NFData DAttr where rnf (DAttr sd uf) = rnf sd `seq` rnf uf++instance Default DAttr where+ def = DAttr AnySlot [] data Dependency = DependAtom Atom | DependAnyOf [Dependency]
src/Portage/GHCCore.hs view
@@ -40,29 +40,32 @@ -- The first @GHC@ version in this list is a minimum default. ghcs :: [(DC.CompilerInfo, InstalledPackageIndex)] ghcs =- [ ghc881, ghc883, ghc884, ghc8101, ghc8104, ghc8106, ghc902, ghc924- , ghc925, ghc926+ [ ghc902, ghc924, ghc925, ghc926, ghc927, ghc928, ghc945, ghc946, ghc947+ , ghc948, ghc962, ghc963, ghc964 ] -- | Maybe determine the appropriate 'Cabal.Version' of the @Cabal@ package -- from a given @GHC@ version. ----- >>> cabalFromGHC [8,8,3]--- Just (mkVersion [3,0,1,0])+-- >>> cabalFromGHC [9,2,7]+-- Just (mkVersion [3,6,3,0]) -- >>> cabalFromGHC [9,9,9,9] -- Nothing cabalFromGHC :: [Int] -> Maybe Cabal.Version cabalFromGHC ver = lookup ver table where- table = [ ([8,8,1], Cabal.mkVersion [3,0,0,0])- , ([8,8,3], Cabal.mkVersion [3,0,1,0])- , ([8,8,4], Cabal.mkVersion [3,0,1,0])- , ([8,10,1], Cabal.mkVersion [3,2,0,0])- , ([8,10,4], Cabal.mkVersion [3,2,1,0])- , ([8,10,6], Cabal.mkVersion [3,2,1,0])- , ([9,0,2], Cabal.mkVersion [3,4,1,0])+ table = [ ([9,0,2], Cabal.mkVersion [3,4,1,0]) , ([9,2,4], Cabal.mkVersion [3,6,3,0]) , ([9,2,6], Cabal.mkVersion [3,6,3,0])+ , ([9,2,7], Cabal.mkVersion [3,6,3,0])+ , ([9,2,8], Cabal.mkVersion [3,6,3,0])+ , ([9,4,5], Cabal.mkVersion [3,8,1,0])+ , ([9,4,6], Cabal.mkVersion [3,8,1,0])+ , ([9,4,7], Cabal.mkVersion [3,8,1,0])+ , ([9,4,8], Cabal.mkVersion [3,8,1,0])+ , ([9,6,2], Cabal.mkVersion [3,10,1,0])+ , ([9,6,3], Cabal.mkVersion [3,10,1,0])+ , ([9,6,4], Cabal.mkVersion [3,10,1,0]) ] platform :: Platform@@ -70,9 +73,12 @@ -- | Is the package a core dependency of a specific version of @GHC@? ----- >>> packageIsCore (mkIndex ghc883_pkgs) (Cabal.mkPackageName "binary")+-- >>> packageIsCore (mkIndex [9,2,7] ghc927_pkgs) (Cabal.mkPackageName "binary") -- True--- >>> all (== True) ((packageIsCore (mkIndex ghc883_pkgs)) <$> (packageNamesFromPackageIndex (mkIndex ghc883_pkgs)))+-- >>> :{+-- let idx = mkIndex [9,2,7] ghc927_pkgs+-- in all (== True) $ packageIsCore idx <$> packageNamesFromPackageIndex idx+-- :} -- True packageIsCore :: InstalledPackageIndex -> Cabal.PackageName -> Bool packageIsCore index pn = not . null $ lookupPackageName index pn@@ -129,13 +135,24 @@ -- | Create an 'InstalledPackageIndex' from a ['Cabal.PackageIdentifier']. -- This is used to generate an index of core @GHC@ packages from the provided -- ['Cabal.PackageIdentifier'] functions, e.g. 'ghc883_pkgs'.-mkIndex :: [Cabal.PackageIdentifier] -> InstalledPackageIndex-mkIndex pids = fromList- [ emptyInstalledPackageInfo- { sourcePackageId = pindex- , exposed = True- }- | pindex@(Cabal.PackageIdentifier _name _version) <- pids ]+--+-- This takes the version of GHC as the first parameter, and uses it to+-- automatically add @ghc-boot@, @ghc-boot-th@, @ghc-heap@, and @ghci@ (all of+-- which share the same version number as GHC).+mkIndex :: [Int] -> [Cabal.PackageIdentifier] -> InstalledPackageIndex+mkIndex ghcVer pids = fromList+ [ emptyInstalledPackageInfo+ { sourcePackageId = pindex+ , exposed = True+ }+ | pindex@(Cabal.PackageIdentifier _name _version) <- pids' ]+ where+ pids' =+ p "ghc-boot" ghcVer+ : p "ghc-boot-th" ghcVer+ : p "ghc-heap" ghcVer+ : p "ghci" ghcVer+ : pids packageNamesFromPackageIndex :: InstalledPackageIndex -> [Cabal.PackageName] packageNamesFromPackageIndex pix = nub $ map fst $ allPackagesByName pix@@ -144,37 +161,55 @@ ghc nrs = DC.unknownCompilerInfo c_id DC.NoAbiTag where c_id = CompilerId GHC (mkVersion nrs) -ghc926 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc926 = (ghc [9,2,6], mkIndex ghc926_pkgs)+-- | Convenience function to combine the outputs of 'mkIndex' and 'ghc'+mkInfoIndex+ :: [Int]+ -> [Cabal.PackageIdentifier]+ -> (DC.CompilerInfo, InstalledPackageIndex)+mkInfoIndex ghcVer pids = (ghc ghcVer, mkIndex ghcVer pids) -ghc925 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc925 = (ghc [9,2,5], mkIndex ghc925_pkgs)+ghc964 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc964 = mkInfoIndex [9,6,4] ghc964_pkgs -ghc924 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc924 = (ghc [9,2,4], mkIndex ghc924_pkgs)+ghc963 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc963 = mkInfoIndex [9,6,3] ghc963_pkgs -ghc902 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc902 = (ghc [9,0,2], mkIndex ghc902_pkgs)+ghc962 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc962 = mkInfoIndex [9,6,2] ghc962_pkgs -ghc8106 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc8106 = (ghc [8,10,6], mkIndex ghc8106_pkgs)+ghc948 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc948 = mkInfoIndex [9,4,8] ghc948_pkgs -ghc8104 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc8104 = (ghc [8,10,4], mkIndex ghc8104_pkgs)+ghc947 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc947 = mkInfoIndex [9,4,7] ghc947_pkgs -ghc8101 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc8101 = (ghc [8,10,1], mkIndex ghc8101_pkgs)+ghc946 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc946 = mkInfoIndex [9,4,6] ghc946_pkgs -ghc884 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc884 = (ghc [8,8,4], mkIndex ghc884_pkgs)+ghc945 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc945 = mkInfoIndex [9,4,5] ghc945_pkgs -ghc883 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc883 = (ghc [8,8,3], mkIndex ghc883_pkgs)+ghc928 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc928 = mkInfoIndex [9,2,8] ghc927_pkgs -- not a mistake: identical to 9.2.7 -ghc881 :: (DC.CompilerInfo, InstalledPackageIndex)-ghc881 = (ghc [8,8,1], mkIndex ghc881_pkgs)+ghc927 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc927 = mkInfoIndex [9,2,7] ghc927_pkgs --- | Non-upgradeable core packages+ghc926 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc926 = mkInfoIndex [9,2,6] ghc926_pkgs++ghc925 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc925 = mkInfoIndex [9,2,5] ghc925_pkgs++ghc924 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc924 = mkInfoIndex [9,2,4] ghc924_pkgs++ghc902 :: (DC.CompilerInfo, InstalledPackageIndex)+ghc902 = mkInfoIndex [9,0,2] ghc902_pkgs++-- | Non-upgradeable core packages. Some packages are not included for+-- simplicity (see 'mkIndex').+-- -- Sources: -- * release notes -- example: https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html@@ -184,6 +219,244 @@ -- * https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.0.2-release/compiler/ghc.cabal.in#L60-77 -- * https://flora.pm/packages/%40hackage/ghc/9.0.2/dependencies -- * https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history+-- * @./scripts/scan-ghc-library-versions.bash@ in the gentoo-haskell tree+ghc964_pkgs :: [Cabal.PackageIdentifier]+ghc964_pkgs =+ [ p "array" [0,5,5,0]+ , p "base" [4,18,2,0]+ , p "binary" [0,8,9,1]+ , p "bytestring" [0,11,5,3]+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,1]+ , p "directory" [1,3,8,1]+ , p "exceptions" [0,10,7]+ , p "filepath" [1,4,200,4]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,10,0]+ , p "hpc" [0,6,2,0]+ , p "integer-gmp" [1,1]+ , p "mtl" [2,3,1]+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,17,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,20,0,0]+ , p "terminfo" [0,4,1,6]+ , p "time" [1,12,2]+ , p "transformers" [0,6,1,0]+ , p "unix" [2,8,4,0]+ ]++ghc963_pkgs :: [Cabal.PackageIdentifier]+ghc963_pkgs =+ [ p "array" [0,5,5,0]+ , p "base" [4,18,1,0]+ , p "binary" [0,8,9,1]+ , p "bytestring" [0,11,5,2]+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,1]+ , p "directory" [1,3,8,1]+ , p "exceptions" [0,10,7]+ , p "filepath" [1,4,100,4]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,10,0]+ , p "hpc" [0,6,2,0]+ , p "integer-gmp" [1,1]+ , p "mtl" [2,3,1]+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,17,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,20,0,0]+ , p "terminfo" [0,4,1,6]+ , p "time" [1,12,2]+ , p "transformers" [0,6,1,0]+ , p "unix" [2,8,1,0]+ ]++ghc962_pkgs :: [Cabal.PackageIdentifier]+ghc962_pkgs =+ [ p "array" [0,5,5,0]+ , p "base" [4,18,0,0]+ , p "binary" [0,8,9,1] -- used by libghc+ , p "bytestring" [0,11,5,1] -- MUST BE PATCHED on ghc-9.6.2+-- , p "Cabal" [3,6,3,0] package is upgradeable+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,1] -- used by time+ , p "directory" [1,3,8,1]+ , p "exceptions" [0,10,7] -- used by libghc+ , p "filepath" [1,4,100,1]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,10,0]+-- , p "haskeline" [0,8,2] package is upgradeable+ , p "hpc" [0,6,2,0] -- used by libghc+ , p "integer-gmp" [1,1]+ , p "mtl" [2,3,1] -- used by exceptions+-- , p "parsec" [3,1,15,0] -- package is upgradeable+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,17,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,20,0,0] -- used by libghc+ , p "terminfo" [0,4,1,6] -- used by libghc+-- , p "text" [1,2,5,0] -- package is upgradeable+ , p "time" [1,12,2] -- used by unix, directory, hpc, ghc. unsafe to upgrade+ , p "transformers" [0,6,1,0] -- used by libghc+ , p "unix" [2,8,1,0]+-- , p "xhtml" [3000,2,2,1]+ ]++ghc948_pkgs :: [Cabal.PackageIdentifier]+ghc948_pkgs =+ [ p "array" [0,5,4,0]+ , p "base" [4,17,2,1]+ , p "binary" [0,8,9,1]+ , p "bytestring" [0,11,5,3]+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,0]+ , p "directory" [1,3,7,1]+ , p "exceptions" [0,10,5]+ , p "filepath" [1,4,2,2]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,9,1]+ , p "hpc" [0,6,1,0]+ , p "integer-gmp" [1,1]+ , p "mtl" [2,2,2]+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,18,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,19,0,0]+ , p "terminfo" [0,4,1,5]+ , p "time" [1,12,2]+ , p "transformers" [0,5,6,2]+ , p "unix" [2,7,3]+ ]++ghc947_pkgs :: [Cabal.PackageIdentifier]+ghc947_pkgs =+ [ p "array" [0,5,4,0]+ , p "base" [4,17,2,0]+ , p "binary" [0,8,9,1]+ , p "bytestring" [0,11,5,2]+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,0]+ , p "directory" [1,3,7,1]+ , p "exceptions" [0,10,5]+ , p "filepath" [1,4,2,2]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,9,1]+ , p "hpc" [0,6,1,0]+ , p "integer-gmp" [1,1]+ , p "mtl" [2,2,2]+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,17,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,19,0,0]+ , p "terminfo" [0,4,1,5]+ , p "time" [1,12,2]+ , p "transformers" [0,5,6,2]+ , p "unix" [2,7,3]+ ]++ghc946_pkgs :: [Cabal.PackageIdentifier]+ghc946_pkgs =+ [ p "array" [0,5,4,0]+ , p "base" [4,17,2,0]+ , p "binary" [0,8,9,1] -- used by libghc+ , p "bytestring" [0,11,5,1]+-- , p "Cabal" [3,6,3,0] package is upgradeable+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,0] -- used by time+ , p "directory" [1,3,7,1]+ , p "exceptions" [0,10,5] -- used by libghc+ , p "filepath" [1,4,2,2]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,9,1]+-- , p "haskeline" [0,8,2] package is upgradeable+ , p "hpc" [0,6,1,0] -- used by libghc+ , p "integer-gmp" [1,1]+ , p "mtl" [2,2,2] -- used by exceptions+-- , p "parsec" [3,1,15,0] -- package is upgradeable+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,17,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,19,0,0] -- used by libghc+ , p "terminfo" [0,4,1,5] -- used by libghc+-- , p "text" [1,2,5,0] -- package is upgradeable+ , p "time" [1,12,2] -- used by unix, directory, hpc, ghc. unsafe to upgrade+ , p "transformers" [0,5,6,2] -- used by libghc+ , p "unix" [2,7,3]+-- , p "xhtml" [3000,2,2,1]+ ]+++ghc945_pkgs :: [Cabal.PackageIdentifier]+ghc945_pkgs =+ [ p "array" [0,5,4,0]+ , p "base" [4,17,1,0]+ , p "binary" [0,8,9,1] -- used by libghc+ , p "bytestring" [0,11,4,0]+-- , p "Cabal" [3,6,3,0] package is upgradeable+ , p "containers" [0,6,7]+ , p "deepseq" [1,4,8,0] -- used by time+ , p "directory" [1,3,7,1]+ , p "exceptions" [0,10,5] -- used by libghc+ , p "filepath" [1,4,2,2]+ , p "ghc-bignum" [1,3]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,9,0]+-- , p "haskeline" [0,8,2] package is upgradeable+ , p "hpc" [0,6,1,0] -- used by libghc+ , p "integer-gmp" [1,1]+ , p "mtl" [2,2,2] -- used by exceptions+-- , p "parsec" [3,1,15,0] -- package is upgradeable+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,16,0]+ , p "stm" [2,5,1,0]+ , p "template-haskell" [2,19,0,0] -- used by libghc+ , p "terminfo" [0,4,1,5] -- used by libghc+-- , p "text" [1,2,5,0] -- package is upgradeable+ , p "time" [1,12,2] -- used by unix, directory, hpc, ghc. unsafe to upgrade+ , p "transformers" [0,5,6,2] -- used by libghc+ , p "unix" [2,7,3]+-- , p "xhtml" [3000,2,2,1]+ ]++ghc927_pkgs :: [Cabal.PackageIdentifier]+ghc927_pkgs =+ [ p "array" [0,5,4,0]+ , p "base" [4,16,4,0]+ , p "binary" [0,8,9,0] -- used by libghc+ , p "bytestring" [0,11,4,0]+-- , p "Cabal" [3,6,3,0] package is upgradeable+ , p "containers" [0,6,5,1]+ , p "deepseq" [1,4,6,1] -- used by time+ , p "directory" [1,3,6,2]+ , p "exceptions" [0,10,4] -- used by libghc+ , p "filepath" [1,4,2,2]+ , p "ghc-bignum" [1,2]+ , p "ghc-compact" [0,1,0,0]+ , p "ghc-prim" [0,8,0]+-- , p "haskeline" [0,8,2] package is upgradeable+ , p "hpc" [0,6,1,0] -- used by libghc+ , p "integer-gmp" [1,1]+ , p "mtl" [2,2,2] -- used by exceptions+-- , p "parsec" [3,1,15,0] -- package is upgradeable+ , p "pretty" [1,1,3,6]+ , p "process" [1,6,16,0]+ , p "stm" [2,5,0,2]+ , p "template-haskell" [2,18,0,0] -- used by libghc+ , p "terminfo" [0,4,1,5] -- used by libghc+-- , p "text" [1,2,5,0] -- package is upgradeable+ , p "time" [1,11,1,1] -- used by unix, directory, hpc, ghc. unsafe to upgrade+ , p "transformers" [0,5,6,2] -- used by libghc+ , p "unix" [2,7,2,2]+-- , p "xhtml" [3000,2,2,1]+ ]+ ghc926_pkgs :: [Cabal.PackageIdentifier] ghc926_pkgs = [ p "array" [0,5,4,0]@@ -197,12 +470,8 @@ , p "exceptions" [0,10,4] -- used by libghc , p "filepath" [1,4,2,1] , p "ghc-bignum" [1,2]- , p "ghc-boot" [9,2,6]- , p "ghc-boot-th" [9,2,6] , p "ghc-compact" [0,1,0,0] , p "ghc-prim" [0,8,0]- , p "ghc-heap" [9,2,6]- , p "ghci" [9,2,6] -- , p "haskeline" [0,8,2] package is upgradeable , p "hpc" [0,6,1,0] -- used by libghc , p "integer-gmp" [1,1]@@ -233,12 +502,8 @@ , p "exceptions" [0,10,4] -- used by libghc , p "filepath" [1,4,2,1] , p "ghc-bignum" [1,2]- , p "ghc-boot" [9,2,5]- , p "ghc-boot-th" [9,2,5] , p "ghc-compact" [0,1,0,0] , p "ghc-prim" [0,8,0]- , p "ghc-heap" [9,2,5]- , p "ghci" [9,2,5] -- , p "haskeline" [0,8,2] package is upgradeable , p "hpc" [0,6,1,0] -- used by libghc , p "integer-gmp" [1,1]@@ -269,12 +534,8 @@ , p "exceptions" [0,10,4] -- used by libghc , p "filepath" [1,4,2,1] , p "ghc-bignum" [1,2]- , p "ghc-boot" [9,2,4]- , p "ghc-boot-th" [9,2,4] , p "ghc-compact" [0,1,0,0] , p "ghc-prim" [0,8,0]- , p "ghc-heap" [9,2,4]- , p "ghci" [9,2,4] -- , p "haskeline" [0,8,2] package is upgradeable , p "hpc" [0,6,1,0] -- used by libghc , p "integer-gmp" [1,1]@@ -305,12 +566,8 @@ , p "filepath" [1,4,2,1] , p "exceptions" [0,10,4] -- used by libghc , p "ghc-bignum" [1,1]- , p "ghc-boot" [9,0,2]- , p "ghc-boot-th" [9,0,2] , p "ghc-compact" [0,1,0,0] , p "ghc-prim" [0,7,0]- , p "ghc-heap" [9,0,2]- , p "ghci" [9,0,2] -- , p "haskeline" [0,8,2] package is upgradeable , p "hpc" [0,6,1,0] -- used by libghc , p "integer-gmp" [1,1]@@ -322,210 +579,6 @@ , p "template-haskell" [2,17,0,0] -- used by libghc , p "terminfo" [0,4,1,5] -- used by libghc -- , p "text" [1,2,5,0] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc8106_pkgs :: [Cabal.PackageIdentifier]-ghc8106_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,14,1,0]- , p "binary" [0,8,8,0] -- used by libghc- , p "bytestring" [0,10,12,0]--- , p "Cabal" [3,2,1,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,6,0]- , p "filepath" [1,4,2,1]- , p "exceptions" [0,10,4] -- used by libghc in ghc-9.0.2- , p "ghc-boot" [8,10,4]- , p "ghc-boot-th" [8,10,4]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,6,1,0]- , p "ghc-heap" [8,10,4]- , p "ghci" [8,10,4]--- , p "haskeline" [0,8,0,1] package is upgradeable- , p "hpc" [0,6,1,0] -- used by libghc- , p "integer-gmp" [1,0,3,0]- , p "mtl" [2,2,2] -- used by exceptions in ghc-9.0.2--- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,16,0]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,16,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,4,1] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc8104_pkgs :: [Cabal.PackageIdentifier]-ghc8104_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,14,1,0]- , p "binary" [0,8,8,0] -- used by libghc- , p "bytestring" [0,10,12,0]--- , p "Cabal" [3,2,1,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,6,0]- , p "filepath" [1,4,2,1]- , p "exceptions" [0,10,4] -- used by libghc in ghc-9.0.2- , p "ghc-boot" [8,10,4]- , p "ghc-boot-th" [8,10,4]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,6,1,0]- , p "ghc-heap" [8,10,4]- , p "ghci" [8,10,4]--- , p "haskeline" [0,8,0,1] package is upgradeable- , p "hpc" [0,6,1,0] -- used by libghc- , p "integer-gmp" [1,0,3,0]- , p "mtl" [2,2,2] -- used by exceptions in ghc-9.0.2--- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,9,0]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,16,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,4,1] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc8101_pkgs :: [Cabal.PackageIdentifier]-ghc8101_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,14,0,0]- , p "binary" [0,8,8,0] -- used by libghc- , p "bytestring" [0,10,10,0]--- , p "Cabal" [3,2,0,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,6,0]- , p "filepath" [1,4,2,1]- , p "exceptions" [0,10,4] -- used by libghc in ghc-9.0.2- , p "ghc-boot" [8,10,1]- , p "ghc-boot-th" [8,10,1]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,6,1,0]- , p "ghc-heap" [8,10,1]- , p "ghci" [8,10,1]--- , p "haskeline" [0,8,0,0] package is upgradeable- , p "hpc" [0,6,1,0] -- used by libghc- , p "integer-gmp" [1,0,3,0]- , p "mtl" [2,2,2] -- used by libghc in ghc-9.0.2 --- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,8,2]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,16,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,3,2] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc884_pkgs :: [Cabal.PackageIdentifier]-ghc884_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,13,0,0]- , p "binary" [0,8,7,0] -- used by libghc- , p "bytestring" [0,10,10,1]--- , p "Cabal" [3,0,1,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,6,0]- , p "filepath" [1,4,2,1]- , p "ghc-boot" [8,8,4]- , p "ghc-boot-th" [8,8,4]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,5,3,0]- , p "ghci" [8,8,4]--- , p "haskeline" [0,7,5,0] package is upgradeable- , p "hpc" [0,6,0,3] -- used by libghc- , p "integer-gmp" [1,0,2,0]- , p "mtl" [2,2,2] -- used by exceptions in ghc-9.0.2--- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,9,0]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,15,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,4,0] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc883_pkgs :: [Cabal.PackageIdentifier]-ghc883_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,13,0,0]- , p "binary" [0,8,7,0] -- used by libghc- , p "bytestring" [0,10,10,0]--- , p "Cabal" [3,0,1,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,6,0]- , p "filepath" [1,4,2,1]- , p "ghc-boot" [8,8,3]- , p "ghc-boot-th" [8,8,3]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,5,3,0]- , p "ghci" [8,8,3]--- , p "haskeline" [0,7,5,0] package is upgradeable- , p "hpc" [0,6,0,3] -- used by libghc- , p "integer-gmp" [1,0,2,0]- , p "mtl" [2,2,2] -- used by exceptions in ghc-9.0.2--- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,8,0]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,15,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,4,0] -- package is upgradeable- , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade- , p "transformers" [0,5,6,2] -- used by libghc- , p "unix" [2,7,2,2]--- , p "xhtml" [3000,2,2,1]- ]--ghc881_pkgs :: [Cabal.PackageIdentifier]-ghc881_pkgs =- [ p "array" [0,5,4,0]- , p "base" [4,13,0,0]- , p "binary" [0,8,7,0] -- used by libghc- , p "bytestring" [0,10,9,0]--- , p "Cabal" [3,0,0,0] package is upgradeable- , p "containers" [0,6,2,1]- , p "deepseq" [1,4,4,0] -- used by time- , p "directory" [1,3,3,2]- , p "filepath" [1,4,2,1]- , p "ghc-boot" [8,8,1]- , p "ghc-boot-th" [8,8,1]- , p "ghc-compact" [0,1,0,0]- , p "ghc-prim" [0,5,3,0]- , p "ghci" [8,8,1]--- , p "haskeline" [0,7,4,3] package is upgradeable- , p "hpc" [0,6,0,3] -- used by libghc- , p "integer-gmp" [1,0,2,0]- , p "mtl" [2,2,2] -- used by exceptions in ghc-9.0.2--- , p "parsec" [3,1,14,0] -- package is upgradeable- , p "pretty" [1,1,3,6]- , p "process" [1,6,5,1]- , p "stm" [2,5,0,0]- , p "template-haskell" [2,15,0,0] -- used by libghc- , p "terminfo" [0,4,1,4] -- used by libghc in ghc-9.0.2--- , p "text" [1,2,4,0] -- package is upgradeable , p "time" [1,9,3,0] -- used by unix, directory, hpc, ghc. unsafe to upgrade , p "transformers" [0,5,6,2] -- used by libghc , p "unix" [2,7,2,2]
− src/Portage/Tables.hs
@@ -1,37 +0,0 @@-{-|-Module : Portage.Tables-License : GPL-3+-Maintainer : haskell@gentoo.org--Tables of Portage-specific conversions.--}-module Portage.Tables- ( set_build_slot- ) where--import Portage.Dependency.Builder-import Portage.Dependency.Types-import Portage.PackageId--import Data.Monoid---- | Set the @SLOT@ for a given 'Dependency'.-set_build_slot :: Dependency -> Dependency-set_build_slot = - overAtom $ \a@(Atom pn dr (DAttr _ u)) -> - case mconcat $ map (First . matches a) slottedPkgs of- First (Just s) -> Atom pn dr (DAttr s u)- First Nothing -> Atom pn dr (DAttr AnyBuildTimeSlot u)- where- matches (Atom pn _ _) (nm,s) - | pn == nm = Just s- | otherwise = Nothing---- | List of 'PackageName's with their corresponding default 'SlotDepend's.------ For example, dependency @QuickCheck@ has its @SLOT@ always set to @2@.-slottedPkgs :: [(PackageName, SlotDepend)]-slottedPkgs =- [ (mkPackageName "dev-haskell" "quickcheck", GivenSlot "2=")- , (mkPackageName "dev-haskell" "hdbc", GivenSlot "2=")- ]
src/Portage/Use.hs view
@@ -57,7 +57,7 @@ dispUses :: [UseFlag] -> Disp.Doc dispUses [] = Disp.empty-dispUses us = Disp.brackets $ Disp.hcat $ (Disp.punctuate (Disp.text ", ")) $ map pretty us+dispUses us = Disp.brackets $ Disp.hcat $ (Disp.punctuate (Disp.text ",")) $ map pretty us newtype Use = Use String deriving (Eq, Read, Show)
tests/spec/Merge/UtilsSpec.hs view
@@ -1,10 +1,14 @@+{-# LANGUAGE CPP #-}+ module Merge.UtilsSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import QuickCheck.Instances +#if !MIN_VERSION_base(4,18,0) import Control.Applicative (liftA2)+#endif import qualified Data.Map.Strict as Map import Data.Maybe (catMaybes) import qualified Data.List as L
tests/spec/Portage/GHCCoreSpec.hs view
@@ -11,7 +11,7 @@ spec = do describe "cabalFromGHC" $ do it "returns the corresponding Cabal version for a valid GHC version" $ do- cabalFromGHC [8,8,3] `shouldBe` Just (Cabal.mkVersion [3,0,1,0])+ cabalFromGHC [9,2,7] `shouldBe` Just (Cabal.mkVersion [3,6,3,0]) it "returns Nothing for an invalid GHC version" $ do cabalFromGHC [9,9,9,9] `shouldBe` Nothing describe "packageIsCoreInAnyGHC" $ do