--- /dev/null
+--- Looptools/Makefile.am
++++ Looptools/Makefile.am
+@@ -1,58 +1,12 @@
+-noinst_LTLIBRARIES = libHwLooptoolsXFC.la libHwLooptoolsCFC.la
+-noinst_LTLIBRARIES += libHwLooptools.la
+-
+-EXTRA_DIST = include/lt.h include/ftypes.h include/ff.h include/ffwarn.h \
+- include/fferr.h include/defs.h include/looptools.h include/ffperm5.h \
+- include/clooptools.h include/cexternals.h include/externals.h \
+- util/solve-LU.F util/solve-LU.h util/solve-Eigen.F
+-
+-theXFCSOURCES = \
+-A/A0.F A/A00.F A/ffxa0.F A/ffca0.F B/Bget.F \
+-B/Bcoeff.F B/BcoeffC.F B/Bcoeffa.F B/Bcoeffb.F B/ffxb0.F \
+-B/ffcb0.F B/ffxb1.F B/ffcb1.F B/ffxb2p.F B/ffcb2p.F \
+-B/ffxdb0.F B/ffcdb0.F B/ffxdb1.F B/ffdel2.F B/ffcel2.F \
+-C/C0.F C/C0C.F C/Cget.F C/ffxc0.F C/ffcc0.F \
+-C/ffxc0i.F C/ffxc0p.F C/ffxc0p0.F C/ffcc0p.F C/ffdxc0.F \
+-C/ffdel3.F C/ffcel3.F D/D0.F D/D0C.F D/Dget.F \
+-D/ffxd0.F D/ffxd0h.F D/ffxd0i.F D/ffxd0p.F D/ffxd0m0.F \
+-D/ffxd0tra.F D/ffxdbd.F D/ffdcc0.F D/ffdel4.F D/ffd0c.F \
+-D/ffTn.F D/ffT13.F D/ffS2.F D/ffS3n.F D/ffRn.F \
+-E/E0.F E/Eget.F E/Ecoeffa.F E/Ecoeffb.F E/ffxe0.F \
+-E/ffdel5.F util/ini.F util/auxCD.F util/solve.F util/Dump.F \
+-util/Li2.F util/ffinit.F util/ffxli2.F util/ffcli2.F util/ffxxyz.F \
+-util/ffcxyz.F util/ffcrr.F util/ffcxr.F util/fftran.F util/ffabcd.F \
+-util/ff2dl2.F util/ffcxs3.F util/ffcxs4.F util/ffdcxs.F util/ffbndc.F
+-
+-## the following need -DCOMPLEXPARA
+-theCFCSOURCES = \
+-A/A0.F A/A00.F B/Bget.F B/Bcoeffa.F C/Cget.F D/Dget.F E/E0.F \
+-E/Eget.F E/Ecoeffa.F E/Ecoeffb.F util/solve.F util/Dump.F util/Li2.F
++noinst_LTLIBRARIES = libHwLooptools.la
+
+ commonCPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/include
+
+-libHwLooptoolsXFC_la_SOURCES = $(theXFCSOURCES)
+-libHwLooptoolsXFC_la_CPPFLAGS = $(commonCPPFLAGS)
+-libHwLooptoolsXFC_la_FCFLAGS = $(AM_FCFLAGS) -ffixed-line-length-none
+-libHwLooptoolsXFC_la_FFLAGS = $(AM_FFLAGS) -ffixed-line-length-none
+-
+-libHwLooptoolsCFC_la_SOURCES = $(theCFCSOURCES)
+-libHwLooptoolsCFC_la_CPPFLAGS = $(commonCPPFLAGS) -DCOMPLEXPARA
+-libHwLooptoolsCFC_la_FCFLAGS = $(AM_FCFLAGS) -ffixed-line-length-none
+-libHwLooptoolsCFC_la_FFLAGS = $(AM_FFLAGS) -ffixed-line-length-none
+-
+-## installed already from "include/Makefile.am"
+-## noinst_HEADERS = include/clooptools.h
+-
+-##if NEED_APPLE_FIXES
+-##libHwLooptoolsXFC_la_LDFLAGS = -Wl,-single_module
+-##libHwLooptoolsCFC_la_LDFLAGS = -Wl,-single_module
+-##endif
+-
+-libHwLooptools_la_SOURCES = util/cache.c clooptools.cc
++libHwLooptools_la_SOURCES = clooptools.cc
+ libHwLooptools_la_CXXFLAGS = $(AM_CXXFLAGS) -Wno-strict-aliasing
+ libHwLooptools_la_CPPFLAGS = $(commonCPPFLAGS)
+ libHwLooptools_la_CFLAGS = $(AM_CFLAGS) -std=c99
+-libHwLooptools_la_LIBADD = libHwLooptoolsXFC.la libHwLooptoolsCFC.la
++libHwLooptools_la_LIBADD = -looptools
+
+
+ ## libHwLooptoolsHelper2_la_SOURCES = clooptools.cc
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils eutils flag-o-matic multilib
+
+MYP=Herwig++-${PV}
+
+DESCRIPTION="High-Energy Physics event generator"
+HOMEPAGE="http://herwig.hepforge.org/"
+SRC_URI="http://www.hepforge.org/archive/herwig/${MYP}.tar.bz2"
+
+LICENSE="GPL-2"
+
+SLOT="0/15"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="c++11 fastjet static-libs"
+
+# >sci-physics/looptools-2.8 leads to misoperation
+# and failing tests (it lacks some symbols)
+RDEPEND="
+ dev-libs/boost:0=
+ sci-libs/gsl:0=
+ <=sci-physics/looptools-2.8:0=
+ >=sci-physics/thepeg-1.9.2:0=
+ fastjet? ( sci-physics/fastjet:0= )"
+DEPEND="${RDEPEND}
+ virtual/fortran"
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.6.3-looptools.patch
+ find -name 'Makefile.am' -exec \
+ sed -i -e '1ipkgdatadir=$(datadir)/herwig++' {} \; || die
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use prefix && \
+ append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/ThePEG
+ local myeconfargs=(
+ --with-boost="${EPREFIX}"/usr
+ --with-thepeg="${EPREFIX}"/usr
+ $(use_enable c++11 stdcxx11)
+ $(use_with fastjet fastjet "${EPREFIX}"/usr)
+ )
+ autotools-utils_src_configure
+}
+
+pkg_preinst () {
+ sed -i -e "s|${ED}||g" "${ED}"/usr/share/herwig++/defaults/PDF.in || die
+ sed -i -e "s|${ED}||g" "${ED}"/usr/share/herwig++/HerwigDefaults.rpo || die
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<maintainer>
+ <email>jauhien@gentoo.org</email>
+</maintainer>
+<longdescription>
+ Herwig++ is a completely new event generator, written in C++.
+ It is built on the experience gained with the well-known
+ event generator HERWIG. The aim is to provide a multi purpose
+ event generator with similar or improved capabilities (like angular
+ ordered parton evolution and the cluster hadronization model).
+</longdescription>
+<use>
+ <flag name='c++11'>Build Herwig++ using the C++11 standard.
+ Experimental feature, not for production use.</flag>
+ <flag name='fastjet'>Adds support for <pkg>sci-physics/fastjet</pkg></flag>
+</use>
+</pkgmetadata>