[arch-commits] Commit in arch-hs/repos (3 files)

Felix Yan felixonmars at archlinux.org
Wed Jul 7 09:39:21 UTC 2021


    Date: Wednesday, July 7, 2021 @ 09:39:21
  Author: felixonmars
Revision: 974305

archrelease: copy trunk to community-staging-x86_64

Added:
  arch-hs/repos/community-staging-x86_64/
  arch-hs/repos/community-staging-x86_64/PKGBUILD
    (from rev 974304, arch-hs/trunk/PKGBUILD)
  arch-hs/repos/community-staging-x86_64/cabal3.4.patch
    (from rev 974304, arch-hs/trunk/cabal3.4.patch)

----------------+
 PKGBUILD       |   71 +++++++++++++++++++++++++++
 cabal3.4.patch |  143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 214 insertions(+)

Copied: arch-hs/repos/community-staging-x86_64/PKGBUILD (from rev 974304, arch-hs/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-07-07 09:39:21 UTC (rev 974305)
@@ -0,0 +1,71 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: berberman <hatsue at typed.icu>
+
+pkgname=arch-hs
+pkgver=0.9.0.0
+pkgrel=27
+pkgdesc="Distribute hackage packages to archlinux"
+arch=('x86_64')
+url="https://github.com/berberman/arch-hs"
+license=('MIT')
+depends=('ghc-libs' 'pacman' 'haskell-diff' 'haskell-aeson' 'haskell-algebraic-graphs'
+         'haskell-arch-web' 'haskell-conduit' 'haskell-conduit-extra' 'haskell-hackage-db'
+         'haskell-http-client' 'haskell-http-client-tls' 'haskell-megaparsec' 'haskell-microlens'
+         'haskell-microlens-th' 'haskell-neat-interpolation' 'haskell-optparse-simple'
+         'haskell-polysemy' 'haskell-prettyprinter' 'haskell-prettyprinter-ansi-terminal'
+         'haskell-servant-client' 'haskell-split' 'haskell-tar-conduit')
+makedepends=('ghc' 'uusi')
+source=("https://hackage.haskell.org/packages/archive/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz"
+        cabal3.4.patch)
+sha512sums=('34b2dc3e927ffccdb943cff5d64b19b85e9d63c43edb7da21c51dc440f41f5aa1abc81c890571638854fb6e7726a86d6e5d8f053ac1668365a4d235651f18bee'
+            '39c6e4e7da8bcfbc58d9c7733285b22f47c769e388cf39350a84389d136ca419368447cc2a4660ef95f501a6899946ed85c9d7aaa851524682bfe385a19d05db')
+
+_gen_comp(){
+  LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --bash-completion-script "/usr/bin/arch-hs${1}" > bash${1}
+  LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --zsh-completion-script  "/usr/bin/arch-hs${1}" > zsh${1}
+  LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --fish-completion-script "/usr/bin/arch-hs${1}" > fish${1}
+}
+
+_install_comp(){
+  install -D -m644 bash${1} "$pkgdir/usr/share/bash-completion/completions/arch-hs${1}"
+  install -D -m644 zsh${1}  "$pkgdir/usr/share/zsh/site-functions/_arch-hs${1}"
+  install -D -m644 fish${1} "$pkgdir/usr/share/fish/vendor_completions.d/arch-hs${1}.fish"
+}
+
+prepare() {
+  cd $pkgname-$pkgver
+  patch -p1 -i ../cabal3.4.patch
+  uusi -u template-haskell $pkgname.cabal
+}
+
+build() {
+  cd $pkgname-$pkgver
+  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+    --prefix=/usr --docdir=/usr/share/doc/$pkgname \
+    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
+    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
+    --ghc-option='-pie' -falpm
+
+  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
+  
+  _gen_comp
+  _gen_comp "-diff"
+  _gen_comp "-sync"
+}
+
+package() {
+  cd $pkgname-$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"
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+  
+  _install_comp
+  _install_comp "-diff"
+  _install_comp "-sync"
+} 

Copied: arch-hs/repos/community-staging-x86_64/cabal3.4.patch (from rev 974304, arch-hs/trunk/cabal3.4.patch)
===================================================================
--- community-staging-x86_64/cabal3.4.patch	                        (rev 0)
+++ community-staging-x86_64/cabal3.4.patch	2021-07-07 09:39:21 UTC (rev 974305)
@@ -0,0 +1,143 @@
+diff --git a/app/Json.hs b/app/Json.hs
+index 68f4373..af2298a 100644
+--- a/app/Json.hs
++++ b/app/Json.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveAnyClass #-}
+ {-# LANGUAGE DeriveGeneric #-}
+ {-# LANGUAGE DerivingStrategies #-}
+@@ -31,7 +32,11 @@ packageName (unPackageName -> name) = String $ T.pack name
+ archLinuxName :: ArchLinuxName -> Value
+ archLinuxName (ArchLinuxName name) = String $ T.pack name
+ 
++#if MIN_VERSION_Cabal(3,4,0)
++flag :: PackageFlag -> Value
++#else
+ flag :: Flag -> Value
++#endif
+ flag f =
+   object
+     [ "name" .= unFlagName (flagName f),
+@@ -99,7 +104,11 @@ instance ToJSON SysDepsS where
+ 
+ data FlagsS = FlagsS
+   { fPkg :: PackageName,
++#if MIN_VERSION_Cabal(3,4,0)
++    fFlag :: [PackageFlag]
++#else
+     fFlag :: [Flag]
++#endif
+   }
+ 
+ instance ToJSON FlagsS where
+@@ -137,5 +146,9 @@ fromSolvedPackage :: SolvedPackage -> SolvedPackageS
+ fromSolvedPackage ProvidedPackage {..} = SolvedPackageS _pkgName [] (Just _pkgProvider)
+ fromSolvedPackage SolvedPackage {..} = SolvedPackageS _pkgName (fromSolvedDependency <$> _pkgDeps) Nothing
+ 
++#if MIN_VERSION_Cabal(3,4,0)
++fromFlag :: (PackageName, [PackageFlag]) -> FlagsS
++#else
+ fromFlag :: (PackageName, [Flag]) -> FlagsS
++#endif
+ fromFlag (fPkg, fFlag) = FlagsS {..}
+diff --git a/diff/Diff.hs b/diff/Diff.hs
+index 294a3d8..30bd123 100644
+--- a/diff/Diff.hs
++++ b/diff/Diff.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE OverloadedStrings #-}
+ {-# LANGUAGE TypeApplications #-}
+ 
+@@ -228,7 +229,11 @@ dep s va vb =
+     joinToString xs = indent 2 $ vsep xs
+     joinVersionWithName (n, range) = unPackageName n <> "  " <> prettyShow range
+ 
++#if MIN_VERSION_Cabal(3,4,0)
++flags :: PackageName -> [PackageFlag] -> [PackageFlag] -> Doc AnsiStyle
++#else
+ flags :: PackageName -> [Flag] -> [Flag] -> Doc AnsiStyle
++#endif
+ flags name a b =
+   annMagneta "Flags" <> colon <> line
+     <> if noDiff diff
+diff --git a/src/Distribution/ArchHs/Core.hs b/src/Distribution/ArchHs/Core.hs
+index 5c27f35..0b80dcb 100644
+--- a/src/Distribution/ArchHs/Core.hs
++++ b/src/Distribution/ArchHs/Core.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE RecordWildCards #-}
+ {-# LANGUAGE TypeApplications #-}
+ 
+@@ -36,7 +37,7 @@ import Distribution.ArchHs.PkgBuild
+ import Distribution.ArchHs.Types
+ import Distribution.ArchHs.Utils
+ import Distribution.Compiler (CompilerFlavor (..))
+-import Distribution.PackageDescription
++import Distribution.PackageDescription hiding (pkgName)
+ import Distribution.SPDX
+ import Distribution.System (Arch (X86_64), OS (Linux))
+ import qualified Distribution.Types.BuildInfo.Lens as L
+@@ -51,7 +52,11 @@ archEnv _ (Arch X86_64) = Right True
+ archEnv _ (Arch _) = Right False
+ archEnv _ (Impl GHC range) = Right $ withinRange (mkVersion [8, 10, 4]) range
+ archEnv _ (Impl _ _) = Right False
++#if MIN_VERSION_Cabal(3,4,0)
++archEnv assignment f@(PackageFlag f') = go f $ lookupFlagAssignment f' assignment
++#else
+ archEnv assignment f@(Flag f') = go f $ lookupFlagAssignment f' assignment
++#endif
+   where
+     go _ (Just r) = Right r
+     go x Nothing = Left x
+diff --git a/src/Distribution/ArchHs/Hackage.hs b/src/Distribution/ArchHs/Hackage.hs
+index 430c293..6586718 100644
+--- a/src/Distribution/ArchHs/Hackage.hs
++++ b/src/Distribution/ArchHs/Hackage.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE TypeApplications #-}
+ 
+ -- | Copyright: (c) 2020-2021 berberman
+@@ -93,7 +94,11 @@ getCabal name version = do
+     Nothing -> throw $ PkgNotFound name
+ 
+ -- | Get flags of a package.
++#if MIN_VERSION_Cabal(3,4,0)
++getPackageFlag :: Members [HackageEnv, WithMyErr] r => PackageName -> Sem r [PackageFlag]
++#else
+ getPackageFlag :: Members [HackageEnv, WithMyErr] r => PackageName -> Sem r [Flag]
++#endif
+ getPackageFlag name = do
+   cabal <- getLatestCabal name
+   return $ cabal & genPackageFlags
+diff --git a/src/Distribution/ArchHs/PP.hs b/src/Distribution/ArchHs/PP.hs
+index baa4298..92b0326 100644
+--- a/src/Distribution/ArchHs/PP.hs
++++ b/src/Distribution/ArchHs/PP.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE OverloadedStrings #-}
+ {-# LANGUAGE RecordWildCards #-}
+ {-# LANGUAGE ViewPatterns #-}
+@@ -97,10 +98,18 @@ prettyDeps =
+     . fmap (\(i :: Int, n) -> pretty i <> dot <+> viaPretty n)
+     . zip [1 ..]
+ 
++#if MIN_VERSION_Cabal(3,4,0)
++prettyFlags :: [(PackageName, [PackageFlag])] -> Doc AnsiStyle
++#else
+ prettyFlags :: [(PackageName, [Flag])] -> Doc AnsiStyle
++#endif
+ prettyFlags = vsep . fmap (\(name, flags) -> annMagneta (viaPretty name) <> line <> indent 2 (vsep (prettyFlag <$> flags)))
+ 
++#if MIN_VERSION_Cabal(3,4,0)
++prettyFlag :: PackageFlag -> Doc AnsiStyle
++#else
+ prettyFlag :: Flag -> Doc AnsiStyle
++#endif
+ prettyFlag f =
+   "⚐" <+> annYellow name <> colon <> line
+     <> indent




More information about the arch-commits mailing list