Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-haskell/esqueleto/files/, dev-haskell/esqueleto/
Date: Thu, 16 Feb 2017 10:22:37
Message-Id: 1487240518.cc6d8b984c41b0a498fe1410d4c2e9a352680693.slyfox@gentoo
1 commit: cc6d8b984c41b0a498fe1410d4c2e9a352680693
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 16 08:47:00 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 16 10:21:58 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc6d8b98
7
8 dev-haskell/esqueleto: bump up to 2.4.3
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 dev-haskell/esqueleto/Manifest | 1 +
13 dev-haskell/esqueleto/esqueleto-2.4.3-r1.ebuild | 50 +++++++
14 .../files/esqueleto-2.4.3-persistent-2.5.patch | 165 +++++++++++++++++++++
15 3 files changed, 216 insertions(+)
16
17 diff --git a/dev-haskell/esqueleto/Manifest b/dev-haskell/esqueleto/Manifest
18 index 6cafb1e224..2f2ad18f46 100644
19 --- a/dev-haskell/esqueleto/Manifest
20 +++ b/dev-haskell/esqueleto/Manifest
21 @@ -1 +1,2 @@
22 DIST esqueleto-2.1.3.tar.gz 33024 SHA256 2d6da3477660212ed7cddec606d0324537b39ef24abe627ba389a0da500158f3 SHA512 b0508daec0f248458581155c731d307f039d04fae7e76697d2a8bb8498a5072b31499d1d3b041314b34b4034e4357e10323483d04f7ce3218da7489a00683fbc WHIRLPOOL aea8960ebe1ba214afe147db5db0e392b208525f5eeccc7c953a314c6000b684df5ccbd671ec23a698048f20af8bb212f3357db8743ac28f4b3cdb42723258a6
23 +DIST esqueleto-2.4.3.tar.gz 39664 SHA256 bf555cfb40519ed1573f7bb90c65f693b9639dfa93fc2222230d3ded6e897434 SHA512 50ad774bbd83c587775887320e24b329b575c9b3dad5aed920d83da7b8e5fa259624c38a40c457a3c12258e2b34cce39042c1b33002a06dcd3020bf370a06cbb WHIRLPOOL c1ef1d8414a2a68b48d291de302ed5fc63e96c88a2278bfd263890979debd365847dbe122915c1ce596a9c8b69a22ae244d0ae6a6228f661d0468526c1e2669b
24
25 diff --git a/dev-haskell/esqueleto/esqueleto-2.4.3-r1.ebuild b/dev-haskell/esqueleto/esqueleto-2.4.3-r1.ebuild
26 new file mode 100644
27 index 0000000000..31b8fcc5a1
28 --- /dev/null
29 +++ b/dev-haskell/esqueleto/esqueleto-2.4.3-r1.ebuild
30 @@ -0,0 +1,50 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=6
36 +
37 +# ebuild generated by hackport 0.4.7.9999
38 +#hackport: flags: -mysql,-postgresql
39 +
40 +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
41 +inherit haskell-cabal
42 +
43 +DESCRIPTION="Type-safe EDSL for SQL queries on persistent backends"
44 +HOMEPAGE="https://github.com/prowdsponsor/esqueleto"
45 +SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"
46 +
47 +LICENSE="BSD"
48 +SLOT="0/${PV}"
49 +KEYWORDS="~amd64 ~x86"
50 +IUSE=""
51 +
52 +RDEPEND="dev-haskell/blaze-html:=[profile?]
53 + >=dev-haskell/conduit-1.1:=[profile?]
54 + dev-haskell/monad-logger:=[profile?]
55 + >=dev-haskell/persistent-2.1.1.7:=[profile?]
56 + >=dev-haskell/resourcet-1.1:=[profile?]
57 + >=dev-haskell/tagged-0.2:=[profile?]
58 + >=dev-haskell/text-0.11:=[profile?] <dev-haskell/text-1.3:=[profile?]
59 + >=dev-haskell/transformers-0.2:=[profile?]
60 + >=dev-haskell/unordered-containers-0.2:=[profile?]
61 + >=dev-lang/ghc-7.4.1:=
62 +"
63 +DEPEND="${RDEPEND}
64 + >=dev-haskell/cabal-1.8
65 + test? ( >=dev-haskell/hspec-1.8
66 + dev-haskell/hunit
67 + dev-haskell/monad-control
68 + >=dev-haskell/monad-logger-0.3
69 + >=dev-haskell/persistent-sqlite-2.1
70 + >=dev-haskell/persistent-template-2.1
71 + dev-haskell/quickcheck )
72 +"
73 +
74 +PATCHES=("${FILESDIR}"/${P}-persistent-2.5.patch)
75 +
76 +src_configure() {
77 + haskell-cabal_src_configure \
78 + --flag=-mysql \
79 + --flag=-postgresql
80 +}
81
82 diff --git a/dev-haskell/esqueleto/files/esqueleto-2.4.3-persistent-2.5.patch b/dev-haskell/esqueleto/files/esqueleto-2.4.3-persistent-2.5.patch
83 new file mode 100644
84 index 0000000000..ebff5cb0bd
85 --- /dev/null
86 +++ b/dev-haskell/esqueleto/files/esqueleto-2.4.3-persistent-2.5.patch
87 @@ -0,0 +1,165 @@
88 +From 675018c54227ce5db4a91a153092d5f4d06f9af0 Mon Sep 17 00:00:00 2001
89 +From: Paul Rouse <pgr@×××××××.org>
90 +Date: Thu, 9 Jun 2016 20:25:34 +0100
91 +Subject: [PATCH 1/3] Changes for persistent-2.5
92 +
93 +---
94 + esqueleto.cabal | 2 +-
95 + src/Database/Esqueleto.hs | 8 ++++----
96 + src/Database/Esqueleto/Internal/Language.hs | 15 +++++----------
97 + src/Database/Esqueleto/Internal/PersistentImport.hs | 12 +++++++++++-
98 + test/Test.hs | 8 ++++----
99 + 5 files changed, 25 insertions(+), 20 deletions(-)
100 +
101 +diff --git a/esqueleto.cabal b/esqueleto.cabal
102 +index 65aa237..1768d2d 100644
103 +--- a/esqueleto.cabal
104 ++++ b/esqueleto.cabal
105 +@@ -66,7 +66,7 @@ library
106 + base >= 4.5 && < 4.9
107 + , bytestring
108 + , text >= 0.11 && < 1.3
109 +- , persistent >= 2.1.1.7 && < 2.3
110 ++ , persistent >= 2.1.1.7
111 + , transformers >= 0.2
112 + , unordered-containers >= 0.2
113 + , tagged >= 0.2
114 +diff --git a/src/Database/Esqueleto.hs b/src/Database/Esqueleto.hs
115 +index eb135c2..97e3211 100644
116 +--- a/src/Database/Esqueleto.hs
117 ++++ b/src/Database/Esqueleto.hs
118 +@@ -430,8 +430,8 @@ valJ = val . unValue
119 +
120 + -- | Synonym for 'Database.Persist.Store.delete' that does not
121 + -- clash with @esqueleto@'s 'delete'.
122 +-deleteKey :: ( PersistStore (PersistEntityBackend val)
123 +- , MonadIO m
124 +- , PersistEntity val )
125 +- => Key val -> ReaderT (PersistEntityBackend val) m ()
126 ++deleteKey :: ( PersistStore backend
127 ++ , PersistRecordBackend val backend
128 ++ , MonadIO m )
129 ++ => Key val -> ReaderT backend m ()
130 + deleteKey = Database.Persist.delete
131 +diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs
132 +index fbe88e2..ab18999 100644
133 +--- a/src/Database/Esqueleto/Internal/Language.hs
134 ++++ b/src/Database/Esqueleto/Internal/Language.hs
135 +@@ -74,13 +74,11 @@ class (Functor query, Applicative query, Monad query) =>
136 + -- In the end, 'fromFinish' is called to materialize the
137 + -- @JOIN@.
138 + fromStart
139 +- :: ( PersistEntity a
140 +- , PersistEntityBackend a ~ backend )
141 ++ :: PersistRecordBackend a backend
142 + => query (expr (PreprocessedFrom (expr (Entity a))))
143 + -- | (Internal) Same as 'fromStart', but entity may be missing.
144 + fromStartMaybe
145 +- :: ( PersistEntity a
146 +- , PersistEntityBackend a ~ backend )
147 ++ :: PersistRecordBackend a backend
148 + => query (expr (PreprocessedFrom (expr (Maybe (Entity a)))))
149 + -- | (Internal) Do a @JOIN@.
150 + fromJoin
151 +@@ -926,8 +924,7 @@ class ToBaseId ent where
152 + -- @
153 + -- person
154 + -- :: ( Esqueleto query expr backend
155 +--- , PersistEntity Person
156 +--- , PersistEntityBackend Person ~ backend
157 ++-- , PersistRecordBackend Person backend
158 + -- ) => expr (Entity Person)
159 + -- (person, blogPost)
160 + -- :: (...) => (expr (Entity Person), expr (Entity BlogPost))
161 +@@ -1054,14 +1051,12 @@ class Esqueleto query expr backend => FromPreprocess query expr backend a where
162 + fromPreprocess :: query (expr (PreprocessedFrom a))
163 +
164 + instance ( Esqueleto query expr backend
165 +- , PersistEntity val
166 +- , PersistEntityBackend val ~ backend
167 ++ , PersistRecordBackend val backend
168 + ) => FromPreprocess query expr backend (expr (Entity val)) where
169 + fromPreprocess = fromStart
170 +
171 + instance ( Esqueleto query expr backend
172 +- , PersistEntity val
173 +- , PersistEntityBackend val ~ backend
174 ++ , PersistRecordBackend val backend
175 + ) => FromPreprocess query expr backend (expr (Maybe (Entity val))) where
176 + fromPreprocess = fromStartMaybe
177 +
178 +diff --git a/src/Database/Esqueleto/Internal/PersistentImport.hs b/src/Database/Esqueleto/Internal/PersistentImport.hs
179 +index ad193e0..02fbd20 100644
180 +--- a/src/Database/Esqueleto/Internal/PersistentImport.hs
181 ++++ b/src/Database/Esqueleto/Internal/PersistentImport.hs
182 +@@ -1,7 +1,13 @@
183 ++{-# LANGUAGE CPP #-}
184 ++{-# LANGUAGE ConstraintKinds #-}
185 ++{-# LANGUAGE TypeFamilies #-}
186 + -- | Re-export "Database.Persist.Sql" without any clashes with
187 + -- @esqueleto@.
188 + module Database.Esqueleto.Internal.PersistentImport
189 + ( module Database.Persist.Sql
190 ++#if ! MIN_VERSION_persistent(2,5,0)
191 ++ , PersistRecordBackend
192 ++#endif
193 + ) where
194 +
195 + import Database.Persist.Sql hiding
196 +@@ -10,4 +16,8 @@ import Database.Persist.Sql hiding
197 + , selectKeysList, deleteCascadeWhere, (=.), (+=.), (-=.), (*=.), (/=.)
198 + , (==.), (!=.), (<.), (>.), (<=.), (>=.), (<-.), (/<-.), (||.)
199 + , listToJSON, mapToJSON, getPersistMap, limitOffsetOrder, selectSource
200 +- , update )
201 ++ , update, count )
202 ++
203 ++#if ! MIN_VERSION_persistent(2,5,0)
204 ++type PersistRecordBackend record backend = (PersistEntity record, PersistEntityBackend record ~ backend)
205 ++#endif
206 +diff --git a/test/Test.hs b/test/Test.hs
207 +index 80c6784..524bd7c 100644
208 +--- a/test/Test.hs
209 ++++ b/test/Test.hs
210 +@@ -1396,10 +1396,10 @@ main = do
211 +
212 +
213 + insert' :: ( Functor m
214 +- , PersistStore (PersistEntityBackend val)
215 +- , MonadIO m
216 +- , PersistEntity val )
217 +- => val -> ReaderT (PersistEntityBackend val) m (Entity val)
218 ++ , PersistStore backend
219 ++ , PersistRecordBackend val backend
220 ++ , MonadIO m )
221 ++ => val -> ReaderT backend m (Entity val)
222 + insert' v = flip Entity v <$> insert v
223 +
224 +
225 +--
226 +2.9.0
227 +
228 +From 4c9ecd94f2748be52c50c85ca8ed7314e21b9e82 Mon Sep 17 00:00:00 2001
229 +From: Paul Rouse <pgr@×××××××.org>
230 +Date: Thu, 9 Jun 2016 20:29:45 +0100
231 +Subject: [PATCH 2/3] Allow base-4.9 for GHC 8
232 +
233 +---
234 + esqueleto.cabal | 2 +-
235 + 1 file changed, 1 insertion(+), 1 deletion(-)
236 +
237 +diff --git a/esqueleto.cabal b/esqueleto.cabal
238 +index 1768d2d..3b9efb9 100644
239 +--- a/esqueleto.cabal
240 ++++ b/esqueleto.cabal
241 +@@ -63,7 +63,7 @@ library
242 + other-modules:
243 + Database.Esqueleto.Internal.PersistentImport
244 + build-depends:
245 +- base >= 4.5 && < 4.9
246 ++ base >= 4.5 && < 5
247 + , bytestring
248 + , text >= 0.11 && < 1.3
249 + , persistent >= 2.1.1.7 && < 2.6
250 +--
251 +2.9.0
252 +