[arch-commits] Commit in haskell-githash/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Tue Jun 22 07:03:42 UTC 2021
Date: Tuesday, June 22, 2021 @ 07:03:42
Author: felixonmars
Revision: 966810
archrelease: copy trunk to community-staging-x86_64
Added:
haskell-githash/repos/community-staging-x86_64/
haskell-githash/repos/community-staging-x86_64/PKGBUILD
(from rev 966809, haskell-githash/trunk/PKGBUILD)
haskell-githash/repos/community-staging-x86_64/ghc9.patch
(from rev 966809, haskell-githash/trunk/ghc9.patch)
------------+
PKGBUILD | 50 ++++++++++++++++++++++++++++++++++++++++++
ghc9.patch | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 119 insertions(+)
Copied: haskell-githash/repos/community-staging-x86_64/PKGBUILD (from rev 966809, haskell-githash/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2021-06-22 07:03:42 UTC (rev 966810)
@@ -0,0 +1,50 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=githash
+pkgname=haskell-githash
+pkgver=0.1.6.0
+pkgrel=4
+pkgdesc="Some handy Template Haskell splices for including the current git hash and branch in the code of your project"
+url="https://github.com/snoyberg/githash"
+license=('BSD')
+arch=('x86_64')
+depends=('ghc-libs' 'git')
+makedepends=('ghc' 'haskell-hpack' 'haskell-hspec' 'haskell-temporary' 'haskell-unliftio')
+source=("git+https://github.com/snoyberg/githash.git#tag=githash-$pkgver"
+ ghc9.patch)
+sha512sums=('SKIP'
+ 'a3ae967a52cb0e110310e6d13cbbf0275e145c1e437a59378a15e270ebe14569a6513e3a6cdfc0f24d1fdf40207a50584a73f8310db774720810264638054ea6')
+
+prepare() {
+ cd $_hkgname
+ patch -p1 -i ../ghc9.patch
+ hpack
+}
+
+build() {
+ cd $_hkgname
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
+ 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
+}
+
+check() {
+ cd $_hkgname
+ runhaskell Setup test --show-details=direct
+}
+
+package() {
+ cd $_hkgname
+
+ 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
+}
Copied: haskell-githash/repos/community-staging-x86_64/ghc9.patch (from rev 966809, haskell-githash/trunk/ghc9.patch)
===================================================================
--- community-staging-x86_64/ghc9.patch (rev 0)
+++ community-staging-x86_64/ghc9.patch 2021-06-22 07:03:42 UTC (rev 966810)
@@ -0,0 +1,69 @@
+commit 23bf04593610702813dd8f266aff218197c0506e
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Tue Jun 22 15:00:01 2021 +0800
+
+ Add support for template-haskell 2.17
+
+ Builds fine and all tests pass.
+
+diff --git a/package.yaml b/package.yaml
+index 6d211e4..293d19f 100644
+--- a/package.yaml
++++ b/package.yaml
+@@ -18,6 +18,7 @@ dependencies:
+ - directory
+ - filepath
+ - template-haskell
++- th-compat
+ - process
+
+ library:
+diff --git a/src/GitHash.hs b/src/GitHash.hs
+index 5167a91..d1beb5f 100644
+--- a/src/GitHash.hs
++++ b/src/GitHash.hs
+@@ -65,6 +65,7 @@ import qualified Data.ByteString.Char8 as B8
+ import Data.Typeable (Typeable)
+ import Language.Haskell.TH
+ import Language.Haskell.TH.Syntax
++import Language.Haskell.TH.Syntax.Compat
+ import System.Directory
+ import System.Exit
+ import System.FilePath
+@@ -256,8 +257,8 @@ instance Exception GitHashException
+ -- directory. Compilation fails if no info is available.
+ --
+ -- @since 0.1.0.0
+-tGitInfo :: FilePath -> Q (TExp GitInfo)
+-tGitInfo fp = unsafeTExpCoerce $ do
++tGitInfo :: FilePath -> SpliceQ GitInfo
++tGitInfo fp = unsafeSpliceCoerce $ do
+ gi <- runIO $
+ getGitRoot fp >>=
+ either throwIO return >>=
+@@ -270,8 +271,8 @@ tGitInfo fp = unsafeTExpCoerce $ do
+ -- directory.
+ --
+ -- @since 0.1.2.0
+-tGitInfoTry :: FilePath -> Q (TExp (Either String GitInfo))
+-tGitInfoTry fp = unsafeTExpCoerce $ do
++tGitInfoTry :: FilePath -> SpliceQ (Either String GitInfo)
++tGitInfoTry fp = unsafeSpliceCoerce $ do
+ egi <- runIO $ do
+ eroot <- getGitRoot fp
+ case eroot of
+@@ -290,12 +291,12 @@ tGitInfoTry fp = unsafeTExpCoerce $ do
+ -- working directory.
+ --
+ -- @since 0.1.0.0
+-tGitInfoCwd :: Q (TExp GitInfo)
++tGitInfoCwd :: SpliceQ GitInfo
+ tGitInfoCwd = tGitInfo "."
+
+ -- | Try to load up the 'GitInfo' value at compile time for the current
+ -- working directory.
+ --
+ -- @since 0.1.2.0
+-tGitInfoCwdTry :: Q (TExp (Either String GitInfo))
++tGitInfoCwdTry :: SpliceQ (Either String GitInfo)
+ tGitInfoCwdTry = tGitInfoTry "."
More information about the arch-commits
mailing list