# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-util/bnfc/bnfc-2.4.2.0.ebuild,v 1.3 2012/09/12 16:08:04 qnikst Exp $ # 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 \/import Data.Array/g' \ -e 's/^import \/import System.Directory/g' \ -e 's/^import \/import System.IO/g' \ -e 's/^import \/import Data.Maybe/g' \ -e 's/^import \/import Control.Monad/g' \ -e 's/^import \/import Data.List/g' \ -e 's/^import \/import Data.Char/g' \ -e 's/^import \\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 }