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

Felix Yan felixonmars at archlinux.org
Wed May 29 16:33:08 UTC 2019


    Date: Wednesday, May 29, 2019 @ 16:33:08
  Author: felixonmars
Revision: 474391

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 474390, haskell-swagger2/trunk/PKGBUILD)
  haskell-swagger2/repos/community-staging-x86_64/generics-sop-0.5.patch
    (from rev 474390, haskell-swagger2/trunk/generics-sop-0.5.patch)

------------------------+
 PKGBUILD               |   57 +++++++++++++++++++++++++++++++++++++++++++++
 generics-sop-0.5.patch |   59 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+)

Copied: haskell-swagger2/repos/community-staging-x86_64/PKGBUILD (from rev 474390, haskell-swagger2/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2019-05-29 16:33:08 UTC (rev 474391)
@@ -0,0 +1,57 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=swagger2
+pkgname=haskell-swagger2
+pkgver=2.3.1.1
+pkgrel=36
+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"
+        generics-sop-0.5.patch)
+sha512sums=('1834e75cc6c8ff8287605e93d2b4d665b7d8de7e7e00f6537d25e0f54934c85e5431e5f2f1beb5264382c4b81f5ed19cc2b7af1f9323ebee9502e19d73d49fc1'
+            '8f1b74df57a090f5cb1cfb9551288dc6ade326c486ebb432767bfb1a0571ff1104269b19b4e2fbed8c5427cd432b3d0c1d18adb19f971b5fd441affbc88c27b6')
+
+prepare() {
+    cd $_hkgname-$pkgver
+    patch -p1 -i ../generics-sop-0.5.patch
+    sed -i -e 's/< *0.8/<1/' -e 's/< *2.13/<3/' $_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 474390, 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	2019-05-29 16:33:08 UTC (rev 474391)
@@ -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