[arch-commits] Commit in haskell-swagger2/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Sat Mar 7 13:28:09 UTC 2020
Date: Saturday, March 7, 2020 @ 13:28:09
Author: felixonmars
Revision: 591121
archrelease: copy trunk to community-staging-x86_64
Added:
haskell-swagger2/repos/community-staging-x86_64/
haskell-swagger2/repos/community-staging-x86_64/PKGBUILD
(from rev 591120, haskell-swagger2/trunk/PKGBUILD)
haskell-swagger2/repos/community-staging-x86_64/generics-sop-0.5.patch
(from rev 591120, haskell-swagger2/trunk/generics-sop-0.5.patch)
------------------------+
PKGBUILD | 54 +++++++++++++++++++++++++++++++++++++++++++
generics-sop-0.5.patch | 59 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+)
Copied: haskell-swagger2/repos/community-staging-x86_64/PKGBUILD (from rev 591120, haskell-swagger2/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2020-03-07 13:28:09 UTC (rev 591121)
@@ -0,0 +1,54 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=swagger2
+pkgname=haskell-swagger2
+pkgver=2.4
+pkgrel=9
+pkgdesc="Swagger 2.0 data model"
+url="https://github.com/GetShopTV/swagger2"
+license=("BSD")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-aeson' 'haskell-base-compat-batteries' 'haskell-cookie'
+ 'haskell-hashable' 'haskell-generics-sop' 'haskell-http-media'
+ 'haskell-insert-ordered-containers' 'haskell-lens' 'haskell-network' 'haskell-quickcheck'
+ 'haskell-scientific' 'haskell-transformers-compat' 'haskell-unordered-containers'
+ 'haskell-vector' 'haskell-uuid-types')
+makedepends=('ghc' 'haskell-hspec' 'haskell-hunit' 'haskell-quickcheck-instances'
+ 'haskell-hspec-discover' 'haskell-doctest' 'haskell-cabal-doctest' 'haskell-glob'
+ 'haskell-utf8-string')
+source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
+sha512sums=('49608aa6d7e52629dc6e0ca811ad1847117bc5ee9af144e49ea8b5c2f23126c058aa749b70aa5f5f7205eeb382b8e5637974a716ca3f752e7eb66753fa22d42e')
+
+prepare() {
+ cd $_hkgname-$pkgver
+ sed -i -e 's/< *0/<1/' -e 's/< *2/<3/' -e 's/< *4/<5/' $_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 --enable-tests \
+ --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 $_hkgname-$pkgver
+ runhaskell Setup test
+}
+
+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-swagger2/repos/community-staging-x86_64/generics-sop-0.5.patch (from rev 591120, haskell-swagger2/trunk/generics-sop-0.5.patch)
===================================================================
--- community-staging-x86_64/generics-sop-0.5.patch (rev 0)
+++ community-staging-x86_64/generics-sop-0.5.patch 2020-03-07 13:28:09 UTC (rev 591121)
@@ -0,0 +1,59 @@
+commit 96420ab204b6079eef1331faecf80fa73476c206
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Fri May 17 03:19:47 2019 +0800
+
+ Fix compatibility with generics-sop 0.5
+
+diff --git a/src/Data/Swagger/Internal/AesonUtils.hs b/src/Data/Swagger/Internal/AesonUtils.hs
+index c1280f0..c785e76 100644
+--- a/src/Data/Swagger/Internal/AesonUtils.hs
++++ b/src/Data/Swagger/Internal/AesonUtils.hs
+@@ -144,7 +144,11 @@ sopSwaggerGenericToJSON'
+ -> DatatypeInfo '[xs]
+ -> POP Maybe '[xs]
+ -> [Pair]
++#if MIN_VERSION_generics_sop(0,5,0)
++sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
++#else
+ sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
++#endif
+ sopSwaggerGenericToJSON'' opts fields fieldsInfo defs
+ sopSwaggerGenericToJSON' _ _ _ _ = error "sopSwaggerGenericToJSON: unsupported type"
+
+@@ -220,7 +224,11 @@ sopSwaggerGenericParseJSON'
+ -> DatatypeInfo '[xs]
+ -> POP Maybe '[xs]
+ -> Parser (SOP I '[xs])
++#if MIN_VERSION_generics_sop(0,5,0)
++sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
++#else
+ sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
++#endif
+ SOP . Z <$> sopSwaggerGenericParseJSON'' opts obj fieldsInfo defs
+ sopSwaggerGenericParseJSON' _ _ _ _ = error "sopSwaggerGenericParseJSON: unsupported type"
+
+@@ -292,7 +300,11 @@ sopSwaggerGenericToEncoding'
+ -> DatatypeInfo '[xs]
+ -> POP Maybe '[xs]
+ -> Series
++#if MIN_VERSION_generics_sop(0,5,0)
++sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
++#else
+ sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
++#endif
+ sopSwaggerGenericToEncoding'' opts fields fieldsInfo defs
+ sopSwaggerGenericToEncoding' _ _ _ _ = error "sopSwaggerGenericToEncoding: unsupported type"
+
+diff --git a/swagger2.cabal b/swagger2.cabal
+index a338669..2154705 100644
+--- a/swagger2.cabal
++++ b/swagger2.cabal
+@@ -77,7 +77,7 @@ library
+ , aeson >=1.4.2.0 && <1.5
+ -- cookie 0.4.3 is needed by GHC 7.8 due to time>=1.4 constraint
+ , cookie >=0.4.3 && <0.5
+- , generics-sop >=0.3.2.0 && <0.5
++ , generics-sop >=0.3.2.0 && <0.6
+ , hashable >=1.2.7.0 && <1.3
+ , http-media >=0.7.1.2 && <0.9
+ , insert-ordered-containers >=0.2.1.0 && <0.3
More information about the arch-commits
mailing list