[arch-commits] Commit in haskell-hackage-db/repos (3 files)

Felix Yan felixonmars at archlinux.org
Thu May 27 05:00:59 UTC 2021


    Date: Thursday, May 27, 2021 @ 05:00:58
  Author: felixonmars
Revision: 948047

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-hackage-db/repos/community-staging-x86_64/
  haskell-hackage-db/repos/community-staging-x86_64/PKGBUILD
    (from rev 948046, haskell-hackage-db/trunk/PKGBUILD)
  haskell-hackage-db/repos/community-staging-x86_64/fix-parsing-of-preferred-version-ranges.patch
    (from rev 948046, haskell-hackage-db/trunk/fix-parsing-of-preferred-version-ranges.patch)

-----------------------------------------------+
 PKGBUILD                                      |   48 ++++++++++++++++++
 fix-parsing-of-preferred-version-ranges.patch |   63 ++++++++++++++++++++++++
 2 files changed, 111 insertions(+)

Copied: haskell-hackage-db/repos/community-staging-x86_64/PKGBUILD (from rev 948046, haskell-hackage-db/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-05-27 05:00:58 UTC (rev 948047)
@@ -0,0 +1,48 @@
+# Maintainer: berberman <hatsue at typed.icu>
+
+_hkgname=hackage-db
+pkgname=haskell-hackage-db
+pkgver=2.1.1
+pkgrel=8
+pkgdesc="Access cabal-install's Hackage database via Data.Map"
+url="https://github.com/peti/hackage-db#readme"
+license=("BSD")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-aeson' 'haskell-tar' 'haskell-utf8-string')
+makedepends=('ghc')
+source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
+        fix-parsing-of-preferred-version-ranges.patch)
+sha512sums=('fada91ffbad436148bfe14c7b44fd2a8682fac6d4ccedd3a86ae49767f1604e723e42b0d712f0edae2797e19c15a80ab6fb4d6e9902ee4125af02b38f3bdbe32'
+            '3987e08584360fe8d28ada30e5424df8406e4783c05787bf6bebac8fc572ef7ddebc959b3877471c6482d8dc2de24b2628410521ce8a0926c0d765d84b785b15')
+
+prepare() {
+  cd $_hkgname-$pkgver
+  # https://github.com/peti/hackage-db/pull/13
+  patch -p1 -i ../fix-parsing-of-preferred-version-ranges.patch
+}
+
+build() {
+  cd $_hkgname-$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'
+
+  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"
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Copied: haskell-hackage-db/repos/community-staging-x86_64/fix-parsing-of-preferred-version-ranges.patch (from rev 948046, haskell-hackage-db/trunk/fix-parsing-of-preferred-version-ranges.patch)
===================================================================
--- community-staging-x86_64/fix-parsing-of-preferred-version-ranges.patch	                        (rev 0)
+++ community-staging-x86_64/fix-parsing-of-preferred-version-ranges.patch	2021-05-27 05:00:58 UTC (rev 948047)
@@ -0,0 +1,63 @@
+From 4c2efcda723aa7afd8d687a39e704000791e924b Mon Sep 17 00:00:00 2001
+From: Kevin Quick <kquick at galois.com>
+Date: Tue, 11 May 2021 23:49:15 -0700
+Subject: [PATCH 1/2] Fix parsing of preferred version ranges.
+
+The preferred version range starts with the name of the current
+package; this name must be removed to allow a valid parse as a
+VersionRange.
+
+Prior to this change:
+$ cabal run show-package-versions containers
+show-package-versions: HackageDBPackageName (PackageName "containers") (InvalidRepresentationOfType "preferred version range" "containers <0.5.8.1 || >0.5.8.1 && <0.5.9.1 || >0.5.9.1")
+
+After this change:
+$ cabal run show-package-versions containers
+containers: 0.1.0.0 0.1.0.1 0.2.0.0 0.2.0.1 0.3.0.0 0.4.0.0 0.4.1.0 0.4.2.0 0.4.2.1 0.5.0.0 0.5.1.0 0.5.2.0 0.5.2.1 0.5.3.0 0.5.3.1 0.5.4.0 0.5.5.0 0.5.5.1 0.5.6.0 0.5.6.1 0.5.6.2 0.5.6.3 0.5.7.0 0.5.7.1 0.5.8.2 0.5.9.2 0.5.10.1 0.5.10.2 0.5.11.0 0.6.0.1 0.6.1.1 0.6.2.1 0.6.3.1 0.6.4.1
+---
+ src/Distribution/Hackage/DB/Parsed.hs | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/Distribution/Hackage/DB/Parsed.hs b/src/Distribution/Hackage/DB/Parsed.hs
+index a73863d..8056228 100644
+--- a/src/Distribution/Hackage/DB/Parsed.hs
++++ b/src/Distribution/Hackage/DB/Parsed.hs
+@@ -55,7 +55,14 @@ parsePackageData pn (U.PackageData pv vs') =
+       Map.filterWithKey (\v _ -> v `withinRange` vr) vs'
+   where
+     vr | BSS.null pv = anyVersion
+-       | otherwise = parseText "preferred version range" (toString pv)
++       | otherwise = parseText "preferred version range"
++                     (toString $
++                      -- pv is something like: "containers <0.5.8.1 || >0.5.8.1".
++                      -- The first word should match pn and should be removed to
++                      -- allow parseText to parse the VersionRange; this is
++                      -- simply done by dropping the first word (non-space chars)
++                      BSS.dropWhile (/= toEnum 32) $  -- 32 = ASCII space
++                      pv)
+ 
+ parseVersionData :: PackageName -> Version -> U.VersionData -> VersionData
+ parseVersionData pn v (U.VersionData cf m) =
+
+From a5dd906dee5075950294f53c3bcc9a2fa675fed1 Mon Sep 17 00:00:00 2001
+From: Kevin Quick <kquick at galois.com>
+Date: Wed, 12 May 2021 08:28:23 -0700
+Subject: [PATCH 2/2] Change required by hlint.
+
+---
+ src/Distribution/Hackage/DB/Parsed.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Distribution/Hackage/DB/Parsed.hs b/src/Distribution/Hackage/DB/Parsed.hs
+index 8056228..19768ae 100644
+--- a/src/Distribution/Hackage/DB/Parsed.hs
++++ b/src/Distribution/Hackage/DB/Parsed.hs
+@@ -61,7 +61,7 @@ parsePackageData pn (U.PackageData pv vs') =
+                       -- The first word should match pn and should be removed to
+                       -- allow parseText to parse the VersionRange; this is
+                       -- simply done by dropping the first word (non-space chars)
+-                      BSS.dropWhile (/= toEnum 32) $  -- 32 = ASCII space
++                      BSS.dropWhile (/= toEnum 32)   -- 32 = ASCII space
+                       pv)
+ 
+ parseVersionData :: PackageName -> Version -> U.VersionData -> VersionData



More information about the arch-commits mailing list