# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="3" inherit elisp-common multilib eutils flag-o-matic java-pkg-opt-2 MY_P=${PN}${PV/_p/-} MY_P=${MY_P/_alpha/-alpha} MY_P=${MY_P/_beta/-beta} BGL_RELEASE=${PV/_*/} DESCRIPTION="Bigloo is a Scheme implementation." HOMEPAGE="http://www-sop.inria.fr/indes/fp/Bigloo/bigloo.html" SRC_URI="ftp://ftp-sop.inria.fr/indes/fp/Bigloo/${MY_P}.tar.gz" SLOT="0" LICENSE="GPL-2" KEYWORDS="~amd64 ~x86" # bug 254916 for >=dev-libs/boehm-gc-7.1 RDEPEND=">=dev-libs/boehm-gc-7.1[threads?] emacs? ( virtual/emacs ) sqlite? ( dev-db/sqlite:3 ) ssl? ( dev-libs/openssl ) gstreamer? ( media-libs/gstreamer media-libs/gst-plugins-base )" DEPEND="${RDEPEND} java? ( >=virtual/jdk-1.5 app-arch/zip )" RDEPEND="${RDEPEND} java? ( >=virtual/jre-1.5 )" S=${WORKDIR}/${MY_P} PATCHPREFIX="${FILESDIR}/${PN}-${BGL_RELEASE}" SITEFILE="50bigloo-gentoo.el" IUSE="calendar crypto debug doc emacs gstreamer java mail multimedia packrat sqlite srfi1 srfi27 ssl text threads web" src_prepare() { epatch "${PATCHPREFIX}-no_strip.patch" epatch "${PATCHPREFIX}-fix_APIs_test_invocation.patch" # Removing bundled boehm-gc rm -rf gc || die } src_configure() { filter-flags -fomit-frame-pointer local myconf="--bee=$(if use emacs; then echo full; else echo partial; fi)" # Need to fix sqlite support. Bigloo comes with its own implementation # of sqlite called sqltiny which is build if no system sqlite is found. # Using --enable-sqlite will built one or the other depending on system. # Thus, the USE is only for deps. BUT, if the user passes USE="-sqlite", # and if dev-db/sqlite is merged, bigloo will be compiled against. myconf="${myconf} --enable-sqlite" # Need fix for bglpkg, which depends on pkglib, pkgcomp, sqlite and web. # This cannot be disabled for now, working on a fix. myconf="${myconf} --enable-pkgcomp --enable-pkglib --enable-web" myconf="${myconf} $(use_enable calendar)" myconf="${myconf} $(use_enable crypto)" myconf="${myconf} $(use_enable mail)" myconf="${myconf} $(use_enable threads fthread)" myconf="${myconf} $(use_enable threads pthread)" # gstreamer extension requires multimedia and pthreads if use gstreamer; then if ! use multimedia; then einfo "Enabling multimedia since it's needed by gstreamer" fi if ! use threads; then eerror "You must enable threads in order to build gstreamer support" die fi myconf="${myconf} --enable-multimedia --enable-gstreamer" else myconf="${myconf} $(use_enable gstreamer)" myconf="${myconf} $(use_enable multimedia)" fi myconf="${myconf} $(use_enable packrat)" if use x86; then myconf="${myconf} $(use_enable srfi27)" else myconf="${myconf} --disable-srfi27" use srfi27 && \ ewarn "srfi27 is known not to work on non 32-bit architecture. Disabled" fi myconf="${myconf} $(use_enable srfi1)" myconf="${myconf} $(use_enable ssl)" myconf="${myconf} $(use_enable text)" # Bigloo doesn't use autoconf and consequently a lot of options used by econf give errors # Manuel Serrano says: "Please, dont talk to me about autoconf. I simply dont want to hear about it..." ./configure \ $(use java && echo "--jvm=yes --java=$(java-config --java) --javac=$(java-config --javac)") \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/$(get_libdir) \ --docdir=/usr/share/doc/${PF} \ --lispdir="${SITELISP}/${PN}" \ --benchmark=yes \ --sharedbde=no \ --sharedcompiler=no \ --customgc=no \ --coflags="" \ --ldflags="${LDFLAGS}" \ --strip=no \ $(use debug && echo "--debug") \ ${myconf} \ || die "configure failed" } src_compile() { emake || die "emake failed" if use emacs; then einfo "Compiling bee..." emake -j1 compile-bee || die "compiling bee failed" fi } # default thinks that target doesn't exist src_test() { emake -j1 test || die } src_install() { # Makefile:671:install: install-progs install-docs emake DESTDIR="${D}" install-progs || die "install failed" if use emacs; then einfo "Installing bee..." emake DESTDIR="${D}" install-bee || die "install-bee failed" elisp-site-file-install "${FILESDIR}/${SITEFILE}" fi if use doc; then # Bogus target... does not install files in the good directories #emake DESTDIR="${D}" install-docs || die "install-docs failed" dohtml -r manuals/ || die "dohtml failed" doinfo manuals/*.info* for man in manuals/*.man; do man1=${man#manuals/} newman ${man} ${man1/.man/.1} done fi dodoc ChangeLog README || die "dodoc failed" newdoc LICENSE COPYING # Maybe not needed.... hard to see why this file is needed, # dev-scheme/hop does not seem to use it #dosed /usr/$(get_libdir)/${PN}/${BGL_RELEASE}/Makefile.config } pkg_postinst() { use emacs && elisp-site-regen if use emacs && ! use minimal; then elog "In order to use the bee-mode, add" elog " (require 'bmacs)" elog "to your ~/.emacs file" fi } pkg_postrm() { use emacs && elisp-site-regen }