Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (41 sloc) 1.37 KB
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# ebuild generated by hackport 0.2.11
EAPI=4
CABAL_FEATURES="bin"
inherit eutils haskell-cabal
MY_PN="BNFC"
MY_P="${MY_PN}-${PV}"
DESCRIPTION="A compiler front-end generator."
HOMEPAGE="http://www.cse.chalmers.se/research/group/Language-technology/BNFC/"
SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}
>=dev-haskell/cabal-1.2
dev-haskell/mtl
>=dev-lang/ghc-6.10.1"
S="${WORKDIR}/${MY_P}"
src_prepare() {
# get rid of haskell98 to be ghc-7.4 compatible
sed -i ${MY_PN}.cabal -e 's/haskell98,//' || die
local hs
find . -type f -name '*.hs' | while read hs; do
einfo "Mangling $hs"
sed -i "$hs"\
-e 's/^import \<Array\>/import Data.Array/g' \
-e 's/^import \<Directory\>/import System.Directory/g' \
-e 's/^import \<IO\>/import System.IO/g' \
-e 's/^import \<Maybe\>/import Data.Maybe/g' \
-e 's/^import \<Monad\>/import Control.Monad/g' \
-e 's/^import \<List\>/import Data.List/g' \
-e 's/^import \<Char\>/import Data.Char/g' \
-e 's/^import \<System\>\s*$/import System.Exit\nimport System.Environment\n/g' \
|| die
done
epatch "${FILESDIR}"/${P}-mangle-errors.patch # yes, built on top of mangled sources above
}
Something went wrong with that request. Please try again.