summaryrefslogtreecommitdiff
blob: 3b9d8ea1b3153e5144c7813c378817e85304b50e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hdbc-sqlite/hdbc-sqlite-1.1.3.0.ebuild,v 1.3 2010/07/24 18:18:43 slyfox Exp $

CABAL_FEATURES="lib profile haddock"
inherit haskell-cabal versionator

MY_PN=HDBC-sqlite3
MY_P=${MY_PN}-${PV}

DESCRIPTION="Sqlite v3 database driver for HDBC"
HOMEPAGE="http://software.complete.org/hdbc-sqlite3"
SRC_URI="http://hackage.haskell.org/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE=""

hdbc_PV=$(get_version_component_range 1-3)

DEPEND=">=dev-lang/ghc-6.4.1
		dev-haskell/mtl
		=dev-haskell/hdbc-${hdbc_PV}*
		>=dev-db/sqlite-3.2"

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}

	cp "${FILESDIR}/hdbc-sqlite3-helper.h" "${S}/"
	sed -i -e 's/GHC-Options: -O2 -Wall/GHC-Options: -fvia-C/' \
		-e '/^Extensions:/a \
		, ForeignFunctionInterface, EmptyDataDecls' \
		"${S}/${MY_PN}.cabal"

	if version_is_at_least "6.8" "$(ghc-version)"; then
		sed -i -e '/Build-Depends:/a \
			, bytestring' \
		"${S}/${MY_PN}.cabal"
		echo "GHC-Options: -XPatternSignatures" >> "${S}/${MY_PN}.cabal"
	fi
}

CABAL_CONFIGURE_FLAGS="--constraint=base<4"