# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit flag-o-matic base eutils ghc-package MY_PN=HSQL DESCRIPTION="SQL binding for Haskell" HOMEPAGE="http://htoolkit.sourceforge.net/" SRC_URI="mirror://sourceforge/htoolkit/${MY_PN}-${PV}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~x86" IUSE="doc mysql sqlite postgres" DEPEND=">=virtual/ghc-6.2 mysql? ( >=dev-db/mysql-4.0.22 ) sqlite? ( =dev-db/sqlite-2.8* ) postgres? ( >=dev-db/postgresql-7.4.7 )" RDEPEND="" S=${WORKDIR}/${MY_PN} src_compile() { local myconf # We need to make the docs installation # Gentoo compliant. # Let's block the doc installation by "make install" sed -i "s/index.html//" ${S}/Makefile # We will register the package using the eclasses sed -i "/\$(GHC_PKG) -u -g -i hsql.pkg/d" ${S}/Makefile # This stuff is apparently broken # The dependency is still # masked for instance. # use odbc && myconf="${myconf} --enable-odbc" # We need to fetch a header file # from ${S} if use mysql; then myconf="--enable-mysql" CPPFLAGS="-I${S}/src/HSQL/" fi # We look for headers in the right place if use postgres; then myconf="${myconf} --enable-postgres" CPPFLAGS="${CPPFLAGS} -I/usr/include/postgresql/server/" fi # Enable sqlite use sqlite && myconf="${myconf} --enable-sqlite" ./configure \ ${myconf} CPPFLAGS="${CPPFLAGS}" || die "./configure failed" # Doesn't like parallelism emake -j1 || die "emake failed" } src_install() { # There is no other way around these # 5 lines? sed -i "s:/usr/local/lib/HSQL/Hugs/imports:$(ghc-libdir)/imports:" \ ${S}/hsql.pkg sed -i "s:/usr/local/lib/HSQL/Hugs:$(ghc-libdir):" \ ${S}/hsql.pkg ghc-setup-pkg ${S}/hsql.pkg make install \ GHC_DIR=${D}/$(ghc-libdir) \ || die "make failed" ghc-install-pkg fperms 0644 $(ghc-libdir)/libHSsql.a ghc-makeghcilib ${D}/$(ghc-libdir)/libHSsql.a if use doc; then make docs dohtml doc/* fi }