summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-physics
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-physics')
-rw-r--r--sci-physics/bullet/Manifest4
-rw-r--r--sci-physics/bullet/bullet-2.80.ebuild63
-rw-r--r--sci-physics/bullet/bullet-2.81.ebuild64
-rw-r--r--sci-physics/bullet/bullet-2.82.ebuild64
-rw-r--r--sci-physics/bullet/bullet-2.83.4.ebuild63
-rw-r--r--sci-physics/bullet/files/bullet-2.77-gcc46.patch47
-rw-r--r--sci-physics/bullet/files/bullet-2.77-libdir.patch24
-rw-r--r--sci-physics/bullet/files/bullet-2.77-soversion.patch36
-rw-r--r--sci-physics/bullet/files/bullet-2.78-soversion.patch44
-rw-r--r--sci-physics/bullet/metadata.xml19
-rw-r--r--sci-physics/cernlib-montecarlo/Manifest3
-rw-r--r--sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r3.ebuild89
-rw-r--r--sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r4.ebuild89
-rw-r--r--sci-physics/cernlib-montecarlo/files/cernlib-montecarlo-2006-noherwig.patch52
-rw-r--r--sci-physics/cernlib-montecarlo/metadata.xml16
-rw-r--r--sci-physics/cernlib/Manifest3
-rw-r--r--sci-physics/cernlib/cernlib-2006-r5.ebuild108
-rw-r--r--sci-physics/cernlib/cernlib-2006-r6.ebuild107
-rw-r--r--sci-physics/cernlib/files/cernlib-2006-fgets.patch20
-rw-r--r--sci-physics/cernlib/files/cernlib-2006-nogfortran.patch56
-rw-r--r--sci-physics/cernlib/files/cernlib-2006-ypatchy-short-name.patch11
-rw-r--r--sci-physics/cernlib/metadata.xml14
-rw-r--r--sci-physics/clhep/Manifest8
-rw-r--r--sci-physics/clhep/clhep-2.0.4.6.ebuild49
-rw-r--r--sci-physics/clhep/clhep-2.1.0.1.ebuild53
-rw-r--r--sci-physics/clhep/clhep-2.1.2.4.ebuild56
-rw-r--r--sci-physics/clhep/clhep-2.1.3.1.ebuild55
-rw-r--r--sci-physics/clhep/clhep-2.1.4.1.ebuild54
-rw-r--r--sci-physics/clhep/clhep-2.1.4.2.ebuild54
-rw-r--r--sci-physics/clhep/clhep-2.2.0.1.ebuild54
-rw-r--r--sci-physics/clhep/clhep-2.2.0.5.ebuild54
-rw-r--r--sci-physics/clhep/files/clhep-2.1.2.3-libdir.patch93
-rw-r--r--sci-physics/clhep/files/clhep-2.1.2.4-libdir.patch87
-rw-r--r--sci-physics/clhep/files/clhep-2.1.2.4-lsb-whitespace.patch32
-rw-r--r--sci-physics/clhep/metadata.xml13
-rw-r--r--sci-physics/espresso++/Manifest2
-rw-r--r--sci-physics/espresso++/espresso++-1.9.2.ebuild50
-rw-r--r--sci-physics/espresso++/espresso++-1.9.3.ebuild46
-rw-r--r--sci-physics/espresso++/files/espresso++-1.6.0-multilib.patch65
-rw-r--r--sci-physics/espresso++/metadata.xml9
-rw-r--r--sci-physics/espresso/Manifest1
-rw-r--r--sci-physics/espresso/espresso-3.3.0.ebuild136
-rw-r--r--sci-physics/espresso/files/espresso-3.3.0-cython-0.22.patch23
-rw-r--r--sci-physics/espresso/metadata.xml14
-rw-r--r--sci-physics/fastjet/Manifest2
-rw-r--r--sci-physics/fastjet/fastjet-3.0.3-r1.ebuild55
-rw-r--r--sci-physics/fastjet/fastjet-3.0.6-r1.ebuild55
-rw-r--r--sci-physics/fastjet/files/fastjet-3.0.3-system-siscone.patch83
-rw-r--r--sci-physics/fastjet/files/fastjet-3.0.6-system-siscone.patch74
-rw-r--r--sci-physics/fastjet/metadata.xml18
-rw-r--r--sci-physics/geant-data/Manifest20
-rw-r--r--sci-physics/geant-data/geant-data-4.10.00.ebuild57
-rw-r--r--sci-physics/geant-data/geant-data-4.10.01.ebuild57
-rw-r--r--sci-physics/geant-data/geant-data-4.9.6_p02.ebuild58
-rw-r--r--sci-physics/geant-data/metadata.xml9
-rw-r--r--sci-physics/geant-python/Manifest2
-rw-r--r--sci-physics/geant-python/files/geant-python-4.10.0-config.patch27
-rw-r--r--sci-physics/geant-python/files/geant-python-4.10.0-polycone.patch15
-rw-r--r--sci-physics/geant-python/files/geant-python-4.9.5-visverbose.patch13
-rw-r--r--sci-physics/geant-python/geant-python-4.10.00.ebuild122
-rw-r--r--sci-physics/geant-python/geant-python-4.9.6_p02.ebuild120
-rw-r--r--sci-physics/geant-python/metadata.xml8
-rw-r--r--sci-physics/geant/Manifest17
-rw-r--r--sci-physics/geant/files/geant-4.10.0-TrackingNavigator.patch60
-rw-r--r--sci-physics/geant/files/geant-4.10.0-no-examples.patch22
-rw-r--r--sci-physics/geant/files/geant-4.9.4-datadir.patch43
-rw-r--r--sci-physics/geant/files/geant-4.9.4-libdir.patch35
-rw-r--r--sci-physics/geant/files/geant-4.9.4-no-benchmarks.patch10
-rw-r--r--sci-physics/geant/files/geant-4.9.4-no-examples.patch15
-rw-r--r--sci-physics/geant/files/geant-4.9.4-trajectory.patch11
-rw-r--r--sci-physics/geant/files/geant-4.9.4-zlib.patch35
-rw-r--r--sci-physics/geant/geant-3.21.14-r2.ebuild71
-rw-r--r--sci-physics/geant/geant-3.21.14-r3.ebuild70
-rw-r--r--sci-physics/geant/geant-3.21.14-r4.ebuild68
-rw-r--r--sci-physics/geant/geant-4.10.00.ebuild89
-rw-r--r--sci-physics/geant/geant-4.10.00_p01.ebuild86
-rw-r--r--sci-physics/geant/geant-4.10.01.ebuild87
-rw-r--r--sci-physics/geant/geant-4.9.4_p03.ebuild86
-rw-r--r--sci-physics/geant/geant-4.9.6_p02-r1.ebuild86
-rw-r--r--sci-physics/geant/metadata.xml25
-rw-r--r--sci-physics/h2o-gtk/Manifest1
-rw-r--r--sci-physics/h2o-gtk/h2o-gtk-0.1.ebuild21
-rw-r--r--sci-physics/h2o-gtk/h2o-gtk-9999.ebuild33
-rw-r--r--sci-physics/h2o-gtk/metadata.xml16
-rw-r--r--sci-physics/harminv/Manifest1
-rw-r--r--sci-physics/harminv/files/harminv-1.3.1-configure.ac.patch31
-rw-r--r--sci-physics/harminv/harminv-1.3.1.ebuild32
-rw-r--r--sci-physics/harminv/metadata.xml12
-rw-r--r--sci-physics/hepmc/Manifest3
-rw-r--r--sci-physics/hepmc/files/hepmc-2.06.04-gcc46.patch28
-rw-r--r--sci-physics/hepmc/hepmc-2.06.03.ebuild64
-rw-r--r--sci-physics/hepmc/hepmc-2.06.08.ebuild87
-rw-r--r--sci-physics/hepmc/hepmc-2.06.09-r1.ebuild93
-rw-r--r--sci-physics/hepmc/metadata.xml25
-rw-r--r--sci-physics/heppdt/Manifest1
-rw-r--r--sci-physics/heppdt/heppdt-3.04.01.ebuild50
-rw-r--r--sci-physics/heppdt/metadata.xml14
-rw-r--r--sci-physics/herwig/Manifest6
-rw-r--r--sci-physics/herwig/herwig-6.5.10.ebuild62
-rw-r--r--sci-physics/herwig/herwig-6.5.21.ebuild66
-rw-r--r--sci-physics/herwig/metadata.xml9
-rw-r--r--sci-physics/hoomd-blue/Manifest1
-rw-r--r--sci-physics/hoomd-blue/hoomd-blue-1.0.2.ebuild61
-rw-r--r--sci-physics/hoomd-blue/metadata.xml12
-rw-r--r--sci-physics/jaxodraw/Manifest2
-rw-r--r--sci-physics/jaxodraw/jaxodraw-2.0.1-r1.ebuild65
-rw-r--r--sci-physics/jaxodraw/metadata.xml8
-rw-r--r--sci-physics/lammps/Manifest10
-rw-r--r--sci-physics/lammps/files/lammps-python3.patch11
-rw-r--r--sci-physics/lammps/files/python-shebang.patch7
-rw-r--r--sci-physics/lammps/lammps-20150210.ebuild206
-rw-r--r--sci-physics/lammps/lammps-20150416.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150418.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150428.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150430.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150515.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150718.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150721.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150722.ebuild267
-rw-r--r--sci-physics/lammps/lammps-20150724.ebuild267
-rw-r--r--sci-physics/lammps/metadata.xml28
-rw-r--r--sci-physics/lhapdf/Manifest8
-rw-r--r--sci-physics/lhapdf/lhapdf-5.8.4.ebuild94
-rw-r--r--sci-physics/lhapdf/lhapdf-6.1.5.ebuild68
-rw-r--r--sci-physics/lhapdf/metadata.xml21
-rw-r--r--sci-physics/lightspeed/Manifest3
-rw-r--r--sci-physics/lightspeed/files/lightspeed-1.2a-autoconf.patch16
-rw-r--r--sci-physics/lightspeed/files/lightspeed-1.2a-libpng15.patch19
-rw-r--r--sci-physics/lightspeed/lightspeed-1.2a-r1.ebuild81
-rw-r--r--sci-physics/lightspeed/metadata.xml16
-rw-r--r--sci-physics/meep/Manifest2
-rw-r--r--sci-physics/meep/files/meep-1.2-no-auto-mpb.patch16
-rw-r--r--sci-physics/meep/files/meep-1.2-pc-no-ldflags.patch12
-rw-r--r--sci-physics/meep/meep-1.1.1.ebuild46
-rw-r--r--sci-physics/meep/meep-1.2.ebuild60
-rw-r--r--sci-physics/meep/metadata.xml14
-rw-r--r--sci-physics/metadata.xml16
-rw-r--r--sci-physics/mpb/Manifest1
-rw-r--r--sci-physics/mpb/files/mpb-1.4.2-autotools.patch262
-rw-r--r--sci-physics/mpb/files/mpb-1.4.2-guile18.patch12
-rw-r--r--sci-physics/mpb/files/mpb-1.4.2-headers.patch11
-rw-r--r--sci-physics/mpb/metadata.xml20
-rw-r--r--sci-physics/mpb/mpb-1.4.2-r2.ebuild127
-rw-r--r--sci-physics/paw/Manifest3
-rw-r--r--sci-physics/paw/files/paw-2.14.04-glibc-2.10.patch11
-rw-r--r--sci-physics/paw/metadata.xml15
-rw-r--r--sci-physics/paw/paw-2.14.04-r4.ebuild72
-rw-r--r--sci-physics/paw/paw-2.14.04-r5.ebuild72
-rw-r--r--sci-physics/pythia/Manifest13
-rw-r--r--sci-physics/pythia/files/pythia8209-root-noninteractive.patch17
-rw-r--r--sci-physics/pythia/files/pythia8209-run-tests.patch20
-rw-r--r--sci-physics/pythia/metadata.xml22
-rw-r--r--sci-physics/pythia/pythia-6.4.28.ebuild68
-rw-r--r--sci-physics/pythia/pythia-8.1.86-r1.ebuild101
-rw-r--r--sci-physics/pythia/pythia-8.1.86.ebuild101
-rw-r--r--sci-physics/pythia/pythia-8.2.10.ebuild184
-rw-r--r--sci-physics/reduze/Manifest1
-rw-r--r--sci-physics/reduze/metadata.xml12
-rw-r--r--sci-physics/reduze/reduze-2.0.9.ebuild66
-rw-r--r--sci-physics/root/Manifest10
-rw-r--r--sci-physics/root/files/proofd.confd12
-rw-r--r--sci-physics/root/files/proofd.initd26
-rw-r--r--sci-physics/root/files/root-5.28.00b-asneeded.patch20
-rw-r--r--sci-physics/root/files/root-5.28.00b-glibc212.patch11
-rw-r--r--sci-physics/root/files/root-5.28.00b-prop-ldflags.patch13
-rw-r--r--sci-physics/root/files/root-5.28.00b-unuran.patch39
-rw-r--r--sci-physics/root/files/root-5.32.00-afs.patch33
-rw-r--r--sci-physics/root/files/root-5.32.00-cfitsio.patch13
-rw-r--r--sci-physics/root/files/root-5.32.00-chklib64.patch24
-rw-r--r--sci-physics/root/files/root-5.32.00-dotfont.patch58
-rw-r--r--sci-physics/root/files/root-5.32.00-explicit-functions.patch18
-rw-r--r--sci-physics/root/files/root-5.32.00-htmldoc.patch12
-rw-r--r--sci-physics/root/files/root-5.32.00-nobyte-compile.patch137
-rw-r--r--sci-physics/root/files/root-5.34.05-nobyte-compile.patch137
-rw-r--r--sci-physics/root/files/root-5.34.13-desktop.patch12
-rw-r--r--sci-physics/root/files/root-5.34.13-unuran.patch40
-rw-r--r--sci-physics/root/files/root-5.34.26-ldflags.patch19
-rw-r--r--sci-physics/root/files/root-6.00.01-dotfont.patch58
-rw-r--r--sci-physics/root/files/root-6.00.01-geocad.patch15
-rw-r--r--sci-physics/root/files/root-6.00.01-llvm.patch13
-rw-r--r--sci-physics/root/files/root-6.00.01-nobyte-compile.patch33
-rw-r--r--sci-physics/root/files/root-6.00.01-prop-flags.patch17
-rw-r--r--sci-physics/root/files/root-6.02.05-xrootd4.patch11
-rw-r--r--sci-physics/root/files/rootd.confd8
-rw-r--r--sci-physics/root/files/rootd.initd28
-rw-r--r--sci-physics/root/metadata.xml35
-rw-r--r--sci-physics/root/root-5.32.03-r2.ebuild378
-rw-r--r--sci-physics/root/root-5.34.26.ebuild453
-rw-r--r--sci-physics/root/root-5.34.32.ebuild437
-rw-r--r--sci-physics/root/root-6.02.05-r2.ebuild486
-rw-r--r--sci-physics/sassena/Manifest1
-rw-r--r--sci-physics/sassena/files/sassena-1.4.1-libs.patch51
-rw-r--r--sci-physics/sassena/metadata.xml9
-rw-r--r--sci-physics/sassena/sassena-1.4.1.ebuild34
-rw-r--r--sci-physics/siscone/Manifest1
-rw-r--r--sci-physics/siscone/metadata.xml10
-rw-r--r--sci-physics/siscone/siscone-2.0.6.ebuild29
-rw-r--r--sci-physics/xfoil/Manifest2
-rw-r--r--sci-physics/xfoil/files/xfoil-6.96-gfortran.patch29
-rw-r--r--sci-physics/xfoil/files/xfoil-6.97-overflow.patch22
-rw-r--r--sci-physics/xfoil/metadata.xml18
-rw-r--r--sci-physics/xfoil/xfoil-6.97.ebuild71
202 files changed, 11770 insertions, 0 deletions
diff --git a/sci-physics/bullet/Manifest b/sci-physics/bullet/Manifest
new file mode 100644
index 000000000000..659ad7796d26
--- /dev/null
+++ b/sci-physics/bullet/Manifest
@@ -0,0 +1,4 @@
+DIST bullet-2.80-rev2531.tgz 9561231 SHA256 464e2d79e3c5a5bdcad597ef6fca26d4244ad83628d8663e03be7c89d0342f36 SHA512 ca61182b20f692a0163aa230d6025b0dc1863ecdd5f6f3c80589a41997464a347ef1b1ab4923a2136a68d5b42ff864e98a9aa00da8bc493a1339bf309a876cca WHIRLPOOL 3186449ffea858b33cf606bee3c27e15dda4fb945d21d75b4ad4dfdf849181526bef06e0d3b35fc51b27815d229472a9b95f85b108b79315c251811105e0755a
+DIST bullet-2.81-rev2613.tgz 8297547 SHA256 8ac9079803a6f793801727ccddb0b98becea3efe92fd6590cf38b9cb8bbc1eed SHA512 5f77d4ea123bca06a390e27f5028d67b1f328c65d16711448cca885bc66de37bdef3024397603140e28e8fe68679cc596aa9a4ee617fc2a913f23d4c5c0f52a3 WHIRLPOOL 91894b76cb3cd4239f91305860cf78152c323df05c4b1d77bb8564cd2badb8a7e811f8dcf7e10f9b04db5345787b3c2cb0163d0ef9c77aa716e69307a235873a
+DIST bullet-2.82-r2704.tgz 7937108 SHA256 67e4c9eb76f7adf99501d726d8ad5e9b525dfd0843fbce9ca73aaca4ba9eced2 SHA512 44bec0bd74e6d9cd8c75a41d0faa068dc05f0cdad92ff001cc53ff29912db245606827a9e763ce2cf1b551b545668a779fdc4455f73c1901b57aaa4eee31901f WHIRLPOOL 181c6bf35ba28333f66fba52faff2e7bfc634a702df4c9925123160d89058602e354e9c21a82c86fc166fab55254a70739e37220d28968a989ed94a52a6f7e39
+DIST bullet-2.83.4.tar.gz 17529283 SHA256 2cf287cead9a116c56f6d6f15f73dc8b3ed1fe407ef2ca894027d585fab07341 SHA512 1a10a11671bd152835a45d44a1b3214e29c255338405705f2aaa41adfbdb545ec02f09b94003b836fafcc2b59b836e5b749696a5bb3489ec7050af0d02d9b2e1 WHIRLPOOL 7a472291128888fdd1c96e232b91d734ff10c2b6cf6ff0563bd3e6fa4c113112fe3f169dc0e42fee56aacf66b6717a10901f0c61c618a6c691bf1eb3cbcefbf2
diff --git a/sci-physics/bullet/bullet-2.80.ebuild b/sci-physics/bullet/bullet-2.80.ebuild
new file mode 100644
index 000000000000..ef97ddf709bc
--- /dev/null
+++ b/sci-physics/bullet/bullet-2.80.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils cmake-utils
+
+# version release, check http://code.google.com/p/bullet/downloads/list
+MYP=${P}-rev2531
+
+DESCRIPTION="Continuous Collision Detection and Physics Library"
+HOMEPAGE="http://www.bulletphysics.com/"
+SRC_URI="http://bullet.googlecode.com/files/${MYP}.tgz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="amd64 ~ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc double-precision examples extras"
+
+RDEPEND="virtual/opengl
+ media-libs/freeglut"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.78-soversion.patch )
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ # allow to generate docs
+ sed -i -e 's/GENERATE_HTMLHELP.*//g' Doxyfile || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_CPU_DEMOS=OFF
+ -DBUILD_DEMOS=OFF
+ -DUSE_GRAPHICAL_BENCHMARK=OFF
+ -DINSTALL_LIBS=ON
+ -DINSTALL_EXTRA_LIBS=ON
+ $(cmake-utils_use_build extras EXTRAS)
+ $(cmake-utils_use_use double-precision DOUBLE_PRECISION)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc *.pdf && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r Extras Demos
+ fi
+}
diff --git a/sci-physics/bullet/bullet-2.81.ebuild b/sci-physics/bullet/bullet-2.81.ebuild
new file mode 100644
index 000000000000..a094785a735c
--- /dev/null
+++ b/sci-physics/bullet/bullet-2.81.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils cmake-utils
+
+# version release, check http://code.google.com/p/bullet/downloads/list
+MYP=${P}-rev2613
+
+DESCRIPTION="Continuous Collision Detection and Physics Library"
+HOMEPAGE="http://www.bulletphysics.com/"
+SRC_URI="http://bullet.googlecode.com/files/${MYP}.tgz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc double-precision examples extras"
+
+RDEPEND="
+ virtual/opengl
+ media-libs/freeglut"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.78-soversion.patch )
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ # allow to generate docs
+ sed -i -e 's/GENERATE_HTMLHELP.*//g' Doxyfile || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_CPU_DEMOS=OFF
+ -DBUILD_DEMOS=OFF
+ -DUSE_GRAPHICAL_BENCHMARK=OFF
+ -DINSTALL_LIBS=ON
+ -DINSTALL_EXTRA_LIBS=ON
+ $(cmake-utils_use_build extras EXTRAS)
+ $(cmake-utils_use_use double-precision DOUBLE_PRECISION)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc *.pdf && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r Extras Demos
+ fi
+}
diff --git a/sci-physics/bullet/bullet-2.82.ebuild b/sci-physics/bullet/bullet-2.82.ebuild
new file mode 100644
index 000000000000..4f4c049f98ba
--- /dev/null
+++ b/sci-physics/bullet/bullet-2.82.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils cmake-utils
+
+# version release, check http://code.google.com/p/bullet/downloads/list
+MYP=${P}-r2704
+
+DESCRIPTION="Continuous Collision Detection and Physics Library"
+HOMEPAGE="http://www.bulletphysics.com/"
+SRC_URI="http://bullet.googlecode.com/files/${MYP}.tgz"
+
+LICENSE="ZLIB"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc double-precision examples extras"
+
+RDEPEND="
+ virtual/opengl
+ media-libs/freeglut"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.78-soversion.patch )
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ # allow to generate docs
+ sed -i -e 's/GENERATE_HTMLHELP.*//g' Doxyfile || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_CPU_DEMOS=OFF
+ -DBUILD_DEMOS=OFF
+ -DUSE_GRAPHICAL_BENCHMARK=OFF
+ -DINSTALL_LIBS=ON
+ -DINSTALL_EXTRA_LIBS=ON
+ $(cmake-utils_use_build extras EXTRAS)
+ $(cmake-utils_use_use double-precision DOUBLE_PRECISION)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc *.pdf && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r Extras Demos
+ fi
+}
diff --git a/sci-physics/bullet/bullet-2.83.4.ebuild b/sci-physics/bullet/bullet-2.83.4.ebuild
new file mode 100644
index 000000000000..c714c7226a8d
--- /dev/null
+++ b/sci-physics/bullet/bullet-2.83.4.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils cmake-utils
+
+DESCRIPTION="Continuous Collision Detection and Physics Library"
+HOMEPAGE="http://www.bulletphysics.com/"
+SRC_URI="https://github.com/bulletphysics/bullet3/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+bullet3 doc double-precision examples extras"
+
+RDEPEND="
+ virtual/opengl
+ media-libs/freeglut"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.78-soversion.patch )
+
+S="${WORKDIR}/${PN}3-${PV}"
+
+src_prepare() {
+ # allow to generate docs
+ sed -i -e 's/GENERATE_HTMLHELP.*//g' Doxyfile || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_CPU_DEMOS=OFF
+ -DBUILD_OPENGL3_DEMOS=OFF
+ -DBUILD_BULLET2_DEMOS=OFF
+ -DUSE_GRAPHICAL_BENCHMARK=OFF
+ -DINSTALL_LIBS=ON
+ -DINSTALL_EXTRA_LIBS=ON
+ $(cmake-utils_use_build bullet3 BULLET3)
+ $(cmake-utils_use_build extras EXTRAS)
+ $(cmake-utils_use_use double-precision DOUBLE_PRECISION)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc docs/*.pdf && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r Extras examples
+ fi
+}
diff --git a/sci-physics/bullet/files/bullet-2.77-gcc46.patch b/sci-physics/bullet/files/bullet-2.77-gcc46.patch
new file mode 100644
index 000000000000..9ef054836e33
--- /dev/null
+++ b/sci-physics/bullet/files/bullet-2.77-gcc46.patch
@@ -0,0 +1,47 @@
+ src/BulletSoftBody/btSoftBody.h | 3 +++
+ src/BulletSoftBody/btSoftBodyInternals.h | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/BulletSoftBody/btSoftBody.h b/src/BulletSoftBody/btSoftBody.h
+index 4d975b7..f781598 100644
+--- a/src/BulletSoftBody/btSoftBody.h
++++ b/src/BulletSoftBody/btSoftBody.h
+@@ -30,6 +30,7 @@ subject to the following restrictions:
+ class btBroadphaseInterface;
+ class btDispatcher;
+
++class btSoftBodySolver;
+
+ /* btSoftBodyWorldInfo */
+ struct btSoftBodyWorldInfo
+@@ -52,6 +53,8 @@ class btSoftBody : public btCollisionObject
+ public:
+ btAlignedObjectArray<class btCollisionObject*> m_collisionDisabledObjects;
+
++ // The solver object that handles this soft body
++ btSoftBodySolver *m_softBodySolver;
+ //
+ // Enumerations
+ //
+diff --git a/src/BulletSoftBody/btSoftBodyInternals.h b/src/BulletSoftBody/btSoftBodyInternals.h
+index 2cb7744..296d97a 100644
+--- a/src/BulletSoftBody/btSoftBodyInternals.h
++++ b/src/BulletSoftBody/btSoftBodyInternals.h
+@@ -26,6 +26,7 @@ subject to the following restrictions:
+ #include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
+ #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
+
++#include <string.h> //for memset
+ //
+ // btSymMatrix
+ //
+@@ -172,8 +173,7 @@ public:
+ template <typename T>
+ static inline void ZeroInitialize(T& value)
+ {
+- static const T zerodummy;
+- value=zerodummy;
++ memset(&value,0,sizeof(T));
+ }
+ //
+ template <typename T>
diff --git a/sci-physics/bullet/files/bullet-2.77-libdir.patch b/sci-physics/bullet/files/bullet-2.77-libdir.patch
new file mode 100644
index 000000000000..9575addbb58c
--- /dev/null
+++ b/sci-physics/bullet/files/bullet-2.77-libdir.patch
@@ -0,0 +1,24 @@
+diff -up bullet-2.77/src/BulletMultiThreaded/CMakeLists.txt.lib bullet-2.77/src/BulletMultiThreaded/CMakeLists.txt
+--- bullet-2.77/src/BulletMultiThreaded/CMakeLists.txt.lib 2010-10-08 12:45:59.000000000 +0200
++++ bullet-2.77/src/BulletMultiThreaded/CMakeLists.txt 2010-10-08 12:46:26.000000000 +0200
+@@ -84,7 +84,7 @@ IF (INSTALL_LIBS)
+ IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ INSTALL(TARGETS BulletMultiThreaded DESTINATION .)
+ ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+- INSTALL(TARGETS BulletMultiThreaded DESTINATION lib)
++ INSTALL(TARGETS BulletMultiThreaded DESTINATION lib${LIB_SUFFIX})
+ INSTALL(DIRECTORY
+ ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING
+ PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
+diff -up bullet-2.77/src/MiniCL/CMakeLists.txt.lib bullet-2.77/src/MiniCL/CMakeLists.txt
+--- bullet-2.77/src/MiniCL/CMakeLists.txt.lib 2010-10-08 12:44:50.000000000 +0200
++++ bullet-2.77/src/MiniCL/CMakeLists.txt 2010-10-08 12:46:42.000000000 +0200
+@@ -32,7 +32,7 @@ IF (INSTALL_LIBS)
+ IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ INSTALL(TARGETS MiniCL DESTINATION .)
+ ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+- INSTALL(TARGETS MiniCL DESTINATION lib)
++ INSTALL(TARGETS MiniCL DESTINATION lib${LIB_SUFFIX})
+ INSTALL(DIRECTORY
+ ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING
+ PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
diff --git a/sci-physics/bullet/files/bullet-2.77-soversion.patch b/sci-physics/bullet/files/bullet-2.77-soversion.patch
new file mode 100644
index 000000000000..6086640790ac
--- /dev/null
+++ b/sci-physics/bullet/files/bullet-2.77-soversion.patch
@@ -0,0 +1,36 @@
+diff -up bullet-2.77/Extras/glui/CMakeLists.txt.extras-version bullet-2.77/Extras/glui/CMakeLists.txt
+--- bullet-2.77/Extras/glui/CMakeLists.txt.extras-version 2010-03-06 16:23:36.000000000 +0100
++++ bullet-2.77/Extras/glui/CMakeLists.txt 2010-07-26 12:09:01.000000000 +0200
+@@ -61,6 +61,8 @@ arcball.cpp glui_button.cpp glui_fil
+
+ )
+
++SET_TARGET_PROPERTIES(GLUI PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(GLUI PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(GLUI ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
+ ENDIF (BUILD_SHARED_LIBS)
+diff -up bullet-2.77/Extras/Serialize/BulletFileLoader/CMakeLists.txt.extras-version bullet-2.77/Extras/Serialize/BulletFileLoader/CMakeLists.txt
+--- bullet-2.77/Extras/Serialize/BulletFileLoader/CMakeLists.txt.extras-version 2010-07-26 12:10:36.000000000 +0200
++++ bullet-2.77/Extras/Serialize/BulletFileLoader/CMakeLists.txt 2010-07-26 12:10:57.000000000 +0200
+@@ -16,6 +16,8 @@ btBulletFile.cpp
+ btBulletFile.h
+ )
+
++SET_TARGET_PROPERTIES(BulletFileLoader PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(BulletFileLoader PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(BulletFileLoader LinearMath)
+ ENDIF (BUILD_SHARED_LIBS)
+diff -up bullet-2.77/Extras/Serialize/BulletWorldImporter/CMakeLists.txt.extras-version bullet-2.77/Extras/Serialize/BulletWorldImporter/CMakeLists.txt
+--- bullet-2.77/Extras/Serialize/BulletWorldImporter/CMakeLists.txt.extras-version 2010-07-26 12:11:08.000000000 +0200
++++ bullet-2.77/Extras/Serialize/BulletWorldImporter/CMakeLists.txt 2010-07-26 12:11:26.000000000 +0200
+@@ -9,6 +9,8 @@ btBulletWorldImporter.cpp
+ btBulletWorldImporter.h
+ )
+
++SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(BulletWorldImporter BulletDynamics BulletCollision BulletFileLoader LinearMath)
+ ENDIF (BUILD_SHARED_LIBS)
diff --git a/sci-physics/bullet/files/bullet-2.78-soversion.patch b/sci-physics/bullet/files/bullet-2.78-soversion.patch
new file mode 100644
index 000000000000..b54ffa777ee3
--- /dev/null
+++ b/sci-physics/bullet/files/bullet-2.78-soversion.patch
@@ -0,0 +1,44 @@
+ Extras/Serialize/BulletFileLoader/CMakeLists.txt | 2 ++
+ .../Serialize/BulletWorldImporter/CMakeLists.txt | 2 ++
+ Extras/glui/CMakeLists.txt | 2 ++
+ 3 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/Extras/Serialize/BulletFileLoader/CMakeLists.txt b/Extras/Serialize/BulletFileLoader/CMakeLists.txt
+index 486cfdc..f1e0884 100644
+--- a/Extras/Serialize/BulletFileLoader/CMakeLists.txt
++++ b/Extras/Serialize/BulletFileLoader/CMakeLists.txt
+@@ -16,6 +16,8 @@ btBulletFile.cpp
+ btBulletFile.h
+ )
+
++SET_TARGET_PROPERTIES(BulletFileLoader PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(BulletFileLoader PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(BulletFileLoader LinearMath)
+ ENDIF (BUILD_SHARED_LIBS)
+diff --git a/Extras/Serialize/BulletWorldImporter/CMakeLists.txt b/Extras/Serialize/BulletWorldImporter/CMakeLists.txt
+index e620315..e04e8e9 100644
+--- a/Extras/Serialize/BulletWorldImporter/CMakeLists.txt
++++ b/Extras/Serialize/BulletWorldImporter/CMakeLists.txt
+@@ -9,6 +9,8 @@ btBulletWorldImporter.cpp
+ btBulletWorldImporter.h
+ )
+
++SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(BulletWorldImporter PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(BulletWorldImporter BulletDynamics BulletCollision BulletFileLoader LinearMath)
+ ENDIF (BUILD_SHARED_LIBS)
+diff --git a/Extras/glui/CMakeLists.txt b/Extras/glui/CMakeLists.txt
+index c2018a7..9a8d90f 100644
+--- a/Extras/glui/CMakeLists.txt
++++ b/Extras/glui/CMakeLists.txt
+@@ -61,6 +61,8 @@ arcball.cpp glui_button.cpp glui_filebrowser.cpp glui_node.cpp glui_separ
+
+ )
+
++SET_TARGET_PROPERTIES(GLUI PROPERTIES VERSION ${BULLET_VERSION})
++SET_TARGET_PROPERTIES(GLUI PROPERTIES SOVERSION ${BULLET_VERSION})
+ IF (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(GLUI ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
+ ENDIF (BUILD_SHARED_LIBS)
diff --git a/sci-physics/bullet/metadata.xml b/sci-physics/bullet/metadata.xml
new file mode 100644
index 000000000000..6c25c6b5e58a
--- /dev/null
+++ b/sci-physics/bullet/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ Bullet is a professional open source multi-threaded
+ 3D Collision Detection and Rigid Body Dynamics Library
+ for games and animation.
+</longdescription>
+ <use>
+ <flag name="bullet3">Build Bullet 3</flag>
+ <flag name="double-precision">Build libraries in double precision</flag>
+ <flag name="extras">Build additional libraries</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">bullet</remote-id>
+ <remote-id type="github">bulletphysics/bullet3</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-physics/cernlib-montecarlo/Manifest b/sci-physics/cernlib-montecarlo/Manifest
new file mode 100644
index 000000000000..d177b5c31a61
--- /dev/null
+++ b/sci-physics/cernlib-montecarlo/Manifest
@@ -0,0 +1,3 @@
+DIST mclibs_20061220+dfsg3-1.debian.tar.gz 46362 SHA256 17a9f61860237b963bc4b6240296add2bbe45cf16ce994061c3f20c33994cf73 SHA512 ddb31fd218f0f051155548011415d9526e7866ec7caf7041a5f572d8064cb4f19c188724e839f445a47f490dacf0d67ef9ba871725756892e0ba1d569d575fe3 WHIRLPOOL c8db51ed7e1e78ffcdca96af3aeb388391473acc796b35af838fa60cb3129816e787dce325c8ac8be411d98ec2d1392959df97dd560ccae172c230ce2c342676
+DIST mclibs_20061220+dfsg3-3.debian.tar.gz 44763 SHA256 9796094d6b27a07a342c8f7572cae40b8717e13d04c8b1acb4b337901cb0c5af SHA512 2ef3c54026e86182200d4d7fce1889a2dd8c252743d0819e74679e2a5067794bea574530b59a7f08c394f8b75f7d31cac31f638fb72045700b379bd686a8f92f WHIRLPOOL 515ba362e11897c02cbbcecd25340ca7aba87c608b537103b38afe2fb65f0d1f7fcdd025d2fe4d835f488580608f53c1c606751996fe0e7fb55fb828c2d35997
+DIST mclibs_20061220+dfsg3.orig.tar.gz 7642494 SHA256 cb5ea19bc54a06c031c90192685748ce0f7df016bfae6b9d7d672d77a3444ce5 SHA512 add98b585648994ab616d040e9a3410b0eba13ab54a812674d3940bae0effed4446b02ce6a34887841c114bc444b1b83598e2c89c22b4df8dcd3fd4c1d8aaba3 WHIRLPOOL cee4c265ae610bbc1b2a48fdc6d769848bf936c78862a298725e5ac11fc2620a18b748dcd41e8b7622cf369c2a43f9641cc67e5f902a88e2f083f7b7587a1771
diff --git a/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r3.ebuild b/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r3.ebuild
new file mode 100644
index 000000000000..f24179997a38
--- /dev/null
+++ b/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r3.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 toolchain-funcs
+
+DEB_PN=mclibs
+DEB_PV=20061220+dfsg3
+DEB_PR=1
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="Monte-carlo library and tools for the cernlib"
+HOMEPAGE="https://cernlib.web.cern.ch/cernlib/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+IUSE="+herwig"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ x11-libs/motif:0
+ dev-lang/cfortran
+ sci-physics/cernlib
+ herwig? ( !sci-physics/herwig )"
+
+DEPEND="${RDEPEND}
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ mv ../debian . || die
+ cp debian/add-ons/Makefile . || die
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ Makefile || die
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+ use herwig || epatch "${FILESDIR}"/${P}-noherwig.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+ # respect users flags
+ sed -i \
+ -e 's/-O3/-O2/g' \
+ -e "s/-O2/${CFLAGS}/g" \
+ -e "s|\(CcCmd[[:space:]]*\)gcc|\1$(tc-getCC)|g" \
+ -e "s|\(CplusplusCmd[[:space:]]*\)g++|\1$(tc-getCXX)|g" \
+ -e "s|\(FortranCmd[[:space:]]*\)gfortran|\1$(tc-getFC)|g" \
+ src/config/linux.cf \
+ || die "sed linux.cf failed"
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+
+ sed -i \
+ -e 's/\$(FCLINK)/\$(FCLINK) $(LDFLAGS)/' \
+ -e 's/\$(CCLINK)/\$(CCLINK) $(LDFLAGS)/' \
+ src/config/{biglib,fortran,Imake}.rules \
+ || die "sed for ldflags propagation failed"
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test() {
+ LD_LIBRARY_PATH="${S}"/shlib \
+ emake -j1 cernlib-test
+}
+
+src_install() {
+ export VARTEXFONTS="${T}"/fonts
+ emake DESTDIR="${D}" MCDOC="${ED}usr/share/doc/${PF}" install
+ cd debian
+ dodoc changelog README.* deadpool.txt copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r4.ebuild b/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r4.ebuild
new file mode 100644
index 000000000000..47893126ffb8
--- /dev/null
+++ b/sci-physics/cernlib-montecarlo/cernlib-montecarlo-2006-r4.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 toolchain-funcs
+
+DEB_PN=mclibs
+DEB_PV=20061220+dfsg3
+DEB_PR=3
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="Monte-carlo library and tools for the cernlib"
+HOMEPAGE="https://cernlib.web.cern.ch/cernlib/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+IUSE="+herwig"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ x11-libs/motif:0
+ dev-lang/cfortran
+ sci-physics/cernlib
+ herwig? ( !sci-physics/herwig )"
+
+DEPEND="${RDEPEND}
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ mv ../debian . || die
+ cp debian/add-ons/Makefile . || die
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ Makefile || die
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+ use herwig || epatch "${FILESDIR}"/${P}-noherwig.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+ # respect users flags
+ sed -i \
+ -e 's/-O3/-O2/g' \
+ -e "s/-O2/${CFLAGS}/g" \
+ -e "s|\(CcCmd[[:space:]]*\)gcc|\1$(tc-getCC)|g" \
+ -e "s|\(CplusplusCmd[[:space:]]*\)g++|\1$(tc-getCXX)|g" \
+ -e "s|\(FortranCmd[[:space:]]*\)gfortran|\1$(tc-getFC)|g" \
+ src/config/linux.cf \
+ || die "sed linux.cf failed"
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+
+ sed -i \
+ -e 's/\$(FCLINK)/\$(FCLINK) $(LDFLAGS)/' \
+ -e 's/\$(CCLINK)/\$(CCLINK) $(LDFLAGS)/' \
+ src/config/{biglib,fortran,Imake}.rules \
+ || die "sed for ldflags propagation failed"
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test() {
+ export VARTEXFONTS="${T}"/fonts
+ LD_LIBRARY_PATH="${S}"/shlib \
+ emake -j1 cernlib-test
+}
+
+src_install() {
+ emake DESTDIR="${D}" MCDOC="${ED}usr/share/doc/${PF}" install
+ cd debian
+ dodoc changelog README.* deadpool.txt copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/cernlib-montecarlo/files/cernlib-montecarlo-2006-noherwig.patch b/sci-physics/cernlib-montecarlo/files/cernlib-montecarlo-2006-noherwig.patch
new file mode 100644
index 000000000000..d0cb42d1ba42
--- /dev/null
+++ b/sci-physics/cernlib-montecarlo/files/cernlib-montecarlo-2006-noherwig.patch
@@ -0,0 +1,52 @@
+diff --git a/mclibs-2006.dfsg.2.orig/Makefile b/mclibs-2006.dfsg.2.orig/Makefile
+index f3c89fd..780499e 100644
+--- a/mclibs-2006.dfsg.2.orig/Makefile
++++ b/mclibs-2006.dfsg.2.orig/Makefile
+@@ -89,9 +89,6 @@ install-includes:
+ done ; \
+ done
+
+- # install some symlinks, e.g. herwig$$version -> herwig
+- rm -f $(DESTDIR)$(includedir)/herwig && \
+- ln -sf herwig59 $(DESTDIR)$(includedir)/herwig
+ rm -rf $(DESTDIR)$(includedir)/isajet758
+ mv $(DESTDIR)$(includedir)/isajet $(DESTDIR)$(includedir)/isajet758
+ ln -sf isajet758 $(DESTDIR)$(includedir)/isajet
+@@ -128,14 +125,12 @@ install-arch: install-includes
+ fi
+
+ # ... and mclibs documentation
+- for dir in cojets eurodec herwig isajet pdflib ; do \
++ for dir in cojets eurodec isajet pdflib ; do \
+ install -d -m 0755 $(MCDOC)/$$dir ; \
+ done
+ install -p -m 0644 $(CERN_DOCDIR)/cojets.txt $(MCDOC)/cojets/
+ install -p -m 0644 $(CERN_DOCDIR)/isa* $(MCDOC)/isajet/
+ install -p -m 0644 $(CERN_DOCDIR)/eurodec.txt $(MCDOC)/eurodec/
+- install -p -m 0644 $(CVSCOSRC)/mclibs/herwig/doc/herwig59 \
+- $(MCDOC)/herwig/herwig59.txt
+ install -p -m 0644 $(CVSCOSRC)/mclibs/pdf/dpdf/pdfdoc.doc \
+ $(MCDOC)/pdflib/pdfdoc.txt
+
+diff --git a/mclibs-2006.dfsg.2.orig/src/mclibs/Imakefile b/mclibs-2006.dfsg.2.orig/src/mclibs/Imakefile
+index 0c9867d..0f04f1b 100644
+--- a/mclibs-2006.dfsg.2.orig/src/mclibs/Imakefile
++++ b/mclibs-2006.dfsg.2.orig/src/mclibs/Imakefile
+@@ -6,7 +6,7 @@
+ to them and their dependents. They have already been purged from
+ Debianized source code. Also, re-order libs so that dependent ones
+ come after dependees. */
+-LIBDIRS= cojets eurodec pdf photos herwig isajet
++LIBDIRS= cojets eurodec pdf photos isajet
+
+ SUBDIRS = $(LIBDIRS)
+
+@@ -16,7 +16,7 @@ InstallLibSubdirs($(LIBDIRS))
+ InstallSharedLibSubdirs($(LIBDIRS))
+
+ /* Again, purge Pythia, Jetset and dependents. */
+-INCLUDEDIRS= cojets eurodec herwig isajet pdf
++INCLUDEDIRS= cojets eurodec isajet pdf
+
+ InstallIncludeSubdirs($(INCLUDEDIRS))
+
diff --git a/sci-physics/cernlib-montecarlo/metadata.xml b/sci-physics/cernlib-montecarlo/metadata.xml
new file mode 100644
index 000000000000..3c0279be07c7
--- /dev/null
+++ b/sci-physics/cernlib-montecarlo/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ This metapackage provides various Monte Carlo libraries included in
+ Cernlib (both shared and static). Likely only physicists will be
+ interested in these packages.
+ The libraries of Ariadne, Fritiof, Jetset, Lepto, and Pythia are not
+ available for Gentoo: see cernlib Debian packaging for explanation.
+</longdescription>
+ <use>
+ <flag name="herwig">Build Herwig internal event generator, newer version
+ available in <pkg>sci-physics/herwig</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-physics/cernlib/Manifest b/sci-physics/cernlib/Manifest
new file mode 100644
index 000000000000..759b697cc84c
--- /dev/null
+++ b/sci-physics/cernlib/Manifest
@@ -0,0 +1,3 @@
+DIST cernlib_20061220+dfsg3-2.debian.tar.gz 257093 SHA256 54d01b7c16015586b09d54940f8e4389eb9f9a85e93be8058a2f1349a009029a SHA512 43a2ca55d42b92bfb551b029c75728e80b4c83473397b52f746d9481c7503762bc5a281732908bfeb29a64f728fed4c127ed1cb9101c16e4fb2dd28c452730ea WHIRLPOOL e11e127c2ef22c96a8f309a1828b076064b87419d7b2fa2f0e93f254582ded6ce41ca678c757921e9a732f75a4bd0392cd4edb7c0752ce04986fe8c1ee210c46
+DIST cernlib_20061220+dfsg3-4.1.debian.tar.xz 170100 SHA256 6f19d776b0a6f22ac688c4e5db9d0ad35f99d8ae1906422f02cca92353d4f9d6 SHA512 d259ab304b040c6bab8535c0db60aaa466ef7bb9bbcce9b2d8931505a180c92935d428e0dd45bfa6199ec939f67580a6d3ac1035c0384bdcf9e6601a351ce90a WHIRLPOOL bf1da58ace8294ff6df710dad8c333122f005437819b8923d53f5fe680f1798f7d22cd917138b679b92363e399759a5b44aa4902b788aa6666f38da7738a3857
+DIST cernlib_20061220+dfsg3.orig.tar.gz 6434476 SHA256 767ecf344cb00a7b2ec232a61c67645ce0fe1a6af861e60a9aa2f96544470f1b SHA512 11fade45c5ae69c858f37a82e74ab1a69416314a23c12ec5205ee6b918590d66f26d3ae68afa466ae3109d736212968ece956a444270ddd189a27a24c0ccece8 WHIRLPOOL fce13048cff43b6abc7e52e9729f5e484ebf85b53f09e6bfbf8acd970ea13b160de6d6d9593779b6b485dfb9843dec4d2d58bac0df20dfce9809a3560eec079c
diff --git a/sci-physics/cernlib/cernlib-2006-r5.ebuild b/sci-physics/cernlib/cernlib-2006-r5.ebuild
new file mode 100644
index 000000000000..bfbba5cefdf7
--- /dev/null
+++ b/sci-physics/cernlib/cernlib-2006-r5.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 multilib toolchain-funcs
+
+DEB_PN=cernlib
+DEB_PV=20061220+dfsg3
+DEB_PR=2
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN program library for High Energy Physics"
+HOMEPAGE="https://cernlib.web.cern.ch/cernlib/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="amd64 hppa sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ x11-libs/motif:0
+ virtual/lapack
+ dev-lang/cfortran"
+DEPEND="${RDEPEND}
+ x11-misc/imake
+ x11-misc/makedepend
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}"
+
+src_prepare() {
+ mv ../debian . || die
+ epatch "${FILESDIR}"/${P}-nogfortran.patch
+ # set some default paths
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ -e "s:prefix)/lib:prefix)/$(get_libdir):" \
+ -e "s:\$(prefix)/etc:${EROOT}/etc:" \
+ -e 's:$(prefix)/man:$(prefix)/share/man:' \
+ debian/add-ons/cernlib.mk || die "sed failed"
+
+ # use system blas and lapack set by gentoo framework
+ sed -i \
+ -e "s:\$DEPS -lm:$($(tc-getPKG_CONFIG) --libs blas):" \
+ -e "s:\$DEPS -llapack -lm:$($(tc-getPKG_CONFIG) --libs lapack):" \
+ -e 's:`depend $d $a blas`::' \
+ -e 's:X11R6:X11:g' \
+ debian/add-ons/bin/cernlib.in || die "sed failed"
+
+ cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+
+ epatch "${FILESDIR}"/${P}-fgets.patch
+ epatch "${FILESDIR}"/${P}-ypatchy-short-name.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+
+ # respect users flags
+ sed -i \
+ -e 's/-O3/-O2/g' \
+ -e "s/-O2/${CFLAGS}/g" \
+ -e "s|\(CcCmd[[:space:]]*\)gcc|\1$(tc-getCC)|g" \
+ -e "s|\(CplusplusCmd[[:space:]]*\)g++|\1$(tc-getCXX)|g" \
+ -e "s|\(FortranCmd[[:space:]]*\)gfortran|\1$(tc-getFC)|g" \
+ src/config/linux.cf \
+ || die "sed linux.cf failed"
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+
+ sed -i \
+ -e 's/\$(FCLINK)/\$(FCLINK) $(LDFLAGS)/' \
+ -e 's/\$(CCLINK)/\$(CCLINK) $(LDFLAGS)/' \
+ src/config/{biglib,fortran,Imake}.rules \
+ src/patchy/Imakefile \
+ || die "sed for ldflags propagation failed"
+
+ # add missing headers for implicit
+ sed -i \
+ -e '0,/^#include/i#include <stdlib.h>' \
+ src/kernlib/kerngen/ccgen*/*.c || die
+}
+
+src_compile() {
+ # parallel make breaks and complex patched imake system, hard to debug
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test() {
+ LD_LIBRARY_PATH="${S}"/shlib emake -j1 cernlib-test
+}
+
+src_install() {
+ default
+ cd debian
+ dodoc changelog README.* deadpool.txt NEWS copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/cernlib/cernlib-2006-r6.ebuild b/sci-physics/cernlib/cernlib-2006-r6.ebuild
new file mode 100644
index 000000000000..f3c6efe14342
--- /dev/null
+++ b/sci-physics/cernlib/cernlib-2006-r6.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 multilib toolchain-funcs
+
+DEB_PN=cernlib
+DEB_PV=20061220+dfsg3
+DEB_PR=4.1
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN program library for High Energy Physics"
+HOMEPAGE="https://cernlib.web.cern.ch/cernlib/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.xz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="~amd64 ~hppa ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ x11-libs/motif:0
+ virtual/lapack
+ dev-lang/cfortran"
+DEPEND="${RDEPEND}
+ x11-misc/imake
+ x11-misc/makedepend
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}"
+
+src_prepare() {
+ mv ../debian . || die
+ epatch "${FILESDIR}"/${P}-nogfortran.patch
+ # set some default paths
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ -e "s:prefix)/lib/\$(DEB_HOST_MULTIARCH):prefix)/$(get_libdir):" \
+ -e "s:\$(prefix)/etc:${EROOT}/etc:" \
+ -e 's:$(prefix)/man:$(prefix)/share/man:' \
+ debian/add-ons/cernlib.mk || die "sed failed"
+
+ # use system blas and lapack set by gentoo framework
+ sed -i \
+ -e "s:\$DEPS -lm:$($(tc-getPKG_CONFIG) --libs blas):" \
+ -e "s:\$DEPS -llapack -lm:$($(tc-getPKG_CONFIG) --libs lapack):" \
+ -e 's:`depend $d $a blas`::' \
+ -e 's:X11R6:X11:g' \
+ debian/add-ons/bin/cernlib.in || die "sed failed"
+
+ cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+
+ epatch "${FILESDIR}"/${P}-fgets.patch
+ epatch "${FILESDIR}"/${P}-ypatchy-short-name.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+
+ # respect users flags
+ sed -i \
+ -e 's/-O3/-O2/g' \
+ -e "s/-O2/${CFLAGS}/g" \
+ -e "s|\(CcCmd[[:space:]]*\)gcc|\1$(tc-getCC)|g" \
+ -e "s|\(CplusplusCmd[[:space:]]*\)g++|\1$(tc-getCXX)|g" \
+ -e "s|\(FortranCmd[[:space:]]*\)gfortran|\1$(tc-getFC)|g" \
+ src/config/linux.cf \
+ || die "sed linux.cf failed"
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+
+ sed -i \
+ -e 's/\$(FCLINK)/\$(FCLINK) $(LDFLAGS)/' \
+ -e 's/\$(CCLINK)/\$(CCLINK) $(LDFLAGS)/' \
+ src/config/{biglib,fortran,Imake}.rules \
+ src/patchy/Imakefile \
+ || die "sed for ldflags propagation failed"
+
+ # add missing headers for implicit
+ sed -i \
+ -e '0,/^#include/i#include <stdlib.h>' \
+ src/kernlib/kerngen/ccgen*/*.c || die
+}
+
+src_compile() {
+ # parallel make breaks and complex patched imake system, hard to debug
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test() {
+ LD_LIBRARY_PATH="${S}"/shlib emake -j1 cernlib-test
+}
+
+src_install() {
+ default
+ cd debian
+ dodoc changelog README.* deadpool.txt NEWS copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/cernlib/files/cernlib-2006-fgets.patch b/sci-physics/cernlib/files/cernlib-2006-fgets.patch
new file mode 100644
index 000000000000..e42eaf833b35
--- /dev/null
+++ b/sci-physics/cernlib/files/cernlib-2006-fgets.patch
@@ -0,0 +1,20 @@
+--- src/packlib/cspack/tcpaw/tcpaw.c.old 2011-01-30 21:18:35.326089059 +0000
++++ src/packlib/cspack/tcpaw/tcpaw.c 2011-01-30 21:18:01.876081979 +0000
+@@ -984,7 +984,7 @@
+ int s, addrlen;
+ int sx, nn = 0; /* REXEC */
+ #ifndef IBM
+- char get[50], *getp = get; /* REXEC */
++ char get[80], *getp = get; /* REXEC */
+ #endif /*^IBM */
+ char sys[30];
+ register int i, j, k;
+@@ -1036,7 +1036,7 @@
+ char buff[100];
+ char *get;
+ char *getp;
+- char getbuf[50]; /* REXEC */
++ char getbuf[80]; /* REXEC */
+ getp = getbuf; /* REXEC */
+ get = getbuf; /* REXEC */
+ /* j = 80; */ /* (crude kludge) length of srvc in Fortran */
diff --git a/sci-physics/cernlib/files/cernlib-2006-nogfortran.patch b/sci-physics/cernlib/files/cernlib-2006-nogfortran.patch
new file mode 100644
index 000000000000..63883274403f
--- /dev/null
+++ b/sci-physics/cernlib/files/cernlib-2006-nogfortran.patch
@@ -0,0 +1,56 @@
+--- debian/add-ons/Makefile.orig 2008-03-15 16:46:46.000000000 +0000
++++ debian/add-ons/Makefile 2008-03-15 16:47:51.000000000 +0000
+@@ -28,6 +28,9 @@
+ ifneq (,$(findstring ifort,$(DEB_BUILD_OPTIONS)))
+ sed -i -e 's/-lgfortran/-limf/' $(CERN_BINDIR)/cernlib
+ endif
++ifneq (,$(findstring g77,$(DEB_BUILD_OPTIONS)))
++ sed -i -e 's/-lgfortran/-lg2c/' $(CERN_BINDIR)/cernlib
++endif
+ chmod a+x $(CERN_BINDIR)/cernlib
+
+ # target to install include files for development packages
+--- debian/add-ons/cernlib.mk.orig 2008-03-15 16:48:05.000000000 +0000
++++ debian/add-ons/cernlib.mk 2008-03-15 17:09:14.000000000 +0000
+@@ -35,6 +35,10 @@
+ export TOOL_SONAME = _gfortran
+ export TOOL_NAME = _gfortran
+ endif
++ifeq (,$(findstring g77,$(DEB_BUILD_OPTIONS)))
++ export TOOL_SONAME = _gfortran
++ export TOOL_NAME = _gfortran
++endif
+ export PATH := $(CERN_BINDIR):$(ADDONDIR)/bin:$(datadir)/cernlib:${PATH}
+ export INSTALL_OPTS ?= -s
+ export CC ?= gcc
+@@ -118,6 +122,8 @@
+ endif
+ ifneq (,$(findstring ifort,$(DEB_BUILD_OPTIONS)))
+ echo '#define HasIntelifc YES' >> $(CVSCOSRC)/config/host.def
++else ifneq (,$(findstring g77,$(DEB_BUILD_OPTIONS)))
++ echo >> $(CVSCOSRC)/config/host.def
+ else
+ echo '#define Hasgfortran YES' >> $(CVSCOSRC)/config/host.def
+ endif
+--- debian/patches/320-support-ifort.dpatch.orig 2008-03-15 17:31:34.000000000 +0000
++++ debian/patches/320-support-ifort.dpatch 2008-03-15 17:31:56.000000000 +0000
+@@ -27,7 +27,7 @@
+ #if defined(CERNLIB_UNIX)
+ CLIBS= -G Motif kernlib
+ +# if defined(CERNLIB_INTELIFC)
+-+CLIBS= $(CLIBS) -nofor_main
+++CLIBS:= $(CLIBS) -nofor_main
+ +# endif
+ #endif
+
+--- debian/patches/803-link-binaries-dynamically.dpatch.orig 2008-03-15 17:48:38.000000000 +0000
++++ debian/patches/803-link-binaries-dynamically.dpatch 2008-03-15 17:49:17.000000000 +0000
+@@ -64,7 +64,7 @@
+ -CLIBS= -G Motif kernlib
+ +CLIBS= -G Motif -u Xm
+ # if defined(CERNLIB_INTELIFC)
+- CLIBS= $(CLIBS) -nofor_main
++ CLIBS:= $(CLIBS) -nofor_main
+ # endif
+ #endif
+
diff --git a/sci-physics/cernlib/files/cernlib-2006-ypatchy-short-name.patch b/sci-physics/cernlib/files/cernlib-2006-ypatchy-short-name.patch
new file mode 100644
index 000000000000..706ab3671672
--- /dev/null
+++ b/sci-physics/cernlib/files/cernlib-2006-ypatchy-short-name.patch
@@ -0,0 +1,11 @@
+--- src/patchy/Imakefile.orig 2013-01-16 13:45:07.161828513 -0800
++++ src/patchy/Imakefile 2013-01-16 13:45:34.768966597 -0800
+@@ -77,7 +77,7 @@
+ @ ln -s $< $@
+
+ %.f: $(LDIR)%.cra $(LDIR)patchy.car
+- ypatchy - :$@ :$< TTY .go
++ ypatchy - :$@ :$(shell basename $<) TTY .go
+
+ .f.o:
+ $(FC) -c $(FORTRANOPTIONS) $(FDEBUGFLAGS) $<
diff --git a/sci-physics/cernlib/metadata.xml b/sci-physics/cernlib/metadata.xml
new file mode 100644
index 000000000000..9db83d0ca7a4
--- /dev/null
+++ b/sci-physics/cernlib/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ The CERN Program Library is a large collection of general purpose
+ libraries and modules maintained and offered in both source and
+ object code form on the CERN central computers. Most of these
+ programs were developed at CERN and are therefore oriented towards
+ the needs of a physics research laboratory that is general
+ mathematics, data analysis, detectors simulation, data-handling
+ etc... applicable to a wide range of problems.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/clhep/Manifest b/sci-physics/clhep/Manifest
new file mode 100644
index 000000000000..213e2b411ac4
--- /dev/null
+++ b/sci-physics/clhep/Manifest
@@ -0,0 +1,8 @@
+DIST clhep-2.0.4.6.tgz 3593699 SHA256 a75e9d5b08cec7456e580834fb0894043054ee66336c2ce4c33622ca2500ee55
+DIST clhep-2.1.0.1.tgz 4243520 SHA256 b8492c1c795e899d8ab2462fc4f40f05a520dba17e598ca2434623e24f51cd29 SHA512 fa6d69239c539992371e053a17c4cb83a2283f87a16ec8249c99a415ab0730a74c59c2386091b5efd040a429075e7a6acd855dfc9c6a68e60f5eb6dcada6327a WHIRLPOOL aa019105093175b197aa4ca9841736d9ad3586a6251e41dede0950e4107b533680293fd8038a239e415bb55d251238a0157803fbb12b05eaa898367252bd9096
+DIST clhep-2.1.2.4.tgz 1845804 SHA256 ca1b39772c4fb75047c001a892019e65be4ac61ccd9f059bd2ff273c88b5c2cf SHA512 5386c41e33e780a3096f8cea47700b8e89246b4450d6ba135bafecde8af6d7315c681f2eee7569afd837cfaacd2c35f104bf5b077f5a4e23faaeaee9fdca7363 WHIRLPOOL 1c26d5ac15fecfdf6302a69ac547b732c65cda3e34d43c90c8a7a0327073bebed24a34ccc6ff0c3bc673733d5ba2368004016a65da46b5cedbf23ce7b3585526
+DIST clhep-2.1.3.1.tgz 1860936 SHA256 5d3e45b39a861731fe3a532bb1426353bf62b54c7b90ecf268827e50f925642b SHA512 d5bd1c459b1a89e53e8768d7b00c1b854172419d1f8a1218f80265c6c995235850cceec6120daaf80067a7717845982ffcbd35944f81fa2f0542e842941d6807 WHIRLPOOL 716a2289c55f727c1c9ba3294abdd592624953fcb57a0235519fa3620dc121a9cc57ab3c5c7cea0849a1bbd10f5f8dd63a2b5aa7b0f5e2c8c889f7aa0c27a013
+DIST clhep-2.1.4.1.tgz 1866250 SHA256 adeb7ad87b810f772b609e77eacc60fd3e1f949e694a434705e6759cdac41fe4 SHA512 ff5eb76ddf740635c17f01c62679ae7c22c152f96684315f059744ab67e420e51ba9c1ae0ac745b2890d1ddb6a678999b61d44c36e358c1d95c6b57362f3fae0 WHIRLPOOL da4fd1087b0c92f5a6f8bec060b4e6eee0091327defb9e2d71721c09b8c1f773d3ed377567a378dbb48156426ecfdb638049e10122fc5b2bcf2a7fe560e1ebd0
+DIST clhep-2.1.4.2.tgz 1838675 SHA256 ffd72997fb921fa7ef770c40c6bb12f603aa4761e642dc577160d1ee2aa695f0 SHA512 8caa6fdbf1d7dbfe217cc5aef384e21b99ae386a76771f17b3dc583c0c55e21164ad3778005798f1a4d151b79782b96a3495d88f1cf7bd46da4c6550ebd69f7c WHIRLPOOL 33ed24301927680c858561e6c6105fddbe72e725bdae26bdefaa24fc2ac9ee93db7a48fcb5e2b773a03acc9a41a2d294e1071ab7ad45bb4c1cec4180cd4da699
+DIST clhep-2.2.0.1.tgz 1844675 SHA256 1006284b195e569276ba9d6e3e2b0b2d002e098c10ac09157b26ec076987d7d7 SHA512 930577d18f1c4a9dc94b259589653ebecf7b85ec78da7e1dc7b49d282dbae210bcf257831254f875840a3fd6bf5fc4ad7c4e46825e31674c55c746ef7c2939f2 WHIRLPOOL ad9e765c2adb47de9688abc5c8f7f6e481160df66c811e381d136fcf7d1e7726402367ad2a3f757cefc754c8fe6dc225bdee0f15f763cecc91a3413b63cbc54c
+DIST clhep-2.2.0.5.tgz 1847046 SHA256 92e8b5d32ae96154edd27d0c641ba048ad33cb69dd4f1cfb72fc578770a34818 SHA512 07d9359604196344fe3b13cc103727693fd70818c22849e54507530221812843a943cb8ed66eea421e498edcc9c0f584826823ea7939cbf53b90b17d412aed1a WHIRLPOOL 4d5b7429e4b0498393c8f664045df4ba27a073a7e926ee9a5f9e196e5d0d3dd4da2cb4bf77e8eb37e6651c3e1f3f9742167414010ae5606e02f307ab6efe82c4
diff --git a/sci-physics/clhep/clhep-2.0.4.6.ebuild b/sci-physics/clhep/clhep-2.0.4.6.ebuild
new file mode 100644
index 000000000000..4724aa529428
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.0.4.6.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit autotools eutils
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="public-domain"
+SLOT="2"
+KEYWORDS="amd64 hppa ppc x86"
+
+IUSE="exceptions"
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ for d in $(find . -name configure.in); do
+ # respect user flags and fix some compilers stuff
+ sed -i \
+ -e 's:^g++):*g++):g' \
+ -e 's:^icc):icc|icpc):g' \
+ -e '/AM_CXXFLAGS=/s:-O ::g' \
+ ${d} || die
+ # need to rebuild because original configurations
+ # have buggy detection
+ done
+ for d in $(find . -name Makefile.am | xargs grep -l ": %\.cc"); do
+ sed -i \
+ -e 's|: %\.cc|: %\.cc \$(shareddir)|' \
+ -e 's|all-local: \$(shareddir)|all-local: |' \
+ ${d} || die
+ # fixing parallel build
+ done
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable exceptions)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README ChangeLog || die
+}
diff --git a/sci-physics/clhep/clhep-2.1.0.1.ebuild b/sci-physics/clhep/clhep-2.1.0.1.ebuild
new file mode 100644
index 000000000000..83bd826f1c2e
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.1.0.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+WANT_AUTOMAKE=1.9
+inherit autotools eutils
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="public-domain"
+SLOT="2"
+KEYWORDS="amd64 hppa ppc x86"
+
+IUSE="exceptions static-libs"
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ for d in $(find . -name configure.ac); do
+ # respect user flags and fix some compilers stuff
+ sed -i \
+ -e 's:^g++):*g++):g' \
+ -e 's:^icc):icc|icpc):g' \
+ -e '/AM_CXXFLAGS=/s:-O ::g' \
+ ${d} || die
+ # need to rebuild because original configurations
+ # have buggy detection
+ done
+ for d in $(find . -name Makefile.am | xargs grep -l ": %\.cc"); do
+ sed -i \
+ -e 's|: %\.cc|: %\.cc \$(shareddir)|' \
+ -e 's|all-local: \$(shareddir)|all-local: |' \
+ ${d} || die
+ # fixing parallel build
+ done
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable exceptions) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README ChangeLog || die
+}
diff --git a/sci-physics/clhep/clhep-2.1.2.4.ebuild b/sci-physics/clhep/clhep-2.1.2.4.ebuild
new file mode 100644
index 000000000000..5b78839aeb8e
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.1.2.4.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-libdir.patch
+ epatch "${FILESDIR}"/${P}-lsb-whitespace.patch
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+ dodoc README ChangeLog
+}
diff --git a/sci-physics/clhep/clhep-2.1.3.1.ebuild b/sci-physics/clhep/clhep-2.1.3.1.ebuild
new file mode 100644
index 000000000000..cf3f1c5a4471
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.1.3.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+ use doc && MAKEOPTS+=" -j1"
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+ dodoc README ChangeLog
+}
diff --git a/sci-physics/clhep/clhep-2.1.4.1.ebuild b/sci-physics/clhep/clhep-2.1.4.1.ebuild
new file mode 100644
index 000000000000..31d17662ee78
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.1.4.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2/${PV}"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+ use doc && MAKEOPTS+=" -j1"
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+}
diff --git a/sci-physics/clhep/clhep-2.1.4.2.ebuild b/sci-physics/clhep/clhep-2.1.4.2.ebuild
new file mode 100644
index 000000000000..c0014cfaee1e
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.1.4.2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2/${PV}"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+ use doc && MAKEOPTS+=" -j1"
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+}
diff --git a/sci-physics/clhep/clhep-2.2.0.1.ebuild b/sci-physics/clhep/clhep-2.2.0.1.ebuild
new file mode 100644
index 000000000000..c0014cfaee1e
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.2.0.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2/${PV}"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+ use doc && MAKEOPTS+=" -j1"
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+}
diff --git a/sci-physics/clhep/clhep-2.2.0.5.ebuild b/sci-physics/clhep/clhep-2.2.0.5.ebuild
new file mode 100644
index 000000000000..e36e813461b5
--- /dev/null
+++ b/sci-physics/clhep/clhep-2.2.0.5.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+DESCRIPTION="High Energy Physics C++ library"
+HOMEPAGE="http://www.cern.ch/clhep"
+SRC_URI="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/${P}.tgz"
+LICENSE="GPL-3 LGPL-3"
+SLOT="2/${PV}"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc static-libs test"
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PV}/CLHEP"
+
+src_prepare() {
+ # respect flags
+ sed -i -e 's:-O::g' cmake/Modules/ClhepVariables.cmake || die
+ # no batch mode to allow parallel building (bug #437482)
+ sed -i \
+ -e 's:-interaction=batchmode::g' \
+ cmake/Modules/ClhepBuildTex.cmake || die
+ # gentoo doc directory
+ sed -i \
+ -e "/DESTINATION/s:doc:share/doc/${PF}:" \
+ cmake/Modules/ClhepBuildTex.cmake */doc/CMakeLists.txt || die
+ # dont build test if not asked
+ if ! use test; then
+ sed -i \
+ -e '/add_subdirectory(test)/d' \
+ */CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use doc CLHEP_BUILD_DOCS)
+ )
+ DESTDIR="${ED}" cmake-utils_src_configure
+ use doc && MAKEOPTS+=" -j1"
+}
+
+src_install() {
+ cmake-utils_src_install
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a
+}
diff --git a/sci-physics/clhep/files/clhep-2.1.2.3-libdir.patch b/sci-physics/clhep/files/clhep-2.1.2.3-libdir.patch
new file mode 100644
index 000000000000..69e6c24451bb
--- /dev/null
+++ b/sci-physics/clhep/files/clhep-2.1.2.3-libdir.patch
@@ -0,0 +1,93 @@
+diff -Nur 2.1.2.3/CLHEP.orig/cmake/Modules/ClhepBuildLibrary.cmake 2.1.2.3/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake
+--- 2.1.2.3/CLHEP.orig/cmake/Modules/ClhepBuildLibrary.cmake 2012-06-27 20:47:44.000000000 +0100
++++ 2.1.2.3/CLHEP/cmake/Modules/ClhepBuildLibrary.cmake 2012-06-27 23:49:13.000000000 +0100
+@@ -47,8 +47,8 @@
+ # Install the libraries
+ INSTALL (TARGETS ${package} ${package}S
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ endmacro(clhep_build_library)
+
+@@ -78,22 +78,22 @@
+ INSTALL(TARGETS CLHEP CLHEPS
+ EXPORT CLHEPLibraryDepends
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+
+ if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
+ # copy
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
+- "exec_program(${CMAKE_COMMAND} ARGS -E chdir ${CMAKE_INSTALL_PREFIX}/lib; ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} )" )
++ "exec_program(${CMAKE_COMMAND} ARGS -E chdir $ENV{CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}; ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} )" )
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
+- "exec_program(${CMAKE_COMMAND} ARGS -E chdir ${CMAKE_INSTALL_PREFIX}/bin; ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} )" )
++ "exec_program(${CMAKE_COMMAND} ARGS -E chdir $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin; ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} )" )
+ else()
+ # create the symbolic links
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
+- "exec_program(${CMAKE_COMMAND} ARGS -E chdir ${CMAKE_INSTALL_PREFIX}/lib; ${CMAKE_COMMAND} ARGS -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} )" )
++ "exec_program(${CMAKE_COMMAND} ARGS -E chdir $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}; ${CMAKE_COMMAND} ARGS -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} )" )
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
+- "exec_program(${CMAKE_COMMAND} ARGS -E chdir ${CMAKE_INSTALL_PREFIX}/lib; ${CMAKE_COMMAND} ARGS -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} )" )
++ "exec_program(${CMAKE_COMMAND} ARGS -E chdir $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}; ${CMAKE_COMMAND} ARGS -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} )" )
+ endif()
+
+ INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink )
+diff -Nur 2.1.2.3/CLHEP.orig/cmake/Modules/ClhepToolchain.cmake 2.1.2.3/CLHEP/cmake/Modules/ClhepToolchain.cmake
+--- 2.1.2.3/CLHEP.orig/cmake/Modules/ClhepToolchain.cmake 2012-06-27 20:47:44.000000000 +0100
++++ 2.1.2.3/CLHEP/cmake/Modules/ClhepToolchain.cmake 2012-06-27 23:39:28.000000000 +0100
+@@ -63,7 +63,7 @@
+ #
+ set(CLHEP_PKGCONFIG_PREFIX ${PROJECT_BINARY_DIR})
+ set(CLHEP_PKGCONFIG_INCLUDEDIR ${CLHEP_INCLUDE_DIR})
+-set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib)
++set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
+
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
+ ${PROJECT_BINARY_DIR}/clhep.pc
+@@ -84,7 +84,7 @@
+ # We use a relative path from the directory where the CLHEPConfig.cmake
+ # file is installed to the actual include dir.
+ file(RELATIVE_PATH _relincpath
+- ${CMAKE_INSTALL_PREFIX}/lib/CLHEP-${VERSION}
++ ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/CLHEP-${VERSION}
+ ${CMAKE_INSTALL_PREFIX}/include
+ )
+ set(CLHEP_INCLUDE_DIR "\${_thisdir}/${_relincpath}")
+@@ -111,7 +111,7 @@
+ # If you later use GNUInstallDirs.cmake, this would need more work to
+ # ensure accurate calculation of the relative path.
+ set(CLHEP_PKGCONFIG_PREFIX "\${pcfiledir}/../..")
+-set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib")
++set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib${LIB_SUFFIX}")
+ set(CLHEP_PKGCONFIG_INCLUDEDIR "\${prefix}/include")
+
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
+@@ -129,16 +129,16 @@
+ install(FILES
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfigVersion.cmake
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfig.cmake
+- DESTINATION lib/CLHEP-${VERSION}
++ DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION}
+ )
+
+-install(EXPORT CLHEPLibraryDepends DESTINATION lib/CLHEP-${VERSION})
++install(EXPORT CLHEPLibraryDepends DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION})
+
+ # Install the pkg-config file. The choice of 'lib/pkgconfig' for the
+ # installation seems fairly standard.
+ install(FILES
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/clhep.pc
+- DESTINATION lib/pkgconfig
++ DESTINATION lib${LIB_SUFFIX}/pkgconfig
+ )
+
+ # - And we should be done...
diff --git a/sci-physics/clhep/files/clhep-2.1.2.4-libdir.patch b/sci-physics/clhep/files/clhep-2.1.2.4-libdir.patch
new file mode 100644
index 000000000000..fbdbb6110a6b
--- /dev/null
+++ b/sci-physics/clhep/files/clhep-2.1.2.4-libdir.patch
@@ -0,0 +1,87 @@
+diff -Nur CLHEP.orig/cmake/Modules/ClhepBuildLibrary.cmake CLHEP/cmake/Modules/ClhepBuildLibrary.cmake
+--- CLHEP.orig/cmake/Modules/ClhepBuildLibrary.cmake 2012-07-09 19:33:59.000000000 +0100
++++ CLHEP/cmake/Modules/ClhepBuildLibrary.cmake 2012-08-07 18:44:55.000000000 +0100
+@@ -47,8 +47,8 @@
+ # Install the libraries
+ INSTALL (TARGETS ${package} ${package}S
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ endmacro(clhep_build_library)
+
+@@ -78,8 +78,8 @@
+ INSTALL(TARGETS CLHEP CLHEPS
+ EXPORT CLHEPLibraryDepends
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+
+ if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
+@@ -91,9 +91,9 @@
+ else()
+ # create the symbolic links
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink
+- "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/lib\" )" )
++ "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}CLHEP${CMAKE_STATIC_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}S{CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clhep_shared_symlink
+- "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/lib\" )" )
++ "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP-${VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}CLHEP${CMAKE_SHARED_LIBRARY_SUFFIX} WORKING_DIRECTORY \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" )" )
+ endif()
+
+ INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/clhep_static_symlink )
+diff -Nur CLHEP.orig/cmake/Modules/ClhepToolchain.cmake CLHEP/cmake/Modules/ClhepToolchain.cmake
+--- CLHEP.orig/cmake/Modules/ClhepToolchain.cmake 2011-12-16 00:07:27.000000000 +0000
++++ CLHEP/cmake/Modules/ClhepToolchain.cmake 2012-08-07 17:48:57.000000000 +0100
+@@ -63,7 +63,7 @@
+ #
+ set(CLHEP_PKGCONFIG_PREFIX ${PROJECT_BINARY_DIR})
+ set(CLHEP_PKGCONFIG_INCLUDEDIR ${CLHEP_INCLUDE_DIR})
+-set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib)
++set(CLHEP_PKGCONFIG_LIBDIR ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
+
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
+ ${PROJECT_BINARY_DIR}/clhep.pc
+@@ -84,7 +84,7 @@
+ # We use a relative path from the directory where the CLHEPConfig.cmake
+ # file is installed to the actual include dir.
+ file(RELATIVE_PATH _relincpath
+- ${CMAKE_INSTALL_PREFIX}/lib/CLHEP-${VERSION}
++ ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/CLHEP-${VERSION}
+ ${CMAKE_INSTALL_PREFIX}/include
+ )
+ set(CLHEP_INCLUDE_DIR "\${_thisdir}/${_relincpath}")
+@@ -111,7 +111,7 @@
+ # If you later use GNUInstallDirs.cmake, this would need more work to
+ # ensure accurate calculation of the relative path.
+ set(CLHEP_PKGCONFIG_PREFIX "\${pcfiledir}/../..")
+-set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib")
++set(CLHEP_PKGCONFIG_LIBDIR "\${prefix}/lib${LIB_SUFFIX}")
+ set(CLHEP_PKGCONFIG_INCLUDEDIR "\${prefix}/include")
+
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/clhep.pc.in
+@@ -129,16 +129,16 @@
+ install(FILES
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfigVersion.cmake
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/CLHEPConfig.cmake
+- DESTINATION lib/CLHEP-${VERSION}
++ DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION}
+ )
+
+-install(EXPORT CLHEPLibraryDepends DESTINATION lib/CLHEP-${VERSION})
++install(EXPORT CLHEPLibraryDepends DESTINATION lib${LIB_SUFFIX}/CLHEP-${VERSION})
+
+ # Install the pkg-config file. The choice of 'lib/pkgconfig' for the
+ # installation seems fairly standard.
+ install(FILES
+ ${PROJECT_BINARY_DIR}/InstallTreeFiles/clhep.pc
+- DESTINATION lib/pkgconfig
++ DESTINATION lib${LIB_SUFFIX}/pkgconfig
+ )
+
+ # - And we should be done...
diff --git a/sci-physics/clhep/files/clhep-2.1.2.4-lsb-whitespace.patch b/sci-physics/clhep/files/clhep-2.1.2.4-lsb-whitespace.patch
new file mode 100644
index 000000000000..9880dd88806a
--- /dev/null
+++ b/sci-physics/clhep/files/clhep-2.1.2.4-lsb-whitespace.patch
@@ -0,0 +1,32 @@
+diff -Nur cmake/Modules.orig/ClhepPackageCompiler.cmake cmake/Modules/ClhepPackageCompiler.cmake
+--- cmake/Modules.orig/ClhepPackageCompiler.cmake 2012-08-14 13:07:41.891381108 -0700
++++ cmake/Modules/ClhepPackageCompiler.cmake 2012-08-14 13:08:39.826695769 -0700
+@@ -16,6 +16,7 @@
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER}
+ ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE _my_COMPILER_VERSION
++ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ set( COMPILER_VERSION ${_my_COMPILER_VERSION} PARENT_SCOPE)
+ STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+diff -Nur cmake/Modules.orig/ClhepPackaging.cmake cmake/Modules/ClhepPackaging.cmake
+--- cmake/Modules.orig/ClhepPackaging.cmake 2012-08-14 13:07:41.890381099 -0700
++++ cmake/Modules/ClhepPackaging.cmake 2012-08-14 13:08:17.025571936 -0700
+@@ -68,7 +68,7 @@
+ # We have linux, so incorporate Vendor info into package name
+ # - Distributor ID
+ ##exec_program(${LSB_RELEASE_PROGRAM} ARGS -s -i OUTPUT_VARIABLE LSB_VENDOR)
+- execute_process(COMMAND ${LSB_RELEASE_PROGRAM} -s -i OUTPUT_VARIABLE LSB_VENDOR)
++ execute_process(COMMAND ${LSB_RELEASE_PROGRAM} -s -i OUTPUT_VARIABLE LSB_VENDOR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REGEX REPLACE " " "-" LSB_VENDOR ${LSB_VENDOR})
+ string(TOLOWER ${LSB_VENDOR} LSB_VENDOR)
+ if("${LSB_VENDOR}" MATCHES "scientificslf")
+@@ -85,7 +85,7 @@
+
+ # - Distributor release
+ ##exec_program(${LSB_RELEASE_PROGRAM} ARGS -s -r OUTPUT_VARIABLE LSB_RELEASE)
+- execute_process(COMMAND ${LSB_RELEASE_PROGRAM} -s -r OUTPUT_VARIABLE LSB_RELEASE)
++ execute_process(COMMAND ${LSB_RELEASE_PROGRAM} -s -r OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(TOLOWER ${LSB_RELEASE} LSB_RELEASE)
+ string(REGEX REPLACE "([0-9])\\.([0-9])?" "\\1" LSB_RELEASE ${LSB_RELEASE})
+
diff --git a/sci-physics/clhep/metadata.xml b/sci-physics/clhep/metadata.xml
new file mode 100644
index 000000000000..cc9e48460d31
--- /dev/null
+++ b/sci-physics/clhep/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ A Class Library for High Energy Physics is intended to be a set of
+ HEP-specific foundation and utility classes such as random
+ generators, physics vectors, geometry and linear algebra.
+</longdescription>
+<use>
+ <flag name="exceptions">Enable zoom exceptions for user intervention</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/espresso++/Manifest b/sci-physics/espresso++/Manifest
new file mode 100644
index 000000000000..36c233b8d526
--- /dev/null
+++ b/sci-physics/espresso++/Manifest
@@ -0,0 +1,2 @@
+DIST espresso++-1.9.2.tar.bz2 14696734 SHA256 7bdcf502661809dc39a18b3f7fa0b0799adbf801ddb6681a197ab1bd9c7915b0 SHA512 2fffd30c24e12c079e5d3c9c98464db7add21b67e848104dc6f3952635595e4108a4d27dd5a852775cb0515e58be7a302602b34fb51dd67dff8f8677d2abb1fc WHIRLPOOL 0fe4ea6f452dd93861a3e04469b5ee8b37c55ccf4523e6ae575b99b3223f861e8e78675a3ef74ba5a3cfe3c9a039453f1eadea4fc99e339db54ac1e1304493b7
+DIST espresso++-1.9.3.tar.bz2 14714575 SHA256 602541c9e5889aeff30462f252fa5f2af7d818808ce946d11ee33500f4f2c959 SHA512 0ac90c6b09da0e7503e83cff8180373249760206fc0035b72868376abbd4a0d9121e7c92ae286493230af2080221464fc0f9428ed78101bde32eb926f07bb010 WHIRLPOOL f9fb22f4d113a47eee1d9203d4dabf5f5cef3347d7c17583459a69a6bee7392675a0f5ebab09315c4a740dba2fb412c13f3cb74ba3e8d0c99f51f62452af28e8
diff --git a/sci-physics/espresso++/espresso++-1.9.2.ebuild b/sci-physics/espresso++/espresso++-1.9.2.ebuild
new file mode 100644
index 000000000000..2e7fd3905069
--- /dev/null
+++ b/sci-physics/espresso++/espresso++-1.9.2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit cmake-utils multilib python-single-r1
+
+DESCRIPTION="extensible, flexible, fast and parallel simulation software for soft matter research"
+HOMEPAGE="https://www.espresso-pp.de"
+
+if [[ ${PV} = 9999 ]]; then
+ EHG_REPO_URI="https://bitbucket.org/${PN//+/p}/${PN//+/p}"
+ EHG_REVISION="default"
+ inherit mercurial
+ KEYWORDS=
+else
+ inherit vcs-snapshot
+ #SRC_URI="https://espressopp.mpip-mainz.mpg.de/Download/${PN//+/p}-${PV}.tgz"
+ SRC_URI="https://bitbucket.org/${PN//+/p}/${PN//+/p}/get/v${PV}.tar.bz2 -> ${P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ virtual/mpi
+ dev-libs/boost[python,mpi,${PYTHON_USEDEP}]
+ sci-libs/fftw:3.0
+ dev-python/mpi4py"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS NEWS README )
+
+src_configure() {
+ mycmakeargs=(
+ -DEXTERNAL_BOOST=ON
+ -DEXTERNAL_MPI4PY=ON
+ -DLIB="$(get_libdir)"
+ -DWITH_RC_FILES=OFF
+ )
+ cmake-utils_src_configure
+}
diff --git a/sci-physics/espresso++/espresso++-1.9.3.ebuild b/sci-physics/espresso++/espresso++-1.9.3.ebuild
new file mode 100644
index 000000000000..55b02857e997
--- /dev/null
+++ b/sci-physics/espresso++/espresso++-1.9.3.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit cmake-utils python-single-r1
+
+DESCRIPTION="extensible, flexible, fast and parallel simulation software for soft matter research"
+HOMEPAGE="https://www.espresso-pp.de"
+
+if [[ ${PV} = 9999 ]]; then
+ EHG_REPO_URI="https://bitbucket.org/${PN//+/p}/${PN//+/p}"
+ inherit mercurial
+ KEYWORDS=
+else
+ inherit vcs-snapshot
+ #SRC_URI="https://espressopp.mpip-mainz.mpg.de/Download/${PN//+/p}-${PV}.tgz"
+ SRC_URI="https://bitbucket.org/${PN//+/p}/${PN//+/p}/get/v${PV}.tar.bz2 -> ${P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ virtual/mpi
+ dev-libs/boost:=[python,mpi,${PYTHON_USEDEP}]
+ sci-libs/fftw:3.0
+ dev-python/mpi4py"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DEXTERNAL_BOOST=ON
+ -DEXTERNAL_MPI4PY=ON
+ -DWITH_RC_FILES=OFF
+ )
+ cmake-utils_src_configure
+}
diff --git a/sci-physics/espresso++/files/espresso++-1.6.0-multilib.patch b/sci-physics/espresso++/files/espresso++-1.6.0-multilib.patch
new file mode 100644
index 000000000000..a66988b1bc82
--- /dev/null
+++ b/sci-physics/espresso++/files/espresso++-1.6.0-multilib.patch
@@ -0,0 +1,65 @@
+# HG changeset patch
+# User Christoph Junghans <christoph.junghans@gmail.com>
+# Date 1381325052 -7200
+# Node ID bcdda52214df0c007e44ec8d5045b0e68b142227
+# Parent 65da1a6110e59322efa1bb5eaff596baf9f07d5d
+added LIB variable
+
+diff -r 65da1a6110e5 -r bcdda52214df CMakeLists.txt
+--- a/CMakeLists.txt Tue Oct 08 20:52:46 2013 +0200
++++ b/CMakeLists.txt Wed Oct 09 15:24:12 2013 +0200
+@@ -29,6 +29,9 @@
+ option(BUILD_SHARED_LIBS "Build shared libs" ON)
+ option(BUILD_STANDALONE "Builds pypresso an standalone binary" OFF)
+ option(BUILD_PYTHON_MODULE "Builds epresso as python module" ON)
++if (NOT DEFINED LIB)
++ set(LIB "lib")
++endif(NOT DEFINED LIB)
+
+ if(NOT BUILD_STANDALONE AND NOT BUILD_PYTHON_MODULE)
+ message(FATAL_ERROR "You need to enable pypresso or the python module")
+diff -r 65da1a6110e5 -r bcdda52214df contrib/boost/CMakeLists.txt
+--- a/contrib/boost/CMakeLists.txt Tue Oct 08 20:52:46 2013 +0200
++++ b/contrib/boost/CMakeLists.txt Wed Oct 09 15:24:12 2013 +0200
+@@ -21,4 +21,4 @@
+
+ add_library(espresso_boost ${BOOST_SOURCES})
+ target_link_libraries(espresso_boost ${PYTHON_LIBRARIES} ${VAMPIRTRACE_LIBRARIES} ${MPI_LIBRARIES} ${RT_LIBRARIES})
+-install(TARGETS espresso_boost LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
++install(TARGETS espresso_boost LIBRARY DESTINATION ${LIB} ARCHIVE DESTINATION lib)
+diff -r 65da1a6110e5 -r bcdda52214df contrib/mpi4py/CMakeLists.txt
+--- a/contrib/mpi4py/CMakeLists.txt Tue Oct 08 20:52:46 2013 +0200
++++ b/contrib/mpi4py/CMakeLists.txt Wed Oct 09 15:24:12 2013 +0200
+@@ -12,4 +12,4 @@
+ target_link_libraries(dl ${PYTHON_LIBRARIES} ${VAMPIRTRACE_LIBRARIES} ${MPI_LIBRARIES})
+ set_target_properties(dl PROPERTIES PREFIX "" SUFFIX ".so")
+
+-install(TARGETS MPI LIBRARY DESTINATION ${PYTHON_INSTDIR} ARCHIVE DESTINATION lib)
++install(TARGETS MPI LIBRARY DESTINATION ${PYTHON_INSTDIR} ARCHIVE DESTINATION ${LIB})
+diff -r 65da1a6110e5 -r bcdda52214df src/CMakeLists.txt
+--- a/src/CMakeLists.txt Tue Oct 08 20:52:46 2013 +0200
++++ b/src/CMakeLists.txt Wed Oct 09 15:24:12 2013 +0200
+@@ -70,11 +70,11 @@
+ add_library(espresso_common ${ESPRESSO_SOURCES})
+ target_link_libraries(espresso_common pylogger ${BOOST} ${PYTHON_LIBRARIES}
+ ${VAMPIRTRACE_LIBRARIES} ${MPI_LIBRARIES} ${FFTW3_LIBRARIES})
+-install(TARGETS espresso_common LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
++install(TARGETS espresso_common LIBRARY DESTINATION ${LIB} ARCHIVE DESTINATION lib)
+
+ add_library(pylogger esutil/PyLogger.cpp)
+ target_link_libraries(pylogger ${BOOST})
+-install(TARGETS pylogger LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
++install(TARGETS pylogger LIBRARY DESTINATION ${LIB} ARCHIVE DESTINATION lib)
+
+ if(BUILD_STANDALONE)
+ add_executable(pypresso main/pypresso.cpp)
+diff -r 65da1a6110e5 -r bcdda52214df src/pymodule/CMakeLists.txt
+--- a/src/pymodule/CMakeLists.txt Tue Oct 08 20:52:46 2013 +0200
++++ b/src/pymodule/CMakeLists.txt Wed Oct 09 15:24:12 2013 +0200
+@@ -5,5 +5,5 @@
+ add_dependencies(_espresso scripts)
+ #python libs have not prefix (default would be 'lib')
+ set_target_properties(_espresso PROPERTIES PREFIX "" SUFFIX ".so")
+- install(TARGETS _espresso LIBRARY DESTINATION ${PYTHON_INSTDIR} ARCHIVE DESTINATION lib)
++ install(TARGETS _espresso LIBRARY DESTINATION ${PYTHON_INSTDIR} ARCHIVE DESTINATION ${LIB})
+ endif(BUILD_PYTHON_MODULE)
diff --git a/sci-physics/espresso++/metadata.xml b/sci-physics/espresso++/metadata.xml
new file mode 100644
index 000000000000..ee9feacef4f8
--- /dev/null
+++ b/sci-physics/espresso++/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-physics/espresso/Manifest b/sci-physics/espresso/Manifest
new file mode 100644
index 000000000000..638d0ca97c67
--- /dev/null
+++ b/sci-physics/espresso/Manifest
@@ -0,0 +1 @@
+DIST espresso-3.3.0.tar.gz 18952622 SHA256 64ea2684e4fc0d31c11969e49ec74c25138b4f74686f67b93c7e1103833ff08f SHA512 90edbbdc8d7f7247b5179fce0fad796a9488f82a1754519918c6588c932050675397d36e0167aae770db9803b6c22f7d14d23c04cf307d10802afd3d5d5edc20 WHIRLPOOL 3e9547f2da6676edf3de415fa848301f2959c3dfeef1c3f461b4e1eb202224ead7635748b47d42edb9f661dc5d672f38168e15ab6c55a9c9d7f102ae11f8574e
diff --git a/sci-physics/espresso/espresso-3.3.0.ebuild b/sci-physics/espresso/espresso-3.3.0.ebuild
new file mode 100644
index 000000000000..f35f8ce2d941
--- /dev/null
+++ b/sci-physics/espresso/espresso-3.3.0.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools-utils python-single-r1 savedconfig
+
+DESCRIPTION="Extensible Simulation Package for Research on Soft matter"
+HOMEPAGE="http://espressomd.org"
+
+if [[ ${PV} = 9999 ]]; then
+ EGIT_REPO_URI="git://git.savannah.nongnu.org/espressomd.git"
+ EGIT_BRANCH="master"
+ AUTOTOOLS_AUTORECONF=1
+ inherit git-r3
+ KEYWORDS=""
+else
+ SRC_URI="mirror://nongnu/${PN}md/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="X cuda doc examples +fftw mpi packages python test -tk"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ tk? ( X )"
+
+RESTRICT="tk? ( test )"
+
+RDEPEND="
+ python? (
+ ${PYTHON_DEPS}
+ dev-python/cython[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ )
+ dev-lang/tcl:0=
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
+ fftw? ( sci-libs/fftw:3.0 )
+ mpi? ( virtual/mpi )
+ packages? ( dev-tcltk/tcllib )
+ tk? ( >=dev-lang/tk-8.4.18-r1:0= )
+ X? ( x11-libs/libX11 )"
+
+DEPEND="${RDEPEND}
+ doc? (
+ app-doc/doxygen[dot]
+ dev-texlive/texlive-latexextra
+ virtual/latex-base )"
+
+DOCS=( AUTHORS NEWS README ChangeLog )
+PATCHES=( "${FILESDIR}/${P}-cython-0.22.patch" )
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ use cuda && cuda_src_prepare
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ myeconfargs=(
+ $(use_with fftw) \
+ $(use_with cuda) \
+ $(use_with python python-interface) \
+ $(use_with mpi) \
+ $(use_with tk) \
+ $(use_with X x)
+ )
+ CXX=$(usex mpi "mpic++" "$(tc-getCXX)") autotools-utils_src_configure
+ restore_config myconfig.hpp
+}
+
+src_compile() {
+ autotools-utils_src_compile
+ use doc && autotools-utils_src_compile doxygen
+ [[ ${PV} = 9999 ]] && use doc && autotools-utils_src_compile ug dg tutorials
+}
+
+src_install() {
+ local i
+
+ autotools-utils_src_install
+
+ insinto /usr/share/${PN}
+ doins ${AUTOTOOLS_BUILD_DIR}/myconfig-sample.hpp
+
+ save_config ${AUTOTOOLS_BUILD_DIR}/src/core/myconfig-final.hpp
+
+ if use doc; then
+ if [[ ${PV} = 9999 ]] ; then
+ newdoc "${AUTOTOOLS_BUILD_DIR}"/doc/dg/dg.pdf developer_guide.pdf
+ newdoc "${AUTOTOOLS_BUILD_DIR}"/doc/ug/ug.pdf user_guide.pdf
+ for i in "${AUTOTOOLS_BUILD_DIR}"/doc/tutorials/*/[0-9]*.pdf; do
+ newdoc "${i}" "tutorial_${i##*/}"
+ done
+ else
+ newdoc "${S}"/doc/ug/ug.pdf user_guide.pdf
+ for i in "${S}"/doc/tutorials/*/[0-9]*.pdf; do
+ newdoc "${i}" "tutorial_${i##*/}"
+ done
+ fi
+ dohtml -r "${AUTOTOOLS_BUILD_DIR}"/doc/doxygen/html/*
+ fi
+
+ if use examples; then
+ insinto /usr/share/${PN}/examples
+ doins -r samples/*
+ fi
+
+ if use packages; then
+ insinto /usr/share/${PN}/packages
+ doins -r packages/*
+ fi
+}
+
+pkg_postinst() {
+ echo
+ elog "Please read and cite:"
+ elog "ESPResSo, Comput. Phys. Commun. 174(9) ,704, 2006."
+ elog "http://dx.doi.org/10.1016/j.cpc.2005.10.005"
+ echo
+ elog "If you need more features, change"
+ elog "/etc/portage/savedconfig/${CATEGORY}/${PF}"
+ elog "and reemerge with USE=savedconfig"
+ echo
+ elog "For a full feature list see:"
+ elog "/usr/share/${PN}/myconfig-sample.h"
+ echo
+}
diff --git a/sci-physics/espresso/files/espresso-3.3.0-cython-0.22.patch b/sci-physics/espresso/files/espresso-3.3.0-cython-0.22.patch
new file mode 100644
index 000000000000..22b726b480e1
--- /dev/null
+++ b/sci-physics/espresso/files/espresso-3.3.0-cython-0.22.patch
@@ -0,0 +1,23 @@
+From 9e6caa3294b0f5f377c16550a07429b73c871ac3 Mon Sep 17 00:00:00 2001
+From: Christoph Junghans <junghans@votca.org>
+Date: Thu, 12 Mar 2015 08:55:51 -0600
+Subject: [PATCH] fix build with cython-0.22
+
+---
+ src/python/espressomd/particle_data.pxd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/python/espressomd/particle_data.pxd b/src/python/espressomd/particle_data.pxd
+index fff022b..4cc39e8 100644
+--- a/src/python/espressomd/particle_data.pxd
++++ b/src/python/espressomd/particle_data.pxd
+@@ -185,5 +185,5 @@ cdef class ParticleHandle(object):
+ cdef public int id
+ cdef bint valid
+ cdef Particle particleData
+- cdef int updateParticleData(self)
++ cdef int updateParticleData(self) except -1
+
+--
+2.0.5
+
diff --git a/sci-physics/espresso/metadata.xml b/sci-physics/espresso/metadata.xml
new file mode 100644
index 000000000000..1ef3470bdd04
--- /dev/null
+++ b/sci-physics/espresso/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <use>
+ <flag name="cuda">Enable cuda support</flag>
+ <flag name="examples">Installs the examples</flag>
+ <flag name="packages">Installs extra subpackages</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-physics/fastjet/Manifest b/sci-physics/fastjet/Manifest
new file mode 100644
index 000000000000..86da395fe0ae
--- /dev/null
+++ b/sci-physics/fastjet/Manifest
@@ -0,0 +1,2 @@
+DIST fastjet-3.0.3.tar.gz 2240610 SHA256 6a3e5869cf43b325c7222a925e195b2bd624db922958a926cb4211c00882a50d SHA512 1fcdd0998d222ae089f10676ae1048fdce3e90f6aef3cd51463719b7ab26f8bcdd599d9521c6f9ef18e3989dbffd7f06da717ce845ab7e486a99433129b56f41 WHIRLPOOL b43091b978bde5189ed009ad424934d45607717bfc81e4d0b49c1ce634650bbf9e51019c7bfb0f6ce6298a697e6c8be296feaae1ac31bd2184e44b53a538ba48
+DIST fastjet-3.0.6.tar.gz 2216501 SHA256 9718f1d014afe4433bc0612a67a050d720c486fcfa7ad9c9b96bf087b0f3da0b SHA512 1f01b7ed0e07bd94c88faa123f72c2e3bcd81ad32ab4d03dc0a18dd18635f3b18ba8d339176b0ef1d6e58cecd9f37aaea30b4ad909d2782ce5be7c11e205c3a5 WHIRLPOOL 8c1aeab2724940e41ca6eed093582d6d9a5424b7f2b86af00bd7e1fedd3df0157538c6d97ff08147a4e3a5300d035d683df31b4a7a9d36bc9c14eca9375ae1e1
diff --git a/sci-physics/fastjet/fastjet-3.0.3-r1.ebuild b/sci-physics/fastjet/fastjet-3.0.3-r1.ebuild
new file mode 100644
index 000000000000..230e4ab48bcb
--- /dev/null
+++ b/sci-physics/fastjet/fastjet-3.0.3-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+
+FORTRAN_NEEDED=plugins
+
+inherit autotools-utils fortran-2 flag-o-matic
+
+DESCRIPTION="Fast implementation of several recombination jet algorithms"
+HOMEPAGE="http://www.fastjet.fr/"
+SRC_URI="${HOMEPAGE}/repo/${P}.tar.gz"
+
+LICENSE="GPL-2 QPL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cgal doc examples +plugins static-libs"
+
+RDEPEND="cgal? ( sci-mathematics/cgal )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )
+ plugins? ( sci-physics/siscone )"
+
+PATCHES=( "${FILESDIR}"/${P}-system-siscone.patch )
+
+src_configure() {
+ use cgal && has_version sci-mathematics/cgal[gmp] && append-ldflags -lgmp
+ local myeconfargs=(
+ $(use_enable cgal)
+ $(use_enable plugins allplugins)
+ $(use_enable plugins allcxxplugins)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+ if use doc; then
+ doxygen Doxyfile || die
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ find example \
+ -name Makefile -or Makefile.in -or Makefile.am -delete
+ doins -r example/*
+ fi
+}
diff --git a/sci-physics/fastjet/fastjet-3.0.6-r1.ebuild b/sci-physics/fastjet/fastjet-3.0.6-r1.ebuild
new file mode 100644
index 000000000000..1aa627e9fddb
--- /dev/null
+++ b/sci-physics/fastjet/fastjet-3.0.6-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+FORTRAN_NEEDED=plugins
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils fortran-2 flag-o-matic
+
+DESCRIPTION="Fast implementation of several recombination jet algorithms"
+HOMEPAGE="http://www.fastjet.fr/"
+SRC_URI="${HOMEPAGE}/repo/${P}.tar.gz"
+
+LICENSE="GPL-2 QPL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cgal doc examples +plugins static-libs"
+
+RDEPEND="cgal? ( sci-mathematics/cgal )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[dot] )
+ plugins? ( sci-physics/siscone:0= )"
+
+PATCHES=( "${FILESDIR}"/${P}-system-siscone.patch )
+
+src_configure() {
+ use cgal && \
+ has_version sci-mathematics/cgal[gmp] && append-ldflags -lgmp
+ local myeconfargs=(
+ $(use_enable cgal)
+ $(use_enable plugins allplugins)
+ $(use_enable plugins allcxxplugins)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+ if use doc; then
+ doxygen Doxyfile || die
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dohtml -r html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ find example \
+ -name Makefile -or Makefile.in -or Makefile.am -delete
+ doins -r example/*
+ fi
+}
diff --git a/sci-physics/fastjet/files/fastjet-3.0.3-system-siscone.patch b/sci-physics/fastjet/files/fastjet-3.0.3-system-siscone.patch
new file mode 100644
index 000000000000..b74b8e4e9033
--- /dev/null
+++ b/sci-physics/fastjet/files/fastjet-3.0.3-system-siscone.patch
@@ -0,0 +1,83 @@
+diff -Nur fastjet-3.0.3.orig/configure.ac fastjet-3.0.3/configure.ac
+--- fastjet-3.0.3.orig/configure.ac 2012-06-25 15:15:32.000000000 +0100
++++ fastjet-3.0.3/configure.ac 2012-07-24 18:39:11.000000000 +0100
+@@ -14,7 +14,7 @@
+ dnl - the first macro needs to place the files in the correct
+ dnl dir in order to have the correct -I options for the remote build
+ dnl - see Makefile.am for distcleaning AX_PREFIX_CONFIG_H leftovers
+-AM_CONFIG_HEADER(include/fastjet/config_raw.h:config.h.in)
++AC_CONFIG_HEADERS(include/fastjet/config_raw.h:config.h.in)
+ AX_PREFIX_CONFIG_H(include/fastjet/config_auto.h,FASTJET,include/fastjet/config_raw.h)
+
+ dnl check autoconf version
+@@ -252,6 +252,12 @@
+ fi
+
+ dnl SISCone
++AC_ARG_WITH(bundle-siscone,
++ [ --with-bundle-siscone Build the bundled SISCone library [default=no]],
++ [bundle_siscone=$withval],
++ [bundle_siscone=no])
++AM_CONDITIONAL(BUNDLE_SISCONE, test x$bundle_siscone != xno)
++
+ ACX_CHECK_PLUGIN(SISCone, siscone, SISCONE, yes,
+ [CONFIG_LIBS_PLUGINS=${CONFIG_LIBS_PLUGINS}" -lsiscone_spherical -lsiscone"
+ CONFIG_LIBS_PLUGINS_STATIC=${CONFIG_LIBS_PLUGINS_STATIC}" \${installationdir}/lib/libsiscone.a \${installationdir}/lib/libsiscone_spherical.a"])
+diff -Nur fastjet-3.0.3.orig/example/Makefile.am fastjet-3.0.3/example/Makefile.am
+--- fastjet-3.0.3.orig/example/Makefile.am 2012-06-13 15:14:58.000000000 +0100
++++ fastjet-3.0.3/example/Makefile.am 2012-07-24 18:26:15.000000000 +0100
+@@ -43,7 +43,7 @@
+ 03_plugin_CXXFLAGS = $(AM_CXXFLAGS) $(CGAL_CPPFLAGS) -I$(srcdir)/../include
+ 03_plugin_LDADD = ../src/libfastjet.la $(CGAL_LIBS)
+ 03_plugin_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-03_plugin_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++03_plugin_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ else
+ EXTRA_DIST += 03-plugin.cc
+ endif
+@@ -125,7 +125,7 @@
+ fastjet_areas_LDADD = ../src/libfastjet.la $(CGAL_LIBS)
+ if BUILD_PLUGIN_SISCONE
+ fastjet_areas_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-fastjet_areas_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++fastjet_areas_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ endif
+
+ fastjet_timing_plugins_SOURCES = fastjet_timing_plugins.cc CmdLine.cc
+@@ -135,7 +135,7 @@
+ fastjet_timing_plugins_LDADD += ../tools/libfastjettools.la
+ if BUILD_PLUGIN_SISCONE
+ fastjet_timing_plugins_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-fastjet_timing_plugins_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++fastjet_timing_plugins_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ endif
+ if BUILD_PLUGIN_CDFCONES
+ fastjet_timing_plugins_CXXFLAGS += -I$(srcdir)/../plugins/CDFCones
+diff -Nur fastjet-3.0.3.orig/plugins/SISCone/Makefile.am fastjet-3.0.3/plugins/SISCone/Makefile.am
+--- fastjet-3.0.3.orig/plugins/SISCone/Makefile.am 2012-06-13 15:14:51.000000000 +0100
++++ fastjet-3.0.3/plugins/SISCone/Makefile.am 2012-07-24 18:36:56.000000000 +0100
+@@ -1,11 +1,22 @@
+-SUBDIRS = siscone fastjet .
++SUBDIRS = fastjet .
+
+ if MONOLITHIC_PLUGINS
+ noinst_LTLIBRARIES = libSISConePlugin.la
+ else
+ lib_LTLIBRARIES = libSISConePlugin.la
+ endif
+-libSISConePlugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir) -I$(srcdir)/siscone -I$(srcdir)/../../include
++libSISConePlugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir) -I$(srcdir)/../../include
++
++if BUNDLE_SISCONE
++SUBDIRS += siscone
++libSISConePlugin_la_CXXFLAGS += -I$(srcdir)/siscone
++libSISConePlugin_la_LIBADD = \
++ $(top_builddir)/plugins/SISCone/siscone/siscone/libsiscone.la \
++ $(top_builddir)/plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++else
++libSISConePlugin_la_LIBADD = -lsiscone -lsiscone_spherical
++endif
++
+ libSISConePlugin_la_SOURCES = SISConePlugin.cc SISConeSphericalPlugin.cc
+
+ EXTRA_DIST = makefile.static
diff --git a/sci-physics/fastjet/files/fastjet-3.0.6-system-siscone.patch b/sci-physics/fastjet/files/fastjet-3.0.6-system-siscone.patch
new file mode 100644
index 000000000000..d3995473fe54
--- /dev/null
+++ b/sci-physics/fastjet/files/fastjet-3.0.6-system-siscone.patch
@@ -0,0 +1,74 @@
+diff -Nur fastjet-3.0.6.orig/configure.ac fastjet-3.0.6/configure.ac
+--- fastjet-3.0.6.orig/configure.ac 2014-05-06 10:29:55.240632504 -0700
++++ fastjet-3.0.6/configure.ac 2014-05-06 10:36:20.156246416 -0700
+@@ -261,6 +261,12 @@
+ fi
+
+ dnl SISCone
++AC_ARG_WITH(bundle-siscone,
++ [ --with-bundle-siscone Build the bundled SISCone library [default=no]],
++ [bundle_siscone=$withval],
++ [bundle_siscone=no])
++AM_CONDITIONAL(BUNDLE_SISCONE, test x$bundle_siscone != xno)
++
+ ACX_CHECK_PLUGIN(SISCone, siscone, SISCONE, yes,
+ [CONFIG_LIBS_PLUGINS=${CONFIG_LIBS_PLUGINS}" -lsiscone_spherical -lsiscone"
+ CONFIG_LIBS_PLUGINS_STATIC=${CONFIG_LIBS_PLUGINS_STATIC}" \${installationdir}/lib/libsiscone.a \${installationdir}/lib/libsiscone_spherical.a"])
+diff -Nur fastjet-3.0.6.orig/example/Makefile.am fastjet-3.0.6/example/Makefile.am
+--- fastjet-3.0.6.orig/example/Makefile.am 2014-05-06 10:29:55.239632499 -0700
++++ fastjet-3.0.6/example/Makefile.am 2014-05-06 10:36:20.156246416 -0700
+@@ -43,7 +43,7 @@
+ 03_plugin_CXXFLAGS = $(AM_CXXFLAGS) $(CGAL_CPPFLAGS) -I$(srcdir)/../include
+ 03_plugin_LDADD = ../src/libfastjet.la $(CGAL_LIBS)
+ 03_plugin_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-03_plugin_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++03_plugin_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ else
+ EXTRA_DIST += 03-plugin.cc
+ endif
+@@ -125,7 +125,7 @@
+ fastjet_areas_LDADD = ../src/libfastjet.la $(CGAL_LIBS)
+ if BUILD_PLUGIN_SISCONE
+ fastjet_areas_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-fastjet_areas_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++fastjet_areas_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ endif
+
+ fastjet_timing_plugins_SOURCES = fastjet_timing_plugins.cc CmdLine.cc
+@@ -135,7 +135,7 @@
+ fastjet_timing_plugins_LDADD += ../tools/libfastjettools.la
+ if BUILD_PLUGIN_SISCONE
+ fastjet_timing_plugins_CXXFLAGS += -I$(srcdir)/../plugins/SISCone -I$(srcdir)/../plugins/SISCone/siscone
+-fastjet_timing_plugins_LDADD += ../plugins/SISCone/libSISConePlugin.la ../plugins/SISCone/siscone/siscone/libsiscone.la ../plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++fastjet_timing_plugins_LDADD += ../plugins/SISCone/libSISConePlugin.la
+ endif
+ if BUILD_PLUGIN_CDFCONES
+ fastjet_timing_plugins_CXXFLAGS += -I$(srcdir)/../plugins/CDFCones
+diff -Nur fastjet-3.0.6.orig/plugins/SISCone/Makefile.am fastjet-3.0.6/plugins/SISCone/Makefile.am
+--- fastjet-3.0.6.orig/plugins/SISCone/Makefile.am 2014-05-06 10:29:55.250632584 -0700
++++ fastjet-3.0.6/plugins/SISCone/Makefile.am 2014-05-06 10:36:20.156246416 -0700
+@@ -1,11 +1,22 @@
+-SUBDIRS = siscone fastjet .
++SUBDIRS = fastjet .
+
+ if MONOLITHIC_PLUGINS
+ noinst_LTLIBRARIES = libSISConePlugin.la
+ else
+ lib_LTLIBRARIES = libSISConePlugin.la
+ endif
+-libSISConePlugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir) -I$(srcdir)/siscone -I$(srcdir)/../../include
++libSISConePlugin_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir) -I$(srcdir)/../../include
++
++if BUNDLE_SISCONE
++SUBDIRS += siscone
++libSISConePlugin_la_CXXFLAGS += -I$(srcdir)/siscone
++libSISConePlugin_la_LIBADD = \
++ $(top_builddir)/plugins/SISCone/siscone/siscone/libsiscone.la \
++ $(top_builddir)/plugins/SISCone/siscone/siscone/spherical/libsiscone_spherical.la
++else
++libSISConePlugin_la_LIBADD = -lsiscone -lsiscone_spherical
++endif
++
+ libSISConePlugin_la_SOURCES = SISConePlugin.cc SISConeSphericalPlugin.cc
+
+ EXTRA_DIST = makefile.static
diff --git a/sci-physics/fastjet/metadata.xml b/sci-physics/fastjet/metadata.xml
new file mode 100644
index 000000000000..21ba005f8078
--- /dev/null
+++ b/sci-physics/fastjet/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ The FastJet package provides a fast implementation of the
+ longitudinally invariant kt longitudinally invariant inclusive
+ Cambridge/Aachen and anti-kt jet finders and a uniform interface
+ to external jet finders (notably SISCone) via a plugin
+ mechanism. It also includes tools for calculating jet areas and
+ performing background (pileup/UE) subtraction.
+</longdescription>
+<use>
+ <flag name="plugins"> Build all standard and C++ plugins </flag>
+ <flag name="cgal"> Use <pkg>sci-mathematics/cgal</pkg> instead of
+ bundled algorithms</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/geant-data/Manifest b/sci-physics/geant-data/Manifest
new file mode 100644
index 000000000000..fddec912ae51
--- /dev/null
+++ b/sci-physics/geant-data/Manifest
@@ -0,0 +1,20 @@
+DIST G4ABLA.3.0.tar.gz 54909 SHA256 ff0b77be6b36204eeeba71099f6b7530edd80b79eb015994535bc4334bc821eb SHA512 905a56c142793de005dc5771509cdd8c4f98e596b95223a1a058cbf614cf48805478839eeec3a29594daf3d89c6b4d72cb33b016a596cdadc4247e452afbd526 WHIRLPOOL daa65dd65160cfa62b1a7b747702cc6cf41230f95b406e2e5e18a743524647842639e8c76906334671d00860b88139f4812c811307803bdc4260468b4c6703cb
+DIST G4EMLOW.6.32.tar.gz 17724068 SHA256 bdb3c00af89b18c21553d79fd823110429fdcf1e83c029aa450185d9caf4a7cf SHA512 c1abc0f5e69cd29f5d3885e672937cfe4ff7ec1a37847e6def6e3dd80ba120bb10cfdd80ccfeadc9ed2c37423a87a185ef2b70f78716c8b40a48277a5c0e65fb WHIRLPOOL 5bcb17be16eddd474a3c96f305a968422ca11075683065c3bc3442289fde6b386f04552dbba4d2635ecabd86a79e558b559f0e7aab20960b1774c24291247231
+DIST G4EMLOW.6.35.tar.gz 19092577 SHA256 1564045a0acad344c8d432cd48c2c3bb2e051a81ab3099a84e0f56ba0fe82cec SHA512 106bd9de3a3b729629341f6e3b18bce3ee61239fe7bcf543da5d456a4db9a835a781b64b3b56d1a43e449e41f2d9447f17d3fbbd6006772333237d7f7b7012ab WHIRLPOOL 1cbabfe8195d3e0f477309a1a2579151bb2b39e1b145a0052fcfcff7099fd59e23a588c677f501a181b84aa35ef34a8620076b60124e8167bb68fd824efbbf9e
+DIST G4EMLOW.6.41.tar.gz 19955388 SHA256 6d878b18bf5e748e9d0ea35ef67eebab16df80cc912402986a03a5e1935f4af2 SHA512 4e146ec71efeca63569bc5522f885ba77e3a3b472b2ca7c1a7bcfb6247838b42d6937eccf7f94c899fafa52ffc8cf233fb924684b3fa7c6a3f11ddbca0a03a6b WHIRLPOOL 6ba8d59067da74b5d6a8c286cf7e3cb9f8dfd700356dfa7fedffcc3500eefef0f5c68dac293e2450d63a8946d7a10a6c39a3d343018ea4feacc75a902c84e28b
+DIST G4ENSDFSTATE.1.0.tar.gz 234612 SHA256 4562e7476aa2df7204a1a77263e9d2331e9ffcdb591d11814dcc2d6b605021dd SHA512 ac3f4c4206976e4bbae93f81faca6bd2ce3d86fc10470abe3a06de2b5df58cdb110f4ab4988bfa16d1671759804874977b4feb4cc5bb0930e03c0db1b4c0a112 WHIRLPOOL 0ef5c0355f3f01faaa8ab1ce5e0dcba4cae7218817441cf7831517f419860584f6fc9d60daf74d5cb09b27e0abdf4a0ad2263cef0bb2b9d35ef34d9c0d1d7a36
+DIST G4NDL.4.2.tar.gz 303309551 SHA256 173f60a506b9176d7ff531d6a5f6195dcec74df30ffafc09644f47f979bd641b SHA512 64397c38afbca4365dfed6898220a6946f00f86c5f52ad23b3d10d0ce79504b74ac653ea398f21e1724e4370573f23a62c016490cfed26cc70745a82d9beb7c0 WHIRLPOOL 1c50cd2cf258aeb8a5d029d945eb5dcdb84399012fd693c44fcb98e2d7f4381717138e6a31919235eea268fcf54072c973858040e7e6968764d3036c84090fe7
+DIST G4NDL.4.4.tar.gz 421555304 SHA256 e9fe8800566a83ccaf9b5229a1fa1d2cd24530bbd2e9fcb96eb6b5b117233071 SHA512 25a26411bf6430e90ec5b8098d12259a60bf688728ef9b97afda66002d8f479dadf9ce8c16c4cfd8068da173d492f7667748802690eb29787e9388c1773c8ade WHIRLPOOL 0575033751e881d8ba8ae04ba06d1c788b89ee3c294b8543da817096e1782e82cff9a5b794096694eaa743411bc695d94353ad0ee3f5f1781a1bd2d3753b4557
+DIST G4NDL.4.5.tar.gz 421710294 SHA256 cba928a520a788f2bc8229c7ef57f83d0934bb0c6a18c31ef05ef4865edcdf8e SHA512 166d0189693f14c08fa9c48e4212c1cb275a848fdf0be3dfc4240bd01d1d4816f3ec3c85149995192e7055b58fd56c7e078e9d6819e01fdeafc13457bfa90470 WHIRLPOOL 0eaed7d62b513cc3381c811d282619aebb01e4777c922d89208d58f7b6ec666a398359d983f9cbbd8b6ede53399f7d24b2d7ebac3f1973fc1d1a07d04b4e52cb
+DIST G4NDL4.2.TS.tar.gz 128939542 SHA256 641972c6001fc8f7d4d55e428cf9237e9ae0e44ab0c4940dfbb05e657a8b9851 SHA512 8466b3bb9a604460ba713847dc59bae7cbc5af8204754eb8d46f83bc40e9bb6afff17433bb96fb76f17b4633c6dab6af88e49d30916a1b0bca18f705c18c6779 WHIRLPOOL 3074ad131888eec9e0dfd4fa018d9504437129e0a5b59df09e161970a69b6af9121ba2ac25aca1203d99b8faf831cb60dd90e217c320efd203032639d4e2fa10
+DIST G4NEUTRONXS.1.2.tar.gz 2221211 SHA256 9ce488505b4c3623e2d98209f708a30e3f213a1371a9110d289257a02b2d7d5c SHA512 94a71e7865c0dd4eab7b477d2cd115b3a90fd3528e7807e5ef85651e1add82b1478753c3382437b22b0ec2e774a12d2af942dffaca6c944229553b240a1594bb WHIRLPOOL 2250323bd915963b5efd92c02a946025d367d3530750b5240cbe1338b253f1dea3467b8c8cd16a9a20b70c9654005ae239863d5cfbd78dd6700b5ff17da209fc
+DIST G4NEUTRONXS.1.4.tar.gz 2249001 SHA256 57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd SHA512 f0de306e35d0cacc77fcea4d233077247afa172413a69ef1255e47fd250e36460c38c47265dbc81499dd47c0aca7266c5299cb5c0cabef04684b796ba890f944 WHIRLPOOL 17426f0e690768f789fe9409c01c2b23689745f9a6bef85e825ec25de4b0e166bb93729c174c4162ca5aa5871ba3c367a6b6fd6dfa25c2dfab2e1cd7db67b859
+DIST G4PII.1.3.tar.gz 4293607 SHA256 6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926 SHA512 dc458f5845948f54315477886d28fd51ea2d45f3675f45d42e8352cc5961705d920d200097dc9b55ad826ff426a655258b970ddd5a96867f706eb14e9ebbfd1a WHIRLPOOL 97c0aa7055ee6aaae30223a59f71edc11126560187cf038cd47fbe69c62b610e01f33d7b8d856aaa3f145c08d2bb4fc31047849634e57a6516dd197d6f53be79
+DIST G4PhotonEvaporation.2.3.tar.gz 7508401 SHA256 60449df933794aa0ad3938886c8c023e3093ff59ad6c752923390d5c550f34cb SHA512 1db97368f6579565447083a912ead17cd0fa1021d13aada4ed514e1b3245ff03509c963a064a97a1c7d5f5530ac036427c6c9e29be198976daebe8623c41e664 WHIRLPOOL a1651adbaf38132f89419b9821a1af4e741c3a058016f4946d815b5d48cd096ea057632f91142ac6d87cb38b24b1f26c664601f5838e92a03189c5227daa16c7
+DIST G4PhotonEvaporation.3.0.tar.gz 8864188 SHA256 c76a843672eca21110e97a274a6b5cd9a58b66f35235301c8e1b162926e0e7cb SHA512 a185e034e5d53a5f0aa00a0a701e40c47a667bafe78a41153d2846b102ce578f2a0bda6f95cd5102a8abb752070c91597ca6f940ca0d9ebe7b2eb67529dca552 WHIRLPOOL 0420b01dcc276f8e3561899f15a010d5169cb236280f0b5a988c849f15f5face3b513e9aa75442ccff610cfbd9f7e747c44c9a2633a1167b60984224cdcba31b
+DIST G4PhotonEvaporation.3.1.tar.gz 8406135 SHA256 276ac5f7b45ce96ae0927c7a3fff0942b7007cfe9339540fc22554fea433142e SHA512 415cd4ed7f080ad0003fa106c214d564a6f8a6693e3ddab16fff0ae7ce97aea233c672e0624dac54ce0c8daaddb4f5678c0daad446d2dd3da41df2ef055de419 WHIRLPOOL e681ae24716b5832f02b977762a30a253019540c892c50969930dfef311e3d36e5f930107e0fda22f5988bd53cdd0ba682fb7d8c04cadb72548fcb136b9b0aa7
+DIST G4RadioactiveDecay.3.6.tar.gz 736879 SHA256 3502ed4be04d694115a3acf59d7a3593725a2d79f3adad0ffa135ff653f89d1d SHA512 30502587d5f1cd5e365c6803e286bcb469999642fdc56bb8f162736b31334f09aae9f96bd71ac1a664fca7a303127c10c5ffe5b460e846756977e97a5f958d51 WHIRLPOOL c991d159c952a6d59e355cd0a691a5a9a8de07bb8985cdc4797853a56c38b3f6320928a3dc1fa19d21a35be9dddc7d6901116f10bb347b2a5bcef70dbe71c06e
+DIST G4RadioactiveDecay.4.0.tar.gz 985509 SHA256 ed2053bddee507920a29a27db4364fbef255b951597686b0410d5458e9b38cb5 SHA512 5caa7b69643acb3071003a81950177061d8221c2b64e9babc46f8aebfe97cea2875ff664183b441a37f0b2c0fb7b3624998ac3f012a2e0308c5fd1ab4b7b8f8d WHIRLPOOL ece7aa1f4734b69af8cceaab6dc7c573ea962efd332e1e778ec1e0b7abf15c7acdaddfd518e6e357633214a58621b076b6ec88836fc7ba945b191cc56b79e325
+DIST G4RadioactiveDecay.4.2.tar.gz 997307 SHA256 cf1946d9e2c222ec1311e7ed94a54a6646cf519b71299e2297a6be3c85ba3c82 SHA512 4d2f2283e8355f2c3f7dee2dabed5123ebe52c4ee255e41841edc64a94a8a85255b4c0ed382a99af67ff605a624ed87d6230c2deb4b6b4df2d16f82079dfea3d WHIRLPOOL 03ad64db8e993d7609e007e3656d0cec6a1e8cb9c3fecf343eab6d53c11688ef647c713a569a3bfb8702a75b4898d1b1a7e60e84c6c622d730c50c6fc26720ea
+DIST G4SAIDDATA.1.1.tar.gz 25800 SHA256 a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f SHA512 191627972dbf859e40e07ec4a63c5e7300571da6792c2588a6ad997e246c3fc41e890679aced918ba2496586da643c23884c4d9754329387e3579e52c87b6202 WHIRLPOOL d47075356db9e5589f12c03563143d1fd816e78d165785d5f37a415a8f1504be8e471064b81311f27a54cf108259dec07b0ef22fbc30374afaa4d46d7e7b648a
+DIST RealSurface.1.0.tar.gz 1257863 SHA256 3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1 SHA512 6457e1931fe1989f822493dbcb3193d97fdb37ecdc8341e953af1fb66816aa589e9d5abaa8a937e4599924c005fc32c763dd0db9af567c4c94aa07fae292be76 WHIRLPOOL 7b36a782278a663866b5676fda2ed5425c61219804aaa3fb6042455f6815e0e16a0f82445947d6e1a9585b9c09fb88fb70230bfd692f3bf10aa4ac8c43c37cae
diff --git a/sci-physics/geant-data/geant-data-4.10.00.ebuild b/sci-physics/geant-data/geant-data-4.10.00.ebuild
new file mode 100644
index 000000000000..35aeb9274a26
--- /dev/null
+++ b/sci-physics/geant-data/geant-data-4.10.00.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Data files for Geant4 physical processes"
+HOMEPAGE="http://geant4.cern.ch/"
+
+GEANT4_DATA="
+ G4NDL.4.4
+ G4EMLOW.6.35
+ G4RadioactiveDecay.4.0
+ G4SAIDDATA.1.1
+ G4NEUTRONXS.1.4
+ G4PII.1.3
+ G4PhotonEvaporation.3.0
+ G4ABLA.3.0
+ RealSurface.1.0
+ G4ENSDFSTATE.1.0"
+
+SRC_COM="http://geant4.cern.ch/support/source"
+for d in ${GEANT4_DATA}; do
+ SRC_URI="${SRC_URI} ${SRC_COM}/${d}.tar.gz"
+done
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=sci-physics/geant-${PV}:4"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # unpack in destination only to avoid copy
+ return
+}
+
+prout() {
+ for d in ${GEANT4_DATA}; do
+ local p=${d/.}
+ doins -r *${p/G4}
+ done
+}
+
+src_install() {
+ sed -n "s,export \(G4.\+DATA=\"\).*\(/share/Geant.\+/data/.\+\) > /dev/null ; pwd\`,\1${EROOT%/}/usr\2,p" \
+ "${EROOT}/usr/bin/geant4.sh" > 99geant-data
+ doenvd 99geant-data
+ local g4dir=/usr/$(sed -n 's|.*/\(share/Geant4.*/data\).*|\1|p' "${EROOT}/usr/bin/geant4.sh" | tail -n 1)
+ dodir ${g4dir}
+ cd "${ED}${g4dir}"
+ unpack ${A}
+}
diff --git a/sci-physics/geant-data/geant-data-4.10.01.ebuild b/sci-physics/geant-data/geant-data-4.10.01.ebuild
new file mode 100644
index 000000000000..834d92861570
--- /dev/null
+++ b/sci-physics/geant-data/geant-data-4.10.01.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Data files for Geant4 physical processes"
+HOMEPAGE="http://geant4.cern.ch/"
+
+GEANT4_DATA="
+ G4NDL.4.5
+ G4EMLOW.6.41
+ G4RadioactiveDecay.4.2
+ G4SAIDDATA.1.1
+ G4NEUTRONXS.1.4
+ G4PII.1.3
+ G4PhotonEvaporation.3.1
+ G4ABLA.3.0
+ RealSurface.1.0
+ G4ENSDFSTATE.1.0"
+
+SRC_COM="http://geant4.cern.ch/support/source"
+for d in ${GEANT4_DATA}; do
+ SRC_URI="${SRC_URI} ${SRC_COM}/${d}.tar.gz"
+done
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=sci-physics/geant-${PV}:4"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # unpack in destination only to avoid copy
+ return
+}
+
+prout() {
+ for d in ${GEANT4_DATA}; do
+ local p=${d/.}
+ doins -r *${p/G4}
+ done
+}
+
+src_install() {
+ sed -n "s,export \(G4.\+DATA=\"\).*\(/share/Geant.\+/data/.\+\) > /dev/null ; pwd\`,\1${EROOT%/}/usr\2,p" \
+ "${EROOT}/usr/bin/geant4.sh" > 99geant-data
+ doenvd 99geant-data
+ local g4dir=/usr/$(sed -n 's|.*/\(share/Geant4.*/data\).*|\1|p' "${EROOT}/usr/bin/geant4.sh" | tail -n 1)
+ dodir ${g4dir}
+ cd "${ED}${g4dir}"
+ unpack ${A}
+}
diff --git a/sci-physics/geant-data/geant-data-4.9.6_p02.ebuild b/sci-physics/geant-data/geant-data-4.9.6_p02.ebuild
new file mode 100644
index 000000000000..d2078df93a54
--- /dev/null
+++ b/sci-physics/geant-data/geant-data-4.9.6_p02.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Data files for Geant4 physical processes"
+HOMEPAGE="http://geant4.cern.ch/"
+
+NDLPV=4.2
+GEANT4_DATA="
+ G4NDL.${NDLPV}
+ G4EMLOW.6.32
+ G4RadioactiveDecay.3.6
+ G4SAIDDATA.1.1
+ G4NEUTRONXS.1.2
+ G4PII.1.3
+ G4PhotonEvaporation.2.3
+ G4ABLA.3.0
+ RealSurface.1.0"
+
+SRC_COM="http://geant4.cern.ch/support/source"
+SRC_URI="${SRC_COM}/G4NDL${NDLPV}.TS.tar.gz"
+for d in ${GEANT4_DATA}; do
+ SRC_URI="${SRC_URI} ${SRC_COM}/${d}.tar.gz"
+done
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="~sci-physics/geant-${PV}:4"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # unpack in destination only to avoid copy
+ return
+}
+
+prout() {
+ for d in ${GEANT4_DATA}; do
+ local p=${d/.}
+ doins -r *${p/G4}
+ done
+}
+
+src_install() {
+ sed -n "s,export \(G4.\+DATA=\"\).*\(/share/Geant.\+/data/.\+\) > /dev/null ; pwd\`,\1${EROOT%/}/usr\2,p" \
+ "${EROOT}/usr/bin/geant4.sh" > 99geant-data
+ doenvd 99geant-data
+ local g4dir=/usr/$(sed -n 's|.*/\(share/Geant4.*/data\).*|\1|p' "${EROOT}/usr/bin/geant4.sh" | tail -n 1)
+ dodir ${g4dir}
+ cd "${ED}${g4dir}"
+ unpack ${A}
+}
diff --git a/sci-physics/geant-data/metadata.xml b/sci-physics/geant-data/metadata.xml
new file mode 100644
index 000000000000..da64a592e0ee
--- /dev/null
+++ b/sci-physics/geant-data/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ For specific, optional physics processes, Geant4 uses extra data
+ which are being installed with this package.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/geant-python/Manifest b/sci-physics/geant-python/Manifest
new file mode 100644
index 000000000000..7ba827c92786
--- /dev/null
+++ b/sci-physics/geant-python/Manifest
@@ -0,0 +1,2 @@
+DIST geant4.10.00.tar.gz 30780131 SHA256 ffec1714b03748b6d691eb0b91906f4c74422c1ad1f8afa918e03be421af8a17 SHA512 c9288b26df8b858622e728158b687cd7bc257c49f26a21b93d1b9fa4619c22dfea2a7604689118ac493b407888690db42d1ec9c8048aa1f45bf8beeb6a657e87 WHIRLPOOL 20eb2002e867a0fe3dab683820ebeeb5de2140c5cd7c4c57c07b5da2a62900d4ee2bf1f6372e034781ed536001e40a5a79d5654729e45a16995415febfefb26d
+DIST geant4.9.6.p02.tar.gz 25480383 SHA256 cf5df83b7e2c99e6729449b32d3ecb0727b4692317426b66fc7fd41951c7351f SHA512 dab5f31568074869adecbbfb8855be0c0a2e92e5ba3119dbeb9cd414878721df3052198a05e5e3c19d0e2942a22602c6618dc0628b05134d3403a50c2bc2032c WHIRLPOOL 8c66d8aa1605a42e6b6f054c32eb49df0bb2afcdf54360ff630908ce7cfc8a7a37b62cdb2a1612af05f1f70a5575c6516aad1f6737a67692449b01e1137b2865
diff --git a/sci-physics/geant-python/files/geant-python-4.10.0-config.patch b/sci-physics/geant-python/files/geant-python-4.10.0-config.patch
new file mode 100644
index 000000000000..50f4dabb43c3
--- /dev/null
+++ b/sci-physics/geant-python/files/geant-python-4.10.0-config.patch
@@ -0,0 +1,27 @@
+do not hard code PATH; QGSP.hh is renamed to G4QGSParticipants.hh in geant-4.10
+
+http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1545
+http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1546
+Index: g4py/configure
+===================================================================
+--- g4py.orig/configure
++++ g4py/configure
+@@ -4,9 +4,6 @@
+ # ======================================================================
+ export LANG=C
+
+-PATH=/bin:/usr/bin
+-export PATH
+-
+ # ======================================================================
+ # testing the echo features
+ # ======================================================================
+@@ -377,7 +374,7 @@ fi
+
+ # ---
+ echo $ac_n "Checking for physics list support ...$ac_c"
+-if [ -f "$g4_incdir"/QGSP.hh ]; then
++if [ -f "$g4_incdir"/G4QGSParticipants.hh ]; then
+ enable_physicslist=1
+ fi
+ if [ $enable_physicslist = 0 ]; then
diff --git a/sci-physics/geant-python/files/geant-python-4.10.0-polycone.patch b/sci-physics/geant-python/files/geant-python-4.10.0-polycone.patch
new file mode 100644
index 000000000000..492e4700ac4f
--- /dev/null
+++ b/sci-physics/geant-python/files/geant-python-4.10.0-polycone.patch
@@ -0,0 +1,15 @@
+polycone API has been changed.
+
+http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1544
+Index: g4py/source/geometry/pyG4Polycone.cc
+===================================================================
+--- g4py.orig/source/geometry/pyG4Polycone.cc
++++ g4py/source/geometry/pyG4Polycone.cc
+@@ -96,7 +96,6 @@ void export_G4Polycone()
+ .def("GetStartPhi", &G4Polycone::GetStartPhi)
+ .def("GetEndPhi", &G4Polycone::GetEndPhi)
+ .def("IsOpen", &G4Polycone::IsOpen)
+- .def("IsGeneric", &G4Polycone::IsGeneric)
+ .def("GetNumRZCorner", &G4Polycone::GetNumRZCorner)
+
+ // operators
diff --git a/sci-physics/geant-python/files/geant-python-4.9.5-visverbose.patch b/sci-physics/geant-python/files/geant-python-4.9.5-visverbose.patch
new file mode 100644
index 000000000000..0508f28b6fa6
--- /dev/null
+++ b/sci-physics/geant-python/files/geant-python-4.9.5-visverbose.patch
@@ -0,0 +1,13 @@
+diff --git a/source/visualization/pyG4VisManager.cc b/source/visualization/pyG4VisManager.cc
+index 33bb0d4..00f86a5 100644
+--- a/source/visualization/pyG4VisManager.cc
++++ b/source/visualization/pyG4VisManager.cc
+@@ -41,7 +41,7 @@ using namespace boost::python;
+ // ====================================================================
+ class PyG4VisManager : public G4VisManager {
+ public:
+- PyG4VisManager() { SetVerboseLevel(quiet); }
++ PyG4VisManager() { SetVerboseLevel(all); }
+ ~PyG4VisManager() { }
+
+ virtual void RegisterGraphicsSystems() { }
diff --git a/sci-physics/geant-python/geant-python-4.10.00.ebuild b/sci-physics/geant-python/geant-python-4.10.00.ebuild
new file mode 100644
index 000000000000..d677e3e28a6b
--- /dev/null
+++ b/sci-physics/geant-python/geant-python-4.10.00.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit python-r1 versionator multilib eutils
+
+MYP="geant$(replace_version_separator 3 .)"
+
+DESCRIPTION="Python bindings for Geant4"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="geant4"
+SLOT="0"
+IUSE="examples"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-libs/boost[${PYTHON_USEDEP}]
+ dev-libs/xerces-c
+ =sci-physics/geant-${PV}*"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MYP}/environments/g4py"
+
+pkg_setup() {
+ if use amd64; then
+ ARG=linux64
+ elif use x86; then
+ ARG=linux
+ else
+ die "platform unknown"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.9.5-visverbose.patch
+ epatch "${FILESDIR}"/${PN}-4.10.0-config.patch
+ epatch "${FILESDIR}"/${PN}-4.10.0-polycone.patch
+ sed -i -e "s/lib64/$(get_libdir)/g" configure || die
+ sed -i -e 's/-lG4clhep/-lCLHEP/g' config/g4py.gmk || die
+ # respect user toolchain and flags
+ sed -i \
+ -e '/^CXX.*:=/d' \
+ -e '/CXXFLAGS/s/-f\(template-depth-255\|inline-functions\|permissive\)//g' \
+ -e "/CXXFLAGS/s/-O2/${CXXFLAGS}/g" \
+ -e '/^rpathflag/s|:\($(rpath.)\)| -Wl,-rpath,\1 |g' \
+ -e "s/\$(rpathflag)/\$(LDFLAGS) \$(rpathflag)/g" \
+ config/sys/linux* || die
+ python_copy_sources
+
+ run_sed() {
+ sed -i -e "s/\(python_exe=\)python/\1${EPYTHON}/" configure || die
+ [[ ${EPYTHON} == python3* ]] && sed -i -e "s/with_python3=0/with_python3=1/" configure
+ # let Geant4 module installed into python sitedir instead of default
+ sed -i \
+ -e "/G4PY_LIBDIR :=/cG4PY_LIBDIR := $\(DESTDIR\)$(python_get_sitedir)/Geant4" \
+ config/install.gmk || die "sed failed on config/install.gmk"
+
+ local mfile
+ for mfile in source/python{3,}/GNUmakefile
+ do
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/Geant4" \
+ "${mfile}" || die "sed failed on ${mfile}"
+ done
+
+ # let g4py module installed into python sitedir instead of default
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/g4py" \
+ config/site-install.gmk || die "sed failed on config/site-install.gmk"
+ for mfile in {processes/emcalculator,utils/MCScore}/{python3/,}GNUmakefile python/GNUmakefile
+ do
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/g4py" \
+ "site-modules/${mfile}" || die "sed failed on site-modules/${mfile}"
+ done
+
+ }
+ python_foreach_impl run_in_build_dir run_sed
+}
+
+src_configure() {
+ run_configure() {
+ # not the autotools configure
+ ./configure ${ARG} \
+ --prefix="${EPREFIX}/usr" \
+ --with-g4install-dir="${EPREFIX}/usr" \
+ --with-python-incdir="$(python_get_includedir)" \
+ --with-python-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-boost-incdir="${EPREFIX}/usr/include" \
+ --with-boost-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-boost-python-lib="boost_python-${EPYTHON#python}" \
+ --with-xercesc-incdir="${EPREFIX}/usr/include" \
+ --with-xercesc-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ || die "configure failed"
+ }
+ python_foreach_impl run_in_build_dir run_configure
+}
+
+src_compile() {
+ python_foreach_impl run_in_build_dir emake CPPVERBOSE=1
+}
+
+src_test() {
+ run_test() {
+ emake -C tests
+ }
+ python_foreach_impl run_in_build_dir run_test
+}
+
+src_install() {
+ python_foreach_impl run_in_build_dir emake DESTDIR="${D}" install
+ dodoc README.md History
+ insinto /usr/share/doc/${PF}
+ use examples && doins -r examples
+}
diff --git a/sci-physics/geant-python/geant-python-4.9.6_p02.ebuild b/sci-physics/geant-python/geant-python-4.9.6_p02.ebuild
new file mode 100644
index 000000000000..d054aa4e6c61
--- /dev/null
+++ b/sci-physics/geant-python/geant-python-4.9.6_p02.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit python-r1 versionator multilib eutils
+
+MYP="geant$(replace_version_separator 3 .)"
+
+DESCRIPTION="Python bindings for Geant4"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="geant4"
+SLOT="0"
+IUSE="examples"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-libs/boost[${PYTHON_USEDEP}]
+ dev-libs/xerces-c
+ =sci-physics/geant-${PV}*"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MYP}/environments/g4py"
+
+pkg_setup() {
+ if use amd64; then
+ ARG=linux64
+ elif use x86; then
+ ARG=linux
+ else
+ die "platform unknown"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.9.5-visverbose.patch
+ sed -i -e "s/lib64/$(get_libdir)/g" configure || die
+ sed -i -e 's/-lG4clhep/-lCLHEP/g' config/g4py.gmk || die
+ # respect user toolchain and flags
+ sed -i \
+ -e '/^CXX.*:=/d' \
+ -e '/CXXFLAGS/s/-f\(template-depth-255\|inline-functions\|permissive\)//g' \
+ -e "/CXXFLAGS/s/-O2/${CXXFLAGS}/g" \
+ -e '/^rpathflag/s|:\($(rpath.)\)| -Wl,-rpath,\1 |g' \
+ -e "s/\$(rpathflag)/\$(LDFLAGS) \$(rpathflag)/g" \
+ config/sys/linux* || die
+ python_copy_sources
+
+ run_sed() {
+ sed -i -e "s/\(python_exe=\)python/\1${EPYTHON}/" configure || die
+ [[ ${EPYTHON} == python3* ]] && sed -i -e "s/with_python3=0/with_python3=1/" configure
+ # let Geant4 module installed into python sitedir instead of default
+ sed -i \
+ -e "/G4PY_LIBDIR :=/cG4PY_LIBDIR := $\(DESTDIR\)$(python_get_sitedir)/Geant4" \
+ config/install.gmk || die "sed failed on config/install.gmk"
+
+ local mfile
+ for mfile in source/python{3,}/GNUmakefile
+ do
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/Geant4" \
+ "${mfile}" || die "sed failed on ${mfile}"
+ done
+
+ # let g4py module installed into python sitedir instead of default
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/g4py" \
+ config/site-install.gmk || die "sed failed on config/site-install.gmk"
+ for mfile in {processes/emcalculator,utils/MCScore}/{python3/,}GNUmakefile python/GNUmakefile
+ do
+ sed -i \
+ -e "/install_dir :=/cinstall_dir := $\(DESTDIR\)$(python_get_sitedir)/g4py" \
+ "site-modules/${mfile}" || die "sed failed on site-modules/${mfile}"
+ done
+
+ }
+ python_foreach_impl run_in_build_dir run_sed
+}
+
+src_configure() {
+ run_configure() {
+ # not the autotools configure
+ ./configure ${ARG} \
+ --prefix="${EPREFIX}/usr" \
+ --with-g4install-dir="${EPREFIX}/usr" \
+ --with-python-incdir="$(python_get_includedir)" \
+ --with-python-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-boost-incdir="${EPREFIX}/usr/include" \
+ --with-boost-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-boost-python-lib="boost_python-${EPYTHON#python}" \
+ --with-xercesc-incdir="${EPREFIX}/usr/include" \
+ --with-xercesc-libdir="${EPREFIX}/usr/$(get_libdir)" \
+ || die "configure failed"
+ }
+ python_foreach_impl run_in_build_dir run_configure
+}
+
+src_compile() {
+ python_foreach_impl run_in_build_dir emake CPPVERBOSE=1
+}
+
+src_test() {
+ run_test() {
+ emake -C tests
+ }
+ python_foreach_impl run_in_build_dir run_test
+}
+
+src_install() {
+ python_foreach_impl run_in_build_dir emake DESTDIR="${D}" install
+ dodoc README.md History
+ insinto /usr/share/doc/${PF}
+ use examples && doins -r examples
+}
diff --git a/sci-physics/geant-python/metadata.xml b/sci-physics/geant-python/metadata.xml
new file mode 100644
index 000000000000..182d59e5d7a2
--- /dev/null
+++ b/sci-physics/geant-python/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ Python binding to Geant 4.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/geant/Manifest b/sci-physics/geant/Manifest
new file mode 100644
index 000000000000..4ed1693853c4
--- /dev/null
+++ b/sci-physics/geant/Manifest
@@ -0,0 +1,17 @@
+DIST G4ABLA.3.0.tar.gz 54909 SHA256 ff0b77be6b36204eeeba71099f6b7530edd80b79eb015994535bc4334bc821eb SHA512 905a56c142793de005dc5771509cdd8c4f98e596b95223a1a058cbf614cf48805478839eeec3a29594daf3d89c6b4d72cb33b016a596cdadc4247e452afbd526 WHIRLPOOL daa65dd65160cfa62b1a7b747702cc6cf41230f95b406e2e5e18a743524647842639e8c76906334671d00860b88139f4812c811307803bdc4260468b4c6703cb
+DIST G4EMLOW.6.19.tar.gz 14396144 SHA256 8876defe74e4c1e9d6b58b2365a9b468ac8d996fb63fa1c6ba6240e0b185845f SHA512 c877f02a40337333dc6a18c9a86436913d7d090e5cd6f0db861c66190d22046edb5dd7a7cb362183e6fa596c80aded5646b322329d0c12948732fb9e55998527 WHIRLPOOL bd534e91cecbcab46f64eaf1f917931013b84a8347bbe0a94d184afb1467984a0421b3336c3f2dcdda02f5d13b3dcc05a1e82ffd4d5d406baab2e7d2c633a596
+DIST G4NDL.3.14.tar.gz 58794491 SHA256 08ff1d4fb0953f2502d88f76fb9db1d4314c975564731f11c9372d0ea992cafa SHA512 bc0bd6ec22184de370f36f076b2904ee6c7cfad963e8b4dcbfc499eaf7af1440c5c00c2520e6df2b12be256a71f8fe49a8071292a645a88f179d3f5b12348b39 WHIRLPOOL 4d6a20303b658756b27120a2627177c13b47eb3ab8f426d7ef7d158ba2f8d07b728cc31ffe606b6a9767708648fba2916a76c5facdca90fda6d1258ea3fe9a3c
+DIST G4NEUTRONXS.1.0.tar.gz 1186619 SHA256 577d28b7faa41caacb001a30384028cd5e3b7018755ab94a427ce0a7feeab365 SHA512 48ba2739233230765a0f5fa492c5190aed17cba631f115dc2a7a6aaf780185b390dc62277abd1ec81fd903003d7c3903857f10add75d89bfbedaffc498555e1c WHIRLPOOL 615b402916ef01a4610c202250a2c106ae0e7a233590fdca70c9694536503b0e24b7ca0200867734938bf000afae4de0658c6448cb57ae762357a9e87ffe6ddc
+DIST G4PII.1.2.tar.gz 3387814 SHA256 80e680d7343ed051bcfffd910c682cfd66980cecd1c0bc435f06c6c740a6f99d SHA512 ac02d4af6483665968ce4ad04442513ee32f850c82bbb81c2630a233246005534a9708502b79159e72b872bd44c414d44e4b53aa23d4b4e4d43527343d25ef95 WHIRLPOOL 50c56b1fccb8cf357bb5fe897c3f4b0b11a5548044ea3664992bc7d8006f0a8be4b29f414f9d9411947bb9184d9ac8ca43dea0d79b8dbcd57043e9b99c06cb5d
+DIST G4PhotonEvaporation.2.1.tar.gz 7504003 SHA256 08ab657a060518c9b7aab03b17628cbb31585ee9512e0f2033f2fb0d7d9b2bc7 SHA512 ea3a2d1ceb025f595d2cdac1c77215d89c95cd314e6cb44f88f3010bdea3c6397e8310a55a82b43a235301db9a7e3fef754bb93f717e513dca97e6b8a01fdd47 WHIRLPOOL fd77105445137960b607bfe17a1357a7722bbf9af0242db6e7aeb374a779444b838b1bc7549c3a0eaaceaf6702595dc90ccea1bedda74588db8460131acb0860
+DIST G4RadioactiveDecay.3.3.tar.gz 732628 SHA256 7f421d6808422f9186a8a96fc1889a54af03c80a37b9f9d1d51ab359ea0264d1 SHA512 a340618134e6c66ce51f1762a68aebb7b2f2467b7d4f3717e4e2bae1f98ed248dcb62f71ceb9bcfe41282253f7b53dfac8e557007c9414f88750abce3b1402e8 WHIRLPOOL 95eeec8b1c2a8fb2f39fb1903e7479649e49e32421b513224541b36784986a2f932c9c9a08d966d47ab21d9e89288673a7ead78f7fb4d042c32e30d5212485c7
+DIST RealSurface.1.0.tar.gz 1257863 SHA256 3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1 SHA512 6457e1931fe1989f822493dbcb3193d97fdb37ecdc8341e953af1fb66816aa589e9d5abaa8a937e4599924c005fc32c763dd0db9af567c4c94aa07fae292be76 WHIRLPOOL 7b36a782278a663866b5676fda2ed5425c61219804aaa3fb6042455f6815e0e16a0f82445947d6e1a9585b9c09fb88fb70230bfd692f3bf10aa4ac8c43c37cae
+DIST geant321_3.21.14.dfsg-11.debian.tar.gz 52237 SHA256 62d95386cfe0d83e7d26b5b38be2d249276002441e57c67452930e18a9d177d8 SHA512 a3b6dea7b0df1ecb89bfb974339d3b5aed6815874f453040b37377ab9e9217d6970429d7a346c62f2b289bb8911aafa3569edc7499c13b7b2d3fac23e2a773c9 WHIRLPOOL 7fa57b667f880c877e12e828ca9db5f845d8fbdbfd070da6e30d9450192ce935e339eaf83ffaf3c7426d89bf4608a71e06a518ef9ae95059a2b4a288d7107c96
+DIST geant321_3.21.14.dfsg-8.diff.gz 41909 SHA256 785277dab1e1d3e17d60c85f3826bc67bbd6de7e6a6d40ff7af901371c4d2ce1 SHA512 d69ecb773f06bb1bfea8c336297b693bf1ff62c051408bd64398077b7ccc81a893ad69a29dbe127d78cbe7d6bce125423fc53a68fc719880ee13e03dc4e52662 WHIRLPOOL 9e2fcd4c8f32dba1af6f71e1fd7153c9ab9a26d6200ca71ab2152df0e66d9ed3933d4f27fc44a0fa1f9a8caa375b2f2be0414c681faec3c79545aa733a0ad01f
+DIST geant321_3.21.14.dfsg-9.diff.gz 47589 SHA256 419bc2315e2692fe84b353d445cbae7af995d84a6a0290b7f9051ee041243d20 SHA512 fd04f42e5ca8bc7f8015bacf038a78e90ac0ebc95ab85ed65e2010a7c05aed8874057de9f28e11fefee8b6c6b983a5db8dcd8480953c185e6d45d1ca16adba01 WHIRLPOOL 6ca0e08fdf464076dda58cd26dc7c92511d82315ea58979de8201c3f8eeab6860bb136d1ebffcea23b7a53b71b5a6a894495b3153c905aa31f9260517f30e526
+DIST geant321_3.21.14.dfsg.orig.tar.gz 10922928 SHA256 186fe98a08ad1de39f68698a09a46e7c2f14c37b22f8f990257b0bd66215c5b4 SHA512 733a77e529ecfe17c35d1e0bf44cf9062dbd9f2e3880e12cbfabf7372e6c60ea9690df010574094b44aef6fe306dfd85dfd4f42641b8f03efda3938a50313734 WHIRLPOOL fc2b230e1bf2ae1157cf9c92f474ff72fc1f3158e5db5a8f1a7d4f7c983fae9b886dc1aeb148019cb961bc602abc629d75a1aa728d66b10887daa45de040def6
+DIST geant4.10.00.p01.tar.gz 29701289 SHA256 09c431ff3ef81034282c46501cea01046d4a20438c2ea2a7339576e1ecf26ba0 SHA512 d7be39580a8dafa55b1a52b498e4a24312499a33d41954d8684385ce57c903430b2c56386728ad9a70d21af6634fbb8d6b55b2ef9c56b6c9272671e66bf9119d WHIRLPOOL d85a84be7166e949a72d6200f6a00a86bb9611a215270e2021cf5f214e78a9b05095816bb5bb135235bdcccd8949b4460a624fce68764485bbbcd06b5a974889
+DIST geant4.10.00.tar.gz 30780131 SHA256 ffec1714b03748b6d691eb0b91906f4c74422c1ad1f8afa918e03be421af8a17 SHA512 c9288b26df8b858622e728158b687cd7bc257c49f26a21b93d1b9fa4619c22dfea2a7604689118ac493b407888690db42d1ec9c8048aa1f45bf8beeb6a657e87 WHIRLPOOL 20eb2002e867a0fe3dab683820ebeeb5de2140c5cd7c4c57c07b5da2a62900d4ee2bf1f6372e034781ed536001e40a5a79d5654729e45a16995415febfefb26d
+DIST geant4.10.01.tar.gz 43759041 SHA256 d37400e96423fedfbf8dbe1f49e2ef0367317c3893ad99f28eed06bf97e1feb7 SHA512 6b9f154f705e7ca4918dea3e2a9ccc0e6fa8806fd4466b4b947f9beec35968640dbe32d383c2a138f15e40b10085c717256cc1604f4d8407e7cb28e5772b52e6 WHIRLPOOL 24316ae5a05026d7e2eff8fad2d628b2198f810d8a82bb934c6c9481961b6b8b3d68393aed785aa8664ea57074e006211df1d9391fbaed154578fe03f3fb6339
+DIST geant4.9.4.p03.tar.gz 25241424 SHA256 5090ca5b506238f16ba2ae2176221a18b6fde06f91180850a109fae1006910c0 SHA512 281b224c126c41cda6b128218dfeb2d77e0e06ca08d2a3dd039be009e3736f3befbf8dd8838543eea197341a5c382543240bf429c38e5e8ca6f0628eb65080b4 WHIRLPOOL 6e9929296624b35cf83a7325d32221f2aaf724b1c27e4f666fea960343c030f08be61723998c5c19cd74a688610a123e3699c907fe5e44f8df2e8058f8691ea5
+DIST geant4.9.6.p02.tar.gz 25480383 SHA256 cf5df83b7e2c99e6729449b32d3ecb0727b4692317426b66fc7fd41951c7351f SHA512 dab5f31568074869adecbbfb8855be0c0a2e92e5ba3119dbeb9cd414878721df3052198a05e5e3c19d0e2942a22602c6618dc0628b05134d3403a50c2bc2032c WHIRLPOOL 8c66d8aa1605a42e6b6f054c32eb49df0bb2afcdf54360ff630908ce7cfc8a7a37b62cdb2a1612af05f1f70a5575c6516aad1f6737a67692449b01e1137b2865
diff --git a/sci-physics/geant/files/geant-4.10.0-TrackingNavigator.patch b/sci-physics/geant/files/geant-4.10.0-TrackingNavigator.patch
new file mode 100644
index 000000000000..e3cc8d6594a5
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.10.0-TrackingNavigator.patch
@@ -0,0 +1,60 @@
+accepted upstream. to be removed in the next minor release.
+
+https://bugs.gentoo.org/show_bug.cgi?id=496678
+http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1537
+
+diff -Naur geant4.10.00/source/geometry/navigation/include/G4TransportationManager.hh geant4.10.00-mod/source/geometry/navigation/include/G4TransportationManager.hh
+--- geant4.10.00/source/geometry/navigation/include/G4TransportationManager.hh 2013-12-05 10:28:54.000000000 +0100
++++ geant4.10.00-mod/source/geometry/navigation/include/G4TransportationManager.hh 2013-12-12 01:40:12.341428809 +0100
+@@ -68,7 +68,7 @@
+ // Accessors for field handling
+
+ inline G4Navigator* GetNavigatorForTracking() const;
+- inline void SetNavigatorForTracking( G4Navigator* newNavigator );
++ void SetNavigatorForTracking( G4Navigator* newNavigator );
+ // Accessors for the navigator for tracking
+
+ inline void SetWorldForTracking(G4VPhysicalVolume* theWorld);
+diff -Naur geant4.10.00/source/geometry/navigation/include/G4TransportationManager.icc geant4.10.00-mod/source/geometry/navigation/include/G4TransportationManager.icc
+--- geant4.10.00/source/geometry/navigation/include/G4TransportationManager.icc 2013-12-05 10:28:54.000000000 +0100
++++ geant4.10.00-mod/source/geometry/navigation/include/G4TransportationManager.icc 2013-12-12 01:40:12.341428809 +0100
+@@ -59,6 +59,7 @@
+ fNavigators[0]->SetWorldVolume(theWorld);
+ }
+
++/*
+ // ----------------------------------------------------------------------------
+ // SetNavigatorForTracking()
+ //
+@@ -70,6 +71,7 @@
+ {
+ fNavigators[0] = newNavigator;
+ }
++*/
+
+ // ----------------------------------------------------------------------------
+ // GetPropagatorInField()
+diff -Naur geant4.10.00/source/geometry/navigation/src/G4TransportationManager.cc geant4.10.00-mod/source/geometry/navigation/src/G4TransportationManager.cc
+--- geant4.10.00/source/geometry/navigation/src/G4TransportationManager.cc 2013-12-05 10:28:56.000000000 +0100
++++ geant4.10.00-mod/source/geometry/navigation/src/G4TransportationManager.cc 2013-12-12 01:40:12.345428679 +0100
+@@ -124,6 +124,20 @@
+ }
+ }
+
++
++// ----------------------------------------------------------------------------
++// SetNavigatorForTracking()
++//
++// Set the active navigator for tracking, always
++// the first in the collection of registered navigators.
++//
++void G4TransportationManager::SetNavigatorForTracking(G4Navigator* newNavigator)
++{
++ fNavigators[0] = newNavigator;
++ fActiveNavigators[0] = newNavigator;
++ fPropagatorInField->SetNavigatorForPropagating(newNavigator);
++}
++
+ // ----------------------------------------------------------------------------
+ // ClearNavigators()
+ //
diff --git a/sci-physics/geant/files/geant-4.10.0-no-examples.patch b/sci-physics/geant/files/geant-4.10.0-no-examples.patch
new file mode 100644
index 000000000000..99aaca546f49
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.10.0-no-examples.patch
@@ -0,0 +1,22 @@
+do not install examples automatically, we do this explictly with dodoc.
+
+Index: geant4.10.00/CMakeLists.txt
+===================================================================
+--- geant4.10.00.orig/CMakeLists.txt
++++ geant4.10.00/CMakeLists.txt
+@@ -136,15 +136,6 @@ if(GEANT4_BUILD_EXAMPLES)
+ add_subdirectory(examples)
+ endif()
+
+-# - Install example code to datarootdir
+-install(DIRECTORY examples
+- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
+- COMPONENT Examples
+- PATTERN "CVS" EXCLUDE
+- PATTERN ".svn" EXCLUDE
+- )
+-
+-
+ #-----------------------------------------------------------------------------
+ # Provide packaging with CPack.
+ include(Geant4CPackBase)
diff --git a/sci-physics/geant/files/geant-4.9.4-datadir.patch b/sci-physics/geant/files/geant-4.9.4-datadir.patch
new file mode 100644
index 000000000000..c691d90e8ce4
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-datadir.patch
@@ -0,0 +1,43 @@
+--- cmake/Modules/Geant4ToolchainBackwardCompatibility.cmake.orig 2011-01-22 00:49:11.096082056 +0000
++++ cmake/Modules/Geant4ToolchainBackwardCompatibility.cmake 2011-01-22 00:53:04.746078920 +0000
+@@ -74,9 +74,9 @@
+ # Construct backward compatible variables
+ #
+ set(G4SYSTEM "${GEANT4_SYSTEM}-${GEANT4_COMPILER}")
+-set(G4INSTALL ${GEANT4_DATADIR}/geant4-${geant4_VERSION})
++set(G4INSTALL ${GEANT4_DATADIR}/geant4)
+ set(G4INCLUDE ${GEANT4_INCLUDEDIR}/geant4)
+-set(G4LIB ${GEANT4_LIBDIR}/geant4-${geant4_VERSION})
++set(G4LIB ${GEANT4_LIBDIR}/geant4)
+
+ message(STATUS "Geant4 backwards compatible variable G4SYSTEM : ${G4SYSTEM}")
+ message(STATUS "Geant4 backwards compatible variable G4INSTALL: ${G4INSTALL}")
+@@ -125,7 +125,7 @@
+ # Install targets
+ # toolchain
+ install(DIRECTORY config
+- DESTINATION ${GEANT4_DATAROOTDIR}/geant4-${geant4_VERSION}
++ DESTINATION ${GEANT4_DATAROOTDIR}/geant4
+ FILES_MATCHING PATTERN "*.gmk"
+ PATTERN "CVS" EXCLUDE
+ PATTERN "scripts/" EXCLUDE)
+@@ -134,16 +134,16 @@
+ install(FILES
+ ${CMAKE_BINARY_DIR}/outputs/runtime/geant4-${geant4_VERSION}.sh
+ ${CMAKE_BINARY_DIR}/outputs/runtime/geant4-${geant4_VERSION}.csh
+- DESTINATION ${GEANT4_DATAROOTDIR}/geant4-${geant4_VERSION}/config
++ DESTINATION ${GEANT4_DATAROOTDIR}/geant4/config
+ PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+
+ # compatibility softlink to library directory
+- install(CODE "execute_process(COMMAND \${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}${GEANT4_LIBDIR}/geant4-${geant4_VERSION})")
++ install(CODE "execute_process(COMMAND \${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}${GEANT4_LIBDIR}/geant4)")
+
+- install(CODE "execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink .. ${GEANT4_SYSTEM}-${GEANT4_COMPILER} WORKING_DIRECTORY \$ENV{DESTDIR}${GEANT4_LIBDIR}/geant4-${geant4_VERSION})")
++ install(CODE "execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink .. ${GEANT4_SYSTEM}-${GEANT4_COMPILER} WORKING_DIRECTORY \$ENV{DESTDIR}${GEANT4_LIBDIR}/geant4)")
+
+ endif()
+
diff --git a/sci-physics/geant/files/geant-4.9.4-libdir.patch b/sci-physics/geant/files/geant-4.9.4-libdir.patch
new file mode 100644
index 000000000000..8934f73acfe9
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-libdir.patch
@@ -0,0 +1,35 @@
+--- CMakeLists.txt.orig 2011-01-17 06:25:14.536078940 +0000
++++ CMakeLists.txt 2011-01-21 23:50:53.406082074 +0000
+@@ -195,7 +195,7 @@
+ set(GEANT4_PREFIX ${CMAKE_INSTALL_PREFIX})
+ set(GEANT4_EXEC_PREFIX ${GEANT4_PREFIX})
+ set(GEANT4_BINDIR ${GEANT4_EXEC_PREFIX}/bin)
+-set(GEANT4_LIBDIR ${GEANT4_PREFIX}/lib)
++set(GEANT4_LIBDIR ${GEANT4_PREFIX}/lib${LIB_SUFFIX})
+ set(GEANT4_DATAROOTDIR ${GEANT4_PREFIX}/share)
+ set(GEANT4_DATADIR ${GEANT4_DATAROOTDIR})
+ set(GEANT4_INCLUDEDIR ${GEANT4_PREFIX}/include)
+--- cmake/Modules/Geant4MacroLibraryTargets.cmake.orig 2011-01-21 23:36:09.356079013 +0000
++++ cmake/Modules/Geant4MacroLibraryTargets.cmake 2011-01-21 23:49:49.826082339 +0000
+@@ -35,8 +35,8 @@
+ # NEEDS WORK TO REMOVE HARDCODED LIB/BIN DIR
+ install(TARGETS ${G4LIBTARGET_NAME}
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib)
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ endif()
+
+ #
+@@ -59,8 +59,8 @@
+
+ install(TARGETS ${G4LIBTARGET_NAME}-static
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib)
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ endif()
+ ENDMACRO()
+
diff --git a/sci-physics/geant/files/geant-4.9.4-no-benchmarks.patch b/sci-physics/geant/files/geant-4.9.4-no-benchmarks.patch
new file mode 100644
index 000000000000..8c9d47707ac4
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-no-benchmarks.patch
@@ -0,0 +1,10 @@
+--- source/geometry/CMakeLists.txt.orig 2011-01-17 05:09:38.046080303 +0000
++++ source/geometry/CMakeLists.txt 2011-01-17 05:09:59.636215548 +0000
+@@ -12,7 +12,6 @@
+ #
+ #------------------------------------------------------------------------------
+
+-add_subdirectory(benchmarks)
+ add_subdirectory(biasing)
+ add_subdirectory(divisions)
+ add_subdirectory(magneticfield)
diff --git a/sci-physics/geant/files/geant-4.9.4-no-examples.patch b/sci-physics/geant/files/geant-4.9.4-no-examples.patch
new file mode 100644
index 000000000000..6db7b3f9017d
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-no-examples.patch
@@ -0,0 +1,15 @@
+--- CMakeLists.txt.orig 2011-01-22 01:47:07.000000000 +0000
++++ CMakeLists.txt 2011-01-22 02:00:58.676084146 +0000
+@@ -209,9 +209,9 @@
+ # Install any extra files needed such as documentation and legacy Makefiles
+ #
+ # User example code
+-install(DIRECTORY examples
+- DESTINATION ${GEANT4_DATAROOTDIR}/geant4-${geant4_VERSION}
+- PATTERN "CVS" EXCLUDE)
++#install(DIRECTORY examples
++# DESTINATION ${GEANT4_DATAROOTDIR}/geant4-${geant4_VERSION}
++# PATTERN "CVS" EXCLUDE)
+
+
+ #
diff --git a/sci-physics/geant/files/geant-4.9.4-trajectory.patch b/sci-physics/geant/files/geant-4.9.4-trajectory.patch
new file mode 100644
index 000000000000..df45ae234e50
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-trajectory.patch
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig 2011-04-28 01:19:54.232041312 +0200
++++ CMakeLists.txt 2011-04-28 01:15:11.434101391 +0200
+@@ -43,6 +43,8 @@
+ set(${PROJECT_NAME}_VERSION_MINOR "4")
+ set(${PROJECT_NAME}_VERSION_PATCH "1")
+
++add_definitions(-DG4_STORE_TRAJECTORY)
++
+ #------------------------------------------------------------------------------
+ # Set up path to internal set of CMake modules.
+ #
diff --git a/sci-physics/geant/files/geant-4.9.4-zlib.patch b/sci-physics/geant/files/geant-4.9.4-zlib.patch
new file mode 100644
index 000000000000..f0429695ce38
--- /dev/null
+++ b/sci-physics/geant/files/geant-4.9.4-zlib.patch
@@ -0,0 +1,35 @@
+force use of system zlib instead of bundled G4zlib
+--- source/visualization/HepRep/sources.cmake.orig 2011-12-02 15:07:49.000000000 +0000
++++ source/visualization/HepRep/sources.cmake 2011-12-18 06:21:22.000000000 +0000
+@@ -91,7 +91,7 @@
+ G4specsolids
+ G4tracking
+ G4vis_management
+- G4zlib
++ ${ZLIB_LIBRARIES}
+ GLOBAL_DEPENDENCIES
+ G4digits_hits
+ G4geometry
+@@ -102,7 +102,7 @@
+ G4modeling
+ G4tracking
+ G4vis_management
+- G4zlib
++ ${ZLIB_LIBRARIES}
+ LINK_LIBRARIES
+ )
+
+--- source/visualization/externals/gl2ps/sources.cmake.orig 2011-12-02 16:07:56.000000000 +0100
++++ source/visualization/externals/gl2ps/sources.cmake 2012-03-09 14:09:26.965148002 +0100
+@@ -49,9 +49,9 @@
+ G4OpenGL2PSAction.cc
+ gl2ps.cc
+ GRANULAR_DEPENDENCIES
+- G4zlib
++ ${ZLIB_LIBRARIES}
+ GLOBAL_DEPENDENCIES
+- G4zlib
++ ${ZLIB_LIBRARIES}
+ LINK_LIBRARIES
+ ${OPENGL_LIBRARIES}
+ )
diff --git a/sci-physics/geant/geant-3.21.14-r2.ebuild b/sci-physics/geant/geant-3.21.14-r2.ebuild
new file mode 100644
index 000000000000..75608a6d437c
--- /dev/null
+++ b/sci-physics/geant/geant-3.21.14-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils fortran-2
+
+DEB_PN=geant321
+DEB_PV=${PV}.dfsg
+DEB_PR=8
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN's detector description and simulation Tool"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.diff.gz"
+
+SLOT="3"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/cfortran
+ sci-physics/cernlib
+ sci-physics/paw
+ x11-libs/motif:0"
+DEPEND="${RDEPEND}
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ cd "${WORKDIR}"
+ sed -i -e 's:/tmp/dp.*/cern:cern:g' ${DEB_P}-${DEB_PR}.diff || die
+ epatch ${DEB_P}-${DEB_PR}.diff
+ cd "${S}"
+ cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+ sed \
+ -e 's:/usr/local:/usr:g' \
+ -i Makefile || die "sed'ing the Makefile failed"
+
+ einfo "Applying Debian patches"
+ emake -j1 patch || die "debian patch failed"
+
+ # since we depend on cfortran, do not use the one from cernlib
+ rm -f src/include/cfortran/cfortran.h
+}
+
+src_compile() {
+ # create local LaTeX cache directory
+ VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch || die "emake failed"
+}
+
+src_test_() {
+ LD_LIBRARY_PATH="${S}"/shlib \
+ emake -j1 cernlib-test || die "emake test failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ cd "${S}"/debian
+ dodoc changelog README.* deadpool.txt NEWS copyright || die "dodoc failed"
+ newdoc add-ons/README README.add-ons || die "newdoc failed"
+}
diff --git a/sci-physics/geant/geant-3.21.14-r3.ebuild b/sci-physics/geant/geant-3.21.14-r3.ebuild
new file mode 100644
index 000000000000..fba71ad42c31
--- /dev/null
+++ b/sci-physics/geant/geant-3.21.14-r3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2
+
+DEB_PN=geant321
+DEB_PV=${PV}.dfsg
+DEB_PR=9
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN's detector description and simulation Tool"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.diff.gz"
+
+SLOT="3"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ x11-libs/motif:0
+ dev-lang/cfortran
+ sci-physics/cernlib
+ sci-physics/paw"
+DEPEND="${RDEPEND}
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ cd "${WORKDIR}"
+ sed -i -e 's:/tmp/dp.*/cern:cern:g' ${DEB_P}-${DEB_PR}.diff || die
+ epatch ${DEB_P}-${DEB_PR}.diff
+ cd "${S}"
+ cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+ sed -i \
+ -e 's:/usr/local:/usr:g' \
+ Makefile || die "sed'ing the Makefile failed"
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+
+ # since we depend on cfortran, do not use the one from cernlib
+ rm -f src/include/cfortran/cfortran.h
+}
+
+src_compile() {
+ # create local LaTeX cache directory
+ VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test_() {
+ LD_LIBRARY_PATH="${S}"/shlib emake -j1 cernlib-test
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ cd debian
+ dodoc changelog README.* deadpool.txt NEWS copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/geant/geant-3.21.14-r4.ebuild b/sci-physics/geant/geant-3.21.14-r4.ebuild
new file mode 100644
index 000000000000..8cdb3f6cfb5e
--- /dev/null
+++ b/sci-physics/geant/geant-3.21.14-r4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2
+
+DEB_PN=geant321
+DEB_PV=${PV}.dfsg
+DEB_PR=11
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN's detector description and simulation Tool"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="3"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ x11-libs/motif:0
+ dev-lang/cfortran
+ sci-physics/cernlib
+ sci-physics/paw"
+DEPEND="${RDEPEND}
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ mv ../debian . || die
+ sed -i -e 's:/tmp/dp.*/cern:cern:g' debian/patches/* || die
+ cp debian/add-ons/Makefile . || die
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+ sed -i \
+ -e 's:/usr/local:${EROOT}usr:g' \
+ Makefile || die "sed'ing the Makefile failed"
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+
+ # since we depend on cfortran, do not use the one from cernlib
+ rm -f src/include/cfortran/cfortran.h
+}
+
+src_compile() {
+ # create local LaTeX cache directory
+ VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_test_() {
+ LD_LIBRARY_PATH="${S}"/shlib emake -j1 cernlib-test
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ cd debian
+ dodoc changelog README.* deadpool.txt NEWS copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/geant/geant-4.10.00.ebuild b/sci-physics/geant/geant-4.10.00.ebuild
new file mode 100644
index 000000000000..d881e8ee0684
--- /dev/null
+++ b/sci-physics/geant/geant-4.10.00.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils eutils fortran-2 versionator multilib
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+SPV3=$(printf %1d ${PV3})
+MYP=${PN}$(replace_version_separator 3 .)
+
+DESCRIPTION="Toolkit for simulation of passage of particles through matter"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
+ raytracerx qt4 static-libs vrml zlib"
+
+RDEPEND="
+ dev-libs/expat
+ >=sci-physics/clhep-2.1.3:2=
+ dawn? ( media-gfx/dawn )
+ gdml? ( dev-libs/xerces-c )
+ motif? ( x11-libs/motif:0 )
+ opengl? ( virtual/opengl )
+ inventor? ( media-libs/SoXt )
+ qt4? ( dev-qt/qtgui:4 opengl? ( dev-qt/qtopengl:4 ) )
+ raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+PDEPEND="
+ data? ( ~sci-physics/geant-data-${PV} )
+ doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}"/${PN}-4.10.0-no-examples.patch
+ "${FILESDIR}"/${PN}-4.10.0-TrackingNavigator.patch # 496678
+ )
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEANT4_USE_SYSTEM_CLHEP=ON
+ -DCMAKE_INSTALL_LIBDIR="${EROOT}usr/$(get_libdir)"
+ -DGEANT4_INSTALL_DATA=OFF
+ $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
+ $(cmake-utils_use gdml GEANT4_USE_GDML)
+ $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
+ $(cmake-utils_use motif GEANT4_USE_XM)
+ $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
+ $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
+ $(cmake-utils_use qt4 GEANT4_USE_QT)
+ $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
+ $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
+ $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
+ $(cmake-utils_use_build static-libs STATIC_LIBS)
+ )
+ if use inventor; then
+ mycmakeargs+=(
+ -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
+ -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # adjust clhep linking flags for system clhep
+ # binmake.gmk is only useful for legacy build systems
+ sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
+ cmake-utils_src_install
+ insinto /usr/share/doc/${PF}
+ local mypv="${PV1}.${PV2}.${SPV3}"
+ doins ReleaseNotes/ReleaseNotes${mypv}.html
+ [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
+ dodoc ReleaseNotes/Patch${mypv}-*.txt
+ use examples && doins -r examples
+}
+
+pkg_postinst() {
+ elog "The following scripts are provided for backward compatibility:"
+ elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${SPV3}.*/geant4make/*sh)"
+}
diff --git a/sci-physics/geant/geant-4.10.00_p01.ebuild b/sci-physics/geant/geant-4.10.00_p01.ebuild
new file mode 100644
index 000000000000..15bf0b709063
--- /dev/null
+++ b/sci-physics/geant/geant-4.10.00_p01.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils eutils fortran-2 versionator multilib
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+SPV3=$(printf %1d ${PV3})
+MYP=${PN}$(replace_version_separator 3 .)
+
+DESCRIPTION="Toolkit for simulation of passage of particles through matter"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
+ raytracerx qt4 static-libs vrml zlib threads"
+
+RDEPEND="
+ dev-libs/expat
+ >=sci-physics/clhep-2.1.3:2=
+ dawn? ( media-gfx/dawn )
+ gdml? ( dev-libs/xerces-c )
+ motif? ( x11-libs/motif:0 )
+ opengl? ( virtual/opengl )
+ inventor? ( media-libs/SoXt )
+ qt4? ( dev-qt/qtgui:4 opengl? ( dev-qt/qtopengl:4 ) )
+ raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+PDEPEND="
+ data? ( >=sci-physics/geant-data-4.10 )
+ doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
+
+S="${WORKDIR}/${MYP}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEANT4_USE_SYSTEM_CLHEP=ON
+ -DCMAKE_INSTALL_LIBDIR="${EROOT}usr/$(get_libdir)"
+ -DGEANT4_INSTALL_DATA=OFF
+ $(cmake-utils_use threads GEANT4_BUILD_MULTITHREADED)
+ $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
+ $(cmake-utils_use gdml GEANT4_USE_GDML)
+ $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
+ $(cmake-utils_use motif GEANT4_USE_XM)
+ $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
+ $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
+ $(cmake-utils_use qt4 GEANT4_USE_QT)
+ $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
+ $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
+ $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
+ $(cmake-utils_use_build static-libs STATIC_LIBS)
+ )
+ if use inventor; then
+ mycmakeargs+=(
+ -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
+ -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # adjust clhep linking flags for system clhep
+ # binmake.gmk is only useful for legacy build systems
+ sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
+ cmake-utils_src_install
+ insinto /usr/share/doc/${PF}
+ local mypv="${PV1}.${PV2}.${SPV3}"
+ doins ReleaseNotes/ReleaseNotes${mypv}.html
+ [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
+ dodoc ReleaseNotes/Patch${mypv}-*.txt
+ use examples && doins -r examples
+}
+
+pkg_postinst() {
+ elog "The following scripts are provided for backward compatibility:"
+ elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${SPV3}.*/geant4make/*sh)"
+}
diff --git a/sci-physics/geant/geant-4.10.01.ebuild b/sci-physics/geant/geant-4.10.01.ebuild
new file mode 100644
index 000000000000..d7d085097fe7
--- /dev/null
+++ b/sci-physics/geant/geant-4.10.01.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils eutils fortran-2 versionator multilib
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+SPV3=$(printf %1d ${PV3})
+MYP=${PN}$(replace_version_separator 3 .)
+
+DESCRIPTION="Toolkit for simulation of passage of particles through matter"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
+ raytracerx qt4 static-libs vrml zlib threads"
+
+RDEPEND="
+ dev-libs/expat
+ >=sci-physics/clhep-2.1.3:2=
+ dawn? ( media-gfx/dawn )
+ gdml? ( dev-libs/xerces-c )
+ motif? ( x11-libs/motif:0 )
+ opengl? ( virtual/opengl )
+ inventor? ( media-libs/SoXt )
+ qt4? ( dev-qt/qtgui:4 opengl? ( dev-qt/qtopengl:4 ) )
+ raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND} prefix? ( app-shells/tcsh )"
+PDEPEND="
+ data? ( ~sci-physics/geant-data-${PV} )
+ doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ use examples || epatch "${FILESDIR}"/${PN}-4.10.0-no-examples.patch
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEANT4_USE_SYSTEM_CLHEP=ON
+ -DGEANT4_INSTALL_DATA=OFF
+ $(cmake-utils_use threads GEANT4_BUILD_MULTITHREADED)
+ $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
+ $(cmake-utils_use gdml GEANT4_USE_GDML)
+ $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
+ $(cmake-utils_use motif GEANT4_USE_XM)
+ $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
+ $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
+ $(cmake-utils_use qt4 GEANT4_USE_QT)
+ $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
+ $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
+ $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
+ $(cmake-utils_use_build static-libs STATIC_LIBS)
+ )
+ if use inventor; then
+ mycmakeargs+=(
+ -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
+ -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # adjust clhep linking flags for system clhep
+ # binmake.gmk is only useful for legacy build systems
+ sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
+ cmake-utils_src_install
+ insinto /usr/share/doc/${PF}
+ doins ReleaseNotes/ReleaseNotes${PV1}.${PV2}.${SPV3}.html
+ [[ -f ReleaseNotes/Patch${PV1}.${PV2}.${SPV3}-1.txt ]] && \
+ dodoc ReleaseNotes/Patch${mypv}-*.txt
+}
+
+pkg_postinst() {
+ elog "The following scripts are provided for backward compatibility:"
+ elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${SPV3}.*/geant4make/*sh)"
+}
diff --git a/sci-physics/geant/geant-4.9.4_p03.ebuild b/sci-physics/geant/geant-4.9.4_p03.ebuild
new file mode 100644
index 000000000000..cf4ff5b02846
--- /dev/null
+++ b/sci-physics/geant/geant-4.9.4_p03.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils eutils fortran-2 versionator
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+MYP=${PN}$(replace_version_separator 3 .)
+
+DESCRIPTION="Toolkit for simulation of passage of particles through matter"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_COM="http://geant4.cern.ch/support/source"
+SRC_URI="${SRC_COM}/${MYP}.tar.gz"
+GEANT4_DATA="
+ G4NDL.3.14
+ G4EMLOW.6.19
+ G4RadioactiveDecay.3.3
+ G4NEUTRONXS.1.0
+ G4PII.1.2
+ G4PhotonEvaporation.2.1
+ G4ABLA.3.0
+ RealSurface.1.0"
+for d in ${GEANT4_DATA}; do
+ SRC_URI="${SRC_URI} data? ( ${SRC_COM}/${d}.tar.gz )"
+done
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="amd64 x86"
+IUSE="+data dawn examples gdml geant3 granular qt4 static-libs vrml zlib"
+
+RDEPEND="
+ >=sci-physics/clhep-2.1
+ qt4? ( dev-qt/qtgui:4 dev-qt/qtopengl:4 )
+ gdml? ( dev-libs/xerces-c )
+ geant3? ( sci-physics/geant:3 )
+ dawn? ( media-gfx/dawn )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}"/${PN}-4.9.4-{zlib,libdir,datadir,trajectory}.patch )
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
+ $(cmake-utils_use gdml GEANT4_USE_GDML)
+ $(cmake-utils_use geant3 GEANT4_USE_GEANT3TOGEANT4)
+ $(cmake-utils_use granular GEANT4_BUILD_GRANULAR_BUILD)
+ $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
+ $(cmake-utils_use qt4 GEANT4_USE_QT)
+ $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
+ $(cmake-utils_use_build static-libs STATIC_LIBS)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ if use data; then
+ einfo "Installing Geant4 data"
+ insinto /usr/share/geant4/data
+ pushd "${WORKDIR}" > /dev/null
+ for d in ${GEANT4_DATA}; do
+ local p=${d/.}
+ doins -r *${p/G4}
+ done
+ popd > /dev/null
+ fi
+
+ insinto /usr/share/doc/${PF}
+ local mypv="${PV1}.${PV2}.${PV3}"
+ doins ReleaseNotes/ReleaseNotes${mypv}.html
+ [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
+ dodoc ReleaseNotes/Patch${mypv}-*.txt
+ use examples && doins -r examples
+}
+
+pkg_postinst() {
+ elog "Users need to define the G4WORKDIR variable (\$HOME/geant4 is normally used)."
+}
diff --git a/sci-physics/geant/geant-4.9.6_p02-r1.ebuild b/sci-physics/geant/geant-4.9.6_p02-r1.ebuild
new file mode 100644
index 000000000000..f2008d4162df
--- /dev/null
+++ b/sci-physics/geant/geant-4.9.6_p02-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils eutils fortran-2 versionator multilib
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+MYP=${PN}$(replace_version_separator 3 .)
+
+DESCRIPTION="Toolkit for simulation of passage of particles through matter"
+HOMEPAGE="http://geant4.cern.ch/"
+SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
+
+LICENSE="geant4"
+SLOT="4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
+ raytracerx qt4 static-libs vrml zlib"
+
+RDEPEND="
+ dev-libs/expat
+ >=sci-physics/clhep-2.1.3
+ dawn? ( media-gfx/dawn )
+ gdml? ( dev-libs/xerces-c )
+ motif? ( x11-libs/motif:0 )
+ opengl? ( virtual/opengl )
+ inventor? ( media-libs/SoXt )
+ qt4? ( dev-qt/qtgui:4 opengl? ( dev-qt/qtopengl:4 ) )
+ raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+PDEPEND="
+ data? ( ~sci-physics/geant-data-${PV} )
+ doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${PV3} )"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}"/${PN}-4.9.4-zlib.patch )
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEANT4_USE_SYSTEM_CLHEP=ON
+ -DCMAKE_INSTALL_LIBDIR="${EROOT}usr/$(get_libdir)"
+ -DGEANT4_INSTALL_DATA=OFF
+ $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
+ $(cmake-utils_use gdml GEANT4_USE_GDML)
+ $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
+ $(cmake-utils_use motif GEANT4_USE_XM)
+ $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
+ $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
+ $(cmake-utils_use qt4 GEANT4_USE_QT)
+ $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
+ $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
+ $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
+ $(cmake-utils_use_build static-libs STATIC_LIBS)
+ )
+ if use inventor; then
+ mycmakeargs+=(
+ -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
+ -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # adjust clhep linking flags for system clhep
+ # binmake.gmk is only useful for legacy build systems
+ sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
+ cmake-utils_src_install
+ insinto /usr/share/doc/${PF}
+ local mypv="${PV1}.${PV2}.${PV3}"
+ doins ReleaseNotes/ReleaseNotes${mypv}.html
+ [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
+ dodoc ReleaseNotes/Patch${mypv}-*.txt
+ use examples && doins -r examples
+}
+
+pkg_postinst() {
+ elog "The following scripts are provided for backward compatibility:"
+ elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${PV3}.*/geant4make/*sh)"
+}
diff --git a/sci-physics/geant/metadata.xml b/sci-physics/geant/metadata.xml
new file mode 100644
index 000000000000..04025cfa9c28
--- /dev/null
+++ b/sci-physics/geant/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ Geant simulates the passage of subatomic particles through matter, for
+ instance, particle detectors. Geant 3 simulations are performed by
+ linking Fortran code supplied by the user with the Geant libraries,
+ then running the resulting executable. This package includes gxint,
+ the script used to perform this linking step.
+ Geant 4 is a complete rewrite in C++ with addition of other modern
+ features and detectors.
+</longdescription>
+<use>
+ <flag name="data">Add a lot of standard physics data files for geant4</flag>
+ <flag name="dawn">Add support for <pkg>media-gfx/dawn</pkg> (3D postscript
+ rendering)</flag>
+ <flag name="gdml">Enable geometry markup language for xml</flag>
+ <flag name="geant3">Add compatibility for geant321 to geant4</flag>
+ <flag name="granular">Produce many small libraries instead of global ones</flag>
+ <flag name="inventor">Add support for Open Inventor SGI toolkit via Coin3D</flag>
+ <flag name="raytracerx">Enable raytracing for physics events</flag>
+ <flag name="vrml">Enable output of geant4 in vrml formats</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/h2o-gtk/Manifest b/sci-physics/h2o-gtk/Manifest
new file mode 100644
index 000000000000..8ee248239474
--- /dev/null
+++ b/sci-physics/h2o-gtk/Manifest
@@ -0,0 +1 @@
+DIST h2o-gtk-0.1.tar.bz2 69851 SHA256 ad62d02b37aac565f6cc854e6dc3ed2e31ddc52ed458b4cd9b9c7b276546bb01 SHA512 58f376f53fc108be620d5a792227ee65e7464581c45b68e94d7bb19b90862f3b008b172d3a2f2376fee5f30fd19f6bb0f5ec74cb49f1224245f8c6ae68cc9b04 WHIRLPOOL 3fef2e32c8a622f1688b7cd4d4be5591117dff536c69d0201f40106c9c27ed9174e43931b0373787e93ab2ff220f0c31f4af09dca63a58c9415252c33c14b4f4
diff --git a/sci-physics/h2o-gtk/h2o-gtk-0.1.ebuild b/sci-physics/h2o-gtk/h2o-gtk-0.1.ebuild
new file mode 100644
index 000000000000..fb30e916c6d9
--- /dev/null
+++ b/sci-physics/h2o-gtk/h2o-gtk-0.1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils
+
+DESCRIPTION="GTK+ UI for libh2o -- water & steam properties"
+HOMEPAGE="https://bitbucket.org/mgorny/h2o-gtk/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-cpp/gtkmm
+ >=sci-libs/libh2oxx-0.2
+ sci-libs/plotmm"
+DEPEND="${RDEPEND}"
diff --git a/sci-physics/h2o-gtk/h2o-gtk-9999.ebuild b/sci-physics/h2o-gtk/h2o-gtk-9999.ebuild
new file mode 100644
index 000000000000..71ac7e8de800
--- /dev/null
+++ b/sci-physics/h2o-gtk/h2o-gtk-9999.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=yes
+EGIT_REPO_URI="http://bitbucket.org/mgorny/${PN}.git"
+
+inherit git-r3
+#endif
+
+inherit autotools-utils
+
+DESCRIPTION="GTK+ UI for libh2o -- water & steam properties"
+HOMEPAGE="https://bitbucket.org/mgorny/h2o-gtk/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-cpp/gtkmm:2.4=
+ sci-libs/libh2oxx:0=
+ sci-libs/plotmm:0="
+DEPEND="${RDEPEND}"
+
+#if LIVE
+KEYWORDS=
+SRC_URI=
+#endif
diff --git a/sci-physics/h2o-gtk/metadata.xml b/sci-physics/h2o-gtk/metadata.xml
new file mode 100644
index 000000000000..12729b5c1ae6
--- /dev/null
+++ b/sci-physics/h2o-gtk/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <maintainer status="active">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <bugs-to>https://bitbucket.org/mgorny/h2o-gtk/issues/</bugs-to>
+ <remote-id type="bitbucket">mgorny/h2o-gtk</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-physics/harminv/Manifest b/sci-physics/harminv/Manifest
new file mode 100644
index 000000000000..9b56d7c6c959
--- /dev/null
+++ b/sci-physics/harminv/Manifest
@@ -0,0 +1 @@
+DIST harminv-1.3.1.tar.gz 327832 SHA256 245778c16390c22850de3fb716c3db19514d40415ee3693293bfe59c66536583 SHA512 7dc1c2f658d9722cd64558a702f04409d10b87cb4ff7247c2fbd7f8d9a24387fef1b8ba4b7b183727bef21891c32d27d83aaa3607d063f8ad60702be4bfe5c3c WHIRLPOOL 31e3e0c6a5a01431a2d6daf4fdab362576f2f72617e5d89ccb0f04cde147c59185697bfc40c35ca09168bc4a2281468e41b978b091f2445f6eea203cf8aa7a12
diff --git a/sci-physics/harminv/files/harminv-1.3.1-configure.ac.patch b/sci-physics/harminv/files/harminv-1.3.1-configure.ac.patch
new file mode 100644
index 000000000000..2830d5b586f3
--- /dev/null
+++ b/sci-physics/harminv/files/harminv-1.3.1-configure.ac.patch
@@ -0,0 +1,31 @@
+--- configure.ac.orig 2007-09-27 09:27:28.731439558 +0100
++++ configure.ac 2007-09-27 09:37:45.755835491 +0100
+@@ -9,7 +9,7 @@
+ # *not* the same as the "public" version number. CURRENT:REVISION:AGE
+ SHARED_VERSION_INFO="2:4:0"
+ AC_SUBST(SHARED_VERSION_INFO)
+-AM_ENABLE_SHARED(no) dnl shared libs cause too many headaches to be default
++AM_ENABLE_SHARED(yes) dnl shared libs cause too many headaches to be default
+
+ ##############################################################################
+
+@@ -123,9 +123,16 @@
+ ###########################################################################
+
+ # Checks for BLAS/LAPACK libraries:
+-
+-ACX_BLAS([], [AC_MSG_ERROR([BLAS library not found])])
+-ACX_LAPACK([], [AC_MSG_ERROR([LAPACK library not found])])
++sinclude(acx_blas.m4)
++ACX_BLAS
++if test x"$BLAS_LIBS" = x ; then
++ AC_MSG_ERROR([BLAS library not found])
++fi
++sinclude(acx_lapack.m4)
++ACX_LAPACK
++if test x"$LAPACK_LIBS" = x ; then
++ AC_MSG_ERROR([LAPACK library not found])
++fi
+
+ LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
+
diff --git a/sci-physics/harminv/harminv-1.3.1.ebuild b/sci-physics/harminv/harminv-1.3.1.ebuild
new file mode 100644
index 000000000000..8889bc6c4698
--- /dev/null
+++ b/sci-physics/harminv/harminv-1.3.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils eutils toolchain-funcs
+
+DESCRIPTION="Extraction of complex frequencies and amplitudes from time series"
+HOMEPAGE="http://ab-initio.mit.edu/harminv/"
+SRC_URI="http://ab-initio.mit.edu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+RDEPEND="virtual/lapack"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${P}-configure.ac.patch )
+
+src_configure() {
+ local myeconfargs=(
+ --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
+ --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
+ )
+ autotools-utils_src_configure
+}
diff --git a/sci-physics/harminv/metadata.xml b/sci-physics/harminv/metadata.xml
new file mode 100644
index 000000000000..1d4bdde16401
--- /dev/null
+++ b/sci-physics/harminv/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ Harminv is a program to solve the problem of harmonic inversion,
+ given a discrete-time, finite-length signal that consists of a sum of
+ finitely-many sinusoids (possibly exponentially decaying) in a given
+ bandwidth, it determines the frequencies, decay constants, amplitudes,
+ and phases of those sinusoids.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/hepmc/Manifest b/sci-physics/hepmc/Manifest
new file mode 100644
index 000000000000..81e1d6be05d8
--- /dev/null
+++ b/sci-physics/hepmc/Manifest
@@ -0,0 +1,3 @@
+DIST HepMC-2.06.03.tar.gz 4587543 SHA256 6dc6de2df9e3a30b98d47a1ca0442a9513fcc5df0d6b5590364270903e96a6f3
+DIST HepMC-2.06.08.tar.gz 3863843 SHA256 8be6c1793e0a045f07ddb88bb64b46de7e66a52e75fb72b3f82f9a3e3ba8a8ce SHA512 a2365f67260a394b9e8d7cebdd399d74e78e39aef64e120dedd2fd2ebd10b85519cb87b00f106891ee1a6f01f4c68c829567e5aa1885324be668e5443ab113f6 WHIRLPOOL fc95858b58bbc2d37a2301cc5b62a6c67f25781d0796b04e6bc5ff976ee2d1456afac892dc554274422e62b1b07d727d2263a816579f73230bae64059d6b190d
+DIST HepMC-2.06.09.tar.gz 4612637 SHA256 c60724ca9740230825e06c0c36fb2ffe17ff1b1465e8656268a61dffe1611a08 SHA512 1030f31ad9d19d8ae184145a693c4a3092131f485e2ed89598b7172992a825ad9aa46fb44a9199a00c4a6bd7e163daead9452e9bc4fe32cb3b97351cf22906c4 WHIRLPOOL 62b91da92ec30bbc1f5619a87e6172fd563751fe29453ed5bdf31ecae6c5964b59a601b4a52f5c3249cfc20664041ee27bb7114d006dabdf05c5926194890370
diff --git a/sci-physics/hepmc/files/hepmc-2.06.04-gcc46.patch b/sci-physics/hepmc/files/hepmc-2.06.04-gcc46.patch
new file mode 100644
index 000000000000..9b19cf70ba9a
--- /dev/null
+++ b/sci-physics/hepmc/files/hepmc-2.06.04-gcc46.patch
@@ -0,0 +1,28 @@
+ HepMC/GenEvent.h | 1 +
+ HepMC/GenVertex.h | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/HepMC/GenEvent.h b/HepMC/GenEvent.h
+index 72374cb..d10b9a0 100644
+--- a/HepMC/GenEvent.h
++++ b/HepMC/GenEvent.h
+@@ -137,6 +137,7 @@ namespace HepMC {
+ #include <vector>
+ #include <algorithm>
+ #include <iostream>
++#include <cstddef>
+
+ namespace HepMC {
+
+diff --git a/HepMC/GenVertex.h b/HepMC/GenVertex.h
+index 2f3d4de..fc3bf63 100644
+--- a/HepMC/GenVertex.h
++++ b/HepMC/GenVertex.h
+@@ -29,6 +29,7 @@
+ #include <vector>
+ #include <set>
+ #include <algorithm>
++#include <cstddef>
+
+ namespace HepMC {
+
diff --git a/sci-physics/hepmc/hepmc-2.06.03.ebuild b/sci-physics/hepmc/hepmc-2.06.03.ebuild
new file mode 100644
index 000000000000..52fc04ef8e7b
--- /dev/null
+++ b/sci-physics/hepmc/hepmc-2.06.03.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils
+
+MYP=HepMC-${PV}
+
+DESCRIPTION="Event Record for Monte Carlo Generators"
+HOMEPAGE="http://lcgapp.cern.ch/project/simu/HepMC/"
+SRC_URI="http://lcgapp.cern.ch/project/simu/HepMC/download/${MYP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc examples gev cm static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.06.04-gcc46.patch
+}
+src_configure() {
+ # use MeV over GeV and mm over cm
+ local length_conf="MM"
+ use cm && length_conf="CM"
+ local momentum_conf="MEV"
+ use gev && momentum_conf="GEV"
+ econf \
+ --with-length=${length_conf} \
+ --with-momentum=${momentum_conf} \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake || die "emake failed"
+ if use doc; then
+ cd doc
+ doxygen doxygen.conf || die "doc building failed"
+ fi
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ INSTALLDIR=/usr/share/doc/${PF}/examples \
+ doc_installdir=/usr/share/doc/${PF} \
+ install || die "emake install failed"
+
+ dodoc README AUTHORS ChangeLog
+ insinto /usr/share/doc/${PF}
+ if use doc; then
+ doins -r doc/html doc/*.pdf || die
+ else
+ rm -f "${D}"/usr/share/doc/${PF}/*pdf
+ fi
+ use examples || rm -rf "${D}"/usr/share/doc/${PF}/examples
+}
diff --git a/sci-physics/hepmc/hepmc-2.06.08.ebuild b/sci-physics/hepmc/hepmc-2.06.08.ebuild
new file mode 100644
index 000000000000..680e47055b4a
--- /dev/null
+++ b/sci-physics/hepmc/hepmc-2.06.08.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+MYP=HepMC-${PV}
+
+DESCRIPTION="Event Record for Monte Carlo Generators"
+HOMEPAGE="http://lcgapp.cern.ch/project/simu/HepMC/"
+SRC_URI="http://lcgapp.cern.ch/project/simu/HepMC/download/${MYP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cm doc examples gev static-libs test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen dev-tex/floatflt )"
+
+S="${WORKDIR}/${MYP}"
+
+DOCS=( ChangeLog AUTHORS )
+
+src_prepare() {
+ sed -i -e '/add_subdirectory(doc)/d' CMakeLists.txt
+ # CMake doc building broken
+ # gentoo doc directory
+ #sed -i \
+ # -e "s:share/HepMC/doc:share/doc/${PF}:" \
+ # doc/CMakeLists.txt || die
+
+ # gentoo examples directory
+ sed -i \
+ -e "s:share/HepMC:share/doc/${PF}:" \
+ $(find examples -name CMakeLists.txt) || die
+
+ # respect user's flags
+ sed -i \
+ -e "s/-O -ansi -pedantic -Wall//g" \
+ cmake/Modules/HepMCVariables.cmake || die
+
+ # gentoo libdir love
+ sed -i \
+ -e '/DESTINATION/s/lib/lib${LIB_SUFFIX}/g' \
+ {src,fio}/CMakeLists.txt || die
+
+ # remove targets if use flags not set
+ use examples || sed -i -e '/add_subdirectory(examples)/d' CMakeLists.txt
+ use test || sed -i -e '/add_subdirectory(test)/d' CMakeLists.txt
+ if ! use static-libs; then
+ sed -i \
+ -e '/(HepMC\(fio\|\)S/d' \
+ -e '/TARGETS/s/HepMC\(fio\|\)S//' \
+ {src,fio}/CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ # use MeV over GeV and mm over cm
+ local length_conf="MM"
+ use cm && length_conf="CM"
+ local momentum_conf="MEV"
+ use gev && momentum_conf="GEV"
+ mycmakeargs+=(
+ -Dlength=${length_conf}
+ -Dmomentum=${momentum_conf}
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ cd doc
+ ./buildDoc.sh || die
+ ./buildDoxygen.sh || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc doc/*.pdf && dohtml -r doc/html/*
+}
diff --git a/sci-physics/hepmc/hepmc-2.06.09-r1.ebuild b/sci-physics/hepmc/hepmc-2.06.09-r1.ebuild
new file mode 100644
index 000000000000..1bc6db438872
--- /dev/null
+++ b/sci-physics/hepmc/hepmc-2.06.09-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+MYP=HepMC-${PV}
+
+DESCRIPTION="Event Record for Monte Carlo Generators"
+HOMEPAGE="http://lcgapp.cern.ch/project/simu/HepMC/"
+SRC_URI="http://lcgapp.cern.ch/project/simu/HepMC/download/${MYP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cm doc examples gev static-libs test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ doc? (
+ app-doc/doxygen
+ || (
+ dev-texlive/texlive-latex
+ dev-tex/floatflt
+ )
+ )"
+
+S="${WORKDIR}/${MYP}"
+
+DOCS=( ChangeLog AUTHORS )
+
+src_prepare() {
+ sed -i -e '/add_subdirectory(doc)/d' CMakeLists.txt
+ # CMake doc building broken
+ # gentoo doc directory
+ #sed -i \
+ # -e "s:share/HepMC/doc:share/doc/${PF}:" \
+ # doc/CMakeLists.txt || die
+
+ # gentoo examples directory
+ sed -i \
+ -e "s:share/HepMC:share/doc/${PF}:" \
+ $(find examples -name CMakeLists.txt) || die
+
+ # respect user's flags
+ sed -i \
+ -e "s/-O -ansi -pedantic -Wall//g" \
+ cmake/Modules/HepMCVariables.cmake || die
+
+ # gentoo libdir love
+ sed -i \
+ -e '/DESTINATION/s/lib/lib${LIB_SUFFIX}/g' \
+ {src,fio}/CMakeLists.txt || die
+
+ # remove targets if use flags not set
+ use examples || sed -i -e '/add_subdirectory(examples)/d' CMakeLists.txt
+ use test || sed -i -e '/add_subdirectory(test)/d' CMakeLists.txt
+ if ! use static-libs; then
+ sed -i \
+ -e '/(HepMC\(fio\|\)S/d' \
+ -e '/TARGETS/s/HepMC\(fio\|\)S//' \
+ {src,fio}/CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ # use MeV over GeV and mm over cm
+ local length_conf="MM"
+ use cm && length_conf="CM"
+ local momentum_conf="MEV"
+ use gev && momentum_conf="GEV"
+ mycmakeargs+=(
+ -Dlength=${length_conf}
+ -Dmomentum=${momentum_conf}
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ cd doc
+ ./buildDoc.sh || die
+ ./buildDoxygen.sh || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc doc/*.pdf && dohtml -r doc/html/*
+}
diff --git a/sci-physics/hepmc/metadata.xml b/sci-physics/hepmc/metadata.xml
new file mode 100644
index 000000000000..5733312e2b08
--- /dev/null
+++ b/sci-physics/hepmc/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ The HepMC package is an object oriented event record written in C++
+ for High Energy Physics Monte Carlo Generators. Many extensions from
+ HEPEVT, the Fortran HEP standard, are supported: the number of entries
+ is unlimited, spin density matrices can be stored with each vertex,
+ flow patterns (such as color) can be stored and traced, integers
+ representing random number generator states can be stored, and an
+ arbitrary number of event weights can be included. Particles and
+ vertices are kept separate in a graph structure, physically similar to
+ a physics event. The added information supports the modularisation of
+ event generators. The package has been kept as simple as possible with
+ minimal internal/external dependencies. Event information is accessed
+ by means of iterators supplied with the package.
+
+ Reference: M. Dobbs and J.B. Hansen, Comput. Phys. Commun. 134 (2001)41.
+</longdescription>
+<use>
+ <flag name='gev'>Build with GeV instead of default MeV for momentum units</flag>
+ <flag name='cm'>Build with cm instead of default mm for length units</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/heppdt/Manifest b/sci-physics/heppdt/Manifest
new file mode 100644
index 000000000000..753312b53a97
--- /dev/null
+++ b/sci-physics/heppdt/Manifest
@@ -0,0 +1 @@
+DIST HepPDT-3.04.01.tar.gz 1851879 SHA256 2c1c39eb91295d3ded69e0d3f1a38b1cb55bc3f0cde37b725ffd5d722f63c0f6 SHA512 33a93b7d18c0cc64ab13923eb5edca89ed753a7f888a31c1d6a5f84f735e4042e2eaaf04e221d487976603a40fbd84cede4b4dd2bcd2e7479d97cc637dda637b WHIRLPOOL 211e9e8839e508f9929d9f69d9d1d67e633067f5957e5f59f44db6a261d3b515b7d0d9aaf49a9648ee38106ba9b9ea91abdc24820798e678eb79c640456c92ba
diff --git a/sci-physics/heppdt/heppdt-3.04.01.ebuild b/sci-physics/heppdt/heppdt-3.04.01.ebuild
new file mode 100644
index 000000000000..e2f5d2b715da
--- /dev/null
+++ b/sci-physics/heppdt/heppdt-3.04.01.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools
+
+MYP=HepPDT-${PV}
+
+DESCRIPTION="Data about each particle from the Review of Particle Properties"
+HOMEPAGE="http://lcgapp.cern.ch/project/simu/HepPDT/"
+SRC_URI="${HOMEPAGE}/download/${MYP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ # respect user flags
+ sed -i \
+ -e '/AC_SUBST(AM_CXXFLAGS)/d' \
+ configure.ac || die
+ # directories
+ sed -i \
+ -e 's:$(prefix)/data:$(datadir)/${PN}:g' \
+ data/Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_test() {
+ LD_LIBRARY_PATH="${S}/src/HepPDT:${S}/src/HepPID" \
+ emake check MY_LD=-L SHEXT=so
+}
+
+src_install() {
+ default
+ use doc && mv "${ED}"usr/doc/* "${ED}"usr/share/doc/${PF}/
+ use examples && mv "${ED}"usr/examples "${ED}"usr/share/doc/${PF}/
+ rm -r "${ED}"usr/{doc,examples}
+}
diff --git a/sci-physics/heppdt/metadata.xml b/sci-physics/heppdt/metadata.xml
new file mode 100644
index 000000000000..89a8cc95903e
--- /dev/null
+++ b/sci-physics/heppdt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ HepPDT contains the fixed data about each particle type. In other
+ words, it contains the data that can be found in the Review of
+ Particle Properties.
+ This data is conceptually split into particle information (e.g. mass)
+ and decay information. HepPDT provides a simple set of particle data
+ classes. Particle ID translation methods are in a separate HepPID
+ library, which is distributed as part of HepPDT.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/herwig/Manifest b/sci-physics/herwig/Manifest
new file mode 100644
index 000000000000..64ac73158109
--- /dev/null
+++ b/sci-physics/herwig/Manifest
@@ -0,0 +1,6 @@
+DIST HERWIG65.INC 32 SHA256 637f8e4c1bd76ec0fd96acc61120d2a41b6b8ca53884a1db30e7f1e35cf52fa4 SHA512 fe63b262458a0e2e9aa5bb76efa2980714e8af96fbd9e226fa33dfda3111e45e6ec033a4c9d21ca339e2336dea3e0f723aa3cff29c4fbbc871a30a9a5690c888 WHIRLPOOL c7459023e7e21a46b7e4bc846f1b6ec3f1358f2efded20411b08c714a98e338c5ad0f2d90b00f4e53967b07a65397d51a562d8334f943efb698d6114469be706
+DIST herwig6510.f 2502723 SHA256 62105cbd5531223ff71c3c0e7215c87fde8202b15b22ba3a0eaa052c1177dc0c SHA512 3176822a3b54d928e66cccaf89ddcfcc1374df54c6159a2557e66d248ec445aa9365f1de8e94af33a7d072a322d78f2684ba09bc0e88a70552b5ef6ecd0a5da0 WHIRLPOOL 53f187eff5c65931f2276ca6e260dbeae7b601aa85be106a9c550be54833f5517b0e421ffef082527b7c19e1955038eaef60dc191a58ff0515e54b83553875dd
+DIST herwig6510.inc 14853 SHA256 4373338dc3f4bc1f0376df8238eedaab785e5ef9823621b1f5beb874f478dca0 SHA512 3ad92ea3327506b469cec086547623d4793b9727ab4ff8ef5d329e3843bae3b1fc8af34520ecce45dc08147caf360dd389297a2f765a4a4e389ad74ef9a04aad WHIRLPOOL d5793d19de41690cd8fb4ff658fc1e963dc2f0959b3cde36f9223173f87f0b4f74cf2372f1ad2c93740fd5bf48682971dea9484192cd54039750515cac5c19ce
+DIST herwig6521.f 2513511 SHA256 6e47079ee19e5cdc538aa7eae6cd6102ce783bfa501f6356eb34349af33954c0 SHA512 c13bc74132ddb86ca0fea61bc2da21dc6908b96d14a33c378c0f37be0dce201012fdd11681e11fcfb715b345ccd72fb4d166017eaf4e0cd19762acbe6687809a WHIRLPOOL 8baf5931614424d8ce873c31d5d494523fa1e8a783fbbc23ea99035cf5ac5f8be7026436991e078ae8b7334e55a9716da86c10aefce8995f6ea34a03c795b715
+DIST herwig6521.inc 15224 SHA256 f75e4cef481a97f73aa0710789fb3e2bd9b8b4ee26850bf7ecdc8ca6e058476c SHA512 8254dc7a99445a7f4a61760fd8bd4ede5f8b7613e25a9c51155ae614c9cb888c7a66043b3b2ec96b8f515351dab0f697dc14738bcde58fdb345f3aebdac6f1fa WHIRLPOOL a5c45472e2350a2fd3459156c7fc77498624e29807d0008b0393eff3a6c027ff4bdc7d1df1cfc3ccf9c70a8a710e94e208638da10ec8a320470581f5ce67a695
+DIST hw65_manual.pdf 934022 SHA256 a857263bc5ee6ead2c7414ffd9a64d04ab40b6c846399c23001ac8b5211b1ac6 SHA512 68c4407e27abe2d34e239455bd94324d919b712cc8b031faa4635caf4e3eb6ff30d35b4e7f8dc9146c8f54886ff77cc690b296b15805dcd9302ef93e707915ff WHIRLPOOL f51dcb8c7d84d872110ba4e9e698284ab36f8a17f3c2de1578b0ecb3127c3f2481d2c005e623267cdea6785a4f78d4a4dbba938fabbaedea2fc94139da155687
diff --git a/sci-physics/herwig/herwig-6.5.10.ebuild b/sci-physics/herwig/herwig-6.5.10.ebuild
new file mode 100644
index 000000000000..4de4376e4b8f
--- /dev/null
+++ b/sci-physics/herwig/herwig-6.5.10.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit versionator autotools fortran-2
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+MY_VER=${PV1}${PV2}${PV3}
+MY_P=${PN}${MY_VER}
+MY_PINC="$(echo ${PN}|tr '[:lower:]' '[:upper:]')${PV1}${PV2}.INC"
+
+DESCRIPTION="High Energy Physics Event Generator"
+HOMEPAGE="http://www.hep.phy.cam.ac.uk/theory/webber/Herwig/"
+SRC_URI="
+ ${HOMEPAGE}/${MY_P}.f
+ ${HOMEPAGE}/${MY_P}.inc
+ ${HOMEPAGE}/${MY_PINC}"
+
+LICENSE="all-rights-reserved"
+RESTRICT="mirror bindist"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="!sci-physics/cernlib-montecarlo[herwig]"
+RDEPEND=""
+
+S="${WORKDIR}"
+
+src_unpack() {
+ cp "${DISTDIR}"/* "${S}"
+}
+
+src_prepare() {
+ sed -i "s/6521/${MY_VER}/" "${MY_PINC}" || die
+ cat > configure.ac <<-EOF
+ AC_INIT(${PN},${PV})
+ AM_INIT_AUTOMAKE
+ AC_PROG_F77
+ AC_PROG_LIBTOOL
+ AC_CONFIG_FILES(Makefile)
+ AC_OUTPUT
+ EOF
+ cat > Makefile.am <<-EOF
+ lib_LTLIBRARIES = lib${PN}.la
+ lib${PN}_la_SOURCES = ${MY_P}.f
+ pkginclude_HEADERS = \
+ ${MY_PINC} \
+ ${MY_P}.inc
+
+ EOF
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+}
diff --git a/sci-physics/herwig/herwig-6.5.21.ebuild b/sci-physics/herwig/herwig-6.5.21.ebuild
new file mode 100644
index 000000000000..a61826408465
--- /dev/null
+++ b/sci-physics/herwig/herwig-6.5.21.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+inherit versionator autotools-utils fortran-2
+
+PV1=$(get_version_component_range 1 ${PV})
+PV2=$(get_version_component_range 2 ${PV})
+PV3=$(get_version_component_range 3 ${PV})
+MY_P=${PN}${PV1}${PV2}${PV3}
+MY_PINC="$(echo ${PN}|tr '[:lower:]' '[:upper:]')${PV1}${PV2}.INC"
+
+DESCRIPTION="High Energy Physics Event Generator"
+HOMEPAGE="http://www.hep.phy.cam.ac.uk/theory/webber/Herwig/"
+SRC_URI="
+ ${HOMEPAGE}/${MY_P}.f
+ ${HOMEPAGE}/${MY_P}.inc
+ ${HOMEPAGE}/${MY_PINC}
+ doc? ( ${HOMEPAGE}/hw65_manual.pdf )"
+
+LICENSE="all-rights-reserved"
+RESTRICT="mirror bindist"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc static-libs"
+
+RDEPEND="!sci-physics/cernlib-montecarlo[herwig]"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ cp "${DISTDIR}"/* "${S}"
+}
+
+src_prepare() {
+ sed -i \
+ -e "s/${PN}.*.inc/${MY_P}.inc/" \
+ ${MY_PINC} || die
+ cat > configure.ac <<-EOF
+ AC_INIT(${PN},${PV})
+ AM_INIT_AUTOMAKE
+ AC_PROG_F77
+ AC_PROG_LIBTOOL
+ AC_CONFIG_FILES(Makefile)
+ AC_OUTPUT
+ EOF
+ cat > Makefile.am <<-EOF
+ lib_LTLIBRARIES = lib${PN}.la
+ lib${PN}_la_SOURCES = ${MY_P}.f
+ include_HEADERS = \
+ ${MY_PINC} \
+ ${MY_P}.inc
+
+ EOF
+ autotools-utils_src_prepare
+}
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dodoc "${DISTDIR}"/hw65_manual.pdf
+}
diff --git a/sci-physics/herwig/metadata.xml b/sci-physics/herwig/metadata.xml
new file mode 100644
index 000000000000..5141b913339a
--- /dev/null
+++ b/sci-physics/herwig/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ HERWIG is a Monte Carlo package for simulating Hadron Emission
+ Reactions With Interfering Gluons.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/hoomd-blue/Manifest b/sci-physics/hoomd-blue/Manifest
new file mode 100644
index 000000000000..045e7af7caec
--- /dev/null
+++ b/sci-physics/hoomd-blue/Manifest
@@ -0,0 +1 @@
+DIST hoomd-blue-1.0.2.tar.bz2 2755462 SHA256 bca7d377fa152b5f99047c5701db0fecb244f56a7861c35eef0ded6106c520d1 SHA512 f9042e3afacc14e62490802d16a13a77592195befa61837703a39aeedf679e81f31aaafb377384d3b0a2f0e9e40dbce7ddd8b2673086706ba223fe265a2dff27 WHIRLPOOL b72c12a88941899c7a51a0a8e78783bf8c108b85f3969663453b2048a9a9c43ab8d4fd3fbcefa0a6d3add47ac880a2462d92760dc9efc5dd7a822be0252bce19
diff --git a/sci-physics/hoomd-blue/hoomd-blue-1.0.2.ebuild b/sci-physics/hoomd-blue/hoomd-blue-1.0.2.ebuild
new file mode 100644
index 000000000000..63ea837ee4af
--- /dev/null
+++ b/sci-physics/hoomd-blue/hoomd-blue-1.0.2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit cmake-utils cuda python-single-r1
+
+DESCRIPTION="a general-purpose particle simulation toolkit"
+HOMEPAGE="http://codeblue.umich.edu/hoomd-blue/"
+
+if [[ ${PV} = 9999 ]]; then
+ EGIT_REPO_URI="https://bitbucket.org/glotzer/${PN}.git"
+ inherit git-r3
+ KEYWORDS=
+else
+ inherit vcs-snapshot
+ SRC_URI="https://bitbucket.org/glotzer/${PN}/get/v${PV}.tar.bz2 -> ${P}.tar.bz2"
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="hoomd-blue"
+SLOT="0"
+IUSE="cuda doc test mpi +zlib"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ mpi? ( virtual/mpi )
+ cuda? ( dev-util/nvidia-cuda-sdk )
+ zlib? ( sys-libs/zlib )
+ dev-libs/boost:=[threads,python,mpi,${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ use cuda && cuda_src_prepare
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable mpi MPI)
+ $(cmake-utils_use_enable doc DOXYGEN)
+ $(cmake-utils_use_enable cuda CUDA)
+ $(cmake-utils_use_enable zlib ZLIB)
+ $(cmake-utils_use_build test BUILD_TESTING)
+ -DPYTHON_SITEDIR=$(python_get_sitedir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${BUILD_DIR}"/doc/hoomd-*doc* )
+ cmake-utils_src_install
+
+ sed -i "s/^python/${EPYTHON}/" "${ED}"/usr/bin/hoomd || die
+}
diff --git a/sci-physics/hoomd-blue/metadata.xml b/sci-physics/hoomd-blue/metadata.xml
new file mode 100644
index 000000000000..8dd7ec69a8a1
--- /dev/null
+++ b/sci-physics/hoomd-blue/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <use>
+ <flag name="cuda">Enable cuda non-bonded kernels</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-physics/jaxodraw/Manifest b/sci-physics/jaxodraw/Manifest
new file mode 100644
index 000000000000..a09735079109
--- /dev/null
+++ b/sci-physics/jaxodraw/Manifest
@@ -0,0 +1,2 @@
+DIST axodraw4j_2008_11_19.tar.gz 20930 SHA256 60353a25563cb4e987304a7d030bbc7e85c688c881f804cd08e8ba76a370af61 SHA512 81bfcbd1b121104e0058654ac5520d0f570f9a915e9f6dfb8c52c11e9cf92f1e01c800182c2dc34e503a6eceafdff462b4f57dfa5bb5db979101a106c10d88c8 WHIRLPOOL 4614a82192fdcc8606be1d634c3a3634107d268a3246043f68ca8bb9d4d3c07955c04e89b7886a7debdec67896ac286647e6208615cad73d57c8d66b0c6c19fc
+DIST jaxodraw-2.0-1_src.tar.gz 3740719 SHA256 e3f456214b9a11dbef030d56a1c6495ea627b0464820792e1998cae9c55554a1 SHA512 ec5866ba03b6f3ecb01ce92f95aa90959153b92eb571f10764d4d10f2fb7a7a0d02a325eb221600526c94faadd53466cf894e4dcba7201e3494555a6330dba02 WHIRLPOOL a146213c3a31fcf64bf0b626dd1ce2996842990196c9708592b461fb33e019f735396153a400d878971bd459ee056462bbb6ab47974f97efcdcee8520455a1f1
diff --git a/sci-physics/jaxodraw/jaxodraw-2.0.1-r1.ebuild b/sci-physics/jaxodraw/jaxodraw-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..678d9cd581cb
--- /dev/null
+++ b/sci-physics/jaxodraw/jaxodraw-2.0.1-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+WANT_ANT_TASKS="ant-trax"
+
+inherit java-pkg-2 java-ant-2 versionator eutils
+
+MY_PV="$(replace_version_separator 2 -)"
+
+DESCRIPTION="Java program for drawing Feynman diagrams"
+HOMEPAGE="http://jaxodraw.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}_src.tar.gz
+ http://downloads.sourceforge.net/jaxodraw/axodraw4j_2008_11_19.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="latex"
+
+DEPEND=">=virtual/jdk-1.4
+ latex? ( dev-texlive/texlive-pstricks:0 )"
+
+RDEPEND=">=virtual/jre-1.4"
+
+S="${WORKDIR}/JaxoDraw-${MY_PV}"
+
+src_install() {
+ java-pkg_newjar build/${PN}-${MY_PV}.jar ${PN}.jar
+
+ newicon src/site/xdocs/images/favicon.ico jaxodraw.ico
+ make_desktop_entry jaxodraw JaxoDraw jaxodraw.ico
+
+ use source && java-pkg_dosrc src/main/java/net
+
+ dodoc src/doc/BUGS src/doc/CHANGELOG src/doc/README src/doc/TODO || die
+ use doc && java-pkg_dojavadoc build/javadoc
+
+ java-pkg_dolauncher "${PN}"
+
+ if use latex; then
+ dodir /usr/share/texmf/tex/latex/misc/
+ insinto /usr/share/texmf/tex/latex/misc/
+ doins "${S}/../axodraw4j.sty"
+ fi
+}
+
+tex_regen() {
+ if use latex; then
+ einfo "Regenerating TeX database..."
+ /usr/bin/mktexlsr /usr/share/texmf /var/spool/texmf > /dev/null
+ eend $?
+ fi
+}
+
+pkg_postinst() {
+ tex_regen
+}
+
+pkg_postrm() {
+ tex_regen
+}
diff --git a/sci-physics/jaxodraw/metadata.xml b/sci-physics/jaxodraw/metadata.xml
new file mode 100644
index 000000000000..8a6842dea3b6
--- /dev/null
+++ b/sci-physics/jaxodraw/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <upstream>
+ <remote-id type="sourceforge">jaxodraw</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest
new file mode 100644
index 000000000000..67afd43f390d
--- /dev/null
+++ b/sci-physics/lammps/Manifest
@@ -0,0 +1,10 @@
+DIST lammps-10Feb15.tar.gz 62912048 SHA256 59373e9b5592f7b697a144bbce1fb742726e03536b7bb355dac7a9e013ddf9b8 SHA512 a7804377a23f03f338bdaf443439dffcdc52293b4c45e6369b340a1107510fed0b8a198e3b5afcff2e04e109985b52ee62e7b28276697bae37ac6f783d1ab9f2 WHIRLPOOL 09f29cadf8b072d388abe45ec219341d2a14a6c9cc9e4010a0f7945e930e9984738f7837748d117ab95ca76ce0c8d9160fe88dcec17e8d21b81f385dec8f7005
+DIST lammps-15May15.tar.gz 63835027 SHA256 0233ea98c7d77d31bd0a538bb674c0ee8f000f1d0ee1b8c049072873192aa228 SHA512 a23c16b98117590b15ca7662b878fb2f76ec41399c329c98deb48e28a0ffce293443269513a96c2503389894b598787b19dadc210d4b4dbc6a7432caf633e7d1 WHIRLPOOL 4c4edfd772bbf534e42fc43e1feaf3b8f76e74c58ec1e985e3c29ee0d8e64aa8c501b8e45e078643409c320a1d834b0d5eb699e7d1ec29df06be0126d12492f1
+DIST lammps-16Apr15.tar.gz 63842472 SHA256 65aecf6f25a055734ef113890a86ecbf7f8478105238c507e5f9bcbeb657bc99 SHA512 95639145db66e76bd27a865849dc0ad15d3920f7ca9f1fb9a426e457376d0c939c57440e89fa6903d1989ca5e5c6c97d8d283928e1dbf33dd94ba88dbb05a252 WHIRLPOOL 422f6814093f22820cfd8fada1d97735c1a8f0388b34e6bad49e361e411b254ea89e6bf7afa8390c0cba1371a6d038fa84cf93583568c5223e42d95210f13515
+DIST lammps-18Apr15.tar.gz 63883297 SHA256 4ce74978da738383a1d808a37481c3c43d4f8f44d919770b3f2cdd4fcf03345b SHA512 be088ec59b7fe495fff3cdfcc5ccb52d2705eec20deb5c8694a215943786652c9dc22a81ba48324707495c3f56c0c347af964d1952ae077c8db02258cf31387a WHIRLPOOL c90403147cc4eda5b4f581cd1bd18bcc8f45a73b1d0e51dcd64c52fc636116c9d57337b89b5753c86e1bbf386f8a2391a9813a6e32154a819f3e35cfc816b5e2
+DIST lammps-18Jul15.tar.gz 66065642 SHA256 deb6625b7c21cf94fc7ee9aefb2edf55a6c8dc870e919028c9ffa1cd169d57ed SHA512 d26dd0084779e037af35bc26f81cdca5a7617f841860e6eab7d52f6c023d2c001075aad5dc3d656ceb6e92650589acc472fa5c8954fd9ab81ec0b737e377284b WHIRLPOOL 66794b7250cdb077bcbeb2b95a464aecc684f7592d81f3db4a3702195ef1d8404eb4b1f38e6c1dd859a42dd8ca1ebd039cbac4d9fd11be99a376168f2c498cdd
+DIST lammps-21Jul15.tar.gz 66715434 SHA256 2e24a7b6131a35ef83cec08f4dc9f7cc5188c59a630ba61f2a8ac3cfbd284ef7 SHA512 cbf39b3559ac60d5ad92299370bf9af76c0bd7fec62dbaa429d5127d561978426d16b03510b815ffeb6b0acdb362523809adf7ac3fbc2fea8cc484010b1ef7bc WHIRLPOOL 41df92b1f5baf52e846032f12c80f813b84fcd1c71f8c7dad5594780da154345d1b1bdea6b68f4c4b71029346d74d4ff3a813f1101437a01be65df7cf6d0d246
+DIST lammps-22Jul15.tar.gz 67275212 SHA256 b75cdf8ead17f20433737c203c8d29c0cc3e157c9b3d175093467873aea0b869 SHA512 f6e5eaf3ca8bcd25a580a4608e0aec0021f2ed5eb23cf9ccd0a707cb8bc320568504ccffc25cccb5acfe2fc3515c58f8afc8936aea63acb3062bdc897a5eb2ee WHIRLPOOL 13c09e1045a0bdabe15e2125ccef0ea622cb12fcce63d8441b7f9843b8f1a3f7aa0c13908a2e215c1fdba8a579a17a5833111b5cf31a2471bf66e781ef281c59
+DIST lammps-24Jul15.tar.gz 67180142 SHA256 bd183f7b073e1ca86656a8f6ea99195123ce3c7829c872ca45216da4132ff96d SHA512 e285a1f326658bd23f32ecf9409d9f0bf16ed635656bbcee0d84da58e1c008363c7815001bcaa5b7701d99b3318a56240b021447e94754607c2ceb178e377122 WHIRLPOOL 003237f8e9a7caec98aa1f8f0c5e03c0cda6d60f20460e32c4eea3c92707e349f4e1a71510f1290b6e6aeac1621951080f904b1bb2224c8eb9e25067206d2b1b
+DIST lammps-28Apr15.tar.gz 63883556 SHA256 6e7c32690cf8bb5a4fb147bab6029cc1d03594ec7b3ea3833e7dc89acc596d8a SHA512 414c786e8666cddd31a3200baedc76974371280dc219636914dd7863f03e32e11f637a9c184af78d8d4da22afe4cf734b6a0eb32c78d6f53ee95d796a3e080c0 WHIRLPOOL c57a91f9d5e977d26cdb2076b5bbd2f3b5791396c23b5326f16cc609b9646e80c602a492b312b4e5f78d1d638c4a6b66e9a49b1ced02274ad7202821a2884975
+DIST lammps-30Apr15.tar.gz 63892754 SHA256 d4a193fd5aa9417ec9d15a3be1e2b149302aacf3d9321886a806b0f4ca91611e SHA512 889fc315719e6f50f802b72a8a0c6e6d7eedb84b67e8b39ae9ea93feb2d526914639848cbfbcbb6dd8b8718c3b332f617f001c6ef04fe14d0685106fcac821bd WHIRLPOOL a681662a0c37fcb701ced8f2cd4f085dfd0ff250faac2c62abd07b718e3bf12ddbf366f725fbc21bc4547e6ef3ca3042ee84571a1fa0277a4c3d7d273ccaa099
diff --git a/sci-physics/lammps/files/lammps-python3.patch b/sci-physics/lammps/files/lammps-python3.patch
new file mode 100644
index 000000000000..1937881c9339
--- /dev/null
+++ b/sci-physics/lammps/files/lammps-python3.patch
@@ -0,0 +1,11 @@
+--- lammps-11Apr15/python/lammps.py 2015-03-13 16:06:20.000000000 -0600
++++ lammps-11Apr15-new/python/lammps.py 2015-04-13 09:40:43.000000000 -0600
+@@ -28,7 +28,7 @@
+ except:
+ type,value,tb = sys.exc_info()
+ traceback.print_exception(type,value,tb)
+- raise OSError,"Could not load LAMMPS dynamic library"
++ raise OSError("Could not load LAMMPS dynamic library")
+
+ # if no ptr provided, create an instance of LAMMPS
+ # don't know how to pass an MPI communicator from PyPar
diff --git a/sci-physics/lammps/files/python-shebang.patch b/sci-physics/lammps/files/python-shebang.patch
new file mode 100644
index 000000000000..7dd45797d4ad
--- /dev/null
+++ b/sci-physics/lammps/files/python-shebang.patch
@@ -0,0 +1,7 @@
+--- lammps-25Mar15/python/lammps.py 2015-03-13 16:06:20.000000000 -0600
++++ lammps-25Mar15-new/python/lammps.py 2015-04-10 15:31:14.000000000 -0600
+@@ -1,3 +1,4 @@
++#!/usr/bin/env python
+ # ----------------------------------------------------------------------
+ # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ # http://lammps.sandia.gov, Sandia National Laboratories
diff --git a/sci-physics/lammps/lammps-20150210.ebuild b/sci-physics/lammps/lammps-20150210.ebuild
new file mode 100644
index 000000000000..b450fcc7a7e4
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150210.ebuild
@@ -0,0 +1,206 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic fortran-2 multilib
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc examples gzip lammps-memalign mpi static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ sci-libs/voro++
+ "
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi '' "-I../STUBS") \
+ MPI_PATH=$(usex mpi '' '-L../STUBS') \
+ MPI_LIB=$(usex mpi '' '-lmpi_stubs') \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+}
+
+src_compile() {
+ # Prepare compiler flags.
+ append-cxxflags -fPIC -I../../src
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src stubs
+
+ # Build packages
+ emake -C src yes-asphere
+ emake -C src yes-body
+ emake -C src yes-class2
+ emake -C src yes-colloid
+ emake -C src yes-dipole
+ emake -C src yes-fld
+ #emake -C src yes-gpu
+ emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #emake -C src yes-kokkos
+ emake -C src yes-kspace
+ emake -C src yes-manybody
+ emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -j1 -C lib/meam -f Makefile.gfortran
+ emake -C src yes-misc
+ emake -C src yes-molecule
+ #emake -C src yes-mpiio
+ emake -C src yes-opt
+ emake -C src yes-peri
+ emake -C src yes-poems
+ lmp_emake -C lib/poems -f Makefile.g++
+ emake -C src yes-reax
+ lmp_emake -j1 -C lib/reax -f Makefile.gfortran
+ emake -C src yes-replica
+ emake -C src yes-rigid
+ emake -C src yes-shock
+ emake -C src yes-snap
+ emake -C src yes-srd
+ emake -C src yes-voronoi
+ emake -C src yes-xtc
+
+ emake -C src yes-user-eff
+ emake -C src yes-user-fep
+ use mpi && emake -C src yes-user-lb
+ emake -C src yes-user-phonon
+ emake -C src yes-user-sph
+
+ if use mpi; then
+ emake -C src yes-user-atc
+ lmp_emake -C lib/atc -f Makefile.g++
+ fi
+
+ if use static-libs; then
+ # Build static library.
+ lmp_emake -C src makelib
+ lmp_emake -C src -f Makefile.lib serial
+ fi
+
+ # Build shared library.
+ lmp_emake -C src makeshlib
+ lmp_emake -C src -f Makefile.shlib serial
+
+ # Compile main executable.
+ lmp_emake -C src serial
+
+ # Compile tools.
+ emake -C tools binary2txt chain micelle2d data2xmovie
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150416.ebuild b/sci-physics/lammps/lammps-20150416.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150416.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150418.ebuild b/sci-physics/lammps/lammps-20150418.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150418.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150428.ebuild b/sci-physics/lammps/lammps-20150428.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150428.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150430.ebuild b/sci-physics/lammps/lammps-20150430.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150430.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150515.ebuild b/sci-physics/lammps/lammps-20150515.ebuild
new file mode 100644
index 000000000000..6869d36b96a1
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150515.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150718.ebuild b/sci-physics/lammps/lammps-20150718.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150718.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150721.ebuild b/sci-physics/lammps/lammps-20150721.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150721.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150722.ebuild b/sci-physics/lammps/lammps-20150722.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150722.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/lammps-20150724.ebuild b/sci-physics/lammps/lammps-20150724.ebuild
new file mode 100644
index 000000000000..020cfbdc4747
--- /dev/null
+++ b/sci-physics/lammps/lammps-20150724.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} )
+
+inherit eutils flag-o-matic fortran-2 multilib python-r1
+
+convert_month() {
+ case $1 in
+ 01) echo Jan
+ ;;
+ 02) echo Feb
+ ;;
+ 03) echo Mar
+ ;;
+ 04) echo Apr
+ ;;
+ 05) echo May
+ ;;
+ 06) echo Jun
+ ;;
+ 07) echo Jul
+ ;;
+ 08) echo Aug
+ ;;
+ 09) echo Sep
+ ;;
+ 10) echo Oct
+ ;;
+ 11) echo Nov
+ ;;
+ 12) echo Dec
+ ;;
+ *) echo unknown
+ ;;
+ esac
+}
+
+MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gzip lammps-memalign mpi python static-libs"
+
+DEPEND="
+ mpi? (
+ virtual/blas
+ virtual/lapack
+ virtual/mpi
+ )
+ gzip? ( app-arch/gzip )
+ sci-libs/voro++
+ python? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+lmp_emake() {
+ local LAMMPS_INCLUDEFLAGS
+ LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
+ LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')"
+
+ # The lammps makefile uses CC to indicate the C++ compiler.
+ emake \
+ ARCHIVE=$(tc-getAR) \
+ CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ F90=$(usex mpi "mpif90" "$(tc-getFC)") \
+ LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
+ CCFLAGS="${CXXFLAGS}" \
+ F90FLAGS="${FCFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
+ MPI_INC=$(usex mpi "" "-I../STUBS") \
+ MPI_PATH=$(usex mpi "" "-L../STUBS") \
+ MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
+ user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
+ "$@"
+}
+
+lmp_activate_packages() {
+ # Build packages
+ lmp_emake -C src yes-asphere
+ lmp_emake -C src yes-body
+ lmp_emake -C src yes-class2
+ lmp_emake -C src yes-colloid
+ lmp_emake -C src yes-coreshell
+ lmp_emake -C src yes-dipole
+ lmp_emake -C src yes-fld
+ #lmp_emake -C src yes-gpu
+ lmp_emake -C src yes-granular
+ # Need OpenKIM external dependency.
+ #lmp_emake -C src yes-kim
+ # Need Kokkos external dependency.
+ #lmp_emake -C src yes-kokkos
+ lmp_emake -C src yes-kspace
+ lmp_emake -C src yes-manybody
+ lmp_emake -C src yes-mc
+ lmp_emake -C src yes-meam
+ lmp_emake -C src yes-misc
+ lmp_emake -C src yes-molecule
+ #lmp_emake -C src yes-mpiio
+ lmp_emake -C src yes-opt
+ lmp_emake -C src yes-peri
+ lmp_emake -C src yes-poems
+ lmp_emake -C src yes-qeq
+ lmp_emake -C src yes-reax
+ lmp_emake -C src yes-replica
+ lmp_emake -C src yes-rigid
+ lmp_emake -C src yes-shock
+ lmp_emake -C src yes-snap
+ lmp_emake -C src yes-srd
+ lmp_emake -C src yes-voronoi
+ lmp_emake -C src yes-xtc
+
+ if use mpi; then
+ lmp_emake -C src yes-user-atc
+ fi
+ lmp_emake -C src yes-user-eff
+ lmp_emake -C src yes-user-fep
+ use mpi && lmp_emake -C src yes-user-lb
+ lmp_emake -C src yes-user-phonon
+ lmp_emake -C src yes-user-sph
+}
+
+lmp_build_packages() {
+ lmp_emake -C lib/meam -j1 -f Makefile.gfortran
+ lmp_emake -C lib/poems -f Makefile.g++
+ lmp_emake -C lib/reax -j1 -f Makefile.gfortran
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++
+}
+
+lmp_clean_packages() {
+ lmp_emake -C lib/meam -f Makefile.gfortran clean
+ lmp_emake -C lib/poems -f Makefile.g++ clean
+ lmp_emake -C lib/reax -f Makefile.gfortran clean
+ use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
+}
+
+src_prepare() {
+ # Fix inconsistent use of SHFLAGS.
+ sed -i \
+ -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
+ -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
+ lib/voronoi/Makefile.lammps || die
+
+ # Fix missing .so name.
+ sed -i \
+ -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
+ src/MAKE/Makefile.serial || die
+
+ # Fix makefile in tools.
+ sed -i \
+ -e 's:g++:$(CXX) $(CXXFLAGS):' \
+ -e 's:gcc:$(CC) $(CCFLAGS):' \
+ -e 's:ifort:$(FC) $(FCFLAGS):' \
+ tools/Makefile || die
+
+ # Patch python.
+ epatch "${FILESDIR}/lammps-python3.patch"
+ epatch "${FILESDIR}/python-shebang.patch"
+}
+
+src_compile() {
+ # Fix atc...
+ append-cxxflags -I../../src
+
+ # Acticate packages.
+ elog "Activating lammps packages..."
+ lmp_activate_packages
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ if use static-libs; then
+ # Build static library.
+ elog "Building static library..."
+ lmp_emake -C src mode=lib serial
+ fi
+
+ # Clean out packages (that's not done by the build system with the clean
+ # target), so we can rebuild the packages with -fPIC.
+ elog "Cleaning packages..."
+ lmp_clean_packages
+
+ # The build system does not rebuild the packages with -fPIC, adding flag
+ # manually.
+ append-cxxflags -fPIC
+ append-fflags -fPIC
+
+ # Compile stubs for serial version.
+ use mpi || lmp_emake -C src mpi-stubs
+
+ elog "Building packages..."
+ lmp_build_packages
+
+ # Build shared library.
+ elog "Building shared library..."
+ lmp_emake -C src mode=shlib serial
+
+ # Compile main executable. The shared library is always built, and
+ # mode=shexe is simply a way to re-use the object files built in the
+ # "shlib" step when linking the executable. The executable is not actually
+ # using the shared library. If we have built the static library, then we
+ # link that into the executable.
+ elog "Linking executable..."
+ if use static-libs; then
+ lmp_emake -C src mode=exe serial
+ else
+ lmp_emake -C src mode=shexe serial
+ fi
+
+ # Compile tools.
+ elog "Building tools..."
+ lmp_emake -C tools binary2txt chain data2xmovie micelle2d
+}
+
+src_install() {
+ use static-libs && newlib.a src/liblammps_serial.a liblammps.a
+ newlib.so src/liblammps_serial.so liblammps.so.0.0.0
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
+ dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
+ newbin src/lmp_serial lmp
+ dobin tools/binary2txt
+ dobin tools/chain
+ dobin tools/data2xmovie
+ dobin tools/micelle2d
+ # Don't forget to add header files of optional packages as they are added
+ # to this ebuild. There may also be .mod files from Fortran based
+ # packages.
+ insinto "/usr/include/${PN}"
+ doins -r src/*.h lib/meam/*.mod
+
+ local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
+ insinto "/${LAMMPS_POTENTIALS}"
+ doins potentials/*
+ echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
+ doenvd 99lammps
+
+ # Install python script.
+ use python && python_foreach_impl python_domodule python/lammps.py
+
+ if use examples; then
+ local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
+ insinto "${LAMMPS_EXAMPLES}"
+ doins -r examples/*
+ fi
+
+ dodoc README
+ if use doc; then
+ dodoc doc/Manual.pdf
+ dohtml -r doc/*
+ fi
+}
diff --git a/sci-physics/lammps/metadata.xml b/sci-physics/lammps/metadata.xml
new file mode 100644
index 000000000000..5d67bcd349fa
--- /dev/null
+++ b/sci-physics/lammps/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ LAMMPS is a classical molecular dynamics code, and an acronym for
+ Large-scale Atomic/Molecular Massively Parallel Simulator.
+
+ LAMMPS has potentials for soft materials (biomolecules, polymers) and
+ solid-state materials (metals, semiconductors) and coarse-grained or
+ mesoscopic systems. It can be used to model atoms or, more generically,
+ as a parallel particle simulator at the atomic, meso, or continuum
+ scale.
+
+ LAMMPS runs on single processors or in parallel using message-passing
+ techniques and a spatial-decomposition of the simulation domain. The
+ code is designed to be easy to modify or extend with new functionality.
+ </longdescription>
+ <use>
+ <flag name="lammps-memalign">Enables the use of the posix_memalign()
+ call instead of malloc() when large chunks or memory are allocated
+ by LAMMPS</flag>
+ </use>
+ <herd>sci-physics</herd>
+ <maintainer>
+ <email>nicolasbock@gentoo.org</email>
+ <name>Nicolas Bock</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-physics/lhapdf/Manifest b/sci-physics/lhapdf/Manifest
new file mode 100644
index 000000000000..1092efd0fa26
--- /dev/null
+++ b/sci-physics/lhapdf/Manifest
@@ -0,0 +1,8 @@
+DIST LHAPDF-6.1.5.tar.gz 668112 SHA256 ee5dfac1c32a386c966b28cb6a2d51531d4eaf9945c4cb48431dd3fabef83231 SHA512 a5e1ac38f681ea6e4bcef4540f8bb836ebeae809ae160a2069972b8752a334a850ae5ec226b19a09da775a0c790439548b0a8a671c4a3f5852a75bbb0647c473 WHIRLPOOL 793ffee34a7bcba616816f030b9206bf1431fcf2d56daf8125818ebac0667677488529dcb2d0141ee5af48e9cf748171c997c1a5028218b21c59d37d2e9780b5
+DIST MRST2004nlo.LHgrid 288040 SHA256 bc1aa4f26ebcf4a6a1bd6e3ec5fbd5fa3ff378c116247fa27ccd5e76324368ce SHA512 b554454fa494c86a3ae56168c3d74c5e3c3bd80f10b393153c0adfbb39a3f3837ae2db80534d288784409154034187c9c5212dfc9c21ed1bf32ef89b9266e262 WHIRLPOOL b7f1e6115015cf19c092cf367798fe1d4459d0c9fac84e022034c14fd81d27023a35f30e7e727a35e2d8af409f448508744be76f04b441b22466ebd92c600bdf
+DIST cteq5l.LHgrid 134797 SHA256 83c92bc90fd6e12be9cd76bc032eca26dcedbe90f0c11aef843bbf54734d5bba SHA512 1ba41fd773104a933af6f37745dcb6f8422e1aece74ba2b1e15a5fb69fdaf694336c0ec1dc6fbc964d2cf3fe363d17ca0c01a6c2ba6def0afa4389cb4083f34b WHIRLPOOL 8a86877fcbae2b45576e3fae08dfd4771c668257893ba2f813c578641dce9800f42bfd57d0d8ac2abc6bf7cd40921020478f1912014a36cfb722ed408ca1430f
+DIST cteq61.LHgrid 8946864 SHA256 5df10c695504f02c2c9cc1eda9ca77fa8c276554cf2cda5fbdba764bf8f47691 SHA512 ab35c058f1ece8b428d8664ba2e14068541279328b5eb9e13b020642cc804c21f7412414dd74bb3621a5136bfa7d9a60832604c944d1e3519c5a94d3dce2a063 WHIRLPOOL a3a5ef45ea92e45a5764cbb484523b2eff671ad2c04f25b0b03efd631d367f3bf9784b19eacf927d909301c73a85505f9f87a3fd3f242fcf48d6e611fe510478
+DIST cteq61.LHpdf 11860 SHA256 0dacfd4d5518b2273ba80ae381af7d46eab4784e84312585f5f149f8fce759f0 SHA512 2769bcaed94aa4b47144cd2c3ce76e0b6ab4fa8af278db5cb3b612f2286200352e829eec3971c8da0b78144483f00bbbf1ae2aae8d1e75045d239fab40289bc0 WHIRLPOOL e24427537b81c438552de53d1ef4ca34c425a241e318ffbeff3f5b632793a2cb6ec4d41bde895e56537c9ace520e012008a5370890c6199b1c29bc4ebc0925ae
+DIST lhapdf-5.8.4.tar.gz 1165256 SHA256 75a3b44bd4509bec47806fb5ad4baaa6334a2aa8f51cf2f7195d4f08bd353ca2
+DIST wrapheragrid-lite.f 7785 SHA256 50e1c4113f6312b0e6131870e7739a4bfb251e20f4f5cddd69e27ceb26e47a1f
+DIST wrapheragrid.f 6931 SHA256 6bd1c4e19de850a2cbe8c548050c772b367f6738f9ba7bb5b6561915833bf5fd
diff --git a/sci-physics/lhapdf/lhapdf-5.8.4.ebuild b/sci-physics/lhapdf/lhapdf-5.8.4.ebuild
new file mode 100644
index 000000000000..8bef4905647f
--- /dev/null
+++ b/sci-physics/lhapdf/lhapdf-5.8.4.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit versionator
+
+MY_PV=$(get_version_component_range 1-3 ${PV})
+MY_PF=${PN}-${MY_PV}
+
+DESCRIPTION="Les Houches Parton Density Function unified library"
+HOMEPAGE="http://projects.hepforge.org/lhapdf/"
+SRC_URI="http://www.hepforge.org/archive/lhapdf/${MY_PF}.tar.gz
+ http://projects.hepforge.org/${PN}/updates-5.8.3/wrapheragrid.f
+ http://projects.hepforge.org/${PN}/updates-5.8.3/wrapheragrid-lite.f
+ test? (
+ http://svn.hepforge.org/${PN}/pdfsets/tags/${MY_PV}/cteq61.LHgrid
+ http://svn.hepforge.org/${PN}/pdfsets/tags/${MY_PV}/MRST2004nlo.LHgrid
+ http://svn.hepforge.org/${PN}/pdfsets/tags/${MY_PV}/cteq61.LHpdf
+ octave? ( http://svn.hepforge.org/${PN}/pdfsets/tags/${MY_PV}/cteq5l.LHgrid ) )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="cxx doc examples octave python test"
+
+RDEPEND="octave? ( sci-mathematics/octave )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[latex] )
+ python? ( dev-lang/swig )"
+
+S="${WORKDIR}/${MY_PF}"
+
+src_unpack() {
+ unpack ${MY_PF}.tar.gz
+ cp "${DISTDIR}"/wrapheragrid.f "${S}"/src/wrapheragrid.f
+ cp "${DISTDIR}"/wrapheragrid-lite.f "${S}"/src/wrapheragrid-lite.f
+}
+
+src_prepare() {
+ # do not create extra latex docs
+ sed -i \
+ -e 's/GENERATE_LATEX.*=YES/GENERATE_LATEX = NO/g' \
+ ccwrap/Doxyfile || die
+}
+
+src_configure() {
+ local myconf="--enable-ccwrap"
+ ! use octave && ! use cxx && myconf="--disable-ccwrap"
+ econf \
+ $(use_enable cxx old-ccwrap ) \
+ $(use_enable octave) \
+ $(use_enable python pyext) \
+ $(use_enable doc doxygen) \
+ ${myconf}
+}
+
+src_test() {
+ # need to make a bogus link for octave test
+ ln -s "${DISTDIR}" PDFsets
+ LHAPATH="${PWD}/PDFsets" \
+ LD_LIBRARY_PATH="${PWD}/lib/.libs:${LD_LIBRARY_PATH}" \
+ emake check || die "emake check failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README TODO AUTHORS ChangeLog
+
+ # leftover
+ rm -rf "${D}"/usr/share/${PN}/doc || die
+ if use doc && use cxx; then
+ # default doc install buggy
+ insinto /usr/share/doc/${PF}
+ doins -r ccwrap/doxy/html || die
+ fi
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*.{f,cc} || die
+ fi
+}
+
+pkg_postinst() {
+ elog "To install data files, you have to run as root:"
+ elog "${ROOT}usr/bin/lhapdf-getdata --dest=${ROOT}usr/share/lhapdf/PDFsets --all"
+}
+
+pkg_postrm() {
+ if [ -d "${ROOT}usr/share/lhapdf" ]; then
+ ewarn "The data directory has not been removed, probably because"
+ ewarn "you still have installed data files."
+ fi
+}
diff --git a/sci-physics/lhapdf/lhapdf-6.1.5.ebuild b/sci-physics/lhapdf/lhapdf-6.1.5.ebuild
new file mode 100644
index 000000000000..e27e87386fb0
--- /dev/null
+++ b/sci-physics/lhapdf/lhapdf-6.1.5.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_IN_SOURCE_BUILD=yes
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit versionator autotools-utils distutils-r1
+
+MY_PV=$(get_version_component_range 1-3 ${PV})
+MY_PF=LHAPDF-${MY_PV}
+
+DESCRIPTION="Les Houches Parton Density Function unified library"
+HOMEPAGE="http://lhapdf.hepforge.org/"
+SRC_URI="http://www.hepforge.org/archive/lhapdf/${MY_PF}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc examples python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ dev-libs/boost:0=
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen[latex] )"
+
+S="${WORKDIR}/${MY_PF}"
+
+src_configure() {
+ autotools-utils_src_configure $(use_enable python)
+ if use python; then
+ cd "${S}/wrappers/python" && distutils-r1_src_prepare
+ fi
+}
+
+src_compile() {
+ autotools-utils_src_compile all $(use doc && echo doxy)
+ if use python; then
+ cd "${S}/wrappers/python" && distutils-r1_src_compile
+ fi
+}
+
+src_test() {
+ autotools-utils_src_compile -C tests
+}
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dohtml -r doc/doxygen/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*.cc
+ fi
+ if use python; then
+ cd "${S}/wrappers/python" && distutils-r1_src_install
+ fi
+}
+
+pkg_postinst() {
+ elog "Download data files from:"
+ elog "http://www.hepforge.org/archive/${PN}/pdfsets/$(get_version_component_range 1-2 ${PV})"
+ elog "and untar them into ${EROOT%/}/usr/share/LHAPDF"
+}
diff --git a/sci-physics/lhapdf/metadata.xml b/sci-physics/lhapdf/metadata.xml
new file mode 100644
index 000000000000..663117301f42
--- /dev/null
+++ b/sci-physics/lhapdf/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ Les Houches Parton Density Function (LHAPDF)
+ provides a unified and easy to use interface to modern PDF
+ sets. It is designed to work not only with individual PDF sets but
+ also with the more recent multiple "error" sets. It can be viewed as
+ the successor to PDFLIB, incorporating many of the older sets found in
+ the latter, including pion and photon PDFs. In LHAPDF the computer
+ code and input parameters/grids are separated thus allowing more easy
+ updating and no limit to the expansion possibilities. The code and
+ data sets can be downloaded together or individually as desired. From
+ version 4.1 onwards a configuration script facilitates the
+ installation of LHAPDF.
+</longdescription>
+<use>
+ <flag name='octave'>Add bindings for <pkg>sci-mathematics/octave</pkg></flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/lightspeed/Manifest b/sci-physics/lightspeed/Manifest
new file mode 100644
index 000000000000..9c2d5531dc78
--- /dev/null
+++ b/sci-physics/lightspeed/Manifest
@@ -0,0 +1,3 @@
+DIST lightspeed-1.2a.tar.gz 163764 SHA256 a8752acce625436b699b4d3c1ab479bd4116673784f17e527a3e37374abc4f4b SHA512 d936e54fcf3f5a59b9d4f0ce7777755d8262a71634f9fca0f5f312a2fbf9f5b65d3fe6628d1547cf88ac8a02243712e838e7d84c5e61a6a318484545896b46ef WHIRLPOOL 0dd6142a32b8c16508bb0fe333683ed8c82c1f461d92f1959e466c3098b56b9f4fa07f285ea754a97b149b60736cb84ff4dde61dd375318f6aa8ec2d0cf17b20
+DIST lightspeed_1.2a-7.diff.gz 379281 SHA256 1cbc562d1ad10afb9598510537cd64fdbbb1f9bd12ac27c5180a668bbc548a58 SHA512 f0a9999750470d45f9b7b6f3339fff5d75b461f8f937e16e784905e85a29fc5587b6b203f151f0a8075ea39b255f6d48c4ca78c48703f4ab3cd2d18af7a4df50 WHIRLPOOL 3cc70f8b1f27229fd510e58b3780f4904d521f192dd9cda7f27ab7feaf70aea0684661d1addcd1482ac36a20fd697f8ce55d81cf1f1d199552a657e35a09046f
+DIST objects-1.tar.gz 767805 SHA256 dd82324796b9f114c652220d069b131321a129ea41ef99cc0b8cbdf8c666bf5b SHA512 cb8c2d5c323b92b87dfe2bfa8f7f37c46b381c4611d5ca2f645a16943339b90850615647f6edc21ae28a28792b0f071e8cac9779dbfdbf6bf928498cdd451231 WHIRLPOOL 07853e37aa761beb5a94fbdce11baeb78ef9c652dbf32c85129cf75af5fe4dae8608fc51f2ccdf0ae612e904c36713ad9a304234234a8e274ae43d09fe068884
diff --git a/sci-physics/lightspeed/files/lightspeed-1.2a-autoconf.patch b/sci-physics/lightspeed/files/lightspeed-1.2a-autoconf.patch
new file mode 100644
index 000000000000..c6b2f9fda711
--- /dev/null
+++ b/sci-physics/lightspeed/files/lightspeed-1.2a-autoconf.patch
@@ -0,0 +1,16 @@
+diff --git a/configure.in b/configure.in
+index 1cfbcba..5363c05 100644
+--- a/configure.in
++++ b/configure.in
+@@ -54,9 +54,8 @@ if test "x$with_gtk" != "x1" -a "$gtkmorph_gtk" = "" ; then
+ AC_MSG_NOTICE([ Testing for GTK 2 skipped])
+ fi
+ if test "x$with_gtk" != "x2" -a "$version_of_gtk" = "" ; then
+- AM_PATH_GTK(1.0.1, , [AC_MSG_ERROR([Cannot find proper GTK+ version])])
+- version_of_gtk=gtk1
+- AC_DEFINE(HAVE_GTK1,1,"compiled with GTK 1 and GtkGLArea ")
++ AC_MSG_ERROR([Cannot find proper GTK+ version])
++ exit 1
+ fi
+
+ AM_CONDITIONAL(COND_GTK1, test "$version_of_gtk" = "gtk1" )
diff --git a/sci-physics/lightspeed/files/lightspeed-1.2a-libpng15.patch b/sci-physics/lightspeed/files/lightspeed-1.2a-libpng15.patch
new file mode 100644
index 000000000000..c3909a7b4dac
--- /dev/null
+++ b/sci-physics/lightspeed/files/lightspeed-1.2a-libpng15.patch
@@ -0,0 +1,19 @@
+--- src/snapshot.c
++++ src/snapshot.c
+@@ -26,6 +26,7 @@
+ #include "lightspeed.h"
+
+ #ifdef HAVE_LIBPNG
++#include <zlib.h>
+ #include <png.h>
+ static int write_png( int message, const void *data );
+ #endif
+@@ -305,7 +306,7 @@
+ return -1;
+ png_write_s = png_create_write_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL );
+ png_info_s = png_create_info_struct( png_write_s );
+- if (setjmp( png_write_s->jmpbuf )) {
++ if (setjmp( png_jmpbuf( png_write_s ) )) {
+ /* Error writing file */
+ png_destroy_write_struct( &png_write_s, &png_info_s );
+ fclose( png_fp );
diff --git a/sci-physics/lightspeed/lightspeed-1.2a-r1.ebuild b/sci-physics/lightspeed/lightspeed-1.2a-r1.ebuild
new file mode 100644
index 000000000000..44edb8d913a8
--- /dev/null
+++ b/sci-physics/lightspeed/lightspeed-1.2a-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils
+
+DEB_PATCH="${PN}_${PV}-7"
+DESCRIPTION="OpenGL interactive relativistic simulator"
+HOMEPAGE="http://lightspeed.sourceforge.net/"
+SRC_URI="
+ mirror://sourceforge/${PN}/${P}.tar.gz
+ mirror://sourceforge/${PN}/objects-1.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${DEB_PATCH}.diff.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+
+IUSE="nls truetype"
+LANGS="es"
+for i in ${LANGS}; do
+ IUSE="${IUSE} linguas_${i}"
+done
+
+RDEPEND="
+ media-libs/libpng
+ media-libs/tiff
+ virtual/opengl
+ x11-libs/gtkglext
+ x11-libs/gtkglarea:2
+ x11-libs/gtk+:2
+ x11-libs/libXmu
+ truetype? ( media-libs/ftgl )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S2="${WORKDIR}/objects"
+
+src_prepare() {
+ epatch "${WORKDIR}/${DEB_PATCH}.diff"
+ epatch \
+ "${FILESDIR}"/${P}-autoconf.patch \
+ "${FILESDIR}"/${P}-libpng15.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-gtk=2 \
+ $(use_enable nls) \
+ $(use_with truetype ftgl)
+}
+
+src_compile() {
+ emake
+ local i
+ for i in ${LANGS}; do
+ use linguas_${i} && emake ${i}.gmo
+ done
+}
+
+src_install() {
+ default
+ newicon src/icon.xpm lightspeed.xpm
+ make_desktop_entry ${PN} "Light Speed! Relativistic Simulator"
+ newdoc debian/changelog ChangeLog.Debian
+ cd ${S2}
+ newdoc README objects-README
+ insinto /usr/share/${PN}
+ doins *.3ds *.lwo
+}
+
+pkg_postinst() {
+ elog
+ elog "Some 3d models have been placed in /usr/share/${PN}"
+ elog "You can load them in Light Speed! from the File menu."
+ elog
+}
diff --git a/sci-physics/lightspeed/metadata.xml b/sci-physics/lightspeed/metadata.xml
new file mode 100644
index 000000000000..bbdc6a250095
--- /dev/null
+++ b/sci-physics/lightspeed/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ Light Speed! is an OpenGL-based program developed to illustrate the
+ effects of special relativity on the appearance of moving
+ objects. The moving object is, by default, a geometric lattice. 3D
+ Studio and LightWave 3D objects may be imported as well. Best of
+ all, the simulator is completely interactive, rendering the exotic
+ distortions in real-time.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">lightspeed</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-physics/meep/Manifest b/sci-physics/meep/Manifest
new file mode 100644
index 000000000000..c31932049131
--- /dev/null
+++ b/sci-physics/meep/Manifest
@@ -0,0 +1,2 @@
+DIST meep-1.1.1.tar.gz 751244 SHA256 7a97b5555da1f9ea2ec6eed5c45bd97bcd6ddbd54bdfc181f46c696dffc169f2 SHA512 cc081b7c63dc4ecda600dd5f55b3833f25fcfd1c1fded0af3a9bbd0471e36f0e54045a78ea52c99ca8aa3beccbe8e6e8afccbbadf869cd5b926a765b0c32618a WHIRLPOOL 2a894c63cb5bf4e907cc3da90ac3c5ff53f181b1e2d9695876806b3b67cb0da5fbc239033ffc33f84d1510bb5851910b33ead9b49dc769ce39e6fd420d990f78
+DIST meep-1.2.tar.gz 807522 SHA256 2734737b8053a45942bc1a50933d63b6fd18c7dc3cf33e92e0815ece93138942 SHA512 f7b25183491881d59653ba5bc727a2b4f5deb126d515ff7ed5df7a1f9d31a5161b720348e65f45b9c76004be44714c606c4b8063f855b5cc97ff7757bd5a5656 WHIRLPOOL 54940326d8f304a57c2dd69c411ef394f44cd2c57367f16a4a0dd6d3fa6df0ee01e0b0081048b4ec3fd8eff404e76507d6dea5db1b9b975096a40d34d1595080
diff --git a/sci-physics/meep/files/meep-1.2-no-auto-mpb.patch b/sci-physics/meep/files/meep-1.2-no-auto-mpb.patch
new file mode 100644
index 000000000000..8c287f208d65
--- /dev/null
+++ b/sci-physics/meep/files/meep-1.2-no-auto-mpb.patch
@@ -0,0 +1,16 @@
+diff -Nur meep-1.2.orig/configure.ac meep-1.2/configure.ac
+--- meep-1.2.orig/configure.ac 2012-08-14 21:52:13.000000000 +0100
++++ meep-1.2/configure.ac 2012-08-14 22:00:55.000000000 +0100
+@@ -161,8 +161,10 @@
+
+ ###########################################################################
+ # MPB library
+-
+-AC_CHECK_HEADER(mpb.h, [have_mpb=maybe], [have_mpb=no])
++AC_ARG_WITH(mpb, [AC_HELP_STRING([--without-mpb],[do not build with mpb])], ok=$withval, ok=yes)
++if test "$ok" = "yes"; then
++ AC_CHECK_HEADER(mpb.h, [have_mpb=maybe], [have_mpb=no])
++fi
+
+ if test $have_mpb = maybe; then
+ if test "x$acx_lapack_ok" = x -a "$have_harminv" = xno; then
diff --git a/sci-physics/meep/files/meep-1.2-pc-no-ldflags.patch b/sci-physics/meep/files/meep-1.2-pc-no-ldflags.patch
new file mode 100644
index 000000000000..d7b2f72eaffc
--- /dev/null
+++ b/sci-physics/meep/files/meep-1.2-pc-no-ldflags.patch
@@ -0,0 +1,12 @@
+diff -Nur meep-1.2.orig/configure.ac meep-1.2/configure.ac
+--- meep-1.2.orig/configure.ac 2012-08-14 21:52:13.000000000 +0100
++++ meep-1.2/configure.ac 2012-08-14 21:54:49.000000000 +0100
+@@ -224,7 +224,7 @@
+ ##############################################################################
+ # Libraries and flags (other than -lmeep) required to link Meep:
+
+-MEEPLIBS="$LDFLAGS $LIBS"
++MEEPLIBS="$LIBS"
+ AC_SUBST(MEEPLIBS)
+
+ ##############################################################################
diff --git a/sci-physics/meep/meep-1.1.1.ebuild b/sci-physics/meep/meep-1.1.1.ebuild
new file mode 100644
index 000000000000..4edfc1f664e7
--- /dev/null
+++ b/sci-physics/meep/meep-1.1.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="Simulation software to model electromagnetic systems"
+HOMEPAGE="http://ab-initio.mit.edu/meep/"
+SRC_URI="http://ab-initio.mit.edu/meep/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="examples hdf5 guile mpi"
+
+DEPEND="sci-libs/fftw
+ sci-libs/gsl
+ sci-physics/harminv
+ guile? ( >=sci-libs/libctl-3.0.3 )
+ hdf5? ( sci-libs/hdf5 )
+ mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ econf \
+ --enable-shared \
+ $(use_with mpi) \
+ $(use_with hdf5) \
+ $(use_with guile libctl)
+}
+
+src_test() {
+ # bug #423247
+ emake pml -C tests CXXFLAGS=-O0 || die
+ emake check || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc AUTHORS NEWS README TODO
+ insinto /usr/share/doc/${PF}
+ if use examples; then
+ doins -r examples || die "install examples failed"
+ fi
+}
diff --git a/sci-physics/meep/meep-1.2.ebuild b/sci-physics/meep/meep-1.2.ebuild
new file mode 100644
index 000000000000..b4b57f0a2930
--- /dev/null
+++ b/sci-physics/meep/meep-1.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+AUTOTOOLS_AUTORECONF=1
+inherit autotools-utils
+
+DESCRIPTION="Simulation software to model electromagnetic systems"
+HOMEPAGE="http://ab-initio.mit.edu/meep/"
+SRC_URI="http://ab-initio.mit.edu/meep/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples hdf5 guile mpb mpi"
+
+RDEPEND="
+ sci-libs/fftw
+ sci-libs/gsl
+ sci-physics/harminv
+ guile? ( >=sci-libs/libctl-3.2 )
+ hdf5? ( sci-libs/hdf5 )
+ mpb? ( sci-physics/mpb )
+ mpi? ( virtual/mpi )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-pc-no-ldflags.patch
+ "${FILESDIR}"/${P}-no-auto-mpb.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with mpb)
+ $(use_with mpi)
+ $(use_with hdf5)
+ $(use_with guile libctl)
+ )
+ autotools-utils_src_configure
+}
+
+src_test() {
+ # pml test buggy with optimization on
+ # http://thread.gmane.org/gmane.comp.science.electromagnetism.meep.general/4579
+ pushd ${AUTOTOOLS_BUILD_DIR} > /dev/null
+ emake -C tests pml CXXFLAGS="-O0"
+ emake check
+ popd > /dev/null
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/*.ctl
+ fi
+}
diff --git a/sci-physics/meep/metadata.xml b/sci-physics/meep/metadata.xml
new file mode 100644
index 000000000000..17865fb063ef
--- /dev/null
+++ b/sci-physics/meep/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ The MIT Electromagnetic Equation Propagation (MEEP) is a
+ finite-difference time-domain (FDTD) simulation software package
+ developed at MIT to model electromagnetic systems, along with the MPB
+ eigenmode package.
+</longdescription>
+<use>
+ <flag name='mpb'>Enable build against <pkg>sci-physics/mpb</pkg></flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/metadata.xml b/sci-physics/metadata.xml
new file mode 100644
index 000000000000..2ad6cdefcdbf
--- /dev/null
+++ b/sci-physics/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sci-physics category contains physics related software.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sci-physics contém programas relacionados com
+ física.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sci-physics contiene software relacionado con
+ la física.
+ </longdescription>
+</catmetadata>
+
diff --git a/sci-physics/mpb/Manifest b/sci-physics/mpb/Manifest
new file mode 100644
index 000000000000..5f52a99d8cbd
--- /dev/null
+++ b/sci-physics/mpb/Manifest
@@ -0,0 +1 @@
+DIST mpb-1.4.2.tar.gz 686488 SHA256 e44c0720a5969a879fb93e48f6098d4d87e2f99d6ef49711d822f4c2249ccd61 SHA512 4151612b8868b324353556f46aeccdce2726d8938ab8cf7404c36da68e90ec0de1799d4e23b2d5bbe5853d0c0329ba0ee1a2fdb2745aed43c34759084b62fbac WHIRLPOOL e0b256c06bdd2c7479723c0db6c434e645b6fbf1a052ebc2971203902f9bf09336b4bf69ec8c8f1cd9b4952672a28290b4ff66c44f56feae135d9cbf07284473
diff --git a/sci-physics/mpb/files/mpb-1.4.2-autotools.patch b/sci-physics/mpb/files/mpb-1.4.2-autotools.patch
new file mode 100644
index 000000000000..b6faf07d2bcf
--- /dev/null
+++ b/sci-physics/mpb/files/mpb-1.4.2-autotools.patch
@@ -0,0 +1,262 @@
+diff -Nur mpb-1.4.2.orig/configure.ac mpb-1.4.2/configure.ac
+--- mpb-1.4.2.orig/configure.ac 2003-03-04 02:38:41.000000000 +0000
++++ mpb-1.4.2/configure.ac 2008-11-25 17:31:12.000000000 +0000
+@@ -6,15 +6,8 @@
+ MPB_VERSION=1.4.2
+ AC_SUBST(MPB_VERSION)
+
+-AC_MSG_CHECKING([for vendor f77 to be used instead of g77])
+-AC_MSG_RESULT()
+-AC_CHECK_PROGS(F77, f77 xlf77 cf77 fort77 f90 xlf90)
+ AC_PROG_F77
+-
+-# Get C compiler.
+-AC_MSG_CHECKING([for vendor cc to be used instead of gcc])
+-AC_MSG_RESULT()
+-AC_CHECK_PROGS(CC, cc xlc) # prefer vendor cc, to stay in sync with Fortran
++AC_F77_WRAPPERS
+ AC_PROG_CC
+
+ # Checks for programs.
+@@ -79,12 +72,6 @@
+ echo "*********************** HERMITIAN EPS. ***********************"
+ fi
+
+-# Add lots of compiler warnings to check for if we are using gcc:
+-# (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.)
+-if test "$GCC" = "yes"; then
+- CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
+-fi
+-
+ ##############################################################################
+ # Checks for libraries:
+ ##############################################################################
+@@ -203,6 +190,10 @@
+ # how to run mpb-mpi in general
+ fi
+
++# Checks for header files.
++AC_HEADER_STDC
++AC_CHECK_HEADERS(unistd.h getopt.h)
++
+ ##############################################################################
+ # Check for HDF5 library
+ AC_ARG_WITH(hdf5, [AC_HELP_STRING([--without-hdf5],[do not use HDF5 output])], ok=$withval, ok=yes)
+@@ -349,9 +340,7 @@
+ ]], [AC_MSG_RESULT(ok)], [AC_MSG_ERROR([libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required])])
+
+ ##############################################################################
+-# Checks for header files.
+-AC_HEADER_STDC
+-AC_CHECK_HEADERS(unistd.h getopt.h)
++
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+diff -Nur mpb-1.4.2.orig/Makefile.in mpb-1.4.2/Makefile.in
+--- mpb-1.4.2.orig/Makefile.in 2002-01-18 22:52:41.000000000 +0000
++++ mpb-1.4.2/Makefile.in 2008-11-25 17:31:12.000000000 +0000
+@@ -2,6 +2,9 @@
+
+ SHELL = @SHELL@
+
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
+ CC = @CC@
+ CFLAGS = @CFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+diff -Nur mpb-1.4.2.orig/mpb-ctl/Makefile.in mpb-1.4.2/mpb-ctl/Makefile.in
+--- mpb-1.4.2.orig/mpb-ctl/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/mpb-ctl/Makefile.in 2008-11-25 18:23:20.000000000 +0000
+@@ -13,6 +13,12 @@
+
+ SHELL = @SHELL@
+
++mandir = @mandir@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
+ ##############################################################################
+
+ # Makefile.in for programs using libctl (assumes that autoconf is
+@@ -37,8 +43,8 @@
+ ../src/util/util.a
+
+ MY_LDFLAGS = # extra -L flags go here
+-MY_CPPFLAGS = -I. -I../src/util -I../src/matrices -I../src/matrixio \
+- -I../src/maxwell
++MY_CPPFLAGS = -I$(srcdir) -I$(top_srcdir)/src/util -I$(top_srcdir)/src/matrices -I$(top_srcdir)/src/matrixio \
++ -I$(top_srcdir)/src/maxwell
+ MY_DEFS = -DHAVE_CTL_HOOKS=1 -DHAVE_CTL_EXPORT_HOOK=1
+
+ # The following variables should be detected and set by autoconf:
+@@ -134,11 +140,11 @@
+
+ install-mpb: $(PROGRAM_NAME)
+ $(INSTALL) -d $(prefix)/bin
+- $(INSTALL) -m 0755 -s .$(PROGRAM_NAME) $(prefix)/bin/`echo $(PROGRAM_NAME)|sed '$(transform)'`
++ $(INSTALL) -m 0755 .$(PROGRAM_NAME) $(prefix)/bin/`echo $(PROGRAM_NAME)|sed '$(transform)'`
+ $(INSTALL) -d $(prefix)/share/libctl/specs
+ $(INSTALL) -m 0644 $(SPECIFICATION_FILE) $(prefix)/share/libctl/specs
+ $(INSTALL) -d $(mandir)/man1
+- $(INSTALL) -m 0644 $(PROGRAM_NAME).1 $(mandir)/man1
++ $(INSTALL) -m 0644 $(srcdir)/$(PROGRAM_NAME).1 $(mandir)/man1
+
+ mpb-split-tmp:
+ rm -f mpb-split-tmp
+@@ -149,7 +155,7 @@
+ mpb_name=`echo mpb | sed '$(transform)'`; \
+ $(INSTALL) -m 0755 mpb-split-tmp $(prefix)/bin/$${mpb_name}-split
+ $(INSTALL) -d $(mandir)/man1
+- $(INSTALL) -m 0644 mpb-split.1 $(mandir)/man1
++ $(INSTALL) -m 0644 $(srcdir)/mpb-split.1 $(mandir)/man1
+
+ clean:
+ rm -f $(ALL_OBJECTS) ctl-io.c ctl-io.h main.c geom.c \
+diff -Nur mpb-1.4.2.orig/src/matrices/Makefile.in mpb-1.4.2/src/matrices/Makefile.in
+--- mpb-1.4.2.orig/src/matrices/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/src/matrices/Makefile.in 2008-11-25 17:31:12.000000000 +0000
+@@ -2,9 +2,11 @@
+
+ SHELL = @SHELL@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I../util -I. @CPPFLAGS@
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
++CPPFLAGS = -I$(top_srcdir)/src/util -I$(srcdir) -I. @CPPFLAGS@
+ DEFS = @DEFS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+diff -Nur mpb-1.4.2.orig/src/matrixio/Makefile.in mpb-1.4.2/src/matrixio/Makefile.in
+--- mpb-1.4.2.orig/src/matrixio/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/src/matrixio/Makefile.in 2008-11-25 17:31:12.000000000 +0000
+@@ -2,9 +2,11 @@
+
+ SHELL = @SHELL@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I../util -I../matrices -I. @CPPFLAGS@
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
++CPPFLAGS = -I$(top_srcdir)/src/util -I$(top_srcdir)/src/matrices -I$(srcdir) -I. @CPPFLAGS@
+ DEFS = @DEFS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+diff -Nur mpb-1.4.2.orig/src/maxwell/Makefile.in mpb-1.4.2/src/maxwell/Makefile.in
+--- mpb-1.4.2.orig/src/maxwell/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/src/maxwell/Makefile.in 2008-11-25 17:31:12.000000000 +0000
+@@ -2,9 +2,11 @@
+
+ SHELL = @SHELL@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I../util -I../matrices @CPPFLAGS@
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
++CPPFLAGS = -I$(top_srcdir)/src/util -I$(top_srcdir)/src/matrices -I. @CPPFLAGS@
+ DEFS = @DEFS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+diff -Nur mpb-1.4.2.orig/src/util/Makefile.in mpb-1.4.2/src/util/Makefile.in
+--- mpb-1.4.2.orig/src/util/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/src/util/Makefile.in 2008-11-25 17:31:12.000000000 +0000
+@@ -2,9 +2,11 @@
+
+ SHELL = @SHELL@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I. @CPPFLAGS@
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
++CPPFLAGS = -I$(top_srcdir) -I. @CPPFLAGS@
+ DEFS = @DEFS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+diff -Nur mpb-1.4.2.orig/tests/Makefile.in mpb-1.4.2/tests/Makefile.in
+--- mpb-1.4.2.orig/tests/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/tests/Makefile.in 2008-11-25 17:31:58.000000000 +0000
+@@ -2,12 +2,14 @@
+
+ SHELL = @SHELL@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I../src/util -I../src/matrices -I../src/maxwell @CPPFLAGS@
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++
++CPPFLAGS = -I$(top_srcdir)/src/util -I$(top_srcdir)/src/matrices -I$(top_srcdir)/src/maxwell -I. @CPPFLAGS@
+ DEFS = @DEFS@
+-LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
++LDFLAGS = @LDFLAGS@
+ RANLIB = @RANLIB@
+ @SET_MAKE@
+
+@@ -15,11 +17,11 @@
+ ../src/matrices/matrices.a \
+ ../src/util/util.a
+
+-all: blastest eigs_test maxwell_test malloctest normal_vectors
++all:
+
+ libs:
+
+-check: all
++check: blastest eigs_test maxwell_test malloctest normal_vectors
+ rm -f blastest.out.test
+ ./blastest | sed 's/\-0\.000\([ ,)]\)/ 0.000\1/g' | sed 's/\-0\.000$$/ 0.000/g' > blastest.out.test
+ diff blastest.@SCALAR_TYPE@.out blastest.out.test
+diff -Nur mpb-1.4.2.orig/utils/Makefile.in mpb-1.4.2/utils/Makefile.in
+--- mpb-1.4.2.orig/utils/Makefile.in 2002-09-14 23:20:55.000000000 +0100
++++ mpb-1.4.2/utils/Makefile.in 2008-11-25 18:23:46.000000000 +0000
+@@ -1,13 +1,16 @@
+ # Variables substituted by the autoconf configure script:
+
+ SHELL = @SHELL@
++mandir = @mandir@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
+
+-CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = -I../src/util -I../src/matrices -I../src/matrixio @CPPFLAGS@
++CPPFLAGS = -I$(top_srcdir)/src/util -I$(top_srcdir)/src/matrices -I$(top_srcdir)/src/matrixio -I. @CPPFLAGS@
+ DEFS = @DEFS@ -DMPB_VERSION='"'"@MPB_VERSION@"'"'
+-LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
++LDFLAGS=@LDFLAGS@
+ RANLIB = @RANLIB@
+ @SET_MAKE@
+
+@@ -36,9 +39,9 @@
+
+ install-mpb-data: mpb-data
+ $(INSTALL) -d $(prefix)/bin
+- $(INSTALL) -m 0755 -s mpb-data $(prefix)/bin/`echo mpb-data|sed '$(transform)'`
++ $(INSTALL) -m 0755 mpb-data $(prefix)/bin/`echo mpb-data|sed '$(transform)'`
+ $(INSTALL) -d $(mandir)/man1
+- $(INSTALL) -m 0644 mpb-data.1 $(mandir)/man1
++ $(INSTALL) -m 0644 $(srcdir)/mpb-data.1 $(mandir)/man1
+
+ clean:
+ rm -f mpb-data mpb-data.o core
diff --git a/sci-physics/mpb/files/mpb-1.4.2-guile18.patch b/sci-physics/mpb/files/mpb-1.4.2-guile18.patch
new file mode 100644
index 000000000000..9cb73a099b8b
--- /dev/null
+++ b/sci-physics/mpb/files/mpb-1.4.2-guile18.patch
@@ -0,0 +1,12 @@
+diff -Nur mpb-1.4.2.orig/mpb-ctl/field-smob.c mpb-1.4.2/mpb-ctl/field-smob.c
+--- mpb-1.4.2.orig/mpb-ctl/field-smob.c 2012-08-07 20:56:24.538452994 -0700
++++ mpb-1.4.2/mpb-ctl/field-smob.c 2012-08-07 20:56:43.713557380 -0700
+@@ -157,7 +157,7 @@
+ boolean cur_fieldp(SCM obj)
+ {
+ if (SCM_NIMP(obj) && SCM_SYMBOLP(obj)) {
+- char *s = gh_symbol2newstr(obj, NULL);
++ char *s = gh_symbol2newstr(obj);
+ int ret = !strcmp(s, "cur-field");
+ free(s);
+ return ret;
diff --git a/sci-physics/mpb/files/mpb-1.4.2-headers.patch b/sci-physics/mpb/files/mpb-1.4.2-headers.patch
new file mode 100644
index 000000000000..937e5fc373d4
--- /dev/null
+++ b/sci-physics/mpb/files/mpb-1.4.2-headers.patch
@@ -0,0 +1,11 @@
+diff -Nur mpb-1.4.2.orig/mpb-ctl/matrix-smob.c mpb-1.4.2/mpb-ctl/matrix-smob.c
+--- mpb-1.4.2.orig/mpb-ctl/matrix-smob.c 2002-09-13 19:27:35.000000000 +0100
++++ mpb-1.4.2/mpb-ctl/matrix-smob.c 2008-11-25 18:20:11.000000000 +0000
+@@ -17,6 +17,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <math.h>
+
+ #include "../src/config.h"
+
diff --git a/sci-physics/mpb/metadata.xml b/sci-physics/mpb/metadata.xml
new file mode 100644
index 000000000000..1b9dacc2cdfa
--- /dev/null
+++ b/sci-physics/mpb/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ The MIT Photonic-Bands (MPB) package is a program for computing
+ the band structures (dispersion relations) and electromagnetic modes of
+ periodic dielectric structures, on both serial and parallel computers. It was
+ developed by Steven G. Johnson at MIT in the Joannopoulos Ab Initio Physics
+ group.
+ This program computes definite-frequency eigenstates of Maxwell's
+ equations in periodic dielectric structures for arbitrary wavevectors, using
+ fully-vectorial and three-dimensional methods. It is especially
+ designed for the study of photonic crystals (a.k.a. photonic
+ band-gap materials), but is also applicable to many other problems
+ in optics, such as waveguides and resonator systems.
+ (For example, it can solve for the modes of waveguides with arbitrary
+ cross-sections.)
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/mpb/mpb-1.4.2-r2.ebuild b/sci-physics/mpb/mpb-1.4.2-r2.ebuild
new file mode 100644
index 000000000000..7eb255b57e63
--- /dev/null
+++ b/sci-physics/mpb/mpb-1.4.2-r2.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="Photonic band structure program"
+SRC_URI="http://ab-initio.mit.edu/mpb/${P}.tar.gz"
+HOMEPAGE="http://ab-initio.mit.edu/mpb/"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples hdf5 mpi"
+
+SLOT="0"
+
+RDEPEND="virtual/lapack
+ dev-scheme/guile
+ sci-libs/libctl
+ sci-libs/fftw:2.1[mpi?]
+ sys-libs/readline
+ hdf5? ( sci-libs/hdf5 )
+ mpi? ( virtual/mpi )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-autotools.patch \
+ "${FILESDIR}"/${P}-guile18.patch \
+ "${FILESDIR}"/${P}-headers.patch
+ cd "${S}"
+ eautoreconf
+ # version with inversion symmetry (mpbi).
+ cp -r "${S}" "${S}_inv" || die
+ # version with hermitian eps (mpbh).
+ cp -r "${S}" "${S}_herm" || die
+ # mpi versions (mpb-mpi).
+ if use mpi; then
+ cp -r "${S}" "${S}_mpi" || die
+ cp -r "${S}" "${S}_inv_mpi" || die
+ cp -r "${S}" "${S}_herm_mpi" || die
+ fi
+ tc-export CC
+}
+
+src_configure() {
+ # enable legacy API for hdf-1.8
+ use hdf5 && append-cflags -DH5_USE_16_API
+ #
+ local myconf=(
+ --with-libctl="${EPREFIX}/usr/share/libctl"
+ --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
+ --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
+ $(use_with hdf5)
+ )
+
+ econf "${myconf[@]}"
+
+ cd "${S}_inv"
+ econf "${myconf[@]}" \
+ --with-inv-symmetry
+
+ cd "${S}_herm"
+ econf "${myconf[@]}" \
+ --with-hermitian-eps
+
+ if use mpi; then
+ cd "${S}_mpi"
+ econf "${myconf[@]}" \
+ --with-mpi
+ cd "${S}_inv_mpi"
+ econf "${myconf[@]}" \
+ --with-inv-symmetry \
+ --with-mpi
+ cd "${S}_herm_mpi"
+ econf "${myconf[@]}" \
+ --with-hermitian-eps \
+ --with-mpi \
+ CC=mpicc
+ fi
+}
+
+src_compile() {
+ local d
+ for d in . _inv _herm; do
+ cd "${S}${d}"
+ emake -C mpb-ctl ctl-io.c
+ emake
+ done
+ if use mpi; then
+ for d in . _inv _herm; do
+ cd "${S}${d}_mpi"
+ emake -C mpb-ctl ctl-io.c CC=mpicc
+ emake CC=mpicc LD=mpicc
+ done
+ fi
+}
+
+src_install() {
+ einstall
+ dodoc README NEWS AUTHORS COPYRIGHT ChangeLog TODO
+ use doc && dohtml doc/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r mpb-ctl/examples
+ fi
+
+ newbin "${S}_inv"/mpb-ctl/.mpb mpbi
+ newbin "${S}_herm"/mpb-ctl/.mpb mpbh
+
+ einfo "Several versions of mpb have been installed:"
+ einfo "mpb : regular version"
+ einfo "mpbi: configured for inversion symmetry"
+ einfo "mpbh: configured for hermitian epsilon"
+ if use mpi; then
+ newbin "${S}_mpi"/mpb-ctl/.mpb mpb-mpi
+ newbin "${S}_inv_mpi"/mpb-ctl/.mpb mpbh-mpi
+ newbin "${S}_herm_mpi"/mpb-ctl/.mpb mpbi-mpi
+ einfo "mpb-mpi : regular version with mpi"
+ einfo "mpbi-mpi: configured for inversion symmetry with mpi"
+ einfo "mpbh-mpi: configured for hermitian epsilon with mpi"
+ fi
+}
diff --git a/sci-physics/paw/Manifest b/sci-physics/paw/Manifest
new file mode 100644
index 000000000000..964e89136fe0
--- /dev/null
+++ b/sci-physics/paw/Manifest
@@ -0,0 +1,3 @@
+DIST paw_2.14.04.dfsg.2-8.debian.tar.gz 75788 SHA256 1fa912310f5c2eb4cd856fca53808d6142451fc6be4ffa3be14f54195f8e2203 SHA512 63800b6071c0614d3d68eceffc23117703a9e48f6a9da3fd160b2eb27b326ffe7dc38718245d40e713b2c047967233e1aa56e7381754bbc95804b4c208d1d270 WHIRLPOOL 38899fa56f370cc4cbae0d593006a09cee451ecfb97b8d236b18bc4a36bfde7d5c4891a9309bd9e8bad9da8d8ba8691fc77b37f7e48545b989f6b9983e61ab38
+DIST paw_2.14.04.dfsg.2-9.debian.tar.gz 79495 SHA256 ff00ccfbc79ea3e727678ff0098d08a87851bc6a18a22b15ddd7e9a7634cef48 SHA512 e0ffd28aef621fbe7ff372bf1add2c3614897c755ada061d80835e43f0e7ebe342c44f5c989110ce53d8896d9738798277689bcb9fcba87c4eeae89e4d340b81 WHIRLPOOL befbf2ef10f1cf28733e06f5d08f36cd1eda8af99640aaf680daec9954ed1ca52a29599855c77e09a949306590a926eba13a5236dc3810debe528c0e720d5bf3
+DIST paw_2.14.04.dfsg.2.orig.tar.gz 3334317 SHA256 68925384706a4a61c477a48ed0fad539d214a4b04fdb9db5ef4e8d453f26c44e SHA512 6e4ef312195936b42ad641a63335586f48e0383e8a7f4330d52173492584f9d03c5fa4eab7e7de594e30556a1daacbe162b4f879718c9c489cb7a89f072b962e WHIRLPOOL a1c78a8d66cc10a1014a96d0b276fc0bf0725ff08ed6055ff4be9c194d50d1416ea32bfae32ea18d1b919d03ff2746c0bda29b74c15b2296f211d58086951551
diff --git a/sci-physics/paw/files/paw-2.14.04-glibc-2.10.patch b/sci-physics/paw/files/paw-2.14.04-glibc-2.10.patch
new file mode 100644
index 000000000000..7cfa5aa03d12
--- /dev/null
+++ b/sci-physics/paw/files/paw-2.14.04-glibc-2.10.patch
@@ -0,0 +1,11 @@
+--- src/pawlib/paw/cpaw/bugrep.c.orig 2009-07-13 00:38:38.000000000 +0400
++++ src/pawlib/paw/cpaw/bugrep.c 2009-07-13 08:47:54.934308924 +0400
+@@ -20,6 +20,8 @@
+ * Paw
+ *
+ */
++#define _POSIX_SOURCE
++
+ #include "paw/pilot.h"
+ #if defined(CERNLIB_BUGREPORT)
+ /*CMZ : 2.07/19 21/11/95 18.17.13 by Unknown*/
diff --git a/sci-physics/paw/metadata.xml b/sci-physics/paw/metadata.xml
new file mode 100644
index 000000000000..9450758ff229
--- /dev/null
+++ b/sci-physics/paw/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ PAW is an interactive program providing interactive graphical
+ presentation and statistical and mathematical analysis tools. It is
+ designed to work on objects familiar to physicists such as histograms,
+ event files (Ntuples), vectors, etc.
+ The program is linked statically against the CERN libraries on 64-bit
+ architectures in order to function properly, as its design is not very
+ 64-bit clean. Even so, AMD64 is the only 64-bit platform where it
+ functions well.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/paw/paw-2.14.04-r4.ebuild b/sci-physics/paw/paw-2.14.04-r4.ebuild
new file mode 100644
index 000000000000..a223aad0e5e5
--- /dev/null
+++ b/sci-physics/paw/paw-2.14.04-r4.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs fortran-2
+
+DEB_PN=paw
+DEB_PV=${PV}.dfsg.2
+DEB_PR=8
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN's Physics Analysis Workstation data analysis program"
+HOMEPAGE="https://paw.web.cern.ch/paw/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="amd64 hppa sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ sci-physics/cernlib
+ x11-libs/libXaw
+ >=x11-libs/motif-2.3:0
+ x11-libs/xbae"
+DEPEND="${RDEPEND}
+ dev-lang/cfortran
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ mv ../debian . && cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+
+ # fix some path stuff and collision for comis.h,
+ # already installed by cernlib and replace hardcoded fortran compiler
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ -e '/comis.h/d' \
+ -e "s/gfortran/$(tc-getFC)/g" \
+ Makefile || die
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+ epatch "${FILESDIR}"/${P}-glibc-2.10.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+}
+
+src_compile() {
+ VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_install() {
+ default
+ cd debian
+ dodoc changelog README.* deadpool.txt copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/paw/paw-2.14.04-r5.ebuild b/sci-physics/paw/paw-2.14.04-r5.ebuild
new file mode 100644
index 000000000000..8f170c1d7e36
--- /dev/null
+++ b/sci-physics/paw/paw-2.14.04-r5.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs fortran-2
+
+DEB_PN=paw
+DEB_PV=${PV}.dfsg.2
+DEB_PR=9
+DEB_P=${DEB_PN}_${DEB_PV}
+
+DESCRIPTION="CERN's Physics Analysis Workstation data analysis program"
+HOMEPAGE="https://paw.web.cern.ch/paw/"
+SRC_URI="
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2 BSD"
+KEYWORDS="~amd64 ~hppa ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ sci-physics/cernlib
+ x11-libs/libXaw
+ >=x11-libs/motif-2.3:0
+ x11-libs/xbae"
+DEPEND="${RDEPEND}
+ dev-lang/cfortran
+ virtual/latex-base
+ x11-misc/imake
+ x11-misc/makedepend"
+
+S="${WORKDIR}/${DEB_PN}-${DEB_PV}.orig"
+
+src_prepare() {
+ mv ../debian . && cp debian/add-ons/Makefile .
+ export DEB_BUILD_OPTIONS="$(tc-getFC) nostrip nocheck"
+
+ # fix some path stuff and collision for comis.h,
+ # already installed by cernlib and replace hardcoded fortran compiler
+ sed -i \
+ -e "s:/usr/local:${EROOT}/usr:g" \
+ -e '/comis.h/d' \
+ -e "s/gfortran/$(tc-getFC)/g" \
+ Makefile || die
+
+ einfo "Applying Debian patches"
+ emake -j1 patch
+ epatch "${FILESDIR}"/${P}-glibc-2.10.patch
+ # since we depend on cfortran, do not use the one from cernlib
+ rm src/include/cfortran/cfortran.h || die
+ sed -i \
+ -e "s|\(ArCmdBase[[:space:]]*\)ar|\1$(tc-getAR)|g" \
+ -e "s|\(RanlibCmd[[:space:]]*\)ranlib|\1$(tc-getRANLIB)|g" \
+ src/config/Imake.tmpl \
+ || die "sed Imake.tmpl failed"
+}
+
+src_compile() {
+ VARTEXFONTS="${T}"/fonts
+ emake -j1 cernlib-indep cernlib-arch
+}
+
+src_install() {
+ default
+ cd debian
+ dodoc changelog README.* deadpool.txt copyright
+ newdoc add-ons/README README.add-ons
+}
diff --git a/sci-physics/pythia/Manifest b/sci-physics/pythia/Manifest
new file mode 100644
index 000000000000..32765731149b
--- /dev/null
+++ b/sci-physics/pythia/Manifest
@@ -0,0 +1,13 @@
+DIST CT10.tar.gz 10246366 SHA256 bcef4600c5af42d6b151b60e29297609e3604f02f5e80f8ec7767a22b185f49d SHA512 90406bd102ab54b683fa3e6f3fc759febea2454a0b96c6a8d373cdec297f5d652097057a015c7d87241792ed9b5d9ac658a33155cdd7362f59110f8f06ecce73 WHIRLPOOL a433983f9938d848a0b23f94195c41a3caf2a4a131f225f8ec27b43d7ca88761e302ed7968c66492b1fee7288e921aa7a40644833d90eeb66a139a8524553003
+DIST MRST2004qed.tar.gz 185079 SHA256 f043f5385d828523169458c01e2d82767468002789ad792d3543efacc4fcb9cd SHA512 404aacf0e241f572cc42ad4cf963deef1acd3d365fa68cfa3518878f921858046377ea39caf663fdced2cdde07af2f6ce695737f7fea229489df3d3f38283c95 WHIRLPOOL 1eb5a8c5a63005b1087ad5b39faf5ba928071ca1edb3aa9e957b43b0a32a3ddb252b75c5fd30f2e364f628583834febc6ff14984b832f2916ad06a2fcdf0d77d
+DIST MRST2007lomod.tar.gz 56685 SHA256 26533c463c17c96c467d40a0aa5603bbe657f986e05154e90782aac43f34598d SHA512 8e55627a01c85d90a62e4fb11b115c2faac2220479b6d558d3d6f1b801fc5c3e88abc377cd5437ccaeedd34b2ca42d6e833014566b796e5e1eebcf4d620e5dc0 WHIRLPOOL 16dfc110168fb3d865f3e743b4a8ce5e5995496fee53a286e82c647eff5afb7072e9d1ef8c940408c4a8184e5a9f7a190f9deea26e1b7bf227c1e5d6eaa3ff77
+DIST NNPDF23_nlo_as_0119_qed_mc.tar.gz 25223180 SHA256 61e36f3aec29e7b38d161a4ebc4978032e5e1f7af70764f6726cabdbac6283b1 SHA512 fc6998d50a61bbe65eef827021c0f453164795c079daef6a4932f825f8db4ae318bbf0e8781b61f1d3ffa9a495b5c4813af3aa31c77694657a44356d93fa970f WHIRLPOOL 31fe0ba55fac9d032441dc955a2117d42d2ab1cc697567e4b9350c4c1866982036178378a9ddeb5416ef1c2712e54cbba32dac4260fff0de07d7fc8c3a2b339d
+DIST NNPDF23_nnlo_as_0119_qed_mc.tar.gz 28940412 SHA256 4f9598322452856e165ea419ef878bb9b5d8284933cef896b7bc339d1f8ae728 SHA512 5088c30acbd1da4e412ba9f6a997ceaa34f426f41c7ebacaf4d2e8aa49b8b45052913e8d873b293d9f140c01e82c05735b66dd527a9aa124b86f73bf5e4d8c53 WHIRLPOOL 1845bb1dbd7b23389fa45af43517e36abc941d6beb2fc650462e1ef875781d0ab40186ae4f4ddfc0ed6d819be056dd11fd63e2bdf02ae1d9365892476415235c
+DIST cteq66.tar.gz 8647237 SHA256 1e1987c3b844d06bac8c205544ea1613515de2965e7e5565892acf37984a2626 SHA512 25d0fa01dcdb59d71c7092367af8258471a2bc6dfd146766cc79f90ffb0feafa0f2011d0a37a7d75315c10ba7c7a6e3fa583d9c0a28119b072228ac800294e48 WHIRLPOOL a8c34f0242fd6a2986484bf60793604a07ad0356b1fabb6350289afd4655f2eeb1953d0e558440b94ed30a7af4cd5d58d9fc07f3f06a72c3f3381094b8036321
+DIST cteq6l1.tar.gz 317834 SHA256 57c9c99d7b83c8ed1ca70480a0ec7bf2183bfa1bd9276a0e146772c5cf3bb5ac SHA512 7177608e97077eaf45a292db4ea74eb9a28b4b500ab8be02098b4837a5583cd397828abc3bf43ead448926eaa75ae3968bd059ecde333d90ed6e4295cbe1873c WHIRLPOOL cb0fff30e96dbcda1ac76550968bda22872d249d6fe14f31060aef5d1913b314365b933fb2bc57676ac5578f39ed3824cce2cd657086b4a92aa4d6e4ce037239
+DIST lutp0613man2.pdf 2902047 SHA256 03d637310ea80f0d7aea761492bd38452c602890d8cf913a1ec9edacd79fa43d SHA512 a8439b3b150b6f3924d4d3671a4fad6a815c374b1f46060072ca6c1faa797a2f73f8727920aaa7ae885c4f6f135c8d8f94d43e518cfe25271bb95652112def58 WHIRLPOOL dd74046a145264653efdc1f96c330a0aa1e71b72578f32b114d9041c6a50e6e03aa5b3e028ab737afa01d9f3fc9928fa3589238ff4c232e90c8362201792ef99
+DIST pythia-6.4.18-examples.tar.bz2 36366 SHA256 17b1809fb0cffba20115c2bc1032c24d8efece25bd3f1f632f88265ade4dd084 SHA512 ba921379a6df4ca417b60ea5b78af506f13135cdf896fa6beeca9713428ad6f298c94c0fe65fca3e583f8f268dcf84ebe4f1f81b46fd865d5f641f7c1e9fa7e1 WHIRLPOOL 5b53f523d0819400da791d471c207c4d0d6cfd43cbb9423900b593015aa4db68632d97615ffd213493ff0b0306ce7b8c4851e58672e1188df1a61352e1af0d17
+DIST pythia-6.4.28.tar.xz 490248 SHA256 6ca6acc172314cf7b56e2a8e18321d28ce57a511e34210a6c64ebbfd5e06d5f4 SHA512 f9db72658f2132ce08d31c8a9f7fe727466b184ef41cc4b762fe2bde48dbdfd7b5df19b21a869e20a1f107c96e9daec115c980e11592968eb2cad666b7c96bdc WHIRLPOOL d6ab42af092348b1ae5c5078c34ef17042b46f728d6c4068cd0930999ccbfefae9b55be05499188525c9fc6499c8cb8c490fe6a37f04bf9b45048f7cf8026cdb
+DIST pythia6.tar.gz 567451 SHA256 ebc90b8ec94897d8b09030341323d2c7c6e5c7c65077f98b96c8cff00d40a5ce SHA512 baa18023de22c3e90f14d2a5a39efa171905f507a31a90f87c65dca271b3be4c9f0d1a56282f5a04b3efabe0b5b15c964e4569d1f9994a75750e52e0be4360b1 WHIRLPOOL e334779f77e938cde85ecd0fbc2dbf0d86a52fc1ef673c909b8533f779e51d6d6680bc5de3aceeb002015ccfdf03da3f975aaf0cc7a249c462cdd3b206c359a2
+DIST pythia8186.tgz 8921248 SHA256 1c0914fc04801ee922c1ad3b544a3cd48b34d9afa4407ae40afbacd009039bd2 SHA512 84729004abbdf522183c27918ae35db037a8954af761a2b452dcff54f82076b1e3bfc7fe9ea0a7cb2c0b6499aedb1c25cc13768d47b24edaa08d631b55d0b86b WHIRLPOOL ecef83d2cb018b1aac55225850cf2a3a8f2b87d08f99bd9c5881f4fa341f012eeabed3b9a43ffda3699daebc54c181d08aac30c1f6b514e98516c29e88a6fbaf
+DIST pythia8210.tgz 14301345 SHA256 a2564c6011235a286115ba9da065f50c1233229b2f1a824583565dfeec0baa35 SHA512 fe2d02e32fd5d25bcdcc216754b91ca509a189c58f1a06ca8deba975af552586632fc8cf8ad3e62920884ee64c4af596fbe7c6872f5ddbd1f5a0cea4ba4bc90d WHIRLPOOL d2d3f212ed2ad700fa6ae44b2b670cce1623e80382af04072bee884a72ea269346c10728cc77cfa4c9377e8cd775febe9488427cb0b890e52c651efebd66f60c
diff --git a/sci-physics/pythia/files/pythia8209-root-noninteractive.patch b/sci-physics/pythia/files/pythia8209-root-noninteractive.patch
new file mode 100644
index 000000000000..4581eaea389b
--- /dev/null
+++ b/sci-physics/pythia/files/pythia8209-root-noninteractive.patch
@@ -0,0 +1,17 @@
+--- pythia8209/examples/main91.cc.orig 2015-06-05 07:44:27.000000000 +0300
++++ pythia8209/examples/main91.cc 2015-06-05 08:17:22.477228166 +0300
+@@ -62,13 +62,9 @@
+ // Statistics on event generation.
+ pythia.stat();
+
+- // Show histogram. Possibility to close it.
+- mult->Draw();
+- std::cout << "\nDouble click on the histogram window to quit.\n";
+- gPad->WaitPrimitive();
+-
+ // Save histogram on file and close file.
+ mult->Write();
++ outFile->Close();
+ delete outFile;
+
+ // Done.
diff --git a/sci-physics/pythia/files/pythia8209-run-tests.patch b/sci-physics/pythia/files/pythia8209-run-tests.patch
new file mode 100644
index 000000000000..d1edc8393726
--- /dev/null
+++ b/sci-physics/pythia/files/pythia8209-run-tests.patch
@@ -0,0 +1,20 @@
+--- pythia8209/examples/Makefile.orig 2015-06-04 22:21:53.000000000 +0300
++++ pythia8209/examples/Makefile 2015-06-05 05:35:25.324262331 +0300
+@@ -139,3 +139,17 @@
+ rm -f test[0-9][0-9][0-9]; rm -f out[0-9][0-9][0-9];\
+ rm -f weakbosons.lhe; rm -f Pythia8.promc; rm -f hist.root;\
+ rm -f *~; rm -f \#*; rm -f core*; rm -f *Dct.*
++ rm -f main*out *.dat
++
++# Run tests, inject test-specific arguments when needed
++main%.out: main%
++ ./$< \
++ $(if $(findstring $*,16 42 43 $(shell seq 81 89)), main$*.cmnd) \
++ $(if $(findstring $*, $(shell seq 81 83)), w+_production_lhc_0.lhe) \
++ $(if $(findstring $*, 84), hepmcout84.dat 2 w+_production_lhc) \
++ $(if $(findstring $*, $(shell seq 85 88)), w_production) \
++ $(if $(findstring $*, 42 43 $(shell seq 81 89)), histout$*.dat) \
++ > $@
++
++main89.out: main89
++ $(foreach cmd, $(wildcard main89*.cmnd), ./$< $(cmd) histout-$(cmd).dat >> $@ || exit;)
diff --git a/sci-physics/pythia/metadata.xml b/sci-physics/pythia/metadata.xml
new file mode 100644
index 000000000000..a0a2a6ec97b9
--- /dev/null
+++ b/sci-physics/pythia/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <longdescription lang="en">
+ PYTHIA is a program for the generation of high-energy physics
+ events, i.e. for the description of collisions at high energies
+ between elementary particles such as e+, e-, p and pbar in various
+ combinations. It contains theory and models for a number of physics
+ aspects, including hard and soft interactions, parton distributions,
+ initial- and final-state parton showers, multiple interactions,
+ fragmentation and decay. It is largely based on original research,
+ but also borrows many formulae and other knowledge from the
+ literature.
+</longdescription>
+ <use>
+ <flag name="fastjet">Build jets using the <pkg>sci-physics/fastjet</pkg> package</flag>
+ <flag name="hepmc">Adds support for High Energy Physics Monte Carlo Generators <pkg>sci-physics/hepmc</pkg></flag>
+ <flag name="lhapdf">Support the use of external PDF sets via <pkg>sci-physics/lhapdf</pkg></flag>
+ <flag name="root">Use <pkg>sci-physics/root</pkg> trees and histograms (in examples only)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-physics/pythia/pythia-6.4.28.ebuild b/sci-physics/pythia/pythia-6.4.28.ebuild
new file mode 100644
index 000000000000..dc841de4d0b4
--- /dev/null
+++ b/sci-physics/pythia/pythia-6.4.28.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools fortran-2 versionator
+
+MV=$(get_major_version)
+MY_PN=${PN}${MV}
+DOC_PV=0613
+EX_PV=6.4.18
+
+DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
+HOMEPAGE="http://pythia6.hepforge.org/"
+
+# pythia6 from root is needed for some files to interface pythia6 with root.
+# To produce a split version, replace the 6.4.x by the current version:
+# svn export http://svn.hepforge.org/pythia6/tags/v_6_4_x/ pythia-6.4.x
+# tar cJf pythia-6.4.x.tar.xz
+SRC_URI="
+ http://dev.gentoo.org/~bicatali/distfiles/${P}.tar.xz
+ ftp://root.cern.ch/root/pythia6.tar.gz
+ doc? ( http://home.thep.lu.se/~torbjorn/pythia/lutp${DOC_PV}man2.pdf )
+ examples? ( mirror://gentoo/${PN}-${EX_PV}-examples.tar.bz2 )"
+
+SLOT="6"
+LICENSE="public-domain"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples static-libs"
+
+src_prepare() {
+ cp ../pythia6/tpythia6_called_from_cc.F .
+ cp ../pythia6/pythia6_common_address.c .
+ cat > configure.ac <<-EOF
+ AC_INIT(${PN},${PV})
+ AM_INIT_AUTOMAKE
+ AC_PROG_F77
+ LT_INIT
+ AC_CHECK_LIB(m,sqrt)
+ AC_CONFIG_FILES(Makefile)
+ AC_OUTPUT
+ EOF
+ echo >> Makefile.am "lib_LTLIBRARIES = libpythia6.la"
+ echo >> Makefile.am "libpythia6_la_SOURCES = \ "
+ # replace wildcard from makefile to ls in shell
+ local f
+ for f in py*.f struct*.f up*.f fh*.f; do
+ echo >> Makefile.am " ${f} \\"
+ done
+ echo >> Makefile.am " ssmssm.f sugra.f visaje.f pdfset.f \\"
+ echo >> Makefile.am " tpythia6_called_from_cc.F pythia6_common_address.c"
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ dodoc update_notes.txt
+ use doc && dodoc "${DISTDIR}"/lutp${DOC_PV}man2.pdf
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r "${WORKDIR}"/examples
+ fi
+}
diff --git a/sci-physics/pythia/pythia-8.1.86-r1.ebuild b/sci-physics/pythia/pythia-8.1.86-r1.ebuild
new file mode 100644
index 000000000000..bfaafd213f52
--- /dev/null
+++ b/sci-physics/pythia/pythia-8.1.86-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator toolchain-funcs multilib
+
+MV=$(get_major_version)
+MY_P=${PN}$(replace_all_version_separators "" ${PV})
+
+DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
+HOMEPAGE="http://pythia8.hepforge.org/"
+SRC_URI="http://home.thep.lu.se/~torbjorn/${PN}${MV}/${MY_P}.tgz"
+
+SLOT="8"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples gzip +hepmc static-libs"
+
+DEPEND="
+ gzip? ( dev-libs/boost sys-libs/zlib )
+ hepmc? ( sci-physics/hepmc:0= )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ PYTHIADIR="${EPREFIX}/usr/share/pythia8"
+ # set datadir for xmldor in include file
+ sed -i \
+ -e "s:../xmldoc:${PYTHIADIR}/xmldoc:" \
+ include/Pythia8/Pythia.h || die
+ # respect libdir, prefix, flags
+ sed -i \
+ -e "s:/lib:/$(get_libdir):g" \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ -e "s:-O2::g" \
+ configure || die
+ sed -i \
+ -e "s:LIBDIR=.*:LIBDIR=$(get_libdir):" \
+ -e "s:LIBDIRARCH=.*:LIBDIRARCH=$(get_libdir):" \
+ -e "s:cp -r lib:cp -r $(get_libdir):" \
+ -e '/ln -fs/d' \
+ Makefile examples/Makefile || die
+}
+
+src_configure() {
+ export USRCXXFLAGS="${CXXFLAGS}"
+ export USRLDFLAGSSHARED="${LDFLAGS}"
+ tc-export CC CXX
+ # homemade configure script
+ ./configure \
+ --installdir="${EPREFIX}/usr" \
+ --datadir="${PYTHIADIR}" \
+ --enable-shared \
+ $(usex gzip "--enable-gzip=yes" "") \
+ $(usex hepmc "--with-hepmcversion=2 --with-hepmc=${EPREFIX}/usr" "") \
+ || die
+ if ! use static-libs; then
+ sed -i \
+ -e '/targets.*=$(LIBDIR.*\.a$/d' \
+ -e 's/+=\(.*libpythia8\.\)/=\1/' \
+ Makefile || die
+ sed -i \
+ -e 's:\.a:\.so:g' \
+ -e 's:$(LIBDIRARCH):$(LIBDIR):g' \
+ examples/Makefile || die
+ fi
+}
+
+src_test() {
+ cd examples || die
+ # use emake for parallel instead of long runmains
+ local tests="$(echo main0{1..8})" t
+ use hepmc && tests="${tests} main31"
+ emake ${tests}
+ for t in ${tests}; do
+ LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \
+ bin/${t}.exe > ${t}.out || die "test ${t} failed"
+ done
+ emake clean && rm main*out
+}
+
+src_install() {
+ emake INSTALLDIR="${ED}/usr" DATADIR="${D}/${PYTHIADIR}" install
+ rm -r "${D}"/${PYTHIADIR}/{html,php}doc || die
+ echo "PYTHIA8DATA=${PYTHIADIR}/xmldoc" >> 99pythia8
+ doenvd 99pythia8
+
+ dodoc GUIDELINES AUTHORS README
+ if use doc; then
+ dodoc worksheet.pdf htmldoc/pythia8100.pdf
+ dohtml -r htmldoc/*
+ fi
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples rootexamples
+ docompress -x /usr/share/doc/${PF}/{root,}examples
+ fi
+}
diff --git a/sci-physics/pythia/pythia-8.1.86.ebuild b/sci-physics/pythia/pythia-8.1.86.ebuild
new file mode 100644
index 000000000000..d04b76e43f56
--- /dev/null
+++ b/sci-physics/pythia/pythia-8.1.86.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator toolchain-funcs multilib
+
+MV=$(get_major_version)
+MY_P=${PN}$(replace_all_version_separators "" ${PV})
+
+DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
+HOMEPAGE="http://pythia8.hepforge.org/"
+SRC_URI="http://home.thep.lu.se/~torbjorn/${PN}${MV}/${MY_P}.tgz"
+
+SLOT="8"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples gzip +hepmc static-libs"
+
+DEPEND="
+ gzip? ( dev-libs/boost sys-libs/zlib )
+ hepmc? ( sci-physics/hepmc:0= )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ PYTHIADIR="${EPREFIX}/usr/share/pythia8"
+ # set datadir for xmldor in include file
+ sed -i \
+ -e "s:../xmldoc:${PYTHIADIR}/xmldoc:" \
+ include/Pythia8/Pythia.h || die
+ # respect libdir, prefix, flags
+ sed -i \
+ -e "s:/lib:/$(get_libdir):g" \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ -e "s:-O2::g" \
+ configure || die
+ sed -i \
+ -e "s:LIBDIR=.*:LIBDIR=$(get_libdir):" \
+ -e "s:LIBDIRARCH=.*:LIBDIRARCH=$(get_libdir):" \
+ -e "s:cp -r lib:cp -r $(get_libdir):" \
+ -e '/ln -fs/d' \
+ Makefile examples/Makefile || die
+}
+
+src_configure() {
+ export USRCXXFLAGS="${CXXFLAGS}"
+ export USRLDFLAGSSHARED="${LDFLAGS}"
+ tc-export CC CXX
+ # homemade configure script
+ ./configure \
+ --installdir="${EPREFIX}/usr" \
+ --datadir="${PYTHIADIR}" \
+ --enable-shared \
+ $(usex gzip "--enable-gzip=yes" "") \
+ $(usex hepmc "--with-hepmcversion=2 --with-hepmc=${EPREFIX}/usr" "") \
+ || die
+ if ! use static-libs; then
+ sed -i \
+ -e '/targets.*=$(LIBDIR.*\.a$/d' \
+ -e 's/+=\(.*libpythia8\.\)/=\1/' \
+ Makefile || die
+ sed -i \
+ -e 's:\.a:\.so:g' \
+ -e 's:$(LIBDIRARCH):$(LIBDIR):g' \
+ examples/Makefile || die
+ fi
+}
+
+src_test() {
+ cd examples || die
+ # use emake for parallel instead of long runmains
+ local tests="$(echo main0{1..8})" t
+ use hepmc && tests="${tests} main31"
+ emake ${tests}
+ for t in ${tests}; do
+ LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \
+ bin/${t}.exe > ${t}.out || die "test ${t} failed"
+ done
+ emake clean && rm main*out
+}
+
+src_install() {
+ emake INSTALLDIR="${ED}/usr" DATADIR="${D}/${PYTHIADIR}" install
+ rm -r "${D}"/${PYTHIADIR}/{html,php}doc || die
+ echo "PYTHIA8DATA=${PYTHIADIR}/xmldoc" >> 99pythia8
+ doenvd 99pythia8
+
+ dodoc GUIDELINES AUTHORS README
+ if use doc; then
+ dodoc worksheet.pdf
+ dohtml -r htmldoc/*
+ fi
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
diff --git a/sci-physics/pythia/pythia-8.2.10.ebuild b/sci-physics/pythia/pythia-8.2.10.ebuild
new file mode 100644
index 000000000000..a9d797450eb5
--- /dev/null
+++ b/sci-physics/pythia/pythia-8.2.10.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs versionator
+
+MV=$(get_major_version)
+MY_P=${PN}$(replace_all_version_separators "" ${PV})
+LHA_VER="6.1"
+
+DESCRIPTION="Lund Monte Carlo high-energy physics event generator"
+HOMEPAGE="http://pythia8.hepforge.org/"
+SRC_URI="http://home.thep.lu.se/~torbjorn/${PN}${MV}/${MY_P}.tgz
+ test? ( lhapdf? (
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/CT10.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/MRST2007lomod.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/NNPDF23_nlo_as_0119_qed_mc.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/NNPDF23_nnlo_as_0119_qed_mc.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/cteq66.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/cteq6l1.tar.gz
+ https://www.hepforge.org/archive/lhapdf/pdfsets/${LHA_VER}/unvalidated/MRST2004qed.tar.gz
+ ) )"
+
+SLOT="8"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples gzip +hepmc fastjet lhapdf root static-libs test"
+
+RDEPEND="
+ fastjet? ( >=sci-physics/fastjet-3 )
+ gzip? ( sys-libs/zlib )
+ hepmc? ( sci-physics/hepmc:0= )
+ lhapdf? ( >=sci-physics/lhapdf-6:= )
+"
+# ROOT is used only when building related tests
+DEPEND="${RDEPEND}
+ test? ( root? ( sci-physics/root:= ) )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ if use root && ! use test; then
+ ewarn "ROOT support will only affect examples code build during test stage."
+ ewarn "Since you have tests disabled, this is a no-op."
+ fi
+}
+
+src_prepare() {
+ PYTHIADIR="/usr/share/pythia8"
+ EPYTHIADIR="${EPREFIX}${PYTHIADIR}"
+ # set datadir for xmldor in include file
+ sed -i \
+ -e "s:../share/Pythia8/xmldoc:${EPYTHIADIR}/xmldoc:" \
+ include/Pythia8/Pythia.h || die
+ # respect libdir, prefix, flags
+ sed -i \
+ -e "s:/lib:/$(get_libdir):g" \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ -e "s:-O2:${CXXFLAGS}:g" \
+ -e "s:Cint:Core:g" \
+ configure || die
+ sed -i 's:$(CXX) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED):$(CXX) $(LDFLAGS) $^ -o $@ $(CXX_COMMON) $(CXX_SHARED):g' \
+ Makefile || die
+ sed -i 's:$(CXX):$(CXX) $(LDFLAGS):' examples/Makefile || die
+ # we use lhapdf6 instead of lhapdf5
+ # some PDFs changed, use something similar
+ sed -i \
+ -e "s:LHAPDF5:LHAPDF6:g" \
+ -e "s:\.LHgrid::g" \
+ -e "s:\.LHpdf::g" \
+ -e "s:MRST2001lo:MRST2007lomod:g" \
+ -e "s:cteq6ll:cteq6l1:g" \
+ -e "s:cteq6m:cteq66:g" \
+ examples/*.{cc,cmnd} || die
+ # After lhapdf5->6 migration PDFs are identical within ~1/1000
+ # https://www.hepforge.org/archive/lhapdf/pdfsets/6.1/README
+ sed -i \
+ -e "s:1e-8:3e-1:g" \
+ -e "s:nlo_as_0119_qed:nlo_as_0119_qed_mc:g" \
+ -e "s:xmldoc:share/Pythia8/xmldoc:g" \
+ examples/main54.cc || die
+ # ask cflags from root
+ sed -i "s:root-config:root-config --cflags:g" examples/Makefile || die
+ if ! use static-libs; then
+ sed -i \
+ -e '/TARGETS=$(LOCAL_LIB)\/libpythia8\.a/d' \
+ -e 's:libpythia8\.a$:libpythia8\.so$:g' \
+ Makefile || die
+ sed -i 's:libpythia8\.a:libpythia8\.so:g' \
+ examples/Makefile || die
+ fi
+
+ epatch "${FILESDIR}/${PN}8209-run-tests.patch"
+ epatch "${FILESDIR}/${PN}8209-root-noninteractive.patch"
+}
+
+# TODO: the following optional packages are out of Gentoo tree:
+# - EvtGen http://atlas-computing.web.cern.ch/atlas-computing/links/externalDirectory/EvtGen/
+# - PowHEG http://powhegbox.mib.infn.it/
+# - ProMC https://github.com/Argonne-National-Laboratory/ProMC/
+src_configure() {
+ # homemade configure script
+ ./configure \
+ --arch=Linux \
+ --cxx=$(tc-getCXX) \
+ --enable-shared \
+ --prefix="${EPREFIX}/usr" \
+ --prefix-lib="$(get_libdir)" \
+ --prefix-share="${EPYTHIADIR}" \
+ $(usex fastjet "--with-fastjet3" "") \
+ $(usex gzip "--with-gzip" "") \
+ $(usex hepmc "--with-hepmc2" "") \
+ $(usex lhapdf "--with-lhapdf6
+ --with-lhapdf6-plugin=LHAPDF6.h
+ --with-lhapdf6-lib=${EPREFIX}/usr/$(get_libdir)" "") \
+ $(usex root "--with-root
+ --with-root-include=${EPREFIX}/usr/include/root
+ --with-root-lib=${EPREFIX}/usr/$(get_libdir)/root" "") \
+ || die
+
+ # fix pythia config script
+ sed -i \
+ -e 's:pythia8/examples/Makefile.inc:pythia8/Makefile.inc:' \
+ -e 's:LINE%=:LINE%%=:' \
+ bin/pythia8-config || die
+}
+
+src_test() {
+ cd examples || die
+
+ local tests="$(echo main{{01..32},37,38,61,62,73,80}.out)"
+ use hepmc && tests+=" $(echo main{41,42,85,86}.out)"
+ use hepmc && use lhapdf && tests+=" $(echo main{43,{87..89}}.out)"
+ use lhapdf && tests+=" $(echo main{51..54}.out)"
+ use fastjet && tests+=" $(echo main{71,72}.out)"
+ use fastjet && use hepmc && use lhapdf && tests+=" $(echo main{81..84}).out"
+ use root && tests+=" main91.out"
+ # Disabled tests:
+ # 33 needs PowHEG
+ # 46 needs ProMC
+ # 48 needs EvtGen
+ # 92 generated ROOT dictionary is badly broken
+
+ # use emake for parallel instead of long runmains
+ LD_LIBRARY_PATH="${S}/$(get_libdir):${LD_LIBRARY_PATH}" \
+ PYTHIA8DATA="../share/Pythia8/xmldoc/" \
+ LHAPDF_DATA_PATH="${WORKDIR}" \
+ emake ${tests}
+ emake clean
+}
+
+src_install() {
+ # make install is too broken, much easier to install manually
+ dobin bin/pythia8-config
+ doheader -r include/*
+ dolib lib/*
+ insinto "${PYTHIADIR}"
+ doins -r share/Pythia8/xmldoc examples/Makefile.inc
+
+ echo "PYTHIA8DATA=${EPYTHIADIR}/xmldoc" >> 99pythia8
+ doenvd 99pythia8
+
+ dodoc AUTHORS GUIDELINES README
+ if use doc; then
+ dodoc share/Pythia8/pdfdoc/*
+ dohtml -r share/Pythia8/htmldoc/*
+ fi
+ if use examples; then
+ # reuse system Makefile.inc
+ rm examples/Makefile.inc || die
+ sed -i "s:include Makefile.inc:include ${EPYTHIADIR}:" \
+ examples/Makefile || die
+
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ # cleanup
+ unset PYTHIADIR EPYTHIADIR
+}
diff --git a/sci-physics/reduze/Manifest b/sci-physics/reduze/Manifest
new file mode 100644
index 000000000000..75027702ed4a
--- /dev/null
+++ b/sci-physics/reduze/Manifest
@@ -0,0 +1 @@
+DIST reduze-2.0.9.tar.gz 568570 SHA256 e56494519faffa381f16c8c9b439e9c17485392d47b836ef372d3c4ff451e67a SHA512 69818d7edaf3c69996d3f703401865f67722ec8d33b285642c71030f2852273b4b4028a00f0c639589cb801def739f93a05d504d4fb2edf228674962897d5f01 WHIRLPOOL 1aa84d755668badf01c077b3e9c63cf1c68c5f37f438875c3f3de11804013e551a92f98c7aacd5b8ea155e1540023d4273f1ceb98ea4e7551de9fe7613b18021
diff --git a/sci-physics/reduze/metadata.xml b/sci-physics/reduze/metadata.xml
new file mode 100644
index 000000000000..ae17f7db132d
--- /dev/null
+++ b/sci-physics/reduze/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<maintainer>
+ <email>grozin@gentoo.org</email>
+ <name>Andrey Grozin</name>
+</maintainer>
+<longdescription lang="en">
+ A program for reducing Feynman integrals
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/reduze/reduze-2.0.9.ebuild b/sci-physics/reduze/reduze-2.0.9.ebuild
new file mode 100644
index 000000000000..13d59264afd8
--- /dev/null
+++ b/sci-physics/reduze/reduze-2.0.9.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Program for reducing Feynman integrals"
+HOMEPAGE="http://reduze.hepforge.org/"
+SRC_URI="http://reduze.hepforge.org/download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="berkdb doc mpi"
+
+RDEPEND=">=sci-mathematics/ginac-1.4.1
+ berkdb? ( sys-libs/db[cxx] )
+ mpi? ( virtual/mpi )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+DOCS=( ChangeLog README )
+
+src_prepare() {
+ # gentoo doc directory
+ sed -i \
+ -e "s:share/reduze:share/doc/${PF}:g" \
+ CMakeLists.txt || die
+ use doc || sed -i -e '/share/d' CMakeLists.txt
+ # prefix fix
+ sed -i \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ reduze/CMakeLists.txt || die
+
+ # remove bundled yaml-cpp
+ # no: it does not build. is it patched?
+ # sed -i -e '/add_subdirectory ("yaml")/d' CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSE_HASH_TABLE=ON
+ $(cmake-utils_use berkdb USE_DATABASE)
+ $(cmake-utils_use mpi USE_MPI)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile all $(use doc && echo doc)
+}
+
+src_test() {
+ cd "${CMAKE_BUILD_DIR}"
+ emake check
+ use mpi && emake check_mpi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dohtml -r "${CMAKE_BUILD_DIR}"/doc/code/html/*
+}
diff --git a/sci-physics/root/Manifest b/sci-physics/root/Manifest
new file mode 100644
index 000000000000..65d6949c4eac
--- /dev/null
+++ b/sci-physics/root/Manifest
@@ -0,0 +1,10 @@
+DIST ROOTUsersGuide.pdf 9124822 SHA256 70a96c4a2573dc0d320142f86993ecfda24caa755e910340a3014120f2997c8b SHA512 c3b4c18ef2e13968afdf67c6003249d4cfe6ea661fa32ce25127361bae7e3376a25cd3b11591292f3975bcd8105291aca52f2f6214c9fe45f4bd6e7e44d54b25 WHIRLPOOL 11256ba7837d17e5795cf71ac32db43d7d8f797bfbddf5f71612fe2f8fb2e01354372c0ea8f0bc22868881eb0bfdc8a3e3f1b05293d2750d293aa4d59217b2e6
+DIST RooFit_Users_Manual_2.91-33.pdf 1330062 SHA256 101c4e4c41962238fcabf1caa86cafc51241a1800594491b2e62ef8b565a5646 SHA512 732d7dea3541b51e5f0b9b5b70dae57e1bdbb2504c4222d5e5095ec0f9b67307011c1f31c2c95be419b53dd8426f52f62f6c9370084208176a2ed3d7f25d783b WHIRLPOOL 033897bef4bdb13246a81ea6749f7895e6c4d639752e932130234ad9153bb399a4e5d416237850da27f139d3cccc53d9adb7a077abf20d257ce057157d6c3696
+DIST TMVAUsersGuide-v4.03.pdf 3913533 SHA256 0cdbb4a2d19eb7a86e2911cfa73a905932e862d6c94be10b7662a9355b0241af SHA512 d8bb2ce35ef32c4877059898f56513db0b1057924e21935a3d3a6f114748e167984c43fd2ec7e54197fccff875540543968fea9a8e75bf63f5f13521724a7ddb WHIRLPOOL 0a3e2e61e8e32f3a22757178adf033f9fbb89014aecd4df7f8bd49677d772bb3ad2c0f5526259611879f6bb20df647c01e23f53ade483d7a3e2242f8aee6c6aa
+DIST info.png 2060 SHA256 51de6661250f3fb71c6c8250cbc4bdc4dc4283cc90240b4dc1ee6168e8d40279 SHA512 81a730eefbe7a7e15d5840491402c7644bf7ed5d5f8f3830ed9457b343cc7882480e993ea84aef93500742cd0fe8469859cd2c925e5582b91ef56406804ae276 WHIRLPOOL 02ea6daf9e3d21947ebf5dd01c455a13f2fcbf9981be34a150056a3510122ca49e3d137d4f242c7218d4d06ace09566d513a04f09071723ac244f5a38e982bac
+DIST root-banner.png 132555 SHA256 d165e1cc175f654ff79af39193a6144678f600e14a53dd20e2b216b3e8951e94 SHA512 139347f396e88c8062d847d612949204cb80e551a826d926950ca8ab967f0d496487fed17a227fc796ae4db23fca758d91a0af7943142adbed358e98d7667b1f WHIRLPOOL dd23e26acf9303b404cda8135d6946af3b1abba3dfdff8d80e56096f810d50a01ebfb52dc1e6ee1d1b99fbb5859dc850e0e368155339b5007294d95ce8909857
+DIST root_v5.32.03.source.tar.gz 55529362 SHA256 575057c429625df69f0fa5c303287acefff185cda8cf8d1e9a6b2d21097d5ae6 SHA512 2e067eb9c6bbda5cf4df6973a3cf5307540247fb07c349f7ee74c0cf6a4abbb63f585a9ff67139cae985250fc5c5106b5ea03d7d9d2bcd20269e0ec8760ebd02 WHIRLPOOL 87dbf6f55f82001e07afc3b467e95f841f185f1f67d1dbd953f73e8aa9127ef8485db84100d6e9a08f0ae6aa5b45a565398eb6723145fff16c07e5158bb3e3ab
+DIST root_v5.34.26.source.tar.gz 75171961 SHA256 c1fd2a249bb7210914b42e35dba4f1262cfa46b79ef7a41f73d7f08f8c54a643 SHA512 f5da5e20d1763608a32d78c48581e574a3f51aef47ecf6987a4064d1fb3234dfc9f626e041a17213f881f52f807ed6a6da60bf1d24951fa7dc2cadd94f8dd8b4 WHIRLPOOL 77b48b815c971642da68b71732a0ea3372648634281be634037b13cb58488f7075ec8bfc9a684e55d85cd9b038f229be29b19a15dfc829f0ce63a5f17241c23c
+DIST root_v5.34.32.source.tar.gz 75170203 SHA256 939c7592802a54b6cbc593efb6e51699bf52e92baf6d6b20f486aaa08480fc5f SHA512 6485f2bb544947173e1feb2cfb41d6a176020027f1193d9388700a797ba4badbf497022e6129fdc4879e709460bf1efabf3e51c51840f0c781fa12e631419afc WHIRLPOOL 695147a519415b99e73fdad1cd61bb1944e292628236b5a7cbf1835174c950fa9cb068431a8164f24663323163012ea652db84d082f9f1eb1fcae79489575d9e
+DIST root_v6.02.05.source.tar.gz 99121880 SHA256 7a5d4af171ba3b8a736c462b2041f8f35bd4c1d3b6a22c32a3ebd3ffe144ae60 SHA512 b30bc4aafe294ee069ee4c884ff70c983539a48eda586cd1938d00d4688f10e94a435640965b89c6d100fdd998453a4c1ae2109d5f1427f23865a868c561d684 WHIRLPOOL de363835fa00ffa0ff6e596b3c92b59ed59378bac3a344c066f7603d6104058203f76181d4c15478fd9066aedbe6a514257d5796feedb2d5d0d789b263e92955
+DIST rootdrawing-logo.png 15051 SHA256 1dfd913cad53a3ebd6bf560d14df918cab5a295cc7d155944a8e27284af83a6b SHA512 14aa13ebfed3c9412d7d7d04c250740b25fe3af6bcb07e618045a5cec2dc23698a251fd7df2db1a6c37331084db99b029b387ea81c25ac825fc7ae10ad164a68 WHIRLPOOL 877a959a5aead73ba69dbb805c9869cbd6a047ea476bd4e7fef80781563a61d20dad49dd4d8b0005bfc58e8f7c7d38efbb3e085a95974feb81dfc9e339c18741
diff --git a/sci-physics/root/files/proofd.confd b/sci-physics/root/files/proofd.confd
new file mode 100644
index 000000000000..81720a7eb335
--- /dev/null
+++ b/sci-physics/root/files/proofd.confd
@@ -0,0 +1,12 @@
+# conf.d file for proof daemon
+#
+# Please refer to the proofd(1) man(1) page for more information on
+# command line parameters.
+#
+PROOFD_OPTS=
+
+# Specify your base of your PROOF directory here. If left blank, it
+# will use the system default (e.g., /usr/share/root/proof).
+# Note, however, that ROOT recommends that this directory is shared (via
+# NFS or similar) among all the nodes of the cluster.
+PROOF_DIR=
diff --git a/sci-physics/root/files/proofd.initd b/sci-physics/root/files/proofd.initd
new file mode 100644
index 000000000000..aee1b029b95e
--- /dev/null
+++ b/sci-physics/root/files/proofd.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need root-file-server
+ use logger
+}
+
+start() {
+ ebegin "Starting parallel ROOT facility server"
+ start-stop-daemon --start --quiet \
+ --pidfile /var/run/proofd.pid \
+ --exec /usr/bin/proofd -- ${PROOFD_OPTS} ${PROOF_DIR}
+ pidof /usr/bin/proofd > /var/run/proofd.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping parallel ROOT facility server"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/proofd.pid \
+ --exec /usr/bin/proofd
+ eend $?
+}
diff --git a/sci-physics/root/files/root-5.28.00b-asneeded.patch b/sci-physics/root/files/root-5.28.00b-asneeded.patch
new file mode 100644
index 000000000000..b845247e11c0
--- /dev/null
+++ b/sci-physics/root/files/root-5.28.00b-asneeded.patch
@@ -0,0 +1,20 @@
+--- root.orig/configure 2010-12-20 07:17:54.000000000 +0000
++++ root/configure 2010-12-20 07:16:05.000000000 +0000
+@@ -709,7 +709,7 @@
+ cat <<EOF > conftest.mk
+ include ${ac_srcdir}/config/Makefile.${arch}
+ conftest: conftest.c
+- \$(CC) \$(CFLAGS) \$(LDFLAGS) $linkdir $linklib \$< -o \$@
++ \$(CC) \$(CFLAGS) \$(LDFLAGS) \$< $linkdir $linklib -o \$@
+
+ conftest.c:
+ echo "int main() { return 0; }" > \$@
+@@ -723,7 +723,7 @@
+ cat <<EOF > conftest.mk
+ include ${ac_srcdir}/config/Makefile.${arch}
+ conftest:conftest.c
+- \$(CC) \$(CFLAGS) \$(LDFLAGS) $linkdir $linklib \$< -o \$@
++ \$(CC) \$(CFLAGS) \$(LDFLAGS) \$< $linkdir $linklib -o \$@
+
+ conftest.c:
+ echo "extern int $linksymbol (); " > \$@
diff --git a/sci-physics/root/files/root-5.28.00b-glibc212.patch b/sci-physics/root/files/root-5.28.00b-glibc212.patch
new file mode 100644
index 000000000000..a365431396f5
--- /dev/null
+++ b/sci-physics/root/files/root-5.28.00b-glibc212.patch
@@ -0,0 +1,11 @@
+--- root.orig/net/auth/src/TAFS.cxx 2010-09-14 03:22:22.647915854 +0400
++++ root/net/auth/src/TAFS.cxx 2010-09-14 03:22:39.034599899 +0400
+@@ -11,6 +11,7 @@
+
+ #ifndef WIN32
+ # include <unistd.h>
++# include <sys/stat.h>
+ #else
+ # define ssize_t int
+ # include <io.h>
+
diff --git a/sci-physics/root/files/root-5.28.00b-prop-ldflags.patch b/sci-physics/root/files/root-5.28.00b-prop-ldflags.patch
new file mode 100644
index 000000000000..732431943a88
--- /dev/null
+++ b/sci-physics/root/files/root-5.28.00b-prop-ldflags.patch
@@ -0,0 +1,13 @@
+diff -Naur root.orig/config/Makefile.in root/config/Makefile.in
+--- root.orig/config/Makefile.in 2010-12-14 17:20:26.000000000 +0300
++++ root/config/Makefile.in 2010-12-17 22:33:34.902161458 +0300
+@@ -27,7 +27,7 @@
+
+ EXTRA_CFLAGS := -Iinclude @cflags@
+ EXTRA_CXXFLAGS := -Iinclude @cflags@
+-EXTRA_LDFLAGS := @ldflags@
++EXTRA_LDFLAGS := @ldflags@ $(LDFLAGS)
+ WINRTDEBUG := @winrtdebug@
+
+ GLBPATCHFLAGS := @glbpatchcflags@
+
diff --git a/sci-physics/root/files/root-5.28.00b-unuran.patch b/sci-physics/root/files/root-5.28.00b-unuran.patch
new file mode 100644
index 000000000000..76422daed54b
--- /dev/null
+++ b/sci-physics/root/files/root-5.28.00b-unuran.patch
@@ -0,0 +1,39 @@
+diff -ur root-trunk.orig/math/unuran/Module.mk root-trunk/math/unuran/Module.mk
+--- root.orig/math/unuran/Module.mk 2010-11-25 20:41:32.000000000 +0100
++++ root/math/unuran/Module.mk 2010-11-25 20:51:47.190704977 +0100
+@@ -20,7 +20,7 @@
+ UNURANETAG := $(call stripsrc,$(UNURANDIRS)/headers.d)
+ UNRCFG := $(call stripsrc,$(UNURANDIRS)/$(UNRVERS)/config.h)
+
+-UNRTARCONTENT:=$(subst $(UNRVERS),$(UNRDIRS),$(shell mkdir -p $(UNRDIR); cd $(UNRDIR); gunzip -c $(UNRSRCS) | tar tf -))
++UNRTARCONTENT:=
+ UNRS := $(filter %.c, \
+ $(filter $(UNRDIRS)/src/utils/%,$(UNRTARCONTENT)) \
+ $(filter $(UNRDIRS)/src/methods/%,$(UNRTARCONTENT)) \
+@@ -69,10 +69,9 @@
+ ##### local rules #####
+ .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME)
+
+-include/%.h: $(UNURANDIRI)/%.h $(UNURANETAG)
++include/%.h: $(UNURANDIRI)/%.h
+ cp $< $@
+
+-$(UNURANDEP): $(UNRCFG)
+ $(UNRS): $(UNURANETAG)
+
+ $(UNURANETAG): $(UNRSRCS)
+@@ -125,12 +124,12 @@
+ GNUMAKE=$(MAKE) ./configure CC="$$ACC" \
+ CFLAGS="$$ACFLAGS");
+
+-$(UNURANLIB): $(UNRCFG) $(UNRO) $(UNURANO) $(UNURANDO) $(ORDER_) \
++$(UNURANLIB): $(UNURANO) $(UNURANDO) $(ORDER_) \
+ $(MAINLIBS) $(UNURANLIBDEP)
+ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \
+ "$(SOFLAGS)" libUnuran.$(SOEXT) $@ \
+ "$(UNURANO) $(UNURANDO)" \
+- "$(UNURANLIBEXTRA) $(UNRO)"
++ "$(UNURANLIBEXTRA) -lunuran"
+
+ $(UNURANDS): $(UNRINIT) $(UNURANDH1) $(UNURANL) $(ROOTCINTTMPDEP)
+ $(MAKEDIR)
diff --git a/sci-physics/root/files/root-5.32.00-afs.patch b/sci-physics/root/files/root-5.32.00-afs.patch
new file mode 100644
index 000000000000..2bf31798e6e0
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-afs.patch
@@ -0,0 +1,33 @@
+--- root/net/auth/src/TAFS.cxx.orig 2011-12-04 00:56:29.405007770 +0400
++++ root/net/auth/src/TAFS.cxx 2011-12-04 00:56:35.534709259 +0400
+@@ -138,7 +138,7 @@
+ } else {
+ if (isatty(0) != 0 && isatty(1) != 0) {
+ Gl_config("noecho", 1);
+- pw = Getline((char *) prompt.Data());
++ pw = const_cast<char *>( Getline((char *) prompt.Data()) );
+ Gl_config("noecho", 0);
+ } else {
+ Warning("TAFS", "not tty: cannot prompt for passwd: failure");
+--- root/core/clib/src/strlcat.c.orig 2011-12-04 01:49:26.495179487 +0400
++++ root/core/clib/src/strlcat.c 2011-12-04 01:50:41.407524763 +0400
+@@ -38,7 +38,7 @@
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+-size_t
++size_t __attribute__((weak))
+ strlcat(char *dst, const char *src, size_t siz)
+ {
+ register char *d = dst;
+--- root/core/clib/src/strlcpy.c.orig 2011-12-04 01:49:34.329797251 +0400
++++ root/core/clib/src/strlcpy.c 2011-12-04 01:50:49.051151843 +0400
+@@ -36,7 +36,7 @@
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+-size_t
++size_t __attribute__((weak))
+ strlcpy(char *dst, const char *src, size_t siz)
+ {
+ register char *d = dst;
diff --git a/sci-physics/root/files/root-5.32.00-cfitsio.patch b/sci-physics/root/files/root-5.32.00-cfitsio.patch
new file mode 100644
index 000000000000..853c3f39f207
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-cfitsio.patch
@@ -0,0 +1,13 @@
+--- configure.orig 2012-01-19 23:44:44.127607638 +0100
++++ configure 2012-01-20 00:19:20.420652913 +0100
+@@ -3435,9 +3435,7 @@
+ cfitsioinc=$found_hdr
+ cfitsioincdir=$found_dir
+
+- # At this time, libcfitsio.a should always be prefered over .so,
+- # to avoid forcing users to install cfitsio.
+- check_library "libcfitsio cfitsio" "no" "$cfitsiolibdir" \
++ check_library "libcfitsio cfitsio" "yes" "$cfitsiolibdir" \
+ $CFITSIO ${CFITSIO:+$CFITSIO/lib} ${CFITSIO:+$CFITSIO/.libs} \
+ ${finkdir:+$finkdir/lib} \
+ /usr/local/lib /usr/lib /opt/cfitsio/lib
diff --git a/sci-physics/root/files/root-5.32.00-chklib64.patch b/sci-physics/root/files/root-5.32.00-chklib64.patch
new file mode 100644
index 000000000000..979220f02f35
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-chklib64.patch
@@ -0,0 +1,24 @@
+bug fix for #406817
+--- configure.orig 2012-02-29 19:46:41.000000000 +0400
++++ configure 2012-03-22 03:28:43.458968696 +0400
+@@ -441,14 +441,13 @@
+ fi
+ else
+ if file $filearg $chklib64 | grep 'ASCII' > /dev/null 2>& 1 ; then
+- check_link $chklib64
+- ret=$link_result
+- else
+- logmsg " file $filearg $chklib64 | grep '64-bit'"
+- if file $filearg $chklib64 | grep '64-bit' > /dev/null 2>& 1 ; then
+- ret=1
+- fi
++ # get real binary .so name from .so ld script
++ chklib64=$(gawk '($1 == "GROUP") { print $3 }' $chklib64)
+ fi
++ logmsg " file $filearg $chklib64 | grep '64-bit'"
++ if file $filearg $chklib64 | grep '64-bit' > /dev/null 2>& 1 ; then
++ ret=1
++ fi
+ fi
+ logmsg " result: $ret"
+ if test $ret -eq 1 ; then
diff --git a/sci-physics/root/files/root-5.32.00-dotfont.patch b/sci-physics/root/files/root-5.32.00-dotfont.patch
new file mode 100644
index 000000000000..85d6dea7655e
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-dotfont.patch
@@ -0,0 +1,58 @@
+--- root/html/src/TClassDocOutput.cxx.orig 2012-05-25 16:18:10.000000000 +0400
++++ root/html/src/TClassDocOutput.cxx 2012-05-29 21:36:53.813593012 +0400
+@@ -625,7 +625,7 @@
+ << "size=\"8,10\";" << endl
+ << "ratio=auto;" << endl
+ << "margin=0;" << endl
+- << "node [shape=plaintext,fontsize=40,width=4,height=0.75];" << endl
++ << "node [shape=plaintext,fontsize=40,width=4,height=0.75,fontname=\"DejaVu Serif\"];" << endl
+ << "\"" << fCurrentClass->GetName() << "\" [shape=ellipse];" << endl;
+
+ std::stringstream ssDep;
+@@ -704,7 +704,7 @@
+ outdot << ";" << endl;
+ } else if (writeAndMoreFor) {
+ outdot << " \"...andmore" << writeAndMoreFor->GetName()
+- << "\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << endl;
++ << "\" [label=\"...and more\",fontname=\"DejaVu Serif Italic\",fillcolor=lightgrey,style=filled];" << endl;
+ }
+ }
+ if (!levelExists) break;
+@@ -733,7 +733,7 @@
+ << "ranksep=0.1;" << endl
+ << "nodesep=0;" << endl
+ << "margin=0;" << endl;
+- outdot << " node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << endl;
++ outdot << " node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10,fontname=\"DejaVu Serif\"];" << endl;
+
+ std::stringstream ssDep;
+ const int numColumns = 3;
+@@ -939,7 +939,7 @@
+ << "ranksep=0;" << endl
+ << "nodesep=0;" << endl
+ << "size=\"8,10\";" << endl
+- << "node [fontsize=20,shape=plaintext];" << endl;
++ << "node [fontsize=20,shape=plaintext,fontname=\"DejaVu Serif\"];" << endl;
+
+ for (std::list<std::string>::iterator iFile = listFilesToParse.begin();
+ iFile != listFilesToParse.end(); ++iFile) {
+@@ -999,7 +999,8 @@
+ << "ranksep=0.7;" << endl
+ << "nodesep=0.3;" << endl
+ << "size=\"8,8\";" << endl
+- << "ratio=compress;" << endl;
++ << "ratio=compress;" << endl
++ << "node [fontname=\"DejaVu Serif\"];" << endl;
+
+ TString libs(fCurrentClass->GetSharedLibs());
+ outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << endl;
+@@ -1109,7 +1110,8 @@
+
+ dotout << "digraph G {" << endl
+ << "ratio=auto;" << endl
+- << "rankdir=RL;" << endl;
++ << "rankdir=RL;" << endl
++ << "node [fontname=\"DejaVu Serif\"];" << endl;
+
+ // loop on all classes
+ TClassDocInfo* cdi = 0;
diff --git a/sci-physics/root/files/root-5.32.00-explicit-functions.patch b/sci-physics/root/files/root-5.32.00-explicit-functions.patch
new file mode 100644
index 000000000000..570d61e680fc
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-explicit-functions.patch
@@ -0,0 +1,18 @@
+--- root/io/io/Module.mk.orig 2012-02-29 19:46:38.000000000 +0400
++++ root/io/io/Module.mk 2012-03-09 02:29:19.905665572 +0400
+@@ -67,15 +67,5 @@
+ distclean:: distclean-$(MODNAME)
+
+ ##### extra rules ######
+-#ifeq ($(GCC_VERS_FULL),gcc-4.4.0)
+-ifeq ($(GCC_VERS),gcc-4.4)
+-ifneq ($(filter -O%,$(OPT)),)
+ $(call stripsrc,$(IODIRS)/TStreamerInfoReadBuffer.o): CXXFLAGS += -DR__EXPLICIT_FUNCTION_INSTANTIATION
+-endif
+-endif
+-ifeq ($(GCC_VERS),gcc-4.5)
+-ifneq ($(filter -O%,$(OPT)),)
+ $(call stripsrc,$(IODIRS)/TStreamerInfoReadBuffer.o): CXXFLAGS += -DR__EXPLICIT_FUNCTION_INSTANTIATION
+-endif
+-endif
+-
diff --git a/sci-physics/root/files/root-5.32.00-htmldoc.patch b/sci-physics/root/files/root-5.32.00-htmldoc.patch
new file mode 100644
index 000000000000..3b80b39cda49
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-htmldoc.patch
@@ -0,0 +1,12 @@
+--- root/html/src/THtml.cxx.orig 2012-05-25 16:18:10.000000000 +0400
++++ root/html/src/THtml.cxx 2012-05-29 19:22:40.810563296 +0400
+@@ -1913,6 +1913,9 @@
+ void THtml::CreateStyleSheet() const {
+ // Write the default ROOT style sheet.
+ CopyFileFromEtcDir("ROOT.css");
++ CopyFileFromEtcDir("info.png");
++ CopyFileFromEtcDir("root-banner.png");
++ CopyFileFromEtcDir("rootdrawing-logo.png");
+ CopyFileFromEtcDir("shadowAlpha.png");
+ CopyFileFromEtcDir("shadow.gif");
+ }
diff --git a/sci-physics/root/files/root-5.32.00-nobyte-compile.patch b/sci-physics/root/files/root-5.32.00-nobyte-compile.patch
new file mode 100644
index 000000000000..179e5790cc36
--- /dev/null
+++ b/sci-physics/root/files/root-5.32.00-nobyte-compile.patch
@@ -0,0 +1,137 @@
+diff -Naur root.as-needed/Makefile root/Makefile
+--- root.as-needed/Makefile 2011-07-10 10:42:49.758191296 +0400
++++ root/Makefile 2011-07-10 10:43:21.493339703 +0400
+@@ -1167,10 +1167,7 @@
+ if test "x$(RFLX_GRFLXPY)" != "x"; then \
+ rm -f $(DESTDIR)$(LIBDIR)/$(RFLX_GRFLXPY); \
+ fi; \
+- if test "x$(RFLX_GRFLXPYC)" != "x"; then \
+- rm -f $(DESTDIR)$(LIBDIR)/$(RFLX_GRFLXPYC); \
+- fi; \
+- if test "x$(RFLX_GRFLXPY)$(RFLX_GRFLXPYC)" != "x"; then \
++ if test "x$(RFLX_GRFLXPY)" != "x"; then \
+ dir=$(RFLX_GRFLXDD:lib/=); \
+ while test "x$${dir}" != "x" && \
+ test -d $(DESTDIR)$(LIBDIR)/$${dir} && \
+diff -Naur root.as-needed/bindings/pyroot/Module.mk root/bindings/pyroot/Module.mk
+--- root.as-needed/bindings/pyroot/Module.mk 2011-07-10 10:42:48.991561304 +0400
++++ root/bindings/pyroot/Module.mk 2011-07-10 10:43:21.493339703 +0400
+@@ -48,8 +48,6 @@
+ ROOTPY := $(subst $(MODDIR),$(LPATH),$(ROOTPYS))
+ $(LPATH)/%.py: $(MODDIR)/%.py; cp $< $@
+ endif
+-ROOTPYC := $(ROOTPY:.py=.pyc)
+-ROOTPYO := $(ROOTPY:.py=.pyo)
+
+ # used in the main Makefile
+ ALLHDRS += $(patsubst $(MODDIRI)/%.h,include/%.h,$(PYROOTH))
+@@ -68,10 +66,8 @@
+ include/%.h: $(PYROOTDIRI)/%.h
+ cp $< $@
+
+-%.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )'
+-%.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )'
+
+-$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) $(ROOTPYC) $(ROOTPYO) \
++$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) \
+ $(ROOTLIBSDEP) $(PYTHONLIBDEP)
+ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \
+ "$(SOFLAGS)" libPyROOT.$(SOEXT) $@ \
+@@ -113,7 +109,7 @@
+
+ distclean-$(MODNAME): clean-$(MODNAME)
+ @rm -f $(PYROOTDEP) $(PYROOTDS) $(PYROOTDH) $(PYROOTLIB) \
+- $(ROOTPY) $(ROOTPYC) $(ROOTPYO) $(PYROOTMAP) \
++ $(ROOTPY) $(PYROOTMAP) \
+ $(PYROOTPYD) $(PYTHON64DEP) $(PYTHON64)
+
+ distclean:: distclean-$(MODNAME)
+diff -Naur root.as-needed/build/package/debian/rules root/build/package/debian/rules
+--- root.as-needed/build/package/debian/rules 2011-07-10 10:42:49.241549346 +0400
++++ root/build/package/debian/rules 2011-07-10 10:48:06.989670589 +0400
+@@ -691,10 +691,6 @@
+ -X$(SYSCONFDIR)/root/system.rootauthrc \
+ -X$(SYSCONFDIR)/root/system.rootdaemonrc \
+ -X$(PREFIX)/lib/root/$(SOVERS)/libAfterImage.a \
+- -X$(PREFIX)/lib/root/$(SOVERS)/PyCintex.pyc \
+- -X$(PREFIX)/lib/root/$(SOVERS)/PyCintex.pyo \
+- -X$(PREFIX)/lib/root/$(SOVERS)/ROOT.pyc \
+- -X$(PREFIX)/lib/root/$(SOVERS)/ROOT.pyo \
+ -X$(PREFIX)/lib/root/$(SOVERS)/cint7 \
+ -X$(PREFIX)/include/root/Minuit2
+ # $(foreach i, \
+diff -Naur root.as-needed/cint/cintex/Module.mk root/cint/cintex/Module.mk
+--- root.as-needed/cint/cintex/Module.mk 2011-07-10 10:42:49.104889217 +0400
++++ root/cint/cintex/Module.mk 2011-07-10 10:43:21.496672876 +0400
+@@ -31,10 +31,6 @@
+ CINTEXPY := $(subst $(MODDIR)/python,$(LPATH),$(CINTEXPYS))
+ $(LPATH)/%.py: $(MODDIR)/python/%.py; cp $< $@
+ endif
+-ifneq ($(BUILDPYTHON),no)
+-CINTEXPYC := $(CINTEXPY:.py=.pyc)
+-CINTEXPYO := $(CINTEXPY:.py=.pyo)
+-endif
+
+ # used in the main Makefile
+ ALLHDRS += $(patsubst $(MODDIRI)/Cintex/%.h,include/Cintex/%.h,$(CINTEXH))
+@@ -86,8 +82,6 @@
+ fi)
+ cp $< $@
+
+-%.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )'
+-%.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )'
+
+ $(CINTEXLIB): $(CINTEXO) $(CINTEXPY) $(CINTEXPYC) $(CINTEXPYO) \
+ $(ORDER_) $(subst $(CINTEXLIB),,$(MAINLIBS)) $(CINTEXLIBDEP)
+diff -Naur root.as-needed/cint/reflex/Module.mk root/cint/reflex/Module.mk
+--- root.as-needed/cint/reflex/Module.mk 2011-07-10 10:42:49.074890651 +0400
++++ root/cint/reflex/Module.mk 2011-07-10 10:43:21.496672876 +0400
+@@ -48,9 +48,6 @@
+ RFLX_GRFLXS := $(wildcard $(RFLX_GRFLXSD)/*.py)
+ RFLX_GRFLXPY := $(patsubst $(RFLX_GRFLXSD)/%.py,$(RFLX_GRFLXDD)/%.py,$(RFLX_GRFLXS))
+ RFLX_GRFLXPY += $(RFLX_GCCXMLPATHPY)
+-ifneq ($(BUILDPYTHON),no)
+-RFLX_GRFLXPYC := $(subst .py,.pyc,$(RFLX_GRFLXPY))
+-endif
+
+ RFLX_LIBDIR = $(LIBDIR)
+
+@@ -92,7 +89,7 @@
+
+ ALLEXECS += $(RFLX_GENMAPX)
+
+-POSTBIN += $(RFLX_GRFLXPYC) $(RFLX_GRFLXPY)
++POSTBIN += $(RFLX_GRFLXPY)
+
+ ##### local rules #####
+ .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME) \
+@@ -122,8 +119,6 @@
+ mkdir -p lib/python/genreflex; fi )
+ cp $< $@
+
+-$(RFLX_GRFLXDD)/%.pyc: $(RFLX_GRFLXDD)/%.py
+- @python -c 'import py_compile; py_compile.compile( "$<" )'
+
+ $(RFLX_GENMAPO) : CXXFLAGS += -I$(REFLEXDIRS)/genmap
+
+@@ -149,7 +144,7 @@
+ $(RLIBMAP) -o $@ -l $(REFLEXDICTLIB) \
+ -d $(REFLEXDICTLIBDEPM) -c $(REFLEXL)
+
+-all-$(MODNAME): $(REFLEXLIB) $(REFLEXDICTLIB) $(REFLEXDICTMAP) $(RFLX_GRFLXPYC) $(RFLX_GRFLXPY)
++all-$(MODNAME): $(REFLEXLIB) $(REFLEXDICTLIB) $(REFLEXDICTMAP) $(RFLX_GRFLXPY)
+
+ clean-genreflex:
+ @rm -rf lib/python/genreflex
+diff -Naur root.as-needed/cint/reflex/python/CMakeLists.txt root/cint/reflex/python/CMakeLists.txt
+--- root.as-needed/cint/reflex/python/CMakeLists.txt 2011-07-10 10:42:49.074890651 +0400
++++ root/cint/reflex/python/CMakeLists.txt 2011-07-10 10:43:21.496672876 +0400
+@@ -15,7 +15,7 @@
+ ##################### sources ####################
+
+ FILE(GLOB_RECURSE GENREFLEX_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} genreflex/*.py)
+-SET(GENREFLEX_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/genreflex/genreflex.pyc PARENT_SCOPE)
++SET(GENREFLEX_SCRIPT PARENT_SCOPE)
+
+ ##################### gccxmlpath ####################
+
diff --git a/sci-physics/root/files/root-5.34.05-nobyte-compile.patch b/sci-physics/root/files/root-5.34.05-nobyte-compile.patch
new file mode 100644
index 000000000000..ec67a15887f6
--- /dev/null
+++ b/sci-physics/root/files/root-5.34.05-nobyte-compile.patch
@@ -0,0 +1,137 @@
+diff -Naur root.as-needed/Makefile root/Makefile
+--- a/Makefile.orig 2013-02-15 02:27:56.000000000 +0400
++++ b/Makefile 2013-02-23 02:22:14.556465852 +0400
+@@ -1258,10 +1258,7 @@
+ for lib in $(RFLX_GRFLXPY); do \
+ rm -f $(DESTDIR)$(LIBDIR)/$${lib#lib/}; \
+ done; \
+- for lib in $(RFLX_GRFLXPYC); do \
+- rm -f $(DESTDIR)$(LIBDIR)/$${lib#lib/}; \
+- done; \
+- if test "x$(RFLX_GRFLXPY)$(RFLX_GRFLXPYC)" != "x"; then \
++ if test "x$(RFLX_GRFLXPY)" != "x"; then \
+ dir=$(subst lib/,,$(RFLX_GRFLXDD)); \
+ while test "x$${dir}" != "x" && \
+ test -d $(DESTDIR)$(LIBDIR)/$${dir} && \
+diff -Naur root.as-needed/bindings/pyroot/Module.mk root/bindings/pyroot/Module.mk
+--- root.as-needed/bindings/pyroot/Module.mk 2011-07-10 10:42:48.991561304 +0400
++++ root/bindings/pyroot/Module.mk 2011-07-10 10:43:21.493339703 +0400
+@@ -48,8 +48,6 @@
+ ROOTPY := $(subst $(MODDIR),$(LPATH),$(ROOTPYS))
+ $(LPATH)/%.py: $(MODDIR)/%.py; cp $< $@
+ endif
+-ROOTPYC := $(ROOTPY:.py=.pyc)
+-ROOTPYO := $(ROOTPY:.py=.pyo)
+
+ # used in the main Makefile
+ ALLHDRS += $(patsubst $(MODDIRI)/%.h,include/%.h,$(PYROOTH))
+@@ -68,10 +66,8 @@
+ include/%.h: $(PYROOTDIRI)/%.h
+ cp $< $@
+
+-%.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )'
+-%.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )'
+
+-$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) $(ROOTPYC) $(ROOTPYO) \
++$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) \
+ $(ROOTLIBSDEP) $(PYTHONLIBDEP)
+ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \
+ "$(SOFLAGS)" libPyROOT.$(SOEXT) $@ \
+@@ -113,7 +109,7 @@
+
+ distclean-$(MODNAME): clean-$(MODNAME)
+ @rm -f $(PYROOTDEP) $(PYROOTDS) $(PYROOTDH) $(PYROOTLIB) \
+- $(ROOTPY) $(ROOTPYC) $(ROOTPYO) $(PYROOTMAP) \
++ $(ROOTPY) $(PYROOTMAP) \
+ $(PYROOTPYD) $(PYTHON64DEP) $(PYTHON64)
+
+ distclean:: distclean-$(MODNAME)
+diff -Naur root.as-needed/build/package/debian/rules root/build/package/debian/rules
+--- root.as-needed/build/package/debian/rules 2011-07-10 10:42:49.241549346 +0400
++++ root/build/package/debian/rules 2011-07-10 10:48:06.989670589 +0400
+@@ -691,10 +691,6 @@
+ -X$(SYSCONFDIR)/root/system.rootauthrc \
+ -X$(SYSCONFDIR)/root/system.rootdaemonrc \
+ -X$(PREFIX)/lib/root/$(SOVERS)/libAfterImage.a \
+- -X$(PREFIX)/lib/root/$(SOVERS)/PyCintex.pyc \
+- -X$(PREFIX)/lib/root/$(SOVERS)/PyCintex.pyo \
+- -X$(PREFIX)/lib/root/$(SOVERS)/ROOT.pyc \
+- -X$(PREFIX)/lib/root/$(SOVERS)/ROOT.pyo \
+ -X$(PREFIX)/lib/root/$(SOVERS)/cint7 \
+ -X$(PREFIX)/include/root/Minuit2
+ # $(foreach i, \
+diff -Naur root.as-needed/cint/cintex/Module.mk root/cint/cintex/Module.mk
+--- root.as-needed/cint/cintex/Module.mk 2011-07-10 10:42:49.104889217 +0400
++++ root/cint/cintex/Module.mk 2011-07-10 10:43:21.496672876 +0400
+@@ -31,10 +31,6 @@
+ CINTEXPY := $(subst $(MODDIR)/python,$(LPATH),$(CINTEXPYS))
+ $(LPATH)/%.py: $(MODDIR)/python/%.py; cp $< $@
+ endif
+-ifneq ($(BUILDPYTHON),no)
+-CINTEXPYC := $(CINTEXPY:.py=.pyc)
+-CINTEXPYO := $(CINTEXPY:.py=.pyo)
+-endif
+
+ # used in the main Makefile
+ ALLHDRS += $(patsubst $(MODDIRI)/Cintex/%.h,include/Cintex/%.h,$(CINTEXH))
+@@ -86,8 +82,6 @@
+ fi)
+ cp $< $@
+
+-%.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )'
+-%.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )'
+
+ $(CINTEXLIB): $(CINTEXO) $(CINTEXPY) $(CINTEXPYC) $(CINTEXPYO) \
+ $(ORDER_) $(subst $(CINTEXLIB),,$(MAINLIBS)) $(CINTEXLIBDEP)
+diff -Naur root.as-needed/cint/reflex/Module.mk root/cint/reflex/Module.mk
+--- root.as-needed/cint/reflex/Module.mk 2011-07-10 10:42:49.074890651 +0400
++++ root/cint/reflex/Module.mk 2011-07-10 10:43:21.496672876 +0400
+@@ -48,9 +48,6 @@
+ RFLX_GRFLXS := $(wildcard $(RFLX_GRFLXSD)/*.py)
+ RFLX_GRFLXPY := $(patsubst $(RFLX_GRFLXSD)/%.py,$(RFLX_GRFLXDD)/%.py,$(RFLX_GRFLXS))
+ RFLX_GRFLXPY += $(RFLX_GCCXMLPATHPY)
+-ifneq ($(BUILDPYTHON),no)
+-RFLX_GRFLXPYC := $(subst .py,.pyc,$(RFLX_GRFLXPY))
+-endif
+
+ RFLX_LIBDIR = $(LIBDIR)
+
+@@ -92,7 +89,7 @@
+
+ ALLEXECS += $(RFLX_GENMAPX)
+
+-POSTBIN += $(RFLX_GRFLXPYC) $(RFLX_GRFLXPY)
++POSTBIN += $(RFLX_GRFLXPY)
+
+ ##### local rules #####
+ .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME) \
+@@ -122,8 +119,6 @@
+ mkdir -p lib/python/genreflex; fi )
+ cp $< $@
+
+-$(RFLX_GRFLXDD)/%.pyc: $(RFLX_GRFLXDD)/%.py
+- @python -c 'import py_compile; py_compile.compile( "$<" )'
+
+ $(RFLX_GENMAPO) : CXXFLAGS += -I$(REFLEXDIRS)/genmap
+
+@@ -149,7 +144,7 @@
+ $(RLIBMAP) -o $@ -l $(REFLEXDICTLIB) \
+ -d $(REFLEXDICTLIBDEPM) -c $(REFLEXL)
+
+-all-$(MODNAME): $(REFLEXLIB) $(REFLEXDICTLIB) $(REFLEXDICTMAP) $(RFLX_GRFLXPYC) $(RFLX_GRFLXPY)
++all-$(MODNAME): $(REFLEXLIB) $(REFLEXDICTLIB) $(REFLEXDICTMAP) $(RFLX_GRFLXPY)
+
+ clean-genreflex:
+ @rm -rf lib/python/genreflex
+diff -Naur root.as-needed/cint/reflex/python/CMakeLists.txt root/cint/reflex/python/CMakeLists.txt
+--- root.as-needed/cint/reflex/python/CMakeLists.txt 2011-07-10 10:42:49.074890651 +0400
++++ root/cint/reflex/python/CMakeLists.txt 2011-07-10 10:43:21.496672876 +0400
+@@ -15,7 +15,7 @@
+ ##################### sources ####################
+
+ FILE(GLOB_RECURSE GENREFLEX_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} genreflex/*.py)
+-SET(GENREFLEX_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/genreflex/genreflex.pyc PARENT_SCOPE)
++SET(GENREFLEX_SCRIPT PARENT_SCOPE)
+
+ ##################### gccxmlpath ####################
+
diff --git a/sci-physics/root/files/root-5.34.13-desktop.patch b/sci-physics/root/files/root-5.34.13-desktop.patch
new file mode 100644
index 000000000000..7d47bcf7ce45
--- /dev/null
+++ b/sci-physics/root/files/root-5.34.13-desktop.patch
@@ -0,0 +1,12 @@
+diff --git a/etc/root.desktop b/etc/root.desktop
+index ca38211..688ecfa 100644
+--- a/etc/root.desktop
++++ b/etc/root.desktop
+@@ -8,5 +8,5 @@ Name[de]=ROOT
+ Comment=An object-oriented data analysis framework
+ Comment[de]=Ein objektorientiertes Framework zur Datenanalyse
+ StartupNotify=true
+-MimeType=application/x-root;text/x-c++src
+-Categories=Science;Development;Application;
++MimeType=application/x-root;text/x-c++src;
++Categories=Science;Development;
diff --git a/sci-physics/root/files/root-5.34.13-unuran.patch b/sci-physics/root/files/root-5.34.13-unuran.patch
new file mode 100644
index 000000000000..8262313184b5
--- /dev/null
+++ b/sci-physics/root/files/root-5.34.13-unuran.patch
@@ -0,0 +1,40 @@
+diff --git a/math/unuran/Module.mk b/math/unuran/Module.mk
+index 00a530b..7cd22dc 100644
+--- a/math/unuran/Module.mk
++++ b/math/unuran/Module.mk
+@@ -31,7 +31,7 @@ UNRS := $(wildcard $(UNRDIRS)/src/utils/*.c) \
+ $(wildcard $(UNRDIRS)/src/uniform/*.c) \
+ $(wildcard $(UNRDIRS)/src/urng/*.c)
+ else
+-UNRTARCONTENT:=$(subst $(UNRVERS),$(UNRDIRS),$(shell mkdir -p $(UNRDIR); cd $(UNRDIR); gunzip -c $(UNRSRCS) | tar tf -))
++UNRTARCONTENT:=
+ UNRS := $(filter %.c, \
+ $(filter $(UNRDIRS)/src/utils/%,$(UNRTARCONTENT)) \
+ $(filter $(UNRDIRS)/src/methods/%,$(UNRTARCONTENT)) \
+@@ -81,10 +81,9 @@ INCLUDEFILES += $(UNURANDEP)
+ ##### local rules #####
+ .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME)
+
+-include/%.h: $(UNURANDIRI)/%.h $(UNURANETAG)
++include/%.h: $(UNURANDIRI)/%.h
+ cp $< $@
+
+-$(UNURANDEP): $(UNRCFG)
+ $(UNRS): $(UNURANETAG)
+
+ $(UNURANETAG): $(UNRSRCS)
+@@ -137,12 +136,12 @@ $(UNRCFG): $(UNURANETAG)
+ GNUMAKE=$(MAKE) ./configure CC="$$ACC" \
+ CFLAGS="$$ACFLAGS");
+
+-$(UNURANLIB): $(UNRCFG) $(UNRO) $(UNURANO) $(UNURANDO) $(ORDER_) \
++$(UNURANLIB): $(UNURANO) $(UNURANDO) $(ORDER_) \
+ $(MAINLIBS) $(UNURANLIBDEP)
+ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \
+ "$(SOFLAGS)" libUnuran.$(SOEXT) $@ \
+ "$(UNURANO) $(UNURANDO)" \
+- "$(UNURANLIBEXTRA) $(UNRO)"
++ "$(UNURANLIBEXTRA) -lunuran"
+
+ $(UNURANDS): $(UNRINIT) $(UNURANDH1) $(UNURANL) $(ROOTCINTTMPDEP)
+ $(MAKEDIR)
diff --git a/sci-physics/root/files/root-5.34.26-ldflags.patch b/sci-physics/root/files/root-5.34.26-ldflags.patch
new file mode 100644
index 000000000000..b81dbb5edb00
--- /dev/null
+++ b/sci-physics/root/files/root-5.34.26-ldflags.patch
@@ -0,0 +1,19 @@
+commit 3c8bc686abf57e7e2037c4c191cb63a1a5172b5b
+Author: Andrew Savchenko <bircoph@gmail.com>
+Date: Sun Feb 22 03:45:21 2015 +0300
+
+ root-5.32.00-prop-flags.patch -> root-5.34.26-prop-flags.patch
+
+diff --git a/config/Makefile.in b/config/Makefile.in
+index 89674e7..91d25b9 100644
+--- a/config/Makefile.in
++++ b/config/Makefile.in
+@@ -29,7 +29,7 @@ EXTRA_CFLAGS := -Iinclude @cflags@
+ USERCONF_CFLAGS:= @usercflags@
+ EXTRA_CXXFLAGS := -Iinclude @cflags@
+ USERCONF_CXXFLAGS:= @usercxxflags@
+-EXTRA_LDFLAGS := @ldflags@
++EXTRA_LDFLAGS := @ldflags@ $(LDFLAGS)
+ WERROR := @werror@
+ WINRTDEBUG := @winrtdebug@
+
diff --git a/sci-physics/root/files/root-6.00.01-dotfont.patch b/sci-physics/root/files/root-6.00.01-dotfont.patch
new file mode 100644
index 000000000000..6c765f75a505
--- /dev/null
+++ b/sci-physics/root/files/root-6.00.01-dotfont.patch
@@ -0,0 +1,58 @@
+--- root/html/src/TClassDocOutput.cxx.orig 2012-06-08 02:13:51.000000000 +0400
++++ root/html/src/TClassDocOutput.cxx 2012-06-08 02:34:45.705436577 +0400
+@@ -625,7 +625,7 @@
+ << "size=\"8,10\";" << std::endl
+ << "ratio=auto;" << std::endl
+ << "margin=0;" << std::endl
+- << "node [shape=plaintext,fontsize=40,width=4,height=0.75];" << std::endl
++ << "node [shape=plaintext,fontsize=40,width=4,height=0.75,fontname=\"DejaVu Serif\"];" << std::endl
+ << "\"" << fCurrentClass->GetName() << "\" [shape=ellipse];" << std::endl;
+
+ std::stringstream ssDep;
+@@ -704,7 +704,7 @@
+ outdot << ";" << std::endl;
+ } else if (writeAndMoreFor) {
+ outdot << " \"...andmore" << writeAndMoreFor->GetName()
+- << "\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << std::endl;
++ << "\" [label=\"...and more\",fontname=\"DejaVu Serif Italic\",fillcolor=lightgrey,style=filled];" << std::endl;
+ }
+ }
+ if (!levelExists) break;
+@@ -733,7 +733,7 @@
+ << "ranksep=0.1;" << std::endl
+ << "nodesep=0;" << std::endl
+ << "margin=0;" << std::endl;
+- outdot << " node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << std::endl;
++ outdot << " node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10,fontname=\"DejaVu Serif\"];" << std::endl;
+
+ std::stringstream ssDep;
+ const int numColumns = 3;
+@@ -939,7 +939,7 @@
+ << "ranksep=0;" << std::endl
+ << "nodesep=0;" << std::endl
+ << "size=\"8,10\";" << std::endl
+- << "node [fontsize=20,shape=plaintext];" << std::endl;
++ << "node [fontsize=20,shape=plaintext,fontname=\"DejaVu Serif\"];" << std::endl;
+
+ for (std::list<std::string>::iterator iFile = listFilesToParse.begin();
+ iFile != listFilesToParse.end(); ++iFile) {
+@@ -999,7 +999,8 @@
+ << "ranksep=0.7;" << std::endl
+ << "nodesep=0.3;" << std::endl
+ << "size=\"8,8\";" << std::endl
+- << "ratio=compress;" << std::endl;
++ << "ratio=compress;" << std::endl
++ << "node [fontname=\"DejaVu Serif\"];" << std::endl;
+
+ TString libs(fCurrentClass->GetSharedLibs());
+ outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << std::endl;
+@@ -1109,7 +1110,8 @@
+
+ dotout << "digraph G {" << std::endl
+ << "ratio=auto;" << std::endl
+- << "rankdir=RL;" << std::endl;
++ << "rankdir=RL;" << std::endl
++ << "node [fontname=\"DejaVu Serif\"];" << std::endl;
+
+ // loop on all classes
+ TClassDocInfo* cdi = 0;
diff --git a/sci-physics/root/files/root-6.00.01-geocad.patch b/sci-physics/root/files/root-6.00.01-geocad.patch
new file mode 100644
index 000000000000..2742a74bd0eb
--- /dev/null
+++ b/sci-physics/root/files/root-6.00.01-geocad.patch
@@ -0,0 +1,15 @@
+diff --git a/geom/geocad/inc/TGeoToOCC.h b/geom/geocad/inc/TGeoToOCC.h
+index 892f225..86eb9e1 100644
+--- a/geom/geocad/inc/TGeoToOCC.h
++++ b/geom/geocad/inc/TGeoToOCC.h
+@@ -13,8 +13,10 @@
+ #define ROOT_TGeoToOCC
+
+ //Cascade
++#define Printf Printf_opencascade
+ #include <TopoDS_Shape.hxx>
+ #include <TopoDS_Wire.hxx>
++#undef Printf
+
+ //Root
+ #ifndef ROOT_TGeoXtru
diff --git a/sci-physics/root/files/root-6.00.01-llvm.patch b/sci-physics/root/files/root-6.00.01-llvm.patch
new file mode 100644
index 000000000000..c6abb353ee64
--- /dev/null
+++ b/sci-physics/root/files/root-6.00.01-llvm.patch
@@ -0,0 +1,13 @@
+diff --git a/interpreter/llvm/src/Makefile.config.in b/interpreter/llvm/src/Makefile.config.in
+index 7633be2..c8756b1 100644
+--- a/interpreter/llvm/src/Makefile.config.in
++++ b/interpreter/llvm/src/Makefile.config.in
+@@ -170,6 +170,8 @@ CXXFLAGS += @CXXFLAGS@
+
+ # Linker flags.
+ LDFLAGS += @LDFLAGS@
++NOUNDEF := -Wl,--no-undefined
++LDFLAGS := $(filter-out $(NOUNDEF),$(LDFLAGS))
+
+ # Path to the library archiver program.
+ AR_PATH = @AR@
diff --git a/sci-physics/root/files/root-6.00.01-nobyte-compile.patch b/sci-physics/root/files/root-6.00.01-nobyte-compile.patch
new file mode 100644
index 000000000000..aa58f20686dc
--- /dev/null
+++ b/sci-physics/root/files/root-6.00.01-nobyte-compile.patch
@@ -0,0 +1,33 @@
+diff -Naur root.as-needed/bindings/pyroot/Module.mk root/bindings/pyroot/Module.mk
+--- root.as-needed/bindings/pyroot/Module.mk 2011-07-10 10:42:48.991561304 +0400
++++ root/bindings/pyroot/Module.mk 2011-07-10 10:43:21.493339703 +0400
+@@ -48,8 +48,6 @@
+ ROOTPY := $(subst $(MODDIR),$(LPATH),$(ROOTPYS))
+ $(LPATH)/%.py: $(MODDIR)/%.py; cp $< $@
+ endif
+-ROOTPYC := $(ROOTPY:.py=.pyc)
+-ROOTPYO := $(ROOTPY:.py=.pyo)
+
+ # used in the main Makefile
+ ALLHDRS += $(patsubst $(MODDIRI)/%.h,include/%.h,$(PYROOTH))
+@@ -68,10 +66,8 @@
+ include/%.h: $(PYROOTDIRI)/%.h
+ cp $< $@
+
+-%.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )'
+-%.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )'
+
+-$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) $(ROOTPYC) $(ROOTPYO) \
++$(PYROOTLIB): $(PYROOTO) $(PYROOTDO) $(ROOTPY) \
+ $(ROOTLIBSDEP) $(PYTHONLIBDEP)
+ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \
+ "$(SOFLAGS)" libPyROOT.$(SOEXT) $@ \
+@@ -113,7 +109,7 @@
+
+ distclean-$(MODNAME): clean-$(MODNAME)
+ @rm -f $(PYROOTDEP) $(PYROOTDS) $(PYROOTDH) $(PYROOTLIB) \
+- $(ROOTPY) $(ROOTPYC) $(ROOTPYO) $(PYROOTMAP) \
++ $(ROOTPY) $(PYROOTMAP) \
+ $(PYROOTPYD) $(PYTHON64DEP) $(PYTHON64)
+
+ distclean:: distclean-$(MODNAME)
diff --git a/sci-physics/root/files/root-6.00.01-prop-flags.patch b/sci-physics/root/files/root-6.00.01-prop-flags.patch
new file mode 100644
index 000000000000..3a1002478902
--- /dev/null
+++ b/sci-physics/root/files/root-6.00.01-prop-flags.patch
@@ -0,0 +1,17 @@
+diff --git a/config/Makefile.in b/config/Makefile.in
+index dd89044..4fc7de3 100644
+--- a/config/Makefile.in
++++ b/config/Makefile.in
+@@ -64,9 +64,9 @@ HOST := @host@
+ USECONFIG := @useconfig@
+ MKLIBOPTIONS := @mkliboption@
+
+-EXTRA_CFLAGS := -Iinclude @cflags@
+-EXTRA_CXXFLAGS := -Iinclude @cflags@
+-EXTRA_LDFLAGS := @ldflags@
++EXTRA_CFLAGS := -Iinclude @cflags@ $(CFLAGS)
++EXTRA_CXXFLAGS := -Iinclude @cflags@ $(CXXFLAGS)
++EXTRA_LDFLAGS := @ldflags@ $(LDFLAGS)
+ WERROR := @werror@
+ WINRTDEBUG := @winrtdebug@
+ CTORSINITARRAY := @ctorsinitarray@
diff --git a/sci-physics/root/files/root-6.02.05-xrootd4.patch b/sci-physics/root/files/root-6.02.05-xrootd4.patch
new file mode 100644
index 000000000000..0b4a4bef0f2e
--- /dev/null
+++ b/sci-physics/root/files/root-6.02.05-xrootd4.patch
@@ -0,0 +1,11 @@
+https://sft.its.cern.ch/jira/browse/ROOT-6998
+--- root-6.02.05/net/netxng/src/TNetXNGFile.cxx.orig 2015-02-09 11:59:47.000000000 +0300
++++ root-6.02.05/net/netxng/src/TNetXNGFile.cxx 2015-04-05 11:32:31.893127758 +0300
+@@ -28,6 +28,7 @@
+ #include <XrdCl/XrdClFile.hh>
+ #include <XrdCl/XrdClXRootDResponses.hh>
+ #include <XrdCl/XrdClDefaultEnv.hh>
++#include <XrdVersion.hh>
+ #include <iostream>
+
+ //------------------------------------------------------------------------------
diff --git a/sci-physics/root/files/rootd.confd b/sci-physics/root/files/rootd.confd
new file mode 100644
index 000000000000..7516b8c9b6dd
--- /dev/null
+++ b/sci-physics/root/files/rootd.confd
@@ -0,0 +1,8 @@
+# conf.d file for root daemon
+
+# User to run as (default is `rootd')
+ROOTD_USER="rootd"
+
+# Please refer to the rootd(1) man(1) page for more information on
+# command line parameters.
+ROOTD_OPTS=""
diff --git a/sci-physics/root/files/rootd.initd b/sci-physics/root/files/rootd.initd
new file mode 100644
index 000000000000..4961ad56380f
--- /dev/null
+++ b/sci-physics/root/files/rootd.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use logger
+ provide root-file-server
+}
+
+start() {
+ ebegin "Starting ROOT file server"
+ pid=$(start-stop-daemon --start --quiet --user ${ROOTD_USER} \
+ --pidfile /var/run/rootd.pid \
+ --exec /usr/bin/rootd -- ${ROOTD_OPTS})
+ retval=$?
+ echo ${ROOTD_PID} > /var/run/rootd.pid
+ eend ${retval}
+}
+
+stop() {
+ ebegin "Stopping ROOT file server"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/rootd.pid \
+ --exec /usr/bin/rootd
+ eend $?
+}
diff --git a/sci-physics/root/metadata.xml b/sci-physics/root/metadata.xml
new file mode 100644
index 000000000000..2d5f75aecc7c
--- /dev/null
+++ b/sci-physics/root/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+</maintainer>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ ROOT Object Oriented Technologies is an object oriented data
+ analysis framework written in C++ by the CERN. Widely used in
+ high energy physics, but also in other data analysis applications. It
+ contains the CINT C/C++ interpreter and many classes such as
+ statistics, serialization, optimization, linear algebra, graphics,
+ GUI toolkit, and a complete visualization framework.
+</longdescription>
+<use>
+ <flag name="c++11"> Build ROOT using the C++11 standard</flag>
+ <flag name="c++14"> Build ROOT using the C++14 standard</flag>
+ <flag name="clarens"> Build the Clarens and PEAC plug-ins, to use in a GRID enabled analysis</flag>
+ <flag name="fits">Support for images and data from FITS files with <pkg>sci-libs/cfitsio</pkg></flag>
+ <flag name="gdml">Enable GDML writer and reader</flag>
+ <flag name="geocad">Enable ROOT-CAD interface using <pkg>sci-libs/opencascade</pkg></flag>
+ <flag name="htmldoc">Generate html documentation</flag>
+ <flag name="http">Enable http server support including but not limited to fastcgi support</flag>
+ <flag name="math">Build all math related libraries plugins, needs <pkg>sci-libs/gsl</pkg> </flag>
+ <flag name="memstat">Build memory statistics library, helps to detect memory leaks</flag>
+ <flag name="pythia6">Build the interface for <pkg>sci-physics/pythia</pkg> version 6.x </flag>
+ <flag name="pythia8">Build the interface for <pkg>sci-physics/pythia</pkg> version 8.x </flag>
+ <flag name="reflex">Build the reflection database for the C++ interpreter</flag>
+ <flag name="shadow">Enable shadow authentication in rootd and proofd</flag>
+ <flag name="table">Build libTable contrib library</flag>
+ <flag name="xrootd">Build the interface for <pkg>net-libs/xrootd</pkg> </flag>
+</use>
+</pkgmetadata>
diff --git a/sci-physics/root/root-5.32.03-r2.ebuild b/sci-physics/root/root-5.32.03-r2.ebuild
new file mode 100644
index 000000000000..7b03c47ffd02
--- /dev/null
+++ b/sci-physics/root/root-5.32.03-r2.ebuild
@@ -0,0 +1,378 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="python? 2"
+
+if [[ ${PV} == "9999" ]] ; then
+ _SVN=subversion
+ ESVN_REPO_URI="https://root.cern.ch/svn/root/trunk"
+ ESVN_OPTIONS="--non-interactive --trust-server-cert"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz"
+ KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+fi
+
+inherit elisp-common eutils fdo-mime fortran-2 multilib python toolchain-funcs user ${_SVN}
+
+ROOFIT_DOC_PV=2.91-33
+TMVA_DOC_PV=4.03
+PATCH_PV=5.28.00b
+PATCH_PV2=5.32.00
+
+DESCRIPTION="C++ data analysis framework and interpreter from CERN"
+HOMEPAGE="http://root.cern.ch/"
+SRC_URI="${SRC_URI}
+ doc? ( ftp://root.cern.ch/${PN}/doc/ROOTUsersGuide.pdf
+ math? (
+ ftp://root.cern.ch/${PN}/doc/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf
+ http://tmva.sourceforge.net/docu/TMVAUsersGuide.pdf -> TMVAUsersGuide-v${TMVA_DOC_PV}.pdf )
+ htmldoc? (
+ http://root.cern.ch/drupal/sites/default/files/rootdrawing-logo.png
+ http://root.cern.ch/drupal/sites/all/themes/newsflash/images/blue/root-banner.png
+ http://root.cern.ch/drupal/sites/all/themes/newsflash/images/info.png ) )"
+
+SLOT="0"
+LICENSE="LGPL-2.1"
+IUSE="+X afs avahi clarens doc emacs examples fits fftw graphviz htmldoc kerberos
+ ldap +math mpi mysql odbc +opengl openmp oracle postgres prefix pythia6
+ pythia8 python qt4 +reflex ruby ssl xft xinetd xml xrootd"
+
+CDEPEND="
+ app-arch/xz-utils
+ >=dev-lang/cfortran-4.4-r2
+ dev-libs/libpcre
+ media-fonts/dejavu
+ media-libs/freetype
+ media-libs/giflib
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/jpeg
+ virtual/shadow
+ X? (
+ media-libs/ftgl
+ media-libs/glew
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXpm
+ || (
+ >=media-libs/libafterimage-1.20[gif,jpeg,png,tiff]
+ >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff]
+ )
+ opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ dev-qt/qt3support:4
+ dev-qt/qtsvg:4
+ dev-qt/qtwebkit:4
+ dev-qt/qtxmlpatterns:4 )
+ xft? ( x11-libs/libXft )
+ )
+ afs? ( net-fs/openafs )
+ avahi? ( net-dns/avahi )
+ clarens? ( dev-libs/xmlrpc-c[curl] )
+ emacs? ( virtual/emacs )
+ fits? ( sci-libs/cfitsio )
+ fftw? ( sci-libs/fftw:3.0 )
+ graphviz? ( media-gfx/graphviz )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap )
+ math? ( sci-libs/gsl sci-mathematics/unuran mpi? ( virtual/mpi ) )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
+ oracle? ( dev-db/oracle-instantclient-basic )
+ postgres? ( dev-db/postgresql )
+ pythia6? ( sci-physics/pythia:6 )
+ pythia8? ( sci-physics/pythia:8 )
+ ruby? (
+ dev-lang/ruby
+ dev-ruby/rubygems )
+ ssl? ( dev-libs/openssl )
+ xml? ( dev-libs/libxml2 )
+ xrootd? ( net-libs/xrootd )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RDEPEND="${CDEPEND}
+ reflex? ( dev-cpp/gccxml )
+ xinetd? ( sys-apps/xinetd )"
+
+PDEPEND="htmldoc? ( ~app-doc/root-docs-${PV} )"
+
+REQUIRED_USE="
+ !X? ( !opengl !qt4 !xft )
+ mpi? ( math !openmp )
+ openmp? ( math !mpi )"
+
+S="${WORKDIR}/${PN}"
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python_pkg_setup
+ echo
+ elog "There are extra options on packages not yet in Gentoo:"
+ elog "AliEn, castor, Chirp, dCache, gfal, gLite, Globus,"
+ elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
+ elog "You can use the env variable EXTRA_ECONF variable for this."
+ elog "For example, for SRP, you would set: "
+ elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=/usr/$(get_libdir)\""
+ echo
+ enewgroup rootd
+ enewuser rootd -1 -1 /var/spool/rootd rootd
+
+ if use math; then
+ if use openmp; then
+ if [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
+ ewarn "You are using a gcc without OpenMP capabilities"
+ die "Need an OpenMP capable compiler"
+ else
+ export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
+ fi
+ elif use mpi; then
+ export USE_MPI=1 USE_PARALLEL_MINUIT2=1
+ fi
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-${PATCH_PV}-prop-ldflags.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV}-asneeded.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-nobyte-compile.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV}-glibc212.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV}-unuran.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-afs.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-cfitsio.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-chklib64.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-explicit-functions.patch \
+ "${FILESDIR}"/${PN}-${PATCH_PV2}-dotfont.patch
+
+ # make sure we use system libs and headers
+ rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
+ rm -rf graf2d/asimage/src/libAfterImage || die
+ rm -rf graf3d/ftgl/{inc,src} || die
+ rm -rf graf2d/freetype/src || die
+ rm -rf graf3d/glew/{inc,src} || die
+ rm -rf core/pcre/src || die
+ rm -rf math/unuran/src/unuran-*.tar.gz || die
+ LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | xargs -0 rm -f || die
+ rm -rf core/lzma/src/*.tar.gz || die
+ rm graf3d/gl/{inc,src}/gl2ps.* || die
+ sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' graf3d/gl/Module.mk || die
+
+ # In Gentoo, libPythia6 is called libpythia6
+ # libungif is called libgif,
+ # iodbc is in /usr/include/iodbc
+ # pg_config.h is checked instead of libpq-fe.h
+ sed -i \
+ -e 's:libPythia6:libpythia6:g' \
+ -e 's:ungif:gif:g' \
+ -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
+ -e 's:libpq-fe.h:pg_config.h:' \
+ configure || die "adjusting configure for Gentoo failed"
+
+ # prefixify the configure script
+ sed -i \
+ -e 's:/usr:${EPREFIX}/usr:g' \
+ configure || die "prefixify configure failed"
+
+ # QTDIR only used for qt3 in gentoo, and configure looks for it.
+ unset QTDIR
+
+ # Make html docs self-consistent for offline work (based on Fedora spec)
+ if use htmldoc; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV2}-htmldoc.patch
+ # make images local
+ sed 's!http://root.cern.ch/drupal/sites/all/themes/newsflash/images/blue/!!' \
+ -i etc/html/ROOT.css || die "htmldoc sed failed"
+ sed 's!http://root.cern.ch/drupal/sites/all/themes/newsflash/images/!!' \
+ -i etc/html/ROOT.css || die "htmldoc sed failed"
+ sed 's!http://root.cern.ch/drupal/sites/default/files/!!' \
+ -i etc/html/header.html || die "htmldoc sed failed"
+
+ cp "${DISTDIR}"/{rootdrawing-logo.png,root-banner.png,info.png} etc/html ||
+ die "htmldoc preparation failed"
+ fi
+}
+
+src_configure() {
+ # the configure script is not the standard autotools
+ ./configure \
+ --prefix="${EPREFIX}"/usr \
+ --etcdir="${EPREFIX}"/etc/root \
+ --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --tutdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tutorials \
+ --testdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tests \
+ --with-cc=$(tc-getCC) \
+ --with-cxx=$(tc-getCXX) \
+ --with-f77=$(tc-getFC) \
+ --with-ld=$(tc-getCXX) \
+ --with-afs-shared=yes \
+ --with-sys-iconpath="${EPREFIX}"/usr/share/pixmaps \
+ --disable-builtin-afterimage \
+ --disable-builtin-freetype \
+ --disable-builtin-ftgl \
+ --disable-builtin-glew \
+ --disable-builtin-pcre \
+ --disable-builtin-zlib \
+ --disable-builtin-lzma \
+ --disable-cling \
+ --enable-astiff \
+ --enable-exceptions \
+ --enable-explicitlink \
+ --enable-gdml \
+ --enable-memstat \
+ --enable-shadowpw \
+ --enable-shared \
+ --enable-soversion \
+ --enable-table \
+ --fail-on-missing \
+ $(use_enable X x11) \
+ $(use_enable X asimage) \
+ $(use_enable afs) \
+ $(use_enable avahi bonjour) \
+ $(use_enable clarens) \
+ $(use_enable clarens peac) \
+ $(use_enable fits fitsio) \
+ $(use_enable fftw fftw3) \
+ $(use_enable graphviz gviz) \
+ $(use_enable kerberos krb5) \
+ $(use_enable ldap) \
+ $(use_enable math gsl-shared) \
+ $(use_enable math genvector) \
+ $(use_enable math mathmore) \
+ $(use_enable math minuit2) \
+ $(use_enable math roofit) \
+ $(use_enable math tmva) \
+ $(use_enable math unuran) \
+ $(use_enable mysql) \
+ $(use_enable odbc) \
+ $(use_enable opengl) \
+ $(use_enable postgres pgsql) \
+ $(use_enable prefix rpath) \
+ $(use_enable pythia6) \
+ $(use_enable pythia8) \
+ $(use_enable python) \
+ $(use_enable qt4 qt) \
+ $(use_enable qt4 qtgsi) \
+ $(use_enable reflex cintex) \
+ $(use_enable reflex) \
+ $(use_enable ruby) \
+ $(use_enable ssl) \
+ $(use_enable xft) \
+ $(use_enable xml) \
+ $(use_enable xrootd) \
+ ${EXTRA_ECONF} \
+ || die "configure failed"
+}
+
+src_compile() {
+ emake OPT="${CXXFLAGS}" F77OPT="${FFLAGS}"
+ if use emacs; then
+ elisp-compile build/misc/*.el || die "elisp-compile failed"
+ fi
+}
+
+doc_install() {
+ cd "${S}"
+ if use doc; then
+ einfo "Installing user's guides"
+ dodoc "${DISTDIR}"/ROOTUsersGuide.pdf
+ use math && dodoc \
+ "${DISTDIR}"/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf \
+ "${DISTDIR}"/TMVAUsersGuide-v${TMVA_DOC_PV}.pdf
+ fi
+
+ if use examples; then
+ # these should really be taken care of by the root make install
+ insinto /usr/share/doc/${PF}/examples/tutorials/tmva
+ doins -r tmva/test
+ else
+ rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
+ fi
+}
+
+daemon_install() {
+ cd "${S}"
+ local daemons="rootd proofd"
+ dodir /var/spool/rootd
+ fowners rootd:rootd /var/spool/rootd
+ dodir /var/spool/rootd/{pub,tmp}
+ fperms 1777 /var/spool/rootd/{pub,tmp}
+
+ for i in ${daemons}; do
+ newinitd "${FILESDIR}"/${i}.initd ${i}
+ newconfd "${FILESDIR}"/${i}.confd ${i}
+ done
+ if use xinetd; then
+ insinto /etc/xinetd
+ doins etc/daemons/{rootd,proofd}.xinetd
+ fi
+}
+
+desktop_install() {
+ cd "${S}"
+ sed -e 's,@prefix@,/usr,' \
+ build/package/debian/root-system-bin.desktop.in > root.desktop
+ domenu root.desktop
+ doicon "${S}"/build/package/debian/root-system-bin.png
+
+ insinto /usr/share/icons/hicolor/48x48/mimetypes
+ doins build/package/debian/application-x-root.png
+
+ insinto /usr/share/icons/hicolor/48x48/apps
+ doicon build/package/debian/root-system-bin.xpm
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ echo "LDPATH=${EPREFIX}/usr/$(get_libdir)/root" > 99root
+ use pythia8 && echo "PYTHIA8=${EPREFIX}/usr" >> 99root
+ use python && echo "PYTHONPATH=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
+ use ruby && echo "RUBYLIB=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
+ doenvd 99root
+
+ # The build system installs Emacs support unconditionally and in the wrong
+ # directory. Remove it and call elisp-install in case of USE=emacs.
+ rm -rf "${ED}"/usr/share/emacs
+ if use emacs; then
+ elisp-install ${PN} build/misc/*.{el,elc} || die "elisp-install failed"
+ fi
+
+ doc_install
+ daemon_install
+ desktop_install
+
+ # Cleanup of files either already distributed or unused on Gentoo
+ rm "${ED}"usr/share/doc/${PF}/{INSTALL,LICENSE,COPYING.CINT} || die
+ rm "${ED}"usr/share/root/fonts/LICENSE || die
+ pushd "${ED}"usr/$(get_libdir)/root/cint/cint/lib > /dev/null
+ rm -f posix/mktypes dll_stl/setup \
+ G__* dll_stl/G__* dll_stl/rootcint_* posix/exten.o || die
+ rm -f "${ED}"usr/$(get_libdir)/root/cint/cint/include/makehpib || die
+ rm -f "${ED}"/etc/root/proof/*.sample || die
+ rm -rf "${ED}"/etc/root/daemons || die
+ popd > /dev/null
+ # these should be in PATH
+ mv "${ED}"etc/root/proof/utils/pq2/pq2* \
+ "${ED}"usr/bin/ || die
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ use python && python_mod_optimize /usr/$(get_libdir)/root
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ use python && python_mod_cleanup /usr/$(get_libdir)/root
+}
diff --git a/sci-physics/root/root-5.34.26.ebuild b/sci-physics/root/root-5.34.26.ebuild
new file mode 100644
index 000000000000..3ba947eccbb0
--- /dev/null
+++ b/sci-physics/root/root-5.34.26.ebuild
@@ -0,0 +1,453 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="http://root.cern.ch/git/root.git"
+else
+ SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit elisp-common eutils fdo-mime fortran-2 multilib python-single-r1 \
+ toolchain-funcs user versionator
+
+DESCRIPTION="C++ data analysis framework and interpreter from CERN"
+HOMEPAGE="http://root.cern.ch/"
+
+SLOT="0/$(get_version_component_range 1-3 ${PV})"
+LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
+IUSE="+X afs avahi c++11 c++14 doc emacs examples fits fftw
+ graphviz http kerberos ldap +math minimal mpi mysql odbc
+ +opengl openmp oracle postgres prefix pythia6 pythia8
+ python qt4 +reflex ruby sqlite ssl xinetd xml xrootd"
+
+# TODO: add support for: davix
+# TODO: unbundle: vdt
+
+REQUIRED_USE="
+ !X? ( !minimal? ( !opengl !qt4 ) )
+ mpi? ( math !openmp )
+ openmp? ( math !mpi )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+CDEPEND="
+ app-arch/xz-utils:0=
+ >=dev-lang/cfortran-4.4-r2
+ dev-libs/libpcre:3=
+ media-fonts/dejavu
+ media-libs/freetype:2=
+ media-libs/giflib:0=
+ media-libs/libpng:0=
+ media-libs/tiff:0=
+ sys-libs/zlib:0=
+ virtual/jpeg:0
+ virtual/shadow
+ X? (
+ media-libs/ftgl:0=
+ media-libs/glew:0=
+ x11-libs/libX11:0=
+ x11-libs/libXext:0=
+ x11-libs/libXpm:0=
+ !minimal? (
+ || (
+ media-libs/libafterimage:0=[gif,jpeg,png,tiff]
+ >=x11-wm/afterstep-2.2.11:0=[gif,jpeg,png,tiff]
+ )
+ opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps:0= )
+ qt4? (
+ dev-qt/qtgui:4=
+ dev-qt/qtopengl:4=
+ dev-qt/qt3support:4=
+ dev-qt/qtsvg:4=
+ dev-qt/qtwebkit:4=
+ dev-qt/qtxmlpatterns:4=
+ )
+ x11-libs/libXft:0=
+ )
+ )
+ !minimal? (
+ afs? ( net-fs/openafs )
+ avahi? ( net-dns/avahi:0= )
+ emacs? ( virtual/emacs )
+ fits? ( sci-libs/cfitsio:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ graphviz? ( media-gfx/graphviz:0= )
+ http? ( dev-libs/fcgi:0= )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap:0= )
+ math? (
+ sci-libs/gsl:0=
+ sci-mathematics/unuran:0=
+ mpi? ( virtual/mpi )
+ )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc:0= dev-db/unixODBC:0= ) )
+ oracle? ( dev-db/oracle-instantclient-basic:0= )
+ postgres? ( dev-db/postgresql:= )
+ pythia6? ( sci-physics/pythia:6= )
+ pythia8? ( >=sci-physics/pythia-8.1.80:8= <sci-physics/pythia-8.2.0:8= )
+ python? ( ${PYTHON_DEPS} )
+ ruby? (
+ dev-lang/ruby:=
+ dev-ruby/rubygems:=
+ )
+ sqlite? ( dev-db/sqlite:3= )
+ ssl? ( dev-libs/openssl:0= )
+ xml? ( dev-libs/libxml2:2= )
+ xrootd? ( >=net-libs/xrootd-3.3.5:0= )
+ )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RDEPEND="${CDEPEND}
+ reflex? ( dev-cpp/gccxml )
+ xinetd? ( sys-apps/xinetd )"
+
+PDEPEND="doc? ( !minimal? ( ~app-doc/root-docs-${PV}[http=,math=] ) )"
+
+S="${WORKDIR}/${PN}"
+
+# install stuff in ${P} and not ${PF} for easier tracking in root-docs
+DOC_DIR="/usr/share/doc/${P}"
+
+die_compiler() {
+ eerror "You are using a $(tc-getCXX)-$5 without C++$1 capabilities"
+ die "Need one of the following C++$1 capable compilers:\n"\
+ " >=sys-devel/gcc[cxx]-$2\n"\
+ " >=sys-devel/clang-$3\n"\
+ " >=dev-lang/icc-$4"
+}
+
+# check compiler to satisfy minimal versions
+# $1 - std version
+# $2 - g++
+# $3 - clang++
+# $4 - icc/icpc
+check_compiler() {
+ local ver
+ case "$(tc-getCXX)" in
+ *clang++*)
+ ver="$(best_version sys-devel/clang | sed 's:sys-devel/clang-::')"
+ ;;
+ *g++*)
+ ver="$(gcc-version)"
+ ;;
+ *icc*|*icpc*)
+ ver="$(best_version dev-lang/icc | sed 's:dev-lang/icc-::')"
+ ;;
+ *)
+ ewarn "You are using an unsupported compiler."
+ ewarn "Please report any issues upstream."
+ return 0
+ ;;
+ esac
+ version_is_at_least "$3" "${ver}" || die_compiler "$1" "$2" "$3" "$4" "${ver}"
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ use python && python-single-r1_pkg_setup
+ echo
+ elog "There are extra options on packages not yet in Gentoo:"
+ elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
+ elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
+ elog "You can use the env variable EXTRA_ECONF variable for this."
+ elog "For example, for SRP, you would set: "
+ elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=${EROOT%/}/usr/$(get_libdir)\""
+ echo
+
+ enewgroup rootd
+ enewuser rootd -1 -1 /var/spool/rootd rootd
+
+ use minimal && return
+
+ if use math; then
+ if use openmp; then
+ if [[ "$(tc-getCXX)" == *g++* && "$(tc-getCXX)" != *clang++* ]] && ! tc-has-openmp; then
+ ewarn "You are using a g++ without OpenMP capabilities"
+ die "Need an OpenMP capable compiler"
+ else
+ export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
+ fi
+ elif use mpi; then
+ export USE_MPI=1 USE_PARALLEL_MINUIT2=1
+ fi
+ fi
+
+ use c++11 && check_compiler "11" "4.8" "3.3" "13"
+ use c++14 && check_compiler "14" "4.9" "3.4" "15"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-5.28.00b-glibc212.patch \
+ "${FILESDIR}"/${PN}-5.32.00-afs.patch \
+ "${FILESDIR}"/${PN}-5.32.00-cfitsio.patch \
+ "${FILESDIR}"/${PN}-5.32.00-chklib64.patch \
+ "${FILESDIR}"/${PN}-5.32.00-dotfont.patch \
+ "${FILESDIR}"/${PN}-5.34.05-nobyte-compile.patch \
+ "${FILESDIR}"/${PN}-5.34.13-unuran.patch \
+ "${FILESDIR}"/${PN}-5.34.13-desktop.patch \
+ "${FILESDIR}"/${PN}-5.34.26-ldflags.patch
+
+ # make sure we use system libs and headers
+ rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
+ rm -r graf2d/asimage/src/libAfterImage || die
+ rm -r graf3d/ftgl/{inc,src} || die
+ rm -r graf2d/freetype/src || die
+ rm -r graf3d/glew/{inc,src} || die
+ rm -r core/pcre/src || die
+ rm -r math/unuran/src/unuran-*.tar.gz || die
+ LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | \
+ xargs -0 rm || die
+ rm -r core/lzma/src/*.tar.gz || die
+ rm graf3d/gl/{inc,src}/gl2ps.* || die
+ sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' \
+ graf3d/gl/Module.mk || die
+
+ # In Gentoo, libPythia6 is called libpythia6
+ # iodbc is in /usr/include/iodbc
+ # pg_config.h is checked instead of libpq-fe.h
+ sed -i \
+ -e 's:libPythia6:libpythia6:g' \
+ -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
+ -e 's:libpq-fe.h:pg_config.h:' \
+ configure || die "adjusting configure for Gentoo failed"
+
+ # prefixify the configure script
+ sed -i \
+ -e 's:/usr:${EPREFIX}/usr:g' \
+ configure || die "prefixify configure failed"
+
+ # CSS should use local images
+ sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
+
+ # fix reflex path (bug #497280)
+ sed -i -e 's|${ROOTSYS}/lib|@libdir@|' config/genreflex.in || die
+
+ # QTDIR only used for qt3 in gentoo, and configure looks for it.
+ unset QTDIR
+}
+
+src_configure() {
+ local -a myconf
+ # Some compilers need special care
+ case "$(tc-getCXX)" in
+ *clang++*)
+ myconf=(
+ --with-clang
+ --with-f77="$(tc-getFC)"
+ )
+ ;;
+ *icc*|*icpc*)
+ # For icc we need to provide architecture manually
+ # and not to tamper with tc-get*
+ use x86 && myconf=( linuxicc )
+ use amd64 && myconf=( linuxx8664icc )
+ ;;
+ *) # gcc goes here too
+ myconf=(
+ --with-cc="$(tc-getCC)"
+ --with-cxx="$(tc-getCXX)"
+ --with-f77="$(tc-getFC)"
+ --with-ld="$(tc-getCXX)"
+ )
+ ;;
+ esac
+
+ # the configure script is not the standard autotools
+ myconf+=(
+ --prefix="${EPREFIX}/usr"
+ --etcdir="${EPREFIX}/etc/root"
+ --libdir="${EPREFIX}/usr/$(get_libdir)/${PN}"
+ --docdir="${EPREFIX}${DOC_DIR}"
+ --tutdir="${EPREFIX}${DOC_DIR}/examples/tutorials"
+ --testdir="${EPREFIX}${DOC_DIR}/examples/tests"
+ --disable-werror
+ --nohowto
+ --cflags='${CFLAGS}'
+ --cxxflags='${CXXFLAGS}'
+ )
+
+ if use minimal; then
+ myconf+=( $(usex X --gminimal --minimal) )
+ else
+ myconf+=(
+ --with-afs-shared=yes
+ --with-sys-iconpath="${EPREFIX}/usr/share/pixmaps"
+ --disable-builtin-afterimage
+ --disable-builtin-ftgl
+ --disable-builtin-freetype
+ --disable-builtin-glew
+ --disable-builtin-pcre
+ --disable-builtin-zlib
+ --disable-builtin-lzma
+ --disable-cling
+ --enable-astiff
+ --enable-explicitlink
+ --enable-gdml
+ --enable-memstat
+ --enable-shadowpw
+ --enable-shared
+ --enable-soversion
+ --enable-table
+ --fail-on-missing
+ $(use_enable X x11)
+ $(use_enable X asimage)
+ $(use_enable X xft)
+ $(use_enable afs)
+ $(use_enable avahi bonjour)
+ $(use_enable c++11 cxx11)
+ $(use_enable c++14 cxx14)
+ $(use_enable fits fitsio)
+ $(use_enable fftw fftw3)
+ $(use_enable graphviz gviz)
+ $(use_enable http)
+ $(use_enable kerberos krb5)
+ $(use_enable ldap)
+ $(use_enable math gsl-shared)
+ $(use_enable math genvector)
+ $(use_enable math mathmore)
+ $(use_enable math minuit2)
+ $(use_enable math roofit)
+ $(use_enable math tmva)
+ $(use_enable math unuran)
+ $(use_enable mysql)
+ $(usex mysql "--with-mysql-incdir=${EPREFIX}/usr/include/mysql" "")
+ $(use_enable odbc)
+ $(use_enable opengl)
+ $(use_enable oracle)
+ $(use_enable postgres pgsql)
+ $(use_enable prefix rpath)
+ $(use_enable pythia6)
+ $(use_enable pythia8)
+ $(use_enable python)
+ $(use_enable qt4 qt)
+ $(use_enable qt4 qtgsi)
+ $(use_enable reflex cintex)
+ $(use_enable reflex)
+ $(use_enable ruby)
+ $(use_enable sqlite)
+ $(use_enable ssl)
+ $(use_enable xml)
+ $(use_enable xrootd)
+ ${EXTRA_ECONF}
+ )
+ fi
+
+ # usex can't be used here, because pg_config may be not
+ # installed with USE="-postgres"
+ use postgres && myconf+=( --with-pgsql-incdir=$(pg_config --includedir) )
+
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake \
+ OPT="${CXXFLAGS}" \
+ F77OPT="${FFLAGS}" \
+ ROOTSYS="${S}" \
+ LD_LIBRARY_PATH="${S}/lib"
+ use emacs && ! use minimal && elisp-compile build/misc/*.el
+}
+
+daemon_install() {
+ local daemons="rootd proofd"
+ dodir /var/spool/rootd
+ fowners rootd:rootd /var/spool/rootd
+ dodir /var/spool/rootd/{pub,tmp}
+ fperms 1777 /var/spool/rootd/{pub,tmp}
+
+ local i
+ for i in ${daemons}; do
+ newinitd "${FILESDIR}"/${i}.initd ${i}
+ newconfd "${FILESDIR}"/${i}.confd ${i}
+ done
+ if use xinetd; then
+ insinto /etc/xinetd
+ doins "${S}"/etc/daemons/{rootd,proofd}.xinetd
+ fi
+}
+
+desktop_install() {
+ cd "${S}"
+ echo "Icon=root-system-bin" >> etc/root.desktop
+ domenu etc/root.desktop
+ doicon build/package/debian/root-system-bin.png
+
+ insinto /usr/share/icons/hicolor/48x48/mimetypes
+ doins build/package/debian/application-x-root.png
+
+ insinto /usr/share/icons/hicolor/48x48/apps
+ doicon build/package/debian/root-system-bin.xpm
+}
+
+cleanup_install() {
+ # Cleanup of files either already distributed or unused on Gentoo
+ pushd "${ED}" > /dev/null
+ rm usr/share/root/fonts/LICENSE || die
+ rm etc/root/proof/*.sample || die
+ rm -r etc/root/daemons || die
+ # these should be in PATH
+ mv etc/root/proof/utils/pq2/pq2* usr/bin/ || die
+ rm ${DOC_DIR#/}/{INSTALL,LICENSE,COPYING.CINT} || die
+ use examples || rm -r ${DOC_DIR#/}/examples || die
+ cd usr/$(get_libdir)/root/cint/cint
+ rm lib/posix/mktypes lib/dll_stl/setup lib/G__* || die
+ rm lib/dll_stl/G__* lib/dll_stl/rootcint_* lib/posix/exten.o || die
+ rm include/makehpib || die
+ popd > /dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ echo "LDPATH=${EPREFIX%/}/usr/$(get_libdir)/root" > 99root
+
+ if ! use minimal; then
+ use pythia8 && echo "PYTHIA8=${EPREFIX%/}/usr" >> 99root
+ if use python; then
+ echo "PYTHONPATH=${EPREFIX%/}/usr/$(get_libdir)/root" >> 99root
+ python_optimize "${D}/usr/$(get_libdir)/root"
+ use reflex && python_optimize "${D}/usr/$(get_libdir)/root/python/genreflex/"
+ fi
+ use ruby && \
+ echo "RUBYLIB=${EPREFIX%/}/usr/$(get_libdir)/root" >> 99root
+ use emacs && elisp-install ${PN} build/misc/*.{el,elc}
+ if use examples; then
+ # these should really be taken care of by the root make install
+ insinto ${DOC_DIR}/examples/tutorials/tmva
+ doins -r tmva/test
+ fi
+ fi
+ doenvd 99root
+
+ # The build system installs Emacs support unconditionally in the wrong
+ # directory. Remove it and call elisp-install in case of USE=emacs.
+ rm -r "${ED}"/usr/share/emacs || die
+
+ daemon_install
+ desktop_install
+ cleanup_install
+
+ # do not copress files used by ROOT's CLI (.credit, .demo, .license)
+ docompress -x "${DOC_DIR}"/{CREDITS,examples/tutorials}
+ # needed for .license command to work
+ dosym "${ED}"usr/portage/licenses/LGPL-2.1 "${DOC_DIR}/LICENSE"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-physics/root/root-5.34.32.ebuild b/sci-physics/root/root-5.34.32.ebuild
new file mode 100644
index 000000000000..915e7123c314
--- /dev/null
+++ b/sci-physics/root/root-5.34.32.ebuild
@@ -0,0 +1,437 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="http://root.cern.ch/git/root.git"
+else
+ SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit elisp-common eutils fdo-mime fortran-2 multilib python-single-r1 \
+ toolchain-funcs user versionator
+
+DESCRIPTION="C++ data analysis framework and interpreter from CERN"
+HOMEPAGE="http://root.cern.ch/"
+
+SLOT="0/$(get_version_component_range 1-3 ${PV})"
+LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
+IUSE="+X afs avahi c++11 c++14 doc emacs examples fits fftw gdml
+ graphviz http kerberos ldap +math +memstat mpi mysql odbc
+ +opengl openmp oracle postgres prefix pythia6 pythia8
+ python qt4 +reflex ruby shadow sqlite ssl table +tiff xinetd xml xrootd"
+
+# TODO: add support for: davix
+# TODO: unbundle: vdt
+
+REQUIRED_USE="
+ !X? ( !opengl !qt4 !tiff )
+ mpi? ( math !openmp )
+ openmp? ( math !mpi )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+CDEPEND="
+ app-arch/xz-utils:0=
+ >=dev-lang/cfortran-4.4-r2
+ dev-libs/libpcre:3=
+ media-fonts/dejavu
+ media-libs/freetype:2=
+ media-libs/libpng:0=
+ sys-libs/zlib:0=
+ X? (
+ media-libs/ftgl:0=
+ media-libs/glew:0=
+ x11-libs/libX11:0=
+ x11-libs/libXext:0=
+ x11-libs/libXpm:0=
+ || (
+ media-libs/libafterimage:0=[gif,jpeg,png,tiff?]
+ >=x11-wm/afterstep-2.2.11:0=[gif,jpeg,png,tiff?]
+ )
+ opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps:0= )
+ qt4? (
+ dev-qt/qtgui:4=
+ dev-qt/qtopengl:4=
+ dev-qt/qt3support:4=
+ dev-qt/qtsvg:4=
+ dev-qt/qtwebkit:4=
+ dev-qt/qtxmlpatterns:4=
+ )
+ x11-libs/libXft:0=
+ )
+ afs? ( net-fs/openafs )
+ avahi? ( net-dns/avahi:0= )
+ emacs? ( virtual/emacs )
+ fits? ( sci-libs/cfitsio:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ graphviz? ( media-gfx/graphviz:0= )
+ http? ( dev-libs/fcgi:0= )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap:0= )
+ math? (
+ sci-libs/gsl:0=
+ sci-mathematics/unuran:0=
+ mpi? ( virtual/mpi )
+ )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc:0= dev-db/unixODBC:0= ) )
+ oracle? ( dev-db/oracle-instantclient-basic:0= )
+ postgres? ( dev-db/postgresql:= )
+ pythia6? ( sci-physics/pythia:6= )
+ pythia8? ( >=sci-physics/pythia-8.1.80:8= <sci-physics/pythia-8.2.0:8= )
+ python? ( ${PYTHON_DEPS} )
+ ruby? (
+ dev-lang/ruby:=
+ dev-ruby/rubygems:=
+ )
+ shadow? ( virtual/shadow )
+ sqlite? ( dev-db/sqlite:3= )
+ ssl? ( dev-libs/openssl:0= )
+ xml? ( dev-libs/libxml2:2= )
+ xrootd? ( >=net-libs/xrootd-3.3.5:0= )
+"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RDEPEND="${CDEPEND}
+ reflex? ( dev-cpp/gccxml )
+ xinetd? ( sys-apps/xinetd )"
+
+PDEPEND="doc? ( ~app-doc/root-docs-${PV}[http=,math=] )"
+
+S="${WORKDIR}/${PN}"
+
+# install stuff in ${P} and not ${PF} for easier tracking in root-docs
+DOC_DIR="/usr/share/doc/${P}"
+
+die_compiler() {
+ eerror "You are using a $(tc-getCXX)-$5 without C++$1 capabilities"
+ die "Need one of the following C++$1 capable compilers:\n"\
+ " >=sys-devel/gcc[cxx]-$2\n"\
+ " >=sys-devel/clang-$3\n"\
+ " >=dev-lang/icc-$4"
+}
+
+# check compiler to satisfy minimal versions
+# $1 - std version
+# $2 - g++
+# $3 - clang++
+# $4 - icc/icpc
+check_compiler() {
+ local ver
+ case "$(tc-getCXX)" in
+ *clang++*)
+ ver="$(best_version sys-devel/clang | sed 's:sys-devel/clang-::')"
+ ;;
+ *g++*)
+ ver="$(gcc-version)"
+ ;;
+ *icc*|*icpc*)
+ ver="$(best_version dev-lang/icc | sed 's:dev-lang/icc-::')"
+ ;;
+ *)
+ ewarn "You are using an unsupported compiler."
+ ewarn "Please report any issues upstream."
+ return 0
+ ;;
+ esac
+ version_is_at_least "$3" "${ver}" || die_compiler "$1" "$2" "$3" "$4" "${ver}"
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ use python && python-single-r1_pkg_setup
+ echo
+ elog "There are extra options on packages not yet in Gentoo:"
+ elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
+ elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
+ elog "You can use the env variable EXTRA_ECONF variable for this."
+ elog "For example, for SRP, you would set: "
+ elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=${EROOT%/}/usr/$(get_libdir)\""
+ echo
+
+ enewgroup rootd
+ enewuser rootd -1 -1 /var/spool/rootd rootd
+
+ if use math; then
+ if use openmp; then
+ if [[ "$(tc-getCXX)" == *g++* && "$(tc-getCXX)" != *clang++* ]] && ! tc-has-openmp; then
+ ewarn "You are using a g++ without OpenMP capabilities"
+ die "Need an OpenMP capable compiler"
+ else
+ export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
+ fi
+ elif use mpi; then
+ export USE_MPI=1 USE_PARALLEL_MINUIT2=1
+ fi
+ fi
+
+ use c++11 && check_compiler "11" "4.8" "3.3" "13"
+ use c++14 && check_compiler "14" "4.9" "3.4" "15"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-5.28.00b-glibc212.patch \
+ "${FILESDIR}"/${PN}-5.32.00-afs.patch \
+ "${FILESDIR}"/${PN}-5.32.00-cfitsio.patch \
+ "${FILESDIR}"/${PN}-5.32.00-chklib64.patch \
+ "${FILESDIR}"/${PN}-5.32.00-dotfont.patch \
+ "${FILESDIR}"/${PN}-5.34.05-nobyte-compile.patch \
+ "${FILESDIR}"/${PN}-5.34.13-unuran.patch \
+ "${FILESDIR}"/${PN}-5.34.26-ldflags.patch
+
+ # make sure we use system libs and headers
+ rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
+ rm -r graf2d/asimage/src/libAfterImage || die
+ rm -r graf3d/ftgl/{inc,src} || die
+ rm -r graf2d/freetype/src || die
+ rm -r graf3d/glew/{inc,src} || die
+ rm -r core/pcre/src || die
+ rm -r math/unuran/src/unuran-*.tar.gz || die
+ LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | \
+ xargs -0 rm || die
+ rm -r core/lzma/src/*.tar.gz || die
+ rm graf3d/gl/{inc,src}/gl2ps.* || die
+ sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' \
+ graf3d/gl/Module.mk || die
+
+ # In Gentoo, libPythia6 is called libpythia6
+ # iodbc is in /usr/include/iodbc
+ # pg_config.h is checked instead of libpq-fe.h
+ sed -i \
+ -e 's:libPythia6:libpythia6:g' \
+ -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
+ -e 's:libpq-fe.h:pg_config.h:' \
+ configure || die "adjusting configure for Gentoo failed"
+
+ # prefixify the configure script
+ sed -i \
+ -e 's:/usr:${EPREFIX}/usr:g' \
+ configure || die "prefixify configure failed"
+
+ # CSS should use local images
+ sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
+
+ # fix reflex path (bug #497280)
+ sed -i -e 's|${ROOTSYS}/lib|@libdir@|' config/genreflex.in || die
+
+ # QTDIR only used for qt3 in gentoo, and configure looks for it.
+ unset QTDIR
+}
+
+src_configure() {
+ local -a myconf
+ # Some compilers need special care
+ case "$(tc-getCXX)" in
+ *clang++*)
+ myconf=(
+ --with-clang
+ --with-f77="$(tc-getFC)"
+ )
+ ;;
+ *icc*|*icpc*)
+ # For icc we need to provide architecture manually
+ # and not to tamper with tc-get*
+ use x86 && myconf=( linuxicc )
+ use amd64 && myconf=( linuxx8664icc )
+ ;;
+ *) # gcc goes here too
+ myconf=(
+ --with-cc="$(tc-getCC)"
+ --with-cxx="$(tc-getCXX)"
+ --with-f77="$(tc-getFC)"
+ --with-ld="$(tc-getCXX)"
+ )
+ ;;
+ esac
+
+ # the configure script is not the standard autotools
+ myconf+=(
+ --prefix="${EPREFIX}/usr"
+ --etcdir="${EPREFIX}/etc/root"
+ --libdir="${EPREFIX}/usr/$(get_libdir)/${PN}"
+ --docdir="${EPREFIX}${DOC_DIR}"
+ --tutdir="${EPREFIX}${DOC_DIR}/examples/tutorials"
+ --testdir="${EPREFIX}${DOC_DIR}/examples/tests"
+ --cflags='${CFLAGS}'
+ --cxxflags='${CXXFLAGS}'
+ --disable-builtin-afterimage
+ --disable-builtin-ftgl
+ --disable-builtin-freetype
+ --disable-builtin-glew
+ --disable-builtin-lzma
+ --disable-builtin-pcre
+ --disable-builtin-zlib
+ --disable-cling
+ --disable-werror
+ --enable-explicitlink
+ --enable-shared
+ --enable-soversion
+ --fail-on-missing
+ --nohowto
+ --with-afs-shared=yes
+ --with-sys-iconpath="${EPREFIX}/usr/share/pixmaps"
+ $(use_enable X x11)
+ $(use_enable X asimage)
+ $(use_enable X xft)
+ $(use_enable afs)
+ $(use_enable avahi bonjour)
+ $(use_enable c++11 cxx11)
+ $(use_enable c++14 cxx14)
+ $(use_enable fits fitsio)
+ $(use_enable fftw fftw3)
+ $(use_enable gdml)
+ $(use_enable graphviz gviz)
+ $(use_enable http)
+ $(use_enable kerberos krb5)
+ $(use_enable ldap)
+ $(use_enable math genvector)
+ $(use_enable math gsl-shared)
+ $(use_enable math mathmore)
+ $(use_enable math minuit2)
+ $(use_enable math roofit)
+ $(use_enable math tmva)
+ $(use_enable math vc)
+ $(use_enable math vdt)
+ $(use_enable math unuran)
+ $(use_enable memstat)
+ $(use_enable mysql)
+ $(usex mysql "--with-mysql-incdir=${EPREFIX}/usr/include/mysql" "")
+ $(use_enable odbc)
+ $(use_enable opengl)
+ $(use_enable oracle)
+ $(use_enable postgres pgsql)
+ $(use_enable prefix rpath)
+ $(use_enable pythia6)
+ $(use_enable pythia8)
+ $(use_enable python)
+ $(use_enable qt4 qt)
+ $(use_enable qt4 qtgsi)
+ $(use_enable reflex cintex)
+ $(use_enable reflex)
+ $(use_enable ruby)
+ $(use_enable shadow shadowpw)
+ $(use_enable sqlite)
+ $(use_enable ssl)
+ $(use_enable table)
+ $(use_enable tiff astiff)
+ $(use_enable xml)
+ $(use_enable xrootd)
+ ${EXTRA_ECONF}
+ )
+
+ # usex can't be used here, because pg_config may be not
+ # installed with USE="-postgres"
+ use postgres && myconf+=( --with-pgsql-incdir=$(pg_config --includedir) )
+
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake \
+ OPT="${CXXFLAGS}" \
+ F77OPT="${FFLAGS}" \
+ ROOTSYS="${S}" \
+ LD_LIBRARY_PATH="${S}/lib"
+ use emacs && elisp-compile build/misc/*.el
+}
+
+daemon_install() {
+ local daemons="rootd proofd"
+ dodir /var/spool/rootd
+ fowners rootd:rootd /var/spool/rootd
+ dodir /var/spool/rootd/{pub,tmp}
+ fperms 1777 /var/spool/rootd/{pub,tmp}
+
+ local i
+ for i in ${daemons}; do
+ newinitd "${FILESDIR}"/${i}.initd ${i}
+ newconfd "${FILESDIR}"/${i}.confd ${i}
+ done
+ if use xinetd; then
+ insinto /etc/xinetd
+ doins "${S}"/etc/daemons/{rootd,proofd}.xinetd
+ fi
+}
+
+desktop_install() {
+ cd "${S}"
+ echo "Icon=root-system-bin" >> etc/root.desktop
+ domenu etc/root.desktop
+ doicon build/package/debian/root-system-bin.png
+
+ insinto /usr/share/icons/hicolor/48x48/mimetypes
+ doins build/package/debian/application-x-root.png
+
+ insinto /usr/share/icons/hicolor/48x48/apps
+ doicon build/package/debian/root-system-bin.xpm
+}
+
+cleanup_install() {
+ # Cleanup of files either already distributed or unused on Gentoo
+ pushd "${ED}" > /dev/null
+ rm usr/share/root/fonts/LICENSE || die
+ rm etc/root/proof/*.sample || die
+ rm -r etc/root/daemons || die
+ # these should be in PATH
+ mv etc/root/proof/utils/pq2/pq2* usr/bin/ || die
+ rm ${DOC_DIR#/}/{INSTALL,LICENSE,COPYING.CINT} || die
+ use examples || rm -r ${DOC_DIR#/}/examples || die
+ cd usr/$(get_libdir)/root/cint/cint
+ rm lib/posix/mktypes lib/dll_stl/setup lib/G__* || die
+ rm lib/dll_stl/G__* lib/dll_stl/rootcint_* lib/posix/exten.o || die
+ rm include/makehpib || die
+ popd > /dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ echo "LDPATH=${EPREFIX%/}/usr/$(get_libdir)/root" > 99root
+
+ use pythia8 && echo "PYTHIA8=${EPREFIX%/}/usr" >> 99root
+ if use python; then
+ echo "PYTHONPATH=${EPREFIX%/}/usr/$(get_libdir)/root" >> 99root
+ python_optimize "${D}/usr/$(get_libdir)/root"
+ use reflex && python_optimize "${D}/usr/$(get_libdir)/root/python/genreflex/"
+ fi
+ use ruby && \
+ echo "RUBYLIB=${EPREFIX%/}/usr/$(get_libdir)/root" >> 99root
+ use emacs && elisp-install ${PN} build/misc/*.{el,elc}
+ if use examples; then
+ # these should really be taken care of by the root make install
+ insinto ${DOC_DIR}/examples/tutorials/tmva
+ doins -r tmva/test
+ fi
+ doenvd 99root
+
+ # The build system installs Emacs support unconditionally in the wrong
+ # directory. Remove it and call elisp-install in case of USE=emacs.
+ rm -r "${ED}"/usr/share/emacs || die
+
+ daemon_install
+ desktop_install
+ cleanup_install
+
+ # do not copress files used by ROOT's CLI (.credit, .demo, .license)
+ docompress -x "${DOC_DIR}"/{CREDITS,examples/tutorials}
+ # needed for .license command to work
+ dosym "${ED}"usr/portage/licenses/LGPL-2.1 "${DOC_DIR}/LICENSE"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-physics/root/root-6.02.05-r2.ebuild b/sci-physics/root/root-6.02.05-r2.ebuild
new file mode 100644
index 000000000000..03f0835c3ad6
--- /dev/null
+++ b/sci-physics/root/root-6.02.05-r2.ebuild
@@ -0,0 +1,486 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="http://root.cern.ch/git/root.git"
+else
+ SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit elisp-common eutils fdo-mime fortran-2 multilib python-single-r1 \
+ toolchain-funcs user versionator
+
+DESCRIPTION="C++ data analysis framework and interpreter from CERN"
+HOMEPAGE="http://root.cern.ch/"
+DOC_URI="ftp://root.cern.ch/${PN}/doc"
+
+SLOT="0/$(get_version_component_range 1-3 ${PV})"
+LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
+IUSE="+X afs avahi doc emacs examples fits fftw gdml geocad
+ graphviz http kerberos ldap +math +memstat mpi mysql odbc
+ +opengl openmp oracle postgres prefix pythia6 pythia8
+ python qt4 shadow sqlite ssl table +tiff xinetd xml xrootd"
+
+# TODO: add support for: davix
+# TODO: ROOT-6 supports x32 ABI, but half of its dependencies doesn't
+# TODO: unbundle: cling, vdt
+
+REQUIRED_USE="
+ !X? ( !opengl !qt4 !tiff )
+ mpi? ( math !openmp )
+ openmp? ( math !mpi )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+CDEPEND="
+ app-arch/xz-utils:0=
+ >=dev-lang/cfortran-4.4-r2
+ dev-libs/libpcre:3=
+ media-fonts/dejavu
+ media-libs/freetype:2=
+ media-libs/libpng:0=
+ >=sys-devel/clang-3.4:=
+ sys-libs/zlib:0=
+ X? (
+ media-libs/ftgl:0=
+ media-libs/glew:0=
+ x11-libs/libX11:0=
+ x11-libs/libXext:0=
+ x11-libs/libXpm:0=
+ || (
+ media-libs/libafterimage:0=[gif,jpeg,png,tiff?]
+ >=x11-wm/afterstep-2.2.11:0=[gif,jpeg,png,tiff?]
+ )
+ opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps:0= )
+ qt4? (
+ dev-qt/qtgui:4=
+ dev-qt/qtopengl:4=
+ dev-qt/qt3support:4=
+ dev-qt/qtsvg:4=
+ dev-qt/qtwebkit:4=
+ dev-qt/qtxmlpatterns:4=
+ )
+ x11-libs/libXft:0=
+ )
+ afs? ( net-fs/openafs )
+ avahi? ( net-dns/avahi:0= )
+ emacs? ( virtual/emacs )
+ fits? ( sci-libs/cfitsio:0= )
+ fftw? ( sci-libs/fftw:3.0= )
+ geocad? ( <sci-libs/opencascade-6.8.0:= )
+ graphviz? ( media-gfx/graphviz:0= )
+ http? ( dev-libs/fcgi:0= )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap:0= )
+ math? (
+ sci-libs/gsl:0=
+ sci-mathematics/unuran:0=
+ mpi? ( virtual/mpi )
+ )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc:0= dev-db/unixODBC:0= ) )
+ oracle? ( dev-db/oracle-instantclient-basic:0= )
+ postgres? ( dev-db/postgresql:= )
+ pythia6? ( sci-physics/pythia:6= )
+ pythia8? ( >=sci-physics/pythia-8.1.80:8= )
+ python? ( ${PYTHON_DEPS} )
+ shadow? ( virtual/shadow )
+ sqlite? ( dev-db/sqlite:3= )
+ ssl? ( dev-libs/openssl:0= )
+ xml? ( dev-libs/libxml2:2= )
+ xrootd? ( >=net-libs/xrootd-3.3.5:0= )
+"
+
+# TODO: ruby is not yet ported to ROOT-6, reenable when (if?) ready
+# ruby? (
+# dev-lang/ruby:=
+# dev-ruby/rubygems:=
+# )
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RDEPEND="${CDEPEND}
+ xinetd? ( sys-apps/xinetd )"
+
+PDEPEND="doc? ( ~app-doc/root-docs-${PV}[http=,math=] )"
+
+# install stuff in ${P} and not ${PF} for easier tracking in root-docs
+DOC_DIR="/usr/share/doc/${P}"
+
+OC_UNSUPPORTED="6.8.0"
+
+die_compiler() {
+ eerror "You are using a $(tc-getCXX)-$5 without C++$1 capabilities"
+ die "Need one of the following C++$1 capable compilers:\n"\
+ " >=sys-devel/gcc[cxx]-$2\n"\
+ " >=sys-devel/clang-$3\n"\
+ " >=dev-lang/icc-$4"
+}
+
+# check compiler to satisfy minimal versions
+# $1 - std version
+# $2 - g++
+# $3 - clang++
+# $4 - icc/icpc
+check_compiler() {
+ local ver
+ case "$(tc-getCXX)" in
+ *clang++*)
+ ver="$(best_version sys-devel/clang | sed 's:sys-devel/clang-::')"
+ ;;
+ *g++*)
+ ver="$(gcc-version)"
+ ;;
+ *icc*|*icpc*)
+ ver="$(best_version dev-lang/icc | sed 's:dev-lang/icc-::')"
+ eerror "ROOT-6 is known not to build with ICC."
+ eerror "Please report any isuses upstream."
+ ;;
+ *)
+ ewarn "You are using an unsupported compiler."
+ ewarn "Please report any issues upstream."
+ return 0
+ ;;
+ esac
+ version_is_at_least "$3" "${ver}" || die_compiler "$1" "$2" "$3" "$4" "${ver}"
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ use python && python-single-r1_pkg_setup
+ echo
+ elog "There are extra options on packages not yet in Gentoo:"
+ elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
+ elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
+ elog "You can use the env variable EXTRA_ECONF variable for this."
+ elog "For example, for SRP, you would set: "
+ elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=${EROOT%/}/usr/$(get_libdir)\""
+ echo
+
+ enewgroup rootd
+ enewuser rootd -1 -1 /var/spool/rootd rootd
+
+ if use math; then
+ if use openmp; then
+ if [[ "$(tc-getCXX)" == *g++* && "$(tc-getCXX)" != *clang++* ]] && ! tc-has-openmp; then
+ ewarn "You are using a g++ without OpenMP capabilities"
+ die "Need an OpenMP capable compiler"
+ else
+ export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
+ fi
+ elif use mpi; then
+ export USE_MPI=1 USE_PARALLEL_MINUIT2=1
+ fi
+ fi
+
+ # c++11 support is mandatory
+ check_compiler "11" "4.8" "3.4" "13"
+
+ # Active version of opencascade may be >= $OC_UNSUPPORTED,
+ # so we need to eselect proper version (it must exist due to DEPEND requirement)
+ if use geocad; then
+ oc_current=$(eselect opencascade show)
+ # Proceed only if active version is unsupported
+ if version_is_at_least "${OC_UNSUPPORTED}" "${oc_current}"; then
+ local -a vlist
+ vlist=( $(version_sort $(eselect opencascade list | awk '/^ / { print $2 }')) )
+ local i
+ # search for higehr version < $OC_UNSUPPORTED
+ # list is sorted acsending, so loop backwards
+ for (( i=$(( ${#vlist[@]} -1 )); i>=0; i-- )); do
+ version_is_at_least "${OC_UNSUPPORTED}" "${vlist[i]}" || break
+ done
+ [[ $i == "-1" ]] && die "No suitable opencascade eselect slot is available (<${OC_UNSUPPORTED})"
+
+ einfo "Switching opencascade to supported slot: ${oc_current} -> ${vlist[i]}"
+ eselect opencascade set ${vlist[i]} > /dev/null || die "eselect opencascade set ${vlist[i]} failed!"
+ else
+ # forget it, effectively disabling eselect cleanup
+ unset oc_current
+ fi
+ fi
+}
+
+src_prepare() {
+ # Second version of makepch is required in order to generate
+ # PCH file appropriate for Gentoo include headers layout.
+ # This can be done only at install stage, when files are placed
+ # as appropriate. Premature modification of makepch.sh will
+ # broke build process, however.
+ #cp "etc/dictpch/makepch.sh" "etc/dictpch/makepch-gentoo.sh" || die
+
+ epatch \
+ "${FILESDIR}"/${PN}-5.28.00b-glibc212.patch \
+ "${FILESDIR}"/${PN}-5.32.00-afs.patch \
+ "${FILESDIR}"/${PN}-5.32.00-cfitsio.patch \
+ "${FILESDIR}"/${PN}-5.32.00-chklib64.patch \
+ "${FILESDIR}"/${PN}-5.34.13-desktop.patch \
+ "${FILESDIR}"/${PN}-5.34.13-unuran.patch \
+ "${FILESDIR}"/${PN}-6.00.01-dotfont.patch \
+ "${FILESDIR}"/${PN}-6.00.01-geocad.patch \
+ "${FILESDIR}"/${PN}-6.00.01-llvm.patch \
+ "${FILESDIR}"/${PN}-6.00.01-nobyte-compile.patch \
+ "${FILESDIR}"/${PN}-6.00.01-prop-flags.patch \
+ "${FILESDIR}"/${PN}-6.02.05-xrootd4.patch
+ #"${FILESDIR}"/${PN}-6.02.05-dictpch.patch \
+
+ # make sure we use system libs and headers
+ rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
+ rm -r graf2d/asimage/src/libAfterImage || die
+ rm -r graf3d/ftgl/{inc,src} || die
+ rm -r graf2d/freetype/src || die
+ rm -r graf3d/glew/{inc,src} || die
+ rm -r core/pcre/src || die
+ rm -r math/unuran/src/unuran-*.tar.gz || die
+ LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | \
+ xargs -0 rm || die
+ rm -r core/lzma/src/*.tar.gz || die
+ rm graf3d/gl/{inc,src}/gl2ps.* || die
+ sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' \
+ graf3d/gl/Module.mk || die
+
+ # In Gentoo, libPythia6 is called libpythia6
+ # iodbc is in /usr/include/iodbc
+ # pg_config.h is checked instead of libpq-fe.h
+ sed -i \
+ -e 's:libPythia6:libpythia6:g' \
+ -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
+ -e 's:libpq-fe.h:pg_config.h:' \
+ configure || die "adjusting configure for Gentoo failed"
+
+ # prefixify the configure script
+ sed -i \
+ -e 's:/usr:${EPREFIX}/usr:g' \
+ configure || die "prefixify configure failed"
+
+ # CSS should use local images
+ sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
+
+ # QTDIR only used for qt3 in gentoo, and configure looks for it.
+ unset QTDIR
+}
+
+# NB: ROOT uses bundled LLVM, because it is patched and API-incompatible with
+# system LLVM.
+# NB: As of 6.00.0.1 cmake is not ready as it can't fully replace configure,
+# e.g. for afs and geocad.
+
+src_configure() {
+ local -a myconf
+ # Some compilers need special care
+ case "$(tc-getCXX)" in
+ *clang++*)
+ myconf=(
+ --with-clang
+ --with-f77="$(tc-getFC)"
+ )
+ ;;
+ *icc*|*icpc*)
+ # For icc we need to provide architecture manually
+ # and not to tamper with tc-get*
+ use x86 && myconf=( linuxicc )
+ use amd64 && myconf=( linuxx8664icc )
+ ;;
+ *) # gcc goes here too
+ myconf=(
+ --with-cc="$(tc-getCC)"
+ --with-cxx="$(tc-getCXX)"
+ --with-f77="$(tc-getFC)"
+ --with-ld="$(tc-getCXX)"
+ )
+ ;;
+ esac
+
+ # the configure script is not the standard autotools
+ myconf+=(
+ --prefix="${EPREFIX}/usr"
+ --etcdir="${EPREFIX}/etc/root"
+ --libdir="${EPREFIX}/usr/$(get_libdir)/${PN}"
+ --docdir="${EPREFIX}${DOC_DIR}"
+ --tutdir="${EPREFIX}${DOC_DIR}/examples/tutorials"
+ --testdir="${EPREFIX}${DOC_DIR}/examples/tests"
+ --disable-builtin-afterimage
+ --disable-builtin-ftgl
+ --disable-builtin-freetype
+ --disable-builtin-glew
+ --disable-builtin-lzma
+ --disable-builtin-pcre
+ --disable-builtin-zlib
+ --disable-werror
+ --enable-explicitlink
+ --enable-shared
+ --enable-soversion
+ --fail-on-missing
+ --nohowto
+ --with-afs-shared=yes
+ --with-sys-iconpath="${EPREFIX}/usr/share/pixmaps"
+ $(use_enable X x11)
+ $(use_enable X asimage)
+ $(use_enable X xft)
+ $(use_enable afs)
+ $(use_enable avahi bonjour)
+ $(use_enable fits fitsio)
+ $(use_enable fftw fftw3)
+ $(use_enable gdml)
+ $(use_enable geocad)
+ $(use_enable graphviz gviz)
+ $(use_enable http)
+ $(use_enable kerberos krb5)
+ $(use_enable ldap)
+ $(use_enable math genvector)
+ $(use_enable math gsl-shared)
+ $(use_enable math mathmore)
+ $(use_enable math minuit2)
+ $(use_enable math roofit)
+ $(use_enable math tmva)
+ $(use_enable math vc)
+ $(use_enable math vdt)
+ $(use_enable math unuran)
+ $(use_enable memstat)
+ $(use_enable mysql)
+ $(usex mysql "--with-mysql-incdir=${EPREFIX}/usr/include/mysql" "")
+ $(use_enable odbc)
+ $(use_enable opengl)
+ $(use_enable oracle)
+ $(use_enable postgres pgsql)
+ $(use_enable prefix rpath)
+ $(use_enable pythia6)
+ $(use_enable pythia8)
+ $(use_enable python)
+ $(use_enable qt4 qt)
+ $(use_enable qt4 qtgsi)
+ $(use_enable shadow shadowpw)
+ $(use_enable sqlite)
+ $(use_enable ssl)
+ $(use_enable table)
+ $(use_enable tiff astiff)
+ $(use_enable xml)
+ $(use_enable xrootd)
+ ${EXTRA_ECONF}
+ )
+
+ # usex can't be used here, because pg_config may be not
+ # installed with USE="-postgres"
+ use postgres && myconf+=( --with-pgsql-incdir=$(pg_config --includedir) )
+
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake \
+ OPT="${CXXFLAGS}" \
+ F77OPT="${FFLAGS}" \
+ ROOTSYS="${S}" \
+ LD_LIBRARY_PATH="${S}/lib"
+ use emacs && elisp-compile build/misc/*.el
+}
+
+daemon_install() {
+ local daemons="rootd proofd"
+ dodir /var/spool/rootd
+ fowners rootd:rootd /var/spool/rootd
+ dodir /var/spool/rootd/{pub,tmp}
+ fperms 1777 /var/spool/rootd/{pub,tmp}
+
+ local i
+ for i in ${daemons}; do
+ newinitd "${FILESDIR}"/${i}.initd ${i}
+ newconfd "${FILESDIR}"/${i}.confd ${i}
+ done
+ if use xinetd; then
+ insinto /etc/xinetd
+ doins "${S}"/etc/daemons/{rootd,proofd}.xinetd
+ fi
+}
+
+desktop_install() {
+ cd "${S}"
+ echo "Icon=root-system-bin" >> etc/root.desktop
+ domenu etc/root.desktop
+ doicon build/package/debian/root-system-bin.png
+
+ insinto /usr/share/icons/hicolor/48x48/mimetypes
+ doins build/package/debian/application-x-root.png
+
+ insinto /usr/share/icons/hicolor/48x48/apps
+ doicon build/package/debian/root-system-bin.xpm
+}
+
+cleanup_install() {
+ # Cleanup of files either already distributed or unused on Gentoo
+ pushd "${ED}" > /dev/null
+ rm usr/share/root/fonts/LICENSE || die
+ rm etc/root/proof/*.sample || die
+ rm -r etc/root/daemons || die
+ # these should be in PATH
+ mv etc/root/proof/utils/pq2/pq2* usr/bin/ || die
+ rm ${DOC_DIR#/}/{INSTALL,LICENSE} || die
+ use examples || rm -r ${DOC_DIR#/}/examples || die
+
+ # clean hardcoded sandbox paths
+ #rm etc/root/dictpch/allCppflags.txt.tmp || die
+ #sed -i "s|${S}/||" etc/root/cling/llvm/Config/llvm-config.h || die
+ # regenerate pch for Gentoo headers layout
+ #rm "etc/root/allDict.cxx.pch" || die
+ #sed -i 's|etc/dictpch|etc/root/dictpch|' etc/root/dictpch/allLinkDefs.h || die
+ #sed -i 's|etc/cling|etc/root/cling|' etc/root/dictpch/allHeaders.h || die
+ #sed -i "s|ROOTDIR_TEMPLATE|${ED}|" etc/root/dictpch/makepch-gentoo.sh || die
+ #etc/root/dictpch/makepch-gentoo.sh etc/root/allDict.cxx.pch || die "PCH generation failed"
+}
+
+src_install() {
+ ROOTSYS="${S}" emake DESTDIR="${D}" install
+ insinto "${DOC_DIR}"
+ doins README.md
+
+ echo "LDPATH=${EPREFIX%/}/usr/$(get_libdir)/root" > 99root
+ use pythia8 && echo "PYTHIA8=${EPREFIX%/}/usr" >> 99root
+
+ if use python; then
+ echo "PYTHONPATH=${EPREFIX%/}/usr/$(get_libdir)/root" >> 99root
+ python_optimize "${D}/usr/$(get_libdir)/root"
+ fi
+ use emacs && elisp-install ${PN} build/misc/*.{el,elc}
+ if use examples; then
+ # these should really be taken care of by the root make install
+ insinto ${DOC_DIR}/examples/tutorials/tmva
+ doins -r tmva/test
+ fi
+ doenvd 99root
+
+ # The build system installs Emacs support unconditionally in the wrong
+ # directory. Remove it and call elisp-install in case of USE=emacs.
+ rm -r "${ED}"/usr/share/emacs || die
+
+ daemon_install
+ desktop_install
+ cleanup_install
+
+ # do not copress files used by ROOT's CLI (.credit, .demo, .license)
+ docompress -x "${DOC_DIR}"/{CREDITS,examples/tutorials}
+ # needed for .license command to work
+ dosym "${ED}"usr/portage/licenses/LGPL-2.1 "${DOC_DIR}/LICENSE"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ # restort opencascade eselect slot
+ if use geocad && [[ -n ${oc_current} ]]; then
+ einfo "Switching to user set slot: $(eselect opencascade show) -> ${oc_current}"
+ eselect opencascade set ${oc_current} > /dev/null || eerror "eselect opencascade set ${vlist[i]} failed!"
+ unset oc_current
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-physics/sassena/Manifest b/sci-physics/sassena/Manifest
new file mode 100644
index 000000000000..9da964bce23e
--- /dev/null
+++ b/sci-physics/sassena/Manifest
@@ -0,0 +1 @@
+DIST sassena-v1.4.1.tar.gz 777979 RMD160 95ae113e7671bc8dbc273beaeaa6eae0f5e6ea9c SHA1 e32ede7c8885eb4e402a506c8aba9e10ac3dc59c SHA256 32f49bad943136bad4cce8b4c427cf1756ae43e20691144b58900653dfc5873f
diff --git a/sci-physics/sassena/files/sassena-1.4.1-libs.patch b/sci-physics/sassena/files/sassena-1.4.1-libs.patch
new file mode 100644
index 000000000000..cded9f7d40db
--- /dev/null
+++ b/sci-physics/sassena/files/sassena-1.4.1-libs.patch
@@ -0,0 +1,51 @@
+diff -urN sassena-v1.4.1/cmake/CMakeLists.txt.executables sassena-v1.4.1.patched/cmake/CMakeLists.txt.executables
+--- sassena-v1.4.1/cmake/CMakeLists.txt.executables 2012-02-03 04:43:33.000000000 +0400
++++ sassena-v1.4.1.patched/cmake/CMakeLists.txt.executables 2012-03-21 18:07:13.000000000 +0400
+@@ -61,6 +61,20 @@
+ INSTALL(TARGETS s_maketnx RUNTIME DESTINATION bin)
+ INSTALL(TARGETS s_stage RUNTIME DESTINATION bin)
+
++IF(NOT STATIC)
++INSTALL(TARGETS sass_controlio LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_decomposition LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_log LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_math LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_mpi LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_report LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_sample LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_scatter_devices LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_services LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_stager LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++INSTALL(TARGETS sass_vendor_xdrfile LIBRARY DESTINATION ${LIB_INSTALL_DIR})
++ENDIF(NOT STATIC)
++
+ TARGET_LINK_LIBRARIES (unit_broadcast
+ sass_log
+ sass_report
+@@ -69,4 +83,4 @@
+ ${BOOST_LIBRARIES}
+ )
+
+-INSTALL(TARGETS unit_broadcast RUNTIME DESTINATION bin)
+\ В конце файла нет новой строки
++INSTALL(TARGETS unit_broadcast RUNTIME DESTINATION bin)
+diff -urN sassena-v1.4.1/cmake/CMakeLists.txt.shared sassena-v1.4.1.patched/cmake/CMakeLists.txt.shared
+--- sassena-v1.4.1/cmake/CMakeLists.txt.shared 2012-02-03 04:43:33.000000000 +0400
++++ sassena-v1.4.1.patched/cmake/CMakeLists.txt.shared 2012-03-21 18:10:30.000000000 +0400
+@@ -4,6 +4,8 @@
+
+ SET(INTERNAL_LIBRARY_TYPE SHARED)
+
++SET(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
++
+ IF(CMAKE_HOST_APPLE)
+ SET(CMAKE_EXE_LINKER_FLAGS "-fPIC ${CMAKE_EXE_LINKER_FLAGS}")
+ ELSE(CMAKE_HOST_APPLE)
+@@ -15,4 +17,4 @@
+ INCLUDE(${CMAKE_PROJECT_PATH}/CMakeLists.txt.intern)
+ INCLUDE(${CMAKE_PROJECT_PATH}/CMakeLists.txt.executables)
+
+-INCLUDE(${CMAKE_PROJECT_PATH}/CMakeLists.txt.packages)
+\ В конце файла нет новой строки
++INCLUDE(${CMAKE_PROJECT_PATH}/CMakeLists.txt.packages)
+diff -urN sassena-v1.4.1/CMakeLists.txt sassena-v1.4.1.patched/CMakeLists.txt
diff --git a/sci-physics/sassena/metadata.xml b/sci-physics/sassena/metadata.xml
new file mode 100644
index 000000000000..277a0627f0dd
--- /dev/null
+++ b/sci-physics/sassena/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/sci-physics/sassena/sassena-1.4.1.ebuild b/sci-physics/sassena/sassena-1.4.1.ebuild
new file mode 100644
index 000000000000..f673d94cde83
--- /dev/null
+++ b/sci-physics/sassena/sassena-1.4.1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+MY_P="${PN}-v${PV}"
+
+DESCRIPTION="Software for Calculating Scattering Diagrams on Massively Parallel Computers"
+HOMEPAGE="http://www.sassena.org"
+SRC_URI="http://www.sassena.org/software/source-code/releases/v${PV}/${MY_P}.tar.gz/at_download/file -> ${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE=""
+
+DEPEND="
+ dev-libs/boost[mpi]
+ sci-libs/hdf5[mpi]
+ dev-libs/libxml2
+ sci-libs/fftw:3.0
+ virtual/mpi
+ virtual/blas
+ virtual/lapack"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/$P-libs.patch"
+ )
diff --git a/sci-physics/siscone/Manifest b/sci-physics/siscone/Manifest
new file mode 100644
index 000000000000..31778b936969
--- /dev/null
+++ b/sci-physics/siscone/Manifest
@@ -0,0 +1 @@
+DIST siscone-2.0.6.tar.gz 473370 SHA256 f66f0ca5360f2cf0413f720b376bf850cde46fe72af093560536e6f0338d8a76 SHA512 3a1bbd50db8800a2ce00eac4f4cd498d7e6674ba739ed8157f6e0c0e32fd7724d19d227b5a023fa945a5b4be5c415c5c77c2e2a60e80ec4029c016e3fd95983d WHIRLPOOL ebe4f44ae784bfca39b47e9eb20d0ea50daeb9c01b2e92f1608f246f416960fd1dec6e0f8e9f9d49fba155fae2c86b4a4853c199737803c3c50d580a4b725637
diff --git a/sci-physics/siscone/metadata.xml b/sci-physics/siscone/metadata.xml
new file mode 100644
index 000000000000..eeceb52716c5
--- /dev/null
+++ b/sci-physics/siscone/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-physics</herd>
+<longdescription lang="en">
+ SISCone implements a seedless infrared (IR) safe cone jet algorithm, it takes
+ N^2*ln(N) time to find jets among N particles, comparing to N*2^N time of
+ other algorithms.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/siscone/siscone-2.0.6.ebuild b/sci-physics/siscone/siscone-2.0.6.ebuild
new file mode 100644
index 000000000000..329ec44b0f07
--- /dev/null
+++ b/sci-physics/siscone/siscone-2.0.6.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="Hadron Seedless Infrared-Safe Cone jet algorithm"
+HOMEPAGE="http://siscone.hepforge.org/"
+SRC_URI="http://www.hepforge.org/archive/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*.{cpp,h}
+ insinto /usr/share/doc/${PF}/examples/events
+ doins examples/events/*.dat
+ fi
+}
diff --git a/sci-physics/xfoil/Manifest b/sci-physics/xfoil/Manifest
new file mode 100644
index 000000000000..35646cfc07e9
--- /dev/null
+++ b/sci-physics/xfoil/Manifest
@@ -0,0 +1,2 @@
+DIST dataflow.pdf 7654 SHA256 4596c77a3fa24cd334b35c34fcbd0b4f1d9055273c0862643e2d07b5e774aff5
+DIST xfoil6.97.tar.gz 3972497 SHA256 293e28e269bd88a62f8b6ba6bf684f16843f6776736e6b77aaa8b6bebc467a81 SHA512 02c0a123fb99fa20de1e3577ca7c6ce00d494058f2ef3ec82e3fdea48901f4346180aea3436e001c5b90401007ccdd5b7e9daa6a96794f0d6b5781a5b36e36e7 WHIRLPOOL 3de5e6c56a906a71b2be1fcf39ea031454c9192b4a649a23aaa889566fea2e92b37239fa6ed90c4b050bdb5759943d0265881f316ecd5b48a06fe4217af36ef7
diff --git a/sci-physics/xfoil/files/xfoil-6.96-gfortran.patch b/sci-physics/xfoil/files/xfoil-6.96-gfortran.patch
new file mode 100644
index 000000000000..67fc19c645f9
--- /dev/null
+++ b/sci-physics/xfoil/files/xfoil-6.96-gfortran.patch
@@ -0,0 +1,29 @@
+--- plotlib/ps_subs.f.orig 2004-08-21 19:02:44.000000000 +0100
++++ plotlib/ps_subs.f 2007-05-03 19:14:28.901490750 +0100
+@@ -559,7 +559,7 @@
+ c in the iout array (3,1,3,1,3,1,3,1)
+ c Note: the bit mask is shifted to always start counting on a '1' bit.
+ c
+-c--- Uses the library routines and() and rshift() for bit manipulation
++c--- Uses the library routines and() and ishft() for bit manipulation
+ c which are present in most fortran libraries as extensions to f77.
+ c
+ dimension iout(*)
+@@ -570,7 +570,7 @@
+ ibitold = and(1,imask)
+ if(ibitold.NE.0) go to 5
+ nshft = n
+- imask = rshift(imask,1)
++ imask = ishft(imask,-1)
+ end do
+ c
+ 5 nout = 0
+@@ -594,7 +594,7 @@
+ c
+ ibitold = ibit
+ nbits = nbits + 1
+- imask = rshift(imask,1)
++ imask = ishft(imask,-1)
+ end do
+ c--- Add final bit(s) to end of 16 bits checked
+ c--- Now append any zero bits shifted out originally
diff --git a/sci-physics/xfoil/files/xfoil-6.97-overflow.patch b/sci-physics/xfoil/files/xfoil-6.97-overflow.patch
new file mode 100644
index 000000000000..73656f927a48
--- /dev/null
+++ b/sci-physics/xfoil/files/xfoil-6.97-overflow.patch
@@ -0,0 +1,22 @@
+--- src/pplot.f.orig 2008-08-21 20:21:08.000000000 +0100
++++ src/pplot.f 2008-08-21 20:21:42.000000000 +0100
+@@ -36,7 +36,7 @@
+ PROGRAM PPLOT
+ INCLUDE 'PPLOT.INC'
+ C
+- LOGICAL ERROR, LGETFN
++ LOGICAL ERROR, LGETFN, LERR
+ REAL RINP(10)
+ REAL CPOLO(NAX,IPTOT,NPX), VPOLO(NAX,2,NPX)
+ C
+--- src/xoper.f.orig 2008-08-22 15:55:27.000000000 +0100
++++ src/xoper.f 2008-08-22 15:53:36.000000000 +0100
+@@ -114,7 +114,7 @@
+ C---- don't try to read integers, since might get integer overflow
+ DO I=1, NINPUT
+ IF(ABS(RINPUT(I)) .GT. 2.1E9) THEN
+- IINPUT(I) = 2**31
++ IINPUT(I) = HUGE(0)
+ ELSE
+ IINPUT(I) = INT(RINPUT(I))
+ ENDIF
diff --git a/sci-physics/xfoil/metadata.xml b/sci-physics/xfoil/metadata.xml
new file mode 100644
index 000000000000..c6130c99cea3
--- /dev/null
+++ b/sci-physics/xfoil/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-physics</herd>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ XFOIL is an interactive program for the design and analysis of subsonic isolated airfoils.
+ It consists of a collection of menu-driven routines which perform various useful functions such as:
+ * Viscous (or inviscid) analysis of an existing airfoil
+ * Airfoil design and redesign by interactive modification of surface speed distributions
+ * Airfoil redesign by interactive modification of geometric parameters
+ * Blending of airfoils
+ * Writing and reading of airfoil coordinates and polar save files
+ * Plotting of geometry, pressure distributions, and multiple polars
+</longdescription>
+</pkgmetadata>
diff --git a/sci-physics/xfoil/xfoil-6.97.ebuild b/sci-physics/xfoil/xfoil-6.97.ebuild
new file mode 100644
index 000000000000..d1679ff859bf
--- /dev/null
+++ b/sci-physics/xfoil/xfoil-6.97.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2
+
+DESCRIPTION="Design and analysis of subsonic isolated airfoils"
+HOMEPAGE="http://raphael.mit.edu/xfoil/"
+SRC_URI="
+ http://web.mit.edu/drela/Public/web/${PN}/${PN}${PV}.tar.gz
+ doc? ( http://web.mit.edu/drela/Public/web/${PN}/dataflow.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples"
+
+RDEPEND="x11-libs/libX11"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/Xfoil"
+
+src_prepare() {
+ sed \
+ -e '/^FC/d' \
+ -e '/^CC/d' \
+ -e '/^FFLAGS/d' \
+ -e '/^CFLAGS/d' \
+ -e 's/^\(FFLOPT .*\)/FFLOPT = $(FFLAGS)/g' \
+ -i {bin,plotlib,orrs/bin}/Makefile plotlib/config.make \
+ || die "sed for flags and compilers failed"
+
+ # fix bug #147033
+ [[ $(tc-getFC) == *gfortran ]] && \
+ epatch "${FILESDIR}"/${PN}-6.96-gfortran.patch
+
+ epatch "${FILESDIR}"/${P}-overflow.patch
+
+ sed \
+ -e "s:/var/local/codes/orrs/osmap.dat:${EPREFIX}/usr/share/xfoil/orrs/osmap.dat:" \
+ -i orrs/src/osmap.f || die "sed osmap.f failed"
+}
+
+src_compile() {
+ cd "${S}"/orrs/bin
+ emake FLG="${FFLAGS}" FTNLIB="${LDFLAGS}" OS
+ cd "${S}"/orrs
+ bin/osgen osmaps_ns.lst
+ cd "${S}"/plotlib
+ emake CFLAGS="${CFLAGS} -DUNDERSCORE"
+ cd "${S}"/bin
+ for i in xfoil pplot pxplot; do
+ emake \
+ PLTOBJ="../plotlib/libPlt.a" \
+ CFLAGS="${CFLAGS} -DUNDERSCORE" \
+ FTNLIB="${LDFLAGS}" \
+ ${i}
+ done
+}
+
+src_install() {
+ dobin bin/pplot bin/pxplot bin/xfoil
+ insinto /usr/share/xfoil/orrs
+ doins orrs/osm*.dat
+ dodoc *.txt README
+ insinto /usr/share/doc/${PF}/
+ use examples && doins -r runs
+ use doc && dodoc "${DISTDIR}"/dataflow.pdf
+}