dev-haskell/bytes: bump up to 0.15.5
[gentoo.git] / dev-haskell / hdbc / hdbc-2.3.1.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 # ebuild generated by hackport 0.3.1.9999
7
8 CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
9 inherit haskell-cabal versionator
10
11 MY_PN="HDBC"
12 MY_P="${MY_PN}-${PV}"
13
14 DESCRIPTION="Haskell Database Connectivity"
15 HOMEPAGE="https://github.com/hdbc/hdbc"
16 SRC_URI="https://hackage.haskell.org/package/${MY_P}/${MY_P}.tar.gz"
17
18 LICENSE="BSD"
19 SLOT="2/${PV}"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="mysql odbc postgres sqlite test"
22 RESTRICT="!test? ( test )"
23
24 RDEPEND=">=dev-haskell/convertible-1.0.10.0:=[profile?] <dev-haskell/convertible-1.1.0.0:=[profile?]
25                 dev-haskell/mtl:=[profile?]
26                 dev-haskell/text:=[profile?]
27                 dev-haskell/utf8-string:=[profile?]
28                 >=dev-lang/ghc-6.12.1:="
29 DEPEND="${RDEPEND}
30                 >=dev-haskell/cabal-1.8
31                 test? ( dev-haskell/hunit
32                         dev-haskell/quickcheck
33                         dev-haskell/testpack
34                 )
35         "
36
37 DEPENDV="$(get_version_component_range 1-2)"
38 PDEPEND="mysql? ( dev-haskell/hdbc-mysql )
39                 odbc? ( =dev-haskell/hdbc-odbc-${DEPENDV}* )
40                 postgres? ( =dev-haskell/hdbc-postgresql-${DEPENDV}* )
41                 sqlite? ( >=dev-haskell/hdbc-sqlite3-${DEPENDV} )"
42
43 S="${WORKDIR}/${MY_P}"
44
45 src_configure() {
46         cabal_src_configure $(cabal_flag test buildtests)
47 }
48
49 src_test() {
50         # default tests
51         haskell-cabal_src_test || die "cabal test failed"
52
53         # built custom tests
54         "${S}/dist/build/runtests/runtests" || die "unit tests failed"
55 }
56
57 src_install() {
58         cabal_src_install
59
60         # if tests were enabled, make sure the unit test driver is deleted
61         rm -f "${ED}/usr/bin/runtests"
62 }