# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit autotools elisp-common java-pkg-opt-2 MYP=ThePEG-${PV} DESCRIPTION="Toolkit for High Energy Physics Event Generation" HOMEPAGE="http://home.thep.lu.se/ThePEG/" SRC_URI="http://www.hepforge.org/archive/thepeg/${MYP}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="emacs hepmc java lhapdf test zlib" DEPEND="sci-libs/gsl dev-lang/perl emacs? ( virtual/emacs ) hepmc? ( sci-physics/hepmc ) java? ( >=virtual/jre-1.5 ) lhapdf? ( sci-physics/lhapdf ) zlib? ( sys-libs/zlib ) " RDEPEND="${DEPEND} test? ( sys-process/time )" S="${WORKDIR}/${MYP}" pkg_setup() { echo elog "There is an extra option on package Rivet not yet in Gentoo:" elog "You can use the env variable EXTRA_ECONF variable for this:" elog "EXTRA_ECONF=\"--with-rivet=DIR\"" elog "where DIR - location of Rivet installation" echo java-pkg-opt-2_pkg_setup } src_unpack() { unpack ${A} if use lhapdf && use test; then LHAPDFV=`best_version sci-physics/lhapdf | sed 's/.*-\(.*\)/\1/'` wget http://www.hepforge.org/archive/lhapdf/pdfsets/${LHAPDFV}/cteq6ll.LHpdf wget http://www.hepforge.org/archive/lhapdf/pdfsets/${LHAPDFV}/cteq5l.LHgrid wget http://www.hepforge.org/archive/lhapdf/pdfsets/${LHAPDFV}/GRV98nlo.LHgrid wget http://www.hepforge.org/archive/lhapdf/pdfsets/${LHAPDFV}/MRST2001nlo.LHgrid fi } src_prepare() { find -name 'Makefile.am' | xargs sed -i '1ipkgdatadir=$(datadir)/thepeg' \ || die "changing pkgdatadir name failed" sed -i '/dist_pkgdata_DATA = ThePEG.el/d' lib/Makefile.am \ || die "preventing install ThePEG.el in pkgdatadir failed" epatch "${FILESDIR}"/${P}-java.patch eautoreconf java-pkg-opt-2_src_prepare } src_configure() { econf \ --disable-silent-rules \ $(use_with hepmc hepmc "${EPREFIX}"/usr) \ $(use_with java javagui) \ $(use_with lhapdf LHAPDF "${EPREFIX}"/usr) \ $(use_with zlib zlib "${EPREFIX}"/usr) } src_compile() { emake use emacs && elisp-compile lib/ThePEG.el || die } src_test() { emake LHAPATH="${WORKDIR}" check } src_install() { emake DESTDIR="${D}" install use emacs && elisp-install ${PN} lib/ThePEG.el lib/ThePEG.elc || die use java && java-pkg_newjar java/ThePEG.jar }