Date: Saturday, January 7, 2023 @ 00:14:00 Author: felixonmars Revision: 1380557
archrelease: copy trunk to community-staging-x86_64 Added: cabal-plan/repos/community-staging-x86_64/ cabal-plan/repos/community-staging-x86_64/PKGBUILD (from rev 1380554, cabal-plan/trunk/PKGBUILD) cabal-plan/repos/community-staging-x86_64/cabal-plan-aeson-2.patch (from rev 1380554, cabal-plan/trunk/cabal-plan-aeson-2.patch) --------------------------+ PKGBUILD | 51 +++++++++++++++++++++++++++++++++++++++++++++ cabal-plan-aeson-2.patch | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) Copied: cabal-plan/repos/community-staging-x86_64/PKGBUILD (from rev 1380554, cabal-plan/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2023-01-07 00:14:00 UTC (rev 1380557) @@ -0,0 +1,51 @@ +# Maintainer: Felix Yan <felixonm...@archlinux.org> + +_hkgname=cabal-plan +pkgname=cabal-plan +pkgver=0.7.2.0 +pkgrel=222 +pkgdesc="Library and utility for processing cabal's plan.json file" +url="https://github.com/hvr/cabal-plan" +license=("GPL") +arch=('x86_64') +depends=('ghc-libs' 'haskell-aeson' 'haskell-ansi-terminal' 'haskell-async' 'haskell-base-compat' + 'haskell-base16-bytestring' 'haskell-cabal-install-parsers' 'haskell-optics-core' + 'haskell-optparse-applicative' 'haskell-semialign' 'haskell-singleton-bool' 'haskell-tar' + 'haskell-these' 'haskell-topograph' 'haskell-vector' 'haskell-zlib') +makedepends=('ghc' 'uusi') +source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz" + cabal-plan-aeson-2.patch) +sha256sums=('233a3d1460732fe3486169023758e431d37c5c9156fb28d829decaf7b9170f85' + '9247a90d0098e6388feb6b1046894defacfa2d1c51136b838be25f04a011e0fc') + +prepare() { + cd $_hkgname-$pkgver + patch -p1 -i ../cabal-plan-aeson-2.patch + uusi -u aeson -u base -u base-compat -u Cabal -u optics-core -u optparse-applicative -u semialign -u vector $_hkgname.cabal +} + +build() { + cd $_hkgname-$pkgver + + runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \ + --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \ + --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \ + --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \ + --ghc-option='-pie' \ + -fexe -flicense-report + + runhaskell Setup build $MAKEFLAGS + runhaskell Setup register --gen-script + runhaskell Setup unregister --gen-script + sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh + sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh +} + +package() { + cd $_hkgname-$pkgver + + install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh + install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh + runhaskell Setup copy --destdir="$pkgdir" + rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE.GPLv2 +} Copied: cabal-plan/repos/community-staging-x86_64/cabal-plan-aeson-2.patch (from rev 1380554, cabal-plan/trunk/cabal-plan-aeson-2.patch) =================================================================== --- community-staging-x86_64/cabal-plan-aeson-2.patch (rev 0) +++ community-staging-x86_64/cabal-plan-aeson-2.patch 2023-01-07 00:14:00 UTC (rev 1380557) @@ -0,0 +1,39 @@ +From e2c8c66d3ca916cee7dec2fa3fd867052ff1fd51 Mon Sep 17 00:00:00 2001 +From: Julian Ospald <hasuf...@posteo.de> +Date: Sat, 9 Oct 2021 21:49:46 +0200 +Subject: [PATCH] Allow to build with aeson >=2 wrt #75 + +--- + cabal-plan.cabal | 2 +- + src/Cabal/Plan.hs | 11 ++++++++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/Cabal/Plan.hs b/src/Cabal/Plan.hs +index eeb5a19..b098e0c 100755 +--- a/src/Cabal/Plan.hs ++++ b/src/Cabal/Plan.hs +@@ -57,6 +57,9 @@ module Cabal.Plan + import Control.Applicative as App + import Control.Monad + import Data.Aeson ++#if MIN_VERSION_aeson(2,0,0) ++import qualified Data.Aeson.Key as AK ++#endif + import Data.Aeson.Types + import qualified Data.ByteString as B + import qualified Data.ByteString.Base16 as B16 +@@ -370,7 +373,13 @@ instance FromJSON PlanJson where + pure pim + + (.:?!) :: (FromJSON a, Monoid a) => Object -> Text -> Parser a +-o .:?! fld = o .:? fld .!= Data.Monoid.mempty ++o .:?! fld = o .:? fT fld .!= Data.Monoid.mempty ++ where ++#if MIN_VERSION_aeson(2,0,0) ++ fT = AK.fromText ++#else ++ fT = id ++#endif + + planItemAllDeps :: Unit -> Set UnitId + planItemAllDeps Unit{..} = mconcat [ ciLibDeps <> ciExeDeps | CompInfo{..} <- M.elems uComps ]