[arch-commits] Commit in hindent/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Wed Jul 18 14:32:25 UTC 2018
Date: Wednesday, July 18, 2018 @ 14:32:25
Author: felixonmars
Revision: 361999
archrelease: copy trunk to community-staging-x86_64
Added:
hindent/repos/community-staging-x86_64/
hindent/repos/community-staging-x86_64/PKGBUILD
(from rev 361998, hindent/trunk/PKGBUILD)
hindent/repos/community-staging-x86_64/ghc-8.4.patch
(from rev 361998, hindent/trunk/ghc-8.4.patch)
---------------+
PKGBUILD | 52 ++++++++++++++++++++++++++++++++++++++++
ghc-8.4.patch | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+)
Copied: hindent/repos/community-staging-x86_64/PKGBUILD (from rev 361998, hindent/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2018-07-18 14:32:25 UTC (rev 361999)
@@ -0,0 +1,52 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+pkgname=hindent
+pkgver=5.2.5
+pkgrel=66
+pkgdesc="Extensible Haskell pretty printer"
+url="https://github.com/commercialhaskell/hindent"
+license=("custom:BSD3")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-descriptive' 'haskell-exceptions' 'haskell-monad-loops'
+ 'haskell-path' 'haskell-path-io' 'haskell-src-exts' 'haskell-unix-compat'
+ 'haskell-utf8-string' 'haskell-yaml')
+makedepends=('ghc' 'haskell-diff' 'haskell-hspec')
+source=("https://hackage.haskell.org/packages/archive/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"
+ ghc-8.4.patch)
+sha512sums=('72a6b57ad5a2514ae7d3dd39d87b92757c8a5c85b60daad1e883ebb20385de3d4794b5f9550653b48cf682e5476b38d5dfaf348caec05df3d4396f3aa0f743ef'
+ '32d8f5f3df69ec204afc2ec6afee28c05670137285bb6ff3978d5ae729e0e67830d7cfe7c5775dd5ced0bbd93270d9f73f8c93282f3eaaded48d023e88ccdc72')
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../ghc-8.4.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --enable-tests --datasubdir="$pkgname" \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
+ runhaskell Setup build
+ 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
+}
+
+check() {
+ cd $pkgname-$pkgver
+ runhaskell Setup test
+}
+
+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.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
+ rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE.md"
+}
Copied: hindent/repos/community-staging-x86_64/ghc-8.4.patch (from rev 361998, hindent/trunk/ghc-8.4.patch)
===================================================================
--- community-staging-x86_64/ghc-8.4.patch (rev 0)
+++ community-staging-x86_64/ghc-8.4.patch 2018-07-18 14:32:25 UTC (rev 361999)
@@ -0,0 +1,72 @@
+From f0ac1ebed87bde6d93dbe5eac42ff5b5fb23e7ee Mon Sep 17 00:00:00 2001
+From: Rob Looby <robertjlooby at gmail.com>
+Date: Fri, 11 May 2018 13:12:07 -0500
+Subject: [PATCH] Make work with lts-11 and ghc-8.4.2 nightly build
+
+---
+ .travis.yml | 6 +++++-
+ src/HIndent/CabalFile.hs | 28 ++++++++++++++++++++++++----
+ stack.yaml | 7 ++++---
+ 3 files changed, 33 insertions(+), 8 deletions(-)
+
+diff --git a/src/HIndent/CabalFile.hs b/src/HIndent/CabalFile.hs
+index 083d965..d8c731e 100644
+--- a/src/HIndent/CabalFile.hs
++++ b/src/HIndent/CabalFile.hs
+@@ -1,14 +1,21 @@
++{-# LANGUAGE CPP #-}
++
+ module HIndent.CabalFile
+ ( getCabalExtensionsForSourcePath
+ ) where
+
++import qualified Data.ByteString as BS
+ import Data.List
+ import Data.Maybe
+ import Data.Traversable
+ import Distribution.ModuleName
+ import Distribution.PackageDescription
+ import Distribution.PackageDescription.Configuration
++#if MIN_VERSION_Cabal(2, 2, 0)
++import Distribution.PackageDescription.Parsec
++#else
+ import Distribution.PackageDescription.Parse
++#endif
+ import Language.Haskell.Extension
+ import qualified Language.Haskell.Exts.Extension as HSE
+ import System.Directory
+@@ -82,6 +89,19 @@ findCabalFiles dir rel = do
+ [] -> findCabalFiles (takeDirectory dir) (takeFileName dir </> rel)
+ _ -> return $ Just (fmap (\n -> dir </> n) cabalnames, rel)
+
++getGenericPackageDescription :: FilePath -> IO (Maybe GenericPackageDescription)
++#if MIN_VERSION_Cabal(2, 2, 0)
++getGenericPackageDescription cabalPath = do
++ cabaltext <- BS.readFile cabalPath
++ return $ parseGenericPackageDescriptionMaybe cabaltext
++#else
++getGenericPackageDescription cabalPath = do
++ cabaltext <- readFile cabalPath
++ case parsePackageDescription cabaltext of
++ ParseOk _ gpd -> return $ Just gpd
++ _ -> return Nothing
++#endif
++
+ -- | Find the `Stanza` that refers to this source path
+ getCabalStanza :: FilePath -> IO (Maybe Stanza)
+ getCabalStanza srcpath = do
+@@ -91,10 +111,10 @@ getCabalStanza srcpath = do
+ Just (cabalpaths, relpath) -> do
+ stanzass <-
+ for cabalpaths $ \cabalpath -> do
+- cabaltext <- readFile cabalpath
+- case parsePackageDescription cabaltext of
+- ParseFailed _ -> return []
+- ParseOk _ gpd -> do
++ genericPackageDescription <- getGenericPackageDescription cabalpath
++ case genericPackageDescription of
++ Nothing -> return []
++ Just gpd -> do
+ return $ packageStanzas $ flattenPackageDescription gpd
+ return $
+ case filter (\stanza -> stanzaIsSourceFilePath stanza relpath) $
More information about the arch-commits
mailing list