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-chemistry
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-chemistry')
-rw-r--r--sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.1.ebuild41
-rw-r--r--sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.2.ebuild41
-rw-r--r--sci-chemistry/GromacsWrapper/Manifest2
-rw-r--r--sci-chemistry/GromacsWrapper/files/0001-Drop-chmod-hack.patch28
-rw-r--r--sci-chemistry/GromacsWrapper/metadata.xml12
-rw-r--r--sci-chemistry/PyMca/Manifest1
-rw-r--r--sci-chemistry/PyMca/PyMca-4.6.2-r1.ebuild41
-rw-r--r--sci-chemistry/PyMca/PyMca-4.6.2.ebuild43
-rw-r--r--sci-chemistry/PyMca/files/4.4.1_p1-gentoo.patch40
-rw-r--r--sci-chemistry/PyMca/files/4.4.1_p1-impl-dec.patch12
-rw-r--r--sci-chemistry/PyMca/files/PyMca-4.6.2-gentoo.patch16
-rw-r--r--sci-chemistry/PyMca/metadata.xml22
-rw-r--r--sci-chemistry/acpype/Manifest3
-rw-r--r--sci-chemistry/acpype/acpype-366.ebuild38
-rw-r--r--sci-chemistry/acpype/acpype-374.ebuild38
-rw-r--r--sci-chemistry/acpype/acpype-389.ebuild39
-rw-r--r--sci-chemistry/acpype/files/acpype.patch37
-rw-r--r--sci-chemistry/acpype/metadata.xml9
-rw-r--r--sci-chemistry/ambertools/Manifest2
-rw-r--r--sci-chemistry/ambertools/ambertools-1.5-r1.ebuild144
-rw-r--r--sci-chemistry/ambertools/files/ambertools-1.5-gentoo.patch386
-rw-r--r--sci-chemistry/ambertools/metadata.xml9
-rw-r--r--sci-chemistry/apbs/Manifest1
-rw-r--r--sci-chemistry/apbs/apbs-1.4.1-r2.ebuild128
-rw-r--r--sci-chemistry/apbs/files/apbs-1.4.1-manip.patch50
-rw-r--r--sci-chemistry/apbs/files/apbs-1.4.1-multilib.patch92
-rw-r--r--sci-chemistry/apbs/files/apbs-1.4.1-python.patch122
-rw-r--r--sci-chemistry/apbs/metadata.xml26
-rw-r--r--sci-chemistry/aqua/Manifest2
-rw-r--r--sci-chemistry/aqua/aqua-3.2-r2.ebuild93
-rw-r--r--sci-chemistry/aqua/files/3.2-flags.patch84
-rw-r--r--sci-chemistry/aqua/metadata.xml8
-rw-r--r--sci-chemistry/aria/Manifest1
-rw-r--r--sci-chemistry/aria/aria-2.3.2_p20130826.ebuild89
-rw-r--r--sci-chemistry/aria/files/aria-2.3.2-python.patch30
-rw-r--r--sci-chemistry/aria/files/aria-2.3.2-through-space-2.patch139
-rw-r--r--sci-chemistry/aria/files/aria-2.3.2-through-space.patch118
-rw-r--r--sci-chemistry/aria/metadata.xml8
-rw-r--r--sci-chemistry/arp-warp-bin/Manifest1
-rw-r--r--sci-chemistry/arp-warp-bin/arp-warp-bin-7.5.ebuild81
-rw-r--r--sci-chemistry/arp-warp-bin/files/7.3-setup.patch30
-rw-r--r--sci-chemistry/arp-warp-bin/metadata.xml5
-rw-r--r--sci-chemistry/autodock/Manifest1
-rw-r--r--sci-chemistry/autodock/autodock-4.2.6.ebuild102
-rw-r--r--sci-chemistry/autodock/files/4.0.1-gcc-4.3.patch10
-rw-r--r--sci-chemistry/autodock/files/autodock-4.2.6-buildsystem.patch44
-rw-r--r--sci-chemistry/autodock/metadata.xml5
-rw-r--r--sci-chemistry/autodock_vina/Manifest1
-rw-r--r--sci-chemistry/autodock_vina/autodock_vina-1.1.2.ebuild47
-rw-r--r--sci-chemistry/autodock_vina/files/1.1.1-gentoo.patch68
-rw-r--r--sci-chemistry/autodock_vina/files/1.1.2-gentoo.patch72
-rw-r--r--sci-chemistry/autodock_vina/files/autodock_vina-1.1.2-boost-filesystem.patch79
-rw-r--r--sci-chemistry/autodock_vina/metadata.xml29
-rw-r--r--sci-chemistry/avogadro/Manifest2
-rw-r--r--sci-chemistry/avogadro/avogadro-1.0.3-r2.ebuild55
-rw-r--r--sci-chemistry/avogadro/avogadro-1.1.0.ebuild60
-rw-r--r--sci-chemistry/avogadro/files/1.0.1-gl2ps.patch39
-rw-r--r--sci-chemistry/avogadro/files/avogadro-1.1.0-textrel.patch29
-rw-r--r--sci-chemistry/avogadro/files/avogadro-1.1.0-xlibs.patch16
-rw-r--r--sci-chemistry/avogadro/metadata.xml17
-rw-r--r--sci-chemistry/azara/Manifest1
-rw-r--r--sci-chemistry/azara/azara-2.8-r4.ebuild98
-rw-r--r--sci-chemistry/azara/azara-2.8-r5.ebuild99
-rw-r--r--sci-chemistry/azara/files/2.8-64bit.patch85
-rw-r--r--sci-chemistry/azara/files/2.8-impl-dec.patch226
-rw-r--r--sci-chemistry/azara/files/2.8-prll.patch387
-rw-r--r--sci-chemistry/azara/files/2.8-python.patch44
-rw-r--r--sci-chemistry/azara/metadata.xml9
-rw-r--r--sci-chemistry/babel/Manifest1
-rw-r--r--sci-chemistry/babel/babel-1.6-r1.ebuild37
-rw-r--r--sci-chemistry/babel/files/10babel1
-rw-r--r--sci-chemistry/babel/files/babel-1.6-gcc32.diff28
-rw-r--r--sci-chemistry/babel/files/babel-1.6-gentoo.diff28
-rw-r--r--sci-chemistry/babel/files/babel-1.6-makefile.patch33
-rw-r--r--sci-chemistry/babel/metadata.xml5
-rw-r--r--sci-chemistry/balbes/Manifest2
-rw-r--r--sci-chemistry/balbes/balbes-1.0.0_p100317-r2.ebuild79
-rw-r--r--sci-chemistry/balbes/files/1.0.0_p100317-makefile.patch107
-rw-r--r--sci-chemistry/balbes/files/pyxml-0.8.4-python-2.6.patch28
-rw-r--r--sci-chemistry/balbes/metadata.xml18
-rw-r--r--sci-chemistry/ball/Manifest1
-rw-r--r--sci-chemistry/ball/ball-1.4.2.ebuild83
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-BondOrder.xml.patch30
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-missing-signed.patch26
-rw-r--r--sci-chemistry/ball/files/ball-1.4.1-multilib.patch39
-rw-r--r--sci-chemistry/ball/files/ball-1.4.2-Fix-compilation-of-sipModularWidget.patch40
-rw-r--r--sci-chemistry/ball/files/ball-1.4.2-PDBFile-Fix-compilation-with-gcc-4.8.patch28
-rw-r--r--sci-chemistry/ball/files/ball-1.4.2-QT4_EXTRACT_OPTIONS-CMake-macro-changed-in-CMake-2.8.patch44
-rw-r--r--sci-chemistry/ball/files/ball-1.4.2-underlinking.patch16
-rw-r--r--sci-chemistry/ball/metadata.xml32
-rw-r--r--sci-chemistry/bkchem/Manifest1
-rw-r--r--sci-chemistry/bkchem/bkchem-0.14.0_pre2-r1.ebuild41
-rw-r--r--sci-chemistry/bkchem/files/0.14.0_pre1-piddle-Fix-assertions.patch48
-rw-r--r--sci-chemistry/bkchem/files/bkchem-0.14.0_pre2-nolauncher.patch106
-rw-r--r--sci-chemistry/bkchem/metadata.xml8
-rw-r--r--sci-chemistry/bodr/Manifest2
-rw-r--r--sci-chemistry/bodr/bodr-10.ebuild27
-rw-r--r--sci-chemistry/bodr/bodr-9-r1.ebuild27
-rw-r--r--sci-chemistry/bodr/metadata.xml15
-rw-r--r--sci-chemistry/burrow-owl/Manifest2
-rw-r--r--sci-chemistry/burrow-owl/burrow-owl-1.5.1.ebuild53
-rw-r--r--sci-chemistry/burrow-owl/files/1.4-glibc-2.12.patch38
-rw-r--r--sci-chemistry/burrow-owl/files/1.4-include.patch12
-rw-r--r--sci-chemistry/burrow-owl/files/burrow-owl-1.5-prll.patch20
-rw-r--r--sci-chemistry/burrow-owl/metadata.xml8
-rw-r--r--sci-chemistry/cara-bin/Manifest2
-rw-r--r--sci-chemistry/cara-bin/cara-bin-1.8.4-r1.ebuild49
-rw-r--r--sci-chemistry/cara-bin/metadata.xml7
-rw-r--r--sci-chemistry/ccp4-apps/Manifest2
-rw-r--r--sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r13.ebuild395
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-clipper-template.patch70
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-balbes.patch14
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-double-and-make-bindir.patch24
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-imosflm.patch11
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-libs.patch35
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-molref.patch19
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-scala.patch42
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-build-xia.patch14
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-configure.patch111
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-dont-make-dirs-in-configure.patch87
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch152
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-lapack.patch597
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-pisa.patch23
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-pythonpath.patch65
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-rename-rapper-ng.patch60
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-unbundle.patch131
-rw-r--r--sci-chemistry/ccp4-apps/files/ccp4-apps-6.1.3-tcl8.6.patch130
-rw-r--r--sci-chemistry/ccp4-apps/metadata.xml5
-rw-r--r--sci-chemistry/ccp4/ccp4-6.1.3-r1.ebuild38
-rw-r--r--sci-chemistry/ccp4/files/6.0.1-dont-make-dirs-in-configure.patch87
-rw-r--r--sci-chemistry/ccp4/files/6.0.1-ppc-double-define-gerror.patch11
-rw-r--r--sci-chemistry/ccp4/files/6.0.2-dont-make-dirs-in-configure.patch87
-rw-r--r--sci-chemistry/ccp4/files/6.0.2-gcc-4.1.2-idate-fix.patch14
-rw-r--r--sci-chemistry/ccp4/files/6.0.2-ppc-double-define-gerror.patch11
-rw-r--r--sci-chemistry/ccp4/files/ccp4i-default-to-firefox.patch13
-rw-r--r--sci-chemistry/ccp4/files/check-blas-lapack-pthread.patch103
-rw-r--r--sci-chemistry/ccp4/files/clipper-find-mccp4-includes.patch11
-rw-r--r--sci-chemistry/ccp4/files/create-mosflm-bindir.patch10
-rw-r--r--sci-chemistry/ccp4/files/dont-build-rasmol.patch19
-rw-r--r--sci-chemistry/ccp4/files/make-ipmosflm-dir.patch10
-rw-r--r--sci-chemistry/ccp4/files/make-mosflm-cbf-libdir.patch11
-rw-r--r--sci-chemistry/ccp4/files/make-mosflm-index-libdir.patch10
-rw-r--r--sci-chemistry/ccp4/files/make-mosflm-libdir.patch10
-rw-r--r--sci-chemistry/ccp4/files/pass-clipper-enablevals.patch11
-rw-r--r--sci-chemistry/ccp4/metadata.xml9
-rw-r--r--sci-chemistry/ccp4i/Manifest3
-rw-r--r--sci-chemistry/ccp4i/ccp4i-6.1.3-r4.ebuild99
-rw-r--r--sci-chemistry/ccp4i/files/6.1.3-fix-baubles.patch22
-rw-r--r--sci-chemistry/ccp4i/files/6.1.3-rename-rapper.patch61
-rw-r--r--sci-chemistry/ccp4i/files/6.1.3-rename-superpose.patch26
-rw-r--r--sci-chemistry/ccp4i/files/6.1.3-rename-truncate.patch91
-rw-r--r--sci-chemistry/ccp4i/metadata.xml5
-rw-r--r--sci-chemistry/ccpn/Manifest6
-rw-r--r--sci-chemistry/ccpn/ccpn-2.4.1_p150226.ebuild166
-rw-r--r--sci-chemistry/ccpn/ccpn-2.4.2.ebuild166
-rw-r--r--sci-chemistry/ccpn/ccpn-2.4.2_p150325.ebuild166
-rw-r--r--sci-chemistry/ccpn/ccpn-2.4.2_p150413.ebuild166
-rw-r--r--sci-chemistry/ccpn/ccpn-2.4.2_p150421.ebuild166
-rw-r--r--sci-chemistry/ccpn/files/2.3.1-parallel.patch38
-rw-r--r--sci-chemistry/ccpn/files/analysis8
-rw-r--r--sci-chemistry/ccpn/files/dangle8
-rw-r--r--sci-chemistry/ccpn/files/dataShifter8
-rw-r--r--sci-chemistry/ccpn/files/depositionFileImporter8
-rw-r--r--sci-chemistry/ccpn/files/eci8
-rw-r--r--sci-chemistry/ccpn/files/extendNmr8
-rw-r--r--sci-chemistry/ccpn/files/formatConverter8
-rw-r--r--sci-chemistry/ccpn/files/pipe2azara8
-rw-r--r--sci-chemistry/ccpn/files/talosn.patch16
-rw-r--r--sci-chemistry/ccpn/files/xeasy2azara8
-rw-r--r--sci-chemistry/ccpn/metadata.xml8
-rw-r--r--sci-chemistry/chemical-mime-data/Manifest1
-rw-r--r--sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r1.ebuild40
-rw-r--r--sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r2.ebuild61
-rw-r--r--sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94.ebuild40
-rw-r--r--sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-namespace-svg.patch16
-rw-r--r--sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-pigz.patch16
-rw-r--r--sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-turbomole.patch57
-rw-r--r--sci-chemistry/chemical-mime-data/metadata.xml15
-rw-r--r--sci-chemistry/chemtool/Manifest2
-rw-r--r--sci-chemistry/chemtool/chemtool-1.6.13.ebuild57
-rw-r--r--sci-chemistry/chemtool/chemtool-1.6.14.ebuild57
-rw-r--r--sci-chemistry/chemtool/files/1.6.13-no-underlinking.patch78
-rw-r--r--sci-chemistry/chemtool/metadata.xml8
-rw-r--r--sci-chemistry/clashlist/Manifest1
-rw-r--r--sci-chemistry/clashlist/clashlist-3.17-r1.ebuild31
-rw-r--r--sci-chemistry/clashlist/clashlist-3.17.ebuild25
-rw-r--r--sci-chemistry/clashlist/metadata.xml16
-rw-r--r--sci-chemistry/cluster/Manifest1
-rw-r--r--sci-chemistry/cluster/cluster-1.3.081231-r1.ebuild30
-rw-r--r--sci-chemistry/cluster/cluster-1.3.081231.ebuild30
-rw-r--r--sci-chemistry/cluster/files/1.3.081231-includes.patch12
-rw-r--r--sci-chemistry/cluster/files/1.3.081231-ldflags.patch41
-rw-r--r--sci-chemistry/cluster/metadata.xml18
-rw-r--r--sci-chemistry/cns/Manifest4
-rw-r--r--sci-chemistry/cns/cns-1.2.1-r8.ebuild233
-rw-r--r--sci-chemistry/cns/cns-1.3_p7-r1.ebuild216
-rw-r--r--sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch20
-rw-r--r--sci-chemistry/cns/files/1.2.1-aria2.3.patch22
-rw-r--r--sci-chemistry/cns/files/1.2.1-gentoo.patch63
-rw-r--r--sci-chemistry/cns/files/1.2.1-ifort.patch126
-rw-r--r--sci-chemistry/cns/files/1.2.1-parallel.patch17
-rw-r--r--sci-chemistry/cns/files/1.3_p7-delete.patch13
-rw-r--r--sci-chemistry/cns/files/1.3_p7-gentoo.patch80
-rw-r--r--sci-chemistry/cns/files/cns_solve_env_sh221
-rw-r--r--sci-chemistry/cns/files/cns_solve_env_sh-1.3_p7229
-rw-r--r--sci-chemistry/cns/metadata.xml21
-rw-r--r--sci-chemistry/coot/Manifest6
-rw-r--r--sci-chemistry/coot/coot-0.7.1-r1.ebuild167
-rw-r--r--sci-chemistry/coot/coot-0.7.2.ebuild165
-rw-r--r--sci-chemistry/coot/coot-0.7.ebuild159
-rw-r--r--sci-chemistry/coot/files/0.6.2-clipper-config.patch17
-rw-r--r--sci-chemistry/coot/files/0.6.2-gl.patch10
-rw-r--r--sci-chemistry/coot/files/0.6.2-libpng15.patch29
-rw-r--r--sci-chemistry/coot/files/0.6.2-mmdb-config.patch18
-rw-r--r--sci-chemistry/coot/files/0.6.2-ssm.patch56
-rw-r--r--sci-chemistry/coot/files/0.6.2-test.patch16
-rw-r--r--sci-chemistry/coot/files/coot-0.7-clipper-config.patch17
-rw-r--r--sci-chemistry/coot/files/coot-0.7-goocanvas.patch25
-rw-r--r--sci-chemistry/coot/files/coot-0.7-mmdb-config.patch18
-rw-r--r--sci-chemistry/coot/files/coot-0.7-ssm.patch56
-rw-r--r--sci-chemistry/coot/metadata.xml5
-rw-r--r--sci-chemistry/cyana/Manifest1
-rw-r--r--sci-chemistry/cyana/cyana-2.1.ebuild72
-rw-r--r--sci-chemistry/cyana/files/2.1-exec.patch77
-rw-r--r--sci-chemistry/cyana/files/2.1-expire.patch15
-rw-r--r--sci-chemistry/cyana/files/2.1-typo.patch13
-rw-r--r--sci-chemistry/cyana/files/2.1-xiar.patch16
-rw-r--r--sci-chemistry/cyana/metadata.xml8
-rw-r--r--sci-chemistry/dssp/Manifest1
-rw-r--r--sci-chemistry/dssp/dssp-2.2.1-r1.ebuild44
-rw-r--r--sci-chemistry/dssp/files/Makefile7
-rw-r--r--sci-chemistry/dssp/files/dssp-2.0.4-gcc47.patch46
-rw-r--r--sci-chemistry/dssp/files/dssp-2.0.4-gentoo.patch70
-rw-r--r--sci-chemistry/dssp/files/dssp-2.1.0-gentoo.patch60
-rw-r--r--sci-chemistry/dssp/metadata.xml8
-rw-r--r--sci-chemistry/easychem/Manifest1
-rw-r--r--sci-chemistry/easychem/easychem-0.6-r1.ebuild40
-rw-r--r--sci-chemistry/easychem/files/0.6-gentoo.patch65
-rw-r--r--sci-chemistry/easychem/files/easychem-0.6-prestrip.patch10
-rw-r--r--sci-chemistry/easychem/metadata.xml15
-rw-r--r--sci-chemistry/eden/Manifest1
-rw-r--r--sci-chemistry/eden/eden-5.3-r2.ebuild87
-rw-r--r--sci-chemistry/eden/files/5.3-makefile-fixes.patch60
-rw-r--r--sci-chemistry/eden/files/eden-5.3-format-security.patch96
-rw-r--r--sci-chemistry/eden/files/eden-5.3-impl-dec.patch28
-rw-r--r--sci-chemistry/eden/files/makefile-fixes.patch25
-rw-r--r--sci-chemistry/eden/metadata.xml9
-rw-r--r--sci-chemistry/elem/Manifest1
-rw-r--r--sci-chemistry/elem/elem-1.0.3-r1.ebuild32
-rw-r--r--sci-chemistry/elem/elem-1.0.3-r2.ebuild35
-rw-r--r--sci-chemistry/elem/metadata.xml8
-rw-r--r--sci-chemistry/freeon/Manifest2
-rw-r--r--sci-chemistry/freeon/files/freeon-1.0.8-blas.patch165
-rw-r--r--sci-chemistry/freeon/freeon-1.0.10.ebuild27
-rw-r--r--sci-chemistry/freeon/freeon-1.0.8-r1.ebuild29
-rw-r--r--sci-chemistry/freeon/metadata.xml12
-rw-r--r--sci-chemistry/gabedit/Manifest3
-rw-r--r--sci-chemistry/gabedit/files/CONFIG.Gentoo14
-rw-r--r--sci-chemistry/gabedit/files/gabedit-2.4.2-gold.patch16
-rw-r--r--sci-chemistry/gabedit/gabedit-2.4.6.ebuild68
-rw-r--r--sci-chemistry/gabedit/gabedit-2.4.7.ebuild68
-rw-r--r--sci-chemistry/gabedit/gabedit-2.4.8.ebuild68
-rw-r--r--sci-chemistry/gabedit/metadata.xml12
-rw-r--r--sci-chemistry/gamess/Manifest2
-rw-r--r--sci-chemistry/gamess/files/gamess-20110811.1.gentoo.patch263
-rw-r--r--sci-chemistry/gamess/files/gamess-checktst.patch21
-rw-r--r--sci-chemistry/gamess/files/gamess-qmmm-tinker-fix-idate.patch20
-rw-r--r--sci-chemistry/gamess/gamess-20110811.1.ebuild337
-rw-r--r--sci-chemistry/gamess/metadata.xml14
-rw-r--r--sci-chemistry/gamessq/Manifest1
-rw-r--r--sci-chemistry/gamessq/gamessq-1.2.ebuild27
-rw-r--r--sci-chemistry/gamessq/metadata.xml5
-rw-r--r--sci-chemistry/gelemental/Manifest2
-rw-r--r--sci-chemistry/gelemental/files/gelemental-1.2.0-doxygen.patch30
-rw-r--r--sci-chemistry/gelemental/files/gelemental-1.2.0-gcc4.3.patch12
-rw-r--r--sci-chemistry/gelemental/files/gelemental-1.2.0-glib-2.32.patch46
-rw-r--r--sci-chemistry/gelemental/gelemental-1.2.0-r1.ebuild64
-rw-r--r--sci-chemistry/gelemental/gelemental-1.2.0.ebuild51
-rw-r--r--sci-chemistry/gelemental/metadata.xml8
-rw-r--r--sci-chemistry/ghemical/Manifest2
-rw-r--r--sci-chemistry/ghemical/files/2.99.2-docs.patch22
-rw-r--r--sci-chemistry/ghemical/files/ghemical-gcc43.patch14
-rw-r--r--sci-chemistry/ghemical/ghemical-2.99.2-r2.ebuild55
-rw-r--r--sci-chemistry/ghemical/ghemical-3.0.0.ebuild55
-rw-r--r--sci-chemistry/ghemical/metadata.xml16
-rw-r--r--sci-chemistry/gopenmol/Manifest1
-rw-r--r--sci-chemistry/gopenmol/files/3.00-impl-dec.patch80
-rw-r--r--sci-chemistry/gopenmol/files/3.00-include-config-for-plugins.patch11
-rw-r--r--sci-chemistry/gopenmol/files/3.00-multilib.patch104
-rw-r--r--sci-chemistry/gopenmol/files/3.00-tcl8.6.patch32
-rw-r--r--sci-chemistry/gopenmol/gopenmol-3.00-r2.ebuild92
-rw-r--r--sci-chemistry/gopenmol/gopenmol-3.00-r3.ebuild91
-rw-r--r--sci-chemistry/gopenmol/metadata.xml5
-rw-r--r--sci-chemistry/gperiodic/Manifest1
-rw-r--r--sci-chemistry/gperiodic/files/gperiodic-2.0.10-makefile.patch64
-rw-r--r--sci-chemistry/gperiodic/files/gperiodic-2.0.10-nls.patch20
-rw-r--r--sci-chemistry/gperiodic/gperiodic-2.0.10-r2.ebuild48
-rw-r--r--sci-chemistry/gperiodic/gperiodic-2.0.10.ebuild52
-rw-r--r--sci-chemistry/gperiodic/metadata.xml10
-rw-r--r--sci-chemistry/gromacs/Manifest6
-rw-r--r--sci-chemistry/gromacs/gromacs-5.0.4-r1.ebuild284
-rw-r--r--sci-chemistry/gromacs/gromacs-5.0.4.ebuild279
-rw-r--r--sci-chemistry/gromacs/gromacs-5.0.5.ebuild284
-rw-r--r--sci-chemistry/gromacs/gromacs-5.0.6.ebuild284
-rw-r--r--sci-chemistry/gromacs/metadata.xml20
-rw-r--r--sci-chemistry/gsim/Manifest1
-rw-r--r--sci-chemistry/gsim/files/0.20.1-build.conf.patch44
-rw-r--r--sci-chemistry/gsim/files/gsim-21.0-build.conf.patch42
-rw-r--r--sci-chemistry/gsim/files/gsim-21.3-build.conf.patch49
-rw-r--r--sci-chemistry/gsim/gsim-21.3.ebuild67
-rw-r--r--sci-chemistry/gsim/metadata.xml14
-rw-r--r--sci-chemistry/gtk-gamess/Manifest1
-rw-r--r--sci-chemistry/gtk-gamess/gtk-gamess-2.00.ebuild30
-rw-r--r--sci-chemistry/gtk-gamess/metadata.xml16
-rw-r--r--sci-chemistry/hollow/Manifest1
-rw-r--r--sci-chemistry/hollow/hollow-1.2-r1.ebuild39
-rw-r--r--sci-chemistry/hollow/metadata.xml8
-rw-r--r--sci-chemistry/icm-browser/Manifest1
-rw-r--r--sci-chemistry/icm-browser/files/90icm-browser1
-rw-r--r--sci-chemistry/icm-browser/files/icm-browser.xpm326
-rw-r--r--sci-chemistry/icm-browser/icm-browser-3.6.1i.ebuild87
-rw-r--r--sci-chemistry/icm-browser/metadata.xml9
-rw-r--r--sci-chemistry/icm/Manifest2
-rw-r--r--sci-chemistry/icm/files/90icm3
-rw-r--r--sci-chemistry/icm/files/icm.xpm326
-rw-r--r--sci-chemistry/icm/icm-3.7.2e.ebuild140
-rw-r--r--sci-chemistry/icm/icm-3.7.3b.ebuild140
-rw-r--r--sci-chemistry/icm/metadata.xml13
-rw-r--r--sci-chemistry/imosflm/Manifest1
-rw-r--r--sci-chemistry/imosflm/files/1.0.4-impl-dec.patch12
-rw-r--r--sci-chemistry/imosflm/files/1.0.4-tk.patch50
-rw-r--r--sci-chemistry/imosflm/files/1.0.7-libpng16.patch13
-rw-r--r--sci-chemistry/imosflm/imosflm-1.0.7-r1.ebuild54
-rw-r--r--sci-chemistry/imosflm/metadata.xml5
-rw-r--r--sci-chemistry/jmol/Manifest3
-rw-r--r--sci-chemistry/jmol/files/12.0.45/jmol-manifest.patch96
-rw-r--r--sci-chemistry/jmol/files/12.0.45/jmol-nointl.patch313
-rw-r--r--sci-chemistry/jmol/files/caffeine.xyz26
-rw-r--r--sci-chemistry/jmol/files/index.html14
-rw-r--r--sci-chemistry/jmol/files/jmol-11.0.3-manifest.patch96
-rw-r--r--sci-chemistry/jmol/files/jmol-11.0.3-nointl.patch266
-rw-r--r--sci-chemistry/jmol/files/jmol-12.2.27-nointl.patch330
-rw-r--r--sci-chemistry/jmol/jmol-12.0.45-r1.ebuild101
-rw-r--r--sci-chemistry/jmol/jmol-12.2.27-r1.ebuild99
-rw-r--r--sci-chemistry/jmol/metadata.xml16
-rw-r--r--sci-chemistry/ksdssp/Manifest1
-rw-r--r--sci-chemistry/ksdssp/ksdssp-040728-r1.ebuild47
-rw-r--r--sci-chemistry/ksdssp/ksdssp-040728.ebuild45
-rw-r--r--sci-chemistry/ksdssp/metadata.xml8
-rw-r--r--sci-chemistry/makecif/Manifest1
-rw-r--r--sci-chemistry/makecif/files/5.6.6-makefile.patch49
-rw-r--r--sci-chemistry/makecif/makecif-5.6.6-r1.ebuild40
-rw-r--r--sci-chemistry/makecif/makecif-5.6.6.ebuild39
-rw-r--r--sci-chemistry/makecif/metadata.xml18
-rw-r--r--sci-chemistry/mars/Manifest1
-rw-r--r--sci-chemistry/mars/mars-1.2.ebuild44
-rw-r--r--sci-chemistry/mars/metadata.xml8
-rw-r--r--sci-chemistry/massxpert/Manifest2
-rw-r--r--sci-chemistry/massxpert/files/massxpert-2.0.5-gentoo.patch84
-rw-r--r--sci-chemistry/massxpert/files/massxpert-3.4.0-gentoo.patch91
-rw-r--r--sci-chemistry/massxpert/massxpert-2.0.5.ebuild56
-rw-r--r--sci-chemistry/massxpert/massxpert-3.4.0.ebuild56
-rw-r--r--sci-chemistry/massxpert/metadata.xml12
-rw-r--r--sci-chemistry/mdanalysis/Manifest1
-rw-r--r--sci-chemistry/mdanalysis/mdanalysis-0.7.7.ebuild35
-rw-r--r--sci-chemistry/mdanalysis/metadata.xml8
-rw-r--r--sci-chemistry/mead/Manifest1
-rw-r--r--sci-chemistry/mead/files/mead-2.2.7-gcc43.patch22
-rw-r--r--sci-chemistry/mead/files/mead-2.2.7-respect-cflags.patch57
-rw-r--r--sci-chemistry/mead/files/mead-2.2.7-respect-flags.patch74
-rw-r--r--sci-chemistry/mead/mead-2.2.7-r1.ebuild44
-rw-r--r--sci-chemistry/mead/mead-2.2.7.ebuild44
-rw-r--r--sci-chemistry/mead/metadata.xml5
-rw-r--r--sci-chemistry/metadata.xml38
-rw-r--r--sci-chemistry/mm-align/Manifest1
-rw-r--r--sci-chemistry/mm-align/files/CMakeLists.txt5
-rw-r--r--sci-chemistry/mm-align/metadata.xml26
-rw-r--r--sci-chemistry/mm-align/mm-align-20120321.ebuild22
-rw-r--r--sci-chemistry/molden/Manifest2
-rw-r--r--sci-chemistry/molden/files/molden-4.7-implicit-dec.patch12
-rw-r--r--sci-chemistry/molden/files/molden-4.8-ambfor.patch12
-rw-r--r--sci-chemistry/molden/files/molden-4.8-ldflags.patch26
-rw-r--r--sci-chemistry/molden/files/molden-4.8-overflow.patch38
-rw-r--r--sci-chemistry/molden/files/molden-5.0-ambfor.patch16
-rw-r--r--sci-chemistry/molden/files/molden-5.0-overflow.patch16
-rw-r--r--sci-chemistry/molden/metadata.xml5
-rw-r--r--sci-chemistry/molden/molden-4.8-r2.ebuild77
-rw-r--r--sci-chemistry/molden/molden-5.0.ebuild77
-rw-r--r--sci-chemistry/moldy/Manifest1
-rw-r--r--sci-chemistry/moldy/files/2.16e-as-needed.patch65
-rw-r--r--sci-chemistry/moldy/metadata.xml5
-rw-r--r--sci-chemistry/moldy/moldy-2.16e-r2.ebuild71
-rw-r--r--sci-chemistry/molequeue/Manifest1
-rw-r--r--sci-chemistry/molequeue/metadata.xml26
-rw-r--r--sci-chemistry/molequeue/molequeue-0.7.1.ebuild58
-rw-r--r--sci-chemistry/molmol/Manifest2
-rw-r--r--sci-chemistry/molmol/files/cast.patch21
-rw-r--r--sci-chemistry/molmol/files/ldflags.patch13
-rw-r--r--sci-chemistry/molmol/files/libpng15.patch32
-rw-r--r--sci-chemistry/molmol/files/molmol-2k_p2-fink.patch356
-rw-r--r--sci-chemistry/molmol/files/opengl.patch96
-rw-r--r--sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff103
-rw-r--r--sci-chemistry/molmol/files/prefix.patch22
-rw-r--r--sci-chemistry/molmol/files/wild.patch1866
-rw-r--r--sci-chemistry/molmol/metadata.xml5
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r2.ebuild80
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r3.ebuild84
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r4.ebuild86
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r5.ebuild85
-rw-r--r--sci-chemistry/molrep/Manifest2
-rw-r--r--sci-chemistry/molrep/files/10.2.35-respect-FLAGS.patch61
-rw-r--r--sci-chemistry/molrep/files/11.0.00-respect-FLAGS.patch12
-rw-r--r--sci-chemistry/molrep/files/11.0.00-test.patch191
-rw-r--r--sci-chemistry/molrep/files/11.0.03-EOR.patch16
-rw-r--r--sci-chemistry/molrep/metadata.xml8
-rw-r--r--sci-chemistry/molrep/molrep-11.0.02.ebuild57
-rw-r--r--sci-chemistry/molrep/molrep-11.0.03-r1.ebuild59
-rw-r--r--sci-chemistry/molscript/Manifest1
-rw-r--r--sci-chemistry/molscript/files/2.1.2-ldflags.patch22
-rw-r--r--sci-chemistry/molscript/files/2.1.2-libpng15.patch19
-rw-r--r--sci-chemistry/molscript/files/2.1.2-prll.patch10
-rw-r--r--sci-chemistry/molscript/files/fix-makefile-shared.patch62
-rw-r--r--sci-chemistry/molscript/files/glutbitmap.h32
-rw-r--r--sci-chemistry/molscript/metadata.xml5
-rw-r--r--sci-chemistry/molscript/molscript-2.1.2-r2.ebuild68
-rw-r--r--sci-chemistry/molsketch/Manifest2
-rw-r--r--sci-chemistry/molsketch/files/molsketch-0.2.0-openbabel-231.patch54
-rw-r--r--sci-chemistry/molsketch/files/molsketch-0.3.0-_DEFAULT_SOURCE.patch16
-rw-r--r--sci-chemistry/molsketch/files/molsketch-0.3.0-desktop.patch19
-rw-r--r--sci-chemistry/molsketch/files/molsketch-0.3.0-no-quotes.patch16
-rw-r--r--sci-chemistry/molsketch/metadata.xml16
-rw-r--r--sci-chemistry/molsketch/molsketch-0.2.0-r1.ebuild48
-rw-r--r--sci-chemistry/molsketch/molsketch-0.3.0.ebuild60
-rw-r--r--sci-chemistry/mongochem/Manifest1
-rw-r--r--sci-chemistry/mongochem/metadata.xml11
-rw-r--r--sci-chemistry/mongochem/mongochem-0.7.0.ebuild29
-rw-r--r--sci-chemistry/mopac7/Manifest3
-rw-r--r--sci-chemistry/mopac7/files/Makefile23
-rw-r--r--sci-chemistry/mopac7/metadata.xml8
-rw-r--r--sci-chemistry/mopac7/mopac7-1.15-r1.ebuild66
-rw-r--r--sci-chemistry/mopac7/mopac7-1.15.ebuild75
-rw-r--r--sci-chemistry/mosflm/Manifest1
-rw-r--r--sci-chemistry/mosflm/files/7.0.6-Makefile.patch13
-rw-r--r--sci-chemistry/mosflm/files/7.0.6-impl-dec.patch36
-rw-r--r--sci-chemistry/mosflm/files/7.0.6-parallel.patch28
-rw-r--r--sci-chemistry/mosflm/files/7.0.7-parallel.patch92
-rw-r--r--sci-chemistry/mosflm/files/7.0.9-parallel.patch92
-rw-r--r--sci-chemistry/mosflm/files/mosflm-7.0.7-buffer-overflow.patch16
-rw-r--r--sci-chemistry/mosflm/files/mosflm-7.0.7-impl-dec.patch29
-rw-r--r--sci-chemistry/mosflm/files/mosflm-7.0.9-buffer-overflow.patch16
-rw-r--r--sci-chemistry/mosflm/metadata.xml8
-rw-r--r--sci-chemistry/mosflm/mosflm-7.0.9.ebuild74
-rw-r--r--sci-chemistry/mpqc/Manifest1
-rw-r--r--sci-chemistry/mpqc/files/mpqc-2.3.1-as-needed.patch163
-rw-r--r--sci-chemistry/mpqc/files/mpqc-2.3.1-blas.patch55
-rw-r--r--sci-chemistry/mpqc/files/mpqc-2.3.1-respect-ldflags.patch25
-rw-r--r--sci-chemistry/mpqc/files/mpqc-2.3.1-test-failure-hack.patch11
-rw-r--r--sci-chemistry/mpqc/metadata.xml8
-rw-r--r--sci-chemistry/mpqc/mpqc-2.3.1-r1.ebuild93
-rw-r--r--sci-chemistry/mpqc/mpqc-2.3.1-r2.ebuild103
-rw-r--r--sci-chemistry/mpqc/mpqc-2.3.1-r3.ebuild107
-rw-r--r--sci-chemistry/mrbump/Manifest1
-rw-r--r--sci-chemistry/mrbump/files/0.4.4-superpose.patch11
-rw-r--r--sci-chemistry/mrbump/metadata.xml10
-rw-r--r--sci-chemistry/mrbump/mrbump-0.4.4.ebuild57
-rw-r--r--sci-chemistry/msms-bin/Manifest2
-rw-r--r--sci-chemistry/msms-bin/metadata.xml8
-rw-r--r--sci-chemistry/msms-bin/msms-bin-2.6.1-r1.ebuild45
-rw-r--r--sci-chemistry/mustang/Manifest1
-rw-r--r--sci-chemistry/mustang/files/mustang-3-gcc43.patch55
-rw-r--r--sci-chemistry/mustang/files/mustang-3.2.1-gcc-4.7.patch16
-rw-r--r--sci-chemistry/mustang/metadata.xml5
-rw-r--r--sci-chemistry/mustang/mustang-3.2.1.ebuild49
-rw-r--r--sci-chemistry/namd/Manifest2
-rw-r--r--sci-chemistry/namd/files/namd-2.10-gentoo.patch124
-rw-r--r--sci-chemistry/namd/files/namd-2.6-gentoo.patch107
-rw-r--r--sci-chemistry/namd/files/namd-2.7-gentoo.patch117
-rw-r--r--sci-chemistry/namd/files/namd-2.7-iml-dec.patch24
-rw-r--r--sci-chemistry/namd/files/namd-2.7-ldflags.patch41
-rw-r--r--sci-chemistry/namd/files/namd-2.7_beta2-gentoo.patch126
-rw-r--r--sci-chemistry/namd/files/namd-2.9-gentoo.patch151
-rw-r--r--sci-chemistry/namd/files/namd-barrier-fix-gentoo.patch61
-rw-r--r--sci-chemistry/namd/files/namd-fftw-lib-gentoo.patch15
-rw-r--r--sci-chemistry/namd/files/namd-makefile-gentoo.patch88
-rw-r--r--sci-chemistry/namd/files/namd-tcl-lib-gentoo.patch16
-rw-r--r--sci-chemistry/namd/metadata.xml9
-rw-r--r--sci-chemistry/namd/namd-2.10.ebuild105
-rw-r--r--sci-chemistry/namd/namd-2.9-r1.ebuild105
-rw-r--r--sci-chemistry/nmrglue/Manifest2
-rw-r--r--sci-chemistry/nmrglue/files/nmrglue-0.5-nohyper.patch33
-rw-r--r--sci-chemistry/nmrglue/metadata.xml29
-rw-r--r--sci-chemistry/nmrglue/nmrglue-0.4.ebuild25
-rw-r--r--sci-chemistry/nmrglue/nmrglue-0.5-r1.ebuild36
-rw-r--r--sci-chemistry/numbat/Manifest1
-rw-r--r--sci-chemistry/numbat/files/numbat-0.999-gnuplot.patch42
-rw-r--r--sci-chemistry/numbat/metadata.xml19
-rw-r--r--sci-chemistry/numbat/numbat-0.999-r1.ebuild53
-rw-r--r--sci-chemistry/oasis/Manifest1
-rw-r--r--sci-chemistry/oasis/files/4.0-makefile.patch15
-rw-r--r--sci-chemistry/oasis/metadata.xml8
-rw-r--r--sci-chemistry/oasis/oasis-4.0-r3.ebuild70
-rw-r--r--sci-chemistry/openbabel-perl/Manifest1
-rw-r--r--sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-makefile.patch28
-rw-r--r--sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-swig.patch25
-rw-r--r--sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.1-makefile.patch9
-rw-r--r--sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-bindings_only.patch108
-rw-r--r--sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-trunk_cmake.patch41
-rw-r--r--sci-chemistry/openbabel-perl/metadata.xml15
-rw-r--r--sci-chemistry/openbabel-perl/openbabel-perl-2.3.2.ebuild65
-rw-r--r--sci-chemistry/openbabel-python/Manifest1
-rw-r--r--sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-bindings_only.patch209
-rw-r--r--sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-swig-3.0.3.patch97
-rw-r--r--sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-testpybel.patch28
-rw-r--r--sci-chemistry/openbabel-python/metadata.xml15
-rw-r--r--sci-chemistry/openbabel-python/openbabel-python-2.3.2.ebuild90
-rw-r--r--sci-chemistry/openbabel/Manifest1
-rw-r--r--sci-chemistry/openbabel/files/openbabel-2.3.2-test_lib_path.patch27
-rw-r--r--sci-chemistry/openbabel/metadata.xml14
-rw-r--r--sci-chemistry/openbabel/openbabel-2.3.2.ebuild82
-rw-r--r--sci-chemistry/ortep3/Manifest1
-rw-r--r--sci-chemistry/ortep3/metadata.xml5
-rw-r--r--sci-chemistry/ortep3/ortep3-1.0.3-r1.ebuild37
-rw-r--r--sci-chemistry/p3d/Manifest1
-rw-r--r--sci-chemistry/p3d/metadata.xml21
-rw-r--r--sci-chemistry/p3d/p3d-0.4.3.ebuild35
-rw-r--r--sci-chemistry/p3d/p3d-9999.ebuild30
-rw-r--r--sci-chemistry/parassign/Manifest1
-rw-r--r--sci-chemistry/parassign/metadata.xml27
-rw-r--r--sci-chemistry/parassign/parassign-20130522.ebuild65
-rw-r--r--sci-chemistry/pdb-extract/Manifest2
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.004-Makefile.patch46
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.004-cflags-install.patch199
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.004-env.patch11
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.004-gcc-4.3.patch20
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.11-cflags-install.patch207
-rw-r--r--sci-chemistry/pdb-extract/files/pdb-extract-3.11-gcc-4.7.patch64
-rw-r--r--sci-chemistry/pdb-extract/metadata.xml5
-rw-r--r--sci-chemistry/pdb-extract/pdb-extract-3.004-r2.ebuild71
-rw-r--r--sci-chemistry/pdb-extract/pdb-extract-3.11.ebuild60
-rw-r--r--sci-chemistry/pdb-tools/Manifest1
-rw-r--r--sci-chemistry/pdb-tools/metadata.xml11
-rw-r--r--sci-chemistry/pdb-tools/pdb-tools-0.2.1-r1.ebuild80
-rw-r--r--sci-chemistry/pdb-tools/pdb-tools-0.2.1-r2.ebuild84
-rw-r--r--sci-chemistry/pdb2pqr/Manifest1
-rw-r--r--sci-chemistry/pdb2pqr/files/pdb2pka13
-rw-r--r--sci-chemistry/pdb2pqr/files/pdb2pqr13
-rw-r--r--sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-flags.patch45
-rw-r--r--sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-install-py.patch15
-rw-r--r--sci-chemistry/pdb2pqr/metadata.xml12
-rw-r--r--sci-chemistry/pdb2pqr/pdb2pqr-1.9.0-r1.ebuild130
-rw-r--r--sci-chemistry/pdbcat/Manifest1
-rw-r--r--sci-chemistry/pdbcat/files/CMakeLists.txt11
-rw-r--r--sci-chemistry/pdbcat/files/pdbcat-1.3-gcc.patch17
-rw-r--r--sci-chemistry/pdbcat/metadata.xml24
-rw-r--r--sci-chemistry/pdbcat/pdbcat-1.3.ebuild24
-rw-r--r--sci-chemistry/pdbcns/Manifest1
-rw-r--r--sci-chemistry/pdbcns/metadata.xml8
-rw-r--r--sci-chemistry/pdbcns/pdbcns-2.0.010504.ebuild26
-rw-r--r--sci-chemistry/pdbmat/Manifest1
-rw-r--r--sci-chemistry/pdbmat/files/CMakeLists.txt14
-rw-r--r--sci-chemistry/pdbmat/metadata.xml24
-rw-r--r--sci-chemistry/pdbmat/pdbmat-3.89.ebuild29
-rw-r--r--sci-chemistry/phaser/Manifest1
-rw-r--r--sci-chemistry/phaser/files/phaser-2.1.4-chmod.patch13
-rw-r--r--sci-chemistry/phaser/metadata.xml9
-rw-r--r--sci-chemistry/phaser/phaser-2.1.4.ebuild115
-rw-r--r--sci-chemistry/platon/Manifest1
-rw-r--r--sci-chemistry/platon/files/20110126-buffer-overflow.patch15
-rw-r--r--sci-chemistry/platon/metadata.xml5
-rw-r--r--sci-chemistry/platon/platon-20110126.ebuild77
-rw-r--r--sci-chemistry/pointless/Manifest2
-rw-r--r--sci-chemistry/pointless/files/1.5.1-gcc4.4.patch12
-rw-r--r--sci-chemistry/pointless/metadata.xml8
-rw-r--r--sci-chemistry/pointless/pointless-1.6.14-r1.ebuild56
-rw-r--r--sci-chemistry/pointless/pointless-1.6.14.ebuild60
-rw-r--r--sci-chemistry/pointless/pointless-1.6.2.ebuild60
-rw-r--r--sci-chemistry/povscript+/Manifest2
-rw-r--r--sci-chemistry/povscript+/files/povscript+-2.1.2.2.19-libpng15.patch19
-rw-r--r--sci-chemistry/povscript+/metadata.xml5
-rw-r--r--sci-chemistry/povscript+/povscript+-2.1.2.2.19.ebuild55
-rw-r--r--sci-chemistry/povscript+/povscript+-2.1.2.2.20.ebuild56
-rw-r--r--sci-chemistry/prekin/Manifest1
-rw-r--r--sci-chemistry/prekin/files/6.51.081122-Makefile.patch41
-rw-r--r--sci-chemistry/prekin/files/6.51.081122-overflow.patch28
-rw-r--r--sci-chemistry/prekin/metadata.xml5
-rw-r--r--sci-chemistry/prekin/prekin-6.51.081122-r1.ebuild53
-rw-r--r--sci-chemistry/probe/Manifest2
-rw-r--r--sci-chemistry/probe/files/2.12.110413-as-needed.patch38
-rw-r--r--sci-chemistry/probe/files/as-needed.patch21
-rw-r--r--sci-chemistry/probe/files/probe-2.13.110909-as-needed.patch25
-rw-r--r--sci-chemistry/probe/metadata.xml5
-rw-r--r--sci-chemistry/probe/probe-2.12.110413.ebuild38
-rw-r--r--sci-chemistry/probe/probe-2.13.110909.ebuild34
-rw-r--r--sci-chemistry/procheck/Manifest3
-rw-r--r--sci-chemistry/procheck/files/3.5.4-ldflags.patch49
-rw-r--r--sci-chemistry/procheck/files/procheck-3.5.4-close.patch35
-rw-r--r--sci-chemistry/procheck/metadata.xml9
-rw-r--r--sci-chemistry/procheck/procheck-3.5.4-r1.ebuild87
-rw-r--r--sci-chemistry/procheck/procheck-3.5.4-r2.ebuild88
-rw-r--r--sci-chemistry/prodecomp/Manifest1
-rw-r--r--sci-chemistry/prodecomp/metadata.xml18
-rw-r--r--sci-chemistry/prodecomp/prodecomp-3.0.ebuild46
-rw-r--r--sci-chemistry/propka/Manifest1
-rw-r--r--sci-chemistry/propka/metadata.xml8
-rw-r--r--sci-chemistry/propka/propka-3.1_p140511.ebuild38
-rw-r--r--sci-chemistry/psi/Manifest1
-rw-r--r--sci-chemistry/psi/files/3.4.0-destdir.patch41
-rw-r--r--sci-chemistry/psi/files/3.4.0-dont-build-libint.patch13
-rw-r--r--sci-chemistry/psi/files/3.4.0-fortify.patch58
-rw-r--r--sci-chemistry/psi/files/3.4.0-gcc-4.3.patch293
-rw-r--r--sci-chemistry/psi/files/3.4.0-ldflags.patch21
-rw-r--r--sci-chemistry/psi/files/3.4.0-man_paths.patch25
-rw-r--r--sci-chemistry/psi/files/3.4.0-parallel_fix.patch400
-rw-r--r--sci-chemistry/psi/files/psi-3.4.0-parallel-make.patch19
-rw-r--r--sci-chemistry/psi/files/use-external-libint.patch37
-rw-r--r--sci-chemistry/psi/metadata.xml8
-rw-r--r--sci-chemistry/psi/psi-3.4.0-r2.ebuild81
-rw-r--r--sci-chemistry/pymol-apbs-plugin/Manifest4
-rw-r--r--sci-chemistry/pymol-apbs-plugin/files/pymol-apbs-plugin-2.1_p26-tcltk8.6.patch176
-rw-r--r--sci-chemistry/pymol-apbs-plugin/metadata.xml8
-rw-r--r--sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p15.ebuild57
-rw-r--r--sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p18.ebuild57
-rw-r--r--sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p24.ebuild57
-rw-r--r--sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26-r1.ebuild56
-rw-r--r--sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26.ebuild56
-rw-r--r--sci-chemistry/pymol-plugins-bni-tools/Manifest2
-rw-r--r--sci-chemistry/pymol-plugins-bni-tools/metadata.xml12
-rw-r--r--sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.25.1.ebuild41
-rw-r--r--sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.27.ebuild35
-rw-r--r--sci-chemistry/pymol-plugins-caver/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-caver/metadata.xml5
-rw-r--r--sci-chemistry/pymol-plugins-caver/pymol-plugins-caver-2.1.2.ebuild54
-rw-r--r--sci-chemistry/pymol-plugins-dssp/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-dssp/metadata.xml8
-rw-r--r--sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430-r1.ebuild39
-rw-r--r--sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430.ebuild49
-rw-r--r--sci-chemistry/pymol-plugins-dynamics/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-dynamics/metadata.xml11
-rw-r--r--sci-chemistry/pymol-plugins-dynamics/pymol-plugins-dynamics-1.2.0.ebuild43
-rw-r--r--sci-chemistry/pymol-plugins-emovie/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-emovie/files/1.0.4-indent.patch22
-rw-r--r--sci-chemistry/pymol-plugins-emovie/metadata.xml8
-rw-r--r--sci-chemistry/pymol-plugins-emovie/pymol-plugins-emovie-1.0.4.ebuild54
-rw-r--r--sci-chemistry/pymol-plugins-msms/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-msms/files/100415-msms.patch33
-rw-r--r--sci-chemistry/pymol-plugins-msms/metadata.xml17
-rw-r--r--sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415-r1.ebuild42
-rw-r--r--sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415.ebuild54
-rw-r--r--sci-chemistry/pymol-plugins-promol/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-promol/metadata.xml7
-rw-r--r--sci-chemistry/pymol-plugins-promol/pymol-plugins-promol-3.0.2-r1.ebuild61
-rw-r--r--sci-chemistry/pymol-plugins-psico/Manifest1
-rw-r--r--sci-chemistry/pymol-plugins-psico/metadata.xml11
-rw-r--r--sci-chemistry/pymol-plugins-psico/pymol-plugins-psico-3.1-r1.ebuild43
-rw-r--r--sci-chemistry/pymol/Manifest4
-rw-r--r--sci-chemistry/pymol/files/pymol-1.7.3.1-maeffplugin.cpp.patch11
-rw-r--r--sci-chemistry/pymol/metadata.xml12
-rw-r--r--sci-chemistry/pymol/pymol-1.7.0.1.ebuild101
-rw-r--r--sci-chemistry/pymol/pymol-1.7.4.0.ebuild106
-rw-r--r--sci-chemistry/pymol/pymol-1.7.6.0.ebuild113
-rw-r--r--sci-chemistry/rasmol/Manifest1
-rw-r--r--sci-chemistry/rasmol/files/2.7.5-bundled-lib.patch80
-rw-r--r--sci-chemistry/rasmol/files/rasmol-2.7.5.2-format-security.patch39
-rw-r--r--sci-chemistry/rasmol/files/rasmol-2.7.5.2-glib.h.patch31
-rw-r--r--sci-chemistry/rasmol/files/rasmol-2.7.5.2-longlong.patch12
-rw-r--r--sci-chemistry/rasmol/metadata.xml8
-rw-r--r--sci-chemistry/rasmol/rasmol-2.7.5.2-r2.ebuild107
-rw-r--r--sci-chemistry/raster3d/Manifest2
-rw-r--r--sci-chemistry/raster3d/files/2.9.1-as-needed.patch41
-rw-r--r--sci-chemistry/raster3d/files/3.0.2-as-needed.patch50
-rw-r--r--sci-chemistry/raster3d/files/3.0.2-gentoo-prefix.patch24
-rw-r--r--sci-chemistry/raster3d/files/raster3d-gcc-4.1-gentoo.patch74
-rw-r--r--sci-chemistry/raster3d/metadata.xml11
-rw-r--r--sci-chemistry/raster3d/raster3d-3.0.2.ebuild107
-rw-r--r--sci-chemistry/raster3d/raster3d-3.0.3.ebuild107
-rw-r--r--sci-chemistry/reduce/Manifest3
-rw-r--r--sci-chemistry/reduce/files/3.13.080428-CFLAGS.patch22
-rw-r--r--sci-chemistry/reduce/files/3.13.080428-LDFLAGS.patch11
-rw-r--r--sci-chemistry/reduce/files/3.14.080821-CFLAGS.patch22
-rw-r--r--sci-chemistry/reduce/metadata.xml5
-rw-r--r--sci-chemistry/reduce/reduce-3.13.080428-r1.ebuild54
-rw-r--r--sci-chemistry/reduce/reduce-3.14.080821.ebuild51
-rw-r--r--sci-chemistry/reduce/reduce-3.16.111118.ebuild51
-rw-r--r--sci-chemistry/refmac/Manifest2
-rw-r--r--sci-chemistry/refmac/files/5.5-test.log.patch32
-rw-r--r--sci-chemistry/refmac/files/5.5.0110-allow-dynamic-linking.patch84
-rw-r--r--sci-chemistry/refmac/files/5.5.0110-gcc4.6.patch17
-rw-r--r--sci-chemistry/refmac/files/5.6.0110-allow-dynamic-linking.patch341
-rw-r--r--sci-chemistry/refmac/files/5.6.0116-allow-dynamic-linking.patch341
-rw-r--r--sci-chemistry/refmac/metadata.xml9
-rw-r--r--sci-chemistry/refmac/refmac-5.5.0110-r3.ebuild85
-rw-r--r--sci-chemistry/relax/Manifest5
-rw-r--r--sci-chemistry/relax/metadata.xml30
-rw-r--r--sci-chemistry/relax/relax-3.3.4.ebuild69
-rw-r--r--sci-chemistry/relax/relax-3.3.5.ebuild69
-rw-r--r--sci-chemistry/relax/relax-3.3.6.ebuild73
-rw-r--r--sci-chemistry/relax/relax-3.3.7.ebuild73
-rw-r--r--sci-chemistry/relax/relax-3.3.8.ebuild71
-rw-r--r--sci-chemistry/scala/Manifest1
-rw-r--r--sci-chemistry/scala/files/3.3.18-gcc4.6.patch17
-rw-r--r--sci-chemistry/scala/files/Makefile.am7
-rw-r--r--sci-chemistry/scala/files/configure.ac14
-rw-r--r--sci-chemistry/scala/metadata.xml13
-rw-r--r--sci-chemistry/scala/scala-3.3.20.ebuild38
-rw-r--r--sci-chemistry/sfcheck/Manifest1
-rw-r--r--sci-chemistry/sfcheck/files/7.03.17-ldflags.patch12
-rw-r--r--sci-chemistry/sfcheck/metadata.xml5
-rw-r--r--sci-chemistry/sfcheck/sfcheck-7.03.18-r1.ebuild42
-rw-r--r--sci-chemistry/shelx/Manifest18
-rw-r--r--sci-chemistry/shelx/files/20060317-autotool.patch47
-rw-r--r--sci-chemistry/shelx/files/20060317-gfortran.patch20
-rw-r--r--sci-chemistry/shelx/metadata.xml5
-rw-r--r--sci-chemistry/shelx/shelx-20141228.ebuild60
-rw-r--r--sci-chemistry/solve-resolve-bin/Manifest2
-rw-r--r--sci-chemistry/solve-resolve-bin/metadata.xml8
-rw-r--r--sci-chemistry/solve-resolve-bin/solve-resolve-bin-2.13.ebuild68
-rw-r--r--sci-chemistry/sparky/Manifest1
-rw-r--r--sci-chemistry/sparky/files/3.115-fpic.patch42
-rw-r--r--sci-chemistry/sparky/files/3.115-ldflags.patch61
-rw-r--r--sci-chemistry/sparky/files/3.115-makefile.patch17
-rw-r--r--sci-chemistry/sparky/files/3.115-paths.patch13
-rw-r--r--sci-chemistry/sparky/files/3.115-wrapper-r1.patch41
-rw-r--r--sci-chemistry/sparky/files/3.115-wrapper.patch41
-rw-r--r--sci-chemistry/sparky/files/fix-install.patch259
-rw-r--r--sci-chemistry/sparky/metadata.xml8
-rw-r--r--sci-chemistry/sparky/sparky-3.115-r1.ebuild119
-rw-r--r--sci-chemistry/suitename/Manifest1
-rw-r--r--sci-chemistry/suitename/metadata.xml22
-rw-r--r--sci-chemistry/suitename/suitename-0.3.070628.ebuild37
-rw-r--r--sci-chemistry/surf/Manifest1
-rw-r--r--sci-chemistry/surf/metadata.xml5
-rw-r--r--sci-chemistry/surf/surf-1.0.ebuild44
-rw-r--r--sci-chemistry/theseus/Manifest3
-rw-r--r--sci-chemistry/theseus/metadata.xml8
-rw-r--r--sci-chemistry/theseus/theseus-2.0.6.ebuild65
-rw-r--r--sci-chemistry/theseus/theseus-3.0.0.ebuild70
-rw-r--r--sci-chemistry/theseus/theseus-3.3.0.ebuild70
-rw-r--r--sci-chemistry/threeV/Manifest1
-rw-r--r--sci-chemistry/threeV/files/1.2-gentoo.patch107
-rw-r--r--sci-chemistry/threeV/metadata.xml8
-rw-r--r--sci-chemistry/threeV/threeV-1.2.ebuild34
-rw-r--r--sci-chemistry/tinker/Manifest1
-rw-r--r--sci-chemistry/tinker/files/5.1.09-Makefile.patch13
-rw-r--r--sci-chemistry/tinker/files/6-openmp.patch15
-rw-r--r--sci-chemistry/tinker/files/7.1.2-openmp.patch15
-rw-r--r--sci-chemistry/tinker/files/tinker-7.1.2-build.patch17
-rw-r--r--sci-chemistry/tinker/metadata.xml5
-rw-r--r--sci-chemistry/tinker/tinker-7.1.2.ebuild104
-rw-r--r--sci-chemistry/tm-align/Manifest1
-rw-r--r--sci-chemistry/tm-align/files/CMakeLists.txt6
-rw-r--r--sci-chemistry/tm-align/metadata.xml24
-rw-r--r--sci-chemistry/tm-align/tm-align-20140601.ebuild25
-rw-r--r--sci-chemistry/viewmol/Manifest1
-rw-r--r--sci-chemistry/viewmol/files/2.4.1-change-default-path-to-usr.patch11
-rw-r--r--sci-chemistry/viewmol/files/2.4.1-change-default-paths.patch68
-rw-r--r--sci-chemistry/viewmol/files/2.4.1-look-for-python-in-right-place.patch20
-rw-r--r--sci-chemistry/viewmol/files/2.4.1-remove-icc-check.patch23
-rw-r--r--sci-chemistry/viewmol/files/2.4.1-use-root-for-app-defaults.patch20
-rw-r--r--sci-chemistry/viewmol/metadata.xml8
-rw-r--r--sci-chemistry/viewmol/viewmol-2.4.1-r2.ebuild87
-rw-r--r--sci-chemistry/vmd/Manifest2
-rw-r--r--sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch28
-rw-r--r--sci-chemistry/vmd/files/vmd-1.9.1-tcl8.6.patch25
-rw-r--r--sci-chemistry/vmd/files/vmd-1.9.2-format-security.patch16
-rw-r--r--sci-chemistry/vmd/metadata.xml16
-rw-r--r--sci-chemistry/vmd/vmd-1.9.2.ebuild250
-rw-r--r--sci-chemistry/votca-csg/Manifest6
-rw-r--r--sci-chemistry/votca-csg/metadata.xml17
-rw-r--r--sci-chemistry/votca-csg/votca-csg-1.2.2.ebuild87
-rw-r--r--sci-chemistry/votca-csg/votca-csg-1.2.4-r1.ebuild96
-rw-r--r--sci-chemistry/votca-csgapps/Manifest2
-rw-r--r--sci-chemistry/votca-csgapps/files/votca-csgapps-1.2.2-dso.patch266
-rw-r--r--sci-chemistry/votca-csgapps/metadata.xml12
-rw-r--r--sci-chemistry/votca-csgapps/votca-csgapps-1.2.2.ebuild31
-rw-r--r--sci-chemistry/votca-csgapps/votca-csgapps-1.2.4.ebuild28
-rw-r--r--sci-chemistry/wxmacmolplt/Manifest2
-rw-r--r--sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.4.2-glew.patch12
-rw-r--r--sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.5-glew.patch12
-rw-r--r--sci-chemistry/wxmacmolplt/metadata.xml11
-rw-r--r--sci-chemistry/wxmacmolplt/wxmacmolplt-7.4.2.ebuild46
-rw-r--r--sci-chemistry/wxmacmolplt/wxmacmolplt-7.5.ebuild46
-rw-r--r--sci-chemistry/xds-bin/Manifest3
-rw-r--r--sci-chemistry/xds-bin/metadata.xml5
-rw-r--r--sci-chemistry/xds-bin/xds-bin-20150301.ebuild53
-rw-r--r--sci-chemistry/xdsgui/Manifest2
-rw-r--r--sci-chemistry/xdsgui/metadata.xml15
-rw-r--r--sci-chemistry/xdsgui/xdsgui-0_p130530.ebuild42
-rw-r--r--sci-chemistry/xdsi/Manifest1
-rw-r--r--sci-chemistry/xdsi/files/0.92-gentoo.patch27
-rw-r--r--sci-chemistry/xdsi/metadata.xml17
-rw-r--r--sci-chemistry/xdsi/xdsi-0.92-r1.ebuild54
-rw-r--r--sci-chemistry/xdsstat-bin/Manifest2
-rw-r--r--sci-chemistry/xdsstat-bin/metadata.xml8
-rw-r--r--sci-chemistry/xdsstat-bin/xdsstat-bin-140225.ebuild33
-rw-r--r--sci-chemistry/xia2/Manifest6
-rw-r--r--sci-chemistry/xia2/files/0.3.1.0-fix-syntax.patch61
-rw-r--r--sci-chemistry/xia2/files/0.3.1.6-fix-syntax.patch61
-rw-r--r--sci-chemistry/xia2/files/0.3.1.7-fix-syntax.patch61
-rw-r--r--sci-chemistry/xia2/files/0.3.3.1-fix-syntax.patch61
-rw-r--r--sci-chemistry/xia2/files/0.3.3.3-fix-syntax.patch28
-rw-r--r--sci-chemistry/xia2/files/0.3.4.0-fix-syntax.patch28
-rw-r--r--sci-chemistry/xia2/metadata.xml5
-rw-r--r--sci-chemistry/xia2/xia2-0.3.1.0.ebuild59
-rw-r--r--sci-chemistry/xia2/xia2-0.3.1.6.ebuild66
-rw-r--r--sci-chemistry/xia2/xia2-0.3.1.7.ebuild66
-rw-r--r--sci-chemistry/xia2/xia2-0.3.3.1.ebuild70
-rw-r--r--sci-chemistry/xia2/xia2-0.3.3.3.ebuild70
-rw-r--r--sci-chemistry/xia2/xia2-0.3.4.0.ebuild70
-rw-r--r--sci-chemistry/xyza2pipe/Manifest2
-rw-r--r--sci-chemistry/xyza2pipe/files/20101129-gentoo.patch152
-rw-r--r--sci-chemistry/xyza2pipe/files/xyza2pipe-20121001-gentoo.patch168
-rw-r--r--sci-chemistry/xyza2pipe/metadata.xml8
-rw-r--r--sci-chemistry/xyza2pipe/xyza2pipe-20101129.ebuild28
-rw-r--r--sci-chemistry/xyza2pipe/xyza2pipe-20121001.ebuild33
814 files changed, 39094 insertions, 0 deletions
diff --git a/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.1.ebuild b/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.1.ebuild
new file mode 100644
index 000000000000..ef7987d5d03e
--- /dev/null
+++ b/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+if [[ $PV = *9999* ]]; then
+ scm_eclass=git-2
+ EGIT_REPO_URI="
+ git://github.com/orbeckst/${PN}.git
+ https://github.com/orbeckst/${PN}.git"
+ EGIT_BRANCH="develop"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ scm_eclass=vcs-snapshot
+ SRC_URI="https://github.com/orbeckst/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+inherit eutils distutils-r1 ${scm_eclass}
+
+DESCRIPTION="Python framework for Gromacs"
+HOMEPAGE="http://orbeckst.github.com/GromacsWrapper/"
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND="
+ >=dev-python/matplotlib-0.91.3[${PYTHON_USEDEP}]
+ >=dev-python/RecSQL-0.3[${PYTHON_USEDEP}]
+ >=sci-libs/scipy-0.9[${PYTHON_USEDEP}]
+ "
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/0001-Drop-chmod-hack.patch"
+)
diff --git a/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.2.ebuild b/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.2.ebuild
new file mode 100644
index 000000000000..6d95361ce0f4
--- /dev/null
+++ b/sci-chemistry/GromacsWrapper/GromacsWrapper-0.3.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+if [[ $PV = *9999* ]]; then
+ scm_eclass=git-2
+ EGIT_REPO_URI="
+ git://github.com/orbeckst/${PN}.git
+ https://github.com/orbeckst/${PN}.git"
+ EGIT_BRANCH="develop"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ scm_eclass=vcs-snapshot
+ SRC_URI="https://github.com/orbeckst/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+inherit eutils distutils-r1 ${scm_eclass}
+
+DESCRIPTION="Python framework for Gromacs"
+HOMEPAGE="http://orbeckst.github.com/GromacsWrapper/"
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND="
+ >=dev-python/matplotlib-0.91.3[${PYTHON_USEDEP}]
+ >=dev-python/RecSQL-0.3[${PYTHON_USEDEP}]
+ >=sci-libs/scipy-0.9[${PYTHON_USEDEP}]
+ "
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/0001-Drop-chmod-hack.patch"
+)
diff --git a/sci-chemistry/GromacsWrapper/Manifest b/sci-chemistry/GromacsWrapper/Manifest
new file mode 100644
index 000000000000..4c77ff3c1ead
--- /dev/null
+++ b/sci-chemistry/GromacsWrapper/Manifest
@@ -0,0 +1,2 @@
+DIST GromacsWrapper-0.3.1.tar.gz 1575486 SHA256 ddd2668060668528878370961a9a33257cf3643fd0d9e9191b1d26d4f78e803b SHA512 655dae431bf575963af58a5f75abe6703fe1ecdddba5839b671d9237ddee0e33ab19b528e89bcba4db9063fe30622d44e8f47c7b6452b4d1eed8c7400873a012 WHIRLPOOL 3b848aff931190eabd49426d61186a3c1eef9779a9fabf95b4d21d47793e5543adbcba5ac2b39c8a9af7c2479930a8ea65bb336e2155dfca98378df56ba4cb3e
+DIST GromacsWrapper-0.3.2.tar.gz 1592147 SHA256 2fe0173275ca125a4260aa05f82746338f237766fe8aa998e85a5b40cf83e42c SHA512 a9e0abb5e7ad0c6831e23b6a8c09c6e4cc74b33d66cd17df8e00b876dc275dda11c3d3723565d8d58c45bdf6b2b00323bf85e24e2d5324a8d8b597cc3e5d78a4 WHIRLPOOL 852d73d01e1060369521ec5ff5197c86daa30ae98f285fe5e3d392a315cff10c68e2ba54ec9a2659260cf6830cf17cb1e094eecbd63652e9c3f13fff8707a824
diff --git a/sci-chemistry/GromacsWrapper/files/0001-Drop-chmod-hack.patch b/sci-chemistry/GromacsWrapper/files/0001-Drop-chmod-hack.patch
new file mode 100644
index 000000000000..8645df77b86e
--- /dev/null
+++ b/sci-chemistry/GromacsWrapper/files/0001-Drop-chmod-hack.patch
@@ -0,0 +1,28 @@
+From 49b8d9662365e0e9b0725682b8a8479de402b272 Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Sat, 23 Mar 2013 16:40:04 +0400
+Subject: [PATCH] Drop chmod hack.
+
+It doesnt work if wrapper installed system-wide
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ gromacs/config.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/gromacs/config.py b/gromacs/config.py
+index cece6fc..2e686e7 100644
+--- a/gromacs/config.py
++++ b/gromacs/config.py
+@@ -619,8 +619,6 @@ del g
+ # Must extract because it is part of a zipped python egg;
+ # see http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources
+ GridMAT_MD = resource_filename(__name__,'external/GridMAT-MD_v1.0.2/GridMAT-MD.pl')
+-os.chmod(GridMAT_MD, 0755)
+-
+
+ #: 3rd party bundled analysis scripts and tools; this is a list of triplets of
+ #:
+--
+1.8.1.5
+
diff --git a/sci-chemistry/GromacsWrapper/metadata.xml b/sci-chemistry/GromacsWrapper/metadata.xml
new file mode 100644
index 000000000000..43390c98619e
--- /dev/null
+++ b/sci-chemistry/GromacsWrapper/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>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">orbeckst/GromacsWrapper</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/PyMca/Manifest b/sci-chemistry/PyMca/Manifest
new file mode 100644
index 000000000000..c6899e234b21
--- /dev/null
+++ b/sci-chemistry/PyMca/Manifest
@@ -0,0 +1 @@
+DIST pymca4.6.2-src.tgz 15979581 SHA256 c50d3a54cad633bac3ec361d1b3b63a78292f1ad4ed976e5206665edd76bc32d SHA512 e33188b446c399e50cf65ebca4bfeef34e1b7d99c331f670dc41ca204284fbba996a1c83bd12a2410a9972927aa9c92b42b5374c58c924b3a8583d4f37be6528 WHIRLPOOL 47f0491aa0e470661bea1aa247d1db730f1db7266f1d2be2272d08f203faa2a084bcb40d579861365ace26d2f94abe03485183eed03139ad7b697cf57bfa5324
diff --git a/sci-chemistry/PyMca/PyMca-4.6.2-r1.ebuild b/sci-chemistry/PyMca/PyMca-4.6.2-r1.ebuild
new file mode 100644
index 000000000000..449f9b5ab220
--- /dev/null
+++ b/sci-chemistry/PyMca/PyMca-4.6.2-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+MY_PV="${PV/_}"
+
+DESCRIPTION="X-ray Fluorescence Toolkit"
+HOMEPAGE="http://pymca.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/pymca/pymca/${PN}${PV/_p1}/pymca${MY_PV}-src.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="X hdf5 matplotlib"
+
+DEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyopengl[${PYTHON_USEDEP}]
+ dev-python/sip[${PYTHON_USEDEP}]
+ virtual/opengl
+ X? (
+ dev-python/PyQt4[${PYTHON_USEDEP}]
+ dev-python/pyqwt[${PYTHON_USEDEP}]
+ )
+ hdf5? ( dev-python/h5py[${PYTHON_USEDEP}] )
+ matplotlib? ( dev-python/matplotlib[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+#S="${WORKDIR}/${PN}${MY_PV}"
+
+python_prepare_all() {
+ local PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+ export SPECFILE_USE_GNU_SOURCE=1
+ distutils-r1_python_prepare_all
+}
diff --git a/sci-chemistry/PyMca/PyMca-4.6.2.ebuild b/sci-chemistry/PyMca/PyMca-4.6.2.ebuild
new file mode 100644
index 000000000000..b1e6d2f50524
--- /dev/null
+++ b/sci-chemistry/PyMca/PyMca-4.6.2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-pypy-*"
+
+inherit distutils eutils
+
+MY_PV="${PV/_}"
+
+DESCRIPTION="X-ray Fluorescence Toolkit"
+HOMEPAGE="http://pymca.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/pymca/pymca/${PN}${PV/_p1}/pymca${MY_PV}-src.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="X hdf5 matplotlib"
+
+DEPEND="
+ dev-python/numpy
+ dev-python/sip
+ virtual/opengl
+ dev-python/pyopengl
+ X? (
+ dev-python/PyQt4
+ dev-python/pyqwt
+ )
+ hdf5? ( dev-python/h5py )
+ matplotlib? ( dev-python/matplotlib )"
+RDEPEND="${DEPEND}"
+
+#S="${WORKDIR}/${PN}${MY_PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ export SPECFILE_USE_GNU_SOURCE=1
+ distutils_src_prepare
+}
diff --git a/sci-chemistry/PyMca/files/4.4.1_p1-gentoo.patch b/sci-chemistry/PyMca/files/4.4.1_p1-gentoo.patch
new file mode 100644
index 000000000000..487a45963d21
--- /dev/null
+++ b/sci-chemistry/PyMca/files/4.4.1_p1-gentoo.patch
@@ -0,0 +1,40 @@
+diff --git a/setup.py b/setup.py
+index 0b0fa58..a4fdab6 100755
+--- a/setup.py
++++ b/setup.py
+@@ -41,34 +41,8 @@ for line in file(os.path.join('PyMca', 'PyMcaMain.py')).readlines():
+ print "PyMca X-Ray Fluorescence Toolkit %s" % __version__
+ print
+
+-print "Type 'L' to view the license."
+-print "Type 'yes' to accept the terms of the license."
+-print "Type 'no' to decline the terms of the license."
+-print
+-
+-while 1:
+- try:
+- resp = raw_input("Do you accept the terms of the license? ")
+- except KeyboardInterrupt:
+- raise SystemExit
+- except:
+- resp = ""
+-
+- resp = string.lower(string.strip(resp))
+-
+- if resp == "yes":
+- break
+-
+- if resp == "no":
+- sys.exit(1)
+-
+- if resp == "l":
+- os.system("more LICENSE.GPL")
+-
+-
+ # Specify all the required PyMca data
+-data_files = [('PyMca', ['LICENSE.GPL',
+- 'PyMca/Scofield1973.dict',
++data_files = [('PyMca', ['PyMca/Scofield1973.dict',
+ 'PyMca/changelog.txt',
+ 'PyMca/McaTheory.cfg',
+ 'PyMca/PyMcaSplashImage.png',
diff --git a/sci-chemistry/PyMca/files/4.4.1_p1-impl-dec.patch b/sci-chemistry/PyMca/files/4.4.1_p1-impl-dec.patch
new file mode 100644
index 000000000000..ea37348066d2
--- /dev/null
+++ b/sci-chemistry/PyMca/files/4.4.1_p1-impl-dec.patch
@@ -0,0 +1,12 @@
+diff --git a/PyMca/specfile/src/sfwrite.c b/PyMca/specfile/src/sfwrite.c
+index 24df907..93c18e9 100755
+--- a/PyMca/specfile/src/sfwrite.c
++++ b/PyMca/specfile/src/sfwrite.c
+@@ -55,6 +55,7 @@
+ */
+ #include <SpecFile.h>
+ #include <SpecFileP.h>
++#include <unistd.h>
+
+ /*
+ * Declarations
diff --git a/sci-chemistry/PyMca/files/PyMca-4.6.2-gentoo.patch b/sci-chemistry/PyMca/files/PyMca-4.6.2-gentoo.patch
new file mode 100644
index 000000000000..81dfaf038fa6
--- /dev/null
+++ b/sci-chemistry/PyMca/files/PyMca-4.6.2-gentoo.patch
@@ -0,0 +1,16 @@
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 0a77cdf..e7ba643 100644
+--- a/setup.py
++++ b/setup.py
+@@ -55,7 +55,7 @@ packages = ['PyMca','PyMca.PyMcaPlugins', 'PyMca.tests']
+ py_modules = []
+
+ # Specify all the required PyMca data
+-data_files = [(PYMCA_DATA_DIR, ['LICENSE.GPL',
++data_files = [(PYMCA_DATA_DIR, [
+ 'PyMca/PyMcaData/Scofield1973.dict',
+ 'changelog.txt',
+ 'PyMca/PyMcaData/McaTheory.cfg',
diff --git a/sci-chemistry/PyMca/metadata.xml b/sci-chemistry/PyMca/metadata.xml
new file mode 100644
index 000000000000..91146f1d585b
--- /dev/null
+++ b/sci-chemistry/PyMca/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+The PyMca Toolkit is a collection of Python tools for visualization and
+analysis of energy-dispersive X-ray fluorescence data. It builds its graphic
+interface and plotting routines on top of the C++ libraries Qt and Qwt
+through their respective Python bindings PyQt and PyQwt. Nevertheless,
+the data analysis routines can be used independently of any graphical
+interface.
+</longdescription>
+ <use>
+ <flag name="matplotlib">Support for plotting through matplotlib</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">pymca</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/acpype/Manifest b/sci-chemistry/acpype/Manifest
new file mode 100644
index 000000000000..e1cd9723b479
--- /dev/null
+++ b/sci-chemistry/acpype/Manifest
@@ -0,0 +1,3 @@
+DIST acpype-366.tar.xz 539408 SHA256 f0c77abea0a5680ecbbecadc1a95c8f851159b7c84d079f6f527336d447e1e9d
+DIST acpype-374.tar.xz 521076 SHA256 60a15d1c29ba3254a17c0792ae859444641e7a9375bd24cdd8baccc27920fde3 SHA512 99915299b32878e2139f67503260b491e05f8a592c37c5668e5aea3414822965827a91e09578264cfb48684decbadfb60c833706b756ff277ffde8b15159391e WHIRLPOOL b4e59eec36438eb2ee6d05183a6f08200213923ff50fbff1377cd976c8e39cc24429eb727d890028af2b5b5ad90428c70a10821ae20b50f7fc494ff9163322a8
+DIST acpype-389.tar.xz 524460 SHA256 4fd4036308cd81a480beaa56ae65b43a8c5ee3bbfc64b07b4d0b6649602f529a SHA512 0fbcb83ae8306d6bcc1cfd921d70c67a15e14c443453ab8c4cfd7082c15b95599801abbe31a46313674aa4841c5cd5499b69cc080221acc2793dc808df247987 WHIRLPOOL 21c8ee51c651c7a519716c818b0febd5fd62384aeeb6a5ce0f8dcf877181edba75fdd15be0d5a158b5a22d051765fb231c7c10038b8da1bcd98bede848057e95
diff --git a/sci-chemistry/acpype/acpype-366.ebuild b/sci-chemistry/acpype/acpype-366.ebuild
new file mode 100644
index 000000000000..01a804da9cba
--- /dev/null
+++ b/sci-chemistry/acpype/acpype-366.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils python
+PYTHON_DEPEND="2:2.5"
+
+DESCRIPTION="AnteChamber PYthon Parser interfacE"
+HOMEPAGE="http://code.google.com/p/acpype/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE=""
+
+DEPEND="sci-chemistry/ambertools"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}.patch"
+ python_convert_shebangs -r 2 .
+}
+
+src_install() {
+ newbin ${PN}.py ${PN}
+ newbin CcpnToAcpype.py CcpnToAcpype
+ dodoc NOTE.txt README.txt
+ insinto /usr/share/${PN}
+ doins -r ffamber_additions test
+}
diff --git a/sci-chemistry/acpype/acpype-374.ebuild b/sci-chemistry/acpype/acpype-374.ebuild
new file mode 100644
index 000000000000..56036152102c
--- /dev/null
+++ b/sci-chemistry/acpype/acpype-374.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="2:2.5"
+
+inherit python
+
+DESCRIPTION="AnteChamber PYthon Parser interfacE"
+HOMEPAGE="http://code.google.com/p/acpype/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE=""
+
+DEPEND="sci-chemistry/ambertools"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ python_convert_shebangs -r 2 .
+}
+
+src_install() {
+ newbin ${PN}.py ${PN}
+ newbin CcpnToAcpype.py CcpnToAcpype
+ dodoc NOTE.txt README.txt
+ insinto /usr/share/${PN}
+ doins -r ffamber_additions test
+}
diff --git a/sci-chemistry/acpype/acpype-389.ebuild b/sci-chemistry/acpype/acpype-389.ebuild
new file mode 100644
index 000000000000..6ff35e1fcc47
--- /dev/null
+++ b/sci-chemistry/acpype/acpype-389.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1
+
+DESCRIPTION="AnteChamber PYthon Parser interfacE"
+HOMEPAGE="http://code.google.com/p/acpype/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ sci-chemistry/ambertools"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed \
+ -e '1s:^:#!/usr/bin/python\n\n:g' \
+ -i CcpnToAcpype.py || die
+}
+
+src_install() {
+ python_parallel_foreach_impl python_newscript ${PN}.py ${PN}
+ python_parallel_foreach_impl python_newscript CcpnToAcpype.py CcpnToAcpype
+ dodoc NOTE.txt README.txt
+ insinto /usr/share/${PN}
+ doins -r ffamber_additions test
+}
diff --git a/sci-chemistry/acpype/files/acpype.patch b/sci-chemistry/acpype/files/acpype.patch
new file mode 100644
index 000000000000..9354527cc8a9
--- /dev/null
+++ b/sci-chemistry/acpype/files/acpype.patch
@@ -0,0 +1,37 @@
+Index: acpype.py
+===================================================================
+--- acpype.py (revision 366)
++++ acpype.py (working copy)
+@@ -3020,32 +3020,6 @@
+ acMol2FileName = '%s_%s_%s.mol2' % (base, chargeType, atomType)
+ self.acMol2FileName = acMol2FileName
+ self.charmmBase = '%s_CHARMM' % base
+- # check for which version of antechamber
+- if 'amber10' in self.acExe:
+- if qprog == 'sqm':
+- self.printWarn("SQM is not implemented in AmberTools 1.2")
+- self.printWarn("Setting mopac for antechamber")
+- qprog = 'mopac'
+- elif qprog == 'divcon':
+- if not os.path.exists(os.path.join(os.path.dirname(self.acExe), qprog)):
+- self.printWarn("DIVCON is not installed")
+- self.printWarn("Setting mopac for antechamber")
+- qprog = 'mopac'
+- elif 'amber11' in self.acExe:
+- if qprog == 'divcon':
+- self.printWarn("DIVCON is not implemented in AmberTools 1.3 anymore")
+- self.printWarn("Setting sqm for antechamber")
+- qprog = 'sqm'
+- elif qprog == 'mopac':
+- if not os.path.exists(os.path.join(os.path.dirname(self.acExe), qprog)):
+- self.printWarn("MOPAC is not installed")
+- self.printWarn("Setting sqm for antechamber")
+- return None
+- qprog = 'sqm'
+- else:
+- self.printWarn("Old version of antechamber. Strongly consider upgrading to AmberTools")
+- self.printWarn("Setting mopac for antechamber")
+- qprog = 'mopac'
+ self.qFlag = qDict[qprog]
+ self.outTopols = [outTopol]
+ if outTopol == 'all':
diff --git a/sci-chemistry/acpype/metadata.xml b/sci-chemistry/acpype/metadata.xml
new file mode 100644
index 000000000000..13ef0bf5a17c
--- /dev/null
+++ b/sci-chemistry/acpype/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-chemistry</herd>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/ambertools/Manifest b/sci-chemistry/ambertools/Manifest
new file mode 100644
index 000000000000..747dbffa95d4
--- /dev/null
+++ b/sci-chemistry/ambertools/Manifest
@@ -0,0 +1,2 @@
+DIST AmberTools-1.5.tar.bz2 121062582 SHA256 0c7d397d2e91603bb9123ae68e91af3525269e60800ced360f68c13350651d7c
+DIST ambertools-1.5-bugfix_1-10.patch.xz 31708 SHA256 5773aaa8a2478ad478f0f3afafaa39669002c31ebe755c0d12ff277ce9ab8352
diff --git a/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild b/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild
new file mode 100644
index 000000000000..47adf6201db7
--- /dev/null
+++ b/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 multilib toolchain-funcs
+
+DESCRIPTION="A suite for carrying out complete molecular mechanics investigations"
+HOMEPAGE="http://ambermd.org/#AmberTools"
+SRC_URI="
+ AmberTools-${PV}.tar.bz2
+ mirror://gentoo/${P}-bugfix_1-10.patch.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE="mpi openmp static-libs X"
+
+RESTRICT="fetch"
+
+RDEPEND="
+ virtual/cblas
+ virtual/lapack
+ sci-libs/clapack
+ sci-libs/arpack
+ sci-libs/cifparse-obj
+ sci-chemistry/mopac7
+ sci-libs/netcdf
+ sci-libs/fftw:2.1
+ sci-chemistry/reduce"
+DEPEND="${RDEPEND}
+ dev-util/byacc
+ dev-libs/libf2c
+ sys-devel/ucpp
+ virtual/pkgconfig"
+S="${WORKDIR}/amber11"
+
+pkg_nofetch() {
+ einfo "Go to ${HOMEPAGE} and get ${A}"
+ einfo "Place it in ${DISTDIR}"
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ if use openmp; then
+ tc-has-openmp || \
+ die "Please select an openmp capable compiler like gcc[openmp]"
+ fi
+ AMBERHOME="${S}"
+}
+
+src_prepare() {
+ epatch \
+ "${WORKDIR}/${P}-bugfix_1-10.patch" \
+ "${FILESDIR}/${P}-gentoo.patch"
+ cd AmberTools/src
+ rm -r arpack blas lapack fftw-2.1.5 c9x-complex cifparse netcdf pnetcdf reduce ucpp-1.3 || die
+}
+
+src_configure() {
+ cd AmberTools/src
+ sed \
+ -e "s:\\\\\$(LIBDIR)/arpack.a:-larpack:g" \
+ -e "s:\\\\\$(LIBDIR)/lapack.a:$($(tc-getPKG_CONFIG) --libs lapack) -lclapack:g" \
+ -e "s:\\\\\$(LIBDIR)/blas.a:$($(tc-getPKG_CONFIG) --libs blas cblas):g" \
+ -e "s:\\\\\$(LIBDIR)/libdrfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \
+ -e "s:\\\\\$(LIBDIR)/libdfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \
+ -e "s:CFLAGS=:CFLAGS=${CFLAGS} -DBINTRAJ :g" \
+ -e "s:FFLAGS=:FFLAGS=${FFLAGS} :g" \
+ -e "s:LDFLAGS=$ldflags:LDFLAGS=${LDFLAGS}:g" \
+ -e "s:fc=g77:fc=$(tc-getFC):g" \
+ -e "s:\$netcdflib:$($(tc-getPKG_CONFIG) --libs netcdf):g" \
+ -e "s:NETCDF=\$netcdf:NETCDF=netcdf.mod:g" \
+ -e "s:-O3::g" \
+ -i configure || die
+ sed -e "s:arsecond_:arscnd_:g" \
+ -i sff/time.c \
+ -i sff/sff.h \
+ -i sff/sff.c || die
+ sed -e "s:\$(NAB):\$(NAB) -lrfftw:g" \
+ -i nss/Makefile || die
+
+ local myconf
+
+ use X || myconf="${myconf} -noX11"
+
+ for x in mpi openmp; do
+ use ${x} && myconf="${myconf} -${x}"
+ done
+
+ ./configure \
+ ${myconf} \
+ -nobintraj \
+ -nomdgx \
+ -nopython \
+ -nomtkpp \
+ gnu
+# $(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+}
+
+src_compile() {
+ cd AmberTools/src
+ emake
+}
+
+src_install() {
+ rm -r bin/chemistry bin/MMPBSA_mods
+ rm bin/ante-MMPBSA.py bin/extractFrcmod.py
+ for x in bin/*
+ do dobin ${x} || die
+ done
+ rm "${ED}/usr/bin/yacc"
+ dobin AmberTools/src/antechamber/mopac.sh
+ sed -e "s:\$AMBERHOME/bin/mopac:mopac7:g" \
+ -i "${ED}/usr/bin/mopac.sh" || die
+ # Make symlinks untill binpath for amber will be fixed
+ dodir /usr/share/${PN}/bin
+ cd "${ED}/usr/bin"
+ for x in *; do
+ dosym /usr/bin/${x} /usr/share/${PN}/bin/${x}
+ done
+ cd "${S}"
+# sed -e "s:\$AMBERHOME/dat:\$AMBERHOME/share/ambertools/dat:g" \
+# -i "${ED}/usr/bin/xleap" \
+# -i "${ED}/usr/bin/tleap" || die
+ dodoc doc/AmberTools.pdf doc/leap_pg.pdf
+
+ use static-libs && dolib.a lib/*
+
+ insinto /usr/include/${PN}
+ doins include/*
+
+ insinto /usr/share/${PN}
+ doins -r dat
+
+ cd AmberTools
+ doins -r benchmarks examples test
+
+ cat >> "${T}"/99ambertools <<- EOF
+ AMBERHOME="${EPREFIX}/usr/share/ambertools"
+ EOF
+ doenvd "${T}"/99ambertools
+}
diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-gentoo.patch b/sci-chemistry/ambertools/files/ambertools-1.5-gentoo.patch
new file mode 100644
index 000000000000..0e41d26d6f9c
--- /dev/null
+++ b/sci-chemistry/ambertools/files/ambertools-1.5-gentoo.patch
@@ -0,0 +1,386 @@
+diff -urN amber11.orig/AmberTools/src/configure amber11/AmberTools/src/configure
+--- amber11.orig/AmberTools/src/configure 2011-04-14 15:30:55.000000000 +0300
++++ amber11/AmberTools/src/configure 2011-06-04 12:26:45.000000000 +0300
+@@ -293,7 +293,8 @@
+ echo "Your AMBERHOME environment variable is not set! It should be set to"
+ echo "$ambhome NOT doing so may cause errors when you compile. Continue"
+ echo "anyway? (yes or no)"
+- read answer
++ #read answer
++ answer='yes'
+ if [ "$answer" = 'yes' -o "$answer" = 'Yes' -o "$answer" = 'YES' -o "$answer" = 'y' -o "$answer" = 'Y' ]; then
+ echo ""
+ echo "Continuing anyway... Setting AMBERHOME to $ambhome temporarily"
+@@ -356,11 +357,11 @@
+ mpi_flag=
+ lex=flex
+ flibs_mkl=
+-lapack=install
+-blas=install
++lapack=skip
++blas=skip
+ f2c=skip
+-ucpp=install
+-cpp="\$(BINDIR)/ucpp -l"
++ucpp=skip
++cpp="\$(EPREFIX)/usr/bin/ucpp -l"
+
+ #-----------------------------------
+ # skip building of sleap?
+@@ -1655,24 +1656,24 @@
+ #--------------------------------------------------------------------------
+ # Configure fftw-3.2.2:
+ #--------------------------------------------------------------------------
+- if [ "$mdgx" = 'yes' ]; then
+- mdgxflag="--prefix=$AMBERHOME --disable-fortran"
+- echo
+- echo "Configuring fftw-3.2.2 (may be time-consuming)..."
+- echo
+- cd fftw-3.2.2 && \
+- env CC="$cc" CFLAGS="$cflags $cnooptflags" \
+- ./configure $mdgxflag > ../fftw3_config.log 2>&1
+- ncerror=$?
+- if [ $ncerror -gt 0 ]; then
+- echo " Error: FFTW configure returned $ncerror"
+- echo " FFTW configure failed! Check the fftw3_config.log file."
+- exit 1
+- else
+- echo " fftw-3.2.2 configure succeeded."
+- fi
+- cd ..
+- fi
++ #if [ "$mdgx" = 'yes' ]; then
++ # mdgxflag="--prefix=$AMBERHOME --disable-fortran"
++ # echo
++ # echo "Configuring fftw-3.2.2 (may be time-consuming)..."
++ # echo
++ # cd fftw-3.2.2 && \
++ # env CC="$cc" CFLAGS="$cflags $cnooptflags" \
++ # ./configure $mdgxflag > ../fftw3_config.log 2>&1
++ # ncerror=$?
++ # if [ $ncerror -gt 0 ]; then
++ # echo " Error: FFTW configure returned $ncerror"
++ # echo " FFTW configure failed! Check the fftw3_config.log file."
++ # exit 1
++ # else
++ # echo " fftw-3.2.2 configure succeeded."
++ # fi
++ # cd ..
++ #fi
+
+ #--------------------------------------------------------------------------
+ # Configure python
+@@ -1792,27 +1793,27 @@
+ echo
+ echo "Configuring fftw-2.1.5 (may be time-consuming)..."
+ echo
+- cd fftw-2.1.5
+- if [ "$mpi" = 'yes' ]; then
+- ./configure $rismflag --enable-mpi \
+- CC="$cc" CFLAGS="$cflags $coptflags" \
+- F77="$fc" FFLAGS="$fflags $foptflags" \
+- FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
+- else
+- ./configure $rismflag \
+- CC="$cc" CFLAGS="$cflags $coptflags" \
+- F77="$fc" FFLAGS="$fflags $foptflags" \
+- FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
+- fi
+- ncerror=$?
+- if [ $ncerror -gt 0 ]; then
+- echo " Error: fftw configure returned $ncerror"
+- echo " fftw configure failed! Check the fftw2_config.log file."
+- exit 1
+- else
+- echo " fftw-2.1.5 configure succeeded."
+- fi
+- cd ..
++ # cd fftw-2.1.5
++ # if [ "$mpi" = 'yes' ]; then
++ # ./configure $rismflag --enable-mpi \
++ # CC="$cc" CFLAGS="$cflags $coptflags" \
++ # F77="$fc" FFLAGS="$fflags $foptflags" \
++ # FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
++ # else
++ # ./configure $rismflag \
++ # CC="$cc" CFLAGS="$cflags $coptflags" \
++ # F77="$fc" FFLAGS="$fflags $foptflags" \
++ # FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
++ # fi
++ # ncerror=$?
++ # if [ $ncerror -gt 0 ]; then
++ # echo " Error: fftw configure returned $ncerror"
++ # echo " fftw configure failed! Check the fftw2_config.log file."
++ # exit 1
++ # else
++ # echo " fftw-2.1.5 configure succeeded."
++ # fi
++ # cd ..
+ flibs_fftw2="-ldrfftw -ldfftw"
+ if [ "$mpi" = 'yes' ]; then
+ flibs_fftw2="-ldrfftw_mpi -ldfftw_mpi $flibs_fftw2"
+diff -urN amber11.orig/AmberTools/src/cpptraj/src/Makefile_at amber11/AmberTools/src/cpptraj/src/Makefile_at
+--- amber11.orig/AmberTools/src/cpptraj/src/Makefile_at 2011-04-14 15:30:16.000000000 +0300
++++ amber11/AmberTools/src/cpptraj/src/Makefile_at 2011-05-20 00:45:48.000000000 +0300
+@@ -65,8 +65,8 @@
+ -/bin/rm FindDepend.o
+ -/bin/rm findDepend
+
+-cpptraj$(SFX): $(NETCDFLIB) $(OBJECTS)
+- $(CXX) $(LDFLAGS) -o cpptraj$(SFX) $(OBJECTS) $(NETCDFLIB) $(ZLIB) $(BZLIB)
++cpptraj$(SFX): $(OBJECTS)
++ $(CXX) $(LDFLAGS) -o cpptraj$(SFX) $(OBJECTS) $(NETCDFLIB) $(ZLIB) $(BZLIB) -lgomp
+
+ $(NETCDFLIB): ../../netcdf_config.log
+ cd ../../netcdf/src && $(MAKE) install
+diff -urN amber11.orig/AmberTools/src/Makefile amber11/AmberTools/src/Makefile
+--- amber11.orig/AmberTools/src/Makefile 2011-04-14 15:30:12.000000000 +0300
++++ amber11/AmberTools/src/Makefile 2011-05-19 23:36:36.000000000 +0300
+@@ -8,15 +8,15 @@
+
+ install: $(INSTALLTYPE)
+
+-serial: configured_serial $(NETCDFLIB) $(PYINSTALL) $(MTKPP)
++serial: configured_serial
+ @echo "Starting installation of ${AMBERTOOLS} serial at `date`".
+ # utility routines and libraries:
+- (cd ucpp-1.3 && $(MAKE) $(UCPP) )
++# (cd ucpp-1.3 && $(MAKE) $(UCPP) )
+ (cd byacc && $(MAKE) install )
+- (cd arpack && $(MAKE) install );
+- (cd lapack && $(MAKE) $(LAPACK) )
+- (cd blas && $(MAKE) $(BLAS) )
+- (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) )
++# (cd arpack && $(MAKE) install );
++# (cd lapack && $(MAKE) $(LAPACK) )
++# (cd blas && $(MAKE) $(BLAS) )
++# (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) )
+ (cd etc && $(MAKE) install )
+ (cd chamber && $(MAKE) install )
+ (cd pbsa && $(MAKE) install )
+@@ -32,7 +32,7 @@
+ (cd cpptraj && $(MAKE) $(CPPTRAJ))
+
+ # miscellaneous:
+- (cd reduce && $(MAKE) install )
++# (cd reduce && $(MAKE) install )
+
+ # leap and gleap:
+ (cd leap && $(MAKE) install )
+@@ -42,7 +42,7 @@
+ (cd rism && $(MAKE) install )
+
+ # nab:
+- (cd cifparse && $(MAKE) install )
++# (cd cifparse && $(MAKE) install )
+ (cd sff && $(MAKE) install )
+ (cd pbsa && $(MAKE) libinstall )
+ (cd nab && $(MAKE) install )
+@@ -63,19 +63,19 @@
+ @echo "Installation of ${AMBERTOOLS} serial is complete at `date`."
+ @echo ""
+
+-nabonly: $(NETCDFLIB)
++nabonly:
+ # utility routines and libraries:
+- (cd ucpp-1.3 && $(MAKE) $(UCPP) )
++# (cd ucpp-1.3 && $(MAKE) $(UCPP) )
+ (cd byacc && $(MAKE) install )
+- (cd arpack && $(MAKE) install );
+- (cd lapack && $(MAKE) $(LAPACK) )
+- (cd blas && $(MAKE) $(BLAS) )
+- (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) )
++# (cd arpack && $(MAKE) install );
++# (cd lapack && $(MAKE) $(LAPACK) )
++# (cd blas && $(MAKE) $(BLAS) )
++# (cd c9x-complex && $(MAKE) $(C9XCOMPLEX) )
+ (cd pbsa && $(MAKE) libinstall )
+ (cd rism && $(MAKE) install )
+
+ # nab:
+- (cd cifparse && $(MAKE) install )
++# (cd cifparse && $(MAKE) install )
+ (cd sff && $(MAKE) install )
+ (cd nab && $(MAKE) install )
+ (cd nss && $(MAKE) install )
+diff -urN amber11.orig/AmberTools/src/mdgx/Makefile amber11/AmberTools/src/mdgx/Makefile
+--- amber11.orig/AmberTools/src/mdgx/Makefile 2011-04-14 15:30:17.000000000 +0300
++++ amber11/AmberTools/src/mdgx/Makefile 2011-05-20 12:44:38.000000000 +0300
+@@ -109,7 +109,7 @@
+
+ FFTW_LIBS = $(LIBDIR)/libfftw3.a
+
+-mdgx$(SFX) : $(MDGX_OBJS) $(FFTW_LIBS) $(NETCDFLIB)
++mdgx$(SFX) : $(MDGX_OBJS)
+ $(CC) $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) \
+ -o $@ $(MDGX_OBJS) $(FFTW_LIBS) $(NETCDFLIB) $(LM)
+
+diff -urN amber11.orig/AmberTools/src/pbsa/Makefile amber11/AmberTools/src/pbsa/Makefile
+--- amber11.orig/AmberTools/src/pbsa/Makefile 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/pbsa/Makefile 2011-05-19 22:27:40.000000000 +0300
+@@ -148,7 +148,7 @@
+ )
+
+ #---------------------------------------------------------------------------
+-pbsa$(SFX): $(OBJ) syslib netlib c9x-complex configured_serial
++pbsa$(SFX): $(OBJ) syslib configured_serial
+ $(FC) $(FFLAGS) $(AMBERFFLAGS) -o pbsa$(SFX) $(OBJ) \
+ ../lib/nxtsec.o ../lib/random.o \
+ $(FLIBSF) $(LDFLAGS) $(AMBERLDFLAGS)
+@@ -158,7 +158,7 @@
+ ../lib/nxtsec.o ../lib/random.o \
+ $(FLIBSF) $(LDFLAGS) $(AMBERLDFLAGS)
+
+-simplepbsa$(SFX): simplepbsa.o gopt.o libpbsa.a sfflib syslib netlib c9x-complex
++simplepbsa$(SFX): simplepbsa.o gopt.o libpbsa.a sfflib syslib
+ $(FC) $(FFLAGS) $(AMBERFFLAGS) -o simplepbsa$(SFX) simplepbsa.o gopt.o \
+ libpbsa.a $(LIBDIR)/libsff.a ../lib/nxtsec.o $(FLIBSF) \
+ $(LDFLAGS) $(AMBERLDFLAGS)
+@@ -194,15 +194,15 @@
+ sfflib:
+ cd ../sff && $(MAKE) install
+
+-netlib:
+- cd ../lapack && $(MAKE) $(LAPACK)
+- cd ../blas && $(MAKE) $(BLAS)
+- cd ../arpack && $(MAKE) install
+-
+-c9x-complex:
+- @if test $(C9XCOMPLEX) != "skip"; then \
+- cd ../c9x-complex && $(MAKE) libmc.a; \
+- fi
++#netlib:
++# cd ../lapack && $(MAKE) $(LAPACK)
++# cd ../blas && $(MAKE) $(BLAS)
++# cd ../arpack && $(MAKE) install
++
++#c9x-complex:
++# @if test $(C9XCOMPLEX) != "skip"; then \
++# cd ../c9x-complex && $(MAKE) libmc.a; \
++# fi
+
+ %.LIBPBSA.o: %.f
+ $(FPP) $(FPPFLAGS) $(AMBERFPPFLAGS) -DLIBPBSA $< > _$<
+diff -urN amber11.orig/AmberTools/src/ptraj/Makefile amber11/AmberTools/src/ptraj/Makefile
+--- amber11.orig/AmberTools/src/ptraj/Makefile 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/ptraj/Makefile 2011-05-19 23:38:36.000000000 +0300
+@@ -57,25 +57,25 @@
+ pubfft.o: pubfft.f
+ $(FC) -c $(FREEFORMAT_FLAG) $(FOPTFLAGS) $(FFLAGS) $(AMBERFFLAGS) -o $@ $<
+
+-rdparm$(SFX): libs $(NETCDFLIB) $(OBJECTS)
++rdparm$(SFX): libs $(OBJECTS)
+ $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \
+ -o rdparm$(SFX) $(OBJECTS) $(LIBS) $(NETCDFLIB) $(LM)
+
+-ptraj$(SFX): libs netlib $(NETCDFLIB) $(OBJECTS)
++ptraj$(SFX): libs $(OBJECTS)
+ $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \
+ -o ptraj$(SFX) $(OBJECTS) $(LIBS) $(NETCDFLIB) $(LM)
+
+-ptraj.MPI$(SFX): libs netlib $(PNETCDFLIB) $(OBJECTS)
++ptraj.MPI$(SFX): libs $(PNETCDFLIB) $(OBJECTS)
+ $(CC) $(CFLAGS) $(AMBERCFLAGS) $(LDFLAGS) $(AMBERLDFLAGS) \
+ -o ptraj.MPI$(SFX) $(OBJECTS) $(LIBS) $(PNETCDFLIB) $(LM)
+
+ libs:
+ cd pdb && $(MAKE)
+- cd ../arpack && $(MAKE)
++# cd ../arpack && $(MAKE)
+
+-netlib:
+- cd ../lapack && $(MAKE) $(LAPACK)
+- cd ../blas && $(MAKE) $(BLAS)
++#netlib:
++# cd ../lapack && $(MAKE) $(LAPACK)
++# cd ../blas && $(MAKE) $(BLAS)
+
+ clean:
+ cd pdb && $(MAKE) clean
+diff -urN amber11.orig/AmberTools/src/ptraj/netcdf_ptraj.h amber11/AmberTools/src/ptraj/netcdf_ptraj.h
+--- amber11.orig/AmberTools/src/ptraj/netcdf_ptraj.h 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/ptraj/netcdf_ptraj.h 2011-05-19 22:30:43.000000000 +0300
+@@ -4,7 +4,7 @@
+ # include "../../include/pnetcdf.h"
+ # define nc_strerror ncmpi_strerror
+ # else
+-# include "../../include/netcdf.h"
++# include <netcdf.h>
+ # endif
+ #endif
+
+diff -urN amber11.orig/AmberTools/src/ptraj/ptraj.h amber11/AmberTools/src/ptraj/ptraj.h
+--- amber11.orig/AmberTools/src/ptraj/ptraj.h 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/ptraj/ptraj.h 2011-06-04 13:25:01.000000000 +0300
+@@ -94,7 +94,7 @@
+ #define nc_strerror ncmpi_strerror
+ #include "../../include/pnetcdf.h"
+ #else
+-#include "../../include/netcdf.h"
++#include <netcdf.h>
+ #endif
+ #endif
+
+diff -urN amber11.orig/AmberTools/src/rism/Makefile amber11/AmberTools/src/rism/Makefile
+--- amber11.orig/AmberTools/src/rism/Makefile 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/rism/Makefile 2011-05-20 01:07:26.000000000 +0300
+@@ -49,7 +49,7 @@
+ mdiis_orig_c.o mdiis_blas_c.o mdiis_blas2_c.o mdiis_c.o \
+ fce_c.o erfcfun.o safemem.o blend.o timer_c.o
+
+-librism: $(LIBOBJ) $(FLIBS_FFTW2)
++librism: $(LIBOBJ)
+ $(AR) $(LIBDIR)/$@.a $(LIBOBJ)
+ $(RANLIB) $(LIBDIR)/$@.a
+
+diff -urN amber11.orig/AmberTools/src/sff/AmberNetcdf.c amber11/AmberTools/src/sff/AmberNetcdf.c
+--- amber11.orig/AmberTools/src/sff/AmberNetcdf.c 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/sff/AmberNetcdf.c 2011-05-20 10:49:06.000000000 +0300
+@@ -27,7 +27,7 @@
+ #endif
+
+ #ifdef BINTRAJ
+-#include "../../include/netcdf.h"
++#include <netcdf.h>
+
+ #define NCFRAME "frame"
+ #define NCSPATIAL "spatial"
+diff -urN amber11.orig/AmberTools/src/sff/Makefile amber11/AmberTools/src/sff/Makefile
+--- amber11.orig/AmberTools/src/sff/Makefile 2011-04-14 15:30:19.000000000 +0300
++++ amber11/AmberTools/src/sff/Makefile 2011-05-20 09:53:27.000000000 +0300
+@@ -1,7 +1,7 @@
+ include ../config.h
+
+ .c.o:
+- $(CC) -c -Dflex $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) $(RISMSFF) -o $@ $<
++ $(CC) -c -Dflex $(COPTFLAGS) $(CFLAGS) $(AMBERCFLAGS) $(RISMSFF) $(NETCDFLIB) -o $@ $<
+
+ OBJS = binpos.o conjgrad.o lmodC.o memutil.o nblist.o newton.o nmode.o \
+ prm.o rand2.o sasad.o sff.o time.o xminC.o AmberNetcdf.o \
+diff -urN amber11.orig/AmberTools/src/sqm/Makefile amber11/AmberTools/src/sqm/Makefile
+--- amber11.orig/AmberTools/src/sqm/Makefile 2011-04-14 15:30:20.000000000 +0300
++++ amber11/AmberTools/src/sqm/Makefile 2011-05-19 22:31:49.000000000 +0300
+@@ -77,7 +77,7 @@
+ install: sqm$(SFX)
+ mv sqm$(SFX) $(BINDIR)
+
+-sqm$(SFX): $(SQMOBJ) $(QMOBJ) netlib sys
++sqm$(SFX): $(SQMOBJ) $(QMOBJ) sys
+ $(FC) $(FFLAGS) $(AMBERFFLAGS) -o sqm$(SFX) $(SQMOBJ) $(QMOBJ) \
+ $(FLIBSF) ../lib/sys.a $(LDFLAGS) $(AMBERLDFLAGS)
+
+@@ -94,10 +94,10 @@
+ sys:
+ cd ../lib; $(MAKE) sys.a
+
+-netlib:
+- cd ../lapack; $(MAKE) $(LAPACK)
+- cd ../blas; $(MAKE) $(BLAS)
+- cd ../arpack && $(MAKE) install
++#netlib:
++# cd ../lapack; $(MAKE) $(LAPACK)
++# cd ../blas; $(MAKE) $(BLAS)
++# cd ../arpack && $(MAKE) install
+
+ clean:
+ /bin/rm -f *.o _*.f *.mod *.d sqm$(SFX)
diff --git a/sci-chemistry/ambertools/metadata.xml b/sci-chemistry/ambertools/metadata.xml
new file mode 100644
index 000000000000..13ef0bf5a17c
--- /dev/null
+++ b/sci-chemistry/ambertools/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-chemistry</herd>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/apbs/Manifest b/sci-chemistry/apbs/Manifest
new file mode 100644
index 000000000000..fef1437b89f5
--- /dev/null
+++ b/sci-chemistry/apbs/Manifest
@@ -0,0 +1 @@
+DIST apbs-1.4.1.zip 37999283 SHA256 1156c44fb65bb7c884801f3111ca1cdb1dfba6f5308226587db112aac4969027 SHA512 3a127af3940054e5a43b3c0c620507f4f9baa69049e5a0933d8e8825458ad2faba840392752de49fe68d91e2054fb1394cf87bb5bb1c0b48305368e2f404cf6a WHIRLPOOL 6729571f13c953ec0bcf90da73ef0c39cf769f1498a767d3280de3ffbeea18eda718373efca0468436c4b18357fe450865f661daba79eeb66778c572c43ff39a
diff --git a/sci-chemistry/apbs/apbs-1.4.1-r2.ebuild b/sci-chemistry/apbs/apbs-1.4.1-r2.ebuild
new file mode 100644
index 000000000000..cabbd1e45e92
--- /dev/null
+++ b/sci-chemistry/apbs/apbs-1.4.1-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=true
+
+inherit cmake-utils distutils-r1 flag-o-matic multilib toolchain-funcs
+
+GITHUB_REV="74fcb8676de69ed04ddab8976a8b05a6caaf4d65"
+
+DESCRIPTION="Evaluation of electrostatic properties of nanoscale biomolecular systems"
+HOMEPAGE="http://www.poissonboltzmann.org/apbs/"
+#SRC_URI="mirror://sourceforge/${PN}/${P}-source.tar.gz"
+SRC_URI="https://github.com/Electrostatics/apbs-pdb2pqr/archive/${GITHUB_REV}.zip -> ${P}.zip"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE="debug doc examples fast +fetk iapbs mpi openmp python tools"
+
+REQUIRED_USE="
+ iapbs? ( fetk )
+ mpi? ( !python )
+ python? ( tools fetk iapbs ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ dev-cpp/eigen:3
+ dev-libs/maloc[mpi=]
+ virtual/blas
+ sys-libs/readline
+ fetk? (
+ sci-libs/fetk
+ sci-libs/amd
+ sci-libs/umfpack
+ sci-libs/superlu
+ )
+ mpi? ( virtual/mpi )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+
+S="${WORKDIR}"/${PN}-pdb2pqr-${GITHUB_REV}/${PN}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-multilib.patch
+ "${FILESDIR}"/${P}-manip.patch
+ "${FILESDIR}"/${P}-python.patch
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags eigen3)
+
+ sed \
+ -e "s:-lblas:$($(tc-getPKG_CONFIG) --libs blas):g" \
+ -e "/TOOLS_PATH/d" \
+ -i CMakeLists.txt || die
+ use doc && MAKEOPTS+=" -j1"
+ if use python; then
+ unset PATCHES || die
+ cd tools/python && distutils-r1_src_prepare
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=ON
+ -DTOOLS_PATH="${ED}"/usr
+ -DSYS_LIBPATHS="${EPREFIX}"/usr/$(get_libdir)
+ -DLIBRARY_INSTALL_PATH=$(get_libdir)
+ -DFETK_PATH="${EPREFIX}"/usr/
+ -DBUILD_SHARED_LIBS=ON
+ -DENABLE_QUIT=OFF
+ $(cmake-utils_use_build doc DOC)
+ $(cmake-utils_use_build tools TOOLS)
+ -DENABLE_BEM=OFF
+# ENABLE_BEM: Boundary element method using TABIPB
+ $(cmake-utils_use_enable debug DEBUG)
+ $(cmake-utils_use_enable debug VERBOSE_DEBUG)
+ $(cmake-utils_use_enable fast FAST)
+ $(cmake-utils_use_enable fetk FETK)
+ $(cmake-utils_use_enable mpi MPI)
+ $(cmake-utils_use_enable python PYTHON)
+# ENABLE_TINKER: Enable TINKER support
+ $(cmake-utils_use_enable iapbs iAPBS)
+# MAX_MEMORY: Set the maximum memory (in MB) to be used for a job
+ )
+ cmake-utils_src_configure
+ if use python; then
+ cd tools/python && distutils-r1_src_configure
+ fi
+}
+
+src_compile(){
+ cmake-utils_src_compile
+ if use python; then
+ append-ldflags -L"${S}"/lib
+ cd tools/python && distutils-r1_src_compile
+ fi
+}
+
+src_test() {
+ python_export_best
+ cd tests || die
+ LD_LIBRARY_PATH="${S}"/lib "${PYTHON}" apbs_tester.py -l log || die
+ grep -q 'FAILED' log && die "Tests failed"
+}
+
+src_install() {
+ dodir /usr/bin
+ cmake-utils_src_install
+ local i
+ for i in "${ED}"/usr/bin/*; do
+ if [[ ! "${i}" =~ .*apbs$ ]]; then
+ mv "${i}" "${i}-apbs" || die
+ fi
+ done
+ if use python; then
+ cd tools/python && distutils-r1_src_install
+ rm -rf "${ED}"/usr/share/apbs/tools/python || die
+ fi
+}
diff --git a/sci-chemistry/apbs/files/apbs-1.4.1-manip.patch b/sci-chemistry/apbs/files/apbs-1.4.1-manip.patch
new file mode 100644
index 000000000000..378223397594
--- /dev/null
+++ b/sci-chemistry/apbs/files/apbs-1.4.1-manip.patch
@@ -0,0 +1,50 @@
+ apbs/CMakeLists.txt | 2 +-
+ apbs/tools/CMakeLists.txt | 4 ----
+ apbs/tools/mesh/CMakeLists.txt | 4 ++--
+ 4 files changed, 5 insertions(+), 9 deletions(-)
+
+diff --git a/apbs/CMakeLists.txt b/apbs/CMakeLists.txt
+index 8917fc4..5152008 100644
+--- a/apbs/CMakeLists.txt
++++ b/apbs/CMakeLists.txt
+@@ -293,7 +293,7 @@ option(ENABLE_FETK "Enable the finite element solver" OFF)
+
+ if(ENABLE_FETK)
+ message(STATUS "Checking for fetk components")
+- set(FETK_ENALBED 1)
++ set(FETK_ENABLED 1)
+
+ list(APPEND APBS_LIBS "-lstdc++")
+ list(APPEND APBS_LIBS "-L${FETK_PATH}/lib")
+diff --git a/apbs/tools/manip/CMakeLists.txt b/apbs/tools/manip/CMakeLists.txt
+index 937dac7..5768cc5 100644
+--- a/apbs/tools/manip/CMakeLists.txt
++++ b/apbs/tools/manip/CMakeLists.txt
+@@ -4,9 +4,9 @@ set(LIBS "")
+ list(APPEND LIBS "apbs_generic")
+ list(APPEND LIBS "apbs_mg")
+ list(APPEND LIBS "apbs_pmgc")
+-if(FETK_ENALBED)
++if(FETK_ENABLED)
+ list(APPEND LIBS "apbs_fem")
+-endif(FETK_ENALBED)
++endif(FETK_ENABLED)
+
+ message(STATUS "libraries: ${LIBS}")
+
+diff --git a/apbs/tools/mesh/CMakeLists.txt b/apbs/tools/mesh/CMakeLists.txt
+index 1406377..6e6dfb9 100644
+--- a/apbs/tools/mesh/CMakeLists.txt
++++ b/apbs/tools/mesh/CMakeLists.txt
+@@ -4,9 +4,9 @@ set(LIBS "")
+ list(APPEND LIBS "apbs_generic")
+ list(APPEND LIBS "apbs_mg")
+ list(APPEND LIBS "apbs_pmgc")
+-if(FETK_ENALBED)
++if(FETK_ENABLED)
+ list(APPEND LIBS "apbs_fem")
+-endif(FETK_ENALBED)
++endif(FETK_ENABLED)
+
+ message(STATUS "libraries: ${LIBS}")
+
diff --git a/sci-chemistry/apbs/files/apbs-1.4.1-multilib.patch b/sci-chemistry/apbs/files/apbs-1.4.1-multilib.patch
new file mode 100644
index 000000000000..a4e2d1761cf4
--- /dev/null
+++ b/sci-chemistry/apbs/files/apbs-1.4.1-multilib.patch
@@ -0,0 +1,92 @@
+ CMakeLists.txt | 18 +++++++++---------
+ src/CMakeLists.txt | 1 -
+ src/fem/CMakeLists.txt | 2 +-
+ src/pmgc/CMakeLists.txt | 2 +-
+ 4 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 75ddbdd..c46f5e7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,7 +61,7 @@ set(LIBRARY_OUTPUT_PATH ${APBS_ROOT}/lib)
+ set(TOOLS_PATH ${APBS_ROOT}/tools)
+ set(APBS_BINARY ${EXECUTABLE_OUTPUT_PATH}/apbs)
+
+-set(LIBRARY_INSTALL_PATH lib)
++set(LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR})
+ set(HEADER_INSTALL_PATH include/apbs)
+ set(EXECUTABLE_INSTALL_PATH bin)
+ set(SHARE_INSTALL_PATH share/apbs)
+@@ -93,8 +93,6 @@ set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}")
+ list(APPEND CMAKE_INCLUDE_PATH /usr/include)
+ list(APPEND CMAKE_INCLUDE_PATH /usr/local/include)
+
+-set(APBS_LIBS "-L${APBS_ROOT}/lib -lapbs_geoflow")
+-
+ ################################################################################
+ # Enable ansi pedantic compiling #
+ ################################################################################
+@@ -193,9 +191,11 @@ if(ENABLE_BEM)
+ else()
+ set(TABI_LIBRARY_BASENAME ${CMAKE_STATIC_LIBRARY_PREFIX}${TABI}${CMAKE_STATIC_LIBRARY_SUFFIX})
+ endif()
+-
++
++ file(GLOB MODS ${LIBRARY_OUTPUT_PATH}/*.mod)
++
+ install(
+- FILES ${LIBRARY_OUTPUT_PATH}/${TABI_LIBRARY_BASENAME} ${LIBRARY_OUTPUT_PATH}/*.mod
++ FILES ${LIBRARY_OUTPUT_PATH}/${TABI_LIBRARY_BASENAME} ${MODS}
+ DESTINATION ${LIBRARY_INSTALL_PATH}
+ )
+ set(TABI_LIBRARY ${APBS_ROOT}/${LIBRARY_INSTALL_PATH}/${TABI_LIBRARY_BASENAME})
+@@ -210,7 +210,7 @@ if(ENABLE_BEM)
+ endif()
+ get_filename_component(LIBGFORTRANPATH ${LIBGFORTRANPATH} PATH)
+ find_path(LIBGFORTRAN_PATH ${LIBGFORTRAN_NAME} PATH ${LIBGFORTRANPATH})
+- list(APPEND APBS_LIBS "-L${APBS_ROOT}/${LIBRARY_INSTALL_PATH} -L${LIBGFORTRAN_PATH} -lgfortran -ltabipb" )
++ list(APPEND APBS_LIBS "-L${APBS_ROOT}/lib -L${LIBGFORTRAN_PATH} -lgfortran -ltabipb" )
+ endif() # ENABLE_BEM
+
+ find_file( # this should be find path...
+@@ -228,7 +228,7 @@ endif()
+
+
+ find_library(MALOC_LIBRARY "maloc"
+- PATHS ${FETK_PATH}/lib ${CONTRIB_PATH}
++ PATHS ${FETK_PATH}/${CMAKE_INSTALL_LIBDIR} ${CONTRIB_PATH}
+ DOC "The fetk/maloc library"
+ )
+ if(MALOC_LIBRARY)
+@@ -296,9 +296,9 @@ if(ENABLE_FETK)
+ set(FETK_ENALBED 1)
+
+ list(APPEND APBS_LIBS "-lstdc++")
+- list(APPEND APBS_LIBS "-L${FETK_PATH}/lib")
++ list(APPEND APBS_LIBS "-L${FETK_PATH}/${CMAKE_INSTALL_LIBDIR}")
+ list(APPEND APBS_LIBS -lamd -lpunc -lmc -lgamer -lsuperlu -lumfpack
+--lblas -lvf2c -ltetgen -ltriangle -lg2c -lreadline )
++-lblas -lvf2c -ltetgen -ltriangle -lreadline )
+
+ SET(HAVE_MC_H YES)
+ endif()
+diff --git a/src/fem/CMakeLists.txt b/src/fem/CMakeLists.txt
+index 5a950c2..dc37f48 100644
+--- a/src/fem/CMakeLists.txt
++++ b/src/fem/CMakeLists.txt
+@@ -12,4 +12,4 @@ add_items(
+ vpee.h
+ )
+
+-add_sublibrary(fem)
++add_sublibrary(fem apbs_geoflow)
+diff --git a/src/pmgc/CMakeLists.txt b/src/pmgc/CMakeLists.txt
+index 85b0c1e..97c95f0 100644
+--- a/src/pmgc/CMakeLists.txt
++++ b/src/pmgc/CMakeLists.txt
+@@ -42,4 +42,4 @@ add_items(
+ mgfasd.h
+ )
+
+-add_sublibrary(pmgc)
++add_sublibrary(pmgc apbs_geoflow)
diff --git a/sci-chemistry/apbs/files/apbs-1.4.1-python.patch b/sci-chemistry/apbs/files/apbs-1.4.1-python.patch
new file mode 100644
index 000000000000..db9f86ba120a
--- /dev/null
+++ b/sci-chemistry/apbs/files/apbs-1.4.1-python.patch
@@ -0,0 +1,122 @@
+ apbs/contrib/iapbs/src/apbs_driver.c | 6 +++---
+ apbs/src/CMakeLists.txt | 1 +
+ apbs/tools/CMakeLists.txt | 2 +-
+ apbs/tools/python/CMakeLists.txt | 1 +
+ apbs/tools/python/apbslib.c | 4 ++--
+ apbs/tools/python/apbslib.i | 4 ++--
+ apbs/tools/python/setup.py | 16 ++++++++++++++++
+ 7 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/apbs/contrib/iapbs/src/apbs_driver.c b/apbs/contrib/iapbs/src/apbs_driver.c
+index c9e443b..e1ad67f 100644
+--- a/apbs/contrib/iapbs/src/apbs_driver.c
++++ b/apbs/contrib/iapbs/src/apbs_driver.c
+@@ -595,7 +595,7 @@ int apbsdrv_(
+ printPBEPARM(pbeparm);
+
+ /* Refine mesh */
+- if (!preRefineFE(i, nosh, feparm, fetk)) {
++ if (!preRefineFE(i, feparm, fetk)) {
+ Vnm_tprint( 2, "Error pre-refining mesh!\n");
+ VJMPERR1(0);
+ }
+@@ -609,7 +609,7 @@ int apbsdrv_(
+ Vnm_tprint(1, " Beginning solve-estimate-refine cycle:\n");
+ for (isolve=0; isolve<feparm->maxsolve; isolve++) {
+ Vnm_tprint(1, " Solve #%d...\n", isolve);
+- if (!solveFE(i, nosh, pbeparm, feparm, fetk)) {
++ if (!solveFE(i, pbeparm, feparm, fetk)) {
+ Vnm_tprint(2, "ERROR SOLVING EQUATION!\n");
+ VJMPERR1(0);
+ }
+@@ -622,7 +622,7 @@ int apbsdrv_(
+ /* We're not going to refine if we've hit the max number
+ * of solves */
+ if (isolve < (feparm->maxsolve)-1) {
+- if (!postRefineFE(i, nosh, feparm, fetk)) break;
++ if (!postRefineFE(i, feparm, fetk)) break;
+ }
+ bytesTotal = Vmem_bytesTotal();
+ highWater = Vmem_highWaterTotal();
+diff --git a/apbs/src/CMakeLists.txt b/apbs/src/CMakeLists.txt
+index 44d20fa..2577343 100644
+--- a/apbs/src/CMakeLists.txt
++++ b/apbs/src/CMakeLists.txt
+@@ -68,6 +68,7 @@ configure_file(
+
+ if(ENABLE_iAPBS)
+ ADD_LIBRARY(apbs_routines routines.c routines.h)
++ target_link_libraries(apbs_routines apbs_mg apbs_fem)
+ INSTALL(TARGETS apbs_routines DESTINATION ${LIBRARY_INSTALL_PATH})
+ INSTALL(FILES apbscfg.h DESTINATION ${HEADER_INSTALL_PATH})
+ endif()
+diff --git a/apbs/tools/CMakeLists.txt b/apbs/tools/CMakeLists.txt
+index 1982a3c..4acbe68 100644
+--- a/apbs/tools/CMakeLists.txt
++++ b/apbs/tools/CMakeLists.txt
+@@ -4,5 +4,5 @@ add_subdirectory(mesh)
+ add_subdirectory(manip)
+
+ if(ENABLE_PYTHON)
+- add_subdirectory(manip)
++ add_subdirectory(python)
+ endif(ENABLE_PYTHON)
+diff --git a/apbs/tools/python/CMakeLists.txt b/apbs/tools/python/CMakeLists.txt
+new file mode 100644
+index 0000000..8b13789
+--- /dev/null
++++ b/apbs/tools/python/CMakeLists.txt
+@@ -0,0 +1 @@
++
+diff --git a/apbs/tools/python/apbslib.c b/apbs/tools/python/apbslib.c
+index fef5cc8..feaaa2c 100644
+--- a/apbs/tools/python/apbslib.c
++++ b/apbs/tools/python/apbslib.c
+@@ -2504,8 +2504,8 @@ static swig_module_info swig_module = {swig_types, 24, 0, 0, 0, 0};
+ #include "maloc/maloc.h"
+ #include "apbscfg.h"
+ #include "routines.h"
+-#include "apbs/valist.h"
+-#include "apbs/vatom.h"
++#include "generic/valist.h"
++#include "generic/vatom.h"
+
+
+ #include <limits.h>
+diff --git a/apbs/tools/python/apbslib.i b/apbs/tools/python/apbslib.i
+index 17fe521..44d05ea 100644
+--- a/apbs/tools/python/apbslib.i
++++ b/apbs/tools/python/apbslib.i
+@@ -15,8 +15,8 @@ Header files:
+ #include "maloc/maloc.h"
+ #include "apbscfg.h"
+ #include "routines.h"
+-#include "apbs/valist.h"
+-#include "apbs/vatom.h"
++#include "generic/valist.h"
++#include "generic/vatom.h"
+ %}
+
+ /*
+diff --git a/apbs/tools/python/setup.py b/apbs/tools/python/setup.py
+new file mode 100644
+index 0000000..4a20198
+--- /dev/null
++++ b/apbs/tools/python/setup.py
+@@ -0,0 +1,16 @@
++from distutils.core import setup, Extension
++setup(name='apbs',
++ version='1.4.1',
++ package_dir={'apbs': '', 'vgrid': 'vgrid'},
++ packages=['apbs', 'vgrid'],
++ py_modules=['apbslib', 'main', 'noinput'],
++ ext_modules=[
++ Extension(
++ '_apbslib',
++ ['apbslib.i'],
++ swig_opts=['-module', 'apbslib', '-I../include'],
++ include_dirs=["../../src"],
++ libraries=["apbs_generic", "apbs_routines"]
++ )
++ ],
++ )
diff --git a/sci-chemistry/apbs/metadata.xml b/sci-chemistry/apbs/metadata.xml
new file mode 100644
index 000000000000..f1b8467dd96e
--- /dev/null
+++ b/sci-chemistry/apbs/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher</name>
+ <description>Ebuild Crasher</description>
+ </maintainer>
+ <use>
+ <flag name="fetk">Include support for FeTK</flag>
+ <flag name="fast">APBS fast mode (experimental)</flag>
+ <flag name="iapbs">C/C++/Fortran interface</flag>
+ <flag name="tools">Install optional tools</flag>
+ </use>
+ <longdescription>
+APBS is a software package for modeling biomolecular solvation through solution
+of the Poisson-Boltzmann equation (PBE), one of the most popular continuum
+models for describing electrostatic interactions between molecular solutes in
+salty, aqueous media. Continuum electrostatics plays an important role in
+several areas of biomolecular simulation
+</longdescription>
+ <upstream>
+ <remote-id type="github">Electrostatics/apbs-pdb2pqr</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/aqua/Manifest b/sci-chemistry/aqua/Manifest
new file mode 100644
index 000000000000..7f6594d70fe4
--- /dev/null
+++ b/sci-chemistry/aqua/Manifest
@@ -0,0 +1,2 @@
+DIST aqua-3.2-nmr_manual.tar.gz 632031 SHA256 89bbc2501831e547fec2fe755bbc0081f672e5e2c7adb83618699e6825f73996
+DIST aqua3.2.tar.gz 688408 SHA256 895291b1771f4db5b4a010ce797400a8c4d84095bf34d660dd3405223419242f
diff --git a/sci-chemistry/aqua/aqua-3.2-r2.ebuild b/sci-chemistry/aqua/aqua-3.2-r2.ebuild
new file mode 100644
index 000000000000..74fccddc5dd2
--- /dev/null
+++ b/sci-chemistry/aqua/aqua-3.2-r2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 toolchain-funcs
+
+DESCRIPTION="Program suite in this distribution calculates restraint violations"
+HOMEPAGE="http://www.biochem.ucl.ac.uk/~roman/procheck/procheck.html"
+SRC_URI="
+ ${PN}${PV}.tar.gz
+ doc? ( ${P}-nmr_manual.tar.gz )"
+
+SLOT="0"
+LICENSE="procheck"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples"
+
+RDEPEND="sci-chemistry/procheck"
+DEPEND=""
+
+RESTRICT="fetch"
+
+S="${WORKDIR}"/${PN}${PV}
+
+pkg_nofetch() {
+ elog "Please visit http://www.ebi.ac.uk/thornton-srv/software/PROCHECK/download.html"
+ elog "And follow the instruction for downloading ${PN}${PV}.tar.gz -> ${DISTDIR}/${PN}${PV}.tar.gz."
+ if use doc; then
+ elog "nmr_manual.tar.gz -> ${DISTDIR}/${P}-nmr_manual.tar.gz"
+ fi
+}
+
+src_prepare() {
+ sed \
+ -e 's:nawk:gawk:g' \
+ -e "s:/bin/gawk:${EPREFIX}/usr/bin/gawk:g" \
+ -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \
+ -i $(find . -type f) || die
+ epatch "${FILESDIR}"/${PV}-flags.patch
+}
+
+src_compile() {
+ pushd src > /dev/null
+ emake \
+ MYROOT="${WORKDIR}" \
+ CC="$(tc-getCC)" \
+ FC="$(tc-getFC)" \
+ CFLAGS="${CFLAGS} -I../sub/lib" \
+ FFLAGS="${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ exth
+ emake \
+ MYROOT="${WORKDIR}" \
+ CC="$(tc-getCC)" \
+ FC="$(tc-getFC)" \
+ CFLAGS="${CFLAGS} -I../sub/lib" \
+ FFLAGS="${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+ popd
+}
+
+src_install() {
+ rm -f scripts/conv* || die
+ dobin bin/* scripts/*
+ dosym AquaWhat /usr/bin/qwhat
+ dosym AquaHow /usr/bin/qhow
+ dosym AquaPseudo /usr/bin/qpseudo
+ dosym AquaDist /usr/bin/qdist
+ dosym AquaCalc /usr/bin/qcalc
+ dosym AquaAssign /usr/bin/qassign
+ dosym AquaRedun /usr/bin/qredun
+ dosym AquaCompl /usr/bin/qcompl
+
+ dodoc HISTORY HOW_TO_USE NEW README doc/*
+ dohtml html/*
+
+ insinto /usr/share/${PN}
+ doins data/*
+ if use examples; then
+ doins -r exmpls
+ fi
+
+ if use doc; then
+ dohtml -r manual
+ fi
+
+ cat >> "${T}"/34aqua <<- EOF
+ AQUADATADIR="${EPREFIX}/usr/share/${PN}"
+ EOF
+ doenvd "${T}"/34aqua
+}
diff --git a/sci-chemistry/aqua/files/3.2-flags.patch b/sci-chemistry/aqua/files/3.2-flags.patch
new file mode 100644
index 000000000000..cd12fbb9a324
--- /dev/null
+++ b/sci-chemistry/aqua/files/3.2-flags.patch
@@ -0,0 +1,84 @@
+diff --git a/src/makefile b/src/makefile
+index 3113471..dd7a320 100644
+--- a/src/makefile
++++ b/src/makefile
+@@ -176,47 +176,46 @@ nrutil.h:
+ # Executable files
+
+ $(BIN)/AquaWhat: AquaWhat.o $(OBJECTS) $(R_OBJECTS) $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaWhat AquaWhat.o $(OBJECTS) $(R_OBJECTS) $(RNG_OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaWhat AquaWhat.o $(OBJECTS) $(R_OBJECTS) $(RNG_OBJECTS)
+
+ $(BIN)/AquaHow: AquaHow.o $(OBJECTS) $(R_OBJECTS) AquaFuncts_dr.o $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaHow AquaHow.o $(OBJECTS) $(R_OBJECTS) AquaFuncts_dr.o $(RNG_OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaHow AquaHow.o $(OBJECTS) $(R_OBJECTS) AquaFuncts_dr.o $(RNG_OBJECTS)
+
+ $(BIN)/AquaPseudo: AquaPseudo.o $(OBJECTS) $(R_OBJECTS)
+- $(CC) -o $(BIN)/AquaPseudo AquaPseudo.o $(OBJECTS) $(R_OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaPseudo AquaPseudo.o $(OBJECTS) $(R_OBJECTS)
+
+ $(BIN)/AquaDist: AquaDist.o $(OBJECTS)
+- $(CC) -o $(BIN)/AquaDist AquaDist.o $(OBJECTS) $(LDFLAGS) -lm
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaDist AquaDist.o $(OBJECTS) -lm
+
+ $(BIN)/AquaCalc: AquaCalc.o $(OBJECTS) $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaCalc AquaCalc.o $(OBJECTS) $(RNG_OBJECTS) $(LDFLAGS) -lm
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaCalc AquaCalc.o $(OBJECTS) $(RNG_OBJECTS) -lm
+
+ $(BIN)/AquaAssign: AquaAssign.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaAssign AquaAssign.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaAssign AquaAssign.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS)
+
+ $(BIN)/AquaCompl: AquaCompl.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaCompl AquaCompl.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS) $(LDFLAGS) -lm
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaCompl AquaCompl.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS) -lm
+
+ $(BIN)/AquaRedun: AquaRedun.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS)
+- $(CC) -o $(BIN)/AquaRedun AquaRedun.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaRedun AquaRedun.o AquaCommon.o $(OBJECTS) $(R_OBJECTS) nrutil.o AquaFuncts_dr.o $(RNG_OBJECTS)
+
+ $(BIN)/testnew: testnew.o $(OBJECTS)
+- $(CC) -o $(BIN)/testnew testnew.o $(OBJECTS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/testnew testnew.o $(OBJECTS)
+
+ $(BIN)/getproj: getproj.c
+- $(CC) -o $(BIN)/getproj -O getproj.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN)/getproj getproj.c
+
+ $(BIN)/AquaPlot: AquaPlot.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o
+- $(CC) -o $(BIN)/AquaPlot AquaPlot.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/AquaPlot AquaPlot.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o
+
+ $(BIN)/Qext: Qext.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o
+- $(CC) -o $(BIN)/Qext Qext.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $(BIN)/Qext Qext.o $(LIB)/MenuFuncts.o $(LIB)/Functs.o
+
+ $(BIN)/StarTest: StarTest.o
+- $(CC) -o $(BIN)/StarTest StarTest.o $(LDFLAGS) $(STARFLAGS) $(STARLIBS)
++ $(CC) $(LDFLAGS) -o $(BIN)/StarTest StarTest.o $(STARFLAGS) $(STARLIBS)
+
+ exth: exth.f
+- f77 -o exth -O2 exth.f
+- strip exth
++ $(FC) $(FFLAGS) -o exth -O2 exth.f
+
+
+ # Object files
+@@ -269,7 +268,7 @@ AquaCommon.o: AquaCommon.c AquaCommon.h nrutil.h \
+ $(CC) -c AquaCommon.c $(CFLAGS)
+
+ nrutil.o: nrutil.c nrutil.h
+- $(CC) -c nrutil.c -DANSI
++ $(CC) $(CFLAGS) -c nrutil.c -DANSI
+
+ AquaFuncts.o: AquaFuncts.c AquaFuncts.h AquaFuncts_cv.h AquaFuncts_io.h\
+ AquaStrucset.h AquaFiles.h\
+@@ -319,7 +318,7 @@ $(LIB)/MenuFuncts.o: $(LIB)/MenuFuncts.c $(LIB)/MenuTypes.h $(LIB)/MenuFuncts.h\
+ cd $(LIB); $(CC) -c MenuFuncts.c $(CFLAGS)
+
+ cv_subs.o: cv_subs.f
+- f77 -c cv_subs.f $(FFLAGS)
++ $(FC) -c cv_subs.f $(FFLAGS)
+
+ Qext.o: Qext.c Qext.h\
+ $(LIB)/MenuFuncts.h $(LIB)/Functs.h $(G_HEADERS)
diff --git a/sci-chemistry/aqua/metadata.xml b/sci-chemistry/aqua/metadata.xml
new file mode 100644
index 000000000000..1837bbc07a6e
--- /dev/null
+++ b/sci-chemistry/aqua/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/aria/Manifest b/sci-chemistry/aria/Manifest
new file mode 100644
index 000000000000..28b40aa5c0c8
--- /dev/null
+++ b/sci-chemistry/aria/Manifest
@@ -0,0 +1 @@
+DIST aria2.3.2_08.26.2013.tar.gz 1878602 SHA256 b9b892de2070a77812733faf4b6a1dbec4bba6dec80e5630088cab8b11cbfaf0 SHA512 a6d8c45218f5d494174587a5f8f1feec940ac8cc4cd7b707dac65b2378219ecf27967e70807e6cb7ae22a7d4aec7239af763f077ad7183c078b1991cac71bc3e WHIRLPOOL 59c0b79fab40201d903c484bf63e8339c235207306efc848965d260c02b00c9a408297df0f211cf45f30d13ec35175bf7d566bb5c6d59b944eb22d9aacf0384d
diff --git a/sci-chemistry/aria/aria-2.3.2_p20130826.ebuild b/sci-chemistry/aria/aria-2.3.2_p20130826.ebuild
new file mode 100644
index 000000000000..7c4026fb1070
--- /dev/null
+++ b/sci-chemistry/aria/aria-2.3.2_p20130826.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit eutils python-single-r1 versionator
+
+MY_P="${PN}$(get_version_component_range 1-2 ${PV})"
+DATE="08.26.2013"
+
+DESCRIPTION="Automated NOE assignment and NMR structure calculation"
+HOMEPAGE="http://aria.pasteur.fr/"
+SRC_URI="http://aria.pasteur.fr/archives/${MY_P}.2_${DATE}.tar.gz"
+
+SLOT="0"
+LICENSE="cns"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-tcltk/tix
+ dev-lang/tk
+ >=dev-python/numpy-1.1[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP},tk]
+ >=sci-chemistry/cns-1.2.1-r7[aria,openmp]
+ >=sci-chemistry/ccpn-2.2[${PYTHON_USEDEP}]
+ sci-chemistry/clashlist
+ sci-chemistry/procheck
+ sci-libs/clashscore-db"
+DEPEND="${RDEPEND}"
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_nofetch(){
+ einfo "Go to http://aria.pasteur.fr/archives/aria2.3.2.tar.gz/view, download ${A}"
+ einfo "and place it in ${DISTDIR}"
+}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_test(){
+ export CCPNMR_TOP_DIR=$(python_get_sitedir)
+ export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+ ${PYTHON} check.py || die
+}
+
+src_install(){
+ python_moduleinto ${PN}
+ python_domodule src aria2.py
+ python_moduleinto ${PN}/cns
+ python_domodule cns/{protocols,toppar,src/helplib}
+
+ if use examples; then
+ insinto /usr/share/${P}/
+ doins -r examples
+ fi
+
+ # ENV
+ cat >> "${T}"/20aria <<- EOF
+ ARIA2="$(python_get_sitedir)/${PN}"
+ EOF
+
+ doenvd "${T}"/20aria
+
+ # Launch Wrapper
+ cat >> "${T}"/aria <<- EOF
+ #!/bin/sh
+ export CCPNMR_TOP_DIR="$(python_get_sitedir)"
+ export PYTHONPATH="$(python_get_sitedir)/ccpn/python"
+ exec "${PYTHON}" -O "\${ARIA2}"/aria2.py \$@
+ EOF
+
+ dobin "${T}"/aria
+ dosym aria /usr/bin/aria2
+
+ dodoc README
+ python_optimize "${D}/$(python_get_sitedir)"
+}
diff --git a/sci-chemistry/aria/files/aria-2.3.2-python.patch b/sci-chemistry/aria/files/aria-2.3.2-python.patch
new file mode 100644
index 000000000000..1f9ae1fcc5f6
--- /dev/null
+++ b/sci-chemistry/aria/files/aria-2.3.2-python.patch
@@ -0,0 +1,30 @@
+ src/py/aria/legacy/QualityChecks/Descriptive.py | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/py/aria/legacy/QualityChecks/Descriptive.py b/src/py/aria/legacy/QualityChecks/Descriptive.py
+index ae5913c..550d20c 100644
+--- a/src/py/aria/legacy/QualityChecks/Descriptive.py
++++ b/src/py/aria/legacy/QualityChecks/Descriptive.py
+@@ -1,3 +1,6 @@
++from math import *
++from numpy import *
++
+ class Descriptive:
+ """
+ some basic statistics
+@@ -55,7 +58,6 @@ class Descriptive:
+
+ def getStdDev(self):
+ if( len(self.myData) == 0): return None
+- from math import *
+ if( (self.count - 1) > 0 ):
+ return sqrt( self.pseudoVariance/ (self.count - 1))
+ else:
+@@ -89,7 +91,6 @@ class Descriptive:
+ def getMedian(self):
+ if( len(self.myData) == 0): return None
+ if( self.median == None ):
+- from numpy import *
+ sort(self.myData)
+ if( self.count%2 == 1):
+ self.median = self.myData[(self.count-1)/2]
diff --git a/sci-chemistry/aria/files/aria-2.3.2-through-space-2.patch b/sci-chemistry/aria/files/aria-2.3.2-through-space-2.patch
new file mode 100644
index 000000000000..6a363d098632
--- /dev/null
+++ b/sci-chemistry/aria/files/aria-2.3.2-through-space-2.patch
@@ -0,0 +1,139 @@
+ src/py/aria/exportToCcpn.py | 24 +++++++++++-------------
+ src/py/aria/importFromCcpn.py | 32 ++++++++++++--------------------
+ 2 files changed, 23 insertions(+), 33 deletions(-)
+
+diff --git a/src/py/aria/exportToCcpn.py b/src/py/aria/exportToCcpn.py
+index c742a88..aae7b7d 100644
+--- a/src/py/aria/exportToCcpn.py
++++ b/src/py/aria/exportToCcpn.py
+@@ -1,5 +1,5 @@
+ from ccpnmr.analysis.core.ConstraintBasic import makeNmrConstraintStore, makeStructureGeneration, getFixedResonance
+-from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims
++from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims, getThroughSpaceDataDims
+ from ccpnmr.analysis.core.AssignmentBasic import assignAtomsToRes, assignResToDim
+ from ccpnmr.analysis.core.PeakBasic import pickPeak, setManualPeakIntensity
+ from ccpnmr.analysis.core.MoleculeBasic import DEFAULT_ISOTOPES
+@@ -791,12 +791,13 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None,
+ ariaDims = ariaDimDict.get(spectrum)
+ if not ariaDims:
+ ariaDims = [] #[0,1,2]
++ throughSpaceDataDims = getThroughSpaceDataDims(spectrum)
+
+ dataDims = spectrum.sortedDataDims()
+ if len(dataDims) == 3:
+ for dataDim in dataDims:
+ expDimRef = dataDim.findFirstDataDimRef().expDimRef
+- if '1H' in expDimRef.isotopeCodes: # 0 or 2
++ if dataDim in throughSpaceDataDims: # 0 or 2
+ if onebondDims.get(dataDim.dim):
+ if ppmX1 is None:
+ ariaDims.append(2)
+@@ -816,21 +817,18 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None,
+ ariaDims.append(1)
+
+ else:
+- transfer = spectrum.experiment.findFirstExpTransfer(transferType='through-space') or \
+- spectrum.experiment.findFirstExpTransfer(transferType='NOESY')
+
++ i = 0
+ for dataDim in dataDims:
+- expDimRefs = [dataDimRef.expDimRef for dataDimRef in dataDim.dataDimRefs]
+- i = 0
+- for expDimRef in transfer.sortedExpDimRefs():
+- if expDimRef in expDimRefs:
+- ariaDims.append(i)
+- boundDim = onebondDims.get(dataDim.dim)
+- if boundDim:
+- ariaDims.append(i+1)
+-
++ if dataDim in throughSpaceDataDims:
++ ariaDims.append(i)
++ boundDim = onebondDims.get(dataDim.dim)
++ if boundDim:
++ ariaDims.append(i+1)
++
+ i += 2
+
++
+ ariaDimDict[spectrum] = ariaDims
+
+ if namesDict:
+diff --git a/src/py/aria/importFromCcpn.py b/src/py/aria/importFromCcpn.py
+index a65ae3e..f63ba16 100644
+--- a/src/py/aria/importFromCcpn.py
++++ b/src/py/aria/importFromCcpn.py
+@@ -165,7 +165,7 @@ def getStructureEnsembles(project, ccpChains):
+
+ return ensembles
+
+-def getNoesyPeakLists(project, molSystem=None):
++def getNoesyPeakLists(project, molSystem=None, excludeSimulated=True):
+ """Descrn: Get the NOE peak lists from a CCPN project. Can filter if appropriate to a given
+ molecular system if passed in.
+ Inputs: Implementation.Project, ccp.molecule.MolSystem.MolSystem
+@@ -196,19 +196,10 @@ def getNoesyPeakLists(project, molSystem=None):
+
+ for spectrum in experiment.dataSources:
+ if (spectrum.dataType == 'processed') and (spectrum.numDim > 1):
+-
+- isotopes = []
+- for dataDim in spectrum.dataDims:
+- for expDimRef in dataDim.expDim.expDimRefs:
+- if expDimRef.measurementType in ('shift','Shift'):
+- isotope = ','.join(expDimRef.isotopeCodes)
+- isotopes.append(isotope)
+- break
+-
+- if isotopes.count('1H') > 1:
+- for peakList in spectrum.peakLists:
+- if peakList.findFirstPeak():
+- peakLists.append(peakList)
++ for peakList in spectrum.sortedPeakLists():
++ if excludeSimulated and peakList.isSimulated:
++ continue
++ peakLists.append(peakList)
+
+
+ return peakLists
+@@ -490,7 +481,10 @@ def makeAriaChain(ccpChain):
+ # Does below work for DNA/RNA?
+
+ aria_settings = ChainSettings()
+- aria_settings['type'] = chainTypeMapping[ccpChain.molecule.molType]
++ # wb104: below changed 31 Oct 2011 to try and get around case when molType is None
++ #aria_settings['type'] = chainTypeMapping[ccpChain.molecule.molType]
++ molType = ccpChain.molecule.molType or 'protein'
++ aria_settings['type'] = chainTypeMapping[molType]
+
+ aria_chain = Chain(settings=aria_settings, segid=string_to_segid(ccpChain.code))
+
+@@ -952,8 +946,6 @@ def makeAriaSpectrum(peakList, ariaMolecule, filterRejected=True):
+ expDimRefDict = {}
+
+ for expDimRef in transfer.sortedExpDimRefs():
+- if expDimRef.isotopeCodes != ('1H',):
+- raise Exception('Not an H-H experiment')
+
+ onebondTransfer = expDimRef.findFirstExpTransfer(transferType='onebond')
+
+@@ -1095,7 +1087,7 @@ def getAriaAtomsFromResonance(resonance, ariaMolecule, cache={}):
+
+ # TJS modify to return just a list of atoms, rather than a list of list
+ ariaAtoms = []
+- for atom in atomSet.sortedAtoms():
++ for atom in atomSet.atoms:
+ ariaAtom = ariaResidue.atoms.get(atom.name)
+ if not ariaAtom:
+ messager.warning('Could not find ARIA Atom for CCPN atom %d%s %s' % (residue.seqCode,residue.ccpCode, atom.name))
+@@ -1256,9 +1248,9 @@ def getAriaDistanceRestraintsList(constraint_list, constraint_type, aria_mol):
+ restraint.setWeight(weight)
+
+
+- for constrItem in distConstr.sortedItems():
++ for constrItem in distConstr.items:
+
+- reso1, reso2 = constrItem.sortedResonances()
++ reso1, reso2 = constrItem.resonances
+
+ # TJS fix for mapping prochirals
+ # always use real resonnances where possible
diff --git a/sci-chemistry/aria/files/aria-2.3.2-through-space.patch b/sci-chemistry/aria/files/aria-2.3.2-through-space.patch
new file mode 100644
index 000000000000..bda76aa11c80
--- /dev/null
+++ b/sci-chemistry/aria/files/aria-2.3.2-through-space.patch
@@ -0,0 +1,118 @@
+ src/py/aria/exportToCcpn.py | 24 +++++++++++-------------
+ src/py/aria/importFromCcpn.py | 25 +++++++------------------
+ 2 files changed, 18 insertions(+), 31 deletions(-)
+
+diff --git a/src/py/aria/exportToCcpn.py b/src/py/aria/exportToCcpn.py
+index c742a88..aae7b7d 100644
+--- a/src/py/aria/exportToCcpn.py
++++ b/src/py/aria/exportToCcpn.py
+@@ -1,5 +1,5 @@
+ from ccpnmr.analysis.core.ConstraintBasic import makeNmrConstraintStore, makeStructureGeneration, getFixedResonance
+-from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims
++from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims, getThroughSpaceDataDims
+ from ccpnmr.analysis.core.AssignmentBasic import assignAtomsToRes, assignResToDim
+ from ccpnmr.analysis.core.PeakBasic import pickPeak, setManualPeakIntensity
+ from ccpnmr.analysis.core.MoleculeBasic import DEFAULT_ISOTOPES
+@@ -791,12 +791,13 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None,
+ ariaDims = ariaDimDict.get(spectrum)
+ if not ariaDims:
+ ariaDims = [] #[0,1,2]
++ throughSpaceDataDims = getThroughSpaceDataDims(spectrum)
+
+ dataDims = spectrum.sortedDataDims()
+ if len(dataDims) == 3:
+ for dataDim in dataDims:
+ expDimRef = dataDim.findFirstDataDimRef().expDimRef
+- if '1H' in expDimRef.isotopeCodes: # 0 or 2
++ if dataDim in throughSpaceDataDims: # 0 or 2
+ if onebondDims.get(dataDim.dim):
+ if ppmX1 is None:
+ ariaDims.append(2)
+@@ -816,21 +817,18 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None,
+ ariaDims.append(1)
+
+ else:
+- transfer = spectrum.experiment.findFirstExpTransfer(transferType='through-space') or \
+- spectrum.experiment.findFirstExpTransfer(transferType='NOESY')
+
++ i = 0
+ for dataDim in dataDims:
+- expDimRefs = [dataDimRef.expDimRef for dataDimRef in dataDim.dataDimRefs]
+- i = 0
+- for expDimRef in transfer.sortedExpDimRefs():
+- if expDimRef in expDimRefs:
+- ariaDims.append(i)
+- boundDim = onebondDims.get(dataDim.dim)
+- if boundDim:
+- ariaDims.append(i+1)
+-
++ if dataDim in throughSpaceDataDims:
++ ariaDims.append(i)
++ boundDim = onebondDims.get(dataDim.dim)
++ if boundDim:
++ ariaDims.append(i+1)
++
+ i += 2
+
++
+ ariaDimDict[spectrum] = ariaDims
+
+ if namesDict:
+diff --git a/src/py/aria/importFromCcpn.py b/src/py/aria/importFromCcpn.py
+index a65ae3e..91ad123 100644
+--- a/src/py/aria/importFromCcpn.py
++++ b/src/py/aria/importFromCcpn.py
+@@ -196,19 +196,10 @@ def getNoesyPeakLists(project, molSystem=None):
+
+ for spectrum in experiment.dataSources:
+ if (spectrum.dataType == 'processed') and (spectrum.numDim > 1):
+-
+- isotopes = []
+- for dataDim in spectrum.dataDims:
+- for expDimRef in dataDim.expDim.expDimRefs:
+- if expDimRef.measurementType in ('shift','Shift'):
+- isotope = ','.join(expDimRef.isotopeCodes)
+- isotopes.append(isotope)
+- break
+-
+- if isotopes.count('1H') > 1:
+- for peakList in spectrum.peakLists:
+- if peakList.findFirstPeak():
+- peakLists.append(peakList)
++ for peakList in spectrum.sortedPeakLists():
++ if excludeSimulated and peakList.isSimulated:
++ continue
++ peakLists.append(peakList)
+
+
+ return peakLists
+@@ -952,8 +943,6 @@ def makeAriaSpectrum(peakList, ariaMolecule, filterRejected=True):
+ expDimRefDict = {}
+
+ for expDimRef in transfer.sortedExpDimRefs():
+- if expDimRef.isotopeCodes != ('1H',):
+- raise Exception('Not an H-H experiment')
+
+ onebondTransfer = expDimRef.findFirstExpTransfer(transferType='onebond')
+
+@@ -1095,7 +1084,7 @@ def getAriaAtomsFromResonance(resonance, ariaMolecule, cache={}):
+
+ # TJS modify to return just a list of atoms, rather than a list of list
+ ariaAtoms = []
+- for atom in atomSet.sortedAtoms():
++ for atom in atomSet.atoms:
+ ariaAtom = ariaResidue.atoms.get(atom.name)
+ if not ariaAtom:
+ messager.warning('Could not find ARIA Atom for CCPN atom %d%s %s' % (residue.seqCode,residue.ccpCode, atom.name))
+@@ -1256,9 +1245,9 @@ def getAriaDistanceRestraintsList(constraint_list, constraint_type, aria_mol):
+ restraint.setWeight(weight)
+
+
+- for constrItem in distConstr.sortedItems():
++ for constrItem in distConstr.items:
+
+- reso1, reso2 = constrItem.sortedResonances()
++ reso1, reso2 = constrItem.resonances
+
+ # TJS fix for mapping prochirals
+ # always use real resonnances where possible
diff --git a/sci-chemistry/aria/metadata.xml b/sci-chemistry/aria/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/aria/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/arp-warp-bin/Manifest b/sci-chemistry/arp-warp-bin/Manifest
new file mode 100644
index 000000000000..739b86dac839
--- /dev/null
+++ b/sci-chemistry/arp-warp-bin/Manifest
@@ -0,0 +1 @@
+DIST arp_warp_7.5.tar.gz 198643246 SHA256 d16fc6775905e56e5159f4a658f654b98d94f78143a2537ba67bffaed7ef1ad8 SHA512 351ed4bad863bac63005d128c693b7dde60c03ca5e8bd449ea602646f7f856c022070e542bcacae2793fbde88d67e7b5639bedeec55eeb191017a2ec19d03768 WHIRLPOOL d4ea42179a8a406508c82320567dc39ce419a2cba8b9e6ed05739dbbf0c9aba072b720c56987c4c94806ba2772f9c8787bde898f7c76543cc4702f00b7f16532
diff --git a/sci-chemistry/arp-warp-bin/arp-warp-bin-7.5.ebuild b/sci-chemistry/arp-warp-bin/arp-warp-bin-7.5.ebuild
new file mode 100644
index 000000000000..ef10d0ab3d5d
--- /dev/null
+++ b/sci-chemistry/arp-warp-bin/arp-warp-bin-7.5.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils prefix
+
+MY_P="arp_warp_${PV}"
+
+DESCRIPTION="Improvement and interpretation of crystallographic electron density maps"
+SRC_URI="${MY_P}.tar.gz"
+HOMEPAGE="http://www.embl-hamburg.de/ARP/"
+
+LICENSE="ArpWarp"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="cpu_flags_x86_sse2"
+
+REQUIRED_USE="cpu_flags_x86_sse2"
+
+RDEPEND="
+ app-shells/tcsh
+ sci-chemistry/refmac
+ virtual/awk
+ virtual/jre
+ virtual/opengl
+ x11-libs/libX11"
+DEPEND=""
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_PREBUILT="opt/arp-warp-bin/bin/*"
+
+pkg_nofetch(){
+ elog "Fill out the form at http://www.embl-hamburg.de/ARP/"
+ elog "and place ${A} in ${DISTDIR}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/7.3-setup.patch
+ eprefixify "${S}"/share/arpwarp_setup_base.*
+
+ sed -e '/exit/d' -i "${S}"/share/arpwarp_setup_base.* || die
+}
+
+src_install(){
+ m_type=$(uname -m)
+ os_type=$(uname)
+
+ exeinto /opt/${PN}/bin/bin-${m_type}-${os_type}
+ doexe "${S}"/bin/bin-${m_type}-${os_type}/* "${S}"/share/*{pl,sh}
+
+ insinto /opt/${PN}/bin/bin-${m_type}-${os_type}
+ doins "${S}"/share/*{gif,bmp,XYZ,bash,csh,dat,lib,tbl,llh,prm}
+
+ insinto /etc/profile.d/
+ newins "${S}"/share/arpwarp_setup_base.csh 90arpwarp_setup.csh
+ newins "${S}"/share/arpwarp_setup_base.bash 90arpwarp_setup.sh
+
+ dodoc "${S}"/README manual/UserGuide${PV}.pdf
+ dohtml -r "${S}"/manual/html/*
+}
+
+pkg_postinst(){
+ testcommand=$(echo 3 2 | awk '{printf"%3.1f",$1/$2}')
+ if [ $testcommand == "1,5" ];then
+ ewarn "*** ERROR ***"
+ ewarn " 3/2=" $testcommand
+ ewarn "Invalid decimal separator (must be ".")"
+ ewarn "You need to set this correctly!!!"
+ echo
+ ewarn "One way of setting the decimal separator is:"
+ ewarn "setenv LC_NUMERIC C' in your .cshrc file"
+ ewarn "\tor"
+ ewarn "export LC_NUMERIC=C' in your .bashrc file"
+ ewarn "Otherwise please consult your system manager"
+ fi
+}
diff --git a/sci-chemistry/arp-warp-bin/files/7.3-setup.patch b/sci-chemistry/arp-warp-bin/files/7.3-setup.patch
new file mode 100644
index 000000000000..faed9c1102fd
--- /dev/null
+++ b/sci-chemistry/arp-warp-bin/files/7.3-setup.patch
@@ -0,0 +1,30 @@
+diff --git a/share/arpwarp_setup_base.bash b/share/arpwarp_setup_base.bash
+index 29e769c..0b8a51e 100644
+--- a/share/arpwarp_setup_base.bash
++++ b/share/arpwarp_setup_base.bash
+@@ -13,10 +13,10 @@ else
+ identifier=${nameprocessor}'-'${namesystem}
+ fi
+ #
+-arpwarphome="$1X"
++arpwarphome="@GENTOO_PORTAGE_EPREFIX@/opt/arp-warp-bin"
+ #
+ export warpbin=${arpwarphome}/bin/bin-${identifier}
+-export warpdoc=${arpwarphome}/manual
++export warpdoc=@GENTOO_PORTAGE_EPREFIX@/usr/share/doc/arp-warp-bin-7.1/html/
+ export PATH=${warpbin}:${PATH}
+ #
+ # Checks for existence of $warpbin directory
+diff --git a/share/arpwarp_setup_base.csh b/share/arpwarp_setup_base.csh
+index 41b11e9..a4edcff 100644
+--- a/share/arpwarp_setup_base.csh
++++ b/share/arpwarp_setup_base.csh
+@@ -13,7 +13,7 @@ else
+ set identifier = ${nameprocessor}'-'${namesystem}
+ endif
+ #
+-set arpwarphome = '$1X'
++set arpwarphome = '@GENTOO_PORTAGE_EPREFIX@/opt/arp-warp-bin'
+ #
+ setenv warpbin ${arpwarphome}/bin/bin-${identifier}
+ #
diff --git a/sci-chemistry/arp-warp-bin/metadata.xml b/sci-chemistry/arp-warp-bin/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/arp-warp-bin/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/autodock/Manifest b/sci-chemistry/autodock/Manifest
new file mode 100644
index 000000000000..422cb216787f
--- /dev/null
+++ b/sci-chemistry/autodock/Manifest
@@ -0,0 +1 @@
+DIST autodocksuite-4.2.6-src.tar.gz 35438010 SHA256 4b24ce4baf216a5e1a6a79bb664eeed684aed17cede64ff0061aa1bcc17874c4 SHA512 75b8878f948c4f6bc28adb442997192dad0c36bbede2fd698623903cb27b06b4df3ba038bfc70fc13b4bdee864fd2344f0f7208be2020da4e01a00b842b46bbb WHIRLPOOL 18230783d13c2d82ad6427711a48dec0c6695301a52dcf419cf4feefb0b5f41bac5de53824313e75d9040ac8623915ba266e764e92ecad9869d845053ec60b93
diff --git a/sci-chemistry/autodock/autodock-4.2.6.ebuild b/sci-chemistry/autodock/autodock-4.2.6.ebuild
new file mode 100644
index 000000000000..10d018292e93
--- /dev/null
+++ b/sci-chemistry/autodock/autodock-4.2.6.ebuild
@@ -0,0 +1,102 @@
+# 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 eutils python-any-r1 versionator
+
+MY_PN="autodocksuite"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A suite of automated docking tools"
+HOMEPAGE="http://autodock.scripps.edu/"
+SRC_URI="http://autodock.scripps.edu/downloads/autodock-registration/tars/dist$(delete_all_version_separators)/${MY_P}-src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples openmp test"
+
+RDEPEND=""
+DEPEND="test? ( ${PYTHON_DEPS} )"
+
+S="${WORKDIR}/src"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-buildsystem.patch
+)
+
+src_prepare() {
+ local i
+
+ epatch ${PATCHES[@]}
+
+ sed \
+ -e "s/\tcsh/\tsh/" \
+ -i auto{dock,grid}/Makefile.am || die
+ for i in autodock autogrid; do
+ pushd $i &>/dev/null
+ eautoreconf
+ popd &>/dev/null
+ done
+}
+
+src_configure() {
+ local i
+ for i in autodock autogrid; do
+ pushd $i &>/dev/null
+ econf $(use_enable openmp)
+ popd &>/dev/null
+ done
+}
+
+src_compile() {
+ emake -C autodock
+ emake -C autogrid
+}
+
+src_test() {
+ elog "Testing autodock"
+ cd "${S}/autodock/Tests" || die
+ cp ../*.dat . || die
+ ${EPYTHON} test_autodock4.py || die "AutoDock tests failed."
+ einfo "Testing autogrid"
+ cd "${S}/autogrid/Tests" || die
+ ${EPYTHON} test_autogrid4.py || die "AutoGrid tests failed."
+}
+
+src_install() {
+ if use openmp; then
+ newbin autodock/autodock4.omp ${PN}4
+ dobin autogrid/autogrid4
+ else
+ dobin autodock/autodock4 autogrid/autogrid4
+ fi
+
+ insinto /usr/share/${PN}
+ doins -r \
+ autodock/{AD4_parameters.dat,AD4_PARM99.dat} \
+ $(usex examples "autodoc/EXAMPLES" "")
+
+ DOCS=(
+ RELEASENOTES
+ autodock/{AUTHORS,README}
+ autodock/USERGUIDES/AutoDock4.{0,1,2}_UserGuide.doc
+ autodock/USERGUIDES/AutoDock4.2_UserGuide.pdf
+ )
+ einstalldocs
+}
+
+pkg_postinst() {
+ elog "The AutoDock development team requests all users to fill out the"
+ elog "registration form at:"
+ echo
+ elog "\thttp://autodock.scripps.edu/downloads/autodock-registration"
+ echo
+ elog "The number of unique users of AutoDock is used by Prof. Arthur J."
+ elog "Olson and the Scripps Research Institude to support grant"
+ elog "applications."
+}
diff --git a/sci-chemistry/autodock/files/4.0.1-gcc-4.3.patch b/sci-chemistry/autodock/files/4.0.1-gcc-4.3.patch
new file mode 100644
index 000000000000..b9eb3c409c64
--- /dev/null
+++ b/sci-chemistry/autodock/files/4.0.1-gcc-4.3.patch
@@ -0,0 +1,10 @@
+--- autodocksuite-4.0.1.orig/src/autogrid/check_size.cpp 2008-08-04 22:44:46.000000000 -0700
++++ autodocksuite-4.0.1/src/autogrid/check_size.cpp 2008-08-04 22:45:12.000000000 -0700
+@@ -27,6 +27,7 @@
+
+ #include <iostream>
+ #include <math.h>
++#include <cstdlib>
+ #include "autogrid.h"
+
+
diff --git a/sci-chemistry/autodock/files/autodock-4.2.6-buildsystem.patch b/sci-chemistry/autodock/files/autodock-4.2.6-buildsystem.patch
new file mode 100644
index 000000000000..ae44ffeb3159
--- /dev/null
+++ b/sci-chemistry/autodock/files/autodock-4.2.6-buildsystem.patch
@@ -0,0 +1,44 @@
+ src/autodock/Makefile.am | 6 +++---
+ src/autogrid/Makefile.am | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/autodock/Makefile.am b/src/autodock/Makefile.am
+index 799a3c4..911897b 100644
+--- a/src/autodock/Makefile.am
++++ b/src/autodock/Makefile.am
+@@ -459,7 +459,8 @@ endif
+
+ BUILT_SOURCES = $(autodock4_SOURCES) default_parameters.h
+
+-AM_CXXFLAGS = -O3 # Agressive optimization
++AM_CXXFLAGS =
++#AM_CXXFLAGS = -O3 # Agressive optimization
+ #AM_CXXFLAGS = -g # debug
+
+ # if gnu c++ compiler
+@@ -488,8 +489,7 @@ endif
+ AM_CPPFLAGS = -DNOSQRT \
+ -DUSE_DOUBLE \
+ -DUSE_8A_NBCUTOFF \
+- -DUSE_INT_AS_FOURBYTELONG \
+- -O3
++ -DUSE_INT_AS_FOURBYTELONG
+ # AM_LDFLAGS = -g # -g is MP debug
+
+
+diff --git a/src/autogrid/Makefile.am b/src/autogrid/Makefile.am
+index b531099..b78b380 100644
+--- a/src/autogrid/Makefile.am
++++ b/src/autogrid/Makefile.am
+@@ -94,9 +94,9 @@ autogrid4_SOURCES = main.cpp \
+ BUILT_SOURCES = default_parameters.h
+
+
+-AM_CFLAGS = -Wall -O3 # All warnings, Agressive optimization
++AM_CFLAGS = -Wall # All warnings, Agressive optimization
+
+-AM_CPPFLAGS = -Wall -O3 -I $(srcdir) -I$(srcdir)/../autodock # All warnings, Agressive optimization
++AM_CPPFLAGS = -Wall -I $(srcdir) -I$(srcdir)/../autodock # All warnings, Agressive optimization
+ AM_CPPFLAGS += -Wno-write-strings # increase compatibility with pre 4.x compilers for string handling
+ # M Pique - add USE_8A_NBCUTOFF
+ AM_CPPFLAGS += -DUSE_8A_NBCUTOFF
diff --git a/sci-chemistry/autodock/metadata.xml b/sci-chemistry/autodock/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/autodock/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/autodock_vina/Manifest b/sci-chemistry/autodock_vina/Manifest
new file mode 100644
index 000000000000..a2f7882e9d79
--- /dev/null
+++ b/sci-chemistry/autodock_vina/Manifest
@@ -0,0 +1 @@
+DIST autodock_vina_1_1_2.tgz 67366 SHA256 b86412d316960b1e4e319401719daf57ff009229d91654d623c3cf09339f6776 SHA512 f704af322ebc192117c49d0cf8a3f217105beccb7b47d6361665470894ef7a9f91fc4b5f07cc9aff56e497bfa80953e40e39090c8394a095c61597756e333ae9 WHIRLPOOL b68f3bb81fe957fddb6674f71e0c63d1425eb5b4de0615258545ba8e241b347380c8745ee47bd2ee2257f29916191773440e3dd4e9ce857b83a947074eae8d45
diff --git a/sci-chemistry/autodock_vina/autodock_vina-1.1.2.ebuild b/sci-chemistry/autodock_vina/autodock_vina-1.1.2.ebuild
new file mode 100644
index 000000000000..aea218f8faf9
--- /dev/null
+++ b/sci-chemistry/autodock_vina/autodock_vina-1.1.2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic versionator
+
+MY_P="${PN}_$(replace_all_version_separators _)"
+
+DESCRIPTION="Program for drug discovery, molecular docking and virtual screening"
+HOMEPAGE="http://vina.scripps.edu/"
+SRC_URI="http://vina.scripps.edu/download/${MY_P}.tgz"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+LICENSE="Apache-2.0"
+IUSE="debug"
+
+RDEPEND="dev-libs/boost"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_P}/build/linux/release
+
+src_prepare() {
+ cd "${WORKDIR}"/${MY_P} || die
+ epatch \
+ "${FILESDIR}"/${PV}-gentoo.patch \
+ "${FILESDIR}"/${P}-boost-filesystem.patch
+}
+
+src_compile() {
+ local c_options
+
+ use debug || c_options="-DNDEBUG"
+
+ append-cxxflags -DBOOST_FILESYSTEM_VERSION=3
+
+ emake \
+ BASE="${EPREFIX}"/usr/ \
+ GPP="$(tc-getCXX)" \
+ C_OPTIONS="${c_options}"
+}
+
+src_install() {
+ dobin vina{,_split}
+}
diff --git a/sci-chemistry/autodock_vina/files/1.1.1-gentoo.patch b/sci-chemistry/autodock_vina/files/1.1.1-gentoo.patch
new file mode 100644
index 000000000000..356ae2ee547d
--- /dev/null
+++ b/sci-chemistry/autodock_vina/files/1.1.1-gentoo.patch
@@ -0,0 +1,68 @@
+diff --git a/build/linux/debug/Makefile b/build/linux/debug/Makefile
+index d2c2d3b..d1f02e5 100644
+--- a/build/linux/debug/Makefile
++++ b/build/linux/debug/Makefile
+@@ -1,6 +1,6 @@
+ BASE=/usr/local
+ BOOST_VERSION=1_41
+-C_PLATFORM=-static-libgcc -pthread
++C_PLATFORM=-pthread
+ GPP=/usr/bin/g++
+ C_OPTIONS= -g
+ BOOST_LIB_VERSION=
+diff --git a/build/linux/release/Makefile b/build/linux/release/Makefile
+index bfbcc1e..c9fd630 100644
+--- a/build/linux/release/Makefile
++++ b/build/linux/release/Makefile
+@@ -1,6 +1,6 @@
+ BASE=/usr/local
+ BOOST_VERSION=1_41
+-C_PLATFORM=-static-libgcc -pthread
++C_PLATFORM=-pthread
+ GPP=/usr/bin/g++
+ C_OPTIONS= -O3 -DNDEBUG
+ BOOST_LIB_VERSION=
+diff --git a/build/makefile_common b/build/makefile_common
+index 885935c..e72142d 100644
+--- a/build/makefile_common
++++ b/build/makefile_common
+@@ -1,30 +1,30 @@
+-BOOST_INCLUDE = $(BASE)/include/boost-${BOOST_VERSION}
++BOOST_INCLUDE = $(BASE)/include/boost
+
+ LIBOBJ = cache.o coords.o current_weights.o everything.o grid.o szv_grid.o manifold.o model.o monte_carlo.o mutate.o my_pid.o naive_non_cache.o non_cache.o parallel_mc.o parse_pdbqt.o pdb.o quasi_newton.o quaternion.o random.o ssd.o terms.o weighted_terms.o
+ MAINOBJ = main.o
+ SPLITOBJ = split.o
+
+-INCFLAGS = -I $(BOOST_INCLUDE)
++INCFLAGS = -I$(BOOST_INCLUDE)
+
+-CC = ${GPP} ${C_PLATFORM} -ansi -pedantic -Wno-long-long ${C_OPTIONS} $(INCFLAGS)
++CC = ${GPP} ${C_PLATFORM} ${C_OPTIONS} $(INCFLAGS)
+
+-LDFLAGS = -L$(BASE)/lib -L.
++LDFLAGS += -L.
+
+-LIBS = -l boost_system${BOOST_LIB_VERSION} -l boost_thread${BOOST_LIB_VERSION} -l boost_serialization${BOOST_LIB_VERSION} -l boost_filesystem${BOOST_LIB_VERSION} -l boost_program_options${BOOST_LIB_VERSION}#-l pthread
++LIBS = -lboost_system -lboost_thread -lboost_serialization -lboost_filesystem -lboost_program_options -lpthread
+
+ .SUFFIXES: .cpp .o
+
+ %.o : ../../../src/lib/%.cpp
+- $(CC) $(CFLAGS) -o $@ -c $<
++ $(CC) $(CXXFLAGS) -o $@ -c $<
+
+ %.o : ../../../src/design/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ %.o : ../../../src/main/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ %.o : ../../../src/split/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ all: vina vina_split
+
diff --git a/sci-chemistry/autodock_vina/files/1.1.2-gentoo.patch b/sci-chemistry/autodock_vina/files/1.1.2-gentoo.patch
new file mode 100644
index 000000000000..61ae8bec36f5
--- /dev/null
+++ b/sci-chemistry/autodock_vina/files/1.1.2-gentoo.patch
@@ -0,0 +1,72 @@
+ build/linux/debug/Makefile | 2 +-
+ build/linux/release/Makefile | 2 +-
+ build/makefile_common | 14 +++++++-------
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/build/linux/debug/Makefile b/build/linux/debug/Makefile
+index 6a41cfc..8097fb9 100644
+--- a/build/linux/debug/Makefile
++++ b/build/linux/debug/Makefile
+@@ -1,7 +1,7 @@
+ BASE=/usr/local
+ BOOST_VERSION=1_41
+ BOOST_INCLUDE = $(BASE)/include
+-C_PLATFORM=-static -pthread
++C_PLATFORM=-pthread
+ GPP=/usr/local/bin/g++
+ C_OPTIONS= -g
+ BOOST_LIB_VERSION=
+diff --git a/build/linux/release/Makefile b/build/linux/release/Makefile
+index 1de1063..ded8133 100644
+--- a/build/linux/release/Makefile
++++ b/build/linux/release/Makefile
+@@ -1,7 +1,7 @@
+ BASE=/usr/local
+ BOOST_VERSION=1_41
+ BOOST_INCLUDE = $(BASE)/include
+-C_PLATFORM=-static -pthread
++C_PLATFORM=-pthread
+ GPP=/usr/local/bin/g++
+ C_OPTIONS= -O3 -DNDEBUG
+ BOOST_LIB_VERSION=
+diff --git a/build/makefile_common b/build/makefile_common
+index a940329..96336e8 100644
+--- a/build/makefile_common
++++ b/build/makefile_common
+@@ -2,29 +2,29 @@ LIBOBJ = cache.o coords.o current_weights.o everything.o grid.o szv_grid.o manif
+ MAINOBJ = main.o
+ SPLITOBJ = split.o
+
+-INCFLAGS = -I $(BOOST_INCLUDE)
++INCFLAGS = -I$(BOOST_INCLUDE)
+
+ # -pedantic fails on Mac with Boost 1.41 (syntax problems in their headers)
+ #CC = ${GPP} ${C_PLATFORM} -ansi -pedantic -Wno-long-long ${C_OPTIONS} $(INCFLAGS)
+ CC = ${GPP} ${C_PLATFORM} -ansi -Wno-long-long ${C_OPTIONS} $(INCFLAGS)
+
+-LDFLAGS = -L$(BASE)/lib -L.
++LDFLAGS += -L.
+
+-LIBS = -l boost_system${BOOST_LIB_VERSION} -l boost_thread${BOOST_LIB_VERSION} -l boost_serialization${BOOST_LIB_VERSION} -l boost_filesystem${BOOST_LIB_VERSION} -l boost_program_options${BOOST_LIB_VERSION}#-l pthread
++LIBS = -lboost_system -lboost_thread -lboost_serialization -lboost_filesystem -lboost_program_options -lpthread
+
+ .SUFFIXES: .cpp .o
+
+ %.o : ../../../src/lib/%.cpp
+- $(CC) $(CFLAGS) -o $@ -c $<
++ $(CC) $(CXXFLAGS) -o $@ -c $<
+
+ %.o : ../../../src/design/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ %.o : ../../../src/main/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ %.o : ../../../src/split/%.cpp
+- $(CC) $(CFLAGS) -I ../../../src/lib -o $@ -c $<
++ $(CC) $(CXXFLAGS) -I ../../../src/lib -o $@ -c $<
+
+ all: vina vina_split
+
diff --git a/sci-chemistry/autodock_vina/files/autodock_vina-1.1.2-boost-filesystem.patch b/sci-chemistry/autodock_vina/files/autodock_vina-1.1.2-boost-filesystem.patch
new file mode 100644
index 000000000000..298aaa9ab993
--- /dev/null
+++ b/sci-chemistry/autodock_vina/files/autodock_vina-1.1.2-boost-filesystem.patch
@@ -0,0 +1,79 @@
+ src/main/main.cpp | 10 +++++++++-
+ src/split/split.cpp | 11 ++++++++++-
+ 2 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/main/main.cpp b/src/main/main.cpp
+index f49c8f5..b566aa2 100644
+--- a/src/main/main.cpp
++++ b/src/main/main.cpp
+@@ -47,7 +47,7 @@
+ using boost::filesystem::path;
+
+ path make_path(const std::string& str) {
+- return path(str, boost::filesystem::native);
++ return path(str);
+ }
+
+ void doing(int verbosity, const std::string& str, tee& log) {
+@@ -661,7 +661,11 @@ Thank you!\n";
+ cpu, seed, verbosity, max_modes_sz, energy_range, log);
+ }
+ catch(file_error& e) {
++#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
++ std::cerr << "\n\nError: could not open \"" << e.name.string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
++#else
+ std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
++#endif
+ return 1;
+ }
+ catch(boost::filesystem::filesystem_error& e) {
+@@ -673,7 +677,11 @@ Thank you!\n";
+ return 1;
+ }
+ catch(parse_error& e) {
++#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
++ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.string() << "\": " << e.reason << '\n';
++#else
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
++#endif
+ return 1;
+ }
+ catch(std::bad_alloc&) {
+diff --git a/src/split/split.cpp b/src/split/split.cpp
+index 54c614b..bc5530e 100644
+--- a/src/split/split.cpp
++++ b/src/split/split.cpp
+@@ -38,7 +38,7 @@
+ using boost::filesystem::path;
+
+ path make_path(const std::string& str) {
+- return path(str, boost::filesystem::native);
++ return path(str);
+ }
+
+ std::string default_prefix(const std::string& input_name, const std::string& add) {
+@@ -208,7 +208,12 @@ Thank you!\n";
+ write_multimodel_pdbqt(tmp, ligand_prefix, flex_prefix);
+ }
+ catch(file_error& e) {
++
++#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
++ std::cerr << "\n\nError: could not open \"" << e.name.string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
++#else
+ std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
++#endif
+ return 1;
+ }
+ catch(boost::filesystem::filesystem_error& e) {
+@@ -220,7 +225,11 @@ Thank you!\n";
+ return 1;
+ }
+ catch(parse_error& e) {
++#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
++ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.string() << "\": " << e.reason << '\n';
++#else
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
++#endif
+ return 1;
+ }
+ catch(std::bad_alloc&) {
diff --git a/sci-chemistry/autodock_vina/metadata.xml b/sci-chemistry/autodock_vina/metadata.xml
new file mode 100644
index 000000000000..3f44e973345a
--- /dev/null
+++ b/sci-chemistry/autodock_vina/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+AutoDock Vina is a new open-source program for drug discovery, molecular
+docking and virtual screening, offering multi-core capability, high
+performance and enhanced accuracy and ease of use. [1]
+AutoDock Vina has been designed and implemented by Dr. Oleg Trott
+in the Molecular Graphics Lab at The Scripps Research Institute.
+If you used AutoDock Vina in your work, please cite:
+O. Trott, A. J. Olson, AutoDock Vina: improving the speed and accuracy
+of docking with a new scoring function, efficient optimization and
+multithreading
+Journal of Computational Chemistry 31 (2010) 455-461
+</longdescription>
+ <!--
+<use>
+ <flag name='flag'>Description of how USE='flag' affects this package</flag>
+ <flag name='userland_GNU'>Description of how USERLAND='GNU' affects this
+ package</flag>
+ <flag name='aspell'>Uses <pkg>app-text/aspell</pkg> for spell checking.
+ Requires an installed dictionary from <cat>app-dicts</cat></flag>
+</use>
+-->
+</pkgmetadata>
diff --git a/sci-chemistry/avogadro/Manifest b/sci-chemistry/avogadro/Manifest
new file mode 100644
index 000000000000..aad0cb8f1ba9
--- /dev/null
+++ b/sci-chemistry/avogadro/Manifest
@@ -0,0 +1,2 @@
+DIST avogadro-1.0.3.tar.bz2 4971989 SHA256 efb6fda223da3c027436f0c218a47ce804f7469c58b41134230e9ebad1c98468 SHA512 49e7b8ca43f0f52a65efc7bf9dc45670ae5a5de5d1aa6bf7b58b8368e816be30fe6529c45fa658d7337d4a69327bb0aa8799d8d4b4805860aace28011cc74210 WHIRLPOOL c835ac24b317a1fa310bf3ea75bae4002d01f364d4754e6a7d841594dcce321435c827d60e125d9410f05670a94c887cc250bf49759d02cde34a5839d2324c92
+DIST avogadro-1.1.0.tar.bz2 10741835 SHA256 6b4eaf57ae52bf43df9b103c77e6abae71e067053d5c99f82acbce9855ecceb0 SHA512 d621dd3ea9e9223d3a29c6b0c0eec89a935837d0c587fcaaa549f91274a76f78a8c60c2a68a67d2f3aa2e107826befb6658be601c46c5bc0760c95bf7284540a WHIRLPOOL c81e866e60b3383a58de515317c754e3982e716c27974ce43ca0c1209d24544949361a7f2f93a4a940d73fd7a18b184f68c7a1856fea89ae5eba75db74b1012d
diff --git a/sci-chemistry/avogadro/avogadro-1.0.3-r2.ebuild b/sci-chemistry/avogadro/avogadro-1.0.3-r2.ebuild
new file mode 100644
index 000000000000..ae73ee50ac4e
--- /dev/null
+++ b/sci-chemistry/avogadro/avogadro-1.0.3-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eutils python-single-r1
+
+DESCRIPTION="Advanced molecular editor that uses Qt4 and OpenGL"
+HOMEPAGE="http://avogadro.openmolecules.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
+IUSE="+glsl python cpu_flags_x86_sse2"
+
+RDEPEND="
+ >=sci-chemistry/openbabel-2.2.3
+ >=dev-qt/qtgui-4.5.3:4
+ >=dev-qt/qtopengl-4.5.3:4
+ x11-libs/gl2ps
+ glsl? ( >=media-libs/glew-1.5.0 )
+ python? (
+ >=dev-libs/boost-1.35.0-r5[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/sip[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}
+ dev-cpp/eigen:2"
+
+PATCHES=(
+ "${FILESDIR}"/1.0.1-gl2ps.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_THREADGL=OFF
+ -DENABLE_RPATH=OFF
+ -DENABLE_UPDATE_CHECKER=OFF
+ -DQT_MKSPECS_DIR="${EPREFIX}/usr/share/qt4/mkspecs"
+ -DQT_MKSPECS_RELATIVE=share/qt4/mkspecs
+ $(cmake-utils_use_enable glsl)
+ $(cmake-utils_use_with cpu_flags_x86_sse2 SSE2)
+ $(cmake-utils_use_enable python)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/sci-chemistry/avogadro/avogadro-1.1.0.ebuild b/sci-chemistry/avogadro/avogadro-1.1.0.ebuild
new file mode 100644
index 000000000000..0de1b83085b6
--- /dev/null
+++ b/sci-chemistry/avogadro/avogadro-1.1.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eutils python-single-r1
+
+DESCRIPTION="Advanced molecular editor that uses Qt4 and OpenGL"
+HOMEPAGE="http://avogadro.openmolecules.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+glsl python cpu_flags_x86_sse2 test"
+
+RDEPEND="
+ >=sci-chemistry/openbabel-2.3.0
+ >=dev-qt/qtgui-4.5.3:4
+ >=dev-qt/qtopengl-4.5.3:4
+ x11-libs/gl2ps
+ glsl? ( >=media-libs/glew-1.5.0 )
+ python? (
+ >=dev-libs/boost-1.35.0-r5[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/sip[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}
+ dev-cpp/eigen:2"
+
+# https://sourceforge.net/p/avogadro/bugs/653/
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-textrel.patch
+ "${FILESDIR}"/${P}-xlibs.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_THREADGL=OFF
+ -DENABLE_RPATH=OFF
+ -DENABLE_UPDATE_CHECKER=OFF
+ -DQT_MKSPECS_DIR="${EPREFIX}/usr/share/qt4/mkspecs"
+ -DQT_MKSPECS_RELATIVE=share/qt4/mkspecs
+ $(cmake-utils_use_enable glsl)
+ $(cmake-utils_use_enable test TESTS)
+ $(cmake-utils_use_with cpu_flags_x86_sse2 SSE2)
+ $(cmake-utils_use_enable python)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/sci-chemistry/avogadro/files/1.0.1-gl2ps.patch b/sci-chemistry/avogadro/files/1.0.1-gl2ps.patch
new file mode 100644
index 000000000000..d8a0c0f758e1
--- /dev/null
+++ b/sci-chemistry/avogadro/files/1.0.1-gl2ps.patch
@@ -0,0 +1,39 @@
+diff --git a/avogadro/src/CMakeLists.txt b/avogadro/src/CMakeLists.txt
+index 75b6dfb..d87ac2c 100644
+--- a/avogadro/src/CMakeLists.txt
++++ b/avogadro/src/CMakeLists.txt
+@@ -45,7 +45,7 @@ endif(ENABLE_UPDATE_CHECKER)
+ FILE(GLOB projectDelegates_SRCS "projectdelegates/*.cpp")
+ set(avogadro_SRCS ${avogadro_SRCS} ${projectDelegates_SRCS})
+ # Add GL2PS to the executable
+-set(avogadro_SRCS ${avogadro_SRCS} "../gl2ps/gl2ps.c")
++#set(avogadro_SRCS ${avogadro_SRCS} "../gl2ps/gl2ps.c")
+
+ if( WIN32 )
+ set(avogadro_SRCS ${avogadro_SRCS} windows/avogadro.rc)
+diff --git a/avogadro/src/mainwindow.cpp b/avogadro/src/mainwindow.cpp
+index 66785fd..2933953 100644
+--- a/avogadro/src/mainwindow.cpp
++++ b/avogadro/src/mainwindow.cpp
+@@ -51,7 +51,7 @@
+ //#endif
+
+ // Include the GL2PS header
+-#include "../gl2ps/gl2ps.h"
++#include <gl2ps.h>
+
+ #include <avogadro/pluginmanager.h>
+
+diff --git a/libavogadro/src/CMakeLists.txt b/libavogadro/src/CMakeLists.txt
+index cce8ece..cc084fb 100644
+--- a/libavogadro/src/CMakeLists.txt
++++ b/libavogadro/src/CMakeLists.txt
+@@ -152,7 +152,7 @@ endforeach(headerFile ${libavogadro_HDRS})
+ add_library(avogadro SHARED ${libavogadro_SRCS} ${libavogadro_QM} ${pythontool_RC_SRCS})
+ set_target_properties(avogadro
+ PROPERTIES VERSION ${Avogadro_VERSION_FULL} SOVERSION 1 )
+-target_link_libraries(avogadro ${AVO_LINK_LIBRARIES})
++target_link_libraries(avogadro ${AVO_LINK_LIBRARIES} gl2ps)
+
+ install(TARGETS avogadro DESTINATION ${LIB_INSTALL_DIR})
+ install(FILES ${libavogadro_HDRS}
diff --git a/sci-chemistry/avogadro/files/avogadro-1.1.0-textrel.patch b/sci-chemistry/avogadro/files/avogadro-1.1.0-textrel.patch
new file mode 100644
index 000000000000..6d4536ef7c9b
--- /dev/null
+++ b/sci-chemistry/avogadro/files/avogadro-1.1.0-textrel.patch
@@ -0,0 +1,29 @@
+ libavogadro/src/extensions/crystallography/spglib/CMakeLists.txt | 2 +-
+ libavogadro/src/extensions/swcntbuilder/tubegen/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavogadro/src/extensions/crystallography/spglib/CMakeLists.txt b/libavogadro/src/extensions/crystallography/spglib/CMakeLists.txt
+index fb88316..2ddcfdf 100644
+--- a/libavogadro/src/extensions/crystallography/spglib/CMakeLists.txt
++++ b/libavogadro/src/extensions/crystallography/spglib/CMakeLists.txt
+@@ -20,6 +20,6 @@ add_library(spglib STATIC ${spglib_SRCS})
+ set_target_properties(spglib PROPERTIES COMPILE_FLAGS "-w")
+
+ # Set -fPIC on x86_64
+-if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
++if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(i.86|x86|x86_64|ppc|ppc64)$")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
+ endif()
+diff --git a/libavogadro/src/extensions/swcntbuilder/tubegen/CMakeLists.txt b/libavogadro/src/extensions/swcntbuilder/tubegen/CMakeLists.txt
+index 0cd0c3e..9e89daf 100644
+--- a/libavogadro/src/extensions/swcntbuilder/tubegen/CMakeLists.txt
++++ b/libavogadro/src/extensions/swcntbuilder/tubegen/CMakeLists.txt
+@@ -19,7 +19,7 @@ add_library(tubegen STATIC ${tubegen_SRCS})
+ set_target_properties(tubegen PROPERTIES COMPILE_FLAGS "-w")
+
+ # Set -fPIC on x86_64
+-if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
++if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(i.86|x86|x86_64|ppc|ppc64)$")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
+ endif()
diff --git a/sci-chemistry/avogadro/files/avogadro-1.1.0-xlibs.patch b/sci-chemistry/avogadro/files/avogadro-1.1.0-xlibs.patch
new file mode 100644
index 000000000000..74a5889ec8ae
--- /dev/null
+++ b/sci-chemistry/avogadro/files/avogadro-1.1.0-xlibs.patch
@@ -0,0 +1,16 @@
+ * Info: Using [gentoo] (https://bugs.gentoo.org/xmlrpc.cgi)
+ * Info: Getting attachment 403034
+ * Info: Viewing attachment: "X11.patch"
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 60ec98f..03443a7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -225,6 +225,7 @@ set(I18N_LANGUAGE "" CACHE STRING "Build i18n only for selected language")
+
+ find_package(Qt4 4.6.0 REQUIRED) # find and setup Qt4 for this project
+ find_package(OpenGL REQUIRED) # find and setup OpenGL
++find_package(X11 REQUIRED)
+ find_package(Linguist) # find and setup Linguist
+ if(NOT Linguist_FOUND)
+ message(WARNING " Qt4 Linguist not found, please install it if you want Avogadro translations")
+
diff --git a/sci-chemistry/avogadro/metadata.xml b/sci-chemistry/avogadro/metadata.xml
new file mode 100644
index 000000000000..bacd1480b120
--- /dev/null
+++ b/sci-chemistry/avogadro/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <longdescription>
+ Avogadro is an advanced molecular editor designed for cross-platform use in
+ computational chemistry, molecular modeling, bioinformatics, materials
+ science, and related areas. It offers flexible rendering and a powerful
+ plugin architecture.
+ </longdescription>
+ <use>
+ <flag name="glsl">Enable glsl features via GLEW.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">avogadro</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/azara/Manifest b/sci-chemistry/azara/Manifest
new file mode 100644
index 000000000000..700d6abb6ece
--- /dev/null
+++ b/sci-chemistry/azara/Manifest
@@ -0,0 +1 @@
+DIST azara-2.8-src.tgz 638120 SHA256 1f9b86d368ca3b4818c88490c40b2055c7a6d1732e746e4c117e045a73269a98 SHA512 61a913b041f8ed7dade9d452ca0d99804ffcea0c678f23ad8357c1e7188996eecde9402201399306fcb32a504b17c3d61997f50ce57794f876c9f8d492ca500c WHIRLPOOL b7512fe29ad97830d2f96811e71c2ab74e9e71c62354f65a499484a1a57fbe8b74a8ecd27a0b72c48cf0ec5bb48c78148433e32f4f2a880c6317d516f3aa644a
diff --git a/sci-chemistry/azara/azara-2.8-r4.ebuild b/sci-chemistry/azara/azara-2.8-r4.ebuild
new file mode 100644
index 000000000000..2b5f3bd6f0b8
--- /dev/null
+++ b/sci-chemistry/azara/azara-2.8-r4.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="python? 2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
+
+inherit eutils python toolchain-funcs
+
+DESCRIPTION="A suite of programmes to process and view NMR data"
+HOMEPAGE="http://www.bio.cam.ac.uk/azara/"
+SRC_URI="http://www.bio.cam.ac.uk/ccpn/download/${PN}/${P}-src.tgz"
+
+LICENSE="AZARA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE="python xpm X"
+
+RDEPEND="
+ x11-libs/libX11
+ x11-libs/motif:0
+ xpm? ( x11-libs/libXpm )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ cat > ENVIRONMENT <<- EOF
+ CC=$(tc-getCC)
+ CFLAGS = ${CFLAGS}
+ LFLAGS = ${LDFLAGS}
+ MATH_LIB = -lm
+ X11_INCLUDE_DIR = -I"${EPREFIX}/usr/X11R6/include"
+ MOTIF_INCLUDE_DIR = -I"${EPREFIX}/usr/include" -I../global
+ X11_LIB_DIR = -L"${EPREFIX}/usr/$(get_libdir)"
+ MOTIF_LIB_DIR = -L"${EPREFIX}/usr/$(get_libdir)"
+ X11_LIB = -lX11
+ MOTIF_LIB = -lXm -lXt
+ SHARED_FLAGS = -shared
+ ENDIAN_FLAG = -DBIG_ENDIAN_DATA -DWRITE_ENDIAN_PAR
+ PIC = -fPIC
+ EOF
+
+ use xpm && echo "XPMUSE=\"XPM_FLAG=-DUSE_XPM XPM_LIB=-lXpm\"" >> ENVIRONMENT
+
+ epatch \
+ "${FILESDIR}"/${PV}-prll.patch \
+ "${FILESDIR}"/${PV}-impl-dec.patch \
+ "${FILESDIR}"/${PV}-python.patch \
+ "${FILESDIR}"/${PV}-64bit.patch
+}
+
+src_compile() {
+ local mymake
+ local makeflags
+
+ mymake="${mymake} help nongui"
+ use X && mymake="${mymake} gui"
+
+ emake ${mymake} || die
+
+ compilation() {
+ emake DataRows_clean || die
+ emake \
+ PYTHON_INCLUDE_DIR="-I${EPREFIX}/$(python_get_includedir)" \
+ PYTHON_LIB="$(python_get_library -l)" \
+ DataRows || die
+ }
+ use python && python_execute_function compilation
+}
+
+src_install() {
+ rm bin/pythonAzara || die
+ if ! use X; then
+ rm bin/plot* || die
+ fi
+
+ dodoc CHANGES* README* || die
+ dohtml -r html/* || die
+
+ installation() {
+ insinto $(python_get_sitedir)
+ doins lib/DataRows.so || die
+ }
+ use python && python_execute_function installation
+
+ cd bin
+ dobin ${PN}|| die
+ rm ${PN}
+ for bin in *; do
+ newbin ${bin} ${bin}-${PN} || die "failed to install ${bin}"
+ done
+}
+
+pkg_postinst() {
+ einfo "Due to collision we moved all binary to *-${PN}"
+}
diff --git a/sci-chemistry/azara/azara-2.8-r5.ebuild b/sci-chemistry/azara/azara-2.8-r5.ebuild
new file mode 100644
index 000000000000..4b90f2ccbd2b
--- /dev/null
+++ b/sci-chemistry/azara/azara-2.8-r5.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1 toolchain-funcs
+
+DESCRIPTION="A suite of programmes to process and view NMR data"
+HOMEPAGE="http://www.bio.cam.ac.uk/azara/"
+SRC_URI="http://www.bio.cam.ac.uk/ccpn/download/${PN}/${P}-src.tgz"
+
+LICENSE="AZARA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+IUSE="xpm X"
+
+RDEPEND="
+ x11-libs/libX11
+ x11-libs/motif:0
+ xpm? ( x11-libs/libXpm )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ cat > ENVIRONMENT <<- EOF
+ CC=$(tc-getCC)
+ CFLAGS = ${CFLAGS}
+ LFLAGS = ${LDFLAGS}
+ MATH_LIB = -lm
+ X11_INCLUDE_DIR = -I"${EPREFIX}/usr/X11R6/include"
+ MOTIF_INCLUDE_DIR = -I"${EPREFIX}/usr/include" -I../global
+ X11_LIB_DIR = -L"${EPREFIX}/usr/$(get_libdir)"
+ MOTIF_LIB_DIR = -L"${EPREFIX}/usr/$(get_libdir)"
+ X11_LIB = -lX11
+ MOTIF_LIB = -lXm -lXt
+ SHARED_FLAGS = -shared
+ ENDIAN_FLAG = -DBIG_ENDIAN_DATA -DWRITE_ENDIAN_PAR
+ PIC = -fPIC
+ EOF
+
+ use xpm && echo "XPMUSE=\"XPM_FLAG=-DUSE_XPM XPM_LIB=-lXpm\"" >> ENVIRONMENT
+
+ epatch \
+ "${FILESDIR}"/${PV}-prll.patch \
+ "${FILESDIR}"/${PV}-impl-dec.patch \
+ "${FILESDIR}"/${PV}-python.patch \
+ "${FILESDIR}"/${PV}-64bit.patch
+}
+
+src_compile() {
+ local mymake
+ local makeflags
+
+ mymake="${mymake} help nongui"
+ use X && mymake="${mymake} gui"
+
+ emake ${mymake}
+
+ compilation() {
+ python_export PYTHON_CFLAGS PYTHON_LIBS
+ cd "${BUILD_DIR}" || die
+ emake DataRows_clean
+ emake \
+ PYTHON_INCLUDE_DIR="${PYTHON_CFLAGS}" \
+ PYTHON_LIB="${PYTHON_LIBS}" \
+ DataRows
+ }
+ python_copy_sources
+ python_foreach_impl compilation
+}
+
+src_install() {
+ rm bin/pythonAzara || die
+ if ! use X; then
+ rm bin/plot* || die
+ fi
+
+ dodoc CHANGES* README*
+ dohtml -r html/*
+
+ cd bin || die
+ dobin ${PN}
+ rm ${PN} || die
+ for bin in *; do
+ newbin ${bin} ${bin}-${PN}
+ done
+
+ installation() {
+ cd "${BUILD_DIR}" || die
+ python_domodule lib/DataRows.so
+ }
+ python_foreach_impl installation
+}
+
+pkg_postinst() {
+ einfo "Due to collision we moved all binary to *-${PN}"
+}
diff --git a/sci-chemistry/azara/files/2.8-64bit.patch b/sci-chemistry/azara/files/2.8-64bit.patch
new file mode 100644
index 000000000000..c65e075c1d30
--- /dev/null
+++ b/sci-chemistry/azara/files/2.8-64bit.patch
@@ -0,0 +1,85 @@
+diff --git a/global/par.c b/global/par.c
+index ac87c88..fecfe35 100644
+--- a/global/par.c
++++ b/global/par.c
+@@ -562,9 +562,9 @@ static Status get_varian_header(FILE *fp, String error_msg)
+ return OK;
+ }
+
+-static long get_varian_long(int offset)
++static int get_varian_int(int offset)
+ {
+- long x;
++ int x;
+
+ if (swapped)
+ {
+@@ -572,7 +572,7 @@ static long get_varian_long(int offset)
+ SWAP(varian_header[offset+1], varian_header[offset+2], char);
+ }
+
+- x = *((long *) (varian_header + offset));
++ x = *((int *) (varian_header + offset));
+
+ return x;
+ }
+@@ -591,7 +591,7 @@ static short get_varian_short(int offset)
+
+ static Status check_varian_header(String error_msg)
+ {
+- long nblocks, ntraces, np, ebytes, tbytes, /*bbytes,*/ d;
++ int nblocks, ntraces, np, ebytes, tbytes, /*bbytes,*/ d;
+ short status;
+ FILE *fp;
+
+@@ -605,17 +605,19 @@ static Status check_varian_header(String error_msg)
+ FCLOSE(fp);
+
+ /* numbers in parentheses are offsets into header */
+- nblocks = get_varian_long(0); /* number of blocks in file */
+- ntraces = get_varian_long(4); /* number of traces per block */
+- np = get_varian_long(8); /* number of elements per trace */
+- ebytes = get_varian_long(12); /* number of bytes per element */
+- tbytes = get_varian_long(16); /* number of bytes per trace */
+- /*bbytes = get_varian_long(20);*/ /* number of bytes per block */
++ nblocks = get_varian_int(0); /* number of blocks in file */
++ printf("nblocks = %d\n", nblocks);
++ ntraces = get_varian_int(4); /* number of traces per block */
++ printf("ntraces = %d\n", ntraces);
++ np = get_varian_int(8); /* number of elements per trace */
++ ebytes = get_varian_int(12); /* number of bytes per element */
++ tbytes = get_varian_int(16); /* number of bytes per trace */
++ /*bbytes = get_varian_int(20);*/ /* number of bytes per block */
+ /* short starting at 24 is software version */
+ status = get_varian_short(26); /* status of whole file */
+ /* long starting at 28 is number of block headers */
+
+- if (ntraces != 1L)
++ if (ntraces != 1)
+ RETURN_ERROR_MSG("can only process Varian data with #traces = 1");
+
+ if (np != npoints[0])
+@@ -646,12 +648,12 @@ static Status check_varian_header(String error_msg)
+
+ if (integer)
+ {
+- if (ebytes == 2L)
++ if (ebytes == 2)
+ {
+ if (status & (1<<2))
+ RETURN_ERROR_MSG("Varian header has inconsistent byte information");
+ }
+- else if (ebytes == 4L)
++ else if (ebytes == 4)
+ {
+ if (!(status & (1<<2)))
+ RETURN_ERROR_MSG("Varian header has inconsistent byte information");
+@@ -666,7 +668,7 @@ static Status check_varian_header(String error_msg)
+ }
+ else /* !integer, i.e. floating point */
+ {
+- if (ebytes != 4L)
++ if (ebytes != 4)
+ RETURN_ERROR_MSG("Varian header has inconsistent byte information");
+ }
+
diff --git a/sci-chemistry/azara/files/2.8-impl-dec.patch b/sci-chemistry/azara/files/2.8-impl-dec.patch
new file mode 100644
index 000000000000..62e8c7d6873b
--- /dev/null
+++ b/sci-chemistry/azara/files/2.8-impl-dec.patch
@@ -0,0 +1,226 @@
+diff --git a/DataRows/data_rows.c b/DataRows/data_rows.c
+index 054fa1f..a07eedc 100644
+--- a/DataRows/data_rows.c
++++ b/DataRows/data_rows.c
+@@ -1,4 +1,5 @@
+ #include "data_rows.h"
++#include "utility.h"
+
+ #include "par.h"
+
+diff --git a/DataRows/py_data_rows.c b/DataRows/py_data_rows.c
+index fc8b3c8..985e6c3 100644
+--- a/DataRows/py_data_rows.c
++++ b/DataRows/py_data_rows.c
+@@ -1,4 +1,6 @@
+ #include "Python.h" /* Python header files */
++#include "modsupport.h"
++#include "intobject.h"
+
+ #include "data_rows.h"
+
+diff --git a/connect/crosspeak.c b/connect/crosspeak.c
+index 0de57bf..7b016e1 100644
+--- a/connect/crosspeak.c
++++ b/connect/crosspeak.c
+@@ -1,4 +1,5 @@
+ #include "crosspeak.h"
++#include "utility.h"
+
+ #include "atom.h"
+ #include "table.h"
+diff --git a/connect/shift.c b/connect/shift.c
+index f54ba9f..a880001 100644
+--- a/connect/shift.c
++++ b/connect/shift.c
+@@ -1,4 +1,5 @@
+ #include "shift.h"
++#include "utility.h"
+
+ #include "atom.h"
+ #include "table.h"
+diff --git a/global/macros.h b/global/macros.h
+index 43fc43e..bb1d267 100644
+--- a/global/macros.h
++++ b/global/macros.h
+@@ -8,6 +8,7 @@
+ #include <math.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <ctype.h>
+
+ #ifdef WIN32
+ #include <ctype.h>
+diff --git a/global/parser.c b/global/parser.c
+index 007d926..0f19575 100644
+--- a/global/parser.c
++++ b/global/parser.c
+@@ -1,4 +1,5 @@
+ #include "parser.h"
++#include "utility.h"
+
+ #define MAX_NARGS 20
+
+diff --git a/peak/fitter.c b/peak/fitter.c
+index ba6b175..b58f573 100644
+--- a/peak/fitter.c
++++ b/peak/fitter.c
+@@ -1,4 +1,5 @@
+ #include "fitter.h"
++#include "data.h"
+
+ #include "nonlinear_model.h"
+
+diff --git a/peak/peak_fit.c b/peak/peak_fit.c
+index 92c69a8..5b9791f 100644
+--- a/peak/peak_fit.c
++++ b/peak/peak_fit.c
+@@ -6,6 +6,7 @@
+ #include "output.h"
+ #include "ref.h"
+ #include "script_fit.h"
++#include "fitter.h"
+
+ #define MEGAWORD (1024 * 1024)
+ #define DEFAULT_STORE (2 * MEGAWORD)
+diff --git a/plot1/draw.c b/plot1/draw.c
+index 4fdce96..a2a2e8a 100644
+--- a/plot1/draw.c
++++ b/plot1/draw.c
+@@ -1,4 +1,5 @@
+ #include "draw.h"
++#include "ticks.h"
+
+ #include "color.h"
+ #include "data.h"
+diff --git a/plot1/object.c b/plot1/object.c
+index 973897c..e043a53 100644
+--- a/plot1/object.c
++++ b/plot1/object.c
+@@ -1,4 +1,5 @@
+ #include "object.h"
++#include "script.h"
+
+ #include "color.h"
+ #include "parser.h"
+diff --git a/plot1/output_popup.c b/plot1/output_popup.c
+index 0794584..e73976e 100644
+--- a/plot1/output_popup.c
++++ b/plot1/output_popup.c
+@@ -1,4 +1,5 @@
+ #include "output_popup.h"
++#include "script.h"
+
+ #include "output.hlp"
+
+diff --git a/plot1/plots.c b/plot1/plots.c
+index 3790f5b..7ac58df 100644
+--- a/plot1/plots.c
++++ b/plot1/plots.c
+@@ -1,4 +1,5 @@
+ #include "plots.h"
++#include "script.h"
+
+ #include "data.h"
+ #include "input.h"
+diff --git a/plot1/region_popup.c b/plot1/region_popup.c
+index 68b3930..f049d29 100644
+--- a/plot1/region_popup.c
++++ b/plot1/region_popup.c
+@@ -1,4 +1,5 @@
+ #include "region_popup.h"
++#include "data.h"
+
+ #include "region.hlp"
+
+diff --git a/plot2/data_popup.c b/plot2/data_popup.c
+index 851b1d4..1c9026e 100644
+--- a/plot2/data_popup.c
++++ b/plot2/data_popup.c
+@@ -1,4 +1,5 @@
+ #include "data_popup.h"
++#include "rowcol_popup.h"
+
+ #include "data.hlp"
+
+diff --git a/plot2/extract_popup.c b/plot2/extract_popup.c
+index 416aab0..a7fcbf3 100644
+--- a/plot2/extract_popup.c
++++ b/plot2/extract_popup.c
+@@ -1,4 +1,5 @@
+ #include "extract_popup.h"
++#include "script.h"
+
+ #include "extract.hlp"
+
+diff --git a/plot2/levels_popup.c b/plot2/levels_popup.c
+index 197cf2c..e1ac22c 100644
+--- a/plot2/levels_popup.c
++++ b/plot2/levels_popup.c
+@@ -1,4 +1,5 @@
+ #include "levels_popup.h"
++#include "levels_func.h"
+
+ #include "levels.hlp"
+
+diff --git a/plot2/plot2.c b/plot2/plot2.c
+index 9ca91c3..0c10d5a 100644
+--- a/plot2/plot2.c
++++ b/plot2/plot2.c
+@@ -1,4 +1,6 @@
+ #include "plot2.h"
++#include "object_popup.h"
++#include "prop_popup.h"
+
+ #include "baseline_popup.h"
+ #include "callback.h"
+diff --git a/plot2/rowcol_popup.c b/plot2/rowcol_popup.c
+index e9f4843..6c50426 100644
+--- a/plot2/rowcol_popup.c
++++ b/plot2/rowcol_popup.c
+@@ -1,4 +1,5 @@
+ #include "rowcol_popup.h"
++#include "ref_popup.h"
+
+ #include "rowcol.hlp"
+
+diff --git a/plot2/script.c b/plot2/script.c
+index 2f55182..d7d886f 100644
+--- a/plot2/script.c
++++ b/plot2/script.c
+@@ -1,4 +1,5 @@
+ #include "script.h"
++#include "macros.h"
+
+ #include "param.h"
+ #include "stack.h"
+diff --git a/plot2/slice_popup.c b/plot2/slice_popup.c
+index b601834..1b1e686 100644
+--- a/plot2/slice_popup.c
++++ b/plot2/slice_popup.c
+@@ -1,4 +1,5 @@
+ #include "slice_popup.h"
++#include "rowcol_func.h"
+
+ #include "baseline.h"
+ #include "baseline_popup.h"
+diff --git a/process/files.c b/process/files.c
+index e09127e..d95d681 100644
+--- a/process/files.c
++++ b/process/files.c
+@@ -1,4 +1,5 @@
+ #include "files.h"
++#include "macros.h"
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff --git a/project/project.c b/project/project.c
+index 92b70e3..a3e6d94 100644
+--- a/project/project.c
++++ b/project/project.c
+@@ -1,4 +1,5 @@
+ #include "project.h"
++#include "utility.h"
+
+ #include "block.h"
+ #include "par.h"
diff --git a/sci-chemistry/azara/files/2.8-prll.patch b/sci-chemistry/azara/files/2.8-prll.patch
new file mode 100644
index 000000000000..4720bb659445
--- /dev/null
+++ b/sci-chemistry/azara/files/2.8-prll.patch
@@ -0,0 +1,387 @@
+diff --git a/DataRows/makefile b/DataRows/makefile
+index 587e710..4e0a312 100644
+--- a/DataRows/makefile
++++ b/DataRows/makefile
+@@ -28,7 +28,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-DataRows.so: locals globals
++DataRows.so: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) $(SHARED_FLAGS) -o $@ $(CFLAGS) $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS)
+diff --git a/azara/makefile b/azara/makefile
+index 3ba0cd9..f7b4ce5 100644
+--- a/azara/makefile
++++ b/azara/makefile
+@@ -12,7 +12,7 @@ LOCAL_OBJS = \
+ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/help.o
+
+-azara: locals globals
++azara: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/combine/makefile b/combine/makefile
+index a855236..7a83d8f 100644
+--- a/combine/makefile
++++ b/combine/makefile
+@@ -20,7 +20,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-combine: locals globals
++combine: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/connect/makefile b/connect/makefile
+index d75e7da..d238507 100644
+--- a/connect/makefile
++++ b/connect/makefile
+@@ -23,7 +23,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-connect: locals globals
++connect: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/contours/makefile b/contours/makefile
+index 5b832b8..49175dd 100644
+--- a/contours/makefile
++++ b/contours/makefile
+@@ -19,7 +19,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-contours: locals globals
++contours: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/deflate/makefile b/deflate/makefile
+index 4c4e02e..42d5c30 100644
+--- a/deflate/makefile
++++ b/deflate/makefile
+@@ -18,7 +18,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-deflate: locals globals
++deflate: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/extract/makefile b/extract/makefile
+index 3212cb9..fed874b 100644
+--- a/extract/makefile
++++ b/extract/makefile
+@@ -18,7 +18,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-extract: locals globals
++extract: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/global/makefile b/global/makefile
+index 364fa41..5272a31 100644
+--- a/global/makefile
++++ b/global/makefile
+@@ -42,6 +42,31 @@ LINPACK_OBJS = \
+ AZARA_OBJS = \
+ help.o
+
++all: \
++ azara_objects \
++ decay_objects \
++ simulate_objects \
++ viewer_objects \
++ components_objects \
++ shuffle_objects \
++ connect_objects \
++ slides_objects \
++ peak_find_objects \
++ peak_fit_objects \
++ plot1_objects \
++ reflate_objects \
++ deflate_objects \
++ combine_objects \
++ unblock_objects \
++ extract_objects \
++ project_objects \
++ contours_objects \
++ plot2_nog_objects \
++ plot2_objects \
++ process_objects \
++ python_objects \
++ integrate_objects
++
+ azara_objects: $(AZARA_OBJS)
+
+ DECAY_OBJS = \
+diff --git a/help/makefile b/help/makefile
+index 9e99a7c..59a86a3 100644
+--- a/help/makefile
++++ b/help/makefile
+@@ -39,7 +39,7 @@ globals:
+
+ .c.o:; $(CC) -c $(CFLAGS) $<
+
+-hlp:
++hlp: txt2hlp
+ $(TXT2HLP) azara
+ $(TXT2HLP) combine
+ $(TXT2HLP) connect
+@@ -78,7 +78,7 @@ hlp:
+ $(TXT2HLP) plot1/text
+ $(TXT2HLP) DataRows
+
+-html:
++html: txt2html
+ $(TXT2HTML) azara
+ $(TXT2HTML) combine
+ $(TXT2HTML) connect
+diff --git a/makefile b/makefile
+index 9965b07..f4383af 100644
+--- a/makefile
++++ b/makefile
+@@ -14,7 +14,7 @@ all: help nongui DataRows gui
+ help: \
+ help_program
+
+-nongui: \
++nongui: help \
+ process_program \
+ plot2_nog_program \
+ peak_program \
+@@ -29,63 +29,66 @@ nongui: \
+ connect_program \
+ azara_program
+
+-gui: \
++gui: help \
+ plot2_program \
+ plot1_program
+
+-DataRows: \
++DataRows: help \
+ DataRows
+
+-process_program:
+- cd process; $(MAKE)
++global:
++ $(MAKE) -C global
+
+-plot2_program:
+- cd plot2; $(MAKE) plot2
++process_program: global
++ $(MAKE) -C process
+
+-plot2_nog_program:
+- cd plot2; $(MAKE) plot2_nog
++plot2_program: global
++ $(MAKE) -C plot2
+
+-plot1_program:
+- cd plot1; $(MAKE)
++plot2_nog_program: global
++ $(MAKE) -C plot2 plot2_nog
+
+-peak_program:
+- cd peak; $(MAKE)
++plot1_program: global
++ $(MAKE) -C plot1
+
+-extract_program:
+- cd extract; $(MAKE)
++peak_program: global process_program
++ $(MAKE) -C peak
+
+-project_program:
+- cd project; $(MAKE)
++extract_program: global
++ $(MAKE) -C extract
+
+-unblock_program:
+- cd unblock; $(MAKE)
++project_program: global
++ $(MAKE) -C project
+
+-contours_program:
+- cd contours; $(MAKE)
++unblock_program: global
++ $(MAKE) -C unblock
+
+-combine_program:
+- cd combine; $(MAKE)
++contours_program: global
++ $(MAKE) -C contours
+
+-deflate_program:
+- cd deflate; $(MAKE)
++combine_program: global
++ $(MAKE) -C combine
+
+-reflate_program:
+- cd reflate; $(MAKE)
++deflate_program: global
++ $(MAKE) -C deflate
+
+-utility_program:
+- cd utility; $(MAKE)
++reflate_program: global
++ $(MAKE) -C reflate
+
+-connect_program:
+- cd connect; $(MAKE)
++utility_program: global
++ $(MAKE) -C utility
+
+-help_program:
+- cd help; $(MAKE)
++connect_program: global
++ $(MAKE) -C connect
+
+-azara_program:
+- cd azara; $(MAKE)
++help_program: global
++ $(MAKE) -C help
+
+-DataRows:
+- cd DataRows; $(MAKE)
++azara_program: global
++ $(MAKE) -C azara
++
++DataRows: global
++ $(MAKE) -C DataRows
+
+ clean: \
+ global_clean \
+@@ -227,3 +230,5 @@ azara_realclean:
+ DataRows_realclean:
+ cd DataRows; $(MAKE) realclean
+
++
++.PHONY: global process_program
+diff --git a/peak/makefile b/peak/makefile
+index f3c13b7..4211221 100644
+--- a/peak/makefile
++++ b/peak/makefile
+@@ -97,13 +97,13 @@ COMMAND_OBJS = \
+
+ all: peak_find peak_fit
+
+-peak_find: local_find global_find
++peak_find: $(LOCAL_FIND_OBJS) $(GLOBAL_FIND_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_FIND_OBJS) \
+ $(GLOBAL_FIND_OBJS) \
+ $(LIB) $(MATH_LIB)
+
+-peak_fit: local_fit global_fit commands
++peak_fit: $(LOCAL_FIT_OBJS) $(GLOBAL_FIT_OBJS) $(COMMAND_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_FIT_OBJS) \
+ $(GLOBAL_FIT_OBJS) \
+diff --git a/plot1/makefile b/plot1/makefile
+index d1dce2d..e729443 100644
+--- a/plot1/makefile
++++ b/plot1/makefile
+@@ -95,7 +95,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/utility.o \
+ $(GLOBAL_DIR)/window.o
+
+-plot1: locals globals
++plot1: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+@@ -110,7 +110,7 @@ locals:
+ globals:
+ cd $(GLOBAL_DIR); $(MAKE) plot1_objects
+
+-.c.o:; $(CC) $(X11_INCLUDE_DIR) $(MOTIF_INCLUDE_DIR) -c $(CFLAGS) $<
++.c.o:; $(CC) $(X11_INCLUDE_DIR) $(MOTIF_INCLUDE_DIR) -c $(CFLAGS) -I../plot2 $<
+
+ clean:
+ rm -f *.o
+diff --git a/plot2/makefile b/plot2/makefile
+index a6b7b4a..98e286e 100644
+--- a/plot2/makefile
++++ b/plot2/makefile
+@@ -129,7 +129,7 @@ GLOBAL_PLOT2_NOG_OBJS = \
+
+ all: plot2 plot2_nog
+
+-plot2: local_plot2 global_plot2
++plot2: $(LOCAL_PLOT2_OBJS) $(GLOBAL_PLOT2_OBJS)
+ $(CC) -o $@ $(CFLAGS) $(LFLAGS) \
+ $(LOCAL_PLOT2_OBJS) \
+ $(GLOBAL_PLOT2_OBJS) \
+@@ -137,7 +137,7 @@ plot2: local_plot2 global_plot2
+ $(LIB) $(MATH_LIB) \
+ $(MOTIF_LIB) $(X11_LIB) $(XPM_LIB)
+
+-plot2_nog: local_plot2_nog global_plot2_nog
++plot2_nog: $(LOCAL_PLOT2_NOG_OBJS) $(GLOBAL_PLOT2_NOG_OBJS)
+ $(CC) -o $@ $(CFLAGS) $(LFLAGS) \
+ $(LOCAL_PLOT2_NOG_OBJS) \
+ $(GLOBAL_PLOT2_NOG_OBJS) \
+diff --git a/process/makefile b/process/makefile
+index 22ceeed..72d587b 100644
+--- a/process/makefile
++++ b/process/makefile
+@@ -72,7 +72,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/utility.o \
+ $(LINPACK_OBJS)
+
+-process: locals globals
++process: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/project/makefile b/project/makefile
+index 78143fc..ed0f296 100644
+--- a/project/makefile
++++ b/project/makefile
+@@ -18,7 +18,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-project: locals globals
++project: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/reflate/makefile b/reflate/makefile
+index 079a3fc..01ec311 100644
+--- a/reflate/makefile
++++ b/reflate/makefile
+@@ -18,7 +18,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-reflate: locals globals
++reflate: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
+diff --git a/unblock/makefile b/unblock/makefile
+index 510dc9e..d9a0f2b 100644
+--- a/unblock/makefile
++++ b/unblock/makefile
+@@ -18,7 +18,7 @@ GLOBAL_OBJS = \
+ $(GLOBAL_DIR)/ref.o \
+ $(GLOBAL_DIR)/utility.o
+
+-unblock: locals globals
++unblock: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) -o $@ $(LFLAGS) \
+ $(LOCAL_OBJS) \
+ $(GLOBAL_OBJS) \
diff --git a/sci-chemistry/azara/files/2.8-python.patch b/sci-chemistry/azara/files/2.8-python.patch
new file mode 100644
index 000000000000..9834c77a77dc
--- /dev/null
+++ b/sci-chemistry/azara/files/2.8-python.patch
@@ -0,0 +1,44 @@
+diff --git a/DataRows/makefile b/DataRows/makefile
+index 4e0a312..ce261ab 100644
+--- a/DataRows/makefile
++++ b/DataRows/makefile
+@@ -22,16 +22,17 @@ LOCAL_OBJS = \
+ data_rows.o
+
+ GLOBAL_OBJS = \
+- $(GLOBAL_DIR)/block_io.o \
+- $(GLOBAL_DIR)/par.o \
+- $(GLOBAL_DIR)/parse.o \
+- $(GLOBAL_DIR)/ref.o \
+- $(GLOBAL_DIR)/utility.o
++ block_io.o \
++ par.o \
++ parse.o \
++ ref.o \
++ utility.o
+
+ DataRows.so: $(LOCAL_OBJS) $(GLOBAL_OBJS)
+ $(CC) $(SHARED_FLAGS) -o $@ $(CFLAGS) $(LFLAGS) \
+ $(LOCAL_OBJS) \
+- $(GLOBAL_OBJS)
++ $(GLOBAL_OBJS) \
++ $(PYTHON_LIB)
+
+ local_objects: $(LOCAL_OBJS)
+
+@@ -42,9 +43,13 @@ globals:
+ cd $(GLOBAL_DIR); $(MAKE) python_objects
+
+ py_data_rows.o: py_data_rows.c
+- $(CC) -c $(CFLAGS) $(PYTHON_INCLUDE_DIR) $<
++ $(CC) -c $(CFLAGS) $(PIC) $(PYTHON_INCLUDE_DIR) $<
+
+-.c.o:; $(CC) -c $(CFLAGS) $<
++data_rows.o: data_rows.c
++ $(CC) -c $(CFLAGS) $(PIC) $<
++
++%.o: $(GLOBAL_DIR)/%.c
++ $(CC) -c $(CFLAGS) $(PIC) $<
+
+ clean:
+ rm -f *.o
diff --git a/sci-chemistry/azara/metadata.xml b/sci-chemistry/azara/metadata.xml
new file mode 100644
index 000000000000..c0432fefe855
--- /dev/null
+++ b/sci-chemistry/azara/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher (jlec)</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/babel/Manifest b/sci-chemistry/babel/Manifest
new file mode 100644
index 000000000000..c710a51eca7e
--- /dev/null
+++ b/sci-chemistry/babel/Manifest
@@ -0,0 +1 @@
+DIST babel-1.6.tar.Z 242341 SHA256 132a800cfe0c15b47391c809481a7ca174bbd1402aac7486e0973da0fd4db948 SHA512 60336f695b8ee3ec87433b003da38d55365162bbe87244cb175eabec6c0a470c475dac66f85f24525a61b16fa933bdc3eea5ddd0452b6573bcb046ab774b3229 WHIRLPOOL f6dee4fe6409aed0dfae3f672c826ccdb45f0f5d743421faf6622e1258435caf7d9259ece83ab711754a7964bca0c21af42ed179af23b056329d8b800bd95e80
diff --git a/sci-chemistry/babel/babel-1.6-r1.ebuild b/sci-chemistry/babel/babel-1.6-r1.ebuild
new file mode 100644
index 000000000000..1905b34846f0
--- /dev/null
+++ b/sci-chemistry/babel/babel-1.6-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="Interconvert file formats used in molecular modeling"
+HOMEPAGE="http://smog.com/chem/babel/"
+SRC_URI="http://smog.com/chem/babel/files/${P}.tar.Z"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+RESTRICT="mirror bindist"
+
+#Doesn't really seem to depend on anything (?)
+DEPEND="!sci-chemistry/openbabel"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-gcc32.diff \
+ "${FILESDIR}"/${P}-makefile.patch
+ tc-export CC
+}
+
+src_install () {
+ emake DESTDIR="${D}"/usr/bin install
+
+ insinto /usr/share/${PN}
+ doins *.lis
+
+ doenvd "${FILESDIR}"/10babel
+ dodoc README.1ST
+}
diff --git a/sci-chemistry/babel/files/10babel b/sci-chemistry/babel/files/10babel
new file mode 100644
index 000000000000..69f3397638dd
--- /dev/null
+++ b/sci-chemistry/babel/files/10babel
@@ -0,0 +1 @@
+BABEL_DIR=/usr/share/babel
diff --git a/sci-chemistry/babel/files/babel-1.6-gcc32.diff b/sci-chemistry/babel/files/babel-1.6-gcc32.diff
new file mode 100644
index 000000000000..ba0964af5352
--- /dev/null
+++ b/sci-chemistry/babel/files/babel-1.6-gcc32.diff
@@ -0,0 +1,28 @@
+--- block.c.orig Sun Sep 15 04:51:13 2002
++++ block.c Sun Sep 15 04:58:04 2002
+@@ -99,7 +99,12 @@
+ void *array;
+
+ /* calc how much space we are gonna need */
++#ifdef __va_copy
++ __va_copy (ap, initap);
++#else
+ ap = initap;
++#endif
++
+ size = 0;
+ for(i=0; types[i] != '\0'; i++)
+ {
+@@ -116,7 +121,12 @@
+ /* set up the ptrs if we can alloc the memory */
+ if(*handle != NULL)
+ {
++#ifdef __va_copy
++ __va_copy (ap, initap);
++#else
+ ap = initap;
++#endif
++
+ ptr = 0;
+ for(i=0; types[i] != '\0'; i++)
+ {
diff --git a/sci-chemistry/babel/files/babel-1.6-gentoo.diff b/sci-chemistry/babel/files/babel-1.6-gentoo.diff
new file mode 100644
index 000000000000..77e2cb47ef03
--- /dev/null
+++ b/sci-chemistry/babel/files/babel-1.6-gentoo.diff
@@ -0,0 +1,28 @@
+--- Makefile.orig Tue Oct 23 00:20:54 2001
++++ Makefile Tue Oct 23 00:33:36 2001
+@@ -1,11 +1,15 @@
+-CFLAGS = -O
++#Commented out to pull CFLAGS from make.conf
++#CFLAGS = -O
+
+ LIBFLAGS = -O -DLIBRARY
+
+-CC = cc
++#Probably not necessary to specify gcc
++CC = gcc
+
+ PROGRAM = babel
+
++DEST = ${DESTDIR}/$(PROGRAM)
++
+ LDFLAGS =
+
+ LIBS =
+@@ -334,6 +338,7 @@
+ index:; ctags -wx $(HDRS) $(SRCS)
+
+ install: $(PROGRAM)
++ install -d ${DESTDIR}
+ install -s $(PROGRAM) $(DEST)
+
+ print:; $(PRINT) $(HDRS) $(SRCS)
diff --git a/sci-chemistry/babel/files/babel-1.6-makefile.patch b/sci-chemistry/babel/files/babel-1.6-makefile.patch
new file mode 100644
index 000000000000..33b158d1b2cf
--- /dev/null
+++ b/sci-chemistry/babel/files/babel-1.6-makefile.patch
@@ -0,0 +1,33 @@
+diff -Naur babel-1.6/Makefile babel-1.6.new/Makefile
+--- babel-1.6/Makefile 1997-01-21 10:53:05.000000000 -0500
++++ babel-1.6.new/Makefile 2008-10-19 10:41:42.000000000 -0400
+@@ -1,12 +1,16 @@
+-CFLAGS = -O
++#Commented out to pull CFLAGS from make.conf
++#CFLAGS = -O
+
+ LIBFLAGS = -O -DLIBRARY
+
+-CC = cc
++#Probably not necessary to specify gcc
++#CC = gcc
+
+ PROGRAM = babel
+
+-LDFLAGS =
++DEST = ${DESTDIR}/$(PROGRAM)
++
++#LDFLAGS =
+
+ LIBS =
+
+@@ -334,7 +338,8 @@
+ index:; ctags -wx $(HDRS) $(SRCS)
+
+ install: $(PROGRAM)
+- install -s $(PROGRAM) $(DEST)
++ install -d ${DESTDIR}
++ install $(PROGRAM) $(DEST)
+
+ print:; $(PRINT) $(HDRS) $(SRCS)
+
diff --git a/sci-chemistry/babel/metadata.xml b/sci-chemistry/babel/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/babel/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/balbes/Manifest b/sci-chemistry/balbes/Manifest
new file mode 100644
index 000000000000..ac3f2cd87d87
--- /dev/null
+++ b/sci-chemistry/balbes/Manifest
@@ -0,0 +1,2 @@
+DIST balbes-1.0.0_p100317.tar.gz 506464 SHA256 c5bf6c2086e1a3d7d380e5501c0cffdb91cbf77c74d2951dd345273f21921d0c
+DIST ccp4-6.1.3-core-src.tar.gz 242134076 SHA256 1e529c660e7f390ec0feca9d45caa00a2813d23156c10a2747c427117293c324
diff --git a/sci-chemistry/balbes/balbes-1.0.0_p100317-r2.ebuild b/sci-chemistry/balbes/balbes-1.0.0_p100317-r2.ebuild
new file mode 100644
index 000000000000..5334207c0229
--- /dev/null
+++ b/sci-chemistry/balbes/balbes-1.0.0_p100317-r2.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+CCP4VER="6.1.3"
+PYTHON_DEPEND="2"
+
+inherit eutils fortran-2 python toolchain-funcs
+
+DESCRIPTION="Automated molecular replacement (MR) pipeline"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~fei/balbes/index.html"
+SRC_URI="
+ mirror://gentoo/${P}.tar.gz
+ ftp://ftp.ccp4.ac.uk/ccp4/${CCP4VER}/ccp4-${CCP4VER}-core-src.tar.gz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+# bundled PyXML is modified and cannot be replaced
+
+COMMON_DEPEND="sci-libs/ccp4-libs"
+RDEPEND="${COMMON_DEPEND}
+ ~sci-libs/balbes-db-${CCP4VER}
+ !<=sci-chemistry/ccp4-apps-6.1.3-r1"
+DEPEND="${COMMON_DEPEND}"
+
+S="${WORKDIR}"/src
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python_set_active_version 2
+}
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ tar xvzf "${DISTDIR}"/ccp4-${CCP4VER}-core-src.tar.gz \
+ ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/bin_py \
+ ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/PyXML-0.8.4
+ python_convert_shebangs 2 "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/bin_py/balbes
+}
+
+src_prepare() {
+ mkdir "${WORKDIR}"/bin || die
+ epatch "${FILESDIR}"/${PV}-makefile.patch
+ cd "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/
+ epatch "${FILESDIR}"/pyxml-0.8.4-python-2.6.patch
+}
+
+src_compile() {
+ emake \
+ BLANC_FORT="$(tc-getFC) ${FFLAGS}" || die
+ cd "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/PyXML-0.8.4
+ find build -delete
+ $(PYTHON) setup.py build
+ find xml/xslt test -delete
+}
+
+src_install() {
+ insinto /usr/share/balbes/BALBES_0.0.1/
+ doins -r \
+ "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/bin_py \
+ "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/PyXML-0.8.4 || die
+ dobin \
+ "${WORKDIR}"/bin/* \
+ "${WORKDIR}"/ccp4-${CCP4VER}/share/balbes/BALBES_0.0.1/bin_py/balbes \
+ || die
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/balbes/BALBES_0.0.1/{bin_py,PyXML-0.8.4}
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/balbes/BALBES_0.0.1/{bin_py,PyXML-0.8.4}
+}
diff --git a/sci-chemistry/balbes/files/1.0.0_p100317-makefile.patch b/sci-chemistry/balbes/files/1.0.0_p100317-makefile.patch
new file mode 100644
index 000000000000..da17240642d7
--- /dev/null
+++ b/sci-chemistry/balbes/files/1.0.0_p100317-makefile.patch
@@ -0,0 +1,107 @@
+diff --git a/makefile b/makefile
+index baaceb5..85a7baf 100755
+--- a/makefile
++++ b/makefile
+@@ -70,6 +70,15 @@ OBJDB_G = get_pdb_list.o
+
+ #OBJDB_Z = blanc2mtz.o libutils.o
+
++# incomplete targets:
++# dimer_search_db domain_search_db domain align3
++all: search_db get_structure_db manage_db search_dm dom2ch \
++ save_si get_pdb_list_db update_db \
++ update_dom_db bl2mtz check_file_db fobs2cif sol_check \
++ get_trns p2s check_cell alt_sg \
++ align cell_list create_bins \
++ get_pdb_list_db get_ch get_nm get_mod
++
+ search_db: sdb_l
+
+ get_structure_db: tdb_l
+@@ -201,58 +210,58 @@ save_seg_id.o: save_seg_id.f
+ $(BLANC_FORT) -c save_seg_id.f
+
+ sdb_l: $(OBJDB_S)
+- $(BLANC_FORT) -o ../bin/search_DB $(OBJDB_S)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/search_DB $(OBJDB_S)
+ tdb_l: $(OBJDB_T)
+- $(BLANC_FORT) -o ../bin/get_structure_DB $(OBJDB_T)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_structure_DB $(OBJDB_T)
+ mdb_l: $(OBJDB_M)
+- $(BLANC_FORT) -o ../bin/manage_DB $(OBJDB_M)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/manage_DB $(OBJDB_M)
+ mdm_l: $(OBJDB_MD)
+- $(BLANC_FORT) -o ../bin/search_DOM $(OBJDB_MD)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/search_DOM $(OBJDB_MD)
+ d2c_l: $(OBJDB_A)
+- $(BLANC_FORT) -o ../bin/domain2chain $(OBJDB_A)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/domain2chain $(OBJDB_A)
+ upd_l: $(OBJDB_U)
+- $(BLANC_FORT) -o ../bin/update_DB $(OBJDB_U)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/update_DB $(OBJDB_U)
+ dom_l: $(OBJDB_V)
+- $(BLANC_FORT) -o ../bin/update_domain_DB $(OBJDB_V)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/update_domain_DB $(OBJDB_V)
+ ddb_l: $(OBJDB_D)
+- $(BLANC_FORT) -o ../bin/dimer_search $(OBJDB_D)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/dimer_search $(OBJDB_D)
+ dmdb_l: $(OBJDB_N)
+- $(BLANC_FORT) -o ../bin/domain_search $(OBJDB_N)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/domain_search $(OBJDB_N)
+ gdb_l: $(OBJDB_G)
+- $(BLANC_FORT) -o ../bin/get_pdb_list $(OBJDB_G)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_pdb_list $(OBJDB_G)
+ b2m_l: blanc2mtz.o libutils.o
+- $(BLANC_FORT) -o ../bin/blanc2mtz blanc2mtz.o libutils.o $(CLIB)/libccp4f.a $(CLIB)/libccp4c.a
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/blanc2mtz blanc2mtz.o libutils.o -lccp4f -lccp4c
+ f2c_l: f2cif.o libutils.o
+- $(BLANC_FORT) -o ../bin/f2cif f2cif.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/f2cif f2cif.o libutils.o
+ chf_l: check_file_DB.o libutils.o
+- $(BLANC_FORT) -o ../bin/check_file_DB check_file_DB.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/check_file_DB check_file_DB.o libutils.o
+ chc_l: check_cell_sg.o libutils.o
+- $(BLANC_FORT) -o ../bin/check_cell_sg check_cell_sg.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/check_cell_sg check_cell_sg.o libutils.o
+ asl_l: alt_sg_list.o libutils.o
+- $(BLANC_FORT) -o ../bin/alt_sg_list alt_sg_list.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/alt_sg_list alt_sg_list.o libutils.o
+ sc_l: $(OBJDB_C)
+- $(BLANC_FORT) -o ../bin/solution_check $(OBJDB_C)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/solution_check $(OBJDB_C)
+ gt_l: $(OBJDB_R)
+- $(BLANC_FORT) -o ../bin/get_trans $(OBJDB_R)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_trans $(OBJDB_R)
+ dmn_l: domain.o libutils.o
+- $(BLANC_FORT) -o ../bin/domain domain.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/domain domain.o libutils.o
+ pack: pdb_pack.o libutils.o
+- $(BLANC_FORT) -o ../bin/pdb_pack pdb_pack.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/pdb_pack pdb_pack.o libutils.o
+ p2s_l: $(OBJDB_P)
+- $(BLANC_FORT) -o ../bin/pdb2s $(OBJDB_P)
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/pdb2s $(OBJDB_P)
+ aln_l: align_DB.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/align_DB align_DB.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/align_DB align_DB.o DB_subr.o libutils.o
+ aln3_l: align_DB_new.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/align_DB_new align_DB_new.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/align_DB_new align_DB_new.o DB_subr.o libutils.o
+ cell_l: create_cell_list.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/create_cell_list create_cell_list.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/create_cell_list create_cell_list.o DB_subr.o libutils.o
+ getch_l: get_chain.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/get_chain get_chain.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_chain get_chain.o DB_subr.o libutils.o
+ getnmr_l: get_nmr.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/get_nmr get_nmr.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_nmr get_nmr.o DB_subr.o libutils.o
+ getmod_l: get_model.o libutils.o
+- $(BLANC_FORT) -o ../bin/get_model get_model.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/get_model get_model.o libutils.o
+ crb_l: create_binaries.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/create_binaries create_binaries.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/create_binaries create_binaries.o DB_subr.o libutils.o
+ save_si_l: save_seg_id.o DB_subr.o libutils.o
+- $(BLANC_FORT) -o ../bin/save_seg_id save_seg_id.o DB_subr.o libutils.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/save_seg_id save_seg_id.o DB_subr.o libutils.o
diff --git a/sci-chemistry/balbes/files/pyxml-0.8.4-python-2.6.patch b/sci-chemistry/balbes/files/pyxml-0.8.4-python-2.6.patch
new file mode 100644
index 000000000000..d29b0b6a9eb2
--- /dev/null
+++ b/sci-chemistry/balbes/files/pyxml-0.8.4-python-2.6.patch
@@ -0,0 +1,28 @@
+diff -rupN PyXML-0.8.4-old/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py PyXML-0.8.4/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py
+--- PyXML-0.8.4-old/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2008-12-15 16:54:36.000000000 +0900
++++ PyXML-0.8.4/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2008-12-15 16:57:02.000000000 +0900
+@@ -24,8 +24,8 @@ class ParsedAbbreviatedAbsoluteLocationP
+ self._rel = rel
+ nt = ParsedNodeTest.ParsedNodeTest('node', '')
+ ppl = ParsedPredicateList.ParsedPredicateList([])
+- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
+- self._step = ParsedStep.ParsedStep(as, nt, ppl)
++ as_ = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
++ self._step = ParsedStep.ParsedStep(as_, nt, ppl)
+ return
+
+ def evaluate(self, context):
+diff -rupN PyXML-0.8.4-old/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py PyXML-0.8.4/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py
+--- PyXML-0.8.4-old/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2008-12-15 16:54:36.000000000 +0900
++++ PyXML-0.8.4/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2008-12-15 16:58:58.000000000 +0900
+@@ -28,8 +28,8 @@ class ParsedAbbreviatedRelativeLocationP
+ self._right = right
+ nt = ParsedNodeTest.ParsedNodeTest('node','')
+ ppl = ParsedPredicateList.ParsedPredicateList([])
+- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
+- self._middle = ParsedStep.ParsedStep(as, nt, ppl)
++ as_ = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
++ self._middle = ParsedStep.ParsedStep(as_, nt, ppl)
+
+ def evaluate(self, context):
+ res = []
diff --git a/sci-chemistry/balbes/metadata.xml b/sci-chemistry/balbes/metadata.xml
new file mode 100644
index 000000000000..4bb6be5e5d0c
--- /dev/null
+++ b/sci-chemistry/balbes/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ BALBES is a system for solving protein structures using x-ray
+ crystalographic data. Molecular Replacement(MR) is its core
+ scientific method. BALBES aims to integrate all components,
+ necessary for finding a solution structure by MR, into one system.
+ It consists of a database, scientific programs and a python
+ pipeline. The system is automated so that it needs no user's
+ intervention when running complicated combination of jobs such
+ as model searching, molecular replacement and refinement.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/ball/Manifest b/sci-chemistry/ball/Manifest
new file mode 100644
index 000000000000..f7919da9098f
--- /dev/null
+++ b/sci-chemistry/ball/Manifest
@@ -0,0 +1 @@
+DIST BALL-1.4.2.tar.xz 16080664 SHA256 053931b2e050d7d5bceaa21ad3617a1ad0af00f94de56076ce02d544383cbf91 SHA512 c719af4ef2dc1076818d59b72350b704fbffea06bd44737519fb50d88da113ea509333d407f2330aa59bf1c4e6b81adfd3d28e05459f66d7c9707f8d85db7a87 WHIRLPOOL ba7ae340833ea5703d047a9dbc0ce50d9b9dc2b0047a0c6d9f9a17946956c684a09e0860f25c7214a2aa0adee9beb1d01eac38b0ab08259a2934f97cbef91379
diff --git a/sci-chemistry/ball/ball-1.4.2.ebuild b/sci-chemistry/ball/ball-1.4.2.ebuild
new file mode 100644
index 000000000000..bc1005204c0b
--- /dev/null
+++ b/sci-chemistry/ball/ball-1.4.2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils python-single-r1
+
+DESCRIPTION="Biochemical Algorithms Library"
+HOMEPAGE="http://www.ball-project.org/"
+SRC_URI="http://www.ball-project.org/Downloads/v${PV}/BALL-${PV}.tar.xz"
+
+SLOT="0"
+LICENSE="LGPL-2 GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cuda mpi +python sql test +threads +webkit"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ dev-cpp/eigen:3
+ dev-libs/boost
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ dev-qt/qttest:4
+ dev-qt/qtwebkit:4
+ media-libs/glew
+ sci-libs/fftw:3.0[threads?]
+ sci-libs/gsl
+ sci-libs/libsvm
+ sci-mathematics/lpsolve
+ virtual/opengl
+ x11-libs/libX11
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ mpi? ( virtual/mpi )
+ python? ( ${PYTHON_DEPS} )
+ sql? ( dev-qt/qtsql:4 )
+ webkit? ( dev-qt/qtwebkit:4 )"
+DEPEND="${RDEPEND}
+ dev-python/sip
+ sys-devel/bison
+ virtual/yacc"
+
+S="${WORKDIR}"/BALL-${PV}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.1-multilib.patch
+ "${FILESDIR}"/${PN}-1.4.1-missing-signed.patch
+ "${FILESDIR}"/${P}-PDBFile-Fix-compilation-with-gcc-4.8.patch
+ "${FILESDIR}"/${P}-QT4_EXTRACT_OPTIONS-CMake-macro-changed-in-CMake-2.8.patch
+ "${FILESDIR}"/${PN}-1.4.1-BondOrder.xml.patch
+ "${FILESDIR}"/${P}-Fix-compilation-of-sipModularWidget.patch
+ "${FILESDIR}"/${P}-underlinking.patch
+ )
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_use threads FFTW_THREADS)
+ $(cmake-utils_use cuda MT_ENABLE_CUDA)
+ $(cmake-utils_use mpi MT_ENABLE_MPI)
+ $(cmake-utils_use sql BALL_HAS_QTSQL)
+ $(cmake-utils_use_use webkit USE_QTWEBKIT)
+ $(cmake-utils_use python BALL_PYTHON_SUPPORT)
+ )
+ cmake-utils_src_configure
+ local i
+ for i in "${S}"/data/*; do
+ ln -sf "${i}" "${BUILD_DIR}"/source/TEST/ || die
+ ln -sf "${i}" "${S}"/source/TEST/ || die
+ done
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ use test && cmake-utils_src_make build_tests
+}
diff --git a/sci-chemistry/ball/files/ball-1.4.1-BondOrder.xml.patch b/sci-chemistry/ball/files/ball-1.4.1-BondOrder.xml.patch
new file mode 100644
index 000000000000..51e592806999
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.1-BondOrder.xml.patch
@@ -0,0 +1,30 @@
+ source/STRUCTURE/assignBondOrderProcessor.C | 2 +-
+ source/TEST/AssignBondOrderProcessor_test.C | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C
+index f8acc4f..035fffc 100644
+--- a/source/STRUCTURE/assignBondOrderProcessor.C
++++ b/source/STRUCTURE/assignBondOrderProcessor.C
+@@ -100,7 +100,7 @@ namespace BALL
+ const bool AssignBondOrderProcessor::Default::KEKULIZE_RINGS = true;
+
+ const char* AssignBondOrderProcessor::Option::INIFile = "iniFile";
+- const String AssignBondOrderProcessor::Default::INIFile = "/bond_lengths/BondOrder.xml";
++ const String AssignBondOrderProcessor::Default::INIFile = "bond_lengths/BondOrder.xml";
+
+ const char* AssignBondOrderProcessor::Option::MAX_BOND_ORDER = "max_bond_order";
+ const int AssignBondOrderProcessor::Default::MAX_BOND_ORDER = 3;
+diff --git a/source/TEST/AssignBondOrderProcessor_test.C b/source/TEST/AssignBondOrderProcessor_test.C
+index 6dfafcc..3405ef5 100644
+--- a/source/TEST/AssignBondOrderProcessor_test.C
++++ b/source/TEST/AssignBondOrderProcessor_test.C
+@@ -1834,7 +1834,7 @@ CHECK(Option::INIFile)
+ // There is really not much we can test here, so we just execute the processor
+ // to have a chance of catching bugs with valgrind if they sneak in
+ AssignBondOrderProcessor abop;
+- abop.options.set(AssignBondOrderProcessor::Option::INIFile, "/bond_lengths/BondOrderGAFF.xml");
++ abop.options.set(AssignBondOrderProcessor::Option::INIFile, "bond_lengths/BondOrderGAFF.xml");
+
+ System sys40;
+ MOL2File mol40(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_C4_input.mol2), std::ios::in);
diff --git a/sci-chemistry/ball/files/ball-1.4.1-missing-signed.patch b/sci-chemistry/ball/files/ball-1.4.1-missing-signed.patch
new file mode 100644
index 000000000000..6868871b3dc4
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.1-missing-signed.patch
@@ -0,0 +1,26 @@
+Index: ball/include/BALL/DATATYPE/hashGrid.h
+===================================================================
+--- ball.orig/include/BALL/DATATYPE/hashGrid.h 2011-12-09 13:49:26.000000000 +0100
++++ ball/include/BALL/DATATYPE/hashGrid.h 2011-12-09 13:51:09.000000000 +0100
+@@ -37,7 +37,7 @@
+ {
+ namespace __private
+ {
+- extern const char BALL_EXPORT neighbour_table_[27][3];
++ extern const signed char BALL_EXPORT neighbour_table_[27][3];
+ }
+
+ template <typename Item> class HashGrid3;
+Index: ball/source/DATATYPE/hashGrid.C
+===================================================================
+--- ball.orig/source/DATATYPE/hashGrid.C 2011-12-09 13:49:26.000000000 +0100
++++ ball/source/DATATYPE/hashGrid.C 2011-12-09 13:50:49.000000000 +0100
+@@ -9,7 +9,7 @@
+ {
+ namespace __private
+ {
+- const char neighbour_table_[27][3] =
++ const signed char neighbour_table_[27][3] =
+ {
+ { 0, 0, 0 }, { 0, 0, -1 }, { 0, 0, 1 },
+ { 0, -1, -1 }, { 0, -1, 0 }, { 0, -1, 1 },
diff --git a/sci-chemistry/ball/files/ball-1.4.1-multilib.patch b/sci-chemistry/ball/files/ball-1.4.1-multilib.patch
new file mode 100644
index 000000000000..317c4029c678
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.1-multilib.patch
@@ -0,0 +1,39 @@
+From 5b8f4e58b4e54bcdfa6f287e01f91d9dfd4e5a14 Mon Sep 17 00:00:00 2001
+From: Justin Lecher <jlec@gentoo.org>
+Date: Sun, 25 Mar 2012 14:12:21 +0200
+Subject: [PATCH] Correct path for multilib installation.
+
+Libraries should go into lib64 not lib on native 64bit. Therefore we can use the LIBDIR detected by cmake.
+---
+ CMakeLists.txt | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 940ebf4..7eb3db4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -426,8 +426,8 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
+ ## These variables are used in all install-targets
+ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ SET(BALL_RUNTIME_INSTALL_DIRECTORY "bin")
+- SET(BALL_LIBRARY_INSTALL_DIRECTORY "lib")
+- SET(BALL_ARCHIVE_INSTALL_DIRECTORY "lib")
++ SET(BALL_LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
++ SET(BALL_ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
+ SET(BALL_HEADER_INSTALL_DIRECTORY ".")
+ SET(BALL_DATA_INSTALL_DIRECTORY "share/BALL")
+ SET(BALL_DOCUMENTATION_INSTALL_DIRECTORY "share/BALL/doc")
+@@ -435,8 +435,8 @@ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ SET(BALL_PYTHON_INSTALL_DIRECTORY "bin")
+ SET(BALL_PLUGIN_INSTALL_DIRECTORY "bin")
+ ELSE()
+- SET(BALL_PYTHON_INSTALL_DIRECTORY "lib")
+- SET(BALL_PLUGIN_INSTALL_DIRECTORY "lib")
++ SET(BALL_PYTHON_INSTALL_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
++ SET(BALL_PLUGIN_INSTALL_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
+ ENDIF()
+ ELSE()
+ SET(BALL_BUNDLE_INSTALL_DIRECTORY "Applications")
+--
+1.7.8.5
+
diff --git a/sci-chemistry/ball/files/ball-1.4.2-Fix-compilation-of-sipModularWidget.patch b/sci-chemistry/ball/files/ball-1.4.2-Fix-compilation-of-sipModularWidget.patch
new file mode 100644
index 000000000000..3ec2f6e983a8
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.2-Fix-compilation-of-sipModularWidget.patch
@@ -0,0 +1,40 @@
+From da49802f8620562f91ac2c947520dccd223ee26b Mon Sep 17 00:00:00 2001
+From: Andreas Hildebrandt <andreas.hildebrandt@uni-mainz.de>
+Date: Wed, 15 Jan 2014 17:42:01 +0100
+Subject: [PATCH] Fix compilation of sipModularWidget
+
+---
+ source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip b/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
+index 522b0ed..7b8ba3e 100644
+--- a/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
++++ b/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
+@@ -22,18 +22,18 @@ class ModularWidget
+ static Size countInstances();
+ static ModularWidget* getInstance(Position);
+
+- ModularWidget(const char* = "<ModularWidget>") throw();
+- ModularWidget(const ModularWidget&) throw();
++ ModularWidget(const char* = "<ModularWidget>");
++ ModularWidget(const ModularWidget&);
+ ~ModularWidget() throw();
+
+- virtual void destroy() throw();
+- virtual void clear() throw();
++// virtual void destroy();
++ virtual void clear();
+
+ static void registerWidget(ModularWidget*) throw(NullPointer);
+ // virtual void initializeWidget(MainControl&);
+ // virtual void finalizeWidget(MainControl&);
+ virtual void checkMenu(MainControl&) throw();
+-// virtual void initializePreferencesTab(Preferences&) throw();
++// virtual void initializePreferencesTab(Preferences&);
+ // virtual void finalizePreferencesTab(Preferences&) throw();
+ virtual void applyPreferences() throw();
+ virtual void fetchPreferences(INIFile&) throw();
+--
+1.9.1
+
diff --git a/sci-chemistry/ball/files/ball-1.4.2-PDBFile-Fix-compilation-with-gcc-4.8.patch b/sci-chemistry/ball/files/ball-1.4.2-PDBFile-Fix-compilation-with-gcc-4.8.patch
new file mode 100644
index 000000000000..f6b8ff45fa7f
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.2-PDBFile-Fix-compilation-with-gcc-4.8.patch
@@ -0,0 +1,28 @@
+From e7cc50705bed20e160bd4b637b23f57270f580a8 Mon Sep 17 00:00:00 2001
+From: Daniel Stoeckel <dstoeckel@bioinf.uni-sb.de>
+Date: Sat, 6 Apr 2013 01:06:55 +0200
+Subject: [PATCH] PDBFile:Fix compilation with gcc 4.8
+
+Apparently the automatic conversion from boost::shared_ptr<CrystalInfo>
+to boost::shared_ptr<PersistentObject> is no longer supported.
+Just change the type of the pointer and work around this issue.
+---
+ source/FORMAT/PDBFileDetails.C | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/FORMAT/PDBFileDetails.C b/source/FORMAT/PDBFileDetails.C
+index 97c2572..aedc5db 100644
+--- a/source/FORMAT/PDBFileDetails.C
++++ b/source/FORMAT/PDBFileDetails.C
+@@ -901,7 +901,7 @@ namespace BALL
+ {
+ if (!(current_protein_->hasProperty("CRYSTALINFO")))
+ {
+- boost::shared_ptr<CrystalInfo> temp_ptr(new CrystalInfo());
++ boost::shared_ptr<PersistentObject> temp_ptr(new CrystalInfo());
+ current_protein_->setProperty(NamedProperty("CRYSTALINFO", temp_ptr));
+ }
+
+--
+1.9.1
+
diff --git a/sci-chemistry/ball/files/ball-1.4.2-QT4_EXTRACT_OPTIONS-CMake-macro-changed-in-CMake-2.8.patch b/sci-chemistry/ball/files/ball-1.4.2-QT4_EXTRACT_OPTIONS-CMake-macro-changed-in-CMake-2.8.patch
new file mode 100644
index 000000000000..615a92290805
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.2-QT4_EXTRACT_OPTIONS-CMake-macro-changed-in-CMake-2.8.patch
@@ -0,0 +1,44 @@
+From 1e76c9cb1920e9176b725269985c7eb43126d188 Mon Sep 17 00:00:00 2001
+From: Luis de la Garza <delagarza@informatik.uni-tuebingen.de>
+Date: Fri, 22 Nov 2013 15:18:55 +0100
+Subject: [PATCH] QT4_EXTRACT_OPTIONS CMake macro changed in CMake 2.8.12;
+ fixed BALLMacros.cmake
+
+---
+ cmake/BALLMacros.cmake | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/BALLMacros.cmake b/cmake/BALLMacros.cmake
+index f81ab89..0ac1b87 100644
+--- a/cmake/BALLMacros.cmake
++++ b/cmake/BALLMacros.cmake
+@@ -6,16 +6,22 @@
+ ### minor modifications (marked with ## BALL ###)
+ ###
+ MACRO(QT4_WRAP_UI_BALL outfiles )
+- QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+-
+- ### BALL ###
++ # since 2.8.12 qt4_extract_options has an additional argument
++ # copied fix from OpenMS
++ IF(${CMAKE_VERSION} VERSION_LESS "2.8.12")
++ QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
++ ELSE()
++ QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
++ ENDIF()
++
++ ### BALL ###
+ # create output directory (will not exist for out-of-source builds)
+ FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/)
+
+ FOREACH (it ${ui_files})
+ GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+ GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+- ### BALL ###
++ ### BALL ###
+ SET(outfile ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/ui_${outfile}.h)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_UIC_EXECUTABLE}
+--
+1.9.1
+
diff --git a/sci-chemistry/ball/files/ball-1.4.2-underlinking.patch b/sci-chemistry/ball/files/ball-1.4.2-underlinking.patch
new file mode 100644
index 000000000000..825f41978c13
--- /dev/null
+++ b/sci-chemistry/ball/files/ball-1.4.2-underlinking.patch
@@ -0,0 +1,16 @@
+ source/APPLICATIONS/BALLVIEW/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/APPLICATIONS/BALLVIEW/CMakeLists.txt b/source/APPLICATIONS/BALLVIEW/CMakeLists.txt
+index 6d16212..f94ce76 100644
+--- a/source/APPLICATIONS/BALLVIEW/CMakeLists.txt
++++ b/source/APPLICATIONS/BALLVIEW/CMakeLists.txt
+@@ -85,7 +85,7 @@ IF (UNIX)
+ LIST(APPEND BALLVIEW_SUPPORT_LIBRARIES "pthread")
+ ENDIF ()
+
+-TARGET_LINK_LIBRARIES(BALLView BALL VIEW ${BALLVIEW_SUPPORT_LIBRARIES})
++TARGET_LINK_LIBRARIES(BALLView BALL VIEW ${BALLVIEW_SUPPORT_LIBRARIES} X11)
+
+ #Setup the translations
+ INCLUDE(${CMAKE_SOURCE_DIR}/cmake/BALLViewTranslations.cmake)
diff --git a/sci-chemistry/ball/metadata.xml b/sci-chemistry/ball/metadata.xml
new file mode 100644
index 000000000000..066e13dd4a53
--- /dev/null
+++ b/sci-chemistry/ball/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Rapid Software Prototyping can significantly reduce development times in the
+field of Computational Molecular Biology and Molecular Modeling.
+BALL (Biochemical Algorithms Library) is an application framework in C++ that
+has been specifically designed for this purpose. It provides an extensive set
+of data structures as well as classes for Molecular Mechanics, advanced
+solvation methods, comparison and analysis of protein structures, file
+import/export, and visualization .
+
+BALL has been carefully designed to be robust, easy to use, and open to
+extensions. Especially its extensibility which results from an object-oriented
+and generic programming approach distinguishes it from other software packages.
+BALL is well suited to serve as a public repository for reliable data
+structures and algorithms.
+
+Based on BALL we have developed a stand-alone tool for molecular visualization,
+BALLView . BALLView makes the broad functionality available through an
+integrated user-friendly GUI.
+</longdescription>
+ <use>
+ <flag name="sql">Include SQL database support</flag>
+ <flag name="cuda">Include cuda support</flag>
+ <flag name="webkit">Uses <pkg>dev-qt/qtwebkit</pkg> for drawing</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/bkchem/Manifest b/sci-chemistry/bkchem/Manifest
new file mode 100644
index 000000000000..8073e9e6a720
--- /dev/null
+++ b/sci-chemistry/bkchem/Manifest
@@ -0,0 +1 @@
+DIST bkchem-0.14.0-pre2.tar.gz 998916 SHA256 65b93128932959b394eff8e5a8018a19b30d26ee1ae44345e8bb87167303ed26 SHA512 7fc3bbd7bfe27bc91cf69a98c347a3fb92f4ea25b45a13debd0646a6b02d7a40c5729ae1b2a9ac33c1049d6b90e38355c3cd80e06660a0a2fcc5dafb3514ef20 WHIRLPOOL 732bc45913248aa3df5929933f2072d09d90a46cdc3b3e22f1849adf391d7fd62704e71a98e24649bd74e1ebe96b30d7d398dadabffc0fcd114d8c13922241c6
diff --git a/sci-chemistry/bkchem/bkchem-0.14.0_pre2-r1.ebuild b/sci-chemistry/bkchem/bkchem-0.14.0_pre2-r1.ebuild
new file mode 100644
index 000000000000..c5aa86e917a0
--- /dev/null
+++ b/sci-chemistry/bkchem/bkchem-0.14.0_pre2-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+PYTHON_REQ_USE="tk"
+
+inherit distutils-r1 eutils versionator
+
+MY_P="${PN}-$(replace_version_separator 3 -)"
+
+DESCRIPTION="Chemical drawing program"
+HOMEPAGE="http://bkchem.zirael.org/"
+SRC_URI="http://bkchem.zirael.org/download/${MY_P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-2"
+IUSE="cairo"
+
+DEPEND="cairo? ( dev-python/pycairo[svg,${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-nolauncher.patch
+)
+
+python_install() {
+ distutils-r1_python_install "--strip=${ED}/_${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ python_foreach_impl python_newscript ${PN}/${PN}.py ${PN}
+ make_desktop_entry bkchem BKChem "${EPREFIX}"/usr/share/${PN}/images/${PN}.png Science
+}
diff --git a/sci-chemistry/bkchem/files/0.14.0_pre1-piddle-Fix-assertions.patch b/sci-chemistry/bkchem/files/0.14.0_pre1-piddle-Fix-assertions.patch
new file mode 100644
index 000000000000..6270e59d5320
--- /dev/null
+++ b/sci-chemistry/bkchem/files/0.14.0_pre1-piddle-Fix-assertions.patch
@@ -0,0 +1,48 @@
+diff --git a/bkchem/plugins/piddle/pdfgen.py b/bkchem/plugins/piddle/pdfgen.py
+index 5213672..4c056c7 100644
+--- a/bkchem/plugins/piddle/pdfgen.py
++++ b/bkchem/plugins/piddle/pdfgen.py
+@@ -639,7 +639,7 @@ class Canvas:
+
+ #use a flate filter and Ascii Base 85 to compress
+ raw = myimage.tostring()
+- assert(len(raw) == imgwidth * imgheight, "Wrong amount of data for image")
++ assert len(raw) == imgwidth * imgheight, "Wrong amount of data for image"
+ compressed = zlib.compress(raw) #this bit is very fast...
+ encoded = pdfutils._AsciiBase85Encode(compressed) #...sadly this isn't
+
+diff --git a/bkchem/plugins/piddle/pdfutils.py b/bkchem/plugins/piddle/pdfutils.py
+index ebde677..4a7675d 100644
+--- a/bkchem/plugins/piddle/pdfutils.py
++++ b/bkchem/plugins/piddle/pdfutils.py
+@@ -27,7 +27,7 @@ def cacheImageFile(filename):
+ code.append('ID')
+ #use a flate filter and Ascii Base 85
+ raw = img.tostring()
+- assert(len(raw) == imgwidth * imgheight, "Wrong amount of data for image")
++ assert len(raw) == imgwidth * imgheight, "Wrong amount of data for image"
+ compressed = zlib.compress(raw) #this bit is very fast...
+ encoded = _AsciiBase85Encode(compressed) #...sadly this isn't
+
+diff --git a/bkchem/plugins/piddle/piddlePS.py b/bkchem/plugins/piddle/piddlePS.py
+index 4d3c327..3afa361 100644
+--- a/bkchem/plugins/piddle/piddlePS.py
++++ b/bkchem/plugins/piddle/piddlePS.py
+@@ -866,7 +866,7 @@ translate
+ # piddlePDF again
+
+ rawimage = myimage.tostring()
+- assert(len(rawimage) == imgwidth*imgheight, 'Wrong amount of data for image')
++ assert len(rawimage) == imgwidth*imgheight, 'Wrong amount of data for image'
+ #compressed = zlib.compress(rawimage) # no zlib at moment
+ hex_encoded = self._AsciiHexEncode(rawimage)
+
+@@ -957,7 +957,7 @@ translate
+ 'image'])
+ # after image operator just need to dump image dat to file as hexstring
+ rawimage = myimage.tostring()
+- assert(len(rawimage) == imwidth*imheight, 'Wrong amount of data for image')
++ assert len(rawimage) == imwidth*imheight, 'Wrong amount of data for image'
+ #compressed = zlib.compress(rawimage) # no zlib at moment
+ hex_encoded = self._AsciiHexEncode(rawimage)
+
diff --git a/sci-chemistry/bkchem/files/bkchem-0.14.0_pre2-nolauncher.patch b/sci-chemistry/bkchem/files/bkchem-0.14.0_pre2-nolauncher.patch
new file mode 100644
index 000000000000..202c47a9c74f
--- /dev/null
+++ b/sci-chemistry/bkchem/files/bkchem-0.14.0_pre2-nolauncher.patch
@@ -0,0 +1,106 @@
+ bkchem/bkchem.py | 24 +++++++++++++-----------
+ setup.py | 23 -----------------------
+ 2 files changed, 13 insertions(+), 34 deletions(-)
+
+diff --git a/bkchem/bkchem.py b/bkchem/bkchem.py
+index b336b9c..bcb68b0 100644
+--- a/bkchem/bkchem.py
++++ b/bkchem/bkchem.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/env python2
+ #--------------------------------------------------------------------------
+ # This file is part of BKChem - a chemical drawing program
+ # Copyright (C) 2002-2009 Beda Kosata <beda@zirael.org>
+@@ -18,18 +19,19 @@
+ #--------------------------------------------------------------------------
+
+
+-"""this is just a starter of the application"""
++#"""this is just a starter of the application"""
+
+ ## support for loading from outside of bkchem dir
+
+-import os_support, sys
++from bkchem import os_support
++import sys
+ sys.path.insert( 1, os_support.get_module_path())
+
+
+ ### now starting for real
+
+-from singleton_store import Store
+-import pref_manager
++from bkchem.singleton_store import Store
++from bkchem import pref_manager
+
+ # at first preference manager
+ Store.pm = pref_manager.pref_manager(
+@@ -78,13 +80,13 @@ else:
+
+
+
+-import config
++from bkchem import config
+
+ if not config.debug:
+ # checking of important modules availability
+ # import modules
+- import import_checker
+- import messages
++ from bkchem import import_checker
++ from bkchem import messages
+
+ # we need sets from the 2.3 version
+ if not import_checker.python_version_ok:
+@@ -103,16 +105,16 @@ if not config.debug:
+
+
+ #import Tkinter
+-from main import BKChem
+-from splash import Splash
+-from singleton_store import Store
++from bkchem.main import BKChem
++from bkchem.splash import Splash
++from bkchem.singleton_store import Store
+
+ myapp = BKChem()
+ myapp.withdraw()
+
+ if __name__ == '__main__':
+
+- import messages
++ from bkchem import messages
+ enc = sys.getfilesystemencoding()
+ if not enc:
+ enc = sys.getdefaultencoding()
+diff --git a/setup.py b/setup.py
+index d4b2a21..2319216 100755
+--- a/setup.py
++++ b/setup.py
+@@ -91,26 +91,3 @@ if len( sys.argv) > 1 and sys.argv[1] == 'install' and '--help' not in sys.argv:
+ print "file %s created" % config_name
+
+
+- # the executable
+- if not os.path.isdir( bin_dir):
+- try:
+- os.mkdir( bin_dir)
+- except:
+- print "ERROR: could not create directory %s" % bin_dir
+- sys.exit( 201)
+- exec_name = os.path.join( bin_dir, 'bkchem')
+- try:
+- file = open( exec_name, 'w')
+- except:
+- print "ERROR: couldn't open the file %s for write" % exec_name
+- sys.exit( 201)
+- file.write( "#!/bin/sh\n")
+- file.write( 'python %s "$@"\n' % strip_path( os.path.join( py_dir, "bkchem", "bkchem.py")))
+- file.close()
+- print "file %s created" % exec_name
+- try:
+- os.chmod( os.path.join( bin_dir, 'bkchem'), 5+5*8+7*8*8)
+- except:
+- print "ERROR: failed to make %s executable" % exec_name
+- sys.exit( 201)
+- print "file %s made executable" % exec_name
diff --git a/sci-chemistry/bkchem/metadata.xml b/sci-chemistry/bkchem/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/bkchem/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/bodr/Manifest b/sci-chemistry/bodr/Manifest
new file mode 100644
index 000000000000..53b218466c9e
--- /dev/null
+++ b/sci-chemistry/bodr/Manifest
@@ -0,0 +1,2 @@
+DIST bodr-10.tar.bz2 225671 SHA256 738a0f0e263cdc088581d0a67a0ea16ec586ceb424704d0ff73bdb5da5d4ee81 SHA512 a3e0e7195914938d8824127aa4777c4054c302ef7811d82d1e012d9be5d7a13d7f2225d4216f4a30ae7dbf70eb3b0b38571c3ee0dbe1d97af15f04171dd51bec WHIRLPOOL e61db3427f6f994a1a628eec12c1a41cf8d9cdbd1a16814a267363ffe4fa320f3fb9b03f8188c746899774631dc5d0398830b8d779d225f3317158809c182c3e
+DIST bodr-9.tar.bz2 210548 SHA256 a7ed30ecc385ff9fe9b2af84710574ac12febea081b5123db6d6337a4a7a4b60 SHA512 5bcdd682729e11a0bc48f9306262e03fa2a3ca3a805633c2b40d7f94608ce6e2e778cc89ed0c57ec3bf6105c2f759204e158ac6f29c9e6ee3aa37190f8f0d772 WHIRLPOOL 78061c24718a4ce5c5694e369d3c97eb90826b2c3b3f694ba9a0f405173ef0efdc565583373b26c96582c853e1606314ee2c5ab3e5cc8e889c0625358f87291b
diff --git a/sci-chemistry/bodr/bodr-10.ebuild b/sci-chemistry/bodr/bodr-10.ebuild
new file mode 100644
index 000000000000..7958b8c319da
--- /dev/null
+++ b/sci-chemistry/bodr/bodr-10.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="The Blue Obelisk Data Repository listing element and isotope properties"
+HOMEPAGE="http://sourceforge.net/projects/bodr"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~ppc-macos"
+IUSE=""
+
+DEPEND="dev-libs/libxslt"
+RDEPEND=""
+
+DOCS=( "THANKS" "AUTHORS" "README" "ChangeLog" )
+
+src_prepare(){
+ sed -i -e "s/COPYING//g" Makefile.* || die
+}
+
+src_configure() {
+ econf --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
diff --git a/sci-chemistry/bodr/bodr-9-r1.ebuild b/sci-chemistry/bodr/bodr-9-r1.ebuild
new file mode 100644
index 000000000000..7958b8c319da
--- /dev/null
+++ b/sci-chemistry/bodr/bodr-9-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="The Blue Obelisk Data Repository listing element and isotope properties"
+HOMEPAGE="http://sourceforge.net/projects/bodr"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~ppc-macos"
+IUSE=""
+
+DEPEND="dev-libs/libxslt"
+RDEPEND=""
+
+DOCS=( "THANKS" "AUTHORS" "README" "ChangeLog" )
+
+src_prepare(){
+ sed -i -e "s/COPYING//g" Makefile.* || die
+}
+
+src_configure() {
+ econf --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
diff --git a/sci-chemistry/bodr/metadata.xml b/sci-chemistry/bodr/metadata.xml
new file mode 100644
index 000000000000..a30a888d000f
--- /dev/null
+++ b/sci-chemistry/bodr/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-chemistry</herd>
+ <longdescription>
+ Blue Obelisk Data Repository (BODR) is a shared data repository. It lists
+ many important chemoinformatics data such as elemental properties, atomic
+ radii, etc. including references to original literature. Software developers
+ can use this repository on online webpages or in chemistry software for
+ free.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">bodr</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/burrow-owl/Manifest b/sci-chemistry/burrow-owl/Manifest
new file mode 100644
index 000000000000..8b584ea4ad29
--- /dev/null
+++ b/sci-chemistry/burrow-owl/Manifest
@@ -0,0 +1,2 @@
+DIST burrow-demos.tar 80896000 SHA256 f93e957889adab0521c6e3234f117cf984b7bb18ba6641a3edbdd30202db4b96 SHA512 76948846b4bff2f5c0814e41ee1745122580d6e28f8de217edbf42c4530bc64fb093dc9c96e9c0c083098755c525300b563ee1368caa12be791b2bea7015ee6b WHIRLPOOL 88ca227d8e808814187630c9568e927620a0dc4fb0eba4131ab14cae842aa778fda6294b32e8ec0e23224fca3b5a2a65609ed7f97a34691267439a557bfa0c42
+DIST burrow-owl-1.5.1.tar.gz 1408249 SHA256 76a4ab0746b1b945e0177d441f7ced8042063d4ff2c9171343ea20ddc19a9bbb SHA512 38b428c8b40cdca6caabc7ed9d247118dbf67b537afaec3af14909353d6b138fdf98a33dee6241ce5224631e16c4dbce11b9aadcfe01fecf92f1aae692ce71e1 WHIRLPOOL e165b0508b28e03a47c77ee72ea0d2347ef9088fe33df9788935e3ec0906efd511f77eebe27d74ed79a913f420cde015a39faebdc3195edc1d279ac0d607d39b
diff --git a/sci-chemistry/burrow-owl/burrow-owl-1.5.1.ebuild b/sci-chemistry/burrow-owl/burrow-owl-1.5.1.ebuild
new file mode 100644
index 000000000000..76018815c9cd
--- /dev/null
+++ b/sci-chemistry/burrow-owl/burrow-owl-1.5.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils virtualx
+
+DESCRIPTION="Visualize multidimensional nuclear magnetic resonance (NMR) spectra"
+HOMEPAGE="http://burrow-owl.sourceforge.net/"
+SRC_URI="
+ mirror://sourceforge/${PN}/${P}.tar.gz
+ examples? ( mirror://sourceforge/${PN}/burrow-demos.tar )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples static-libs"
+
+RDEPEND="
+ dev-libs/g-wrap
+ dev-libs/glib:2
+ dev-scheme/guile[networking,regex]
+ dev-scheme/guile-cairo
+ dev-scheme/guile-gnome-platform
+ sci-libs/starparse
+ x11-libs/gtk+:2"
+DEPEND="${RDEPEND}
+ dev-util/indent
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with doc doxygen doxygen)
+ )
+ autotools-utils_src_configure
+}
+
+src_test () {
+ cd "${AUTOTOOLS_BUILD_DIR}" || die
+ virtualmake -C test-suite check
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${AUTOTOOLS_BUILD_DIR}/doc/api/html/." )
+ autotools-utils_src_install
+
+ use examples && \
+ insinto /usr/share/${PN} && \
+ doins -r "${WORKDIR}"/burrow-demos/*
+}
diff --git a/sci-chemistry/burrow-owl/files/1.4-glibc-2.12.patch b/sci-chemistry/burrow-owl/files/1.4-glibc-2.12.patch
new file mode 100644
index 000000000000..cca640a6347d
--- /dev/null
+++ b/sci-chemistry/burrow-owl/files/1.4-glibc-2.12.patch
@@ -0,0 +1,38 @@
+Fix build with GLIBC-2.12
+
+http://bugs.gentoo.org/show_bug.cgi?id=333843
+
+--- src/Makefile.am
++++ src/Makefile.am
+@@ -82,8 +82,8 @@
+ painter.h \
+ ticket.c \
+ ticket.h \
+-endian.c \
+-endian.h \
++bo_endian.c \
++bo_endian.h \
+ version.c \
+ version.h
+
+--- src/hosbackingfile.c
++++ src/hosbackingfile.c
+@@ -18,6 +18,7 @@
+ */
+
+ #include "hosbackingfile.h"
++#include "bo_endian.h"
+
+ #define DEFAULT_BUF_SIZE 512
+
+--- src/nih.c
++++ src/nih.c
+@@ -24,7 +24,7 @@
+ #include "hosdimensionblock.h"
+ #include "hosbackingblock.h"
+ #include "hosbackingfile.h"
+-#include "endian.h"
++#include "bo_endian.h"
+
+ /* --- header contents ----
+ *
diff --git a/sci-chemistry/burrow-owl/files/1.4-include.patch b/sci-chemistry/burrow-owl/files/1.4-include.patch
new file mode 100644
index 000000000000..3dc4cbdf8000
--- /dev/null
+++ b/sci-chemistry/burrow-owl/files/1.4-include.patch
@@ -0,0 +1,12 @@
+diff --git a/src/gw/spectrum-spec.scm b/src/gw/spectrum-spec.scm
+index 253464c..605796c 100644
+--- a/src/gw/spectrum-spec.scm
++++ b/src/gw/spectrum-spec.scm
+@@ -30,6 +30,7 @@
+ "#include <painter_gdk.h>\n"
+ "#include <burrow/nih.h>\n"
+ "#include <hosbackingsim.h>\n"
++ "#include <guile-cairo/guile-cairo-smob-types.h>\n"
+ "\n"))
+
+ ; couple of disabled sources
diff --git a/sci-chemistry/burrow-owl/files/burrow-owl-1.5-prll.patch b/sci-chemistry/burrow-owl/files/burrow-owl-1.5-prll.patch
new file mode 100644
index 000000000000..340ccd2366e5
--- /dev/null
+++ b/sci-chemistry/burrow-owl/files/burrow-owl-1.5-prll.patch
@@ -0,0 +1,20 @@
+ burrow/canvas/gw/Makefile.am | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/burrow/canvas/gw/Makefile.am b/burrow/canvas/gw/Makefile.am
+index da50ee3..2ed89bc 100644
+--- a/burrow/canvas/gw/Makefile.am
++++ b/burrow/canvas/gw/Makefile.am
+@@ -31,9 +31,11 @@ H2DEF=@top_srcdir@/utils/h2def.py
+ canvas.defs: $(HEADERS_1)
+ $(H2DEF) --all $(HEADERS_1) > $@
+
+-canvas-gw.c canvas-gw.h canvas-gw.scm: canvas.defs
++canvas-gw.c canvas-gw.h: canvas.defs
+ GUILE_LOAD_PATH=@srcdir@:@builddir@:@GUILE_GNOME_MODULE_DIR@:@G_WRAP_MODULE_DIR@:$$GUILE_LOAD_PATH $(GUILE) -s @srcdir@/run-g-wrap.scm
+
++BUILT_SOURCES=canvas-gw.c canvas-gw.h canvas.defs
++
+ INCLUDES=@GTK_CFLAGS@ @G_WRAP_CFLAGS@ @GUILE_GNOME_CFLAGS@ @GUILE_CAIRO_CFLAGS@ @GUILE_CFLAGS@ -I$(headers_dir) -I@top_srcdir@
+
+ moduledir=$(datadir)/guile/burrow
diff --git a/sci-chemistry/burrow-owl/metadata.xml b/sci-chemistry/burrow-owl/metadata.xml
new file mode 100644
index 000000000000..9849d77b1370
--- /dev/null
+++ b/sci-chemistry/burrow-owl/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">burrow-owl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/cara-bin/Manifest b/sci-chemistry/cara-bin/Manifest
new file mode 100644
index 000000000000..12c0fa6dee54
--- /dev/null
+++ b/sci-chemistry/cara-bin/Manifest
@@ -0,0 +1,2 @@
+DIST Start1.2.cara.xz 43124 SHA256 c28321b051902bc020ea04a46b33ceb19b1b3d902264956474c90798f2d60d25 SHA512 26874d634491558dc593a0ec32e83d5cfceedc69bbf901f4d25d6b9515b84aebffbf495d1ac34b3664b8b5822954edf62c5b88dcca6bcfcb152715caa88f5f03 WHIRLPOOL 034e8b73354e7244e4fcc21c03da7b99c02019ebef1e0754dd9cb8249fe68b82be1e78db9848912fc48c8625b0f2acf0f41242d83949a117f0b8a648a930445e
+DIST cara_1.8.4_linux.gz 6677463 SHA256 5ba34cc8b0782e1791186cde5a02ec036665769df7f5c559db27377b6f3cc6d6 SHA512 e264cfbef640f267132dfd48b940203a319c8f34de71c5b786c6bfc2ab561bdf3fbd79516d619ca52b2aca64a2887f770fabfabedb76433c5f78aa02c65f898f WHIRLPOOL 5619c70bc31dfb328a72233c8fc3e3d8dcfdccc3db4e5a67430f0ebe8a0a474f998abb2a0ec56f4a3c2e6e4b95e324ec3c667864c81cb3531a1e162439c780da
diff --git a/sci-chemistry/cara-bin/cara-bin-1.8.4-r1.ebuild b/sci-chemistry/cara-bin/cara-bin-1.8.4-r1.ebuild
new file mode 100644
index 000000000000..d17c035cd3bc
--- /dev/null
+++ b/sci-chemistry/cara-bin/cara-bin-1.8.4-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_PN="${PN%%-bin}"
+MY_P="${MY_PN}_${PV}"
+
+DESCRIPTION="Analysis of NMR spectra and Computer Aided Resonance Assignment"
+SRC_URI="
+ http://www.cara.nmr-software.org/downloads/${MY_P}_linux.gz
+ http://dev.gentoo.org/~jlec/distfiles//Start1.2.cara.xz"
+HOMEPAGE="http://www.nmr.ch"
+
+LICENSE="CARA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="lua"
+
+RDEPEND="
+ !prefix? (
+ >=media-libs/fontconfig-2.10.92[abi_x86_32(-)]
+ >=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
+ >=x11-libs/libICE-1.0.8-r1[abi_x86_32(-)]
+ >=x11-libs/libSM-1.2.1-r1[abi_x86_32(-)]
+ >=x11-libs/libX11-1.6.2[abi_x86_32(-)]
+ >=x11-libs/libXcursor-1.1.14[abi_x86_32(-)]
+ >=x11-libs/libXext-1.3.2[abi_x86_32(-)]
+ >=x11-libs/libXi-1.7.2[abi_x86_32(-)]
+ >=x11-libs/libXrandr-1.4.2[abi_x86_32(-)]
+ >=x11-libs/libXrender-0.9.8[abi_x86_32(-)]
+ )
+ virtual/libstdc++
+ lua? ( dev-lang/lua )"
+DEPEND=""
+
+RESTRICT="mirror"
+
+QA_PREBUILT="opt/cara/*"
+
+S="${WORKDIR}"
+
+src_install() {
+ exeinto /opt/cara
+ doexe ${MY_P}_linux
+ dosym ../cara/${MY_P}_linux /opt/bin/cara
+ dodoc Start1.2.cara
+}
diff --git a/sci-chemistry/cara-bin/metadata.xml b/sci-chemistry/cara-bin/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sci-chemistry/cara-bin/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/ccp4-apps/Manifest b/sci-chemistry/ccp4-apps/Manifest
new file mode 100644
index 000000000000..e56aec5512a2
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/Manifest
@@ -0,0 +1,2 @@
+DIST 6.1.3-oasis4.0.patch.bz2 946 SHA256 12d7c5965e0c46b0f482514d9083d6be94d65eeb14ba29c17d507d5f9669f84b SHA512 7c7bf4ef90550708bf41b1831dbe71c38418b46455adb3d42ec609d287894ac9260d9671f1759f71c713ced72fa004b9808391ea6874007ac8b7d7637f349d32 WHIRLPOOL a2bc27e1e054e1717c387f3800533fa490c03d1d18d3fe3cff4676f0ec47799a1681a206e01013c1b8f8e41162303446a824b86effeef2ed73f059feb07fb820
+DIST ccp4-6.1.3-core-src.tar.gz 242134076 SHA256 1e529c660e7f390ec0feca9d45caa00a2813d23156c10a2747c427117293c324 SHA512 413eba806107ebcdbd93e9122275463709133d9b2a9ce44ae57a6c2350465a47ba66ad9875237aead74f5d422c0104f58f728ab37a757b10d82cde92af444c20 WHIRLPOOL faebf8ee7920013bc3d0e83565207dca1f31ba0b5c92fe1eae4b740f70ff2031d95787fa0d545b09c853d25657c08973527e43de02fddc086988123ca2a6339c
diff --git a/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r13.ebuild b/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r13.ebuild
new file mode 100644
index 000000000000..854cc48db0cf
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r13.ebuild
@@ -0,0 +1,395 @@
+# 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 eutils fortran-2 flag-o-matic gnuconfig python-single-r1 toolchain-funcs
+
+MY_P="${PN/-apps}-${PV}"
+
+#UPDATE="04_03_09"
+#PATCHDATE="090511"
+
+PATCH_TOT="0"
+
+DESCRIPTION="Protein X-ray crystallography toolkit"
+HOMEPAGE="http://www.ccp4.ac.uk/"
+SRC="ftp://ftp.ccp4.ac.uk/ccp4"
+SRC_URI="
+ ${SRC}/${PV}/${MY_P}-core-src.tar.gz
+ http://dev.gentoo.org/~jlec/distfiles/${PV}-oasis4.0.patch.bz2"
+# patch tarball from upstream
+ [[ -n ${UPDATE} ]] && SRC_URI="${SRC_URI} ${SRC}/${PV}/updates/${P}-src-patch-${UPDATE}.tar.gz"
+# patches created by us
+ [[ -n ${PATCHDATE} ]] && SRC_URI="${SRC_URI} http://dev.gentoo.org/~jlec/science-dist/${PV}-${PATCHDATE}-updates.patch.bz2"
+
+for i in $(seq $PATCH_TOT); do
+ NAME="PATCH${i}[1]"
+ SRC_URI="${SRC_URI}
+ ${SRC}/${PV}/patches/${!NAME}"
+done
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="examples X"
+
+X11DEPS="
+ x11-libs/libX11
+ x11-libs/libXaw
+ x11-libs/libXt
+ x11-libs/libxdl_view"
+
+TKDEPS="
+ >=dev-lang/tk-8.3:0=
+ >=dev-tcltk/blt-2.4
+ dev-tcltk/iwidgets
+ dev-tcltk/itcl
+ dev-tcltk/itk
+ >=dev-tcltk/tdom-0.8
+ dev-tcltk/tktreectrl"
+
+SCILIBS="
+ ~sci-libs/ccp4-libs-${PV}
+ >=sci-libs/ccp4-libs-${PV}-r7
+ sci-libs/clipper
+ sci-libs/fftw:2.1
+ sci-libs/mmdb:0
+ sci-libs/ssm
+ virtual/blas
+ virtual/lapack"
+
+SCIAPPS="
+ sci-chemistry/pdb-extract
+ sci-chemistry/pymol
+ sci-chemistry/rasmol
+ >=sci-chemistry/oasis-4.0-r1"
+
+RDEPEND="
+ ${TKDEPS}
+ ${SCILIBS}
+ app-shells/tcsh
+ dev-python/pyxml
+ dev-libs/libxml2:2
+ dev-libs/libjwc_c
+ dev-libs/libjwc_f
+ dev-libs/boehm-gc
+ !app-office/sc
+ !<sci-chemistry/ccp4-6.1.3
+ X? ( ${X11DEPS} )"
+DEPEND="${RDEPEND}
+ X? (
+ x11-misc/imake
+ x11-proto/inputproto
+ x11-proto/xextproto
+ )"
+PDEPEND="${SCIAPPS}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ tc-export PKG_CONFIG
+ einfo "Applying upstream patches ..."
+ for patch in $(seq $PATCH_TOT); do
+ base="PATCH${patch}"
+ dir=$(eval echo \${${base}[0]})
+ p=$(eval echo \${${base}[1]})
+ pushd "${dir}" >& /dev/null
+ ccp_patch "${DISTDIR}/${p}"
+ popd >& /dev/null
+ done
+ einfo "Done."
+ echo
+
+ [[ -n ${PATCHDATE} ]] && epatch "${WORKDIR}"/${PV}-${PATCHDATE}-updates.patch
+
+ einfo "Applying Gentoo patches ..."
+
+ # it tries to create libdir, bindir etc on live system in configure
+ ccp_patch "${FILESDIR}"/${PV}-dont-make-dirs-in-configure.patch
+
+ # We already have sci-chemistry/rasmol
+ # Also remember to create the bindir.
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-double-and-make-bindir.patch
+
+ # libraries come from sci-libs/ccp4-libs
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-libs.patch
+
+ # We have seperate ebuilds for those
+ for bin in molref xia scala imosflm balbes; do
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-${bin}.patch
+ done
+
+ # don't configure what is not build
+ ccp_patch "${FILESDIR}"/${PV}-dont-configure.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-pythonpath.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-pisa.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-clipper-template.patch
+
+ # Fix upstreams code
+ ccp_patch "${FILESDIR}"/${PV}-impl-dec.patch
+
+ # Not renaming, but unbundling libs
+ ccp_patch "${FILESDIR}"/${PV}-rename-rapper-ng.patch
+
+ # Use pkg-config to detect BLAS/LAPCK
+ ccp_patch "${FILESDIR}"/${PV}-lapack.patch
+
+ # unbundle libs
+ ccp_patch "${FILESDIR}"/${PV}-unbundle.patch
+
+ # tcl-8.6
+ ccp_patch "${FILESDIR}"/${P}-tcl8.6.patch
+
+ # Update things for oasis 4 usage
+ epatch "${WORKDIR}"/${PV}-oasis4.0.patch
+ sed 's: oasis : :g' -i src/Makefile.in || die
+
+ einfo "Done." # done applying Gentoo patches
+ echo
+
+ find ./lib/src/mmdb ./lib/ssm ./lib/clipper ./lib/fftw lib/lapack -delete
+
+ sed \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ -e 's:-Wl,-rpath,$CLIB::g' \
+ -e 's: -rpath $CLIB::g' \
+ -e 's: -I${srcdir}/include/cpp_c_headers::g' \
+ -e 's:sleep 1:sleep .2:g' \
+ -e 's:\\$(XCIF_LIB):-L$srcdir/lib/ccif -lccif:g' \
+ -e 's:\\$(XLAPACK_LIB):${XLAPACK_LIB}:g' \
+ -e 's:\\$(CXX_LIBS):\${CXX_LIBS}:g' \
+ -e 's:\\$(XLDFLAGS):\${XLDFLAGS}:g' \
+ -i configure || die
+
+ sed \
+ -e '/o crunch2/s:$: ${XLAPACK_LIB}:g' \
+ -i src/Makefile* || die
+
+ find "${S}" -name "Makefile.*" \
+ -exec sed -e 's|_FLAGS-|_FLAGS:-|g' -e "s:\(eval \$([[:alnum:]]*)\):\1 \$(GENTOOLDFLAGS):g" -i '{}' \;
+
+ # Don't build refmac, sfcheck, balbes, molrep binaries; available from the standalone version
+ sed -i -e "/^REFMACTARGETS/s:^.*:REFMACTARGETS="":g" configure || die
+
+ # Rapper bundles libxml2 and boehm-gc. Don't build, use or install those.
+ pushd src/rapper 2>/dev/null
+ eautoreconf
+ popd 2>/dev/null
+
+ gnuconfig_update
+
+ python_fix_shebang -f .
+}
+
+src_configure() {
+ # Build system is broken if we set LDFLAGS
+ export GENTOOLDFLAGS="${LDFLAGS}"
+ unset LDFLAGS
+
+ # These are broken with ./src/procheck/ps.f
+ filter-flags "-floop-*"
+
+ # GENTOO_OSNAME can be one of:
+ # irix irix64 sunos sunos64 aix hpux osf1 linux freebsd
+ # linux_compaq_compilers linux_intel_compilers generic Darwin
+ # ia64_linux_intel Darwin_ibm_compilers linux_ibm_compilers
+ if [[ "$(tc-getFC)" = "ifort" ]]; then
+ if use ia64; then
+ GENTOO_OSNAME="ia64_linux_intel"
+ else
+ # Should be valid for x86, maybe amd64
+ GENTOO_OSNAME="linux_intel_compilers"
+ fi
+ else
+ # Should be valid for x86 and amd64, at least
+ GENTOO_OSNAME="linux"
+ fi
+
+ # Sets up env
+ ln -s \
+ ccp4.setup-bash \
+ "${S}"/include/ccp4.setup
+
+ # We agree to the license by emerging this, set in LICENSE
+ sed -i \
+ -e "s~^\(^agreed=\).*~\1yes~g" \
+ "${S}"/configure || die
+
+ # Fix up variables -- need to reset CCP4_MASTER at install-time
+ sed -i \
+ -e "s~^\(setenv CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
+ -e "s~^\(export CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
+ -e "s~^\(.*export CBIN=.*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
+ -e "s~^\(.*setenv CBIN .*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
+ -e "s~^\(setenv CCP4I_TCLTK.*\)/usr/local/bin~\1${EPREFIX}/usr/bin~g" \
+ "${S}"/include/ccp4.setup* || die
+
+ # Set up variables for build
+ source "${S}"/include/ccp4.setup-sh
+
+ export CC=$(tc-getCC)
+ export CXX=$(tc-getCXX)
+ export COPTIM=${CFLAGS}
+ export CXXOPTIM=${CXXFLAGS}
+ # Default to -O2 if FFLAGS is unset
+ export FC=$(tc-getFC)
+ export FOPTIM=${FFLAGS:- -O2}
+ export BINSORT_SCR="${T}"
+ export CCP4_MASTER="${WORKDIR}"
+ export CCP4I_TCLTK="${EPREFIX}/usr/bin"
+ export MAKE="make ${MAKEOPTS} ${EXTRA_EMAKE}"
+
+ # Can't use econf, configure rejects unknown options like --prefix
+ ./configure \
+ $(use_enable X x) \
+ --with-shared-libs \
+ --with-fftw="${EPREFIX}/usr" \
+ --with-warnings \
+ --disable-pdb_extract \
+ --disable-cctbx \
+ --disable-phaser \
+ --disable-diffractionImg \
+ --disable-clipper \
+ --disable-ssm \
+ --disable-mosflm \
+ --disable-mrbump \
+ --tmpdir="${TMPDIR}" \
+ ${GENTOO_OSNAME} || die "configure failed"
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd src/clipper_progs 2>/dev/null
+ econf \
+ --prefix="${S}" \
+ --bindir="${ED}"/usr/libexec/ccp4/bin \
+ --with-ccp4="${S}" \
+ --with-clipper="${EPREFIX}/usr" \
+ --with-fftw="${EPREFIX}/usr" \
+ --with-mmdb="${EPREFIX}/usr" \
+ CXX=$(tc-getCXX)
+ popd 2>/dev/null
+}
+
+src_compile() {
+ # fsplit is required for the programs
+ pushd lib/src 2>/dev/null
+ emake fsplit -j1 || die
+ popd 2>/dev/null
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd src/clipper_progs 2>/dev/null
+ emake || die
+ popd 2>/dev/null
+
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ # Set up variables for build
+ source "${S}"/include/ccp4.setup-sh
+
+ # if we don't make this, a ton of programs fail to install
+ mkdir "${S}"/bin || die
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd "${S}"/src/clipper_progs 2>/dev/null
+ emake install || die
+ popd 2>/dev/null
+
+ einstall || die "install failed"
+
+ # Collision with sci-chemistry/mrbump
+ rm -f "${S}"/bin/{mrbump,pydbviewer} || die
+
+ # Bins
+ exeinto /usr/libexec/ccp4/bin/
+ doexe "${S}"/bin/* || die
+
+ # Libs
+ for file in "${S}"/lib/*; do
+ if [[ -d ${file} ]]; then
+ continue
+ elif [[ -x ${file} ]]; then
+ dolib.so ${file} || die
+ else
+ insinto /usr/$(get_libdir)
+ doins ${file} || die
+ fi
+ done
+
+ rm -f "${S}"/include/ccp4.setup*
+
+ # smartie -- log parsing
+ insinto /usr/share/ccp4
+ doins -r "${S}"/share/smartie || die
+
+ # Install docs and examples
+ local _man
+ pushd "${S}"/man/cat1 > /dev/null
+ for _man in *; do
+ newman ${_man} ${_man%??}-ccp4${_man:${#_man}-2:2}
+ done
+ popd > /dev/null
+
+ mv "${S}"/manual/README "${S}"/manual/README-manual
+ dodoc manual/* README CHANGES doc/* examples/README || die
+
+ rm "${ED}"/usr/share/doc/${PF}/GNUmakefile.*
+ rm "${ED}"/usr/share/doc/${PF}/COPYING.*
+
+ dohtml -r "${S}"/html/*
+
+ if use examples; then
+ for i in data rnase toxd; do
+ docinto examples/${i}
+ dodoc "${S}"/examples/${i}/*
+ done
+
+ docinto examples/tutorial
+ dohtml -r "${S}"/examples/tutorial/html examples/tutorial/tut.css
+ for i in data results; do
+ docinto examples/tutorial/${i}
+ dodoc "${S}"/examples/tutorial/${i}/*
+ done
+
+ for i in non-runnable runnable; do
+ docinto examples/unix/${i}
+ dodoc "${S}"/examples/unix/${i}/*
+ done
+ fi
+ # Needed for ccp4i docs to work
+ dosym ../../share/doc/${PF}/examples /usr/$(get_libdir)/ccp4/examples || die
+ dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/ccp4/html || die
+
+ cat >> "${T}"/baubles <<- EOF
+ #!${EPREFIX}/bin/bash
+ exec "${EPYTHON}" "\${CCP4}/share/ccp4/smartie/baubles.py"
+ EOF
+
+ exeinto /usr/libexec/ccp4/bin/
+ doexe "${T}"/baubles || die
+}
+
+# Epatch wrapper for bulk patching
+ccp_patch() {
+ EPATCH_SINGLE_MSG=" ${1##*/} ..." epatch ${1}
+}
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-clipper-template.patch b/sci-chemistry/ccp4-apps/files/6.1.3-clipper-template.patch
new file mode 100644
index 000000000000..433a78dbd23b
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-clipper-template.patch
@@ -0,0 +1,70 @@
+--- src/clipper_progs/src/intensity_target.h.orig 2010-01-21 11:27:13.236795886 -0600
++++ src/clipper_progs/src/intensity_target.h 2010-01-21 11:31:33.450686927 -0600
+@@ -70,9 +70,31 @@
+ {
+ public:
+ //! constructor: takes the datalist against which to calc target
+- TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ );
++ TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ )
++ {
++ hkl_data1 = &hkl_data1_;
++ hkl_data2 = &hkl_data2_;
++ }
+ //! return the value and derivatives of the target function
+- Rderiv rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const;
++ Rderiv rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const
++ {
++ Rderiv result;
++ result.r = result.dr = result.dr2 = 0.0;
++ const T1& it1 = (*hkl_data1)[ih];
++ const T2& it2 = (*hkl_data2)[ih];
++ if ( !it1.missing() && !it2.missing() )
++ if ( it1.I() > 1.0e-6 && it2.I() > 1.0e-6 ) {
++ const ftype eps = ih.hkl_class().epsilon();
++ const ftype i1 = it1.I() / eps;
++ const ftype i2 = it2.I() / eps;
++ const ftype w = sqrt( i1 * i2 );
++ const ftype d = intensityh + log(i1) - log(i2);
++ result.r = w * d * d;
++ result.dr = 2.0 * w * d;
++ result.dr2 = 2.0 * w;
++ }
++ return result;
++ }
+ //! the type of the function: optionally used to improve convergence
+ FNtype type() const { return QUADRATIC; }
+ private:
+@@ -109,33 +131,4 @@
+ return result;
+ }
+
+- // Log I1-I2 scaling
+-
+- template<class T1, class T2> TargetFn_scaleLogI1I2<T1,T2>::TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ )
+- {
+- hkl_data1 = &hkl_data1_;
+- hkl_data2 = &hkl_data2_;
+- }
+-
+- template<class T1, class T2> TargetFn_base::Rderiv TargetFn_scaleLogI1I2<T1,T2>::rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const
+- {
+- Rderiv result;
+- result.r = result.dr = result.dr2 = 0.0;
+- const T1& it1 = (*hkl_data1)[ih];
+- const T2& it2 = (*hkl_data2)[ih];
+- if ( !it1.missing() && !it2.missing() )
+- if ( it1.I() > 1.0e-6 && it2.I() > 1.0e-6 ) {
+- const ftype eps = ih.hkl_class().epsilon();
+- const ftype i1 = it1.I() / eps;
+- const ftype i2 = it2.I() / eps;
+- const ftype w = sqrt( i1 * i2 );
+- const ftype d = intensityh + log(i1) - log(i2);
+- result.r = w * d * d;
+- result.dr = 2.0 * w * d;
+- result.dr2 = 2.0 * w;
+- }
+- return result;
+- }
+-
+-
+ #endif
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-balbes.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-balbes.patch
new file mode 100644
index 000000000000..f1df3e5e19f9
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-balbes.patch
@@ -0,0 +1,14 @@
+diff --git a/share/Makefile.in b/share/Makefile.in
+index 2d4f20b..4500993 100755
+--- a/share/Makefile.in
++++ b/share/Makefile.in
+@@ -18,9 +18,6 @@ install :
+ for i in $(MRBUMP_TARGETS); do \
+ test -s $(MRBUMP_BINDIR)/$$i && $(INSTALL_PROGRAM) $(MRBUMP_BINDIR)/$$i $(bindir)/$$i || true ;\
+ done
+- for i in $(BALBES_TARGETS); do \
+- test -s $(BALBES_BINDIR)/$$i && $(INSTALL_PROGRAM) $(BALBES_BINDIR)/$$i $(bindir)/$$i || true ;\
+- done
+
+ clean : ; -rm -f core *.o *~ a.out
+
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-double-and-make-bindir.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-double-and-make-bindir.patch
new file mode 100644
index 000000000000..e62ae12adfbe
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-double-and-make-bindir.patch
@@ -0,0 +1,24 @@
+--- ccp4-6.1.1/x-windows/Makefile.in 2008-08-11 19:20:01.000000000 +0200
++++ ccp4-6.1.1/x-windows/Makefile.in.new 2009-02-27 14:32:25.000000000 +0100
+@@ -35,7 +35,7 @@
+ #
+ # all
+ #
+-all : xdlview libjwc_c libjwc_f rotgen_ hklview xjiffy rasmol2 ipmosflm
++all : rotgen_ hklview xjiffy
+ #
+ # xdl_view
+ #
+@@ -157,11 +157,10 @@
+ #
+ install_obj = hklview rotgen ipmosflm
+ install: all
++ mkdir -p $(bindir)
+ $(INSTALL_PROGRAM) $(srcdir)/hklview $(bindir)
+ cd $(srcdir)/XCCPJIFFY ; $(MAKE) bindir=$(bindir) libdir=$(libdir) install
+- $(INSTALL_PROGRAM) $(rasmol_dir)/rasmol $(bindir)
+ cd $(rotgen_dir); $(MAKE) install
+- $(INSTALL_PROGRAM) $(mosflm_dir)/bin/ipmosflm $(bindir)
+ #
+ # clean
+ #
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-imosflm.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-imosflm.patch
new file mode 100644
index 000000000000..f645643e1c67
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-imosflm.patch
@@ -0,0 +1,11 @@
+--- ccp4i/Makefile.in 2009-06-19 15:08:53.000000000 +0200
++++ ccp4i/Makefile.in.new 2009-08-04 21:10:14.000000000 +0200
+@@ -9,7 +9,7 @@
+ SHELL = /bin/sh
+ DESTDIR = $(prefix)
+ CCP4I_BINDIR = $(top_srcdir)/ccp4i/bin
+-CCP4I_TARGETS = ccp4i imosflm loggraph crank mapslicer
++CCP4I_TARGETS = ccp4i loggraph crank mapslicer
+
+ install :
+ for i in $(CCP4I_TARGETS); do \
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-libs.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-libs.patch
new file mode 100644
index 000000000000..1d1323005540
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-libs.patch
@@ -0,0 +1,35 @@
+--- Makefile.in 2009-06-19 15:13:29.000000000 +0200
++++ Makefile.in.new 2009-08-02 23:06:41.000000000 +0200
+@@ -2,7 +2,7 @@
+ # $Id$
+
+ SHELL = /bin/sh
+-DIRS = $(fftwdir) $(clipperdir) $(diffimdir) $(lapackdir) $(ccifdir) lib/src $(ssmdir) src lib/data unsupported/src x-windows share ccp4i $(prereleasedir)
++DIRS = src lib/data unsupported/src x-windows share ccp4i $(prereleasedir)
+ # this is for the benefit of makes that don't pass variable values in
+ # recursive invocations, so that you can override these values on the
+ # command line at the top level
+@@ -69,19 +69,19 @@
+ $(MAKE) -i $(MFLAGS) $(MVARS) install; else true; fi ; \
+ $(MAKE) install
+
+-srcdir : FORCE libdir
++srcdir : FORCE
+ if test -d src; then cd src; $(MAKE) $(MFLAGS) $(MVARS); else true; fi
+
+ supported : srcdir
+
+-unsupported : FORCE libdir
++unsupported : FORCE
+ if test -d unsupported/src; then cd unsupported/src; \
+ $(MAKE) $(MFLAGS) $(MVARS); else true; fi
+
+-datadir : FORCE libdir
++datadir : FORCE
+ cd lib/data; $(MAKE) $(MFLAGS) $(MVARS)
+
+-xwindir : FORCE libdir
++xwindir : FORCE
+ if test -f x-windows/Makefile; then cd x-windows; \
+ $(MAKE) -i $(MFLAGS) ; else true; fi
+
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-molref.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-molref.patch
new file mode 100644
index 000000000000..f16b0ecb938c
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-molref.patch
@@ -0,0 +1,19 @@
+--- src/pisa/Makefile.am 2007-07-10 10:56:05.000000000 +0200
++++ src/pisa/Makefile.am.new 2009-06-11 21:16:51.000000000 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = molref pisastore sbase
++SUBDIRS = pisastore sbase
+
+ pkgdatadir = $(datadir)/pisa
+
+--- src/pisa/Makefile.in 2009-06-12 21:12:08.000000000 +0200
++++ src/pisa/Makefile.in.new 2009-06-12 21:41:52.000000000 +0200
+@@ -82,7 +82,7 @@
+ am__quote = @am__quote@
+ install_sh = @install_sh@
+ pisa_LDFLAGS = @pisa_LDFLAGS@
+-SUBDIRS = molref pisastore sbase
++SUBDIRS = pisastore sbase
+
+ dist_pkgdata_DATA = pisa.cfg
+
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-scala.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-scala.patch
new file mode 100644
index 000000000000..af4fd8219c4f
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-scala.patch
@@ -0,0 +1,42 @@
+--- ./src/Makefile.in 2009-03-20 15:06:41.000000000 +0100
++++ ./src/Makefile.in.new 2009-07-31 23:46:13.000000000 +0200
+@@ -50,7 +50,7 @@
+
+ # these live in subdirectories and have more than one dependency:
+ OTHERS = rsps anglen secstr proclean pplot gfac2pdb tplot mplot probplot rmsdev nb \
+- scala dm dmmulti stereo mapmask maprot ncsmask \
++ dm dmmulti stereo mapmask maprot ncsmask \
+ sftools tlsanl tlsextract topp toplist dyndom sc combat mlphare fffear ffjoin \
+ anisoanl $(REFMACTARGETS) dtrek2scala crunch2 pmf doser mat2symop symop2mat
+
+@@ -637,7 +637,7 @@
+
+ ### scala, mapmask, maprot, ncsmask, combat
+
+-scala mapmask maprot ncsmask combat sc dyndom: # dependencies below
++mapmask maprot ncsmask combat sc dyndom: # dependencies below
+ @$(SETFLAGS) pwd=`pwd` ; rm -f $@; \
+ cd $(srcdir)/$@_; \
+ echo $(FC) $${$@_FLAGS-"$(FFLAGS)"} -c -o $$pwd/$@.o `pwd`/$@.f ;\
+@@ -1002,21 +1002,6 @@
+ proclean: $(srcdir)/procheck/clean.f $(srcdir)/procheck/brkcln.par
+ rmsdev: $(srcdir)/procheck/rmsdev.f $(srcdir)/procheck/rmsdev.inc
+
+-scaladir = $(srcdir)/scala_
+-scala : $(scaladir)/scala.f $(scaladir)/column.fh $(scaladir)/orient.fh \
+- $(scaladir)/params.fh $(scaladir)/rfile.fh $(scaladir)/scales.fh \
+- $(scaladir)/nbtchc.fh $(scaladir)/parameter.fh $(scaladir)/refcon.fh \
+- $(scaladir)/rundef.fh $(scaladir)/sdfacc.fh $(scaladir)/flags.fh \
+- $(scaladir)/inout.fh $(scaladir)/dump.fh $(scaladir)/tie.fh \
+- $(scaladir)/outcon.fh $(scaladir)/version.fh $(scaladir)/anomtc.fh \
+- $(scaladir)/axes.fh $(scaladir)/bigarg.fh \
+- $(scaladir)/errors.fh $(scaladir)/flow.fh $(scaladir)/glocon.fh \
+- $(scaladir)/means.fh $(scaladir)/refflg.fh $(scaladir)/stats.fh \
+- $(scaladir)/symmty.fh $(scaladir)/sharvest.fh $(scaladir)/chtml.fh \
+- $(scaladir)/htmbuf.fh $(scaladir)/sphhrm.fh $(scaladir)/crlncf.fh \
+- $(scaladir)/datasets.fh $(scaladir)/dts_storage.fh \
+- $(scaladir)/sclinimeans.fh $(scaladir)/timecor.fh
+-
+ freemask.o: $(dmdir)/freemask.f $(dmdir)/crystal.fh $(dmdir)/cycl.fh \
+ $(dmdir)/dmheader.fh $(dmdir)/io.fh $(dmdir)/output.fh \
+ $(dmdir)/params.fh $(dmdir)/uvwdata.fh
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-xia.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-xia.patch
new file mode 100644
index 000000000000..3af4af503fa6
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-build-xia.patch
@@ -0,0 +1,14 @@
+--- src/Makefile.in 2009-07-05 16:50:25.000000000 +0200
++++ src/Makefile.in.new 2009-07-05 19:38:06.000000000 +0200
+@@ -50,9 +50,9 @@
+
+ # these live in subdirectories and have more than one dependency:
+ OTHERS = rsps anglen secstr proclean pplot gfac2pdb tplot mplot probplot rmsdev nb \
+- scala dm dmmulti stereo mapmask maprot ncsmask chef \
++ scala dm dmmulti stereo mapmask maprot ncsmask \
+ sftools tlsanl tlsextract topp toplist dyndom sc combat mlphare fffear ffjoin \
+- anisoanl $(REFMACTARGETS) dtrek2scala crunch2 pmf doser mat2symop symop2mat
++ anisoanl $(REFMACTARGETS) dtrek2scala crunch2 pmf
+
+ # targets built from .c sources:
+ CSIMPLE = pltdev binsort
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-configure.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-configure.patch
new file mode 100644
index 000000000000..1e59578473ff
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-configure.patch
@@ -0,0 +1,111 @@
+--- configure 2009-08-07 12:11:28.000000000 +0200
++++ configure.new.nolib 2009-08-17 22:30:39.000000000 +0200
+@@ -3113,41 +3113,6 @@
+ RX_L="$configdir/lib/rxdispencer/rx"
+ export RX_H RX_L
+ fi
+- echo
+- echo "Running separate configure for CCIF library."
+- echo
+- cd lib/ccif
+- echo "Updating modification times for configuration files"
+- echo "Please wait..."
+- for i in configure.in aclocal.m4 configure Makefile.in; do
+- touch $i && sleep 1
+- done
+- echo "...done."
+-
+- if [ "X$LIBFOPTIM" != "X" ]; then
+- FOPTIM_save=$FOPTIM
+- FOPTIM=$LIBFOPTIM
+- FFLAGS="${FOPTIM} ${XFFLAGS}"
+- fi
+- if [ "X$LIBCOPTIM" != "X" ]; then
+- COPTIM_save=$COPTIM
+- COPTIM=$LIBCOPTIM
+- CFLAGS="${COPTIM} ${XCFLAGS}"
+- fi
+- ( touch /tmp/$$.cache_file 2>/dev/null && \
+- cat /dev/null > /tmp/$$.cache_file && \
+- ./configure $xopts --libdir=${libdir} --srcdir=${srcdir}/lib/ccif --cache-file=/tmp/$$.cache_file ) || \
+- ./configure $xopts --libdir=${libdir} --srcdir=${srcdir}/lib/ccif
+- rm -f /tmp/$$.cache_file
+- if [ "X$LIBFOPTIM" != "X" ]; then
+- FOPTIM=$FOPTIM_save
+- FFLAGS="${FOPTIM} ${XFFLAGS}"
+- fi
+- if [ "X$LIBCOPTIM" != "X" ]; then
+- COPTIM=$COPTIM_save
+- CFLAGS="${COPTIM} ${XCFLAGS}"
+- fi
+- cd ../..
+ echo
+ echo "Returning to main configure."
+ echo
+@@ -5094,53 +5059,6 @@
+ echo "configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}"
+ ./configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}
+ echo
+- echo "CCP4 configure: Running separate configure for libjwc_c library."
+- echo
+- cd ${srcdir}/${xwindir}/libjwc/libjwc_c
+- echo "Updating modification times for configuration files in libjwc_c"
+- echo "Please wait..."
+- for i in configure.in Makefile.am aclocal.m4 configure Makefile.in ltconfig ltmain.sh; do
+- touch $i && sleep 1
+- done
+- echo "...done."
+- echo
+- echo "configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}"
+- ( touch /tmp/$$.cache_file 2>/dev/null && \
+- cat /dev/null > /tmp/$$.cache_file && \
+- ./configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir} --cache-file=/tmp/$$.cache_file ) || \
+- ./configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}
+- rm -f /tmp/$$.cache_file
+- echo
+- echo "CCP4 configure: Running separate configure for libjwc_f library."
+- echo
+- cd ${srcdir}/${xwindir}/libjwc/libjwc_f
+- # for g77 3.1 some builds do not have no-common for system libs,
+- # so disable for now
+- echo "Updating modification times for configuration files in libjwc_f"
+- echo "Please wait..."
+- for i in configure.in Makefile.am aclocal.m4 configure Makefile.in ltconfig ltmain.sh; do
+- touch $i && sleep 1
+- done
+- echo "...done."
+- echo
+- # for g77 3.1 some builds do not have no-common for system libs,
+- # so disable for now
+- case $system in
+- Darwin* )
+- echo "configure --disable-shared --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}"
+- ( touch /tmp/$$.cache_file 2>/dev/null && \
+- cat /dev/null > /tmp/$$.cache_file && \
+- ./configure --disable-shared --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir} --cache-file=/tmp/$$.cache_file ) || \
+- ./configure --disable-shared --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}
+- ;;
+- * )
+- echo "configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}"
+- ( touch /tmp/$$.cache_file 2>/dev/null && \
+- cat /dev/null > /tmp/$$.cache_file && \
+- ./configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir} --cache-file=/tmp/$$.cache_file ) || \
+- ./configure $xopts --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}
+- esac
+- rm -f /tmp/$$.cache_file
+
+ if test "$non_shared" = yes; then
+ #this is a bit of a cheat/fudge but that's life!
+@@ -5210,12 +5128,6 @@
+ fi
+
+ echo
+- echo "CCP4 configure: Running separate configure for Mosflm"
+- echo
+- cd ${srcdir}/${mosflmdir}
+- echo "configure $xopts --with-ccp4-prefix=${prefix} --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}"
+- ./configure $xopts --with-ccp4-prefix=${prefix} --exec_prefix=${prefix} --prefix=${prefix} --bindir=${bindir} --libdir=${libdir}
+- echo
+ cd ../..
+ echo "Returning to main configure."
+ echo
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-dont-make-dirs-in-configure.patch b/sci-chemistry/ccp4-apps/files/6.1.3-dont-make-dirs-in-configure.patch
new file mode 100644
index 000000000000..583697cea0a1
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-dont-make-dirs-in-configure.patch
@@ -0,0 +1,87 @@
+--- ccp4-6.0.99e.orig/configure 2008-07-31 10:37:22.000000000 -0700
++++ ccp4-6.0.99e/configure 2008-07-31 10:39:18.000000000 -0700
+@@ -643,45 +643,45 @@
+ # echo "! Beware -- the $system installation isn't properly tested." ; }
+ syswarn='echo; echo "! Beware -- the $system installation is not properly tested."'
+
+-if test -z "$onlylibs" ; then
+- for i in CCP4_SCR BINSORT_SCR; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the value of $i."
+- badvar=1
+- fi
+- done
+-
+- for i in libdir bindir includedir; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the argument of --$i."
+- badvar=1
+- fi
+- done
+-
+- for i in $dotsrc $dotunsupp $dotunsuppsrc $dotdeprec $dotdeprecsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
+- if test -d $i || mkdir $i; then :
+- else
+- eval echo "! No directory $i and can\'t create it."
+- badvar=1
+- fi
+- done
+-else
+- # Kludge to fool the "Makefile" target in the top-level CCP4
+- # Makefile into not trying to remake src/Makefile.in
+- for i in $srcdir/src $srcdir/lib/src ; do
+- if test -d $i || mkdir $i; then
+- if ! test -f $i/Makefile.in ; then
+- echo
+- echo "onlylibs: making dummy file $i/Makefile.in"
+- touch $i/Makefile.in
+- fi
+- fi
+- done
+-fi
++#if test -z "$onlylibs" ; then
++# for i in CCP4_SCR BINSORT_SCR; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the value of $i."
++# badvar=1
++# fi
++# done
++#
++# for i in libdir bindir includedir; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the argument of --$i."
++# badvar=1
++# fi
++# done
++#
++# for i in $dotsrc $dotunsupp $dotunsuppsrc $dotdeprec $dotdeprecsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
++# if test -d $i || mkdir $i; then :
++# else
++# eval echo "! No directory $i and can\'t create it."
++# badvar=1
++# fi
++# done
++#else
++# # Kludge to fool the "Makefile" target in the top-level CCP4
++# # Makefile into not trying to remake src/Makefile.in
++# for i in $srcdir/src $srcdir/lib/src ; do
++# if test -d $i || mkdir $i; then
++# if ! test -f $i/Makefile.in ; then
++# echo
++# echo "onlylibs: making dummy file $i/Makefile.in"
++# touch $i/Makefile.in
++# fi
++# fi
++# done
++#fi
+
+ ### sanity checks
+
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch b/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch
new file mode 100644
index 000000000000..db8236063043
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch
@@ -0,0 +1,152 @@
+diff --git a/lib/DiffractionImage/Bruker/FRM_LIB.c b/lib/DiffractionImage/Bruker/FRM_LIB.c
+index bfda882..f821e04 100755
+--- a/lib/DiffractionImage/Bruker/FRM_LIB.c
++++ b/lib/DiffractionImage/Bruker/FRM_LIB.c
+@@ -38,6 +38,8 @@ FRM_LIB: Routines for reading, writing, and handling frame files.
+ #include "sys/types.h" /* _open, etc. */
+ #include "sys/stat.h" /* _open, etc. */
+
++#include <unistd.h>
++
+ #ifndef _MSC_VER
+ int min(int a, int b)
+ {
+diff --git a/lib/DiffractionImage/MAR/mar300_header.c b/lib/DiffractionImage/MAR/mar300_header.c
+index 1a933de..1c40c32 100755
+--- a/lib/DiffractionImage/MAR/mar300_header.c
++++ b/lib/DiffractionImage/MAR/mar300_header.c
+@@ -23,6 +23,9 @@
+ */
+ #include "mar300_header.h"
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ /*
+ * Local functions
+ */
+diff --git a/lib/DiffractionImage/MAR/mar345_header.c b/lib/DiffractionImage/MAR/mar345_header.c
+index a8351ea..16d0f7b 100755
+--- a/lib/DiffractionImage/MAR/mar345_header.c
++++ b/lib/DiffractionImage/MAR/mar345_header.c
+@@ -32,6 +32,9 @@
+ */
+ #include "mar345_header.h"
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ /*
+ * Definitions
+ */
+diff --git a/lib/DiffractionImage/MAR/nb_header.c b/lib/DiffractionImage/MAR/nb_header.c
+index 07f2741..6364ca4 100755
+--- a/lib/DiffractionImage/MAR/nb_header.c
++++ b/lib/DiffractionImage/MAR/nb_header.c
+@@ -20,6 +20,8 @@
+ #include <io.h>
+ #endif
+
++#include <sys/types.h>
++#include <unistd.h>
+ /*
+ * mar software include files
+ */
+diff --git a/lib/DiffractionImage/MAR/swap.c b/lib/DiffractionImage/MAR/swap.c
+index 443bb8c..0d96b3f 100755
+--- a/lib/DiffractionImage/MAR/swap.c
++++ b/lib/DiffractionImage/MAR/swap.c
+@@ -10,6 +10,9 @@
+ *
+ **********************************************************************/
+
++#define _XOPEN_SOURCE
++#include <unistd.h>
++
+ void swaplong();
+ void swapshort();
+
+diff --git a/lib/ccif/f_interface.c b/lib/ccif/f_interface.c
+index 0f6a6b7..a09dc48 100755
+--- a/lib/ccif/f_interface.c
++++ b/lib/ccif/f_interface.c
+@@ -25,6 +25,7 @@
+ ********************************************************************/
+
+ #include "stdpccts.h"
++#include <sys/mman.h>
+
+ /* This file is terribly organised, and badly needs re-doing. There is probably
+ * scope for splitting this into three modules:
+diff --git a/lib/src/ccp4_general_f.c b/lib/src/ccp4_general_f.c
+index 8b5d04f..74ee3f7 100755
+--- a/lib/src/ccp4_general_f.c
++++ b/lib/src/ccp4_general_f.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <math.h>
++#include <time.h>
+ #include "ccp4_errno.h"
+ #include "ccp4_fortran.h"
+ #include "ccp4_parser.h"
+diff --git a/lib/src/ccp4_program.c b/lib/src/ccp4_program.c
+index 3e83d4d..bb3e975 100755
+--- a/lib/src/ccp4_program.c
++++ b/lib/src/ccp4_program.c
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <time.h>
+ #include "ccp4_program.h"
+ #include "ccp4_parser.h"
+ #include "ccp4_utils.h"
+diff --git a/lib/src/fsplit.c b/lib/src/fsplit.c
+index ee8af24..c6fb3cd 100755
+--- a/lib/src/fsplit.c
++++ b/lib/src/fsplit.c
+@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)fsplit.c 5.5 (Berkeley) 3/12/91";
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <unistd.h>
+
+ /*
+ * usage: fsplit [-e efile] ... [file]
+diff --git a/src/clipper_progs/src/pirate/compress42.c b/src/clipper_progs/src/pirate/compress42.c
+index ea52e96..30dbd56 100755
+--- a/src/clipper_progs/src/pirate/compress42.c
++++ b/src/clipper_progs/src/pirate/compress42.c
+@@ -142,6 +142,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <errno.h>
++#include <unistd.h>
+
+ #ifdef DIRENT
+ # include <dirent.h>
+diff --git a/src/mtz2cif_/mtz2cif.c b/src/mtz2cif_/mtz2cif.c
+index e224430..c7b82f4 100755
+--- a/src/mtz2cif_/mtz2cif.c
++++ b/src/mtz2cif_/mtz2cif.c
+@@ -28,6 +28,7 @@
+ #include "cmtzlib.h"
+ #include "ccp4_parser.h"
+ #include "ccp4_general.h"
++#include "ccp4_program.h"
+ #include "csymlib.h"
+ #include "mtz2cif_lib.h"
+
+diff --git a/x-windows/XCCPJIFFY/xplot84driver.c b/x-windows/XCCPJIFFY/xplot84driver.c
+index 67e0bf1..76526ab 100755
+--- a/x-windows/XCCPJIFFY/xplot84driver.c
++++ b/x-windows/XCCPJIFFY/xplot84driver.c
+@@ -11,6 +11,7 @@
+
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <stdlib.h>
+
+ #include <X11/StringDefs.h>
+ #include <X11/Intrinsic.h>
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-lapack.patch b/sci-chemistry/ccp4-apps/files/6.1.3-lapack.patch
new file mode 100644
index 000000000000..62892db01147
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-lapack.patch
@@ -0,0 +1,597 @@
+diff --git a/configure b/configure
+index 833f483..bcfa62d 100755
+--- a/configure
++++ b/configure
+@@ -3226,574 +3226,14 @@ else
+ echo
+ echo "Warning: this option has not been extensively tested!"
+ echo "Please report problems to ccp4@ccp4.ac.uk"
+- # Search for vendor LAPACK/BLAS first
+- if test ! "$with_netlib_lapack" ; then
+- # Initialise variables to blank
+- lapackdir=
+- XLAPACK_LIB=
+- # Possible directories to check for vendor or pre-existing LAPACK or
+- # BLAS - add to these if you want to test others
+- trydirs="`echo $LD_LIBRARY_PATH |sed -e s/:/\ /g` /lib /usr/lib /usr/local/lib"
+- # Possible library names
+- # These are the names like xxxx where the library will be libxxxx.a
+- # or libxxxx.so
+- echo
+- echo "Guessing names for native/vendor LAPACK and/or BLAS libraries"
+- echo "on this system"
+- case $system in
+- linux | linux64 | linux32 )
+- # linux users will usually have them in /usr/lib but don't call it
+- trylapack="lapack"
+- tryblas="blas"
+- # if code is non_shared then this can lead to problems. both blas and lapack
+- # need to be resolved even if they are not called!
+- if test "$non_shared" = yes; then
+- echo "You are compiling linux non_shared. This sometimes causes problems "
+- echo " so checking for requirements."
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+- PROGRAM TESTLINK
+-C A bit of scala code to test the linking
+- real bf(3), bnorm
+-c
+- integer maxbmt
+- parameter (maxbmt = 2)
+- double precision B(maxbmt,maxbmt), eigval(maxbmt),
+- $ eigvec(maxbmt,maxbmt), w(5*maxbmt)
+- integer m, ia, ix, istat
+-c
+- B(1,1) = 1.00
+- B(1,2) = 1.00
+- B(2,1) = 1.00
+- B(2,2) = 1.00
+-c
+- m = maxbmt
+- ia = maxbmt
+- ix = maxbmt
+- call dsyev('N', 'L', m, B, ia, eigval, w, 5*maxbmt, istat)
+- end
+-EOF
+- #firstly test without -lblas
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack"
+- echo $test_compile
+- if { (eval $test_compile >& /dev/null ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... only -llapack needed"
+- XLAPACK_LIB="-llapack"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="lapack"
+- noblas=yes
+- trylapack=
+- tryblas=
+- else
+- echo "more than just -llapack needed...."
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack -lblas"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "...-llapack and -lblas were needed"
+- XLAPACK_LIB="-llapack -lblas"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="lapack blas"
+- noblas=no
+- trylapack=
+- tryblas=
+- else
+- echo "....could not find either lapack or blas."
+- fi
+- fi
+- fi
+- # add 64 bit libs
+- case $system in
+- linux64 ) trydirs="/usr/lib64 ${trydirs}" ;;
+- esac
+-
+- ;;
+- osf1)
+- # OSF1 has dxml (old version) and cxml
+- # which should have both lapack and blas
+- trylapack="dxml cxml"
+- tryblas=
+- trydirs="${trydirs} /usr/shlib"
+- ;;
+- irix)
+- # Additional search paths for IRIX
+- trydirs="${trydirs} /usr/lib32"
+- # SCSL should have both LAPACK and BLAS
+- trylapack="scs"
+- tryblas="blas"
+- ;;
+- irix64)
+- # Additional search paths for IRIX64
+- trydirs="${trydirs} /usr/lib64"
+- # SCSL should have both LAPACK and BLAS
+- trylapack="scs"
+- tryblas="blas"
+- # Extra compiler flags?
+- #XLAPACKFLAGS="-OPT:IEEE_NaN_inf=ON"
+- ;;
+- aix)
+- # Additional search paths for AIX
+- trydirs="${trydirs}"
+- # AIX might have ESSL library - blas only I think
+- trylapack=
+- tryblas="essl"
+- ;;
+- hpux)
+- # Additional search paths for HPUX
+- trydirs="${trydirs} /opt/fortran/lib /opt/fortran/lib/pa2.0 /opt/mlib/lib/pa2.0"
+- # HPUX should have both LAPACK (part of mlib) and BLAS
+- trylapack="lapack"
+- tryblas="blas"
+- # Extra compiler flags?
+- # +U77 required for ETIME function - this is already in XFFLAGS
+- #XLAPACKFLAGS="+U77"
+- ;;
+-
+- sunos | sunos64)
+- # Sun has libraries with BLAS and LAPACK invoked using
+- # -xlic_lib=sunperf
+- trylapack=
+- tryblas=
+- echo "SunOs can use the Sun Performance Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- echo "Looking for a valid library to use..."
+- echo
+- # Loop over the possible library names
+- try_libs="sunperf"
+- for testlib in $try_libs
+- do
+- if test ! "$XLAPACK_LIB" ; then
+- # Try running a test compile to see if this a valid library
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -dalign -xlic_lib=$testlib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -xlic_lib=$testlib is okay"
+- XLAPACK_LIB="-dalign -xlic_lib=$testlib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="$testlib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -xlic_lib=$testlib"
+- fi
+- # End of test for testlib
+- fi
+- # End of loop over possible lib names
+- done
+- # Report if no suitable library was found
+- if test ! "$XLAPACK_LIB" ; then
+- echo
+- echo "No suitable LAPACK library was found."
+- echo "This may be because the Sun Performance Library is not"
+- echo "installed on your system"
+- echo "Contact your system administrator or Sun vendor"
+- fi
+- ;;
+- Darwin | Darwin32 | Darwin64 )
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -framework vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -framework vecLib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- XLAPACK_LIB="-framework vecLib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+-#alternative linking for vecLib libraries
+- case `uname -sr` in
+- *Darwin\ 7.* ) test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -lcc_dynamic -Wl,-framework -Wl,vecLib" ;;
+- * ) test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -Wl,-framework -Wl,vecLib" ;;
+- esac
+-
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- XLAPACK_LIB="-Wl,-framework -Wl,vecLib"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="-Wl,-framework -Wl,vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+- Darwin_ibm_compilers )
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -framework vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- case `uname -sr` in
+- Darwin\ 8* )
+- XLAPACK_LIB="-L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lLAPACK -lBLAS"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f $XLAPACK_LIB"
+- ;;
+- Darwin\ 7* )
+- XLAPACK_LIB="-L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lLAPACK -lBLAS"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -lcc_dynamic $XLAPACK_LIB"
+- ;;
+- *)
+- XLAPACK_LIB="/System/Library/Frameworks/vecLib.Framework/Versions/Current/VecLib"
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f $XLAPACK_LIB"
+- esac
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- echo "... -framework vecLib is okay"
+- # Set the next two variables so that configure
+- # doesn't try to build netlib libraries
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- XLAPACK_LIB=""
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+-
+- Darwin_intel_compilers)
+- # Darwin has libraries with BLAS and LAPACK invoked using
+- # -F vecLib
+- echo "Darwin can use the vecLib Library (if installed)"
+- echo "which has both BLAS and LAPACK 3.0"
+- echo
+- # This is a special case so try running a test compile
+- echo "Checking: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -Wl,-framework -Wl,vecLib"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- # Compilation was okay
+- # doesn't try to build netlib libraries
+- XLAPACK_LIB="-F /System/Library/Frameworks -Qoption,ld,-framework -Qoption,ld,vecLib"
+- LAPACKLIB="vecLib"
+- noblas=yes
+- else
+- # Compilation failed
+- echo "... cannot use -framework vecLib"
+- echo
+- fi
+- trylapack=
+- tryblas=
+-# try the fink installation
+- trydirs="${trydirs} /sw"
+- ;;
+-
+-# linux_ia64_sgi_altix)
+-# SGI Japan
+- ia64_linux_intel)
+- # Additional search paths for Linux/IA64
+- trydirs="${trydirs} /opt/scsl/lib /usr/lib /usr/local/lib"
+- # SCSL and MKL should have both LAPACK and BLAS
+- trylapack="mkl_lapack scs lapack"
+- tryblas="mkl scs blas"
+- ;;
+- linux_ibm_compilers )
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- linux64_ibm_compilers )
+- trydirs="/usr/lib64 ${trydirs}"
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- linux_intel_compilers )
+- trydirs="/usr/lib64 ${trydirs}"
+- trylapack="mkl_lapack lapack"
+- tryblas="mkl blas"
+- ;;
+- *)
+- echo "The guesses for this system may not be correct - please"
+- echo "e-mail ccp4@ccp4.ac.uk if you have any extra information"
+- echo
+- # Default guess is just libblas
+- trylapack="lapack"
+- tryblas="blas"
+- ;;
+- esac
+- #
+- # Search for LAPACK libraries
+- #
+- # Write out what the guesses are
+- if test "$trylapack" ; then
+- echo "Possible LAPACK library names for this system:"
+- for libname in $trylapack
+- do
+- echo " lib$libname"
+- done
+- # Possible library name extensions
+- tryexts="a so dylib"
+- # Now loop over all the possibilities and see if anything
+- # turns up
+- echo
+- echo "Searching for libraries with LAPACK and BLAS:"
+- for testdir in $trydirs
+- do
+- for testlib in $trylapack
+- do
+- for ext in $tryexts
+- do
+- if test ! "$LAPACKLIB"; then
+- if test -s "$testdir/lib$testlib.$ext" ; then
+- echo "...found LAPACK library: $testdir/lib$testlib.$ext"
+- # Now try and link to a test program
+- # This is really for IRIX where libraries can be
+- # o32 or n32
+- echo " Testing: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
+- echo $test_compile
+- if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+- have_lapack=yes
+- else
+-# cover clapack option
+- echo $test_ccompile
+- if { (eval $test_ccompile ) 2>&1; } && test -s testlink ; then
+- have_lapack=yes
+- fi
+- fi
+- if test x$have_lapack = xyes ; then
+- # This one is okay
+- LAPACKLIB="$testlib"
+- LAPACKDIR="$testdir"
+- echo "Link ok - using lib$LAPACKLIB from $LAPACKDIR"
+- #
+- XLAPACK_LIB="-L$LAPACKDIR -l$LAPACKLIB"
+- #
+- # Test to see if we need BLAS too
+- # Do this by trying to compile a test program
+- # Use the LSAME test for now
+- echo
+- echo " * Checking whether we need a separate BLAS library *"
+- echo " Testing: try linking library against test program"
+- cd lib/lapack/test
+- if test -f testlsame ; then
+- rm -f testsame testlsame.o
+- fi
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB $XLDFLAGS"
+- echo $test_compile
+- if { ( eval $test_compile) 2>&1;} && test -s testlsame ; then
+- have_blas=yes
+- else
+-#cblas route
+- echo $test_ccompile
+- if { ( eval $test_ccompile) 2>&1;} && test -s testlsame ; then
+- have_blas=yes
+- fi
+- fi
+- if test x$have_blas = xyes ; then
+- echo "Test program okay - additional separate BLAS not required"
+- noblas=yes
+- else
+- echo "Test program failed - need a separate BLAS library"
+- fi
+- cd ../../..
+- else
+- # Keep looking
+- echo " link failed - cannot use lib$testlib"
+- fi
+- fi
+- fi
+- done
+- done
+- if test ! "$LAPACKLIB"; then
+- echo "...nothing in $testdir"
+- fi
+- done
+- fi
+-
+- # If LAPACKLIB hasn't been set at this point then no LAPACK library
+- # was found
+- if test ! "$LAPACKLIB" ; then
+- echo
+- echo "No pre-existing LAPACK library found - NetLib LAPACK will be built instead"
+- make_lapack=lapacklib
+- fi
+- # Look for possible BLAS
+- if test ! "$noblas" ; then
+- if test "$tryblas" ; then
+- echo
+- echo "Possible BLAS library names for this system:"
+- for libname in $tryblas
+- do
+- echo " lib$libname"
+- done
+- # Possible library name extensions
+- tryexts="a so"
+- # Now loop over all the possibilities and see if anything
+- # turns up
+- echo
+- echo "Searching for libraries with BLAS:"
+- for testdir in $trydirs
+- do
+- for testlib in $tryblas
+- do
+- for ext in $tryexts
+- do
+- if test ! "$BLASLIB"; then
+- if test -s "$testdir/lib$testlib.$ext" ; then
+- echo "...found BLAS library: $testdir/lib$testlib.$ext"
+- # Now try and link to a test program
+- # This is really for IRIX where libraries can be
+- # o32 or n32
+- echo " Testing: try to link library against test program"
+- if test -f testlink.f || test -f testlink ; then
+- rm -f testlink*
+- fi
+- cat > testlink.f <<EOF
+-c Test fortran program to link against library
+- PROGRAM TESTLINK
+- IMPLICIT NONE
+- INTEGER A
+- A = 1
+- STOP
+- END
+-EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
+- echo $test_compile
+- if { ( eval $test_compile) 2>&1;} && test -s testlink ; then
+- have_blas=yes
+- else
+- echo $test_ccompile
+- if { ( eval $test_compile) 2>&1;} && test -s testlink ; then
+- have_blas=yes
+- fi
+- fi
+- if test x$have_blas = xyes ; then
+- # This one is okay
+- BLASLIB="$testlib"
+- BLASDIR="$testdir"
+- BLASEXT="$ext"
+- echo "Link ok - using lib$BLASLIB from $BLASDIR"
+- XLAPACK_LIB="$XLAPACK_LIB -L$BLASDIR -l$BLASLIB"
+- else
+- # Keep looking
+- echo " link failed - cannot use lib$testlib"
+- fi
+- fi
+- fi
+- done
+- done
+- if test ! "$BLASLIB"; then
+- echo "...nothing in $testdir"
+- fi
+- done
+- fi
+- # Do we need to build BLAS too?
+- if test ! "$BLASLIB" ; then
+- echo
+- echo "No pre-existing BLAS library was found - NetLib BLAS will be built instead"
+- echo "This may result in poorer performance of the LAPACK routines"
+- make_blas=blaslib
+- BLASLIB=blas
+- BLASDIR="$srcdir/lib/lapack"
+- BLASEXT="a"
+- fi
+- fi
++ # gentoo is clever
++ make_blas=
++ make_lapack=
++ BLASLIB=$(${PKG_CONFIG} --libs blas)
++ LAPACKLIB=$(${PKG_CONFIG} --libs lapack)
++ XLAPACK_LIB="${BLASLIB} ${LAPACKLIB}"
++ XFFLAGS_LAPACK="$(${PKG_CONFIG} --cflags lapack blas)"
+ # Otherwise force building of NetLib BLAS and LAPACK libs
+- else
+- echo
+- echo "! Force building of NetLib BLAS and LAPACK..."
+- make_blas=blaslib
+- make_lapack=lapacklib
+- BLASLIB=blas
+- BLASDIR="$srcdir/lib/lapack"
+- BLASEXT="a"
+- fi
+ # need to know if we the lapack library was linked using the C or
+ # fortran linker
+ if test -f testlink.f || test -f testlink || test -f testlink.c ; then
+@@ -3916,8 +3356,8 @@ RANLIB = ${RANLIB}
+ INSTALL_DATA = ${INSTALL_DATA}
+ libdir = $libdir
+ #
+-BLASLIB = lib${BLASLIB}.${BLASEXT}
+-LAPACKLIB = liblapack.a
++BLASLIB = ${BLASLIB}
++LAPACKLIB = ${LAPACKLIB}
+ #
+ # These variables define targets in the main Makefile
+ blaslib = ${make_blas}
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-pisa.patch b/sci-chemistry/ccp4-apps/files/6.1.3-pisa.patch
new file mode 100644
index 000000000000..9d8fefe965e5
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-pisa.patch
@@ -0,0 +1,23 @@
+diff --git a/src/pisa/sbase/Makefile.am b/src/pisa/sbase/Makefile.am
+index 053e83a..4ff3394 100755
+--- a/src/pisa/sbase/Makefile.am
++++ b/src/pisa/sbase/Makefile.am
+@@ -1,4 +1,4 @@
+-pkgdatadir = $(datadir)/sbase
++pkgdatadir = $(datadir)/pisa/sbase
+ dist_pkgdata_DATA = \
+ graph.sbase index.sbase struct.sbase
+
+diff --git a/src/pisa/sbase/Makefile.in b/src/pisa/sbase/Makefile.in
+index faa3f7f..8630bd7 100755
+--- a/src/pisa/sbase/Makefile.in
++++ b/src/pisa/sbase/Makefile.in
+@@ -62,7 +62,7 @@ POST_UNINSTALL = :
+ EXEEXT = @EXEEXT@
+ OBJEXT = @OBJEXT@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+-pkgdatadir = $(datadir)/sbase
++pkgdatadir = $(datadir)/pisa/sbase
+ AMTAR = @AMTAR@
+ AR_FLAGS = @AR_FLAGS@
+ AWK = @AWK@
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-pythonpath.patch b/sci-chemistry/ccp4-apps/files/6.1.3-pythonpath.patch
new file mode 100644
index 000000000000..7a012be6ef02
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-pythonpath.patch
@@ -0,0 +1,65 @@
+diff --git a/ccp4-6.1.2/include/ccp4.setup-bash b/ccp4-6.1.2/include/ccp4.setup-bash
+index 9848101..cea8ae6 100755
+--- a/ccp4-6.1.2/include/ccp4.setup-bash
++++ b/ccp4-6.1.2/include/ccp4.setup-bash
+@@ -188,9 +188,9 @@ fi
+ #Python path for the subprocess fixed module
+
+ if [ $ccp4_first_in_path -eq 1 ]; then
+- setenv PYTHONPATH ${CCP4}/share/python:${PYTHONPATH}
++ setenv PYTHONPATH ${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python:${PYTHONPATH}
+ else
+- setenv PYTHONPATH ${PYTHONPATH}:${CCP4}/share/python
++ setenv PYTHONPATH ${PYTHONPATH}:${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python
+ fi
+
+ ### PLOT_COMMAND PRINT_COMMAND for the XCCPJIFFY programs to compile ###
+diff --git a/ccp4-6.1.2/include/ccp4.setup-csh b/ccp4-6.1.2/include/ccp4.setup-csh
+index 42f0820..93c2cf3 100755
+--- a/ccp4-6.1.2/include/ccp4.setup-csh
++++ b/ccp4-6.1.2/include/ccp4.setup-csh
+@@ -180,9 +180,9 @@ endif
+ #Python path for the subprocess fixed module
+ if (${?PYTHONPATH}) then
+ if ($ccp4_first_in_path) then
+- setenv PYTHONPATH ${CCP4}/share/python:${PYTHONPATH}
++ setenv PYTHONPATH ${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python:${PYTHONPATH}
+ else
+- setenv PYTHONPATH ${PYTHONPATH}:${CCP4}/share/python
++ setenv PYTHONPATH ${PYTHONPATH}:${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python
+ endif
+ else
+ setenv PYTHONPATH ${CCP4}/share/python
+diff --git a/ccp4-6.1.2/include/ccp4.setup-sh b/ccp4-6.1.2/include/ccp4.setup-sh
+index 4396ebf..a0455bd 100755
+--- a/ccp4-6.1.2/include/ccp4.setup-sh
++++ b/ccp4-6.1.2/include/ccp4.setup-sh
+@@ -228,9 +228,9 @@ test -r $CCP4/include/ccp4.msg && cat $CCP4/include/ccp4.msg
+ #Python path for the subprocess fixed module
+
+ if test $ccp4_first_in_path -eq 1; then
+- export PYTHONPATH=${CCP4}/share/python:${PYTHONPATH}
++ export PYTHONPATH=${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python:${PYTHONPATH}
+ else
+- export PYTHONPATH=${PYTHONPATH}:${CCP4}/share/python
++ export PYTHONPATH=${PYTHONPATH}:${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python
+ fi
+
+ ################### THE REST SHOULDN'T NEED EDITING #####################
+diff --git a/ccp4-6.1.2/include/ccp4.setup-zsh b/ccp4-6.1.2/include/ccp4.setup-zsh
+index 0e5c2ce..53523f3 100755
+--- a/ccp4-6.1.2/include/ccp4.setup-zsh
++++ b/ccp4-6.1.2/include/ccp4.setup-zsh
+@@ -157,10 +157,10 @@ export CLASSPATH
+ #Python path for the subprocess fixed module
+
+ if ($ccp4_first_in_path) then
+- PYTHONPATH=${CCP4}/share/python:${PYTHONPATH}
++ PYTHONPATH=${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python:${PYTHONPATH}
+ export PYTHONPATH
+ else
+- PYTHONPATH=${PYTHONPATH}:${CCP4}/share/python
++ PYTHONPATH=${PYTHONPATH}:${CCP4}/share/ccp4/smartie:${CCP4I_TOP}/python
+ export PYTHONPATH
+ fi
+
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-rename-rapper-ng.patch b/sci-chemistry/ccp4-apps/files/6.1.3-rename-rapper-ng.patch
new file mode 100644
index 000000000000..a5144cfa5d33
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-rename-rapper-ng.patch
@@ -0,0 +1,60 @@
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 70781f3..b2dcc25 100755
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -760,7 +760,7 @@ chainsawobjs = chainsaw.o
+ pdbcur : $(pdbcurobjs)
+ @$(SETFLAGS) ; rm -f pdbcur; eval $(CXX) $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -o pdbcur $(pdbcurobjs) $(LDCXXFLAGS)
+ ncont : $(ncontobjs)
+- @$(SETFLAGS) ; rm -f ncont; eval $(CXX) $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -o ncont $(ncontobjs) $(LDCXXFLAGS)
++ @$(SETFLAGS) ; rm -f ncont; eval $(CXX) $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -o ncont $(ncontobjs) $(LDCXXFLAGS) -lmmdb
+ coord_format : $(coord_formatobjs)
+ @$(SETFLAGS) xxx=1 ; \
+ rm -f coord_format; \
+diff --git a/src/rapper/LOOP/Makefile.am b/src/rapper/LOOP/Makefile.am
+index 85f212e..2608c6d 100755
+--- a/src/rapper/LOOP/Makefile.am
++++ b/src/rapper/LOOP/Makefile.am
+@@ -15,12 +15,12 @@ params.cpp typed_value.cpp misc.cpp residue.cpp atom.cpp psa.cpp edm_sidechains.
+ hash_table.cpp surface.cpp parse.cpp band.cpp edensity.cpp read_map.cpp iterator.cpp \
+ residue_range.cpp pop_search_frags.cpp saxs.cpp lib_choral.cpp pdf.cpp WeightedDistribMean.cpp
+
+-rapper_LDADD = ../gc7.0/libgc.la ../libxml2/libxml2.la
++rapper_LDADD = @GC_LIBS@ @LIBXML_LIBS@
+
+ pkgdatadir = $(datadir)/rapper
+ dist_pkgdata_DATA = params.xml
+
+-INCLUDES = -I. -I../gc7.0/include -I../libxml2/include
++INCLUDES = -I. @LIBXML_CFLAGS@ @GC_CFLAGS@
+ #SUBDIRS = \
+ #@PYTHON_USE_TRUE@ python
+
+diff --git a/src/rapper/Makefile.am b/src/rapper/Makefile.am
+index e78b10d..486b931 100755
+--- a/src/rapper/Makefile.am
++++ b/src/rapper/Makefile.am
+@@ -1,3 +1,3 @@
+-SUBDIRS = libxml2 gc7.0 LOOP data
++SUBDIRS = LOOP data
+
+ EXTRA_DIST =
+diff --git a/src/rapper/configure.ac b/src/rapper/configure.ac
+index 5e4ef69..268a579 100755
+--- a/src/rapper/configure.ac
++++ b/src/rapper/configure.ac
+@@ -48,6 +48,13 @@ AM_CONDITIONAL(AMDEP, test "x$enable_dependency_tracking" != xno)
+
+ AC_SUBST(rapper_LDFLAGS)
+
+-AC_CONFIG_SUBDIRS([gc7.0 libxml2])
++PKG_CHECK_MODULES([LIBXML],[libxml-2.0])
++AC_SUBST([LIBXML_CFLAGS])
++AC_SUBST([LIBXML_LIBS])
++
++PKG_CHECK_MODULES([GC],[bdw-gc])
++AC_SUBST([GC_CFLAGS])
++AC_SUBST([GC_LIBS])
++
+ #AC_OUTPUT(Makefile LOOP/Makefile LOOP/python/Makefile data/Makefile)
+ AC_OUTPUT(Makefile LOOP/Makefile data/Makefile)
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-unbundle.patch b/sci-chemistry/ccp4-apps/files/6.1.3-unbundle.patch
new file mode 100644
index 000000000000..107cfd740238
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-unbundle.patch
@@ -0,0 +1,131 @@
+ src/Makefile.in | 14 +++++-----
+ src/pisa/configure.ac | 67 +++++++++----------------------------------------
+ 2 files changed, 19 insertions(+), 62 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 70781f3..b11db04 100755
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -778,8 +778,8 @@ chainsaw : $(chainsawobjs)
+ eval $(CXX) $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -o chainsaw $(chainsawobjs) $(LDCXXFLAGS)
+ pdbcur.o pcur_funcs.o ncont.o coord_format.o pdb_merge.o chainsaw.o: # dependencies at end
+ @$(SETFLAGS) xxx=1 ; \
+- echo $(CXX) -I$(mmdb_appdir) -I$(incdir) -I$(incdir)/mmdb $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(mmdb_appdir)/`basename $@ .o`.cpp ;
+- eval $(CXX) -I$(mmdb_appdir) -I$(incdir) -I$(incdir)/mmdb $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(mmdb_appdir)/`basename $@ .o`.cpp
++ echo $(CXX) -I$(mmdb_appdir) -I$(incdir) `pkg-config --cflags mmdb` $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(mmdb_appdir)/`basename $@ .o`.cpp ;
++ eval $(CXX) -I$(mmdb_appdir) -I$(incdir) `pkg-config --cflags mmdb` $${mmdb_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(mmdb_appdir)/`basename $@ .o`.cpp
+
+ ### bp3, afro, gcx
+
+@@ -813,8 +813,8 @@ gcx : libbp3 $(gcxobjs)
+
+ $(libbp3objs) $(bp3objs) $(afroobjs) $(gcxobjs) : # dependencies at end
+ @$(SETFLAGS) xxx=1 ; \
+- echo $(CXX) -I$(bp3dir) -I$(incdir) -I$(incdir)/mmdb $${bp3_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(bp3dir)/`basename $@ .o`.C ; \
+- eval $(CXX) -I$(bp3dir) -I$(incdir) -I$(incdir)/mmdb $${bp3_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(bp3dir)/`basename $@ .o`.C
++ echo $(CXX) -I$(bp3dir) -I$(incdir) `pkg-config --cflags mmdb` $${bp3_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(bp3dir)/`basename $@ .o`.C ; \
++ eval $(CXX) -I$(bp3dir) -I$(incdir) `pkg-config --cflags mmdb` $${bp3_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(bp3dir)/`basename $@ .o`.C
+
+ ### crunch2 pmf
+
+@@ -853,7 +853,7 @@ cif2xml : $(cif2xmlobjs)
+ cross_validate : $(cross_validateobjs)
+ @$(SETFLAGS); rm -f cross_validate; eval $(CXX) $${harvest_app_FLAGS-"$(CXXFLAGS)"} -o cross_validate $(cross_validateobjs) $(LDCXXFLAGS)
+ cif2xml.o cross_validate.o : # dependencies at end
+- @$(SETFLAGS); eval $(CXX) -I$(harvest_appdir) -I$(incdir) -I$(incdir)/mmdb $${harvest_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(harvest_appdir)/`basename $@ .o`.cpp
++ @$(SETFLAGS); eval $(CXX) -I$(harvest_appdir) -I$(incdir) `pkg-config --cflags mmdb` $${harvest_app_FLAGS-"$(CXXFLAGS)"} -c -o $@ $(harvest_appdir)/`basename $@ .o`.cpp
+
+ pdb_extractdir = $(srcdir)/harvest_app_/pdb_extract
+ pdb_extract_suite :
+@@ -873,8 +873,8 @@ $(dev_tools_ctargets) :
+ $(dev_tools_cxxtargets) :
+ @$(SETFLAGS) xxx=1; \
+ rm -f $@; \
+- echo $(CXX) $${dev_tools_FLAGS-"$(CXXFLAGS)"} -o $@ $(dev_toolsdir)/$@.cpp -I$(incdir) -I$(incdir)/mmdb $(LDCXXFLAGS) ;\
+- eval $(CXX) $${dev_tools_FLAGS-"$(CXXFLAGS)"} -o $@ $(dev_toolsdir)/$@.cpp -I$(incdir) -I$(incdir)/mmdb $(LDCXXFLAGS)
++ echo $(CXX) $${dev_tools_FLAGS-"$(CXXFLAGS)"} -o $@ $(dev_toolsdir)/$@.cpp -I$(incdir) `pkg-config --cflags mmdb` $(LDCXXFLAGS) ;\
++ eval $(CXX) $${dev_tools_FLAGS-"$(CXXFLAGS)"} -o $@ $(dev_toolsdir)/$@.cpp -I$(incdir) `pkg-config --cflags mmdb` $(LDCXXFLAGS)
+
+ ### mlphare
+ mlphare:
+diff --git a/src/pisa/configure.ac b/src/pisa/configure.ac
+index 81afdda..044b6f8 100755
+--- a/src/pisa/configure.ac
++++ b/src/pisa/configure.ac
+@@ -31,64 +31,21 @@ AC_CHECK_FUNCS([floor pow rint sqrt])
+ # test for function in m
+ AC_CHECK_LIB([m], [sqrt])
+
+-dnl Optional: Check for MMDB.
+-AM_PATH_MMDB(,
+- [ if test "x$mmdb_prefix" != x ; then
+- if test "x$ac_MMDB_CXXFLAGS" != x && test "x$ac_MMDB_LDOPTS" = x ; then
+- case "$ac_MMDB_CXXFLAGS" in
+- *src/mmdb )
+- ac_MMDB_LDOPTS=`echo "$ac_MMDB_CXXFLAGS" | sed s#src/mmdb#src#g`
+- ;;
+- *include/mmdb )
+- ac_MMDB_LDOPTS=`echo "$ac_MMDB_CXXFLAGS" | sed s#include/mmdb#lib#g`
+- ;;
+- *)
+- esac
+- MMDB_CXXFLAGS="$ac_MMDB_CXXFLAGS"
+- MMDB_LIBS=`echo "$ac_MMDB_LDOPTS -lmmdb" | sed s#-I#-L#`
+- AC_MSG_WARN([assuming library $MMDB_LIBS headers $MMDB_CXXFLAGS])
+- else
+- MMDB_CXXFLAGS="-I$mmdb_prefix/src -I$mmdb_prefix/src/mmdb -I$mmdb_prefix/include -I$mmdb_prefix/include/mmdb"
+- MMDB_LIBS="-L$mmdb_prefix/src -L$mmdb_prefix/lib -lmmdb"
+- AC_MSG_WARN([assuming library $MMDB_LIBS headers $MMDB_CXXFLAGS])
+- fi
+- else
+- AC_MSG_ERROR([mmdb not found])
+- fi
+- ]
+-)
++PKG_CHECK_MODULES([MMDB],[mmdb])
++PKG_CHECK_MODULES([SSM],[ssm])
++
++MMDB_CXXFLAGS=${MMDB_CFLAGS}
++
++AC_SUBST([MMDB_CFLAGS])
++AC_SUBST([MMDB_CXXFLAGS])
++AC_SUBST([SSM_CFLAGS])
++
++AC_SUBST([MMDB_LIBS])
++AC_SUBST([SSM_LIBS])
+
+-ac_saved_CXXFLAGS=$CXXFLAGS
+-ac_saved_LIBS=$LIBS
+ CXXFLAGS="$CXXFLAGS $MMDB_CXXFLAGS"
+ LIBS="$MMDB_LIBS $LIBS"
+-AM_PATH_SSM(,
+- [ if test "x$ssm_prefix" != x ; then
+- if test "x$ac_SSM_CXXFLAGS" != x && test "x$ac_SSM_LDOPTS" = x ; then
+- case "$ac_SSM_CXXFLAGS" in
+- *lib/ssm )
+- ac_SSM_LDOPTS=`echo "$ac_SSM_CXXFLAGS" | sed s#lib/ssm#lib#g`
+- ;;
+- *include/ssm )
+- ac_SSM_LDOPTS=`echo "$ac_SSM_CXXFLAGS" | sed s#include/ssm#lib#g`
+- ;;
+- *)
+- esac
+- SSM_CXXFLAGS="$ac_SSM_CXXFLAGS"
+- SSM_LIBS=`echo "$ac_SSM_LDOPTS -lssm" | sed s#-I#-L#`
+- AC_MSG_WARN([assuming library $SSM_LIBS headers $SSM_CXXFLAGS])
+- else
+- SSM_CXXFLAGS="-I$ssm_prefix/include/ssm -I$ssm_prefix/lib/ssm"
+- SSM_LIBS="-L$ssm_prefix/lib -L$ssm_prefix/lib/ssm -lssm"
+- AC_MSG_WARN([assuming library $SSM_LIBS headers $SSM_CXXFLAGS])
+- fi
+- else
+- AC_MSG_ERROR([ssm not found])
+- fi
+- ]
+-)
+-CXXFLAGS=$ac_saved_CXXFLAGS
+-LIBS=$ac_saved_LIBS
++
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ #
diff --git a/sci-chemistry/ccp4-apps/files/ccp4-apps-6.1.3-tcl8.6.patch b/sci-chemistry/ccp4-apps/files/ccp4-apps-6.1.3-tcl8.6.patch
new file mode 100644
index 000000000000..4b98545eec83
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/files/ccp4-apps-6.1.3-tcl8.6.patch
@@ -0,0 +1,130 @@
+ src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c | 34 ++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c b/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
+index 2c9f02f..98d814a 100755
+--- a/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
++++ b/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
+@@ -297,7 +297,7 @@ int canvas_draw_line(char *canvas, int npts, float *x, float *y, char *tags,
+ puts("canvas_draw_line: about to evaluate the command...");
+ }
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_draw_line: error from Tcl_Eval: %s",interp->result);
++ printf("canvas_draw_line: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
+ return 0;
+ }
+ if (CCP4MAPWISH_CANVAS_DIAG)
+@@ -432,7 +432,7 @@ int canvas_draw_rectangle(char *canvas, int npts, float *x, float *y,
+ puts("canvas_draw_rectangle: about to evaluate the command...");
+ }
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_draw_rectangle: error from Tcl_Eval: %s",interp->result);
++ printf("canvas_draw_rectangle: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
+ printf("canvas_draw_rectangle:\ncanvas = \"%s\"\ntags = \"%s\"\ncolor = \"%s\"\nunits = \"%c\"\n",canvas,tags,color,units);
+ return 0;
+ }
+@@ -536,7 +536,7 @@ int canvas_draw_label(char *canvas, char *text, float x, float y,
+ /* Execute the command which draws the label */
+ if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_draw_label: command is: %s\n",command);
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_draw_label: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_draw_label: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+@@ -617,7 +617,7 @@ int canvas_scale_canvas(char *canvas, char *tag, float scale)
+ /* Execute the command which scales the canvas */
+ if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_scale_canvas: command is: %s\n",command);
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+@@ -706,7 +706,7 @@ int canvas_shift_canvas(char *canvas)
+ /* Execute the command which resizes the canvas */
+ if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_shift_canvas: command is: %s\n",command);
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_shift_canvas: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_shift_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+@@ -789,7 +789,7 @@ int canvas_shift_element(char *canvas, char *tag, int shiftx, int shifty)
+ /* Execute the command which resizes the canvas */
+ if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_shift_canvas: command is: %s\n",command);
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_shift_element: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_shift_element: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+@@ -861,7 +861,7 @@ int canvas_delete(char *canvas, char *tag)
+ /* Execute the command which deletes the tagged items */
+ if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_delete: command is: %s\n",command);
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+@@ -892,15 +892,15 @@ int canvas_exists(char *canvas)
+
+ sprintf(tmpstr,"winfo exists %s",canvas);
+ if (Tcl_Eval(interp,tmpstr) != TCL_OK) {
+- printf("canvas_exists: error from Tcl_Eval: %s",interp->result);
++ printf("canvas_exists: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
+ return 0;
+ }
+ /* Extract a long int using strtol
+ If no conversion takes place then "endptr" will be equal
+ to "result" */
+- istatus = (int) strtol(interp->result,&endptr,10);
+- if (strcmp(interp->result,endptr) == 0) {
+- printf("canvas_exists: bad return status from winfo command \"%s\"\n",interp->result);
++ istatus = (int) strtol(Tcl_GetStringResult(interp),&endptr,10);
++ if (strcmp(Tcl_GetStringResult(interp),endptr) == 0) {
++ printf("canvas_exists: bad return status from winfo command \"%s\"\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+ if (!istatus) {
+@@ -930,13 +930,13 @@ float canvas_get_tk_scaling(char *canvas, char units)
+
+ /* Execute the tk scaling command */
+ if (Tcl_Eval(interp,"tk scaling") != TCL_OK) {
+- printf("canvas_get_tk_scaling: error from Tcl_Eval: %s",interp->result);
++ printf("canvas_get_tk_scaling: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
+ return (float) 0.0;
+ }
+
+ /* Extract a float from the result */
+- tkscale = ((float) strtod(interp->result,&endptr));
+- if (strcmp(interp->result,endptr) == 0) {
++ tkscale = ((float) strtod(Tcl_GetStringResult(interp),&endptr));
++ if (strcmp(Tcl_GetStringResult(interp),endptr) == 0) {
+ printf("canvas_get_tk_scaling: couldn't extract scale factor\n");
+ return (float) 0.0;
+ }
+@@ -1021,19 +1021,19 @@ int canvas_get_limits(char *canvas, int limits[4])
+
+ /* Evaluate the command */
+ if (Tcl_Eval(interp,command) != TCL_OK) {
+- printf("canvas_get_limits: error from Tcl_Eval: %s\n",interp->result);
++ printf("canvas_get_limits: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
+ return 0;
+ }
+
+ /* Process the result - it should consist of 4 integers */
+ /* Use strtok which can split the string based on tokens
+ set by the programmer - in this case a space */
+- if (!interp->result) {
++ if (!Tcl_GetStringResult(interp)) {
+ puts("canvas_get_limits: failed to fetch canvas limits");
+ return TCL_ERROR;
+ }
+ i = 0;
+- p = strtok(interp->result," ");
++ p = strtok(Tcl_GetStringResult(interp)," ");
+ if (p == NULL) {
+ return 0;
+ }
diff --git a/sci-chemistry/ccp4-apps/metadata.xml b/sci-chemistry/ccp4-apps/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/ccp4/ccp4-6.1.3-r1.ebuild b/sci-chemistry/ccp4/ccp4-6.1.3-r1.ebuild
new file mode 100644
index 000000000000..eea4a408b472
--- /dev/null
+++ b/sci-chemistry/ccp4/ccp4-6.1.3-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit fortran-2
+
+DESCRIPTION="Protein X-ray crystallography toolkit -- meta package"
+HOMEPAGE="http://www.ccp4.ac.uk/"
+SRC_URI=""
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="X arpwarp +balbes"
+
+RDEPEND="
+ ~sci-chemistry/ccp4-apps-${PV}[X?]
+ !<=sci-chemistry/ccp4-apps-${PV}-r2
+ >=sci-chemistry/molrep-11.0.00-r1
+ >=sci-chemistry/mosflm-7.0.6-r2
+ sci-chemistry/mrbump[X?]
+ >=sci-chemistry/oasis-4.0-r1
+ >=sci-chemistry/pdb-extract-3.004-r2
+ >=sci-chemistry/refmac-5.5.0110-r1
+ >=sci-chemistry/scala-3.3.18-r1
+ >=sci-chemistry/sfcheck-7.03.18-r1
+ sci-chemistry/xia2
+ arpwarp? ( sci-chemistry/arp-warp-bin )
+ balbes? ( sci-chemistry/balbes )
+ X? (
+ ~sci-chemistry/ccp4i-${PV}
+ sci-chemistry/imosflm
+ sci-chemistry/pymol
+ sci-chemistry/rasmol
+ )"
+DEPEND=""
diff --git a/sci-chemistry/ccp4/files/6.0.1-dont-make-dirs-in-configure.patch b/sci-chemistry/ccp4/files/6.0.1-dont-make-dirs-in-configure.patch
new file mode 100644
index 000000000000..1420419ffab0
--- /dev/null
+++ b/sci-chemistry/ccp4/files/6.0.1-dont-make-dirs-in-configure.patch
@@ -0,0 +1,87 @@
+--- ccp4-6.0.1.orig/configure 2006-06-10 17:30:02.000000000 -0700
++++ ccp4-6.0.1/configure 2006-06-10 17:45:43.000000000 -0700
+@@ -623,45 +623,45 @@
+ # echo "! Beware -- the $system installation isn't properly tested." ; }
+ syswarn='echo; echo "! Beware -- the $system installation is not properly tested."'
+
+-if test -z "$onlylibs" ; then
+- for i in CCP4_SCR BINSORT_SCR; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the value of $i."
+- badvar=1
+- fi
+- done
+-
+- for i in libdir bindir; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the argument of --$i."
+- badvar=1
+- fi
+- done
+-
+- for i in $dotsrc $dotunsupp $dotunsuppsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
+- if test -d $i || mkdir $i; then :
+- else
+- eval echo "! No directory $i and can\'t create it."
+- badvar=1
+- fi
+- done
+-else
+- # Kludge to fool the "Makefile" target in the top-level CCP4
+- # Makefile into not trying to remake src/Makefile.in
+- for i in $srcdir/src $srcdir/lib/src ; do
+- if test -d $i || mkdir $i; then
+- if ! test -f $i/Makefile.in ; then
+- echo
+- echo "onlylibs: making dummy file $i/Makefile.in"
+- touch $i/Makefile.in
+- fi
+- fi
+- done
+-fi
++#if test -z "$onlylibs" ; then
++# for i in CCP4_SCR BINSORT_SCR; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the value of $i."
++# badvar=1
++# fi
++# done
++#
++# for i in libdir bindir; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the argument of --$i."
++# badvar=1
++# fi
++# done
++#
++# for i in $dotsrc $dotunsupp $dotunsuppsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
++# if test -d $i || mkdir $i; then :
++# else
++# eval echo "! No directory $i and can\'t create it."
++# badvar=1
++# fi
++# done
++#else
++# # Kludge to fool the "Makefile" target in the top-level CCP4
++# # Makefile into not trying to remake src/Makefile.in
++# for i in $srcdir/src $srcdir/lib/src ; do
++# if test -d $i || mkdir $i; then
++# if ! test -f $i/Makefile.in ; then
++# echo
++# echo "onlylibs: making dummy file $i/Makefile.in"
++# touch $i/Makefile.in
++# fi
++# fi
++# done
++#fi
+
+ ### sanity checks
+
diff --git a/sci-chemistry/ccp4/files/6.0.1-ppc-double-define-gerror.patch b/sci-chemistry/ccp4/files/6.0.1-ppc-double-define-gerror.patch
new file mode 100644
index 000000000000..a77d9494a05c
--- /dev/null
+++ b/sci-chemistry/ccp4/files/6.0.1-ppc-double-define-gerror.patch
@@ -0,0 +1,11 @@
+--- ccp4-6.0.1.orig/lib/src/library_f.c 2006-06-12 07:06:22.000000000 -0700
++++ ccp4-6.0.1/lib/src/library_f.c 2006-06-12 07:21:56.000000000 -0700
+@@ -716,7 +716,7 @@
+
+ #endif /* end of apple xlf support */
+
+-#if ( defined (__linux__) && defined (_CALL_SYSV) )
++#if ( defined (__linux__) && defined (_CALL_SYSV) && ! defined(G95) && ! defined (GFORTRAN) )
+ /* linuxppc xlf support */
+ void gerror_ (str, Lstr)
+ char *str;
diff --git a/sci-chemistry/ccp4/files/6.0.2-dont-make-dirs-in-configure.patch b/sci-chemistry/ccp4/files/6.0.2-dont-make-dirs-in-configure.patch
new file mode 100644
index 000000000000..1420419ffab0
--- /dev/null
+++ b/sci-chemistry/ccp4/files/6.0.2-dont-make-dirs-in-configure.patch
@@ -0,0 +1,87 @@
+--- ccp4-6.0.1.orig/configure 2006-06-10 17:30:02.000000000 -0700
++++ ccp4-6.0.1/configure 2006-06-10 17:45:43.000000000 -0700
+@@ -623,45 +623,45 @@
+ # echo "! Beware -- the $system installation isn't properly tested." ; }
+ syswarn='echo; echo "! Beware -- the $system installation is not properly tested."'
+
+-if test -z "$onlylibs" ; then
+- for i in CCP4_SCR BINSORT_SCR; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the value of $i."
+- badvar=1
+- fi
+- done
+-
+- for i in libdir bindir; do
+- if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
+- else
+- eval echo "! No directory \$$i and can\'t create it."
+- echo " Check the argument of --$i."
+- badvar=1
+- fi
+- done
+-
+- for i in $dotsrc $dotunsupp $dotunsuppsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
+- if test -d $i || mkdir $i; then :
+- else
+- eval echo "! No directory $i and can\'t create it."
+- badvar=1
+- fi
+- done
+-else
+- # Kludge to fool the "Makefile" target in the top-level CCP4
+- # Makefile into not trying to remake src/Makefile.in
+- for i in $srcdir/src $srcdir/lib/src ; do
+- if test -d $i || mkdir $i; then
+- if ! test -f $i/Makefile.in ; then
+- echo
+- echo "onlylibs: making dummy file $i/Makefile.in"
+- touch $i/Makefile.in
+- fi
+- fi
+- done
+-fi
++#if test -z "$onlylibs" ; then
++# for i in CCP4_SCR BINSORT_SCR; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the value of $i."
++# badvar=1
++# fi
++# done
++#
++# for i in libdir bindir; do
++# if ( eval test -d \$$i || eval mkdir -p \$$i ) ; then :
++# else
++# eval echo "! No directory \$$i and can\'t create it."
++# echo " Check the argument of --$i."
++# badvar=1
++# fi
++# done
++#
++# for i in $dotsrc $dotunsupp $dotunsuppsrc ./lib ./lib/src ./lib/data ./ccp4i/etc/unix $mosflmdir/lib $mosflmdir/bin $mosflmdir/cbf/lib ; do
++# if test -d $i || mkdir $i; then :
++# else
++# eval echo "! No directory $i and can\'t create it."
++# badvar=1
++# fi
++# done
++#else
++# # Kludge to fool the "Makefile" target in the top-level CCP4
++# # Makefile into not trying to remake src/Makefile.in
++# for i in $srcdir/src $srcdir/lib/src ; do
++# if test -d $i || mkdir $i; then
++# if ! test -f $i/Makefile.in ; then
++# echo
++# echo "onlylibs: making dummy file $i/Makefile.in"
++# touch $i/Makefile.in
++# fi
++# fi
++# done
++#fi
+
+ ### sanity checks
+
diff --git a/sci-chemistry/ccp4/files/6.0.2-gcc-4.1.2-idate-fix.patch b/sci-chemistry/ccp4/files/6.0.2-gcc-4.1.2-idate-fix.patch
new file mode 100644
index 000000000000..c118cc53baff
--- /dev/null
+++ b/sci-chemistry/ccp4/files/6.0.2-gcc-4.1.2-idate-fix.patch
@@ -0,0 +1,14 @@
+https://bugs.gentoo.org/show_bug.cgi?id=175630
+JTRiley
+
+--- ccp4-6.0.2.orig/src/refmac5_/make_unix_ccp4.f 2005-09-06 07:29:56.000000000 -0400
++++ ccp4-6.0.2.new/src/refmac5_/make_unix_ccp4.f 2007-05-02 20:03:46.000000000 -0400
+@@ -97,7 +97,7 @@
+
+ READ(CID,'(I2,1X,I2,1X,I2,2X)') IH(4),IH(3),IH(2)
+
+- CALL IDATE(IMON,IDAY,IYR)
++ CALL UIDATE(IMON,IDAY,IYR)
+ IF(IYR.GE.99) THEN
+ IYR=IYR+1900
+ ELSE
diff --git a/sci-chemistry/ccp4/files/6.0.2-ppc-double-define-gerror.patch b/sci-chemistry/ccp4/files/6.0.2-ppc-double-define-gerror.patch
new file mode 100644
index 000000000000..a77d9494a05c
--- /dev/null
+++ b/sci-chemistry/ccp4/files/6.0.2-ppc-double-define-gerror.patch
@@ -0,0 +1,11 @@
+--- ccp4-6.0.1.orig/lib/src/library_f.c 2006-06-12 07:06:22.000000000 -0700
++++ ccp4-6.0.1/lib/src/library_f.c 2006-06-12 07:21:56.000000000 -0700
+@@ -716,7 +716,7 @@
+
+ #endif /* end of apple xlf support */
+
+-#if ( defined (__linux__) && defined (_CALL_SYSV) )
++#if ( defined (__linux__) && defined (_CALL_SYSV) && ! defined(G95) && ! defined (GFORTRAN) )
+ /* linuxppc xlf support */
+ void gerror_ (str, Lstr)
+ char *str;
diff --git a/sci-chemistry/ccp4/files/ccp4i-default-to-firefox.patch b/sci-chemistry/ccp4/files/ccp4i-default-to-firefox.patch
new file mode 100644
index 000000000000..106db895b775
--- /dev/null
+++ b/sci-chemistry/ccp4/files/ccp4i-default-to-firefox.patch
@@ -0,0 +1,13 @@
+--- ccp4-5.99.5.orig/ccp4i/etc/configure.def.dist 2006-01-06 17:54:17.000000000 -0800
++++ ccp4-5.99.5/ccp4i/etc/configure.def.dist 2006-01-06 17:54:47.000000000 -0800
+@@ -54,8 +54,8 @@
+ MESSAGE _text ""
+ BLT_LIBRARY _text ""
+ MENU_LENGTH _positiveint 25
+-HYPERTEXT_VIEWER _text netscape
+-START_NETSCAPE _text netscape
++HYPERTEXT_VIEWER _text firefox
++START_NETSCAPE _text firefox
+ O_MAPMAN _text mapman
+ MAPMAN_MAXSIZE _positiveint 4194304
+ QUANTA_MBKALL _text mbkall
diff --git a/sci-chemistry/ccp4/files/check-blas-lapack-pthread.patch b/sci-chemistry/ccp4/files/check-blas-lapack-pthread.patch
new file mode 100644
index 000000000000..02a2aa6d8877
--- /dev/null
+++ b/sci-chemistry/ccp4/files/check-blas-lapack-pthread.patch
@@ -0,0 +1,103 @@
+--- ccp4-5.99.5.orig/configure 2006-01-17 00:35:36.000000000 -0800
++++ ccp4-5.99.5/configure 2006-01-17 10:44:39.000000000 -0800
+@@ -2410,12 +2410,12 @@
+ end
+ EOF
+ #firslty test without -lblas
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack -lpthread"
+ echo $test_compile
+ if { (eval $test_compile >& /dev/null ) 2>&1; } && test -s testlink ; then
+ # Compilation was okay
+- echo "... only -llapack needed"
+- XLAPACK_LIB="-llapack"
++ echo "... only -llapack -lpthread needed"
++ XLAPACK_LIB="-llapack -lpthread"
+ # Set the next two variables so that configure
+ # doesn't try to build netlib libraries
+ LAPACKLIB="lapack"
+@@ -2424,12 +2424,12 @@
+ tryblas=
+ else
+ echo "more than just -llapack needed...."
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack -lblas"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -llapack -lblas -lpthread"
+ echo $test_compile
+ if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+ # Compilation was okay
+- echo "...-llapack and -lblas were needed"
+- XLAPACK_LIB="-llapack -lblas"
++ echo "...-llapack, -lpthread and -lblas were needed"
++ XLAPACK_LIB="-llapack -lpthread -lblas"
+ # Set the next two variables so that configure
+ # doesn't try to build netlib libraries
+ LAPACKLIB="lapack blas"
+@@ -2720,8 +2720,8 @@
+ STOP
+ END
+ EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib -lpthread"
++ test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS -lpthread"
+ echo $test_compile
+ if { (eval $test_compile ) 2>&1; } && test -s testlink ; then
+ have_lapack=yes
+@@ -2738,7 +2738,7 @@
+ LAPACKDIR="$testdir"
+ echo "Link ok - using lib$LAPACKLIB from $LAPACKDIR"
+ #
+- XLAPACK_LIB="-L$LAPACKDIR -l$LAPACKLIB"
++ XLAPACK_LIB="-L$LAPACKDIR -l$LAPACKLIB -lpthread"
+ #
+ # Test to see if we need BLAS too
+ # Do this by trying to compile a test program
+@@ -2750,8 +2750,8 @@
+ if test -f testlsame ; then
+ rm -f testsame testlsame.o
+ fi
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB $XLDFLAGS"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB -lpthread"
++ test_ccompile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$LAPACKDIR -l$LAPACKLIB $XLDFLAGS -lpthread"
+ echo $test_compile
+ if { ( eval $test_compile) 2>&1;} && test -s testlsame ; then
+ have_blas=yes
+@@ -2830,8 +2830,8 @@
+ STOP
+ END
+ EOF
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib"
+- test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib -lpthread"
++ test_ccompile="$FC $FOPTIM $XFFLAGS -o testlink testlink.f -L$testdir -l$testlib $XLDFLAGS -lpthread"
+ echo $test_compile
+ if { ( eval $test_compile) 2>&1;} && test -s testlink ; then
+ have_blas=yes
+@@ -3033,7 +3033,7 @@
+ if test -f testlsame ; then
+ rm -f testsame testlsame.o
+ fi
+- test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$BLASDIR -l$BLASLIB"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testlsame lsametst.f -L$BLASDIR -l$BLASLIB -lpthread"
+ echo $test_compile
+ if { ( eval $test_compile) 2>&1;} && test -s testlsame ; then
+ echo "Found LSAME in lib$BLASLIB"
+@@ -3046,7 +3046,7 @@
+ if test -f testxerbla ; then
+ rm -f testxerbla testxerbla.o
+ fi
+- test_compile="$FC $FOPTIM $XFFLAGS -o testxerbla xerblatst.f -L$BLASDIR -l$BLASLIB"
++ test_compile="$FC $FOPTIM $XFFLAGS -o testxerbla xerblatst.f -L$BLASDIR -l$BLASLIB -lpthread"
+ echo $test_compile
+ if { ( eval $test_compile) 2>&1;} && test -s testxerbla ; then
+ # Found lsame
+@@ -3080,7 +3080,7 @@
+ cd ../..
+ #
+ lapackdir=lib/lapack
+- XLAPACK_LIB="-L$srcdir/lib/lapack -llapack -L$BLASDIR -l$BLASLIB"
++ XLAPACK_LIB="-L$srcdir/lib/lapack -llapack -L$BLASDIR -l$BLASLIB -lpthread"
+ # netlib lapack is in fortran, so we may need the fortran libraries when
+ # we are linking using the C or C++ compilers
+ case $system in
diff --git a/sci-chemistry/ccp4/files/clipper-find-mccp4-includes.patch b/sci-chemistry/ccp4/files/clipper-find-mccp4-includes.patch
new file mode 100644
index 000000000000..3bf5a0652247
--- /dev/null
+++ b/sci-chemistry/ccp4/files/clipper-find-mccp4-includes.patch
@@ -0,0 +1,11 @@
+--- ccp4-5.99.5/lib/clipper/configure.orig 2006-01-07 16:54:13.000000000 -0800
++++ ccp4-5.99.5/lib/clipper/configure 2006-01-07 16:54:31.000000000 -0800
+@@ -21751,7 +21751,7 @@
+
+ if test "x$mccp4_prefix" != x; then
+ # ie. mccp4=thing was given (thing is what we're checking for)
+- ac_MCCP4_CXXFLAGS="-I$mccp4_prefix/include"
++ ac_MCCP4_CXXFLAGS="-I$mccp4_prefix/include -I$mccp4_prefix/include/mccp4"
+ ac_MCCP4_LDOPTS="-L$mccp4_prefix/lib -lmccp4"
+ else
+ # treat as standard lib/include
diff --git a/sci-chemistry/ccp4/files/create-mosflm-bindir.patch b/sci-chemistry/ccp4/files/create-mosflm-bindir.patch
new file mode 100644
index 000000000000..34d6197572fc
--- /dev/null
+++ b/sci-chemistry/ccp4/files/create-mosflm-bindir.patch
@@ -0,0 +1,10 @@
+--- ccp4-5.99.5.orig/x-windows/Makefile.in 2006-01-06 12:31:02.000000000 -0800
++++ ccp4-5.99.5/x-windows/Makefile.in 2006-01-06 12:31:30.000000000 -0800
+@@ -158,6 +158,7 @@
+ install_obj = ipdisp.exe hklview xdldataman xdlmapman \
+ rotgen ipmosflm
+ install: all
++ mkdir -p $(bindir)
+ $(INSTALL_PROGRAM) $(srcdir)/ipdisp.exe $(bindir)
+ $(INSTALL_PROGRAM) $(srcdir)/ipdisp/ipdisp $(bindir)
+ $(INSTALL_PROGRAM) $(srcdir)/hklview $(bindir)
diff --git a/sci-chemistry/ccp4/files/dont-build-rasmol.patch b/sci-chemistry/ccp4/files/dont-build-rasmol.patch
new file mode 100644
index 000000000000..8da54fd26de8
--- /dev/null
+++ b/sci-chemistry/ccp4/files/dont-build-rasmol.patch
@@ -0,0 +1,19 @@
+--- ccp4-5.99.5.orig/x-windows/Makefile.in 2005-12-05 03:06:57.000000000 -0800
++++ ccp4-5.99.5/x-windows/Makefile.in 2005-12-05 03:07:23.000000000 -0800
+@@ -35,7 +35,7 @@
+ #
+ # all
+ #
+-all : xdlview libjwc_c libjwc_f rotgen_ hklview ipdisp.exe xdlgjk xjiffy rasmol2 ipmosflm
++all : xdlview libjwc_c libjwc_f rotgen_ hklview ipdisp.exe xdlgjk xjiffy ipmosflm
+ #
+ # xdl_view
+ #
+@@ -161,7 +161,6 @@
+ $(INSTALL_PROGRAM) $(srcdir)/xdldataman $(bindir)
+ $(INSTALL_PROGRAM) $(srcdir)/xdlmapman $(bindir)
+ cd $(srcdir)/XCCPJIFFY ; $(MAKE) install
+- $(INSTALL_PROGRAM) $(rasmol_dir)/rasmol $(bindir)
+ cd $(rotgen_dir); $(MAKE) install
+ $(INSTALL_PROGRAM) $(mosflm_dir)/bin/ipmosflm $(bindir)
+ cd $(xdlview_dir); $(MAKE) install
diff --git a/sci-chemistry/ccp4/files/make-ipmosflm-dir.patch b/sci-chemistry/ccp4/files/make-ipmosflm-dir.patch
new file mode 100644
index 000000000000..7813141b2ec2
--- /dev/null
+++ b/sci-chemistry/ccp4/files/make-ipmosflm-dir.patch
@@ -0,0 +1,10 @@
+--- ccp4-5.99.5.orig/x-windows/Mosflm/mosflm/Makefile.in 2006-01-06 00:04:12.000000000 -0800
++++ ccp4-5.99.5/x-windows/Mosflm/mosflm/Makefile.in 2006-01-06 00:04:41.000000000 -0800
+@@ -37,6 +37,7 @@
+ ${F77} ${FFLAGS} -o $@ $<
+
+ ipmosflm: ${OBJS}
++ mkdir -p ${DPSBIN}
+ ${FLINK} ${FFLAGS} ${OBJS} ${LOCALLIBS} ${LIBS} \
+ -o ${DPSBIN}/ipmosflm ${LDFLAGS}
+
diff --git a/sci-chemistry/ccp4/files/make-mosflm-cbf-libdir.patch b/sci-chemistry/ccp4/files/make-mosflm-cbf-libdir.patch
new file mode 100644
index 000000000000..ae4b7633b105
--- /dev/null
+++ b/sci-chemistry/ccp4/files/make-mosflm-cbf-libdir.patch
@@ -0,0 +1,11 @@
+--- ccp4-5.99.5.orig/x-windows/Mosflm/cbf/Makefile.in 2006-01-05 23:42:19.000000000 -0800
++++ ccp4-5.99.5/x-windows/Mosflm/cbf/Makefile.in 2006-01-05 23:43:35.000000000 -0800
+@@ -132,7 +132,7 @@
+ #
+ # CBF library
+ #
+-$(LIB)/libcbf.a: $(SOURCE) $(HEADERS) $(COMMONDEP)
++$(LIB)/libcbf.a: $(SOURCE) $(HEADERS) $(COMMONDEP) $(LIB)
+ $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $(SOURCE)
+ $(AR) cr $@ *.o
+ $(RANLIB) $@
diff --git a/sci-chemistry/ccp4/files/make-mosflm-index-libdir.patch b/sci-chemistry/ccp4/files/make-mosflm-index-libdir.patch
new file mode 100644
index 000000000000..97607b689672
--- /dev/null
+++ b/sci-chemistry/ccp4/files/make-mosflm-index-libdir.patch
@@ -0,0 +1,10 @@
+--- ccp4-5.99.5.orig/x-windows/Mosflm/index/Makefile.in 2006-01-05 23:15:09.000000000 -0800
++++ ccp4-5.99.5/x-windows/Mosflm/index/Makefile.in 2006-01-05 23:15:30.000000000 -0800
+@@ -76,6 +76,7 @@
+
+ # local version of libdps_index.a
+ ${LIB}/dps_index.a: ${IOBJS} ${HOBJS}
++ mkdir -p ${LIB}
+ ar ru ${LIB}/dps_index.a ${IOBJS} ${HOBJS}
+
+ ${LIB}/libpeak.a:
diff --git a/sci-chemistry/ccp4/files/make-mosflm-libdir.patch b/sci-chemistry/ccp4/files/make-mosflm-libdir.patch
new file mode 100644
index 000000000000..eac1b9f1721e
--- /dev/null
+++ b/sci-chemistry/ccp4/files/make-mosflm-libdir.patch
@@ -0,0 +1,10 @@
+--- ccp4-5.99.5.orig/x-windows/Mosflm/src/dps/index/Makefile.in 2006-01-05 22:48:47.000000000 -0800
++++ ccp4-5.99.5/x-windows/Mosflm/src/dps/index/Makefile.in 2006-01-05 22:49:02.000000000 -0800
+@@ -42,6 +42,7 @@
+ $(LOCALLIBS) $(LIBS)
+
+ index: $(IOBJS)
++ mkdir -p $(LIBDIR)
+ ${AR} $(AR_FLAGS) $(LIBDIR)/libdps_index.a $(IOBJS)
+ chmod 644 $(LIBDIR)/libdps_index.a
+
diff --git a/sci-chemistry/ccp4/files/pass-clipper-enablevals.patch b/sci-chemistry/ccp4/files/pass-clipper-enablevals.patch
new file mode 100644
index 000000000000..3e1a8b0e6be8
--- /dev/null
+++ b/sci-chemistry/ccp4/files/pass-clipper-enablevals.patch
@@ -0,0 +1,11 @@
+--- ccp4-5.99.5.orig/configure 2006-01-06 11:45:43.000000000 -0800
++++ ccp4-5.99.5/configure 2006-01-06 11:46:53.000000000 -0800
+@@ -3210,7 +3210,7 @@
+ #ccp4 setup
+ xopts="${xopts} --with-ccp4=${srcdir}"
+ #interface setup
+- xopts="${xopts} --enable-mmdb --enable-cif --enable-ccp4 --enable-minimol"
++ xopts="${xopts} --enable-mmdb --enable-cif --enable-ccp4 --enable-minimol --enable-mmdbold --enable-mtz --with-mccp4=/usr"
+ echo
+ echo "********* CLIPPER CONFIGURATION ***********"
+ echo
diff --git a/sci-chemistry/ccp4/metadata.xml b/sci-chemistry/ccp4/metadata.xml
new file mode 100644
index 000000000000..d37774eb9ada
--- /dev/null
+++ b/sci-chemistry/ccp4/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-chemistry</herd>
+ <use>
+ <flag name="balbes">Install sci-chemistry/balbes</flag>
+ <flag name="arpwarp">Add binary arp-warp for molecular replacement</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/ccp4i/Manifest b/sci-chemistry/ccp4i/Manifest
new file mode 100644
index 000000000000..e082cb44f7fb
--- /dev/null
+++ b/sci-chemistry/ccp4i/Manifest
@@ -0,0 +1,3 @@
+DIST 6.1.3-oasis4.0.patch.bz2 946 SHA256 12d7c5965e0c46b0f482514d9083d6be94d65eeb14ba29c17d507d5f9669f84b SHA512 7c7bf4ef90550708bf41b1831dbe71c38418b46455adb3d42ec609d287894ac9260d9671f1759f71c713ced72fa004b9808391ea6874007ac8b7d7637f349d32 WHIRLPOOL a2bc27e1e054e1717c387f3800533fa490c03d1d18d3fe3cff4676f0ec47799a1681a206e01013c1b8f8e41162303446a824b86effeef2ed73f059feb07fb820
+DIST ccp4-6.1.3-core-src.tar.gz 242134076 SHA256 1e529c660e7f390ec0feca9d45caa00a2813d23156c10a2747c427117293c324 SHA512 413eba806107ebcdbd93e9122275463709133d9b2a9ce44ae57a6c2350465a47ba66ad9875237aead74f5d422c0104f58f728ab37a757b10d82cde92af444c20 WHIRLPOOL faebf8ee7920013bc3d0e83565207dca1f31ba0b5c92fe1eae4b740f70ff2031d95787fa0d545b09c853d25657c08973527e43de02fddc086988123ca2a6339c
+DIST ccp4i-6.1.3-arpwarp.patch.bz2 58498 SHA256 297e6f75354f3a1932302f7039bf449484c95eb41b8634ae96d93c754b47c687 SHA512 0bf18d9768b722c553e79eed04de316f6b0b4695f7678e1d850d5e22735ecc79cdb961ea76b6482457fff232892b81ce191cd48fa588ded8058184a871dffb65 WHIRLPOOL f24625941e31e951f13c94cf31e2ca061840b016aa3fd038d29710d9ca400d364467dc3fa1e42a55944d63ac7e42a0a6baa39a596c55b18610eeb552d232d1b8
diff --git a/sci-chemistry/ccp4i/ccp4i-6.1.3-r4.ebuild b/sci-chemistry/ccp4i/ccp4i-6.1.3-r4.ebuild
new file mode 100644
index 000000000000..f5ac55ef17fa
--- /dev/null
+++ b/sci-chemistry/ccp4i/ccp4i-6.1.3-r4.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-single-r1 virtualx
+
+MY_PN="${PN%i}"
+MY_P="${MY_PN}-${PV}"
+
+#UPDATE="04_03_09"
+#PATCHDATE="090511"
+
+SRC="ftp://ftp.ccp4.ac.uk/ccp4"
+
+DESCRIPTION="Protein X-ray crystallography toolkit -- graphical interface"
+HOMEPAGE="http://www.ccp4.ac.uk/"
+SRC_URI="
+ ${SRC}/${PV}/${MY_P}-core-src.tar.gz
+ mirror://gentoo/${P}-arpwarp.patch.bz2
+ http://dev.gentoo.org/~jlec/distfiles/${PV}-oasis4.0.patch.bz2"
+[[ -n ${UPDATE} ]] && SRC_URI="${SRC_URI} ${SRC}/${PV}/updates/${P}-src-patch-${UPDATE}.tar.gz"
+[[ -n ${PATCHDATE} ]] && SRC_URI="${SRC_URI} http://dev.gentoo.org/~jlec/science-dist/${PV}-${PATCHDATE}-updates.patch.bz2"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="ccp4"
+IUSE=""
+
+RDEPEND="
+ app-shells/tcsh
+ media-gfx/graphviz
+ >=dev-lang/tk-8.3:0
+ >=dev-tcltk/blt-2.4
+ sci-libs/ccp4-libs"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-fix-baubles.patch
+ "${WORKDIR}"/${P}-arpwarp.patch
+ )
+
+src_prepare() {
+ epatch ${PATCHES[@]}
+
+ [[ ! -z ${PATCHDATE} ]] && epatch "${WORKDIR}"/${PV}-${PATCHDATE}-updates.patch
+
+ epatch "${WORKDIR}"/${PV}-oasis4.0.patch
+ python_fix_shebang ccp4i/ share/dbccp4i/
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ :
+}
+
+src_install() {
+ # rm imosflm stuff
+ rm -rf "${S}"/ccp4i/{bin/imosflm,imosflm} || die
+
+ rm -rf "${S}"/ccp4i/{bin,etc}/WINDOWS || die
+
+ # This is installed by mrbump
+ rm -rf "${S}"/ccp4i/{tasks/{dbviewer.tcl,mrbump.*},templates/mrbump.com,scripts/mrbump.script} || die
+
+ # CCP4Interface - GUI
+ insinto /usr/$(get_libdir)/ccp4
+ doins -r "${S}"/ccp4i
+ exeinto /usr/$(get_libdir)/ccp4/ccp4i/bin
+ doexe "${S}"/ccp4i/bin/*
+ dosym ../$(get_libdir)/ccp4/ccp4i/bin/ccp4i /usr/bin/ccp4i
+
+ dodir /usr/$(get_libdir)/ccp4/ccp4i/unix
+
+ # dbccp4i
+ insinto /usr/share/ccp4
+ doins -r "${S}"/share/dbccp4i
+}
+
+pkg_postinst() {
+ _ccp4-setup() {
+ source "${EPREFIX}/etc/profile"
+ export USER=root
+ bash "${EPREFIX}"/usr/$(get_libdir)/ccp4/ccp4i/bin/ccp4i -h > /dev/null
+ }
+ VIRTUALX_COMMAND="_ccp4-setup" virtualmake
+ echo ""
+ elog "ccp4i needs some enviromental settings. So please"
+ elog "\t source ${EPREFIX}/etc/profile"
+ echo ""
+}
diff --git a/sci-chemistry/ccp4i/files/6.1.3-fix-baubles.patch b/sci-chemistry/ccp4i/files/6.1.3-fix-baubles.patch
new file mode 100644
index 000000000000..2c5f659b8018
--- /dev/null
+++ b/sci-chemistry/ccp4i/files/6.1.3-fix-baubles.patch
@@ -0,0 +1,22 @@
+--- ccp4i/etc/configure.def.dist 2009-01-09 16:45:08.000000000 +0100
++++ ccp4i/etc/configure.def.dist.new 2009-07-07 23:17:26.000000000 +0200
+@@ -53,8 +53,8 @@
+ RUN_IMOSFLM _text "ccp4iwish [file join [GetEnvPath CCP4I_TOP] imosflm imosflm.tcl] project [GetCurrentProjectDir [GetCurrentProject]]"
+ RUN_CCP4MG _text "ccp4mg"
+ RUN_COOT _text "coot"
+-RUN_BAUBLES _text "python [file join [GetEnvPath CCP4] share smartie baubles.py]"
+-RUN_DBVIEWER _text "wish [file join [GetEnvPath CCP4] share dbccp4i application viewer.tcl]"
++RUN_BAUBLES _text "python [file join [GetEnvPath CCP4] share ccp4 smartie baubles.py]"
++RUN_DBVIEWER _text "wish [file join [GetEnvPath DBCCP4I_TOP] application viewer.tcl]"
+ ENABLE_BUBBLE_HELP _logical 1
+ DISABLE_TASKS _logical 1
+ CCP4_SETUP_COMMAND _text setup_ccp4
+@@ -62,7 +62,7 @@
+ BLT_LIBRARY _text ""
+ MENU_LENGTH _positiveint 25
+ HYPERTEXT_VIEWER _text firefox
+-START_NETSCAPE _text netscape
++START_NETSCAPE _text firefox
+ O_MAPMAN _text mapman
+ MAPMAN_MAXSIZE _positiveint 4194304
+ QUANTA_MBKALL _text mbkall
diff --git a/sci-chemistry/ccp4i/files/6.1.3-rename-rapper.patch b/sci-chemistry/ccp4i/files/6.1.3-rename-rapper.patch
new file mode 100644
index 000000000000..9f5cfb4b635f
--- /dev/null
+++ b/sci-chemistry/ccp4i/files/6.1.3-rename-rapper.patch
@@ -0,0 +1,61 @@
+diff --git a/ccp4i/scripts/check.script b/ccp4i/scripts/check.script
+index def44bc..dd4bb7e 100755
+--- a/ccp4i/scripts/check.script
++++ b/ccp4i/scripts/check.script
+@@ -24,7 +24,7 @@
+ if $RUN_RAMPAGE {
+
+ # Generate command line
+- set cmd "[BinPath rapper]"
++ set cmd "[BinPath rappermc]"
+
+ set rapperdatadir [FileJoin [GetEnvPath CCP4] share rapper]
+ set paramsfile [FileJoin $rapperdatadir params.xml]
+diff --git a/ccp4i/scripts/rapper.script b/ccp4i/scripts/rapper.script
+index cdae1e2..faae226 100755
+--- a/ccp4i/scripts/rapper.script
++++ b/ccp4i/scripts/rapper.script
+@@ -17,7 +17,7 @@
+
+ #set up command line
+
+-set cmd "[BinPath rapper]"
++set cmd "[BinPath rappermc]"
+
+ set rapperdatadir [FileJoin [GetEnvPath CCP4] share rapper]
+ set paramsfile [FileJoin [GetEnvPath CCP4] share rapper params.xml]
+@@ -180,7 +180,7 @@ append outfiles " $XYZOUT PROJECT"
+
+ # Run RAPPER to join loop back to framework and out put to defined pdb file
+ # Also need to sort out multimodel files join - FIX ME
+-set cmd2 "[BinPath rapper]"
++set cmd2 "[BinPath rappermc]"
+ append cmd2 " $paramsfile joinpdb "
+ append cmd2 " --pdb2 \"$root\-loop.pdb\" "
+ append cmd2 " --pdb \"$root\-framework.pdb\" "
+diff --git a/ccp4i/tasks/check.tcl b/ccp4i/tasks/check.tcl
+index ae88ff2..ee3307b 100755
+--- a/ccp4i/tasks/check.tcl
++++ b/ccp4i/tasks/check.tcl
+@@ -46,7 +46,7 @@ proc check_run { arrayname } {
+ # Check for Rampage program. If it is not found, we switch off the option.
+ # If it was the only option, script will fail with next check.
+ if { $array(RUN_RAMPAGE) == 1 } {
+- if { [FindExecutable "rapper"] == "" } {
++ if { [FindExecutable "rappermc"] == "" } {
+ WarningMessage "Input Error: Rapper_Rampage program not found in system path."
+ set array(RUN_RAMPAGE) 0
+ }
+diff --git a/ccp4i/tasks/rapper.tcl b/ccp4i/tasks/rapper.tcl
+index e299057..8843a3f 100755
+--- a/ccp4i/tasks/rapper.tcl
++++ b/ccp4i/tasks/rapper.tcl
+@@ -28,7 +28,7 @@ proc rapper_run { arrayname } {
+ # Check for RAPPER program. If it is not found, we switch off the option.
+ # If it was the only option, script will fail with next check.
+ if { [regexp MODEL $build_type ] && $prog_type == "RAPPER"} {
+- if { [FindExecutable "rapper"] == "" } {
++ if { [FindExecutable "rappermc"] == "" } {
+ WarningMessage "Input Error: RAPPER program not found in system path."
+ set build_type 0
+ }
diff --git a/sci-chemistry/ccp4i/files/6.1.3-rename-superpose.patch b/sci-chemistry/ccp4i/files/6.1.3-rename-superpose.patch
new file mode 100644
index 000000000000..74cd2b946601
--- /dev/null
+++ b/sci-chemistry/ccp4i/files/6.1.3-rename-superpose.patch
@@ -0,0 +1,26 @@
+diff --git a/ccp4i/scripts/superpose.script b/ccp4i/scripts/superpose.script
+index 3483c97..5027536 100755
+--- a/ccp4i/scripts/superpose.script
++++ b/ccp4i/scripts/superpose.script
+@@ -21,7 +21,7 @@
+
+ if { [regexp SSM $SUPERPOSE_MODE ] } {
+
+- set cmd "[BinPath superpose] \"$XYZIN2\" -s $SSM_MOVING \"$XYZIN1\" -s $SSM_FIXED \"$XYZOUT_LOCAL\""
++ set cmd "[BinPath superpose-ccp4] \"$XYZIN2\" -s $SSM_MOVING \"$XYZIN1\" -s $SSM_FIXED \"$XYZOUT_LOCAL\""
+ set status [Execute $cmd "" program_status report ]
+
+ } elseif { [regexp TOP $SUPERPOSE_MODE ] } {
+diff --git a/ccp4i/tasks/superpose.tcl b/ccp4i/tasks/superpose.tcl
+index 748bf6e..c92122a 100755
+--- a/ccp4i/tasks/superpose.tcl
++++ b/ccp4i/tasks/superpose.tcl
+@@ -100,7 +100,7 @@ proc superpose_run { arrayname } {
+ # If user is match equivalent named residues/atoms then fit in the match fields
+ switch [GetValue $arrayname SUPERPOSE_MODE] \
+ SSM {
+- if { ![file exists [FindExecutable superpose]] } {
++ if { ![file exists [FindExecutable superpose-ccp4]] } {
+ WarningMessage "The program \"superpose\" is not on your path.
+ Check your installation for \"superpose\" program and \"ssm\" library."
+ return 0
diff --git a/sci-chemistry/ccp4i/files/6.1.3-rename-truncate.patch b/sci-chemistry/ccp4i/files/6.1.3-rename-truncate.patch
new file mode 100644
index 000000000000..9af60b7c5152
--- /dev/null
+++ b/sci-chemistry/ccp4i/files/6.1.3-rename-truncate.patch
@@ -0,0 +1,91 @@
+diff --git a/ccp4i/crank/plugins/prep/crank_prep.tcl b/ccp4i/crank/plugins/prep/crank_prep.tcl
+index 7d05905..d01f1dc 100755
+--- a/ccp4i/crank/plugins/prep/crank_prep.tcl
++++ b/ccp4i/crank/plugins/prep/crank_prep.tcl
+@@ -226,7 +226,7 @@ proc run_truncate { i j } {
+ set script "$script\n$labout"
+ set script "$script\nEND\n"
+
+- set run_command "truncate $command << \"$script\""
++ set run_command "ftruncate $command << \"$script\""
+ puts $run_command
+ catch {eval exec $run_command } output
+ puts $output
+diff --git a/ccp4i/scripts/dtrek2mtz.script b/ccp4i/scripts/dtrek2mtz.script
+index e74aa0d..a2a1adb 100755
+--- a/ccp4i/scripts/dtrek2mtz.script
++++ b/ccp4i/scripts/dtrek2mtz.script
+@@ -36,7 +36,7 @@
+ set HKL_TRUNCATE [GetTmpFileName -ext mtz]
+
+ CreateComScript truncate truncate_script
+- set cmd "[BinPath truncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
++ set cmd "[BinPath ftruncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
+ set status [Execute $cmd $truncate_script program_status report]
+
+ HandleHarvestFile $HARVEST_MODE $HARVEST_PNAME $HARVEST_DNAME truncate
+diff --git a/ccp4i/scripts/import.script b/ccp4i/scripts/import.script
+index 90cba83..1c90c33 100755
+--- a/ccp4i/scripts/import.script
++++ b/ccp4i/scripts/import.script
+@@ -144,7 +144,7 @@ if { $FORMAT == "MTZ" } {
+
+ set truncatemtz [GetTmpFileName -ext mtz ]
+ CreateComScript truncate truncate_script
+- set cmd "[BinPath truncate] HKLIN \"$tmpmtz\" HKLOUT \"$truncatemtz\""
++ set cmd "[BinPath ftruncate] HKLIN \"$tmpmtz\" HKLOUT \"$truncatemtz\""
+ set status [Execute $cmd $truncate_script program_status report]
+
+
+diff --git a/ccp4i/scripts/import_scaled.script b/ccp4i/scripts/import_scaled.script
+index dcc619b..7250513 100755
+--- a/ccp4i/scripts/import_scaled.script
++++ b/ccp4i/scripts/import_scaled.script
+@@ -62,7 +62,7 @@
+
+ } else {
+ CreateComScript truncate truncate_script
+- set cmd "[BinPath truncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
++ set cmd "[BinPath ftruncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
+ set status [Execute $cmd $truncate_script program_status report]
+
+ HandleHarvestFile $HARVEST_MODE $HARVEST_PNAME $HARVEST_DNAME truncate
+diff --git a/ccp4i/scripts/scala.script b/ccp4i/scripts/scala.script
+index 6940ccd..bde10d6 100755
+--- a/ccp4i/scripts/scala.script
++++ b/ccp4i/scripts/scala.script
+@@ -275,7 +275,7 @@ END"
+
+ } else {
+ CreateComScript truncate truncate_script
+- set cmd "[BinPath truncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
++ set cmd "[BinPath ftruncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
+ set status [Execute $cmd $truncate_script $LOG_FILE program_status report ]
+ }
+
+diff --git a/ccp4i/scripts/scalepack2mtz.script b/ccp4i/scripts/scalepack2mtz.script
+index 986e06c..a1947a6 100755
+--- a/ccp4i/scripts/scalepack2mtz.script
++++ b/ccp4i/scripts/scalepack2mtz.script
+@@ -35,7 +35,7 @@
+
+ set HKL_TRUNCATE [GetTmpFileName -ext mtz]
+ CreateComScript truncate truncate_script
+- set cmd "[BinPath truncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
++ set cmd "[BinPath ftruncate] HKLIN \"$HKLTMP\" HKLOUT \"$HKL_TRUNCATE\""
+ set status [Execute $cmd $truncate_script program_status report]
+
+ HandleHarvestFile $HARVEST_MODE $HARVEST_PNAME $HARVEST_DNAME truncate
+diff --git a/ccp4i/scripts/truncate.script b/ccp4i/scripts/truncate.script
+index e0e09ce..2d448a2 100755
+--- a/ccp4i/scripts/truncate.script
++++ b/ccp4i/scripts/truncate.script
+@@ -45,7 +45,7 @@
+
+ CreateComScript truncate truncate_script
+
+- set cmd "[BinPath truncate] HKLIN \"$HKLIN\""
++ set cmd "[BinPath ftruncate] HKLIN \"$HKLIN\""
+ if { ![StringSame $INPUT_DATA AMPLITUDES] } {
+ append cmd " HKLOUT \"$HKL_TRUNCATE\""
+ }
diff --git a/sci-chemistry/ccp4i/metadata.xml b/sci-chemistry/ccp4i/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/ccp4i/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/ccpn/Manifest b/sci-chemistry/ccpn/Manifest
new file mode 100644
index 000000000000..73f83f19c7b2
--- /dev/null
+++ b/sci-chemistry/ccpn/Manifest
@@ -0,0 +1,6 @@
+DIST analysis2.4.1.tar.gz 36088236 SHA256 1cb089dcc739e8536d938a68536f556094f5d728907b251fe337758ba5bef106 SHA512 db44468c360d51815614fe0055505001c0a7a722f980c2c049c00524672bdfd4a507134ce1d68b29ebf622ffe94e0c9bb9685fea5b3441790b997a64f78c0dc1 WHIRLPOOL b53fc0438a878a8f8ce0244f5c1ce9edb616665149a699364e3bcd38c5db548c22b80ef67b4183ad5321b71b69a3b85aecc7d912893bba947700003a411651ac
+DIST analysis2.4.2.tar.gz 36390919 SHA256 14941131033cbd4b0b13d6d4fe3f9253360a7c2ace8ece9194be00c1fe4b2903 SHA512 694faefd3c085b559b6bb4729141a9ab885334f578bfbb0ebf260366dbca38c31738d5f5af50b5c7ea16b304b27adf80411082859796a5afeec630c36d56bd8b WHIRLPOOL 4499dcb074d445bfc972f9dea43e6f3e3c28722d513dce0fec4e1b2b5dab8be098f53f82565d86a4e7935f0595ef303465668230aa61021cf88e13cce8606214
+DIST ccpn-update-2.4.1-150226.patch.xz 10732 SHA256 74e8723d310d336cd4215ed4e9a1a1c0b2c0efdb4c03aaacba7ecd0575b38287 SHA512 60eb4acf6179f80207a72076ff5d5d733d3c3e804c1ce0a48701dd6e923146af49cd6759a529c8125f4b26eb3f8f83b35acc0c48b88a3e3034b25b5438a04feb WHIRLPOOL 3a2357d4fcb086206d45edd5b9cc807313b5f62be2f2a70e8f011f5521cf8729371b8c7149837c4ea1f6f059e26a49c1d20492f338a844e15f38ccf543faf6e1
+DIST ccpn-update-2.4.2-150325.patch.xz 2096 SHA256 d33676fd93aaa5814aa43179f221df69f4bae9b8ec98ce5b6cc57ce6aacab732 SHA512 c544e0a4a93d0e3275a22d07d21bf3bb5ed90cf041f40bf08fbc687b431640ad5c56180eadd4b43e4023b08ef42afe5a874423becc6f9313a0b1f642a4b97873 WHIRLPOOL f2e9780eb3216185cc6b89ca490e14c2de1130393eda4308fc71e6a2eb0460fc97f83ab3c92fb6a488a1926ba2f3099c7ae5f0a4bd216f8ffa24bfd87e360838
+DIST ccpn-update-2.4.2-150413.patch.xz 3132 SHA256 c0796e1f739f799003304c8b8d23ea0ee42b2e0a6dd59b292cb2a1167b5725f5 SHA512 99893ca009ff76b015017b29cfd97e0ae935ed2d62aa5a99d52dd9a5f22cf0d369e5019273fe3c3811c28b32568721fb64f71c5927eb57d0cc91dcea44b0288d WHIRLPOOL 48a355ef4824d41517d618178be4cd4efc42a6f5e190bac88348041504da0807aa1b34bafbc3937d7f6fc3b5b52fe469431fb6ce9df40bb1c56d7faad88cfe51
+DIST ccpn-update-2.4.2-150421.patch.xz 3788 SHA256 df8f7dd81281f3f7ddd266b8bd90a089f61a9e8f0cda3bcba8b495a6f4be6238 SHA512 0e8a10b6d9721b52574cd2fe0413dca0fac32a948eb31d3db6e2c4d4f7d85c341e8d53d70954341792ea598a37ec87e4392a615e1c2f6f8bbfc0e42a750be648 WHIRLPOOL 2673ac33b2eca1a3fb873567784f1d77937e7ec6aec3ab7eef6065f9322513326993786bd3865a50c50c58e05bf874ba25df02d15083f50aef9acb404ca4e1ef
diff --git a/sci-chemistry/ccpn/ccpn-2.4.1_p150226.ebuild b/sci-chemistry/ccpn/ccpn-2.4.1_p150226.ebuild
new file mode 100644
index 000000000000..6768d790f140
--- /dev/null
+++ b/sci-chemistry/ccpn/ccpn-2.4.1_p150226.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ssl,tk"
+
+inherit eutils flag-o-matic multilib portability python-single-r1 toolchain-funcs versionator
+
+PATCHSET="${PV##*_p}"
+MY_PN="${PN}mr"
+MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
+MY_MAJOR="$(get_version_component_range 1-3)"
+
+DESCRIPTION="The Collaborative Computing Project for NMR"
+HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
+SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
+[[ -n ${PATCHSET} ]] \
+ && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
+
+SLOT="0"
+LICENSE="|| ( CCPN LGPL-2.1 )"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+opengl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/tk:0=[threads]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-tcltk/tix
+ =sci-libs/ccpn-data-"${MY_MAJOR}"*[${PYTHON_USEDEP}]
+ sci-biology/psipred
+ x11-libs/libXext
+ x11-libs/libX11
+ opengl? (
+ media-libs/freeglut
+ dev-python/pyglet[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2)
+
+src_prepare() {
+ [[ -n ${PATCHSET} ]] && \
+ EPATCH_OPTS="-p2" epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
+
+ epatch "${FILESDIR}"/2.3.1-parallel.patch
+
+ append-lfs-flags
+
+ sed \
+ -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
+ -e "s:weights_s:weights:g" \
+ -i python/ccpnmr/analysis/wrappers/Psipred.py || die
+
+ local tk_ver
+ local myconf
+
+ tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
+
+ if use opengl; then
+ GLUT_NEED_INIT="-DNEED_GLUT_INIT"
+ IGNORE_GL_FLAG=""
+ GL_FLAG="-DUSE_GL_TRUE"
+ GL_DIR="${EPREFIX}/usr"
+ GL_LIB="-lglut -lGLU -lGL"
+ GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
+ GL_LIB_FLAGS=""
+ else
+ IGNORE_GL_FLAG="-DIGNORE_GL"
+ GL_FLAG="-DUSE_GL_FALSE"
+ fi
+
+ GLUT_NOT_IN_GL=""
+ GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
+
+ rm -rf data model doc license || die
+
+ sed \
+ -e "s|/usr|${EPREFIX}/usr|g" \
+ -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
+ -e "s|^\(OPT_FLAG =\).*|\1 ${CPPFLAGS} ${CFLAGS}|g" \
+ -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
+ -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
+ -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
+ -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
+ -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
+ -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
+ -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
+ -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
+ -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
+ -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
+ -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I$(python_get_includedir)|g" \
+ -e "s|^\(PYTHON_LIB =\).*|\1 -l${EPYTHON}|g" \
+ c/environment_default.txt > c/environment.txt || die
+
+ sed \
+ -e 's:ln -s:cp -f:g' \
+ -i $(find python -name linkSharedObjs) || die
+}
+
+src_compile() {
+ emake -C c all
+ emake -C c links
+}
+
+src_install() {
+ local libdir
+ local tkver
+ local _wrapper
+
+ find . -name "*.pyc" -type f -delete || die
+
+ libdir=$(get_libdir)
+ tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+
+ _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara extendNmr"
+ for wrapper in ${_wrapper}; do
+ sed \
+ -e "s|gentoo_sitedir|$(python_get_sitedir)|g" \
+ -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
+ -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
+ -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
+ -e "s|gentoopython|${EPYTHON}|g" \
+ -e "s|gentoousr|${EPREFIX}/usr|g" \
+ -e "s|//|/|g" \
+ "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
+ dobin "${T}"/${wrapper}
+ done
+
+ local in_path=$(python_get_sitedir)/${PN}
+ local files
+ local pydocs
+
+ pydocs="$(find python -name doc -type d)"
+ rm -rf ${pydocs} || die
+
+ for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
+ sed \
+ -e 's|#from __future__|from __future__|g' \
+ -i ${i} || die
+ done
+
+ dodir ${in_path#${EPREFIX}}/c
+
+ ebegin "Installing main files"
+ python_moduleinto ${PN}
+ python_domodule python
+ eend
+
+ ebegin "Adjusting permissions"
+ for _file in $(find "${ED}" -type f -name "*so"); do
+ chmod 755 ${_file}
+ done
+ eend
+ python_optimize
+}
diff --git a/sci-chemistry/ccpn/ccpn-2.4.2.ebuild b/sci-chemistry/ccpn/ccpn-2.4.2.ebuild
new file mode 100644
index 000000000000..b97807a88f38
--- /dev/null
+++ b/sci-chemistry/ccpn/ccpn-2.4.2.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ssl,tk"
+
+inherit eutils flag-o-matic multilib portability python-single-r1 toolchain-funcs versionator
+
+#PATCHSET="${PV##*_p}"
+MY_PN="${PN}mr"
+MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
+MY_MAJOR="$(get_version_component_range 1-3)"
+
+DESCRIPTION="The Collaborative Computing Project for NMR"
+HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
+SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
+[[ -n ${PATCHSET} ]] \
+ && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
+
+SLOT="0"
+LICENSE="|| ( CCPN LGPL-2.1 )"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+opengl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/tk:0=[threads]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-tcltk/tix
+ =sci-libs/ccpn-data-"${MY_MAJOR}"*[${PYTHON_USEDEP}]
+ sci-biology/psipred
+ x11-libs/libXext
+ x11-libs/libX11
+ opengl? (
+ media-libs/freeglut
+ dev-python/pyglet[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2)
+
+src_prepare() {
+ [[ -n ${PATCHSET} ]] && \
+ EPATCH_OPTS="-p2" epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
+
+ epatch "${FILESDIR}"/2.3.1-parallel.patch
+
+ append-lfs-flags
+
+ sed \
+ -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
+ -e "s:weights_s:weights:g" \
+ -i python/ccpnmr/analysis/wrappers/Psipred.py || die
+
+ local tk_ver
+ local myconf
+
+ tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
+
+ if use opengl; then
+ GLUT_NEED_INIT="-DNEED_GLUT_INIT"
+ IGNORE_GL_FLAG=""
+ GL_FLAG="-DUSE_GL_TRUE"
+ GL_DIR="${EPREFIX}/usr"
+ GL_LIB="-lglut -lGLU -lGL"
+ GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
+ GL_LIB_FLAGS=""
+ else
+ IGNORE_GL_FLAG="-DIGNORE_GL"
+ GL_FLAG="-DUSE_GL_FALSE"
+ fi
+
+ GLUT_NOT_IN_GL=""
+ GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
+
+ rm -rf data model doc license || die
+
+ sed \
+ -e "s|/usr|${EPREFIX}/usr|g" \
+ -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
+ -e "s|^\(OPT_FLAG =\).*|\1 ${CPPFLAGS} ${CFLAGS}|g" \
+ -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
+ -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
+ -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
+ -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
+ -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
+ -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
+ -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
+ -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
+ -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
+ -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
+ -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I$(python_get_includedir)|g" \
+ -e "s|^\(PYTHON_LIB =\).*|\1 -l${EPYTHON}|g" \
+ c/environment_default.txt > c/environment.txt || die
+
+ sed \
+ -e 's:ln -s:cp -f:g' \
+ -i $(find python -name linkSharedObjs) || die
+}
+
+src_compile() {
+ emake -C c all
+ emake -C c links
+}
+
+src_install() {
+ local libdir
+ local tkver
+ local _wrapper
+
+ find . -name "*.pyc" -type f -delete || die
+
+ libdir=$(get_libdir)
+ tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+
+ _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara extendNmr"
+ for wrapper in ${_wrapper}; do
+ sed \
+ -e "s|gentoo_sitedir|$(python_get_sitedir)|g" \
+ -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
+ -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
+ -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
+ -e "s|gentoopython|${EPYTHON}|g" \
+ -e "s|gentoousr|${EPREFIX}/usr|g" \
+ -e "s|//|/|g" \
+ "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
+ dobin "${T}"/${wrapper}
+ done
+
+ local in_path=$(python_get_sitedir)/${PN}
+ local files
+ local pydocs
+
+ pydocs="$(find python -name doc -type d)"
+ rm -rf ${pydocs} || die
+
+ for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
+ sed \
+ -e 's|#from __future__|from __future__|g' \
+ -i ${i} || die
+ done
+
+ dodir ${in_path#${EPREFIX}}/c
+
+ ebegin "Installing main files"
+ python_moduleinto ${PN}
+ python_domodule python
+ eend
+
+ ebegin "Adjusting permissions"
+ for _file in $(find "${ED}" -type f -name "*so"); do
+ chmod 755 ${_file}
+ done
+ eend
+ python_optimize
+}
diff --git a/sci-chemistry/ccpn/ccpn-2.4.2_p150325.ebuild b/sci-chemistry/ccpn/ccpn-2.4.2_p150325.ebuild
new file mode 100644
index 000000000000..6768d790f140
--- /dev/null
+++ b/sci-chemistry/ccpn/ccpn-2.4.2_p150325.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ssl,tk"
+
+inherit eutils flag-o-matic multilib portability python-single-r1 toolchain-funcs versionator
+
+PATCHSET="${PV##*_p}"
+MY_PN="${PN}mr"
+MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
+MY_MAJOR="$(get_version_component_range 1-3)"
+
+DESCRIPTION="The Collaborative Computing Project for NMR"
+HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
+SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
+[[ -n ${PATCHSET} ]] \
+ && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
+
+SLOT="0"
+LICENSE="|| ( CCPN LGPL-2.1 )"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+opengl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/tk:0=[threads]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-tcltk/tix
+ =sci-libs/ccpn-data-"${MY_MAJOR}"*[${PYTHON_USEDEP}]
+ sci-biology/psipred
+ x11-libs/libXext
+ x11-libs/libX11
+ opengl? (
+ media-libs/freeglut
+ dev-python/pyglet[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2)
+
+src_prepare() {
+ [[ -n ${PATCHSET} ]] && \
+ EPATCH_OPTS="-p2" epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
+
+ epatch "${FILESDIR}"/2.3.1-parallel.patch
+
+ append-lfs-flags
+
+ sed \
+ -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
+ -e "s:weights_s:weights:g" \
+ -i python/ccpnmr/analysis/wrappers/Psipred.py || die
+
+ local tk_ver
+ local myconf
+
+ tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
+
+ if use opengl; then
+ GLUT_NEED_INIT="-DNEED_GLUT_INIT"
+ IGNORE_GL_FLAG=""
+ GL_FLAG="-DUSE_GL_TRUE"
+ GL_DIR="${EPREFIX}/usr"
+ GL_LIB="-lglut -lGLU -lGL"
+ GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
+ GL_LIB_FLAGS=""
+ else
+ IGNORE_GL_FLAG="-DIGNORE_GL"
+ GL_FLAG="-DUSE_GL_FALSE"
+ fi
+
+ GLUT_NOT_IN_GL=""
+ GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
+
+ rm -rf data model doc license || die
+
+ sed \
+ -e "s|/usr|${EPREFIX}/usr|g" \
+ -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
+ -e "s|^\(OPT_FLAG =\).*|\1 ${CPPFLAGS} ${CFLAGS}|g" \
+ -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
+ -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
+ -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
+ -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
+ -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
+ -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
+ -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
+ -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
+ -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
+ -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
+ -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I$(python_get_includedir)|g" \
+ -e "s|^\(PYTHON_LIB =\).*|\1 -l${EPYTHON}|g" \
+ c/environment_default.txt > c/environment.txt || die
+
+ sed \
+ -e 's:ln -s:cp -f:g' \
+ -i $(find python -name linkSharedObjs) || die
+}
+
+src_compile() {
+ emake -C c all
+ emake -C c links
+}
+
+src_install() {
+ local libdir
+ local tkver
+ local _wrapper
+
+ find . -name "*.pyc" -type f -delete || die
+
+ libdir=$(get_libdir)
+ tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+
+ _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara extendNmr"
+ for wrapper in ${_wrapper}; do
+ sed \
+ -e "s|gentoo_sitedir|$(python_get_sitedir)|g" \
+ -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
+ -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
+ -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
+ -e "s|gentoopython|${EPYTHON}|g" \
+ -e "s|gentoousr|${EPREFIX}/usr|g" \
+ -e "s|//|/|g" \
+ "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
+ dobin "${T}"/${wrapper}
+ done
+
+ local in_path=$(python_get_sitedir)/${PN}
+ local files
+ local pydocs
+
+ pydocs="$(find python -name doc -type d)"
+ rm -rf ${pydocs} || die
+
+ for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
+ sed \
+ -e 's|#from __future__|from __future__|g' \
+ -i ${i} || die
+ done
+
+ dodir ${in_path#${EPREFIX}}/c
+
+ ebegin "Installing main files"
+ python_moduleinto ${PN}
+ python_domodule python
+ eend
+
+ ebegin "Adjusting permissions"
+ for _file in $(find "${ED}" -type f -name "*so"); do
+ chmod 755 ${_file}
+ done
+ eend
+ python_optimize
+}
diff --git a/sci-chemistry/ccpn/ccpn-2.4.2_p150413.ebuild b/sci-chemistry/ccpn/ccpn-2.4.2_p150413.ebuild
new file mode 100644
index 000000000000..6768d790f140
--- /dev/null
+++ b/sci-chemistry/ccpn/ccpn-2.4.2_p150413.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ssl,tk"
+
+inherit eutils flag-o-matic multilib portability python-single-r1 toolchain-funcs versionator
+
+PATCHSET="${PV##*_p}"
+MY_PN="${PN}mr"
+MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
+MY_MAJOR="$(get_version_component_range 1-3)"
+
+DESCRIPTION="The Collaborative Computing Project for NMR"
+HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
+SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
+[[ -n ${PATCHSET} ]] \
+ && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
+
+SLOT="0"
+LICENSE="|| ( CCPN LGPL-2.1 )"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+opengl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/tk:0=[threads]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-tcltk/tix
+ =sci-libs/ccpn-data-"${MY_MAJOR}"*[${PYTHON_USEDEP}]
+ sci-biology/psipred
+ x11-libs/libXext
+ x11-libs/libX11
+ opengl? (
+ media-libs/freeglut
+ dev-python/pyglet[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2)
+
+src_prepare() {
+ [[ -n ${PATCHSET} ]] && \
+ EPATCH_OPTS="-p2" epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
+
+ epatch "${FILESDIR}"/2.3.1-parallel.patch
+
+ append-lfs-flags
+
+ sed \
+ -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
+ -e "s:weights_s:weights:g" \
+ -i python/ccpnmr/analysis/wrappers/Psipred.py || die
+
+ local tk_ver
+ local myconf
+
+ tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
+
+ if use opengl; then
+ GLUT_NEED_INIT="-DNEED_GLUT_INIT"
+ IGNORE_GL_FLAG=""
+ GL_FLAG="-DUSE_GL_TRUE"
+ GL_DIR="${EPREFIX}/usr"
+ GL_LIB="-lglut -lGLU -lGL"
+ GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
+ GL_LIB_FLAGS=""
+ else
+ IGNORE_GL_FLAG="-DIGNORE_GL"
+ GL_FLAG="-DUSE_GL_FALSE"
+ fi
+
+ GLUT_NOT_IN_GL=""
+ GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
+
+ rm -rf data model doc license || die
+
+ sed \
+ -e "s|/usr|${EPREFIX}/usr|g" \
+ -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
+ -e "s|^\(OPT_FLAG =\).*|\1 ${CPPFLAGS} ${CFLAGS}|g" \
+ -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
+ -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
+ -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
+ -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
+ -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
+ -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
+ -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
+ -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
+ -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
+ -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
+ -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I$(python_get_includedir)|g" \
+ -e "s|^\(PYTHON_LIB =\).*|\1 -l${EPYTHON}|g" \
+ c/environment_default.txt > c/environment.txt || die
+
+ sed \
+ -e 's:ln -s:cp -f:g' \
+ -i $(find python -name linkSharedObjs) || die
+}
+
+src_compile() {
+ emake -C c all
+ emake -C c links
+}
+
+src_install() {
+ local libdir
+ local tkver
+ local _wrapper
+
+ find . -name "*.pyc" -type f -delete || die
+
+ libdir=$(get_libdir)
+ tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+
+ _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara extendNmr"
+ for wrapper in ${_wrapper}; do
+ sed \
+ -e "s|gentoo_sitedir|$(python_get_sitedir)|g" \
+ -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
+ -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
+ -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
+ -e "s|gentoopython|${EPYTHON}|g" \
+ -e "s|gentoousr|${EPREFIX}/usr|g" \
+ -e "s|//|/|g" \
+ "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
+ dobin "${T}"/${wrapper}
+ done
+
+ local in_path=$(python_get_sitedir)/${PN}
+ local files
+ local pydocs
+
+ pydocs="$(find python -name doc -type d)"
+ rm -rf ${pydocs} || die
+
+ for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
+ sed \
+ -e 's|#from __future__|from __future__|g' \
+ -i ${i} || die
+ done
+
+ dodir ${in_path#${EPREFIX}}/c
+
+ ebegin "Installing main files"
+ python_moduleinto ${PN}
+ python_domodule python
+ eend
+
+ ebegin "Adjusting permissions"
+ for _file in $(find "${ED}" -type f -name "*so"); do
+ chmod 755 ${_file}
+ done
+ eend
+ python_optimize
+}
diff --git a/sci-chemistry/ccpn/ccpn-2.4.2_p150421.ebuild b/sci-chemistry/ccpn/ccpn-2.4.2_p150421.ebuild
new file mode 100644
index 000000000000..6768d790f140
--- /dev/null
+++ b/sci-chemistry/ccpn/ccpn-2.4.2_p150421.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ssl,tk"
+
+inherit eutils flag-o-matic multilib portability python-single-r1 toolchain-funcs versionator
+
+PATCHSET="${PV##*_p}"
+MY_PN="${PN}mr"
+MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
+MY_MAJOR="$(get_version_component_range 1-3)"
+
+DESCRIPTION="The Collaborative Computing Project for NMR"
+HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
+SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
+[[ -n ${PATCHSET} ]] \
+ && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
+
+SLOT="0"
+LICENSE="|| ( CCPN LGPL-2.1 )"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+opengl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/tk:0=[threads]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-tcltk/tix
+ =sci-libs/ccpn-data-"${MY_MAJOR}"*[${PYTHON_USEDEP}]
+ sci-biology/psipred
+ x11-libs/libXext
+ x11-libs/libX11
+ opengl? (
+ media-libs/freeglut
+ dev-python/pyglet[${PYTHON_USEDEP}]
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2)
+
+src_prepare() {
+ [[ -n ${PATCHSET} ]] && \
+ EPATCH_OPTS="-p2" epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
+
+ epatch "${FILESDIR}"/2.3.1-parallel.patch
+
+ append-lfs-flags
+
+ sed \
+ -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
+ -e "s:weights_s:weights:g" \
+ -i python/ccpnmr/analysis/wrappers/Psipred.py || die
+
+ local tk_ver
+ local myconf
+
+ tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
+
+ if use opengl; then
+ GLUT_NEED_INIT="-DNEED_GLUT_INIT"
+ IGNORE_GL_FLAG=""
+ GL_FLAG="-DUSE_GL_TRUE"
+ GL_DIR="${EPREFIX}/usr"
+ GL_LIB="-lglut -lGLU -lGL"
+ GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
+ GL_LIB_FLAGS=""
+ else
+ IGNORE_GL_FLAG="-DIGNORE_GL"
+ GL_FLAG="-DUSE_GL_FALSE"
+ fi
+
+ GLUT_NOT_IN_GL=""
+ GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
+
+ rm -rf data model doc license || die
+
+ sed \
+ -e "s|/usr|${EPREFIX}/usr|g" \
+ -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
+ -e "s|^\(OPT_FLAG =\).*|\1 ${CPPFLAGS} ${CFLAGS}|g" \
+ -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
+ -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
+ -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
+ -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
+ -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
+ -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
+ -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
+ -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
+ -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
+ -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
+ -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
+ -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I$(python_get_includedir)|g" \
+ -e "s|^\(PYTHON_LIB =\).*|\1 -l${EPYTHON}|g" \
+ c/environment_default.txt > c/environment.txt || die
+
+ sed \
+ -e 's:ln -s:cp -f:g' \
+ -i $(find python -name linkSharedObjs) || die
+}
+
+src_compile() {
+ emake -C c all
+ emake -C c links
+}
+
+src_install() {
+ local libdir
+ local tkver
+ local _wrapper
+
+ find . -name "*.pyc" -type f -delete || die
+
+ libdir=$(get_libdir)
+ tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+
+ _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara extendNmr"
+ for wrapper in ${_wrapper}; do
+ sed \
+ -e "s|gentoo_sitedir|$(python_get_sitedir)|g" \
+ -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
+ -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
+ -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
+ -e "s|gentoopython|${EPYTHON}|g" \
+ -e "s|gentoousr|${EPREFIX}/usr|g" \
+ -e "s|//|/|g" \
+ "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
+ dobin "${T}"/${wrapper}
+ done
+
+ local in_path=$(python_get_sitedir)/${PN}
+ local files
+ local pydocs
+
+ pydocs="$(find python -name doc -type d)"
+ rm -rf ${pydocs} || die
+
+ for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
+ sed \
+ -e 's|#from __future__|from __future__|g' \
+ -i ${i} || die
+ done
+
+ dodir ${in_path#${EPREFIX}}/c
+
+ ebegin "Installing main files"
+ python_moduleinto ${PN}
+ python_domodule python
+ eend
+
+ ebegin "Adjusting permissions"
+ for _file in $(find "${ED}" -type f -name "*so"); do
+ chmod 755 ${_file}
+ done
+ eend
+ python_optimize
+}
diff --git a/sci-chemistry/ccpn/files/2.3.1-parallel.patch b/sci-chemistry/ccpn/files/2.3.1-parallel.patch
new file mode 100644
index 000000000000..fcf44707e082
--- /dev/null
+++ b/sci-chemistry/ccpn/files/2.3.1-parallel.patch
@@ -0,0 +1,38 @@
+diff --git a/ccpnmr2.3/c/Makefile b/ccpnmr2.3/c/Makefile
+index 01fb25a..8e8e1fe 100644
+--- a/ccpnmr2.3/c/Makefile
++++ b/ccpnmr2.3/c/Makefile
+@@ -5,22 +5,22 @@ all: compile
+ compile: global structure analysis clouds dynamics bayes
+
+ global:
+- cd memops/global && $(MAKE)
++ $(MAKE) -C memops/global
+
+-structure:
+- cd ccp/structure && $(MAKE)
++structure: global
++ $(MAKE) -C ccp/structure
+
+-analysis:
+- cd ccpnmr/analysis && $(MAKE)
++analysis: global
++ $(MAKE) -C ccpnmr/analysis
+
+-clouds:
+- cd ccpnmr/clouds && $(MAKE)
++clouds: global
++ $(MAKE) -C ccpnmr/clouds
+
+-dynamics:
+- cd ccpnmr/dynamics && $(MAKE)
++dynamics: global
++ $(MAKE) -C ccpnmr/dynamics
+
+-bayes:
+- cd other/cambridge/bayes && $(MAKE)
++bayes: global
++ $(MAKE) -C other/cambridge/bayes
+
+ clean: global_clean structure_clean analysis_clean clouds_clean dynamics_clean bayes_clean
+
diff --git a/sci-chemistry/ccpn/files/analysis b/sci-chemistry/ccpn/files/analysis
new file mode 100644
index 000000000000..828ed4e64ae9
--- /dev/null
+++ b/sci-chemistry/ccpn/files/analysis
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -i -O ${CCPNMR_TOP_DIR}/ccpn/python/ccpnmr/analysis/AnalysisGui.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/files/dangle b/sci-chemistry/ccpn/files/dangle
new file mode 100644
index 000000000000..6d8a42e615de
--- /dev/null
+++ b/sci-chemistry/ccpn/files/dangle
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/cambridge/dangle/DangleGui.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/files/dataShifter b/sci-chemistry/ccpn/files/dataShifter
new file mode 100644
index 000000000000..c083960f2f60
--- /dev/null
+++ b/sci-chemistry/ccpn/files/dataShifter
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/ccpnmr/format/gui/DataShifter.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/files/depositionFileImporter b/sci-chemistry/ccpn/files/depositionFileImporter
new file mode 100644
index 000000000000..09505ccc4925
--- /dev/null
+++ b/sci-chemistry/ccpn/files/depositionFileImporter
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/pdbe/deposition/dataFileImport/dataFileImportGui.py $@
diff --git a/sci-chemistry/ccpn/files/eci b/sci-chemistry/ccpn/files/eci
new file mode 100644
index 000000000000..54d913348718
--- /dev/null
+++ b/sci-chemistry/ccpn/files/eci
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/ccpnmr/eci/EntryCompletionGui.py $*
diff --git a/sci-chemistry/ccpn/files/extendNmr b/sci-chemistry/ccpn/files/extendNmr
new file mode 100644
index 000000000000..a2fe4c997c7c
--- /dev/null
+++ b/sci-chemistry/ccpn/files/extendNmr
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O -i -O ${CCPNMR_TOP_DIR}/ccpn/python/extendNmr/ExtendNmrGui.py $@
diff --git a/sci-chemistry/ccpn/files/formatConverter b/sci-chemistry/ccpn/files/formatConverter
new file mode 100644
index 000000000000..6cb273612352
--- /dev/null
+++ b/sci-chemistry/ccpn/files/formatConverter
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/ccpnmr/format/gui/FormatConverter.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/files/pipe2azara b/sci-chemistry/ccpn/files/pipe2azara
new file mode 100644
index 000000000000..5a3710a134a7
--- /dev/null
+++ b/sci-chemistry/ccpn/files/pipe2azara
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/ccp/format/spectra/params/NmrPipeData.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/files/talosn.patch b/sci-chemistry/ccpn/files/talosn.patch
new file mode 100644
index 000000000000..e19a0ab19783
--- /dev/null
+++ b/sci-chemistry/ccpn/files/talosn.patch
@@ -0,0 +1,16 @@
+ ccpnmr2.3/python/ccpnmr/format/general/Constants.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ccpnmr2.3/python/ccpnmr/format/general/Constants.py b/ccpnmr2.3/python/ccpnmr/format/general/Constants.py
+index d10553e..fb732db 100644
+--- a/ccpnmr2.3/python/ccpnmr/format/general/Constants.py
++++ b/ccpnmr2.3/python/ccpnmr/format/general/Constants.py
+@@ -865,7 +865,7 @@ IoSetupList = [
+ 'cyana': ['dihedrals.aco',1,1, [['SelectionList','version','Cyana version:',['2.0','2.1'],None]],
+ [['SelectionList','version','Cyana version:',['2.0','2.1'],None]]],
+ 'nmrStar': ['nmrStar.str',1,0, [],[]],
+- 'talos': ['dihedral.tab',1,0, [['MultiSelectionList','validClasses','Classes for valid constraint:',['Good','New','Warn','None'],None],
++ 'talos': ['dihedral.tab',1,0, [['MultiSelectionList','validClasses','Classes for valid constraint:',['Good','New','Warn','Dyn', 'Strong', 'Generous', 'None'],None],
+ ['IntEntry','validCount','Count variable lower limit for valid constraint:',0,None],
+ ['FloatEntry','multiplyDeviation','Multiplication factor to convert deviation in constraint range:',2.0,None]],
+ []]},
diff --git a/sci-chemistry/ccpn/files/xeasy2azara b/sci-chemistry/ccpn/files/xeasy2azara
new file mode 100644
index 000000000000..7b73714c2fa5
--- /dev/null
+++ b/sci-chemistry/ccpn/files/xeasy2azara
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+export CCPNMR_TOP_DIR=gentoo_sitedir
+export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+export TCL_LIBRARY=gentootcl
+export TK_LIBRARY=gentootk
+export PSIPRED_DIR=gentoousr
+gentoopython -O ${CCPNMR_TOP_DIR}/ccpn/python/ccp/format/spectra/params/XeasyData.py $1 $2 $3 $4 $5 $6
diff --git a/sci-chemistry/ccpn/metadata.xml b/sci-chemistry/ccpn/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/ccpn/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/chemical-mime-data/Manifest b/sci-chemistry/chemical-mime-data/Manifest
new file mode 100644
index 000000000000..d8db80c30926
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/Manifest
@@ -0,0 +1 @@
+DIST chemical-mime-data-0.1.94.tar.bz2 146077 SHA256 4907cdf60e9edca0a453f6f24e9179ae9da085b67168e932ba44a4280316bff1 SHA512 7f3d967149f27ab1de53c948dc055959e661e1be9d778e3d56d06bea95769da7770ab5fb66afab6607747ef91ffb1dbbcf921e5f06e3303351781968594b5f00 WHIRLPOOL 2e601b37ca22cc1d2b77b5d82713e756dea380fcb0a01c517513be0271162df6e19e7cc7dbc0af8f25e579bb809e0768cc2ee394124c91c296ed0d4c38cfa213
diff --git a/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r1.ebuild b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r1.ebuild
new file mode 100644
index 000000000000..c63c806baa7c
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils fdo-mime
+
+DESCRIPTION="A collection of data files to add support for chemical MIME types"
+HOMEPAGE="http://chemical-mime.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN/-data/}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="virtual/pkgconfig
+ x11-misc/shared-mime-info
+ dev-util/intltool
+ dev-util/desktop-file-utils
+ dev-libs/libxslt
+ media-gfx/imagemagick[xml]
+ gnome-base/gnome-mime-data"
+
+RDEPEND=""
+
+src_configure() {
+ econf --disable-update-database --htmldir=/usr/share/doc/${PF}/html
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ ewarn "You can ignore any 'Unknown media type in type' warnings."
+}
diff --git a/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r2.ebuild b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r2.ebuild
new file mode 100644
index 000000000000..851bd6b2bec4
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils fdo-mime
+
+DESCRIPTION="A collection of data files to add support for chemical MIME types"
+HOMEPAGE="http://chemical-mime.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN/-data/}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ gnome-base/gnome-mime-data
+ x11-misc/shared-mime-info"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ dev-util/desktop-file-utils
+ dev-libs/libxslt
+ media-gfx/imagemagick[xml]
+ media-gfx/inkscape
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-turbomole.patch
+ "${FILESDIR}"/${P}-pigz.patch
+ "${FILESDIR}"/${P}-namespace-svg.patch
+ )
+
+src_prepare() {
+ # needed for convert/inkscape #464782
+ export XDG_CONFIG_HOME=$HOME/.config
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --disable-update-database
+ --htmldir=/usr/share/doc/${PF}/html
+ )
+ autotools-utils_src_configure
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ ewarn "You can ignore any 'Unknown media type in type' warnings."
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ ewarn "You can ignore any 'Unknown media type in type' warnings."
+}
diff --git a/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94.ebuild b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94.ebuild
new file mode 100644
index 000000000000..c965d2f88027
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/chemical-mime-data-0.1.94.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils fdo-mime
+
+DESCRIPTION="A collection of data files to add support for chemical MIME types"
+HOMEPAGE="http://chemical-mime.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN/-data/}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="virtual/pkgconfig
+ x11-misc/shared-mime-info
+ dev-util/intltool
+ dev-util/desktop-file-utils
+ dev-libs/libxslt
+ media-gfx/imagemagick[xml]
+ gnome-base/gnome-mime-data"
+
+RDEPEND=""
+
+src_configure() {
+ econf --disable-update-database --htmldir=/usr/share/doc/${PN}/html
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ ewarn "You can ignore any 'Unknown media type in type' warnings."
+}
diff --git a/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-namespace-svg.patch b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-namespace-svg.patch
new file mode 100644
index 000000000000..9860261af403
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-namespace-svg.patch
@@ -0,0 +1,16 @@
+ icons/hicolor/gnome-mime-chemical.svg | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/icons/hicolor/gnome-mime-chemical.svg b/icons/hicolor/gnome-mime-chemical.svg
+index 1a8d428..804514c 100644
+--- a/icons/hicolor/gnome-mime-chemical.svg
++++ b/icons/hicolor/gnome-mime-chemical.svg
+@@ -5,7 +5,7 @@
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+ ]>
+-<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
++<svg xmlns:svg="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ width="128" height="128" viewBox="0 0 128 128" overflow="visible" enable-background="new 0 0 128 128" xml:space="preserve">
+ <g id="Layer_1">
+ <g>
diff --git a/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-pigz.patch b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-pigz.patch
new file mode 100644
index 000000000000..8b5ccfbc3fd9
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-pigz.patch
@@ -0,0 +1,16 @@
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 96e03ab..ba0847a 100644
+--- a/icons/hicolor/Makefile.am
++++ b/icons/hicolor/Makefile.am
+@@ -21,7 +21,7 @@ icon_sizes = 16 22 24 32 36 48 64 72 96 128 192
+ if BOOL_HICOLOR_THEME
+
+ .svg.svgz:
+- gzip $< -c > $@
++ gzip -c $< > $@
+ for size in $(icon_sizes) ; do \
+ if test "x$(RSVG)" != "x" ; then \
+ $(RSVG) -w $${size} -h $${size} -f png $< $*_$${size}.png ; \
diff --git a/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-turbomole.patch b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-turbomole.patch
new file mode 100644
index 000000000000..852d6b0605be
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/files/chemical-mime-data-0.1.94-turbomole.patch
@@ -0,0 +1,57 @@
+diff -up chemical-mime-data-0.1.94/src/chemical-mime-database.xml.in.turbomole chemical-mime-data-0.1.94/src/chemical-mime-database.xml.in
+--- chemical-mime-data-0.1.94/src/chemical-mime-database.xml.in.turbomole 2009-08-10 09:37:06.000000000 +0200
++++ chemical-mime-data-0.1.94/src/chemical-mime-database.xml.in 2009-08-10 09:40:57.000000000 +0200
+@@ -1290,7 +1290,7 @@
+ <specification url="http://ca.expasy.org/sprot/userman.html"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-basis" support="no">
++ <mime-type type="chemical/x-turbomole-basis" support="yes">
+ <_comment>Turbomole Basis Set File</_comment>
+ <glob pattern="basis"/>
+ <sub-class-of type="text/plain"/>
+@@ -1304,7 +1304,7 @@
+ <specification url="http://www.cosmologic.de/data/DOK_HTML/"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-control" support="no">
++ <mime-type type="chemical/x-turbomole-control" support="yes">
+ <_comment>Turbomole Control File</_comment>
+ <glob pattern="control"/>
+ <sub-class-of type="text/plain"/>
+@@ -1320,7 +1320,7 @@
+ <specification url="http://www.cosmologic.de/data/DOK_HTML/node230.html"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-coord" support="no">
++ <mime-type type="chemical/x-turbomole-coord" support="yes">
+ <_comment>Turbomole Coordinate File</_comment>
+ <glob pattern="coord"/>
+ <glob pattern="*.tmol"/>
+@@ -1335,7 +1335,7 @@
+ <specification url="http://www.cosmologic.de/data/DOK_HTML/"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-grad" support="no">
++ <mime-type type="chemical/x-turbomole-grad" support="yes">
+ <_comment>Turbomole Gradient File</_comment>
+ <glob pattern="gradient"/>
+ <sub-class-of type="text/plain"/>
+@@ -1383,7 +1383,7 @@
+ <specification url="http://www.cosmologic.de/data/DOK_HTML/"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-scfmo" support="no">
++ <mime-type type="chemical/x-turbomole-scfmo" support="yes">
+ <_comment>Turbomole SCF Molecular Orbital File</_comment>
+ <acronym>MO</acronym>
+ <expanded-acronym>Molecular Orbital</expanded-acronym>
+@@ -1401,7 +1401,7 @@
+ <specification url="http://www.cosmologic.de/data/DOK_HTML/"/>
+ </mime-type>
+
+- <mime-type type="chemical/x-turbomole-vibrational" support="no">
++ <mime-type type="chemical/x-turbomole-vibrational" support="yes">
+ <_comment>Turbomole Vibrational Data File</_comment>
+ <glob pattern="???"/>
+ <sub-class-of type="text/plain"/>
diff --git a/sci-chemistry/chemical-mime-data/metadata.xml b/sci-chemistry/chemical-mime-data/metadata.xml
new file mode 100644
index 000000000000..941ce487e86e
--- /dev/null
+++ b/sci-chemistry/chemical-mime-data/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-chemistry</herd>
+ <maintainer>
+ <email>je_fro@gentoo.org</email>
+ <name>Jeff Gardner</name>
+ </maintainer>
+ <longdescription lang="en">
+A collection of data files to add support for chemical MIME types.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">chemical-mime</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/chemtool/Manifest b/sci-chemistry/chemtool/Manifest
new file mode 100644
index 000000000000..a364d0afdaea
--- /dev/null
+++ b/sci-chemistry/chemtool/Manifest
@@ -0,0 +1,2 @@
+DIST chemtool-1.6.13.tar.gz 838868 SHA256 31a07683f55305c3e0c4d7af3bc3d1d3a9a2eff4d836455fe1e382962f0aa0c8 SHA512 6c248321f73b6eab4ad21e810639a1f0b14cc30db9c9fdc8fe66ee218bd88ead5e74f1f047f5badcb91b515827c2eddc64b28ead380d9b14ab5b76777e7134dd WHIRLPOOL c7158a75480e9b98eb2ed5c16d73c4d5e5fa05375009ac1778b7e9bf0e9a2ef9092032557d46ea506a6503c0799676998a6fcb80063ed56a7ae8d360c1f273bc
+DIST chemtool-1.6.14.tar.gz 817735 SHA256 86161a0461386b334a5ffb17cdf094a491941884678272f45749813514ddafcb SHA512 066c83c61aced3134b081767e788143a047889a2fee4b6535c2b0a3166bccc73d75981e1cf35b7bcaa5b8fe2e0227b28693b659decd82f7783cb4082ac6ed2bd WHIRLPOOL 41a2bd4662c06307a94281e6a54d4e129b407bc597c7d08c8a9f976332cb727f3e195d1d85429716ac22a34ea1dae03b724167bbb5444c03dcb24131cc20ae1d
diff --git a/sci-chemistry/chemtool/chemtool-1.6.13.ebuild b/sci-chemistry/chemtool/chemtool-1.6.13.ebuild
new file mode 100644
index 000000000000..2ab2dc197a0b
--- /dev/null
+++ b/sci-chemistry/chemtool/chemtool-1.6.13.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils eutils
+
+DESCRIPTION="A GTK program for drawing organic molecules"
+HOMEPAGE="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/"
+SRC_URI="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="emf gnome nls"
+
+RDEPEND="
+ dev-libs/glib:2
+ media-gfx/transfig
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/pango
+ emf? ( media-libs/libemf )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-no-underlinking.patch
+ )
+
+src_configure() {
+ local myeconfargs=(
+ --without-kdedir
+ $(use_with gnome gnomedir /usr)
+ $(use_enable emf)
+ --enable-undo
+ --enable-menu
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/${PN}/examples
+ doins "${S}"/examples/*
+ if ! use nls; then rm -rf "${ED}"/usr/share/locale || die; fi
+
+ insinto /usr/share/pixmaps
+ doins chemtool.xpm
+ make_desktop_entry ${PN} Chemtool ${PN} "Education;Science;Chemistry"
+}
diff --git a/sci-chemistry/chemtool/chemtool-1.6.14.ebuild b/sci-chemistry/chemtool/chemtool-1.6.14.ebuild
new file mode 100644
index 000000000000..b77cb79569e4
--- /dev/null
+++ b/sci-chemistry/chemtool/chemtool-1.6.14.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils eutils
+
+DESCRIPTION="A GTK program for drawing organic molecules"
+HOMEPAGE="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/"
+SRC_URI="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="emf gnome nls"
+
+RDEPEND="
+ dev-libs/glib:2
+ media-gfx/transfig
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/pango
+ emf? ( media-libs/libemf )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/1.6.13-no-underlinking.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ --without-kdedir
+ $(use_with gnome gnomedir /usr)
+ $(use_enable emf)
+ --enable-undo
+ --enable-menu
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/${PN}/examples
+ doins "${S}"/examples/*
+ if ! use nls; then rm -rf "${ED}"/usr/share/locale || die; fi
+
+ insinto /usr/share/pixmaps
+ doins chemtool.xpm
+ make_desktop_entry ${PN} Chemtool ${PN} "Education;Science;Chemistry"
+}
diff --git a/sci-chemistry/chemtool/files/1.6.13-no-underlinking.patch b/sci-chemistry/chemtool/files/1.6.13-no-underlinking.patch
new file mode 100644
index 000000000000..5d2fe36d6bf1
--- /dev/null
+++ b/sci-chemistry/chemtool/files/1.6.13-no-underlinking.patch
@@ -0,0 +1,78 @@
+ Makefile.am | 6 ++++--
+ configure.ac | 24 ++++--------------------
+ 2 files changed, 8 insertions(+), 22 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 99dbf8c..931ba16 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -22,10 +22,12 @@ localedir = $(datadir)/locale
+ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+ # Make sure the gettext.h include file is found.
+-AM_CPPFLAGS = -I. -I$(srcdir) @GTK_CFLAGS@
++AM_CPPFLAGS = -I. -I$(srcdir) @GTK_CFLAGS@ @EMFINCL@
+
+ # Link time dependencies.
+-LDADD = @LIBINTL@ @GTK_LIBS@ @EMFLIBS@
++LDADD = @LIBINTL@ @GTK_LIBS@ @EMFLIBS@ -lX11
++
++AM_CFLAGS = -DGTK2
+
+ # Additional files to be distributed.
+ EXTRA_DIST = autogen.sh autoclean.sh
+diff --git a/configure.ac b/configure.ac
+index 6d8c45a..c5fab42 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,32 +32,14 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+ AC_MSG_CHECKING([for GTK version and compile options ])
+
+-if test x$PKG_CONFIG = xno -o x$enable_gtk1 = xyes ; then
+-AM_PATH_GTK(1.0.2, , exit 1)
+-else
+-if $PKG_CONFIG gtk+-2.0 --cflags ; then
+- GTK_CFLAGS="-DGTK2 `$PKG_CONFIG gtk+-2.0 --cflags` "
+- GTK_LIBS=`$PKG_CONFIG gtk+-2.0 --libs`
+-dnl use_gtk2=yes
+- AC_DEFINE([GTK2], [1], [the GTK2 library])
+- enable_stockgtk=yes
+-else
+-if $PKG_CONFIG --cflags gtk+ ; then
+- GTK_CFLAGS=`$PKG_CONFIG gtk+ --cflags`
+- GTK_LIBS=`$PKG_CONFIG gtk+ --libs`
+-dnl use_gtk2=no
+-fi
+-fi
+-fi
+-
+-dnl AC_MSG_RESULT using GTK2 : $use_gtk2
++PKG_CHECK_MODULES([GTK],[gtk+-2.0])
+
+ dnl Checks for header files.
+ AC_PATH_XTRA
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+
+-LDFLAGS="$X_LIBS"
++LDFLAGS+="$X_LIBS"
+ AC_CHECK_LIB([X11],[XOpenDisplay])
+ dnl just an ugly hack to work around the more aggressive header checks
+ dnl in recent autoconf. Not sure if we should really rely on include
+@@ -184,6 +166,7 @@ if test x$enable_emf = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([EMF], [1], [use optional libEMF instead of fig2dev for EMF output])
+ EMFLIBS="-lEMF -lstdc++"
++ EMFINCL="-I${includedir}libEMF"
+ else
+ AC_MSG_RESULT(no)
+ EMFLIBS=""
+@@ -221,6 +204,7 @@ AC_SUBST(localedir)
+ AC_SUBST(kdemimedir)
+ AC_SUBST(gnomemimedir)
+ AC_SUBST(EMFLIBS)
++AC_SUBST(EMFINCL)
+ AC_SUBST(MYGTKSRCS)
+ AC_SUBST(MYGTKOBJS)
+ AC_SUBST(GTK_CFLAGS)
diff --git a/sci-chemistry/chemtool/metadata.xml b/sci-chemistry/chemtool/metadata.xml
new file mode 100644
index 000000000000..26c258873424
--- /dev/null
+++ b/sci-chemistry/chemtool/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-chemistry</herd>
+ <use>
+ <flag name="emf">EMF export support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/clashlist/Manifest b/sci-chemistry/clashlist/Manifest
new file mode 100644
index 000000000000..3c71b7792037
--- /dev/null
+++ b/sci-chemistry/clashlist/Manifest
@@ -0,0 +1 @@
+DIST molprobity-3.17.tgz 26429898 SHA256 2e70814efb4f566a522762a626f69669c09285cbb6fc26444eb947fde9b30f25 SHA512 a6e986f285ff7e8d167e2d1c935a55b080446c9809d352c95e2ffa32265892b59cd1611730e75ca88aa28387495d3ebd84226e1a9cdd33f0b27b1a8a1b6a469f WHIRLPOOL 3981522eeacaa589530e7d268cda786bebeaf676f7fa5c26508798022126bd1a1c8ea193f65e3c5c739fb3b516b26c3cf24ac0e7898e764a9cffab6637dcd5a9
diff --git a/sci-chemistry/clashlist/clashlist-3.17-r1.ebuild b/sci-chemistry/clashlist/clashlist-3.17-r1.ebuild
new file mode 100644
index 000000000000..7aedd7743f6b
--- /dev/null
+++ b/sci-chemistry/clashlist/clashlist-3.17-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Build lists of van der Waals clashes from an input PDB file"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/index.php"
+SRC_URI="mirror://gentoo/molprobity-${PV}.tgz"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="~amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/cluster-1.3.081231-r1
+ sci-chemistry/probe"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ sed \
+ -e 's: cluster : molprobity-cluster :g' \
+ -i molprobity3/bin/clashlist || die
+}
+
+src_install() {
+ dobin molprobity3/bin/clashlist
+}
diff --git a/sci-chemistry/clashlist/clashlist-3.17.ebuild b/sci-chemistry/clashlist/clashlist-3.17.ebuild
new file mode 100644
index 000000000000..513a1e024746
--- /dev/null
+++ b/sci-chemistry/clashlist/clashlist-3.17.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Build lists of van der Waals clashes from an input PDB file"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/index.php"
+SRC_URI="mirror://gentoo/molprobity-${PV}.tgz"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ <=sci-chemistry/cluster-1.3.081231
+ sci-chemistry/probe"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_install() {
+ dobin molprobity3/bin/clashlist
+}
diff --git a/sci-chemistry/clashlist/metadata.xml b/sci-chemistry/clashlist/metadata.xml
new file mode 100644
index 000000000000..c96b852229d5
--- /dev/null
+++ b/sci-chemistry/clashlist/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Clashlist is a simple UNIX script which uses the awk facility along with
+the programs Probe and Cluster to build lists of van der Waals clashes
+from an input PDB-format molecular data file (with H atoms). These lists
+are organized such that collections of interacting residues are grouped
+together, sorted by the worst clash. For the purposes of this analysis,
+a clash is defined as a van der Waals overlap &gt;= 0.4 A.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/cluster/Manifest b/sci-chemistry/cluster/Manifest
new file mode 100644
index 000000000000..1a7bcd779934
--- /dev/null
+++ b/sci-chemistry/cluster/Manifest
@@ -0,0 +1 @@
+DIST cluster.1.3.081231.src.tgz 8860 SHA256 4e0986d5ff124936b5fff4b6f8989dd04be11180d6552fddc34b2c10dfcc870f SHA512 af5851ef467458d45ee5f2309c6344ae16145ac371a1b9d0a3d8b5769a18b98877cf7cb65b85f71108d927b0e6c363e06b85a67e7cb2e5e0b41af375cb2db7ac WHIRLPOOL 2f02de20b323792360b28d5a42d233d06be529414e29796a39a439651fee9e8ba73bdd05033907ac7434890bfa2a31aaf57ab98bbe59964d06a2d63646833f5f
diff --git a/sci-chemistry/cluster/cluster-1.3.081231-r1.ebuild b/sci-chemistry/cluster/cluster-1.3.081231-r1.ebuild
new file mode 100644
index 000000000000..801d4209627a
--- /dev/null
+++ b/sci-chemistry/cluster/cluster-1.3.081231-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Build lists of collections of interacting items"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/index.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/${PN}/${PN}.${PV}.src.tgz"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+S="${WORKDIR}"/${PN}1.3src
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-ldflags.patch \
+ "${FILESDIR}"/${PV}-includes.patch
+ tc-export CXX
+}
+
+src_install() {
+ newbin ${PN} molprobity-${PN}
+ dodoc README.cluster
+}
diff --git a/sci-chemistry/cluster/cluster-1.3.081231.ebuild b/sci-chemistry/cluster/cluster-1.3.081231.ebuild
new file mode 100644
index 000000000000..abb875d7f2d0
--- /dev/null
+++ b/sci-chemistry/cluster/cluster-1.3.081231.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Build lists of collections of interacting items"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/index.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/${PN}/${PN}.${PV}.src.tgz"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+S="${WORKDIR}"/${PN}1.3src
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-ldflags.patch \
+ "${FILESDIR}"/${PV}-includes.patch
+ tc-export CXX
+}
+
+src_install() {
+ dobin ${PN}
+ dodoc README.cluster
+}
diff --git a/sci-chemistry/cluster/files/1.3.081231-includes.patch b/sci-chemistry/cluster/files/1.3.081231-includes.patch
new file mode 100644
index 000000000000..a5586a540a4f
--- /dev/null
+++ b/sci-chemistry/cluster/files/1.3.081231-includes.patch
@@ -0,0 +1,12 @@
+diff --git a/cluster.cpp b/cluster.cpp
+index 0a8c3c1..1384949 100644
+--- a/cluster.cpp
++++ b/cluster.cpp
+@@ -24,6 +24,7 @@
+ #include <iostream>
+ #include <vector>
+ #include <string>
++#include <cstring>
+
+ #include <iostream>
+ #include <fstream>
diff --git a/sci-chemistry/cluster/files/1.3.081231-ldflags.patch b/sci-chemistry/cluster/files/1.3.081231-ldflags.patch
new file mode 100644
index 000000000000..1b99f6d662f2
--- /dev/null
+++ b/sci-chemistry/cluster/files/1.3.081231-ldflags.patch
@@ -0,0 +1,41 @@
+ Makefile | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7892054..929564b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,27 +3,27 @@ PROG_FLGS = -D BOOLPREDEFINED
+
+ SRCS = cluster.cpp DisjointSets.cpp utility.cpp
+
+-CFLAGS = $(OPT) $(DEBUG) $(PROG_FLGS)
++CXXFLAGS += $(OPT) $(DEBUG) $(PROG_FLGS)
+
+ LFLAGS =
+
+ OBJLIST = cluster.o DisjointSets.o utility.o
+
+-CXX = g++
++CXX ?= g++
+
+ .cpp.o:
+- $(CXX) -c $*.cpp $(CFLAGS)
++ $(CXX) $(CXXFLAGS) -c $*.cpp
+
+-OPT = -O3
++OPT =
+ DEBUG = $(CXXDEBUGFLAGS)
+
+ all: cluster
+
+ cluster: $(OBJLIST)
+- $(CXX) -o $@ $(OBJLIST) $(LFLAGS)
++ $(CXX) $(LDFLAGS) -o $@ $(OBJLIST)
+
+ depend:
+- makedepend -- $(CFLAGS) -- $(SRCS)
++ makedepend -- $(CXXFLAGS) -- $(SRCS)
+
+ clean:
+ @rm -rf *.o *.ckp ii_files
diff --git a/sci-chemistry/cluster/metadata.xml b/sci-chemistry/cluster/metadata.xml
new file mode 100644
index 000000000000..76f6a5d9e463
--- /dev/null
+++ b/sci-chemistry/cluster/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Cluster is a simple UNIX C++ program to build lists of collections
+of interacting items from records containing interacting pairs
+and larger fragments.
+
+It reads in lines consisting of two or more names and output
+connected clusters of names. Each line of output is
+prefixed with a cluster number, the size of the cluster
+and an optional name string.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/cns/Manifest b/sci-chemistry/cns/Manifest
new file mode 100644
index 000000000000..d0d2b7b0dc55
--- /dev/null
+++ b/sci-chemistry/cns/Manifest
@@ -0,0 +1,4 @@
+DIST aria2.3.1.tar.gz 1833973 SHA256 cc45ed2d66182cf0ee197a7cf3bc7edd8d5043d95cdcd19e1cec9aeb82c2fdbc SHA512 79a2cd89e2120acecb04f286a153dbf52c16500e8956c9dad49b1e1ed94a7b2449c7b044bae6f87e0d2b452a1467a2c02de74f0fa85b0eae66042386e2f5e2d5 WHIRLPOOL 2ff003322601b42bec0d2431e2f1f85819b3982f8da612ff778bb404e51f0fcbca3faa6998e9c0635f9e73899609bb1e273420cac182952aa744364c20299723
+DIST aria2.3.2.tar.gz 1836270 SHA256 30727ea8bdc2e3b44e5970545008fcfa07fa59aa28b76824956a2aa71daa9615 SHA512 009a1d0079f5cc162dc732749ddd2b33297268f0d988b2f37bda4ed50c7764ceef7ae5b56b322c7ac79427a4a2a92d1239199891445cb5e2b3d0908ed670e2aa WHIRLPOOL f18af5b751e79c92e04f4dc12b6b806a1c505b269559a2342bdd6280b790f9f0df9bb4afe366af03beaf09af0128c6b68c39bc66603d51ad24914c78b2579cf3
+DIST cns_solve_1.21_all-mp.tar.gz 32748040 SHA256 7ab464e20932eb024ba6378738da77a4a03642d63b0ca9772b612a7cf27baec1 SHA512 383324d771570b501e388fba9bf20789f483a3a4044eb3334c7a7e7835e0c345b784e0d344b22d20a10fe1c33ed21c9013adb1af5912808af480b96abe275857 WHIRLPOOL fecd0b2dfba43e5525a9fcc8543a55867602b376744848ddafd4c132bcdfc32225780f543742fa225b5e0f0ce658c1029a9ca8b80d5ee3f2491b6d63e8ad91b0
+DIST cns_solve_1.3_all.tar.gz 64167735 SHA256 2ee368022c5ecabf66ce7d32059d93cd7d885ad2d684a094b87c64f6b3dfea0d SHA512 4fe73820e96999bb33a59ff6da979794628552f49bc03cdebcb9439b57e6042b92190e04bb7e4079157adf06a6facc5c16b8ae91621bd24a4b35ee382e53ae37 WHIRLPOOL b3cd14ab7a8a29a44f6e6c3cbc22ee2c665eb8c8565969337b24deffb2a1fd007fae11c5eb73ac38ddf9a38e850948e3b2df2548931722a2a383d5e8c72607a1
diff --git a/sci-chemistry/cns/cns-1.2.1-r8.ebuild b/sci-chemistry/cns/cns-1.2.1-r8.ebuild
new file mode 100644
index 000000000000..d9cc723f98b3
--- /dev/null
+++ b/sci-chemistry/cns/cns-1.2.1-r8.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 toolchain-funcs versionator flag-o-matic
+
+MY_PN="${PN}_solve"
+MY_PV="$(delete_version_separator 2)"
+MY_P="${MY_PN}_${MY_PV}"
+
+DESCRIPTION="Crystallography and NMR System"
+HOMEPAGE="http://cns.csb.yale.edu/"
+SRC_URI="
+ ${MY_P}_all-mp.tar.gz
+ aria? ( aria2.3.2.tar.gz )"
+
+SLOT="0"
+LICENSE="cns"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="aria openmp"
+
+RDEPEND="app-shells/tcsh"
+DEPEND="${RDEPEND}"
+
+FORTRAN_NEED_OPENMP=1
+
+S="${WORKDIR}/${MY_P}"
+
+RESTRICT="fetch test"
+
+pkg_nofetch() {
+ elog "Fill out the form at http://cns.csb.yale.edu/cns_request/"
+ use aria && elog "and http://aria.pasteur.fr/"
+ elog "and place these files:"
+ elog ${A}
+ elog "in ${DISTDIR}."
+}
+
+get_fcomp() {
+ case $(tc-getFC) in
+ *gfortran* )
+ FCOMP="gfortran" ;;
+ ifort )
+ FCOMP="ifc" ;;
+ * )
+ FCOMP=$(tc-getFC) ;;
+ esac
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ get_fcomp
+}
+
+get_bitness() {
+ echo > "${T}"/test.c
+ $(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o
+ case $(file "${T}"/test.o) in
+ *64-bit*|*ppc64*|*x86_64*) export _bitness="64";;
+ *32-bit*|*ppc*|*i386*) export _bitness="32";;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-gentoo.patch \
+ "${FILESDIR}"/${PV}-parallel.patch
+
+ get_bitness
+
+ if use aria; then
+ pushd "${WORKDIR}"/aria* >& /dev/null
+ # Update the cns sources in aria for version 1.2.1
+ epatch "${FILESDIR}"/1.2.1-aria2.3.patch
+
+ # Update the code with aria specific things
+ cp -rf cns/src/* "${S}"/source/ || die
+ popd >& /dev/null
+ fi
+
+ # the code uses Intel-compiler-specific directives
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ epatch "${FILESDIR}"/${PV}-allow-gcc-openmp.patch
+ use openmp && \
+ append-flags -fopenmp && append-ldflags -fopenmp
+ COMP="gfortran"
+ [[ ${_bitness} == 64 ]] && \
+ append-fflags -fdefault-integer-8
+ elif [[ $(tc-getFC) == if* ]]; then
+ epatch "${FILESDIR}"/${PV}-ifort.patch
+ use openmp && \
+ append-flags -openmp && append-ldflags -openmp
+ COMP="ifort"
+ [[ ${_bitness} == 64 ]] && append-fflags -i8
+ fi
+
+ [[ ${_bitness} == 64 ]] && \
+ append-cflags "-DINTEGER='long long int'"
+
+ # Set up location for the build directory
+ # Uses obsolete `sort` syntax, so we set _POSIX2_VERSION
+ cp "${FILESDIR}"/cns_solve_env_sh "${T}"/ || die
+ sed \
+ -e "s:_CNSsolve_location_:${S}:g" \
+ -e "17 s:\(.*\):\1\nsetenv _POSIX2_VERSION 199209:g" \
+ -i "${S}"/cns_solve_env || die
+ sed \
+ -e "s:_CNSsolve_location_:${S}:g" \
+ -e "17 s:\(.*\):\1\nexport _POSIX2_VERSION; _POSIX2_VERSION=199209:g" \
+ -i "${T}"/cns_solve_env_sh || die
+
+ einfo "Fixing shebangs..."
+ find "${S}" -type f \
+ -exec sed "s:/bin/csh:${EPREFIX}/bin/csh:g" -i '{}' + || die
+}
+
+src_compile() {
+ local GLOBALS
+ local MALIGN
+ if [[ $(tc-getFC) =~ g77 ]]; then
+ GLOBALS="-fno-globals"
+ MALIGN='\$(CNS_MALIGN_I86)'
+ fi
+
+ # Set up the compiler to use
+ ln -s Makefile.header instlib/machine/unsupported/g77-unix/Makefile.header.${FCOMP} || die
+
+ # make install really means build, since it's expected to be used in-place
+ # -j1 doesn't mean we do no respect MAKEOPTS!
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ F77=$(tc-getFC) \
+ LD=$(tc-getFC) \
+ CCFLAGS="${CFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \
+ LDFLAGS="${LDFLAGS}" \
+ F77OPT="${FCFLAGS} ${MALIGN}" \
+ F77STD="${GLOBALS}" \
+ OMPLIB="${OMPLIB}" \
+ compiler="${COMP}" \
+ install
+}
+
+src_test() {
+ # We need to force on g77 manually, because we can't get aliases working
+ # when we source in a -c
+ einfo "Running tests ..."
+ csh -c \
+ "export CNS_G77=ON; source ${S}/cns_solve_env; make run_tests" \
+ || die "tests failed"
+ einfo "Displaying test results ..."
+ cat "${S}"/*_g77/test/*.diff-test
+}
+
+src_install() {
+ # Install to locations resembling FHS
+ sed \
+ -e "s:${S}:usr:g" \
+ -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_ROOT ${EPREFIX}/usr:g" \
+ -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DATA \$CNS_ROOT/share/cns:g" \
+ -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DOC \$CNS_ROOT/share/doc/${PF}:g" \
+ -e "s:CNS_LIB \$CNS_SOLVE/libraries:CNS_LIB \$CNS_DATA/libraries:g" \
+ -e "s:CNS_MODULE \$CNS_SOLVE/modules:CNS_MODULE \$CNS_DATA/modules:g" \
+ -e "s:CNS_HELPLIB \$CNS_SOLVE/helplib:CNS_HELPLIB \$CNS_DATA/helplib:g" \
+ -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \
+ -e "/^g77on/d" \
+ -i "${S}"/cns_solve_env || die
+ # I don't entirely understand why the sh version requires a leading /
+ # for CNS_SOLVE and CNS_ROOT, but it does
+ sed \
+ -e "s:${S}:/usr:g" \
+ -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_ROOT=${EPREFIX}/usr:g" \
+ -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DATA=\$CNS_ROOT/share/cns:g" \
+ -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DOC=\$CNS_ROOT/share/doc/${PF}:g" \
+ -e "s:CNS_LIB=\$CNS_SOLVE/libraries:CNS_LIB=\$CNS_DATA/libraries:g" \
+ -e "s:CNS_MODULE=\$CNS_SOLVE/modules:CNS_MODULE=\$CNS_DATA/modules:g" \
+ -e "s:CNS_HELPLIB=\$CNS_SOLVE/helplib:CNS_HELPLIB=\$CNS_DATA/helplib:g" \
+ -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \
+ -e "/^g77on/d" \
+ -e "/^g77off/d" \
+ -i "${T}"/cns_solve_env_sh || die
+
+ # Get rid of setup stuff we don't need in the installed script
+ sed \
+ -e "83,$ d" \
+ -e "37,46 d" \
+ -i "${S}"/cns_solve_env || die
+ sed \
+ -e "84,$ d" \
+ -e "39,50 d" \
+ -i "${T}"/cns_solve_env_sh || die
+
+ newbin "${S}"/*linux*/bin/cns_solve* cns_solve
+
+ # Can be run by either cns_solve or cns
+ dosym cns_solve /usr/bin/cns
+
+ # Don't want to install this
+ rm -f "${S}"/*linux*/utils/Makefile || die
+
+ dobin "${S}"/*linux*/utils/*
+
+ sed \
+ -e "s:\$CNS_SOLVE/doc/:\$CNS_SOLVE/share/doc/${PF}/:g" \
+ -i "${S}"/bin/cns_web || die
+
+ dobin "${S}"/bin/cns_{edit,header,transfer,web}
+
+ insinto /usr/share/cns
+ doins -r "${S}"/libraries "${S}"/modules "${S}"/helplib
+ doins "${S}"/bin/cns_info
+
+ insinto /etc/profile.d
+ newins "${S}"/cns_solve_env cns_solve_env.csh
+ newins "${T}"/cns_solve_env_sh cns_solve_env.sh
+
+ dohtml \
+ -A iq,cgi,csh,cv,def,fm,gif,hkl,inp,jpeg,lib,link,list,mask,mtf,param,pdb,pdf,pl,ps,sc,sca,sdb,seq,tbl,top \
+ -f all_cns_info_template,omac,def \
+ -r doc/html/*
+ # Conflits with app-text/dos2unix
+ rm -f "${D}"/usr/bin/dos2unix || die
+}
+
+pkg_postinst() {
+ if use openmp; then
+ elog "Set OMP_NUM_THREADS to the number of threads you want."
+ elog "If you get segfaults on large structures, set the GOMP_STACKSIZE"
+ elog "variable if using gcc (16384 should be good)."
+ fi
+}
diff --git a/sci-chemistry/cns/cns-1.3_p7-r1.ebuild b/sci-chemistry/cns/cns-1.3_p7-r1.ebuild
new file mode 100644
index 000000000000..724c62f7e98c
--- /dev/null
+++ b/sci-chemistry/cns/cns-1.3_p7-r1.ebuild
@@ -0,0 +1,216 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 toolchain-funcs versionator flag-o-matic
+
+MY_PN="${PN}_solve"
+MY_PV="$(delete_version_separator 2)"
+MY_P="${MY_PN}_${MY_PV}"
+
+DESCRIPTION="Crystallography and NMR System"
+HOMEPAGE="http://cns.csb.yale.edu/"
+SRC_URI="
+ ${MY_P/p7}_all.tar.gz
+ aria? ( aria2.3.1.tar.gz )"
+
+SLOT="0"
+LICENSE="cns"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="aria openmp"
+
+RDEPEND="app-shells/tcsh"
+DEPEND="${RDEPEND}"
+
+FORTRAN_NEED_OPENMP=1
+
+S="${WORKDIR}/${MY_P/p7}"
+
+RESTRICT="fetch"
+
+pkg_nofetch() {
+ elog "Fill out the form at http://cns.csb.yale.edu/cns_request/"
+ use aria && elog "and http://aria.pasteur.fr/"
+ elog "and place these files:"
+ elog ${A}
+ elog "in ${DISTDIR}."
+}
+
+get_fcomp() {
+ case $(tc-getFC) in
+ *gfortran* )
+ FCOMP="gfortran" ;;
+ ifort )
+ FCOMP="ifc" ;;
+ * )
+ FCOMP=$(tc-getFC) ;;
+ esac
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ get_fcomp
+}
+
+get_bitness() {
+ echo > "${T}"/test.c
+ $(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o
+ case $(file "${T}"/test.o) in
+ *64-bit*|*ppc64*|*x86_64*) export _bitness="64";;
+ *32-bit*|*ppc*|*i386*) export _bitness="32";;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-gentoo.patch \
+ "${FILESDIR}"/${PV}-delete.patch
+
+ get_bitness
+
+ if use aria; then
+ pushd "${WORKDIR}"/aria* >& /dev/null
+ # Update the cns sources in aria for version 1.2.1
+ epatch "${FILESDIR}"/1.2.1-aria2.3.patch
+
+ # Update the code with aria specific things
+ cp -rf cns/src/* "${S}"/source/ || die
+ popd >& /dev/null
+ fi
+
+ # the code uses Intel-compiler-specific directives
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ use openmp && \
+ append-flags -fopenmp && append-ldflags -fopenmp
+ COMP="gfortran"
+ [[ ${_bitness} == 64 ]] && \
+ append-fflags -fdefault-integer-8
+ elif [[ $(tc-getFC) == if* ]]; then
+ use openmp && \
+ append-flags -openmp && append-ldflags -openmp
+ COMP="ifort"
+ [[ ${_bitness} == 64 ]] && append-fflags -i8
+ fi
+
+ [[ ${_bitness} == 64 ]] && \
+ append-cflags "-DINTEGER='long long int'"
+
+ # Set up location for the build directory
+ # Uses obsolete `sort` syntax, so we set _POSIX2_VERSION
+ cp "${FILESDIR}"/cns_solve_env_sh-${PV} "${T}"/cns_solve_env_sh || die
+ sed \
+ -e "s:_CNSsolve_location_:${S}:g" \
+ -e "17 s:\(.*\):\1\nsetenv _POSIX2_VERSION 199209:g" \
+ -i "${S}"/cns_solve_env || die
+ sed \
+ -e "s:_CNSsolve_location_:${S}:g" \
+ -e "17 s:\(.*\):\1\nexport _POSIX2_VERSION; _POSIX2_VERSION=199209:g" \
+ -e "s:setenv OMP_STACKSIZE 256m:export OMP_STACKSIZE=256m:g" \
+ -e "s:^limit:^ulimit:g" \
+ -i "${T}"/cns_solve_env_sh || die
+
+ ebegin "Fixing shebangs..."
+ find "${S}" -type f \
+ -exec sed "s:/bin/csh:${EPREFIX}/bin/csh:g" -i '{}' + || die
+ find . -name "Makefile*" \
+ -exec \
+ sed \
+ -e "s:^SHELL=/bin/sh:SHELL=${EPREFIX}/bin/sh:g" \
+ -e "s:/bin/ls:ls:g" \
+ -e "s:/bin/rm:rm:g" \
+ -i '{}' + || die
+ eend
+}
+
+src_compile() {
+ local GLOBALS
+ local MALIGN
+
+ # Set up the compiler to use
+ ln -s Makefile.header instlib/machine/unsupported/g77-unix/Makefile.header.${FCOMP} || die
+
+ # make install really means build, since it's expected to be used in-place
+ # -j1 doesn't mean we do no respect MAKEOPTS!
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ F77=$(tc-getFC) \
+ LD=$(tc-getFC) \
+ CCFLAGS="${CFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \
+ CXXFLAGS="${CXXFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \
+ LDFLAGS="${LDFLAGS}" \
+ F77OPT="${FCFLAGS} ${MALIGN}" \
+ F77STD="${GLOBALS}" \
+ OMPLIB="${OMPLIB}" \
+ compiler="${COMP}" \
+ install
+}
+
+src_test() {
+ # We need to force on g77 manually, because we can't get aliases working
+ # when we source in a -c
+ einfo "Running tests ..."
+ sh -c \
+ "export CNS_G77=ON; source ${T}/cns_solve_env_sh; make run_tests" \
+ || die "tests failed"
+ einfo "Displaying test results ..."
+ cat "${S}"/*_g77/test/*.diff-test
+}
+
+src_install() {
+ cat >> "${T}"/66cns <<- EOF
+ CNS_SOLVE="${EPREFIX}/usr"
+ CNS_ROOT="${EPREFIX}/usr"
+ CNS_DATA="${EPREFIX}/usr/share/cns"
+ CNS_DOC="${EPREFIX}/usr/share/doc/cns-1.3"
+ CNS_LIB="${EPREFIX}/usr/share/cns/libraries"
+ CNS_MODULE="${EPREFIX}/usr/share/cns/modules"
+ CNS_TOPPAR="${EPREFIX}/usr/share/cns/libraries/toppar"
+ CNS_CONFDB="${EPREFIX}/usr/share/cns/libraries/confdb"
+ CNS_XTALLIB="${EPREFIX}/usr/share/cns/libraries/xtal"
+ CNS_NMRLIB="${EPREFIX}/usr/share/cns/libraries/nmr"
+ CNS_XRAYLIB="${EPREFIX}/usr/share/cns/libraries/xray"
+ CNS_XTALMODULE="${EPREFIX}/usr/share/cns/modules/xtal"
+ CNS_NMRMODULE="${EPREFIX}/usr/share/cns/modules/nmr"
+ CNS_HELPLIB="${EPREFIX}/usr/share/cns/helplib"
+ EOF
+
+ doenvd "${T}"/66cns || die
+
+ # Don't want to install this
+ rm -f "${S}"/*linux*/utils/Makefile || die
+
+ sed \
+ -e "s:\$CNS_SOLVE/doc/:\$CNS_SOLVE/share/doc/${PF}/:g" \
+ -i "${S}"/bin/cns_web || die
+
+ newbin "${S}"/*linux*/bin/cns_solve* cns_solve
+
+ # Can be run by either cns_solve or cns
+ dosym cns_solve /usr/bin/cns
+
+ dobin \
+ "${S}"/*linux*/utils/* \
+ "${S}"/bin/cns_{edit,header,import_cif,transfer,web}
+
+ insinto /usr/share/cns
+ doins -r "${S}"/libraries "${S}"/modules "${S}"/helplib "${S}"/bin/cns_info
+
+ dohtml \
+ -A iq,cgi,csh,cv,def,fm,gif,hkl,inp,jpeg,lib,link,list,mask,mtf,param,pdb,pdf,pl,ps,sc,sca,sdb,seq,tbl,top \
+ -f all_cns_info_template,omac,def \
+ -r doc/html/*
+ # Conflits with app-text/dos2unix
+ rm -f "${D}"/usr/bin/dos2unix || die
+}
+
+pkg_postinst() {
+ if use openmp; then
+ elog "Set OMP_NUM_THREADS to the number of threads you want."
+ elog "If you get segfaults on large structures, set the GOMP_STACKSIZE"
+ elog "variable if using gcc (16384 should be good)."
+ fi
+}
diff --git a/sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch b/sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch
new file mode 100644
index 000000000000..42b9b0572231
--- /dev/null
+++ b/sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch
@@ -0,0 +1,20 @@
+--- source/xfft.f.orig 2008-08-03 00:36:52.000000000 -0700
++++ source/xfft.f 2008-08-03 00:37:06.000000000 -0700
+@@ -514,7 +514,7 @@
+ LOGICAL QHERM
+ DOUBLE PRECISION XRCELL(9), MAPR
+ C local
+-!$ integer omp_get_max_threads, kmp_get_stacksize
++!$ integer omp_get_max_threads
+ LOGICAL DONE
+ DOUBLE PRECISION ZERO
+ PARAMETER (ZERO=0.0D0)
+@@ -537,7 +537,7 @@
+ NBPP=1
+ ! The following command is only relevant for the ifort compiler (if -openmp option is used).
+ ! If your compiler is not ifort, and gives an error, just comment the next line out:
+-!$ if (kmp_get_stacksize().lt.2**23) call kmp_set_stacksize(2**23)
++! if (kmp_get_stacksize().lt.2**23) call kmp_set_stacksize(2**23)
+ ! Explanation: the default KMP_STACKSIZE of ifort is 2**21 bytes (2Mb) for 32bit,
+ ! and 2**22 bytes (4Mb) for 64bit.
+ ! This may be low for big structures, which leads to segmentation faults!
diff --git a/sci-chemistry/cns/files/1.2.1-aria2.3.patch b/sci-chemistry/cns/files/1.2.1-aria2.3.patch
new file mode 100644
index 000000000000..8c6939d8eb92
--- /dev/null
+++ b/sci-chemistry/cns/files/1.2.1-aria2.3.patch
@@ -0,0 +1,22 @@
+diff --git a/cns/src/cns.f b/cns/src/cns.f
+index a3c2cbe..51a34f8 100644
+--- a/cns/src/cns.f
++++ b/cns/src/cns.f
+@@ -470,6 +470,7 @@ C local
+ INTEGER HNLEN, TMP, PTRSZ, STLEN
+ CHARACTER*(1) CNSPTMP
+ CHARACTER*(4) ST
++!$ integer omp_get_max_threads
+ C
+ C write header
+ WRITE(6,'(10X,A)')
+@@ -526,6 +527,9 @@ C
+ WRITE(6,'(10X,7A)')
+ & ' Running on machine: ',HOSTNM(1:HNLEN),
+ & ' (',SYSNM(1:TMP),',',ST(1:STLEN),'-bit)'
++!$ write(6,'(31x,a,i3,a)') 'with',omp_get_max_threads(),
++!$ & ' threads'
++!$C (to change use setenv OMP_NUM_THREADS x)
+ C
+ CALL GETNAM(USERNM,12,TMP)
+ WRITE(6,'(10X,2A)')
diff --git a/sci-chemistry/cns/files/1.2.1-gentoo.patch b/sci-chemistry/cns/files/1.2.1-gentoo.patch
new file mode 100644
index 000000000000..2b47bfcc7d86
--- /dev/null
+++ b/sci-chemistry/cns/files/1.2.1-gentoo.patch
@@ -0,0 +1,63 @@
+--- cns_solve_1.21/instlib/source/Makefile.proto 2000-09-07 20:35:33.000000000 +0200
++++ cns_solve_1.21/instlib/source/Makefile.proto.new 2009-07-14 09:18:37.000000000 +0200
+@@ -11,6 +11,8 @@
+
+ SHELL=/bin/sh
+
++cns_string=`date "+%y%m%d%H%M"`
++
+ # commands
+ RM = /bin/rm
+
+@@ -25,26 +27,20 @@
+
+ # rule for the fortran routines
+ $(OBJS):
+- @ echo "compiling: $(@:.o=.f)"; \
+- $(F77) -c $(F77FLAGS) $(@:.o=.f)
++ $(F77) -c $(F77FLAGS) $(@:.o=.f)
+
+ # rule for the dynamic memory allocation C routines
+ dmemory.o: dmemory.c
+- @ echo ; echo "compiling: $?"
+- @ $(CC) -c $(CCFLAGS) $?
++ $(CC) -c $(CCFLAGS) $?
+
+ # rule for the machine specific C routines
+ machine_c.o: machine_c.c
+- @ echo ; echo "compiling: $?"
+- @ $(CC) -c $(CCFLAGS) $?
++ $(CC) -c $(CCFLAGS) $?
+
+ # rule for the executable itself
+ ../bin/cns_solve: $(DEPENDS)
+- @ echo ; echo "linking: cns_solve"; echo
+- @ cns_string=`date "+%y%m%d%H%M"`; \
+- $(LD) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \
+- $(LDFLAGS) \
+- $(CNS_FFTDIR) $(CNS_FFTLIB); \
++ $(LD) $(LDFLAGS) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \
++ $(CNS_FFTDIR) $(CNS_FFTLIB); \
+ if [ -x cns_solve-$$cns_string.exe ]; \
+ then echo "created executable file cns_solve-$$cns_string.exe"; \
+ echo ""; cd ../bin; $(RM) -f cns_solve; $(RM) -f cns; \
+--- cns_solve_1.21/instlib/utils/Makefile 2004-08-30 00:40:35.000000000 +0200
++++ cns_solve_1.21/instlib/utils/Makefile.new 2009-07-14 09:50:27.000000000 +0200
+@@ -22,14 +22,14 @@
+ make clean
+
+ .f:
+- $(F77) -o $@ $(F77FLAGS) $(@).f $(F77LINK)
++ $(F77) $(LDFLAGS) -o $@ $(F77FLAGS) $(@).f $(F77LINK)
+
+ .c:
+- $(CC) -o $@ $(CCFLAGS) $(@).c $(CCLINK)
++ $(CC) $(LDFLAGS) -o $@ $(CCFLAGS) $(@).c $(CCLINK)
+
+ .l:
+ lex $(@).l
+- $(CC) $(CCFLAGS) -o $@ lex.yy.c $(CCLINK) -l$(LEXLIB)
++ $(CC) $(LDFLAGS) $(CCFLAGS) -o $@ lex.yy.c $(CCLINK) -l$(LEXLIB)
+
+ relink:
+ @ cd $(CNS_INST)/utils; touch x; rm -f x `ls * | grep -v Makefile`
diff --git a/sci-chemistry/cns/files/1.2.1-ifort.patch b/sci-chemistry/cns/files/1.2.1-ifort.patch
new file mode 100644
index 000000000000..ba44bebd1b68
--- /dev/null
+++ b/sci-chemistry/cns/files/1.2.1-ifort.patch
@@ -0,0 +1,126 @@
+diff --git a/source/angledb.f b/source/angledb.f
+index 28ad657..eaa847d 100644
+--- a/source/angledb.f
++++ b/source/angledb.f
+@@ -1416,10 +1416,10 @@ C include files
+ C local variables
+ INTEGER COUNT, SPTR, OLDCLASS, OLDMAXANGLEDBS
+ INTEGER THETYPE, CURPSIS, CURPHIS
+- INTEGER CLASSINDEX
++ INTEGER CLASINDEX
+ DOUBLE PRECISION K1, CUTOFF
+ CHARACTER*4 THENAME
+- CHARACTER*20 CLASSNAME
++ CHARACTER*20 CLASNAME
+ C begin
+ C
+ IF (ANGLEDBFLAG) THEN
+@@ -1450,10 +1450,10 @@ C
+ ELSE IF (WD(1:4).EQ.'CLAS') THEN
+ OLDCLASS = CURANGLEDBCLASS
+ CALL NEXTWD('class name =')
+- CLASSNAME = WD(1:20)
++ CLASNAME = WD(1:20)
+ ANGLEDBMODE = NEW
+ DO COUNT = 1, NANGLEDBCLASSES
+- IF (ANGDBCLASSNAMES(COUNT).EQ.CLASSNAME) THEN
++ IF (ANGDBCLASSNAMES(COUNT).EQ.CLASNAME) THEN
+ ANGLEDBMODE = UPDATE
+ CURANGLEDBCLASS = COUNT
+ END IF
+@@ -1472,7 +1472,7 @@ C
+ END IF
+ NANGLEDBCLASSES = NANGLEDBCLASSES + 1
+ CURANGLEDBCLASS = NANGLEDBCLASSES
+- ANGDBCLASSNAMES(CURANGLEDBCLASS) = CLASSNAME
++ ANGDBCLASSNAMES(CURANGLEDBCLASS) = CLASNAME
+ ANGLEDBASSNDX(CURANGLEDBCLASS) = NANGLEDBS
+ END IF
+ C
+@@ -1733,16 +1733,16 @@ C
+ & HEAP(ANGLEDBTPTR))
+ ELSE IF (WD(1:4).EQ.'CLAS') THEN
+ CALL NEXTWD('Class name>')
+- CLASSNAME = WD(1:20)
+- CLASSINDEX = 0
++ CLASNAME = WD(1:20)
++ CLASINDEX = 0
+ DO COUNT = 1, NANGLEDBCLASSES
+ IF (ANGDBCLASSNAMES(COUNT).EQ.
+- & CLASSNAME) THEN
++ & CLASNAME) THEN
+ PRINTTHISCLASS(COUNT) = .TRUE.
+- CLASSINDEX = COUNT
++ CLASINDEX = COUNT
+ END IF
+ END DO
+- IF (CLASSINDEX.EQ.0) THEN
++ IF (CLASINDEX.EQ.0) THEN
+ CALL DSPERR('ANGLEDB',
+ & 'unknown class. Using first.')
+ PRINTTHISCLASS(1) = .TRUE.
+diff --git a/source/rama.f b/source/rama.f
+index c5d14f2..3063e7b 100644
+--- a/source/rama.f
++++ b/source/rama.f
+@@ -1468,11 +1468,11 @@ C include files
+ C local variables
+ INTEGER COUNT, SPTR, OLDCLASS, OLDMAXRAMAS,
+ & THETYPE, CURPSIS, CURPHIS,
+- & CURCHIS, CURTHTS, CLASSINDEX
++ & CURCHIS, CURTHTS, CLASINDEX
+ INTEGER CLEN
+ DOUBLE PRECISION K1, CUTOFF
+ CHARACTER*4 THENAME
+- CHARACTER*50 CLASSNAME
++ CHARACTER*50 CLASNAME
+ C begin
+ C
+ C this is used by READRAMA2 to hold the selection
+@@ -1503,10 +1503,10 @@ C
+ ELSE IF (WD(1:4).EQ.'CLAS') THEN
+ OLDCLASS = CURRAMACLASS
+ CALL NEXTWD('class name =')
+- CLASSNAME = WD(1:50)
++ CLASNAME = WD(1:50)
+ RAMAMODE = NEW
+ DO COUNT = 1, NRAMACLASSES
+- IF (RAMACLASSNAMES(COUNT).EQ.CLASSNAME) THEN
++ IF (RAMACLASSNAMES(COUNT).EQ.CLASNAME) THEN
+ RAMAMODE = UPDATE
+ CURRAMACLASS = COUNT
+ END IF
+@@ -1525,7 +1525,7 @@ C
+ END IF
+ NRAMACLASSES = NRAMACLASSES + 1
+ CURRAMACLASS = NRAMACLASSES
+- RAMACLASSNAMES(CURRAMACLASS) = CLASSNAME
++ RAMACLASSNAMES(CURRAMACLASS) = CLASNAME
+ END IF
+ C
+ C set force constant for current class,
+@@ -1954,18 +1954,18 @@ C
+ & HEAP(RAMAATOMPTR), 0)
+ ELSE IF (WD(1:4).EQ.'CLAS') THEN
+ CALL NEXTWD('Class name>')
+- CLASSINDEX = 0
++ CLASINDEX = 0
+ DO COUNT = 1, NRAMACLASSES
+- IF (RAMACLASSNAMES(COUNT).EQ.CLASSNAME)
+- & CLASSINDEX = COUNT
++ IF (RAMACLASSNAMES(COUNT).EQ.CLASNAME)
++ & CLASINDEX = COUNT
+ END DO
+- IF (CLASSINDEX.EQ.0) THEN
++ IF (CLASINDEX.EQ.0) THEN
+ CALL DSPERR('RAMA',
+ & 'unknown class. Using first.')
+- CLASSINDEX = 1
++ CLASINDEX = 1
+ END IF
+ CALL PRINTRAMAS(CUTOFF, HEAP(CALCRAMAPTR),
+- & HEAP(RAMAATOMPTR), CLASSINDEX)
++ & HEAP(RAMAATOMPTR), CLASINDEX)
+ ELSE
+ CALL DSPERR('RAMA',
+ & 'Expected ALL or CLASs.')
diff --git a/sci-chemistry/cns/files/1.2.1-parallel.patch b/sci-chemistry/cns/files/1.2.1-parallel.patch
new file mode 100644
index 000000000000..dfaa40021d66
--- /dev/null
+++ b/sci-chemistry/cns/files/1.2.1-parallel.patch
@@ -0,0 +1,17 @@
+diff --git a/instlib/source/Makefile.proto b/instlib/source/Makefile.proto
+index 0d0dd3e..ae9e422 100644
+--- a/instlib/source/Makefile.proto
++++ b/instlib/source/Makefile.proto
+@@ -19,9 +19,9 @@ DEPENDS = $(OBJS) dmemory.o machine_c.o
+
+ # the default is to make the cns executable
+ cns_solve:
+- @ make -k printflags F77BUG="$(debug)" DEBUG="$(debug)"
+- @ make -k ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)"
+- @ make -k exepurge
++ @ make printflags F77BUG="$(debug)" DEBUG="$(debug)"
++ @ make ${MAKEOPTS} ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)"
++ @ make exepurge
+
+ # rule for the fortran routines
+ $(OBJS):
diff --git a/sci-chemistry/cns/files/1.3_p7-delete.patch b/sci-chemistry/cns/files/1.3_p7-delete.patch
new file mode 100644
index 000000000000..cbddf4289158
--- /dev/null
+++ b/sci-chemistry/cns/files/1.3_p7-delete.patch
@@ -0,0 +1,13 @@
+diff --git a/utils/cluster_struc.cpp b/utils/cluster_struc.cpp
+index b64467a..5f727db 100644
+--- a/utils/cluster_struc.cpp
++++ b/utils/cluster_struc.cpp
+@@ -173,7 +173,7 @@ int main(int argc, char *argv[]) {
+ for (int i = 0; i < nrstruc; i++) {
+ delete[] neighbor[i];
+ }
+- delete[] neighbor, neighborcount;
++ delete[] neighbor, delete[] neighborcount;
+ return 5;
+ }
+ if (rmsd < cutoff) {
diff --git a/sci-chemistry/cns/files/1.3_p7-gentoo.patch b/sci-chemistry/cns/files/1.3_p7-gentoo.patch
new file mode 100644
index 000000000000..7942c55abfb9
--- /dev/null
+++ b/sci-chemistry/cns/files/1.3_p7-gentoo.patch
@@ -0,0 +1,80 @@
+diff --git a/instlib/source/Makefile.proto b/instlib/source/Makefile.proto
+index 0d0dd3e..dd4b680 100644
+--- a/instlib/source/Makefile.proto
++++ b/instlib/source/Makefile.proto
+@@ -11,6 +11,8 @@
+
+ SHELL=/bin/sh
+
++cns_string=`date "+%y%m%d%H%M"`
++
+ # commands
+ RM = /bin/rm
+
+@@ -19,32 +21,26 @@ DEPENDS = $(OBJS) dmemory.o machine_c.o
+
+ # the default is to make the cns executable
+ cns_solve:
+- @ make -k printflags F77BUG="$(debug)" DEBUG="$(debug)"
+- @ make -k ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)"
+- @ make -k exepurge
++ @ make printflags F77BUG="$(debug)" DEBUG="$(debug)"
++ @ make ${MAKEOPTS} ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)"
++ @ make exepurge
+
+ # rule for the fortran routines
+ $(OBJS):
+- @ echo "compiling: $(@:.o=.f)"; \
+- $(F77) -c $(F77FLAGS) $(@:.o=.f)
++ $(F77) -c $(F77FLAGS) $(@:.o=.f)
+
+ # rule for the dynamic memory allocation C routines
+ dmemory.o: dmemory.c
+- @ echo ; echo "compiling: $?"
+- @ $(CC) -c $(CCFLAGS) $?
++ $(CC) -c $(CCFLAGS) $?
+
+ # rule for the machine specific C routines
+ machine_c.o: machine_c.c
+- @ echo ; echo "compiling: $?"
+- @ $(CC) -c $(CCFLAGS) $?
++ $(CC) -c $(CCFLAGS) $?
+
+ # rule for the executable itself
+ ../bin/cns_solve: $(DEPENDS)
+- @ echo ; echo "linking: cns_solve"; echo
+- @ cns_string=`date "+%y%m%d%H%M"`; \
+- $(LD) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \
+- $(LDFLAGS) \
+- $(CNS_FFTDIR) $(CNS_FFTLIB); \
++ $(LD) $(LDFLAGS) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \
++ $(CNS_FFTDIR) $(CNS_FFTLIB); \
+ if [ -x cns_solve-$$cns_string.exe ]; \
+ then echo "created executable file cns_solve-$$cns_string.exe"; \
+ echo ""; cd ../bin; $(RM) -f cns_solve; $(RM) -f cns; \
+diff --git a/instlib/utils/Makefile b/instlib/utils/Makefile
+index 98de84f..4f32b34 100644
+--- a/instlib/utils/Makefile
++++ b/instlib/utils/Makefile
+@@ -22,17 +22,17 @@ utils:
+ make clean
+
+ .f:
+- $(F77) -o $@ $(F77FLAGS) $(@).f $(F77LINK)
++ $(F77) $(LDFLAGS) -o $@ $(F77FLAGS) $(@).f $(F77LINK)
+
+ .c:
+- $(CC) -o $@ $(CCFLAGS) $(@).c $(CCLINK)
++ $(CC) $(LDFLAGS) -o $@ $(CCFLAGS) $(@).c $(CCLINK)
+
+ .cpp:
+- $(CPP) -o $@ $(CCFLAGS) $(@).cpp $(CCLINK)
++ $(CXX) $(LDFLAGS) -o $@ $(CXXFLAGS) $(@).cpp $(CCLINK)
+
+ .l:
+ lex $(@).l
+- $(CC) $(CCFLAGS) -o $@ lex.yy.c $(CCLINK) -l$(LEXLIB)
++ $(CC) $(LDFLAGS) $(CCFLAGS) -o $@ lex.yy.c $(CCLINK) -l$(LEXLIB)
+
+ relink:
+ @ cd $(CNS_INST)/utils; touch x; rm -f x `ls * | grep -v Makefile`
diff --git a/sci-chemistry/cns/files/cns_solve_env_sh b/sci-chemistry/cns/files/cns_solve_env_sh
new file mode 100644
index 000000000000..34e1a2b635cf
--- /dev/null
+++ b/sci-chemistry/cns/files/cns_solve_env_sh
@@ -0,0 +1,221 @@
+#!/bin/sh
+#
+# This file sets up the appropriate environmental variables and paths
+# for CNSsolve. In the case of the same machines with different versions
+# of the OS, backward compatibility is assumed - ie. a later version will
+# be setup for a previous version of the OS if nothing else is available.
+#
+# written by: Paul Adams
+#
+# copyright Yale University
+#
+# ==========================================================================
+#
+# >>>>>> Important: define the location of the CNSsolve directory <<<<<<
+#
+# CHANGE THE NEXT LINE TO POINT TO THE LOCATION OF THE CNSsolve DIRECTORY
+
+ CNS_SOLVE=_CNSsolve_location_
+
+#
+# ==========================================================================
+#
+# full expansion of the CNS_SOLVE variable prior to use.
+#
+export CNS_SOLVE; CNS_SOLVE=$CNS_SOLVE
+#
+# ==========================================================================
+#
+# set the number of threads for SGI multiprocessors
+# if this causes a problem on other systems it can be commented out
+#
+export MP_SET_NUMTHREADS; MP_SET_NUMTHREADS=1
+#
+# ==========================================================================
+#
+# get the machine architecture
+#
+if [ -d $CNS_SOLVE ]; then
+ if [ ! "$CNS_ARCH" ]; then
+ export CNS_ARCH; CNS_ARCH=`$CNS_SOLVE/bin/getarch`
+ fi
+else
+ export CNS_ARCH; CNS_ARCH='unknown'
+fi
+#
+# system variables (this is needed for openmp)
+#
+ulimit -s unlimited
+# ==========================================================================
+#
+# general environmental variables
+#
+export CNS_LIB; CNS_LIB=$CNS_SOLVE/libraries
+export CNS_MODULE; CNS_MODULE=$CNS_SOLVE/modules
+export CNS_TOPPAR; CNS_TOPPAR=$CNS_LIB/toppar
+export CNS_CONFDB; CNS_CONFDB=$CNS_LIB/confdb
+export CNS_XTALLIB; CNS_XTALLIB=$CNS_LIB/xtal
+export CNS_NMRLIB; CNS_NMRLIB=$CNS_LIB/nmr
+export CNS_XRAYLIB; CNS_XRAYLIB=$CNS_LIB/xray
+export CNS_XTALMODULE; CNS_XTALMODULE=$CNS_MODULE/xtal
+export CNS_NMRMODULE; CNS_NMRMODULE=$CNS_MODULE/nmr
+export CNS_HELPLIB; CNS_HELPLIB=$CNS_SOLVE/helplib
+#
+# general user aliases
+#
+cns_web () { $CNS_SOLVE/bin/cns_web; }
+cns_header () { $CNS_SOLVE/bin/cns_header; }
+cns_info () { cat $CNS_SOLVE/bin/cns_info; }
+cns_transfer () { $CNS_SOLVE/bin/cns_transfer; }
+if [ -x $CNS_SOLVE/bin/cns_edit_local ]; then
+ cns_edit () { $CNS_SOLVE/bin/cns_edit_local; }
+else
+ cns_edit () { $CNS_SOLVE/bin/cns_edit; }
+fi
+run_tutorial () { "csh -f tutorial.csh"; }
+#
+# g77 compilation and use
+#
+g77on () { CNS_G77=ON; . $CNS_SOLVE/.cns_solve_env_sh; }
+g77off () { unset CNS_G77; . $CNS_SOLVE/.cns_solve_env_sh; }
+#
+# developer aliases
+#
+run_tests () { $CNS_SOLVE/bin/run_tests; }
+run_diffs () { $CNS_SOLVE/bin/run_diffs; }
+maketar () { $CNS_SOLVE/bin/maketar; }
+create_patch () { $CNS_SOLVE/bin/create_patch; }
+#
+#
+# ==========================================================================
+#
+# to do expansions - unset noglob just in case user has it otherwise
+#
+set +f
+#
+# try to set up appropriate path
+#
+# first strip off any trailing information (eg. _g77)
+#
+CNS_ARCH=`echo ${CNS_ARCH} | sed -e 's/_g77//g'`
+#
+cns_vendor=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $1}'`
+cns_cpu=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $2}'`
+cns_os=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $3}'`
+cns_major=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $4}'`
+cns_minor=`echo $cns_major | sed -e 's/\./ /g'`
+#
+# if we are looking for a specific type of setup then limit search
+#
+cns_dirs=""
+if [ ! "$CNS_G77" ]; then
+ if /bin/ls -d $CNS_SOLVE/$cns_vendor-* >/dev/null 2>&1 ; then
+ cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-* 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
+ fi
+else
+ CNS_ARCH="${CNS_ARCH}_g77"
+ if /bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 >/dev/null 2>&1 ; then
+ cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
+ fi
+fi
+#
+# first look for an exact match (with os version)
+#
+#
+cns_found=0
+if [ -n "$cns_dirs" ]; then
+ for cns_dir in $cns_dirs ; do
+ cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major} -o \
+ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major}_g77 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ done
+#
+#
+# now look for an exact match (without os version)
+#
+ if [ $cns_found -eq 0 ]; then
+ for cns_dir in $cns_dirs ; do
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os} -o \
+ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}_g77 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ done
+ fi
+#
+# now look for a backwards compatible match (with os version major/minor)
+#
+ if [ $cns_found -eq 0 ]; then
+ for cns_dir in $cns_dirs ; do
+ if [ $cns_found -eq 0 ]; then
+ cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}' | sed 's/_g77//g'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-* ]; then
+ osv_test=`echo $cns_major $cns_tmp_major | awk '{if ($1 > $2) print 1}'`
+ if [ $osv_test -eq 1 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+#
+# now look for a wildcard match on cpu
+#
+ if [ $cns_found -eq 0 ]; then
+ cpu_cpu=`echo $cns_cpu | sed 's/[0-9]*\.*[0-9]*$//'`
+ cpu_ver=`echo $cns_cpu | sed 's/[A-Za-z]*//'`
+ for cns_dir in $cns_dirs ; do
+ if [ $cns_found -eq 0 ]; then
+ cns_tmp_cpu=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[0-9]*\.*[0-9]*$//'`
+ cns_tmp_ver=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[A-Za-z]*//'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major} -o \
+ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major}_g77 ]; then
+ cpu_test=`echo $cpu_ver $cns_tmp_ver | awk '{if ($1 > $2) print 1}'`
+ if [ $cpu_test -eq 1 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+fi
+#
+# if found set environment
+#
+if [ $cns_found -eq 1 ]; then
+ #
+ # set installation and source directory
+ #
+ export CNS_INST; CNS_INST=$CNS_SOLVE/$cns_archenv
+ export CNS_SOURCE; CNS_SOURCE=$CNS_INST/source
+ #
+ # path for CNSsolve utility programs
+ #
+ if [ -d $CNS_SOLVE/$cns_archenv/utils ]; then
+ export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/utils`
+ fi
+ #
+ # path for CNSsolve executable if installed
+ #
+ if [ -d $CNS_SOLVE/$cns_archenv/bin ]; then
+ export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/bin`
+ fi
+fi
+#
+unset cns_vendor cns_cpu cns_os cns_major cns_minor cns_tmp_major cns_tmp_minor
+unset cns_dir cns_dirs cns_found cns_archenv cns_diff cns_count cns_same
+unset cpu_cpu cpu_ver cns_tmp_cpu cns_tmp_ver cpu_test osv_test
+#
diff --git a/sci-chemistry/cns/files/cns_solve_env_sh-1.3_p7 b/sci-chemistry/cns/files/cns_solve_env_sh-1.3_p7
new file mode 100644
index 000000000000..12368f87b596
--- /dev/null
+++ b/sci-chemistry/cns/files/cns_solve_env_sh-1.3_p7
@@ -0,0 +1,229 @@
+#!/bin/sh
+#
+# This file sets up the appropriate environmental variables and paths
+# for CNSsolve. In the case of the same machines with different versions
+# of the OS, backward compatibility is assumed - ie. a later version will
+# be setup for a previous version of the OS if nothing else is available.
+#
+# written by: Paul Adams
+#
+# copyright Yale University
+#
+# ==========================================================================
+#
+# >>>>>> Important: define the location of the CNSsolve directory <<<<<<
+#
+# CHANGE THE NEXT LINE TO POINT TO THE LOCATION OF THE CNSsolve DIRECTORY
+
+ CNS_SOLVE=_CNSsolve_location_
+
+#
+# ==========================================================================
+#
+# full expansion of the CNS_SOLVE variable prior to use.
+#
+export CNS_SOLVE; CNS_SOLVE=$CNS_SOLVE
+#
+# ==========================================================================
+#
+# get the machine architecture
+#
+if [ -d $CNS_SOLVE ]; then
+ if [ ! "$CNS_ARCH" ]; then
+ export CNS_ARCH; CNS_ARCH=`$CNS_SOLVE/bin/getarch`
+ fi
+else
+ export CNS_ARCH; CNS_ARCH='unknown'
+fi
+#
+# ==========================================================================
+#
+# system variables for OpenMP
+#
+# The default stack sizes are usually insufficient, especially when
+# CNS is compiled using OpenMP. If the stack sizes are too
+# small segfaults may occur. Recommended setting for "stacksize":
+limit stacksize unlimited
+#
+# KMP_STACKSIZE is specific for Intel ifort, icc:
+##setenv KMP_STACKSIZE 256m
+#
+# OMP_STACKSIZE is used by all compilers:
+setenv OMP_STACKSIZE 256m
+#
+# Uncomment the following line and change as appropriate to set the number
+# of processors (threads) to use.
+###setenv OMP_NUM_THREADS 4
+#
+# ==========================================================================
+#
+# general environmental variables
+#
+export CNS_LIB; CNS_LIB=$CNS_SOLVE/libraries
+export CNS_MODULE; CNS_MODULE=$CNS_SOLVE/modules
+export CNS_TOPPAR; CNS_TOPPAR=$CNS_LIB/toppar
+export CNS_CONFDB; CNS_CONFDB=$CNS_LIB/confdb
+export CNS_XTALLIB; CNS_XTALLIB=$CNS_LIB/xtal
+export CNS_NMRLIB; CNS_NMRLIB=$CNS_LIB/nmr
+export CNS_XRAYLIB; CNS_XRAYLIB=$CNS_LIB/xray
+export CNS_XTALMODULE; CNS_XTALMODULE=$CNS_MODULE/xtal
+export CNS_NMRMODULE; CNS_NMRMODULE=$CNS_MODULE/nmr
+export CNS_HELPLIB; CNS_HELPLIB=$CNS_SOLVE/helplib
+#
+# general user aliases
+#
+cns_web () { $CNS_SOLVE/bin/cns_web; }
+cns_header () { $CNS_SOLVE/bin/cns_header; }
+cns_info () { cat $CNS_SOLVE/bin/cns_info; }
+cns_transfer () { $CNS_SOLVE/bin/cns_transfer; }
+if [ -x $CNS_SOLVE/bin/cns_edit_local ]; then
+ cns_edit () { $CNS_SOLVE/bin/cns_edit_local; }
+else
+ cns_edit () { $CNS_SOLVE/bin/cns_edit; }
+fi
+#
+# g77 compilation and use
+#
+g77on () { CNS_G77=ON; . $CNS_SOLVE/.cns_solve_env_sh; }
+g77off () { unset CNS_G77; . $CNS_SOLVE/.cns_solve_env_sh; }
+#
+# developer aliases
+#
+run_tests () { $CNS_SOLVE/bin/run_tests; }
+run_diffs () { $CNS_SOLVE/bin/run_diffs; }
+maketar () { $CNS_SOLVE/bin/maketar; }
+create_patch () { $CNS_SOLVE/bin/create_patch; }
+#
+#
+# ==========================================================================
+#
+# to do expansions - unset noglob just in case user has it otherwise
+#
+set +f
+#
+# try to set up appropriate path
+#
+# first strip off any trailing information (eg. _g77)
+#
+CNS_ARCH=`echo ${CNS_ARCH} | sed -e 's/_g77//g'`
+#
+cns_vendor=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $1}'`
+cns_cpu=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $2}'`
+cns_os=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $3}'`
+cns_major=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $4}'`
+cns_minor=`echo $cns_major | sed -e 's/\./ /g'`
+#
+# if we are looking for a specific type of setup then limit search
+#
+cns_dirs=""
+if [ ! "$CNS_G77" ]; then
+ if /bin/ls -d $CNS_SOLVE/$cns_vendor-* >/dev/null 2>&1 ; then
+ cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-* 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
+ fi
+else
+ CNS_ARCH="${CNS_ARCH}_g77"
+ if /bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 >/dev/null 2>&1 ; then
+ cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
+ fi
+fi
+#
+# first look for an exact match (with os version)
+#
+#
+cns_found=0
+if [ -n "$cns_dirs" ]; then
+ for cns_dir in $cns_dirs ; do
+ cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major} -o \
+ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major}_g77 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ done
+#
+#
+# now look for an exact match (without os version)
+#
+ if [ $cns_found -eq 0 ]; then
+ for cns_dir in $cns_dirs ; do
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os} -o \
+ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}_g77 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ done
+ fi
+#
+# now look for a backwards compatible match (with os version major/minor)
+#
+ if [ $cns_found -eq 0 ]; then
+ for cns_dir in $cns_dirs ; do
+ if [ $cns_found -eq 0 ]; then
+ cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}' | sed 's/_g77//g'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-* ]; then
+ osv_test=`echo $cns_major $cns_tmp_major | awk '{if ($1 > $2) print 1}'`
+ if [ $osv_test -eq 1 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+#
+# now look for a wildcard match on cpu
+#
+ if [ $cns_found -eq 0 ]; then
+ cpu_cpu=`echo $cns_cpu | sed 's/[0-9]*\.*[0-9]*$//'`
+ cpu_ver=`echo $cns_cpu | sed 's/[A-Za-z]*//'`
+ for cns_dir in $cns_dirs ; do
+ if [ $cns_found -eq 0 ]; then
+ cns_tmp_cpu=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[0-9]*\.*[0-9]*$//'`
+ cns_tmp_ver=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[A-Za-z]*//'`
+ if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
+ if [ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major} -o \
+ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major}_g77 ]; then
+ cpu_test=`echo $cpu_ver $cns_tmp_ver | awk '{if ($1 > $2) print 1}'`
+ if [ $cpu_test -eq 1 ]; then
+ cns_archenv=$cns_dir
+ cns_found=1
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+fi
+#
+# if found set environment
+#
+if [ $cns_found -eq 1 ]; then
+ #
+ # set installation and source directory
+ #
+ export CNS_INST; CNS_INST=$CNS_SOLVE/$cns_archenv
+ export CNS_SOURCE; CNS_SOURCE=$CNS_INST/source
+ #
+ # path for CNSsolve utility programs
+ #
+ if [ -d $CNS_SOLVE/$cns_archenv/utils ]; then
+ export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/utils`
+ fi
+ #
+ # path for CNSsolve executable if installed
+ #
+ if [ -d $CNS_SOLVE/$cns_archenv/bin ]; then
+ export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/bin`
+ fi
+fi
+#
+unset cns_vendor cns_cpu cns_os cns_major cns_minor cns_tmp_major cns_tmp_minor
+unset cns_dir cns_dirs cns_found cns_archenv cns_diff cns_count cns_same
+unset cpu_cpu cpu_ver cns_tmp_cpu cns_tmp_ver cpu_test osv_test
+#
diff --git a/sci-chemistry/cns/metadata.xml b/sci-chemistry/cns/metadata.xml
new file mode 100644
index 000000000000..a9cb92ec3f79
--- /dev/null
+++ b/sci-chemistry/cns/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="aria"> Support patch for sci-chemistry/aria</flag>
+ </use>
+ <longdescription>
+Crystallography and NMR System (CNS) is the result of an international
+collaborative effort among several research groups. The program has
+been designed to provide a flexible multi-level hierachical approach for the
+most commonly used algorithms in macromolecular structure determination.
+Highlights include heavy atom searching, experimental phasing (including
+MAD and MIR), density modification, crystallographic refinement with maximum
+likelihood targets, and NMR structure calculation using NOEs, J-coupling,
+chemical shift, and dipolar coupling data.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/coot/Manifest b/sci-chemistry/coot/Manifest
new file mode 100644
index 000000000000..3b897f1a8159
--- /dev/null
+++ b/sci-chemistry/coot/Manifest
@@ -0,0 +1,6 @@
+DIST coot-0.7.1.tar.gz 16663581 SHA256 2310d48f7581283ee20eeb355d5fcef90e8d36bc032684b7b47f7c61e89ea0a9 SHA512 dad758b227231543cacd9b34ca00a0bff18bdc208c10529bbf2e504db9f17a3f1bbf610a52c21fe6046e443222667a3703dc962241debff87058ac041bbcec2e WHIRLPOOL 7c57f1161016a74449a9fee1202ada82044d17d957002c67c59f2eb9776f676eb525b605a1973b9bc479e15b40df5478e3b3fad9594433fee73bfc544d5d6b52
+DIST coot-0.7.2.tar.gz 16859099 SHA256 67fbb702559be850f3198c11038fa2c25c692ef8a284e88bbf6a0e941cf3dadd SHA512 84ced967ab661a36ae61a529c1e7fdef121283795fe2300946277c8ba0724724a0190806434257cae01302542efd628cb57d0f35f24968b061cb04faf43daefa WHIRLPOOL ef379156fdfafc275fa953c01b81a06bf75dbf51cc84d6669fa92aef4449e507f45429ad599b455ca3b6b53f9944116adfe42e7ef50e2c56396624f3b5ea5f79
+DIST coot-0.7.tar.gz 16172237 SHA256 e3d61d326ee906eb77081a6f646024cc6c5c92281f9508da3086fb937fb05aa2 SHA512 27fe0485240adcb7f370cf2daf116d8ea1c8e80e297c0975f1b2d2f78d4a5cd9314e06537e680993d465ef551ceba46a2b402c63acfabcbf599cca6bdb8f843f WHIRLPOOL cc919a7ec3731cfd482bb906c7fd9dc98d9ce2ba2f6bbaa91facf5e5195e27b3fe3f0e03e93668a1524bc2b2306ec23951e1db5033315ed1f26456768a5ac2a7
+DIST greg-data-0.7.1.tar.gz 8142259 SHA256 6f3e1c1bc540c8355583ce2e1807cc9f6a2f7b466384382a843942f96b1d31a1 SHA512 6ce97b72f3f984c0d2dc1eb4a259412761736bfaec23867eba46919b6c6444698dc0b0e717c1a095aa713b2a4726d4229aed5964d89a74f7c1f2aa058f4891bf WHIRLPOOL 65db8c976f481a765e1301526cc7af6939ceb4c1cc26f3c1d5e628512a9c34bc4a10e8380d10ab4773976def9b3e07cf84b2cdc1da821750118c405b2f8b34d4
+DIST greg-data-0.7.2.tar.gz 8142259 SHA256 6f3e1c1bc540c8355583ce2e1807cc9f6a2f7b466384382a843942f96b1d31a1 SHA512 6ce97b72f3f984c0d2dc1eb4a259412761736bfaec23867eba46919b6c6444698dc0b0e717c1a095aa713b2a4726d4229aed5964d89a74f7c1f2aa058f4891bf WHIRLPOOL 65db8c976f481a765e1301526cc7af6939ceb4c1cc26f3c1d5e628512a9c34bc4a10e8380d10ab4773976def9b3e07cf84b2cdc1da821750118c405b2f8b34d4
+DIST greg-data-0.7.tar.gz 8202091 SHA256 b82743b1d3c2d3acaa4adb4901368d46e0638733364963ad62044f79111f21f7 SHA512 71ab00869df074660103b824130776ceeaad398b1df8bbc30c9fc41660cc08a66998a406c5cfc93f4605cc5052aae414bd79b6e6de2ae46acd9c6997dbd5361b WHIRLPOOL 87deff25e864f55b316f432b9a9b595e23352720d08257e2b69bbe7946bf8ab5d1fcc9d13205354a0edd3fbea89422952df5f6fa0c05f9707167b544494b2c14
diff --git a/sci-chemistry/coot/coot-0.7.1-r1.ebuild b/sci-chemistry/coot/coot-0.7.1-r1.ebuild
new file mode 100644
index 000000000000..c55da6705209
--- /dev/null
+++ b/sci-chemistry/coot/coot-0.7.1-r1.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+AUTOTOOLS_AUTORECONF="true"
+
+inherit autotools-utils python-single-r1 toolchain-funcs versionator
+
+MY_S2_PV=$(replace_version_separator 2 - ${PV})
+MY_S2_P=${PN}-${MY_S2_PV/pre1/pre-1}
+MY_S_P=${MY_S2_P}-${PR/r/revision-}
+MY_PV=${PV}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Crystallographic Object-Oriented Toolkit for model building, completion and validation"
+HOMEPAGE="http://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/"
+SRC_URI="
+ http://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/source/releases/${MY_P}.tar.gz
+ test? ( http://dev.gentoo.org/~jlec/distfiles/greg-data-${PV}.tar.gz )"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+openmp static-libs test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+SCIDEPS="
+ >=sci-libs/ccp4-libs-6.1
+ sci-libs/clipper
+ >=sci-libs/coot-data-2
+ >=sci-libs/gsl-1.3
+ >=sci-libs/mmdb-1.23:0
+ sci-libs/ssm
+ sci-libs/monomer-db
+ sci-chemistry/reduce
+ sci-chemistry/refmac
+ sci-chemistry/probe"
+
+XDEPS="
+ gnome-base/libgnomecanvas
+ gnome-base/librsvg:2
+ media-libs/libpng
+ media-libs/freeglut
+ x11-libs/gtk+:2
+ x11-libs/goocanvas:0
+ x11-libs/gtkglext"
+
+SCHEMEDEPS="
+ dev-scheme/net-http
+ dev-scheme/guile-gui
+ >=dev-scheme/guile-lib-0.1.6
+ dev-scheme/guile-www
+ >=x11-libs/guile-gtk-2.1"
+
+RDEPEND="
+ ${SCIDEPS}
+ ${XDEPS}
+ ${SCHEMEDEPS}
+ ${PYTHON_DEPS}
+ dev-python/pygtk:2[${PYTHON_USEDEP}]
+ >=dev-libs/gmp-4.2.2-r2
+ >=net-misc/curl-7.19.6
+ net-dns/libidn"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.4-r2
+ dev-lang/swig
+ sys-devel/bc
+ test? ( dev-scheme/greg )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use openmp; then
+ tc-has-openmp || die "Please use an OPENMP capable compiler"
+ fi
+ python-single-r1_pkg_setup
+}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.7-clipper-config.patch
+ "${FILESDIR}"/${PN}-0.7-goocanvas.patch
+ "${FILESDIR}"/${PN}-0.7-mmdb-config.patch
+ "${FILESDIR}"/${PN}-0.7-ssm.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:AM_COOT_SYS_BUILD_TYPE:COOT_SYS_BUILD_TYPE=Gentoo-Linux-${EPYTHON}-gtk2 ; AC_MSG_RESULT([\$COOT_SYS_BUILD_TYPE]); AC_SUBST(COOT_SYS_BUILD_TYPE):g" \
+ -i configure.in || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # All the --with's are used to activate various parts.
+ # Yes, this is broken behavior.
+ local myeconfargs=(
+ --includedir='${prefix}/include/coot'
+ --with-goocanvas-prefix="${EPREFIX}/usr"
+ --with-guile
+ --with-python="${EPREFIX}/usr"
+ --with-guile-gtk
+ --with-gtk2
+ --with-pygtk
+ $(use_enable openmp)
+ )
+ autotools-utils_src_configure
+}
+
+src_test() {
+ source "${EPREFIX}/etc/profile.d/40ccp4.setup.sh"
+ mkdir "${T}"/coot_test
+
+ export COOT_STANDARD_RESIDUES="${S}/standard-residues.pdb"
+ export COOT_SCHEME_DIR="${S}/scheme/"
+ export COOT_RESOURCES_FILE="${S}/cootrc"
+ export COOT_PIXMAPS_DIR="${S}/pixmaps/"
+ export COOT_DATA_DIR="${S}/"
+ export COOT_PYTHON_DIR="${S}/python/"
+ export PYTHONPATH="${COOT_PYTHON_DIR}:${PYTHONPATH}"
+ export PYTHONHOME="${EPREFIX}"/usr/
+ export CCP4_SCR="${T}"/coot_test/
+ export CLIBD_MON="${EPREFIX}/usr/share/ccp4/data/monomers/"
+ export SYMINFO="${S}/syminfo.lib"
+
+ export COOT_TEST_DATA_DIR="${WORKDIR}"/greg-data
+
+ cat > command-line-greg.scm <<- EOF
+ (use-modules (ice-9 greg))
+ (set! greg-tools (list "greg-tests"))
+ (set! greg-debug #t)
+ (set! greg-verbose 5)
+ (let ((r (greg-test-run)))
+ (if r
+ (coot-real-exit 0)
+ (coot-real-exit 1)))
+ EOF
+
+ einfo "Running test with following paths ..."
+ einfo "COOT_STANDARD_RESIDUES $COOT_STANDARD_RESIDUES"
+ einfo "COOT_SCHEME_DIR $COOT_SCHEME_DIR"
+ einfo "COOT_RESOURCES_FILE $COOT_RESOURCES_FILE"
+ einfo "COOT_PIXMAPS_DIR $COOT_PIXMAPS_DIR"
+ einfo "COOT_DATA_DIR $COOT_DATA_DIR"
+ einfo "COOT_PYTHON_DIR $COOT_PYTHON_DIR"
+ einfo "PYTHONPATH $PYTHONPATH"
+ einfo "PYTHONHOME $PYTHONHOME"
+ einfo "CCP4_SCR ${CCP4_SCR}"
+ einfo "CLIBD_MON ${CLIBD_MON}"
+ einfo "SYMINFO ${SYMINFO}"
+
+ "${S}"/src/coot-real --no-graphics --script command-line-greg.scm || die
+ "${S}"/src/coot-real --no-graphics --script python-tests/coot_unittest.py || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ insinto /usr/share/${PN}
+ doins syminfo.lib
+}
diff --git a/sci-chemistry/coot/coot-0.7.2.ebuild b/sci-chemistry/coot/coot-0.7.2.ebuild
new file mode 100644
index 000000000000..54e430017fc2
--- /dev/null
+++ b/sci-chemistry/coot/coot-0.7.2.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+AUTOTOOLS_AUTORECONF="true"
+
+inherit autotools-utils python-single-r1 toolchain-funcs versionator
+
+MY_S2_PV=$(replace_version_separator 2 - ${PV})
+MY_S2_P=${PN}-${MY_S2_PV/pre1/pre-1}
+MY_S_P=${MY_S2_P}-${PR/r/revision-}
+MY_PV=${PV}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Crystallographic Object-Oriented Toolkit for model building, completion and validation"
+HOMEPAGE="http://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/"
+SRC_URI="
+ http://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/source/releases/${MY_P}.tar.gz
+ test? ( http://dev.gentoo.org/~jlec/distfiles/greg-data-${PV}.tar.gz )"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+openmp static-libs test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+SCIDEPS="
+ >=sci-libs/ccp4-libs-6.1
+ sci-libs/clipper
+ >=sci-libs/coot-data-2
+ >=sci-libs/gsl-1.3
+ >=sci-libs/mmdb-1.23:0
+ sci-libs/ssm
+ sci-libs/monomer-db
+ sci-chemistry/reduce
+ sci-chemistry/refmac
+ sci-chemistry/probe"
+
+XDEPS="
+ gnome-base/libgnomecanvas
+ gnome-base/librsvg:2
+ media-libs/libpng
+ media-libs/freeglut
+ x11-libs/gtk+:2
+ x11-libs/goocanvas:0
+ x11-libs/gtkglext"
+
+SCHEMEDEPS="
+ dev-scheme/net-http
+ dev-scheme/guile-gui
+ >=dev-scheme/guile-lib-0.1.6
+ dev-scheme/guile-www
+ >=x11-libs/guile-gtk-2.1"
+
+RDEPEND="
+ ${SCIDEPS}
+ ${XDEPS}
+ ${SCHEMEDEPS}
+ ${PYTHON_DEPS}
+ dev-python/pygtk:2[${PYTHON_USEDEP}]
+ >=dev-libs/gmp-4.2.2-r2
+ >=net-misc/curl-7.19.6
+ net-dns/libidn"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.4-r2
+ dev-lang/swig
+ sys-devel/bc
+ test? ( dev-scheme/greg )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use openmp; then
+ tc-has-openmp || die "Please use an OPENMP capable compiler"
+ fi
+ python-single-r1_pkg_setup
+}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.7-clipper-config.patch
+ "${FILESDIR}"/${PN}-0.7-goocanvas.patch
+ "${FILESDIR}"/${PN}-0.7-mmdb-config.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:AM_COOT_SYS_BUILD_TYPE:COOT_SYS_BUILD_TYPE=Gentoo-Linux-${EPYTHON}-gtk2 ; AC_MSG_RESULT([\$COOT_SYS_BUILD_TYPE]); AC_SUBST(COOT_SYS_BUILD_TYPE):g" \
+ -i configure.in || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # All the --with's are used to activate various parts.
+ # Yes, this is broken behavior.
+ local myeconfargs=(
+ --includedir='${prefix}/include/coot'
+ --with-goocanvas-prefix="${EPREFIX}/usr"
+ --with-guile
+ --with-python="${EPREFIX}/usr"
+ --with-guile-gtk
+ --with-gtk2
+ --with-pygtk
+ $(use_enable openmp)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+ cp "${S}"/src/coot_gtk2.py python/coot.py || die
+}
+
+src_test() {
+ source "${EPREFIX}/etc/profile.d/40ccp4.setup.sh"
+ mkdir "${T}"/coot_test
+
+ export COOT_STANDARD_RESIDUES="${S}/standard-residues.pdb"
+ export COOT_SCHEME_DIR="${S}/scheme/"
+ export COOT_RESOURCES_FILE="${S}/cootrc"
+ export COOT_PIXMAPS_DIR="${S}/pixmaps/"
+ export COOT_DATA_DIR="${S}/"
+ export COOT_PYTHON_DIR="${S}/python/"
+ export PYTHONPATH="${COOT_PYTHON_DIR}:${PYTHONPATH}"
+ export PYTHONHOME="${EPREFIX}"/usr/
+ export CCP4_SCR="${T}"/coot_test/
+ export CLIBD_MON="${EPREFIX}/usr/share/ccp4/data/monomers/"
+ export SYMINFO="${S}/syminfo.lib"
+
+ export COOT_TEST_DATA_DIR="${WORKDIR}"/greg-data
+
+ cat > command-line-greg.scm <<- EOF
+ (use-modules (ice-9 greg))
+ (set! greg-tools (list "greg-tests"))
+ (set! greg-debug #t)
+ (set! greg-verbose 5)
+ (let ((r (greg-test-run)))
+ (if r
+ (coot-real-exit 0)
+ (coot-real-exit 1)))
+ EOF
+
+ einfo "Running test with following paths ..."
+ einfo "COOT_STANDARD_RESIDUES $COOT_STANDARD_RESIDUES"
+ einfo "COOT_SCHEME_DIR $COOT_SCHEME_DIR"
+ einfo "COOT_RESOURCES_FILE $COOT_RESOURCES_FILE"
+ einfo "COOT_PIXMAPS_DIR $COOT_PIXMAPS_DIR"
+ einfo "COOT_DATA_DIR $COOT_DATA_DIR"
+ einfo "COOT_PYTHON_DIR $COOT_PYTHON_DIR"
+ einfo "PYTHONPATH $PYTHONPATH"
+ einfo "PYTHONHOME $PYTHONHOME"
+ einfo "CCP4_SCR ${CCP4_SCR}"
+ einfo "CLIBD_MON ${CLIBD_MON}"
+ einfo "SYMINFO ${SYMINFO}"
+
+ "${S}"/src/coot-real --no-graphics --script command-line-greg.scm || die
+ "${S}"/src/coot-real --no-graphics --script python-tests/coot_unittest.py || die
+}
diff --git a/sci-chemistry/coot/coot-0.7.ebuild b/sci-chemistry/coot/coot-0.7.ebuild
new file mode 100644
index 000000000000..2922f57bfe37
--- /dev/null
+++ b/sci-chemistry/coot/coot-0.7.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="2"
+
+AUTOTOOLS_AUTORECONF="true"
+
+inherit autotools-utils python toolchain-funcs versionator
+
+MY_S2_PV=$(replace_version_separator 2 - ${PV})
+MY_S2_P=${PN}-${MY_S2_PV/pre1/pre-1}
+MY_S_P=${MY_S2_P}-${PR/r/revision-}
+MY_PV=${PV}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Crystallographic Object-Oriented Toolkit for model building, completion and validation"
+HOMEPAGE="http://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/"
+SRC_URI="
+ http://www.biop.ox.ac.uk/coot/software/source/releases/${MY_P}.tar.gz
+ test? ( http://dev.gentoo.org/~jlec/distfiles/greg-data-${PV}.tar.gz )"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="+openmp static-libs test"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+SCIDEPS="
+ >=sci-libs/ccp4-libs-6.1
+ sci-libs/clipper
+ >=sci-libs/coot-data-2
+ >=sci-libs/gsl-1.3
+ >=sci-libs/mmdb-1.23:0
+ sci-libs/ssm
+ <sci-libs/monomer-db-1
+ sci-chemistry/reduce
+ <sci-chemistry/refmac-5.6
+ sci-chemistry/probe"
+
+XDEPS="
+ gnome-base/libgnomecanvas
+ gnome-base/librsvg:2
+ media-libs/libpng
+ media-libs/freeglut
+ x11-libs/gtk+:2
+ x11-libs/goocanvas:0
+ x11-libs/gtkglext"
+
+SCHEMEDEPS="
+ dev-scheme/net-http
+ dev-scheme/guile-gui
+ >=dev-scheme/guile-lib-0.1.6
+ dev-scheme/guile-www
+ >=x11-libs/guile-gtk-2.1"
+
+RDEPEND="
+ ${SCIDEPS}
+ ${XDEPS}
+ ${SCHEMEDEPS}
+ dev-python/pygtk:2
+ >=dev-libs/gmp-4.2.2-r2
+ >=net-misc/curl-7.19.6
+ net-dns/libidn"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.4-r2
+ dev-lang/swig
+ sys-devel/bc
+ test? ( dev-scheme/greg )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use openmp; then
+ tc-has-openmp || die "Please use an OPENMP capable compiler"
+ fi
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-clipper-config.patch
+ "${FILESDIR}"/${P}-goocanvas.patch
+ "${FILESDIR}"/${P}-mmdb-config.patch
+ "${FILESDIR}"/${P}-ssm.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:AM_COOT_SYS_BUILD_TYPE:COOT_SYS_BUILD_TYPE=Gentoo-Linux-$(PYTHON)-gtk2 ; AC_MSG_RESULT([\$COOT_SYS_BUILD_TYPE]); AC_SUBST(COOT_SYS_BUILD_TYPE):g" \
+ -i configure.in || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # All the --with's are used to activate various parts.
+ # Yes, this is broken behavior.
+ local myeconfargs=(
+ --includedir='${prefix}/include/coot'
+ --with-goocanvas-prefix="${EPREFIX}/usr"
+ --with-guile
+ --with-python="${EPREFIX}/usr"
+ --with-guile-gtk
+ --with-gtk2
+ --with-pygtk
+ $(use_enable openmp)
+ )
+ autotools-utils_src_configure
+}
+
+src_test() {
+ source "${EPREFIX}/etc/profile.d/40ccp4.setup.sh"
+ mkdir "${T}"/coot_test
+
+ export COOT_STANDARD_RESIDUES="${S}/standard-residues.pdb"
+ export COOT_SCHEME_DIR="${S}/scheme/"
+ export COOT_RESOURCES_FILE="${S}/cootrc"
+ export COOT_PIXMAPS_DIR="${S}/pixmaps/"
+ export COOT_DATA_DIR="${S}/"
+ export COOT_PYTHON_DIR="${S}/python/"
+ export PYTHONPATH="${COOT_PYTHON_DIR}:${PYTHONPATH}"
+ export PYTHONHOME="${EPREFIX}"/usr/
+ export CCP4_SCR="${T}"/coot_test/
+ export CLIBD_MON="${EPREFIX}/usr/share/ccp4/data/monomers/"
+ export SYMINFO="${S}/syminfo.lib"
+
+ export COOT_TEST_DATA_DIR="${WORKDIR}"/data/greg-data
+
+ cat > command-line-greg.scm <<- EOF
+ (use-modules (ice-9 greg))
+ (set! greg-tools (list "greg-tests"))
+ (set! greg-debug #t)
+ (set! greg-verbose 5)
+ (let ((r (greg-test-run)))
+ (if r
+ (coot-real-exit 0)
+ (coot-real-exit 1)))
+ EOF
+
+ einfo "Running test with following paths ..."
+ einfo "COOT_STANDARD_RESIDUES $COOT_STANDARD_RESIDUES"
+ einfo "COOT_SCHEME_DIR $COOT_SCHEME_DIR"
+ einfo "COOT_RESOURCES_FILE $COOT_RESOURCES_FILE"
+ einfo "COOT_PIXMAPS_DIR $COOT_PIXMAPS_DIR"
+ einfo "COOT_DATA_DIR $COOT_DATA_DIR"
+ einfo "COOT_PYTHON_DIR $COOT_PYTHON_DIR"
+ einfo "PYTHONPATH $PYTHONPATH"
+ einfo "PYTHONHOME $PYTHONHOME"
+ einfo "CCP4_SCR ${CCP4_SCR}"
+ einfo "CLIBD_MON ${CLIBD_MON}"
+ einfo "SYMINFO ${SYMINFO}"
+
+ "${S}"/src/coot-real --no-graphics --script command-line-greg.scm || die
+ "${S}"/src/coot-real --no-graphics --script python-tests/coot_unittest.py || die
+}
diff --git a/sci-chemistry/coot/files/0.6.2-clipper-config.patch b/sci-chemistry/coot/files/0.6.2-clipper-config.patch
new file mode 100644
index 000000000000..311b5e88d84e
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-clipper-config.patch
@@ -0,0 +1,17 @@
+ macros/clipper.m4 | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/macros/clipper.m4 b/macros/clipper.m4
+index 0bf087a..d0e8b6b 100644
+--- a/macros/clipper.m4
++++ b/macros/clipper.m4
+@@ -98,6 +98,9 @@ case $ac_cv_build_alias in
+ ;;
+ esac
+
++CLIPPER_CXXFLAGS=`clipper-config --cflags`
++CLIPPER_LDOPTS=`clipper-config --libs`
++
+ AC_MSG_CHECKING([for Clipper])
+
+ LIBS="$save_LIBS $CLIPPER_LDOPTS"
diff --git a/sci-chemistry/coot/files/0.6.2-gl.patch b/sci-chemistry/coot/files/0.6.2-gl.patch
new file mode 100644
index 000000000000..bbd858c646df
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-gl.patch
@@ -0,0 +1,10 @@
+Index: coot-surface/Makefile.am
+===================================================================
+--- coot-surface/Makefile.am (revision 3478)
++++ coot-surface/Makefile.am (working copy)
+@@ -29,4 +29,4 @@
+
+ libcoot_surface_la_LIBADD = \
+ $(top_builddir)/surface/libccp4mg-surface.la \
+- $(GLUT_LIBS) $(CLIPPER_LIBS) $(MMDB_LIBS)
++ $(GLUT_LIBS) $(CLIPPER_LIBS) $(MMDB_LIBS) -lGL
diff --git a/sci-chemistry/coot/files/0.6.2-libpng15.patch b/sci-chemistry/coot/files/0.6.2-libpng15.patch
new file mode 100644
index 000000000000..bddd251698de
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-libpng15.patch
@@ -0,0 +1,29 @@
+--- ccp4mg-utils/ppmutil.cc
++++ ccp4mg-utils/ppmutil.cc
+@@ -2494,15 +2494,21 @@
+
+ pixels = new unsigned char[width*height*colourspace];
+
++ png_colorp palette;
++ int num_trans;
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >=4
++ png_bytep trans_alpha;
++#endif
++
+ for (int i=0; i<height; i++){
+ if(color_type==PNG_COLOR_TYPE_PALETTE){
+ for (int j=0; j<width; j++){
+- pixels[i*width*colourspace+j*colourspace] = png_ptr->palette[row_pointers[i][j]].red;
+- pixels[i*width*colourspace+j*colourspace+1] = png_ptr->palette[row_pointers[i][j]].green;
+- pixels[i*width*colourspace+j*colourspace+2] = png_ptr->palette[row_pointers[i][j]].blue;
+- if(row_pointers[i][j]<png_ptr->num_trans){
++ pixels[i*width*colourspace+j*colourspace] = palette[row_pointers[i][j]].red;
++ pixels[i*width*colourspace+j*colourspace+1] = palette[row_pointers[i][j]].green;
++ pixels[i*width*colourspace+j*colourspace+2] = palette[row_pointers[i][j]].blue;
++ if(row_pointers[i][j]<num_trans){
+ #if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >=4
+- pixels[i*width*colourspace+j*colourspace+3] = png_ptr->trans_alpha[row_pointers[i][j]];
++ pixels[i*width*colourspace+j*colourspace+3] = trans_alpha[row_pointers[i][j]];
+ #else
+ pixels[i*width*colourspace+j*colourspace+3] = png_ptr->trans[row_pointers[i][j]];
+ #endif
diff --git a/sci-chemistry/coot/files/0.6.2-mmdb-config.patch b/sci-chemistry/coot/files/0.6.2-mmdb-config.patch
new file mode 100644
index 000000000000..1d7cbd452f7b
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-mmdb-config.patch
@@ -0,0 +1,18 @@
+ macros/mmdb.m4 | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/macros/mmdb.m4 b/macros/mmdb.m4
+index b477597..d05cf66 100644
+--- a/macros/mmdb.m4
++++ b/macros/mmdb.m4
+@@ -86,6 +86,10 @@ else
+ ac_MMDB_LDOPTS="-lmmdb -lm"
+ fi
+
++PKG_CHECK_MODULES([MMDB],[mmdb >= 1.2])
++ac_MMDB_LDOPTS="${MMDB_LIBS}"
++ac_MMDB_CXXFLAGS="${MMDB_CFLAGS}"
++
+ AC_MSG_CHECKING([for MMDB])
+
+ LIBS="$save_LIBS $ac_MMDB_LDOPTS"
diff --git a/sci-chemistry/coot/files/0.6.2-ssm.patch b/sci-chemistry/coot/files/0.6.2-ssm.patch
new file mode 100644
index 000000000000..c801da72410a
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-ssm.patch
@@ -0,0 +1,56 @@
+ macros/mmdb-ssm.m4 | 42 +-----------------------------------------
+ 1 files changed, 1 insertions(+), 41 deletions(-)
+
+diff --git a/macros/mmdb-ssm.m4 b/macros/mmdb-ssm.m4
+index 1937a16..6ef547c 100644
+--- a/macros/mmdb-ssm.m4
++++ b/macros/mmdb-ssm.m4
+@@ -22,47 +22,7 @@
+ AC_DEFUN([AM_WITH_MMDBSSM],
+ [AC_PROVIDE([AM_USE_MMDBSSM])
+
+-
+-AC_ARG_WITH(ssmlib-prefix,
+- AC_HELP_STRING( [--with-ssmlib-prefix=PFX], [Prefix where SSMLib has been installed] ),
+- [ with_ssmlib_prefix="$withval" ],
+- with_ssmlib_prefix="")
+-
+-AC_MSG_CHECKING([for SSMLib])
+-
+-if test x$with_ssmlib_prefix != x; then
+-
+- MMDBSSM_CXXFLAGS="-DHAVE_SSMLIB"
+- MMDBSSM_LIBS="-L$with_ssmlib_prefix/$acl_libdirstem -lssm"
+-
+-ac_mmdb_dirs='
+-.
+-include
+-include/ssm
+-include/mmdb
+-lib
+-src
+-lib/src
+-lib/src/mmdb'
+-
+- for ac_dir in $ac_mmdb_dirs; do
+- if test -r "$with_ssmlib_prefix/$ac_dir/ssm_superpose.h"; then
+- ac_MMDBSSM_CXXFLAGS="-I$with_ssmlib_prefix/$ac_dir"
+- break
+- fi
+- done
+-
+- MMDBSSM_CXXFLAGS="$MMDBSSM_CXXFLAGS $ac_MMDBSSM_CXXFLAGS"
+-
+-else
+-
+- MMDBSSM_CXXFLAGS=""
+- MMDBSSM_LIBS=""
+- with_ssmlib_prefix=no
+-
+-fi
+-
+-AC_MSG_RESULT([$with_ssmlib_prefix])
++PKG_CHECK_MODULES([MMDBSSM],[ssm])
+
+ AC_SUBST(MMDBSSM_CXXFLAGS)
+ AC_SUBST(MMDBSSM_LIBS)
diff --git a/sci-chemistry/coot/files/0.6.2-test.patch b/sci-chemistry/coot/files/0.6.2-test.patch
new file mode 100644
index 000000000000..8cb79e65d767
--- /dev/null
+++ b/sci-chemistry/coot/files/0.6.2-test.patch
@@ -0,0 +1,16 @@
+ src/testing.cc | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/src/testing.cc b/src/testing.cc
+index f767bf6..097b9b9 100644
+--- a/src/testing.cc
++++ b/src/testing.cc
+@@ -86,6 +86,8 @@ std::string greg_test(const std::string &file_name) {
+ const char *c = getenv("COOT_TEST_DATA_DIR");
+ if (c) {
+ dd = c;
++ dd += "/";
++ dd += file_name;
+ } else {
+ const char *d = getenv("HOME");
+ if (d) {
diff --git a/sci-chemistry/coot/files/coot-0.7-clipper-config.patch b/sci-chemistry/coot/files/coot-0.7-clipper-config.patch
new file mode 100644
index 000000000000..311b5e88d84e
--- /dev/null
+++ b/sci-chemistry/coot/files/coot-0.7-clipper-config.patch
@@ -0,0 +1,17 @@
+ macros/clipper.m4 | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/macros/clipper.m4 b/macros/clipper.m4
+index 0bf087a..d0e8b6b 100644
+--- a/macros/clipper.m4
++++ b/macros/clipper.m4
+@@ -98,6 +98,9 @@ case $ac_cv_build_alias in
+ ;;
+ esac
+
++CLIPPER_CXXFLAGS=`clipper-config --cflags`
++CLIPPER_LDOPTS=`clipper-config --libs`
++
+ AC_MSG_CHECKING([for Clipper])
+
+ LIBS="$save_LIBS $CLIPPER_LDOPTS"
diff --git a/sci-chemistry/coot/files/coot-0.7-goocanvas.patch b/sci-chemistry/coot/files/coot-0.7-goocanvas.patch
new file mode 100644
index 000000000000..ce0d4a00abba
--- /dev/null
+++ b/sci-chemistry/coot/files/coot-0.7-goocanvas.patch
@@ -0,0 +1,25 @@
+Index: macros/goo-canvas.m4
+===================================================================
+--- macros/goo-canvas.m4 (revision 3307)
++++ macros/goo-canvas.m4 (working copy)
+@@ -56,9 +56,9 @@
+ fi
+ fi
+
+-AC_MSG_CHECKING([for Goocanvas])
++PKG_CHECK_MODULES(GOOCANVAS, goocanvas)
+
+-LIBS="$saved_LIBS $GOOCANVAS_LDOPTS $GTK_LIBS"
++LIBS="$saved_LIBS $GOOCANVAS_LIBS $GTK_LIBS"
+ CXXFLAGS="$saved_CXXFLAGS $GOOCANVAS_CFLAGS $GTK_CFLAGS"
+ #
+ # AC_TRY_LINK uses the c compiler (set by AC_LANG), so we will
+@@ -76,7 +76,7 @@
+ if test x$have_goocanvas = xyes; then
+
+ GOOCANVAS_CFLAGS="$GOOCANVAS_CFLAGS"
+- GOOCANVAS_LIBS="$GOOCANVAS_LDOPTS"
++ GOOCANVAS_LIBS="$GOOCANVAS_LIBS"
+
+ ifelse([$1], , :, [$1])
+
diff --git a/sci-chemistry/coot/files/coot-0.7-mmdb-config.patch b/sci-chemistry/coot/files/coot-0.7-mmdb-config.patch
new file mode 100644
index 000000000000..b3b66ab65786
--- /dev/null
+++ b/sci-chemistry/coot/files/coot-0.7-mmdb-config.patch
@@ -0,0 +1,18 @@
+Index: macros/mmdb.m4
+===================================================================
+--- macros/mmdb.m4 (revision 3579)
++++ macros/mmdb.m4 (working copy)
+@@ -86,8 +86,12 @@
+ ac_MMDB_LDOPTS="-lmmdb -lm"
+ fi
+
+-AC_MSG_CHECKING([for MMDB])
++PKG_CHECK_MODULES([MMDB],[mmdb >= 1.2])
++ac_MMDB_LDOPTS="${MMDB_LIBS}"
++ac_MMDB_CXXFLAGS="${MMDB_CFLAGS}"
+
++AC_MSG_CHECKING([for CISPEP in MMDB])
++
+ LIBS="$save_LIBS $ac_MMDB_LDOPTS"
+ CXXFLAGS="$save_CXXFLAGS $ac_MMDB_CXXFLAGS"
+ #
diff --git a/sci-chemistry/coot/files/coot-0.7-ssm.patch b/sci-chemistry/coot/files/coot-0.7-ssm.patch
new file mode 100644
index 000000000000..c801da72410a
--- /dev/null
+++ b/sci-chemistry/coot/files/coot-0.7-ssm.patch
@@ -0,0 +1,56 @@
+ macros/mmdb-ssm.m4 | 42 +-----------------------------------------
+ 1 files changed, 1 insertions(+), 41 deletions(-)
+
+diff --git a/macros/mmdb-ssm.m4 b/macros/mmdb-ssm.m4
+index 1937a16..6ef547c 100644
+--- a/macros/mmdb-ssm.m4
++++ b/macros/mmdb-ssm.m4
+@@ -22,47 +22,7 @@
+ AC_DEFUN([AM_WITH_MMDBSSM],
+ [AC_PROVIDE([AM_USE_MMDBSSM])
+
+-
+-AC_ARG_WITH(ssmlib-prefix,
+- AC_HELP_STRING( [--with-ssmlib-prefix=PFX], [Prefix where SSMLib has been installed] ),
+- [ with_ssmlib_prefix="$withval" ],
+- with_ssmlib_prefix="")
+-
+-AC_MSG_CHECKING([for SSMLib])
+-
+-if test x$with_ssmlib_prefix != x; then
+-
+- MMDBSSM_CXXFLAGS="-DHAVE_SSMLIB"
+- MMDBSSM_LIBS="-L$with_ssmlib_prefix/$acl_libdirstem -lssm"
+-
+-ac_mmdb_dirs='
+-.
+-include
+-include/ssm
+-include/mmdb
+-lib
+-src
+-lib/src
+-lib/src/mmdb'
+-
+- for ac_dir in $ac_mmdb_dirs; do
+- if test -r "$with_ssmlib_prefix/$ac_dir/ssm_superpose.h"; then
+- ac_MMDBSSM_CXXFLAGS="-I$with_ssmlib_prefix/$ac_dir"
+- break
+- fi
+- done
+-
+- MMDBSSM_CXXFLAGS="$MMDBSSM_CXXFLAGS $ac_MMDBSSM_CXXFLAGS"
+-
+-else
+-
+- MMDBSSM_CXXFLAGS=""
+- MMDBSSM_LIBS=""
+- with_ssmlib_prefix=no
+-
+-fi
+-
+-AC_MSG_RESULT([$with_ssmlib_prefix])
++PKG_CHECK_MODULES([MMDBSSM],[ssm])
+
+ AC_SUBST(MMDBSSM_CXXFLAGS)
+ AC_SUBST(MMDBSSM_LIBS)
diff --git a/sci-chemistry/coot/metadata.xml b/sci-chemistry/coot/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/coot/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/cyana/Manifest b/sci-chemistry/cyana/Manifest
new file mode 100644
index 000000000000..de99a95f8e55
--- /dev/null
+++ b/sci-chemistry/cyana/Manifest
@@ -0,0 +1 @@
+DIST cyana-2.1.tar.gz 2203650 SHA256 4b49d23eda3a327074fa337c7ee13262e93fb2b92cc6feb9139dfb7695bdeded SHA512 20f5369e47198000927ee9a60beda34d265fddcd6be59f0d5d81ac23691b7e870ca674bdd7215a13bc849586411a007ebb1ff46072b55f255a6d796359067be8 WHIRLPOOL dfc60a456c166d98bbdb60227a2dae63d12ea9fb7375dede3d372a6dbf0785bfd0c8b1069d985a6ee775ab136405b553ff9336a2603d139d81d853f0681f5167
diff --git a/sci-chemistry/cyana/cyana-2.1.ebuild b/sci-chemistry/cyana/cyana-2.1.ebuild
new file mode 100644
index 000000000000..6d042584dbc1
--- /dev/null
+++ b/sci-chemistry/cyana/cyana-2.1.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 fortran-2 toolchain-funcs
+
+DESCRIPTION="Combined assignment and dynamics algorithm for NMR applications"
+HOMEPAGE="http://www.las.jp/english/products/cyana.html"
+SRC_URI="${P}.tar.gz"
+
+LICENSE="CYANA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RESTRICT="fetch"
+
+# we need libg2c for gfortran # 136988
+DEPEND="dev-lang/ifc"
+RDEPEND="${DEPEND}"
+
+pkg_nofetch() {
+ elog "Please visit"
+ elog "http://www.las.jp/english/products/cyana.html"
+ elog "and get a copy of ${A}."
+ elog "Place it in ${DISTDIR}."
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-typo.patch \
+ "${FILESDIR}"/${PV}-exec.patch \
+ "${FILESDIR}"/${PV}-expire.patch \
+ "${FILESDIR}"/${PV}-xiar.patch
+
+ cat >> etc/config <<- EOF
+ VERSION=${PV}
+ SHELL=${EPREFIX}/bin/sh
+ FC=ifort
+ FFLAGS=${FFLAGS} -openmp -threads
+ FFLAGS2=${FFLAGS} -openmp -threads
+ CC=$(tc-getCC)
+ AR=xiar
+ RANLIB=ranlib
+ FORK=g77fork.o
+ LDFLAGS=${LDFLAGS} -reentrancy threaded -openmp
+ LIBS=
+ DEFS=-Dintel
+ SYSTEM=intel
+ EOF
+}
+
+src_compile() {
+ cd src || die
+ emake
+}
+
+src_install() {
+ dobin cyana{job,table,filter,clean}
+ newbin src/${PN}/${PN}exe.* ${PN}
+ insinto /usr/share/${PN}
+ doins -r lib macro help
+ use examples && doins -r demo
+
+ cat >> "${T}"/20cyana <<- EOF
+ CYANALIB="${EPREFIX}/usr/share/${PN}"
+ EOF
+
+ doenvd "${T}"/20cyana
+}
diff --git a/sci-chemistry/cyana/files/2.1-exec.patch b/sci-chemistry/cyana/files/2.1-exec.patch
new file mode 100644
index 000000000000..28cd88d3eee6
--- /dev/null
+++ b/sci-chemistry/cyana/files/2.1-exec.patch
@@ -0,0 +1,77 @@
+diff --git a/cyana b/cyana
+index 4f746cf..a7ff060 100755
+--- a/cyana
++++ b/cyana
+@@ -45,16 +45,13 @@ shift `expr $optind - 1`
+
+ if [ "$h" ]; then usage=1; fi
+ if [ "$usage" ]; then
+- echo "Usage: $prog -hctx parameters ..."
++ echo "Usage: $prog -hS parameters ..."
+ echo
+ echo " -h help"
+ echo " -c command command to start program (must contain \$exefile)"
+ echo " -S run in safe mode, i.e. within one directory"
+- echo " -t system explicit system type"
+- echo " -x display name of executable without executing it"
+ exit 2
+ fi
+-if [ "$c" ]; then cmd="$c"; fi
+ sys=$t
+ mode=$x
+ safe=$S
+@@ -65,23 +62,6 @@ safe=$S
+ eval ${PROG}ARG='$*'
+ export ${PROG}ARG
+
+-
+-# ------ Set library name ------
+-
+-f=$0
+-if [ `echo $f | sed 's,^/.*,+,'` != "+" ]; then f=`which $0`; fi
+-odir=`pwd`
+-while [ "`ls -l $f | awk '{ print substr($1,1,1) }'`" = "l" ]; do
+- l=`ls -l $f | awk '{ i = NF; print $i }'`
+- cd `dirname $f`; cd `dirname $l`; l=`pwd`/`basename $l`
+- f=$l
+-done
+-cd `dirname $f`
+-libdir=`pwd | sed 's,/src/'${prog}'$,,'`
+-cd $odir
+-eval ${PROG}LIB=$libdir
+-export ${PROG}LIB
+-
+ if [ "$safe" ]; then
+ CYANAINIT=initsafe; export CYANAINIT
+ fi
+@@ -89,29 +69,4 @@ fi
+
+ # ------ Start the program ------
+
+-if [ -d $libdir/src/$prog ]; then
+- exe=$libdir/src/$prog/$exe
+-else
+- exe=$libdir/$exe
+-fi
+-if [ "$sys" = "" ]; then
+- sys=`$libdir/etc/identify`
+- files="$exe.$sys* $exe.gnu $exe.*"
+-else
+- files=$exe.$sys
+-fi
+-for exefile in $files; do
+- if [ -x $exefile ]; then
+- if [ "$mode" ]; then
+- echo $exefile; exit 0
+- else
+- if [ "`echo $cmd | grep -c '\$exefile'`" -gt 0 ]; then
+- eval exec $cmd
+- else
+- eval exec $cmd $exefile
+- fi
+- fi
+- fi
+-done
+-echo "No executable found in \"`dirname $exe`\"."
+-exit 1
++exec cyana
diff --git a/sci-chemistry/cyana/files/2.1-expire.patch b/sci-chemistry/cyana/files/2.1-expire.patch
new file mode 100644
index 000000000000..e18008286f68
--- /dev/null
+++ b/sci-chemistry/cyana/files/2.1-expire.patch
@@ -0,0 +1,15 @@
+--- src/inclan/unix.for.orig 2011-01-05 14:56:46.572193759 +0100
++++ src/inclan/unix.for 2011-01-05 14:57:27.833627375 +0100
+@@ -206,11 +206,8 @@
+ end if
+ if (iwbeg.lt.0) then
+ iwbeg=igttim
+- iexpir=(julday(12,31,2010)-julday(1,1,1970))*24*3600
+- if (iwbeg.gt.iexpir) call fatmsg ('License expired.')
++ iexpir=iwbeg+100
+ j=(iexpir-iwbeg)/(24*3600)
+- if (j.lt.1000)
+- * call wrnmsg ('License expires in '//plural(j,'day')//'.')
+ end if
+ iwall=igttim-iwbeg
+ c print *,'iwall = ',iwall,iwbeg,idat,itim \ No newline at end of file
diff --git a/sci-chemistry/cyana/files/2.1-typo.patch b/sci-chemistry/cyana/files/2.1-typo.patch
new file mode 100644
index 000000000000..3f011a9b2c28
--- /dev/null
+++ b/sci-chemistry/cyana/files/2.1-typo.patch
@@ -0,0 +1,13 @@
+diff --git a/src/cyana/putpro.f b/src/cyana/putpro.f
+index d4080f9..4490225 100644
+--- a/src/cyana/putpro.f
++++ b/src/cyana/putpro.f
+@@ -66,7 +66,7 @@ c ------------------------------------------------------ BMRB header
+ * ' _Mol_residue_sequence',
+ * ';'
+ do i=1,nr,20
+- write (iunit,'(20A1))') (rcode(rnam(j)),j=i,min(nr,i+19))
++ write (iunit,'(20A1)') (rcode(rnam(j)),j=i,min(nr,i+19))
+ end do
+
+ write (iunit,'(A)')
diff --git a/sci-chemistry/cyana/files/2.1-xiar.patch b/sci-chemistry/cyana/files/2.1-xiar.patch
new file mode 100644
index 000000000000..e8393253d7f6
--- /dev/null
+++ b/sci-chemistry/cyana/files/2.1-xiar.patch
@@ -0,0 +1,16 @@
+ src/inclan/Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/inclan/Makefile b/src/inclan/Makefile
+index fc5a8bf..482d48f 100644
+--- a/src/inclan/Makefile
++++ b/src/inclan/Makefile
+@@ -35,7 +35,7 @@ clean:
+
+ inclan.a: $(OBJS)
+ rm -f $@
+- ar rc $@ $(OBJS)
++ $(AR) rc $@ $(OBJS)
+ if [ "$(RANLIB)" ]; then $(RANLIB) $@; fi
+
+ inclan.o: inclan.for
diff --git a/sci-chemistry/cyana/metadata.xml b/sci-chemistry/cyana/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/cyana/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/dssp/Manifest b/sci-chemistry/dssp/Manifest
new file mode 100644
index 000000000000..a5bba878b984
--- /dev/null
+++ b/sci-chemistry/dssp/Manifest
@@ -0,0 +1 @@
+DIST dssp-2.2.1.tgz 47141 SHA256 5fb5e7c085de16c05981e3a72869c8b082911a0b46e6dcc6dbd669c9f267e8e1 SHA512 4a273714d6b3230daea166caa7f4117d5ccb225bea0cf1bc2eb61539b6cc8e227d0ba19047d61f0ad0d1d6bc2efdec9c193bd44341e15ef0950acb4a22498811 WHIRLPOOL abdb6777ccc06b062e3f20226c555348cd221d9c3e14d2adb9aeb85f14f84db8841c2fbbc4a487f5fa021da6616cddf2e96fde787d7670c419926d24d24944bd
diff --git a/sci-chemistry/dssp/dssp-2.2.1-r1.ebuild b/sci-chemistry/dssp/dssp-2.2.1-r1.ebuild
new file mode 100644
index 000000000000..5e8b800f9488
--- /dev/null
+++ b/sci-chemistry/dssp/dssp-2.2.1-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="The protein secondary structure standard"
+HOMEPAGE="http://swift.cmbi.ru.nl/gv/dssp/"
+SRC_URI="ftp://ftp.cmbi.ru.nl/pub/molbio/software/dssp-2/${P}.tgz"
+
+LICENSE="Boost-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="dev-libs/boost:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ tc-export CXX
+
+ cat >> make.config <<- EOF
+ BOOST_LIB_SUFFIX = -mt
+ BOOST_LIB_DIR = "${EPREFIX}/usr/$(get_libdir)"
+ BOOST_INC_DIR = "${EPREFIX}/usr/include"
+ EOF
+
+ epatch \
+ "${FILESDIR}"/${PN}-2.1.0-gentoo.patch
+}
+
+src_install() {
+ dobin mkdssp
+ dosym mkdssp /usr/bin/dssp
+ doman doc/mkdssp.1
+ dodoc README.txt changelog
+
+ cat >> "${T}"/30-${PN} <<- EOF
+ DSSP="${EPREFIX}"/usr/bin/${PN}
+ EOF
+ doenvd "${T}"/30-${PN}
+}
diff --git a/sci-chemistry/dssp/files/Makefile b/sci-chemistry/dssp/files/Makefile
new file mode 100644
index 000000000000..575202ebbe2d
--- /dev/null
+++ b/sci-chemistry/dssp/files/Makefile
@@ -0,0 +1,7 @@
+#OBJ = AccSurf.o CalcAccSurf.o Contacts.o Date.o Dssp.o DsspCMBI.o p2clib.o Vector.o
+OBJ = AccSurf.o CalcAccSurf.o Contacts.o Date.o DsspCMBI.o p2clib.o Vector.o
+
+LIBS = -lm
+
+dssp: $(OBJ)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
diff --git a/sci-chemistry/dssp/files/dssp-2.0.4-gcc47.patch b/sci-chemistry/dssp/files/dssp-2.0.4-gcc47.patch
new file mode 100644
index 000000000000..5db1437beb1f
--- /dev/null
+++ b/sci-chemistry/dssp/files/dssp-2.0.4-gcc47.patch
@@ -0,0 +1,46 @@
+ src/matrix.h | 5 +++--
+ src/primitives-3d.cpp | 1 +
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/matrix.h b/src/matrix.h
+index 1053ad9..d7dae5f 100644
+--- a/src/matrix.h
++++ b/src/matrix.h
+@@ -14,6 +14,7 @@
+ #include <istream>
+ #include <cassert>
+ #include <stdexcept>
++#include <unistd.h>
+
+ // --------------------------------------------------------------------
+ // uBlas compatible matrix types
+@@ -284,7 +285,7 @@ class identity_matrix : public matrix_base<T>
+ template<typename T>
+ matrix<T> operator*(const matrix_base<T>& lhs, const matrix_base<T>& rhs)
+ {
+- matrix<T> result(min(lhs.dim_m(), rhs.dim_m()), min(lhs.dim_n(), rhs.dim_n()));
++ matrix<T> result(std::min(lhs.dim_m(), rhs.dim_m()), std::min(lhs.dim_n(), rhs.dim_n()));
+
+ for (uint32 i = 0; i < result.dim_m(); ++i)
+ {
+@@ -310,7 +311,7 @@ matrix<T> operator*(const matrix_base<T>& lhs, T rhs)
+ template<typename T>
+ matrix<T> operator-(const matrix_base<T>& lhs, const matrix_base<T>& rhs)
+ {
+- matrix<T> result(min(lhs.dim_m(), rhs.dim_m()), min(lhs.dim_n(), rhs.dim_n()));
++ matrix<T> result(std::min(lhs.dim_m(), rhs.dim_m()), std::min(lhs.dim_n(), rhs.dim_n()));
+
+ for (uint32 i = 0; i < result.dim_m(); ++i)
+ {
+diff --git a/src/primitives-3d.cpp b/src/primitives-3d.cpp
+index b04e7c4..4532ecd 100644
+--- a/src/primitives-3d.cpp
++++ b/src/primitives-3d.cpp
+@@ -9,6 +9,7 @@
+
+ #include <valarray>
+ #include <cmath>
++#include <unistd.h>
+
+ #include <boost/foreach.hpp>
+ #define foreach BOOST_FOREACH
diff --git a/sci-chemistry/dssp/files/dssp-2.0.4-gentoo.patch b/sci-chemistry/dssp/files/dssp-2.0.4-gentoo.patch
new file mode 100644
index 000000000000..3db40f640ccd
--- /dev/null
+++ b/sci-chemistry/dssp/files/dssp-2.0.4-gentoo.patch
@@ -0,0 +1,70 @@
+ makefile | 24 ++++++++++++++----------
+ 1 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/makefile b/makefile
+index df699b7..9d2167b 100644
+--- a/makefile
++++ b/makefile
+@@ -2,7 +2,7 @@
+ #
+ # Copyright Maarten L. Hekkelman, Radboud University 2008-2011.
+ # Distributed under the Boost Software License, Version 1.0.
+-# (See accompanying file LICENSE_1_0.txt or copy at
++# (See aCXXompanying file LICENSE_1_0.txt or copy at
+ # http://www.boost.org/LICENSE_1_0.txt)
+ #
+ # This makefile includes a file called make.config. It will create a
+@@ -24,22 +24,23 @@ BOOST_LIBS = thread regex filesystem program_options date_time iostreams math_
+ LIBS = $(BOOST_LIBS:%=boost_%$(BOOST_LIB_SUFFIX)) z bz2
+
+ DEFINES = USE_COMPRESSION LINUX VERSION='"$(VERSION)"'
+-CC = c++
++CXX ?= c++
+
+-CFLAGS = $(INC_DIR:%=-I%) -iquote src -g -Wall -Wno-multichar -pthread
+-LDOPTS = $(LIB_DIR:%=-L%) $(LIBS:%=-l%) -g -pthread
++CPPFLAGS += $(INC_DIR:%=-I%) -iquote src
++CXXFLAGS += -Wall -Wno-multichar -pthread
++LDOPTS = $(LIB_DIR:%=-L%) $(LIBS:%=-l%) -pthread
+
+ OBJ_DIR = obj
+
+ ifeq ($(DEBUG),1)
+ OBJ_DIR := $(OBJ_DIR).dbg
+-CFLAGS += -g3
++CFLAGS +=
+ else
+ DEFINES += NDEBUG
+-CFLAGS += -O3
++CFLAGS +=
+ endif
+
+-CFLAGS += $(DEFINES:%=-D%)
++CPPFLAGS += $(DEFINES:%=-D%)
+
+ DIST_NAME = dssp-$(VERSION)
+
+@@ -49,17 +50,20 @@ OBJECTS = $(OBJ_DIR)/mkdssp.o $(OBJ_DIR)/dssp.o $(OBJ_DIR)/primitives-3d.o $(OBJ
+
+ mkdssp: $(OBJECTS)
+ @ echo linking $@
+- @ $(CC) -static -o $@ $^ $(LDOPTS)
++ $(CXX) $(LDFLAGS) -o $@ $^ $(LDOPTS)
+ @ echo OK
+
+ include $(OBJECTS:%.o=%.d)
+
+ $(OBJECTS:.o=.d):
+
+-$(OBJ_DIR)/%.o: %.cpp
++OBJ_DIR:
+ @ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi
++
++
++$(OBJ_DIR)/%.o: %.cpp OBJ_DIR
+ @ echo compiling $@
+- @ $(CC) -MD -c -o $@ $< $(CFLAGS)
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -c -o $@ $<
+
+ clean:
+ rm -rf $(OBJ_DIR)/* mkdssp
diff --git a/sci-chemistry/dssp/files/dssp-2.1.0-gentoo.patch b/sci-chemistry/dssp/files/dssp-2.1.0-gentoo.patch
new file mode 100644
index 000000000000..15198feaea19
--- /dev/null
+++ b/sci-chemistry/dssp/files/dssp-2.1.0-gentoo.patch
@@ -0,0 +1,60 @@
+ makefile | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/makefile b/makefile
+index d6f335e..68736c6 100644
+--- a/makefile
++++ b/makefile
+@@ -25,22 +25,23 @@ BOOST_LIBS = thread filesystem program_options iostreams system
+ LIBS = $(BOOST_LIBS:%=boost_%$(BOOST_LIB_SUFFIX)) z bz2
+
+ DEFINES = USE_COMPRESSION LINUX VERSION='"$(VERSION)"'
+-CXX = g++
++CXX ?= g++
+
+-CFLAGS += $(INC_DIR:%=-I%) -iquote src -g -Wall -Wno-multichar -pthread
+-LDOPTS += $(LIB_DIR:%=-L%) $(LIBS:%=-l%) -g -pthread
++CPPFLAGS += $(INC_DIR:%=-I%) -iquote src
++CXXFLAGS += -Wall -Wno-multichar -pthread
++LDOPTS += $(LIB_DIR:%=-L%) $(LIBS:%=-l%) -pthread
+
+ OBJ_DIR = obj
+
+ ifeq ($(DEBUG),1)
+ OBJ_DIR := $(OBJ_DIR).dbg
+-CFLAGS += -g3
++CFLAGS +=
+ else
+ DEFINES += NDEBUG
+-CFLAGS += -O3
++CFLAGS +=
+ endif
+
+-CFLAGS += $(DEFINES:%=-D%)
++CPPFLAGS += $(DEFINES:%=-D%)
+
+ DIST_NAME = dssp-$(VERSION)
+
+@@ -50,18 +51,18 @@ OBJECTS = $(OBJ_DIR)/mkdssp.o $(OBJ_DIR)/dssp.o $(OBJ_DIR)/primitives-3d.o $(OBJ
+
+ mkdssp: $(OBJECTS)
+ @ echo linking $@
+- @ $(CXX) -static -o $@ $^ $(LDOPTS)
++ $(CXX) $(LDFLAGS) -o $@ $^ $(LDOPTS)
+
+ include $(OBJECTS:%.o=%.d)
+
+ $(OBJECTS:.o=.d):
+
+-$(OBJ_DIR):
++OBJ_DIR:
+ @ mkdir -p $(OBJ_DIR)
+
+-$(OBJ_DIR)/%.o: %.cpp | $(OBJ_DIR)
++$(OBJ_DIR)/%.o: %.cpp OBJ_DIR
+ @ echo compiling $@
+- @ $(CXX) -MD -c -o $@ $< $(CFLAGS)
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -c -o $@ $<
+
+ clean:
+ install -d $(BIN_DIR) $(MAN_DIR)
diff --git a/sci-chemistry/dssp/metadata.xml b/sci-chemistry/dssp/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/dssp/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/easychem/Manifest b/sci-chemistry/easychem/Manifest
new file mode 100644
index 000000000000..8c12b1a64218
--- /dev/null
+++ b/sci-chemistry/easychem/Manifest
@@ -0,0 +1 @@
+DIST easychem-0.6.tar.gz 265458 SHA256 1dba1a1ed1862c723cd77184a90ee7571a26ebcb0d3c22e7e032af1cbafe284d SHA512 83f877d1813287592a460f4dc3769feda88e45d8f77cd728c4055b60521babe253b4432033941ff429c753cfe675a642714052a01736534147398d6972e47051 WHIRLPOOL 7869025a921b2a6ada516f60c3e79247b1ad74a0bb904f7dd9b7bd993b3b5166ccd3f266f6c2e85198c8bde1ddaf863518a7adea7a6fd9b22bf789e1df7103fe
diff --git a/sci-chemistry/easychem/easychem-0.6-r1.ebuild b/sci-chemistry/easychem/easychem-0.6-r1.ebuild
new file mode 100644
index 000000000000..932cf7709daa
--- /dev/null
+++ b/sci-chemistry/easychem/easychem-0.6-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Chemical structure drawing program - focused on presentation"
+HOMEPAGE="http://easychem.sourceforge.net/"
+SRC_URI="mirror://sourceforge/easychem/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ x11-libs/gtk+:2
+ app-text/ghostscript-gpl
+ media-gfx/pstoedit"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ tc-export CC
+}
+
+src_compile() {
+ ln -s Makefile.linux Makefile || die
+ DGS_PATH="${EPREFIX}"/usr/bin DPSTOEDIT_PATH="${EPREFIX}"/usr/bin \
+ C_FLAGS="${CFLAGS}" emake -e
+}
+
+src_install () {
+ dobin easychem
+ dodoc TODO
+}
diff --git a/sci-chemistry/easychem/files/0.6-gentoo.patch b/sci-chemistry/easychem/files/0.6-gentoo.patch
new file mode 100644
index 000000000000..000e4373b3c2
--- /dev/null
+++ b/sci-chemistry/easychem/files/0.6-gentoo.patch
@@ -0,0 +1,65 @@
+diff --git a/Makefile.linux b/Makefile.linux
+index 6638394..5da56b0 100644
+--- a/Makefile.linux
++++ b/Makefile.linux
+@@ -1,5 +1,5 @@
+ # The C compiler
+-CC=gcc
++CC ?= gcc
+
+ # The following line must be uncommented if you want to specify a place
+ # where the 'gs' (or 'pstoedit') program is.
+@@ -25,11 +25,10 @@ GTK_LIBS=`pkg-config --libs gtk+-2.0`
+ # The list of important files
+ OBJECTS=auxi.o bonds.o easychem.o export.o dialogs.o detect.o library.o drawing.o
+
+-all: easychem po/
++all: easychem po
+
+-easychem: postscript/ graph/ $(OBJECTS)
+- $(CC) -o easychem $(OBJECTS) $(GTK_LIBS) $(C_FLAGS)
+- strip easychem
++easychem: postscript graph $(OBJECTS)
++ $(CC) $(C_FLAGS) $(LDFLAGS) -o easychem $(OBJECTS) $(GTK_LIBS) -lm
+
+ clean: FORCE
+ -cd graph; make clean
+@@ -37,7 +36,7 @@ clean: FORCE
+ -cd po; make clean
+ -rm $(OBJECTS) easychem
+
+-export.o: export.c common.h bonds.h postscript/
++export.o: export.c common.h bonds.h postscript
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c export.c
+ bonds.o: bonds.c common.h bonds.h
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c bonds.c
+@@ -49,20 +48,22 @@ library.o: library.c common.h library.h
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c library.c
+ drawing.o: drawing.c common.h drawing.h
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c drawing.c
+-dialogs.o: dialogs.c common.h dialogs.h graph/
++dialogs.o: dialogs.c common.h dialogs.h graph
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c dialogs.c
+ detect.o: detect.c common.h detect.h
+ $(CC) $(GTK_FLAGS) $(C_FLAGS) -c detect.c
+
+ # The rules for subdirectories
+-graph/: FORCE
+- cd graph; make all
++graph:
++ +make -C $@
+
+-postscript/: FORCE
+- cd postscript; make all
++postscript:
++ +make -C $@
+
+-po/: FORCE
+- cd po; make all
++po:
++ +make -C $@
+
+ # This is used to force an update
+ FORCE:
++
++.PHONY: graph postscript po
diff --git a/sci-chemistry/easychem/files/easychem-0.6-prestrip.patch b/sci-chemistry/easychem/files/easychem-0.6-prestrip.patch
new file mode 100644
index 000000000000..a1cbbb055d0c
--- /dev/null
+++ b/sci-chemistry/easychem/files/easychem-0.6-prestrip.patch
@@ -0,0 +1,10 @@
+--- Makefile.linux.orig 2009-02-23 21:17:25.000000000 +0200
++++ Makefile.linux 2009-02-23 21:17:50.000000000 +0200
+@@ -29,7 +29,6 @@
+
+ easychem: postscript/ graph/ $(OBJECTS)
+ $(CC) -o easychem $(OBJECTS) $(GTK_LIBS) $(C_FLAGS)
+- strip easychem
+
+ clean: FORCE
+ -cd graph; make clean
diff --git a/sci-chemistry/easychem/metadata.xml b/sci-chemistry/easychem/metadata.xml
new file mode 100644
index 000000000000..0a2ea04beeec
--- /dev/null
+++ b/sci-chemistry/easychem/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-chemistry</herd>
+ <longdescription>
+ EasyChem is a program designed to draw chemical molecules, written under
+ Linux using Gtk+ 2.4. It is implemented with a strong focus on producing
+ press quality molecules. Easychem can be a little more difficult to learn to
+ use, but when mastered it can be very fast and powerful. It can draw
+ ornaments easily, and exports to EPS with LaTeX fonts among other things.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">easychem</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/eden/Manifest b/sci-chemistry/eden/Manifest
new file mode 100644
index 000000000000..c0087f8f962b
--- /dev/null
+++ b/sci-chemistry/eden/Manifest
@@ -0,0 +1 @@
+DIST eden_V5.3.tar.gz 1139981 SHA256 249447f507ace3e188ce0d76796c6e307c043592405db1f6c24f3e90917ec524 SHA512 c59d08004bdb72ef39fe205aef546fbcff9c57ee42942c0391052de9c501c7793ed3bd280569020c2b9ec6133a87362d184a2012b61c6be18b5f6ba9b59716c5 WHIRLPOOL f0329805ab1d3b75febcc07c87583ee30f2ca44d5b5ae5c3512d4891a8763bf45ab7dc94abed831c0326cdbc35502f4bc3904ccb7447b090100b2f7d52b1156b
diff --git a/sci-chemistry/eden/eden-5.3-r2.ebuild b/sci-chemistry/eden/eden-5.3-r2.ebuild
new file mode 100644
index 000000000000..8dc430e329b1
--- /dev/null
+++ b/sci-chemistry/eden/eden-5.3-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+MY_P="${PN}_V${PV}"
+
+DESCRIPTION="A crystallographic real-space electron-density refinement and optimization program"
+HOMEPAGE="http://www.gromacs.org/pipermail/eden-users/"
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="double-precision"
+
+RDEPEND="
+ sci-libs/fftw:2.1
+ sci-libs/gsl"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+SRC="${S}/source"
+
+pkg_setup() {
+ export EDENHOME="${EPREFIX}/usr/$(get_libdir)/${PN}"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-makefile-fixes.patch \
+ "${FILESDIR}"/${P}-impl-dec.patch \
+ "${FILESDIR}"/${P}-format-security.patch
+
+ sed -i \
+ -e "s:^\(FFTW.*=\).*:\1 ${EPREFIX}/usr:g" \
+ -e "s:^\(LIB.*=.*\$(FFTW)/\).*:\1$(get_libdir):g" \
+ -e "s:^\(BIN.*=\).*:\1 ${D}usr/bin:g" \
+ -e "s:^\(CFLAGS.*=\).*:\1 ${CFLAGS}:g" \
+ -e "s:-lgsl -lgslcblas:$($(tc-getPKG_CONFIG) --libs gsl):g" \
+ ${SRC}/Makefile || die
+
+ if ! use double-precision; then
+ sed -i -e "s:^\(DOUBLESWITCH.*=\).*:\1 OFF:g" ${SRC}/Makefile || die
+ EDEN_EXE="s${PN}"
+ else
+ EDEN_EXE="d${PN}"
+ fi
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) -C ${SRC}
+}
+
+src_install() {
+ emake -C ${SRC} install
+
+ python_foreach_impl python_newscript python/${PN}.py i${PN}
+ python_foreach_impl python_domodule python/FileListDialog.py
+
+ rm python/*py || die
+ insinto ${EDENHOME}/python
+ doins python/*
+
+ insinto ${EDENHOME}/help
+ doins help/*
+
+ insinto ${EDENHOME}/tools
+ doins tools/*
+
+ dodoc manual/UserManual.pdf
+
+ cat >> "${T}"/60${PN} <<- EOF
+ EDENHOME="${EDENHOME}"
+ EOF
+
+ doenvd "${T}"/60${PN}
+
+ dosym ${EDEN_EXE} /usr/bin/${PN}
+}
diff --git a/sci-chemistry/eden/files/5.3-makefile-fixes.patch b/sci-chemistry/eden/files/5.3-makefile-fixes.patch
new file mode 100644
index 000000000000..632358341784
--- /dev/null
+++ b/sci-chemistry/eden/files/5.3-makefile-fixes.patch
@@ -0,0 +1,60 @@
+ source/Makefile | 17 ++++++++++-------
+ 1 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/source/Makefile b/source/Makefile
+index 46d89cc..aa751c7 100644
+--- a/source/Makefile
++++ b/source/Makefile
+@@ -78,8 +78,10 @@ CFLAGS = -Wall -pipe -g3
+ #CFLAGS = -Wall -pipe -marchi686 -pedantic -gdwarf-2 -g3
+ #CFLAGS = -Wall -O3 -march=i686
+ ifneq ($(FFTW),/usr/local)
++ifneq ($(FFTW),/usr)
+ CFLAGS += -I$(INC)
+ endif
++endif
+
+ # NOTE:
+ # DOUBLESWITCH = ON for double precision;
+@@ -91,15 +93,15 @@ endif
+ DOUBLESWITCH = ON
+
+ ifeq ($(DOUBLESWITCH),ON)
+-LDFLAGS = -L$(LIB) -ldfftw -lm
++LIBS = -L$(LIB) -ldfftw -lm
+ CFLAGS += -DDOUBLE
+ TARGET = deden
+ else
+-LDFLAGS = -L$(LIB) -lsfftw -lm
++LIBS = -L$(LIB) -lsfftw -lm
+ TARGET = seden
+ endif
+
+-LDFLAGS += -g -lgsl -lgslcblas
++LIBS += -lgsl -lgslcblas
+
+ # GSL_PREFIX:= /sw/lib
+ # LDFLAGS += -l$(GSL_PREFIX)/libgsl.a -l$(GSL_PREFIX)/libgslcblas.a
+@@ -120,17 +122,18 @@ OBJ = addmaps.o apodfc.o apodfo.o back.o cadhkl.o \
+ all: eden fbyteswap
+
+ eden: eden.o $(OBJ)
+- $(CC) $^ $(LDFLAGS) -o $@
++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ fbyteswap: fbyteswap.c
+- $(CC) -o $@ $^
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ install: all
++ mkdir -p $(BIN)
+ mv fbyteswap $(BIN)
+ mv eden $(BIN)/$(TARGET)
+ chmod 751 $(BIN)/$(TARGET)
+- chmod +x mkeden.csh
+- ./mkeden.csh $(BIN) $(BIN)/$(TARGET)
++# chmod +x mkeden.csh
++# ./mkeden.csh $(BIN) $(BIN)/$(TARGET)
+
+ dist: clean
+ cd ../..; tar -cvf eden_$(VERSION).tar --exclude CVS --exclude \#\*\# --exclude \*~ --exclude Misc --exclude .\* eden; gzip -f eden_$(VERSION).tar
diff --git a/sci-chemistry/eden/files/eden-5.3-format-security.patch b/sci-chemistry/eden/files/eden-5.3-format-security.patch
new file mode 100644
index 000000000000..04b5ecfddebb
--- /dev/null
+++ b/sci-chemistry/eden/files/eden-5.3-format-security.patch
@@ -0,0 +1,96 @@
+ source/back.c | 2 +-
+ source/concosts.c | 4 ++--
+ source/count.c | 4 ++--
+ source/eden.c | 2 +-
+ source/util.c | 4 ++--
+ 5 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/source/back.c b/source/back.c
+index fd517b9..185a02b 100644
+--- a/source/back.c
++++ b/source/back.c
+@@ -112,7 +112,7 @@ void back_main(int argc, char *argv[])
+ ballpark(caller) ;
+
+ if (argc > optind+2)
+- sprintf(sf_filename, argv[optind+2]) ;
++ sprintf(sf_filename, "%s", argv[optind+2]) ;
+
+ /*********************************************
+ Pull off prefix defining whereabouts of input
+diff --git a/source/concosts.c b/source/concosts.c
+index d62d2e3..590f073 100644
+--- a/source/concosts.c
++++ b/source/concosts.c
+@@ -452,7 +452,7 @@ void prepare_singlets(char *filename)
+ sprintf(message,
+ "s=%d, p=%d, n=%d, phase=%g, old phase=%g, delta=%g\n",
+ s, p, n, phase, *(checks+n), phase-*(checks+n)) ;
+- fprintf(fp_log, message) ;
++ fprintf(fp_log, "%s", message) ;
+ }
+ }
+ /***********************************************
+@@ -556,7 +556,7 @@ void prepare_triplets(char *filename)
+ sprintf(message,
+ "Triplet (%d %d %d) from input (%d %d %d) corresponds to point w/o fobs info!\n",
+ newh, newk, newl, t_h[q], t_k[q], t_l[q]) ;
+- fprintf(fp_log, message) ;
++ fprintf(fp_log, "%s", message) ;
+ legal_triplet = FALSE ;
+ }
+ }
+diff --git a/source/count.c b/source/count.c
+index c3bc390..ca13008 100644
+--- a/source/count.c
++++ b/source/count.c
+@@ -460,12 +460,12 @@ void print_el_count(char *filename,
+ }
+
+ sprintf(message, "\nTotal no. of electrons is %g\n", totnump*volvox) ;
+- fprintf(fp, message) ;
++ fprintf(fp, "%s", message) ;
+ printTwice(message) ;
+
+ sprintf(message, "Count of all remaining electrons: %g %g %g\n",
+ remainder0*volvox, remainder1*volvox, remainder2*volvox) ;
+- fprintf(fp, message) ;
++ fprintf(fp, "%s", message) ;
+ printTwice(message) ;
+
+ fclose(fp) ;
+diff --git a/source/eden.c b/source/eden.c
+index dea3246..5a9b389 100644
+--- a/source/eden.c
++++ b/source/eden.c
+@@ -319,7 +319,7 @@ int main(int argc, char *argv[])
+
+ get_unique_logname() ;
+
+- sprintf(command_line, argv[0]) ;
++ sprintf(command_line, "%s", argv[0]) ;
+
+ for (k = 1; k < argc; k++) {
+ strcat(command_line, " ") ;
+diff --git a/source/util.c b/source/util.c
+index 6fff179..41c624c 100644
+--- a/source/util.c
++++ b/source/util.c
+@@ -266,7 +266,7 @@ void printTwice(char *mess) /* send info to terminal (stdout) and to log */
+
+ void prompt(char *mess) /* Send message to user, await reply */
+ {
+- fprintf(stdout, mess) ;
++ fprintf(stdout, "%s", mess) ;
+
+ while (fgets(terminp, MAXSTRING, stdin) != NULL) {
+ if ((int)strlen(terminp) > 0)
+@@ -722,7 +722,7 @@ void start_record()
+ int k ;
+
+ rec_length = k = sprintf(record, "\n") ;
+- rec_length += sprintf(record+k, timestamp()) ;
++ rec_length += sprintf(record+k, "%s", timestamp()) ;
+ k = rec_length ;
+
+ if ((cwd = getcwd(NULL, 120)) == NULL)
diff --git a/sci-chemistry/eden/files/eden-5.3-impl-dec.patch b/sci-chemistry/eden/files/eden-5.3-impl-dec.patch
new file mode 100644
index 000000000000..af67508d090e
--- /dev/null
+++ b/sci-chemistry/eden/files/eden-5.3-impl-dec.patch
@@ -0,0 +1,28 @@
+ source/fbyteswap.c | 1 +
+ source/util.c | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/source/fbyteswap.c b/source/fbyteswap.c
+index 83015b9..c9033c3 100644
+--- a/source/fbyteswap.c
++++ b/source/fbyteswap.c
+@@ -39,6 +39,7 @@ and shall not be used for advertising or product endorsement purposes.
+
+ #include <stdio.h>
+ #include <fcntl.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ void byteswap();
+diff --git a/source/util.c b/source/util.c
+index 6fff179..ca7a957 100644
+--- a/source/util.c
++++ b/source/util.c
+@@ -89,6 +89,7 @@ and shall not be used for advertising or product endorsement purposes.
+
+ *******************************************************************************/
+ #include <sys/time.h> /* ... for picking up date & time */
++#include <time.h>
+ #include <signal.h> /* ... for capturing kill */
+ #include "util.h"
+
diff --git a/sci-chemistry/eden/files/makefile-fixes.patch b/sci-chemistry/eden/files/makefile-fixes.patch
new file mode 100644
index 000000000000..4cfff3f515df
--- /dev/null
+++ b/sci-chemistry/eden/files/makefile-fixes.patch
@@ -0,0 +1,25 @@
+diff -ur eden.orig/source/Makefile eden/source/Makefile
+--- eden.orig/source/Makefile 2004-10-18 10:40:03.000000000 -0700
++++ eden/source/Makefile 2005-12-15 22:32:45.000000000 -0800
+@@ -78,8 +78,10 @@
+ #CFLAGS = -Wall -pipe -marchi686 -pedantic -gdwarf-2 -g3
+ #CFLAGS = -Wall -O3 -march=i686
+ ifneq ($(FFTW),/usr/local)
++ifneq ($(FFTW),/usr)
+ CFLAGS += -I$(INC)
+ endif
++endif
+
+ # NOTE:
+ # DOUBLESWITCH = ON for double precision;
+@@ -129,8 +131,8 @@
+ mv fbyteswap $(BIN)
+ mv eden $(BIN)/$(TARGET)
+ chmod 751 $(BIN)/$(TARGET)
+- chmod +x mkeden.csh
+- ./mkeden.csh $(BIN) $(BIN)/$(TARGET)
++# chmod +x mkeden.csh
++# ./mkeden.csh $(BIN) $(BIN)/$(TARGET)
+
+ dist: clean
+ cd ../..; tar -cvf eden_$(VERSION).tar --exclude CVS --exclude \#\*\# --exclude \*~ --exclude Misc --exclude .\* eden; gzip -f eden_$(VERSION).tar
diff --git a/sci-chemistry/eden/metadata.xml b/sci-chemistry/eden/metadata.xml
new file mode 100644
index 000000000000..732277b2b750
--- /dev/null
+++ b/sci-chemistry/eden/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-chemistry</herd>
+ <use>
+ <flag name="double-precision">More precise calculations at the expense of
+ speed</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/elem/Manifest b/sci-chemistry/elem/Manifest
new file mode 100644
index 000000000000..49bd992fc961
--- /dev/null
+++ b/sci-chemistry/elem/Manifest
@@ -0,0 +1 @@
+DIST elem-src-1.0.3-Linux.tgz 58364 SHA256 a570736165b939841a9dbf273110a6c01ddfd77559e5b020574aad8e3f5af296
diff --git a/sci-chemistry/elem/elem-1.0.3-r1.ebuild b/sci-chemistry/elem/elem-1.0.3-r1.ebuild
new file mode 100644
index 000000000000..386caa804b61
--- /dev/null
+++ b/sci-chemistry/elem/elem-1.0.3-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="periodic table of the elements"
+HOMEPAGE="http://elem.sourceforge.net/"
+SRC_URI="mirror://sourceforge/elem/${PN}-src-${PV}-Linux.tgz"
+LICENSE="GPL-2"
+KEYWORDS="amd64 sparc x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="x11-libs/xforms"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -e 's:\(^LIBS = .*\):\1 -lXpm:' -i Makefile || die "sed failed"
+}
+
+src_compile () {
+ emake COMPILER="$(tc-getCC)" FLAGS="${CFLAGS}" all || die "Build failed."
+}
+
+src_install () {
+ into /usr
+ dobin elem elem-de elem-en
+ dohtml -r doc/*
+}
diff --git a/sci-chemistry/elem/elem-1.0.3-r2.ebuild b/sci-chemistry/elem/elem-1.0.3-r2.ebuild
new file mode 100644
index 000000000000..c52107340659
--- /dev/null
+++ b/sci-chemistry/elem/elem-1.0.3-r2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="periodic table of the elements"
+HOMEPAGE="http://elem.sourceforge.net/"
+SRC_URI="mirror://sourceforge/elem/${PN}-src-${PV}-Linux.tgz"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~sparc ~x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="x11-libs/xforms"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -e 's:\(^LIBS = .*\):\1 -lXpm:' \
+ -e "s:\${FLAGS} -o elem:\$(LDFLAGS) &:" \
+ -i Makefile || die #336190
+ sed -e "/string.h/ i #include <stdlib.h>" \
+ -i elem_cb.c || die #implicit exit()
+}
+
+src_compile () {
+ emake COMPILER="$(tc-getCC)" FLAGS="${CFLAGS}" all || die "Build failed."
+}
+
+src_install () {
+ dobin elem elem-de elem-en || die
+ dohtml -r doc/* || die
+}
diff --git a/sci-chemistry/elem/metadata.xml b/sci-chemistry/elem/metadata.xml
new file mode 100644
index 000000000000..841c9b22af92
--- /dev/null
+++ b/sci-chemistry/elem/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">elem</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/freeon/Manifest b/sci-chemistry/freeon/Manifest
new file mode 100644
index 000000000000..39a7e4aedcc1
--- /dev/null
+++ b/sci-chemistry/freeon/Manifest
@@ -0,0 +1,2 @@
+DIST freeon-1.0.10.tar.bz2 5872019 SHA256 01f0086a53930afb3078a2794baa1fccdacdc4a23082725cb016068d5a10ec38 SHA512 5bae89d6421600792bf986f6fb7504d321d5d51782587237ecba35191e54c1ec6c5ea1fdc50ed2d339551c527e4efcc5421048ccce0404c4b06875cbd0800862 WHIRLPOOL 84fcf7ca4d62e5a2407f2920f9a13fd2a4930f2637d098954b3be81f540e4a10344d17053a1d05046c2743f317a8898886148439d51364ce10dc66a313eadb8b
+DIST freeon-1.0.8.tar.bz2 5957707 SHA256 ae14c1b640e4dcd9f18d2807f2debf9fc005b7451401e3e5d7b9dc76919f381d SHA512 1227f670a73b4ea39beb26e4136ad535e126ad17d66171c31b3bd403a3886eee150cda865806a2d9dad85646ccb086a6be4f645455eab24603cb064fb725efbd WHIRLPOOL b41a3b1e4bb152309a12ac0c4fec07c932809bb465af4b08cb76f6e0bf089c4d91682e1428c47d1adb449d153a1338cd3d540e860ca22774a299e21da44a16c1
diff --git a/sci-chemistry/freeon/files/freeon-1.0.8-blas.patch b/sci-chemistry/freeon/files/freeon-1.0.8-blas.patch
new file mode 100644
index 000000000000..46fca7fa2a52
--- /dev/null
+++ b/sci-chemistry/freeon/files/freeon-1.0.8-blas.patch
@@ -0,0 +1,165 @@
+ FreeON/Makefile.am | 2 +-
+ HiCu/Makefile.am | 2 +-
+ ONX/Makefile.am | 1 +
+ OneE/Makefile.am | 2 +-
+ QCTC/Makefile.am | 2 +-
+ SCFeqs/Makefile.am | 2 +-
+ configure.ac | 12 ++++++++----
+ make.inc | 2 +-
+ tests/Makefile.am | 8 ++++----
+ tools/Makefile.am | 2 +-
+ 10 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/FreeON/Makefile.am b/FreeON/Makefile.am
+index 18e0283..12db056 100644
+--- a/FreeON/Makefile.am
++++ b/FreeON/Makefile.am
+@@ -50,7 +50,7 @@ FreeON_DEPENDENCIES = $(LIBRARY_DEPENDENCY_FILES)
+
+ SOURCES_DEPCHECK = $(FreeON_SOURCES)
+
+-FreeON_LDADD = $(LDADD_MODULES)
++FreeON_LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ AM_CPPFLAGS += \
+ -DFREEON_BASISSETS=\"$(datadir)/$(PACKAGE)/BasisSets\" \
+diff --git a/HiCu/Makefile.am b/HiCu/Makefile.am
+index 1847354..cc4ebef 100644
+--- a/HiCu/Makefile.am
++++ b/HiCu/Makefile.am
+@@ -27,7 +27,7 @@ EXTRA_DIST = \
+ MMA/CubeRules/RuleD.Inc \
+ MMA/CubeRules/RuleE.Inc
+
+-LDADD = $(LDADD_MODULES)
++LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ EXTRA_INCLUDES = -I$(top_srcdir)/Modules/MMA/Functionals
+ AM_CPPFLAGS += -DRULE7 -DEXPLICIT_SOURCE
+diff --git a/ONX/Makefile.am b/ONX/Makefile.am
+index 4d25029..b27b149 100644
+--- a/ONX/Makefile.am
++++ b/ONX/Makefile.am
+@@ -61,6 +61,7 @@ EXTRA_INCLUDES = \
+
+ LDADD = \
+ $(LDADD_MODULES) \
++ $(LAPACK_LIBS) \
+ $(builddir)/../TwoE/libfreeonTwoE.la
+
+ # In case we have ctags installed, make the necessary tags files.
+diff --git a/OneE/Makefile.am b/OneE/Makefile.am
+index 784bede..ea86ae7 100644
+--- a/OneE/Makefile.am
++++ b/OneE/Makefile.am
+@@ -46,7 +46,7 @@ EXTRA_DIST = \
+ MMA/QQuad32.Inc \
+ MMA/QQuad64.Inc
+
+-LDADD = $(LDADD_MODULES)
++LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ EXTRA_INCLUDES = -I$(srcdir)/MMA
+
+diff --git a/QCTC/Makefile.am b/QCTC/Makefile.am
+index 3ec39f0..53c358c 100644
+--- a/QCTC/Makefile.am
++++ b/QCTC/Makefile.am
+@@ -105,7 +105,7 @@ EXTRA_DIST = \
+ PBCTensor/Majik_Kubic_WS2.Inc
+
+ EXTRA_INCLUDES = -I$(top_builddir)/OneE -I$(top_srcdir)/Modules/MMA/LookUpTables_800_6x
+-LDADD = $(LDADD_MODULES) libktrax.la
++LDADD = $(LDADD_MODULES) libktrax.la $(LAPACK_LIBS)
+
+ # In case we have ctags installed, make the necessary tags files.
+ .PHONY : tags
+diff --git a/SCFeqs/Makefile.am b/SCFeqs/Makefile.am
+index 2ee640f..709f220 100644
+--- a/SCFeqs/Makefile.am
++++ b/SCFeqs/Makefile.am
+@@ -57,7 +57,7 @@ SOURCES_DEPCHECK = \
+ $(P2Use_SOURCES) \
+ $(DIIS_SOURCES)
+
+-LDADD = $(LDADD_MODULES)
++LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ # In case we have ctags installed, make the necessary tags files.
+ .PHONY : tags
+diff --git a/configure.ac b/configure.ac
+index e0c6a77..726c880 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -784,12 +784,16 @@ END PROGRAM test_compiler
+ you use a version >= 4.2.0])])
+
+ # Check for BLAS.
+-AC_SEARCH_LIBS([dgemm], [blas], [],
+- [AC_MSG_FAILURE([specify the location of dgemm()])])
++PKG_CHECK_MODULES([BLAS],[blas],[],
++ AC_SEARCH_LIBS([dgemm], [blas], [],
++ [AC_MSG_FAILURE([specify the location of dgemm()])])
++ )
+
+ # Check for LAPACK.
+-AC_SEARCH_LIBS([dsyev], [lapack], [],
+- [AC_MSG_FAILURE([specify the library that contains dsyev()])])
++PKG_CHECK_MODULES([LAPACK],[lapack],[],
++ AC_SEARCH_LIBS([dsyev], [lapack], [],
++ [AC_MSG_FAILURE([specify the library that contains dsyev()])])
++ )
+
+ AC_ARG_VAR([H5CC], [h5cc compiler wrapper command])
+
+diff --git a/make.inc b/make.inc
+index cf35e40..5766ff9 100644
+--- a/make.inc
++++ b/make.inc
+@@ -9,7 +9,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@
+ # Fix for bug in autoconf-2.59
+ builddir = .
+
+-LDADD_MODULES = $(top_builddir)/Modules/libfreeonmodules.la
++LDADD_MODULES = $(top_builddir)/Modules/libfreeonmodules.la $(LAPACK_MODULES)
+
+ # On filesystems which are case-insensitive (which really means HFS+ on OS X)
+ # we can not preprocess into a filename that differs by the case only, i.e. .C
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 6bd89f2..ae9da60 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -7,16 +7,16 @@ noinst_PROGRAMS = \
+ sendReceive_HGRho
+
+ sleeper_SOURCES = sleeper.F90
+-sleeper_LDADD = $(LDADD_MODULES)
++sleeper_LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ lock_SOURCES = lock.F90
+-lock_LDADD = $(LDADD_MODULES)
++lock_LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ sendReceive_DBL_RNK2_SOURCES = sendReceive_DBL_RNK2.F90
+-sendReceive_DBL_RNK2_LDADD = $(LDADD_MODULES)
++sendReceive_DBL_RNK2_LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ sendReceive_HGRho_SOURCES = sendReceive_HGRho.F90
+-sendReceive_HGRho_LDADD = $(LDADD_MODULES)
++sendReceive_HGRho_LDADD = $(LDADD_MODULES) $(LAPACK_LIBS)
+
+ if HAVE_MPIRUN
+ MPI_TESTS = locktest
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index e0baaff..a6b18b2 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -19,7 +19,7 @@ python_PYTHON = \
+ bin_PROGRAMS = printBCSR convertBCSR
+
+ printBCSR_SOURCES = printBCSR.F90
+-printBCSR_LDADD = $(top_builddir)/Modules/libfreeonmodules.la
++printBCSR_LDADD = $(top_builddir)/Modules/libfreeonmodules.la $(LAPACK_LIBS)
+
+ convertBCSR_SOURCES = \
+ convertBCSR.cc \
diff --git a/sci-chemistry/freeon/freeon-1.0.10.ebuild b/sci-chemistry/freeon/freeon-1.0.10.ebuild
new file mode 100644
index 000000000000..f19ae3f6fb89
--- /dev/null
+++ b/sci-chemistry/freeon/freeon-1.0.10.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+FORTRAN_STANDARD=90
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools-utils fortran-2 python-any-r1
+
+DESCRIPTION="An experimental suite of programs for linear scaling quantum chemistry"
+HOMEPAGE="http://www.freeon.org"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${PN}-${PV}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ sci-libs/hdf5
+ virtual/blas
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
diff --git a/sci-chemistry/freeon/freeon-1.0.8-r1.ebuild b/sci-chemistry/freeon/freeon-1.0.8-r1.ebuild
new file mode 100644
index 000000000000..9a847d58768e
--- /dev/null
+++ b/sci-chemistry/freeon/freeon-1.0.8-r1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+FORTRAN_STANDARD=90
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools-utils fortran-2 python-any-r1
+
+DESCRIPTION="An experimental suite of programs for linear scaling quantum chemistry"
+HOMEPAGE="http://www.freeon.org"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${PN}-${PV}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ sci-libs/hdf5
+ virtual/blas
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+PATCHES=( "${FILESDIR}"/${P}-blas.patch )
diff --git a/sci-chemistry/freeon/metadata.xml b/sci-chemistry/freeon/metadata.xml
new file mode 100644
index 000000000000..eba82069680b
--- /dev/null
+++ b/sci-chemistry/freeon/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ FreeON is an experimental, open source (GPL) suite of programs for linear scaling quantum chemistry.
+ </longdescription>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>nicolasbock@gentoo.org</email>
+ <name>Nicolas Bock</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/gabedit/Manifest b/sci-chemistry/gabedit/Manifest
new file mode 100644
index 000000000000..545d0a84c3ae
--- /dev/null
+++ b/sci-chemistry/gabedit/Manifest
@@ -0,0 +1,3 @@
+DIST GabeditSrc246.tar.gz 1964406 SHA256 3881df1f2d4788d4b3660e7d8af0f7318223dd50194fd9ed0072dd58a6beaa12 SHA512 fbd92ff532ce21e97dcc2d012927fb0d19f4634956e88122a8e9a41e9484592ede455c3a88670cbd1c6387a4d0916425f897d2ade1957ebf4b25b89c7365a076 WHIRLPOOL 12be8d5299e6adcb63e4c989542f2fae02136a18bf515ded7ce8f7b3ab4e69f9fb085778be0bd5589b9ae42b7fd80c5ea7fa451a24377e5feedeb09ddff7a6b7
+DIST GabeditSrc247.tar.gz 1990187 SHA256 e9f84aae6751146f72e5cd8d3f33ec68f057f720edc68e3a89d53c5a2c3c9020 SHA512 a562dd650f9dc90a3c28a6d6b45212dc1d945548c9021f84e25a96022e67f95309030ded30bc20c052526783d0613f328830c640955822237828fcbac6d91b95 WHIRLPOOL f6a69e8e6a60fb48ef23849538a8718f507abc4e09de97abe10016ecf7b4ae101c09135f2762d7db7d764c4a66f9a268bd194ece9f05d6162b94a70b36ccec7a
+DIST GabeditSrc248.tar.gz 1992373 SHA256 38d6437a18280387b46fd136f2201a73b33e45abde13fa802c64806b6b64e4d3 SHA512 d06b54693c4887e3cecb6bb20b98307db8aeb7f32ff87b85af536a4034f2d6af04f30809c04e29ed6fb4744e6290dcd276c9f85b2940daa71a595f6bd5f154da WHIRLPOOL c47cf238b7080dbeddb3992162e6bb31f17a33623299a0bc4608aa86d2d4ff71f18159f3ca952d71251b039ace9bca0d3736a56af3e1dc8305200395c2a422e3
diff --git a/sci-chemistry/gabedit/files/CONFIG.Gentoo b/sci-chemistry/gabedit/files/CONFIG.Gentoo
new file mode 100644
index 000000000000..9cf387c752eb
--- /dev/null
+++ b/sci-chemistry/gabedit/files/CONFIG.Gentoo
@@ -0,0 +1,14 @@
+GTKLIB = `pkg-config --libs gtk+-2.0 gtkglext-1.0`
+GTKCFLAGS = `pkg-config --cflags gtk+-2.0 gtkglext-1.0`
+OGLLIB = `pkg-config --libs glu`
+OGLCFLAGS = `pkg-config --cflags glu`
+X11LIB = `pkg-config --libs x11`
+LIBPTHREAD = -lpthread
+RM = rm -f
+MAKE = make
+MKDIR = mkdir -p
+WIN32LIB =
+
+#DRAWGEOMGL=
+DRAWGEOMGL=-DDRAWGEOMGL
+
diff --git a/sci-chemistry/gabedit/files/gabedit-2.4.2-gold.patch b/sci-chemistry/gabedit/files/gabedit-2.4.2-gold.patch
new file mode 100644
index 000000000000..68823d0d7663
--- /dev/null
+++ b/sci-chemistry/gabedit/files/gabedit-2.4.2-gold.patch
@@ -0,0 +1,16 @@
+ Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ae08e60..eee2b46 100644
+--- a/Makefile
++++ b/Makefile
+@@ -62,7 +62,7 @@ all: gabedit
+ gabedit: $(SUBDIRS)
+ $(MKDIR) tmp
+ cp $(OBJECTS) tmp
+- $(CC) $(LDFLAGS) tmp/*.o -o gabedit $(GLTOPS) $(X11LIB) $(GTKLIB) $(OGLLIB) $(JPEGLIB) $(LIBPTHREAD) $(WIN32LIB) $(OMPLIB) -g
++ $(CC) $(LDFLAGS) tmp/*.o -o gabedit $(GLTOPS) $(X11LIB) $(GTKLIB) $(OGLLIB) $(JPEGLIB) $(LIBPTHREAD) $(WIN32LIB) $(OMPLIB) -g -lm
+ @$(RMTMP) > ptmp
+ rmdir tmp
+ @$(RM) ptmp
diff --git a/sci-chemistry/gabedit/gabedit-2.4.6.ebuild b/sci-chemistry/gabedit/gabedit-2.4.6.ebuild
new file mode 100644
index 000000000000..2b6d8659c53c
--- /dev/null
+++ b/sci-chemistry/gabedit/gabedit-2.4.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs versionator
+
+MY_PN=${PN/g/G}
+MY_PV=$(delete_all_version_separators)
+MY_P="${MY_PN}Src${MY_PV}"
+
+DESCRIPTION="GUI for computational chemistry packages"
+HOMEPAGE="http://gabedit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="openmp"
+
+RDEPEND="
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ x11-libs/gl2ps
+ x11-libs/pango
+ virtual/opengl
+ virtual/glu"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i "/rmdir tmp/d" "${S}"/Makefile || die
+ sed \
+ -e "/GTK_DISABLE_DEPRECATED/s:define:undef:g" \
+ -i "${S}/Config.h" || die
+ sed -e 's:-g::g' -i Makefile || die
+ cp "${FILESDIR}"/CONFIG.Gentoo "${S}"/CONFIG
+
+ if use openmp && tc-has-openmp; then
+ cat <<- EOF >> "${S}/CONFIG"
+ OMPLIB=-fopenmp
+ OMPCFLAGS=-DENABLE_OMP -fopenmp
+ EOF
+ fi
+ echo "COMMONCFLAGS = ${CFLAGS} -DENABLE_DEPRECATED \$(OMPCFLAGS) \$(DRAWGEOMGL)" >> CONFIG
+
+ tc-export CC
+}
+
+src_compile() {
+ emake clean
+ emake external_gl2ps=1
+}
+
+src_install() {
+ local size
+ dobin ${PN}
+ dodoc ChangeLog
+ for size in 16 24 32 48; do
+ doicon -s ${size} icons/Gabedit${size}.*
+ done
+}
diff --git a/sci-chemistry/gabedit/gabedit-2.4.7.ebuild b/sci-chemistry/gabedit/gabedit-2.4.7.ebuild
new file mode 100644
index 000000000000..bdfd10250b7d
--- /dev/null
+++ b/sci-chemistry/gabedit/gabedit-2.4.7.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs versionator
+
+MY_PN=${PN/g/G}
+MY_PV=$(delete_all_version_separators)
+MY_P="${MY_PN}Src${MY_PV}"
+
+DESCRIPTION="GUI for computational chemistry packages"
+HOMEPAGE="http://gabedit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="openmp"
+
+RDEPEND="
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ x11-libs/gl2ps
+ x11-libs/pango
+ virtual/opengl
+ virtual/glu"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i "/rmdir tmp/d" "${S}"/Makefile || die
+ sed \
+ -e "/GTK_DISABLE_DEPRECATED/s:define:undef:g" \
+ -i "${S}/Config.h" || die
+ sed -e 's:-g::g' -i Makefile || die
+ cp "${FILESDIR}"/CONFIG.Gentoo "${S}"/CONFIG
+
+ if use openmp && tc-has-openmp; then
+ cat <<- EOF >> "${S}/CONFIG"
+ OMPLIB=-fopenmp
+ OMPCFLAGS=-DENABLE_OMP -fopenmp
+ EOF
+ fi
+ echo "COMMONCFLAGS = ${CFLAGS} -DENABLE_DEPRECATED \$(OMPCFLAGS) \$(DRAWGEOMGL)" >> CONFIG
+
+ tc-export CC
+}
+
+src_compile() {
+ emake clean
+ emake external_gl2ps=1
+}
+
+src_install() {
+ local size
+ dobin ${PN}
+ dodoc ChangeLog
+ for size in 16 24 32 48; do
+ doicon -s ${size} icons/Gabedit${size}.*
+ done
+}
diff --git a/sci-chemistry/gabedit/gabedit-2.4.8.ebuild b/sci-chemistry/gabedit/gabedit-2.4.8.ebuild
new file mode 100644
index 000000000000..9d3e7d191505
--- /dev/null
+++ b/sci-chemistry/gabedit/gabedit-2.4.8.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs versionator
+
+MY_PN=${PN/g/G}
+MY_PV=$(delete_all_version_separators)
+MY_P="${MY_PN}Src${MY_PV}"
+
+DESCRIPTION="GUI for computational chemistry packages"
+HOMEPAGE="http://gabedit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="openmp"
+
+RDEPEND="
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ x11-libs/gl2ps
+ x11-libs/pango
+ virtual/opengl
+ virtual/glu"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i "/rmdir tmp/d" "${S}"/Makefile || die
+ sed \
+ -e "/GTK_DISABLE_DEPRECATED/s:define:undef:g" \
+ -i "${S}/Config.h" || die
+ sed -e 's:-g::g' -i Makefile || die
+ cp "${FILESDIR}"/CONFIG.Gentoo "${S}"/CONFIG
+
+ if use openmp && tc-has-openmp; then
+ cat <<- EOF >> "${S}/CONFIG"
+ OMPLIB=-fopenmp
+ OMPCFLAGS=-DENABLE_OMP -fopenmp
+ EOF
+ fi
+ echo "COMMONCFLAGS = ${CFLAGS} -DENABLE_DEPRECATED \$(OMPCFLAGS) \$(DRAWGEOMGL)" >> CONFIG
+
+ tc-export CC
+}
+
+src_compile() {
+ emake clean
+ emake external_gl2ps=1
+}
+
+src_install() {
+ local size
+ dobin ${PN}
+ dodoc ChangeLog
+ for size in 16 24 32 48; do
+ doicon -s ${size} icons/Gabedit${size}.*
+ done
+}
diff --git a/sci-chemistry/gabedit/metadata.xml b/sci-chemistry/gabedit/metadata.xml
new file mode 100644
index 000000000000..574871e7938f
--- /dev/null
+++ b/sci-chemistry/gabedit/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>jlec@gentoo.org</email>
+ <description>Tree Proxy for Max</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gabedit</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/gamess/Manifest b/sci-chemistry/gamess/Manifest
new file mode 100644
index 000000000000..d6cb7f6ac130
--- /dev/null
+++ b/sci-chemistry/gamess/Manifest
@@ -0,0 +1,2 @@
+DIST gamess-20110811.1.tar.gz 21105973 SHA256 b7b7af0eb141c140da31bcd9ef29fbafd82fbe45c087cadd7948d4c0a3cefe57
+DIST tinker.tar.Z 1902051 SHA256 7c52454ade7dd81d1b70a7e7722eda3672c644a3ba67ab444824a0212b4a7a8c
diff --git a/sci-chemistry/gamess/files/gamess-20110811.1.gentoo.patch b/sci-chemistry/gamess/files/gamess-20110811.1.gentoo.patch
new file mode 100644
index 000000000000..7bf5797bf513
--- /dev/null
+++ b/sci-chemistry/gamess/files/gamess-20110811.1.gentoo.patch
@@ -0,0 +1,263 @@
+diff -urN gamess.orig/comp gamess/comp
+--- gamess.orig/comp 2011-08-11 17:37:48.000000000 +0200
++++ gamess/comp 2011-10-11 15:17:23.349829478 +0200
+@@ -1444,7 +1444,7 @@
+ # g77 does not support FORTRAN logical units above 99, or 128 bit math.
+ #
+ case g77:
+- set OPT = '-O2'
++ set gentoo-OPT = '-O2'
+ if ($MODULE == ormas1) set OPT='-O2 -fno-move-all-movables' # RH9, g77 3.3
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+@@ -1474,7 +1474,7 @@
+ # -std=legacy suppresses warnings about use of f77 constructs.
+ #
+ case gfortran:
+- set OPT='-O2'
++ set gentoo-OPT = '-O2'
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+ if ($MODULE == pcmcv2) set OPT='-O1' # EFP+CPCM, ala Francois, v4.1.2
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+@@ -1500,7 +1500,7 @@
+ # optimizations in 32 bit mode, as a function of the ifort version.
+ #
+ case ifort:
+- set OPT = '-O3'
++ set gentoo-OPT = '-O2'
+ if ($MODULE == delocl) set OPT='-O0' # from Cheol
+ if ($MODULE == prpamm) set OPT='-O0' # for exam13
+ if ($MODULE == zheev) set OPT='-O0'
+@@ -1617,7 +1617,7 @@
+ case gfortran:
+ # -finit-real=<zero|inf|-inf|nan> could be interesting debug opt
+ # -fno-automatic forces static storage of all local variables
+- set OPT='-O2'
++ set gentoo-OPT = '-O2'
+ if (".$GMS_DEBUG_FLAGS" != .) set OPT="$GMS_DEBUG_FLAGS"
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+@@ -1648,7 +1648,7 @@
+ # -WB means warn but don't fail on out-of-bounds array references
+ # -ftz flushes underflow results to zero
+ #
+- set OPT = '-O2'
++ set gentoo-OPT = '-O2'
+ if (".$GMS_DEBUG_FLAGS" != .) set OPT="$GMS_DEBUG_FLAGS"
+ # alas, I'm so tired of hearing about so many versions failing to
+ # diagonalize, that this time critical code is run w/o optimization.
+diff -urN gamess.orig/compall gamess/compall
+--- gamess.orig/compall 2011-05-17 22:53:33.000000000 +0200
++++ gamess/compall 2011-10-11 12:13:30.041087251 +0200
+@@ -84,12 +84,11 @@
+ endif
+ endif
+ if ($TARGET == linux32) set extraflags='-DLINUX32'
+-if ($TARGET == linux64) then
++if ($TARGET == linux64) then
++ set chip=`uname -m`
+ # Ubuntu uses the non-standard -m flag, its -p replies "unknown"
+- set chip=`uname -p`
+- if ($chip == unknown) set chip=`uname -m`
+- if ($chip == x86_64) set extraflags='-DLINUX64 -m64'
+- if ($chip == ia64) set extraflags='-DLINUX64' # this always 64 bits
++ if ($chip == x86_64) set extraflags='-DLINUX64 -m64'
++ if ($chip == ia64) set extraflags='-DLINUX64' # this always 64 bits
+ endif
+ if ($TARGET == mac32) set extraflags='-DLINUX32'
+ if ($TARGET == mac64) set extraflags='-DLINUX64 -m64 -I/usr/include/malloc'
+diff -urN gamess.orig/ddi/compddi gamess/ddi/compddi
+--- gamess.orig/ddi/compddi 2011-02-15 21:31:30.000000000 +0100
++++ gamess/ddi/compddi 2011-10-11 12:23:45.513796580 +0200
+@@ -634,7 +634,7 @@
+
+ set FORTRAN=$GMS_FORTRAN # might be g77, gfortran, ifort, pgf77, f2c
+
+- set CC = 'gcc'
++ set gentoo-CC = 'gcc'
+ set CFLAGS = "-DLINUX -O3 -fstrict-aliasing -I./"
+ set CLIBS = "-lpthread"
+
+@@ -687,7 +687,7 @@
+ set ARCH='-m64'
+ if (`uname -p` == ia64) set ARCH=''
+
+- set CC = 'gcc'
++ set gentoo-CC = 'gcc'
+ set CFLAGS = "-DLINUX $ARCH -O3 -fstrict-aliasing -I./"
+ set CLIBS = "-lpthread"
+
+diff -urN gamess.orig/ddi/kickoff/ddikick.c gamess/ddi/kickoff/ddikick.c
+--- gamess.orig/ddi/kickoff/ddikick.c 2008-05-06 12:16:12.000000000 +0200
++++ gamess/ddi/kickoff/ddikick.c 2011-10-11 12:25:11.862714681 +0200
+@@ -105,7 +105,7 @@
+ remoteshell = argv[++i];
+ } else {
+ if((remoteshell = getenv("DDI_RSH")) == NULL) {
+- remoteshell = (char *) strdup("rsh");
++ remoteshell = (char *) strdup("ssh");
+ }
+ }
+
+diff -urN gamess.orig/lked gamess/lked
+--- gamess.orig/lked 2011-08-11 17:41:02.000000000 +0200
++++ gamess/lked 2011-10-11 12:26:38.564634821 +0200
+@@ -53,7 +53,7 @@
+ #
+ # 3. optional Nuclear-Electronic Orbital method, using NEO code
+ #
+-set NEO=false
++set NEO=true
+ #
+ # 4. optional Nvidia/CUDA code, for closed shell SCF Fock construction
+ # see ~/gamess/libcchem/aaa.readme.1st for more information
+@@ -356,17 +356,17 @@
+ switch ($GMS_FORTRAN)
+ case g77:
+ set LDR='g77'
+- set LDOPTS=' ' # add '-Wl,-M' to see load map
++ set gentoo-LDOPTS=' ' # add '-Wl,-M' to see load map
+ set FORTLIBS=' '
+ breaksw
+ case gfortran:
+ set LDR='gfortran'
+- set LDOPTS=' '
++ set gentoo-LDOPTS=' '
+ set FORTLIBS=' '
+ breaksw
+ case ifort:
+ set LDR='ifort'
+- set LDOPTS=' ' # add '-Wl,-M' to see load map
++ set gentoo-LDOPTS=' ' # add '-Wl,-M' to see load map
+ set FORTLIBS='-Vaxlib'
+ breaksw
+ case pgf77:
+@@ -376,7 +376,7 @@
+ breaksw
+ case f2c:
+ set LDR='gcc'
+- set LDOPTS=' '
++ set gentoo-LDOPTS=' '
+ set FORTLIBS='-lf2c -lm'
+ breaksw
+ default:
+@@ -427,12 +427,7 @@
+ # Otherwise, attempt a link against shared object libs.
+ # See the 64 bit Atlas below for a way to fix the linker's
+ # not being able to locate -lf77blas, if that happens.
+- if (-e $GMS_MATHLIB_PATH/libf77blas.a) then
+- set MATHLIBS="$GMS_MATHLIB_PATH/libf77blas.a"
+- set MATHLIBS="$MATHLIBS $GMS_MATHLIB_PATH/libatlas.a"
+- else
+- set MATHLIBS="-L$GMS_MATHLIB_PATH -lf77blas -latlas"
+- endif
++ set MATHLIBS=`${PKG_CONFIG} --libs blas`
+ set BLAS=' '
+ breaksw
+
+@@ -466,12 +461,12 @@
+ switch ($GMS_FORTRAN)
+ case gfortran:
+ set LDR='gfortran'
+- set LDOPTS=' '
++ set gentoo-LDOPTS=' '
+ set FORTLIBS=' '
+ breaksw
+ case ifort:
+ set LDR='ifort'
+- set LDOPTS='-i8' # -Wl,-M generates a load map
++ set gentoo-LDOPTS=' ' # -Wl,-M generates a load map
+ # this auxiliary library seems to have disappeared in ifort 10
+ set FORTLIBS=' '
+ if($GMS_IFORT_VERNO < 10) set FORTLIBS='-Vaxlib'
+@@ -556,12 +551,7 @@
+ # ln -s liblapack_atlas.so.3.0 liblapack.so
+ # ln -s liblapack.so.3.0 liblapack.so
+ # It is strange the RPM's don't do these soft links for us.
+- if (-e $GMS_MATHLIB_PATH/libf77blas.a) then
+- set MATHLIBS="$GMS_MATHLIB_PATH/libf77blas.a"
+- set MATHLIBS="$MATHLIBS $GMS_MATHLIB_PATH/libatlas.a"
+- else
+- set MATHLIBS="-L$GMS_MATHLIB_PATH -lf77blas -latlas"
+- endif
++ set MATHLIBS=`${PKG_CONFIG} --libs blas`
+ set BLAS=' '
+ breaksw
+
+diff -urN gamess.orig/runall gamess/runall
+--- gamess.orig/runall 2009-02-28 00:57:18.000000000 +0100
++++ gamess/runall 2011-10-11 12:27:32.195586568 +0200
+@@ -10,7 +10,6 @@
+ #
+ # Only the following two lines need to be customized:
+ #
+-chdir /u1/mike/gamess
+ set VERNO=00
+ #
+ # Loop over all Ntest jobs supplied with GAMESS
+@@ -27,7 +26,7 @@
+ gms -v $VERNO -q ti -l exam$NUM.log exam$NUM
+ sleep 5
+ else
+- ./rungms exam$NUM $VERNO 1 >& exam$NUM.log
++ rungms exam$NUM $VERNO 1 >& exam$NUM.log
+ endif
+ @ i++
+ end
+diff -urN gamess.orig/rungms gamess/rungms
+--- gamess.orig/rungms 2011-08-04 21:03:11.000000000 +0200
++++ gamess/rungms 2011-10-11 12:30:05.244448126 +0200
+@@ -55,7 +55,7 @@
+ # one for LoadLeveler "ll-gms" on the IBM SP line.
+ #
+ set TARGET=sockets
+-set SCR=/scr/$USER
++set SCR=`pwd`
+ #
+ set JOB=$1 # name of the input file xxx.inp, give only the xxx part
+ set VERNO=$2 # revision number of the executable created by 'lked' step
+@@ -144,7 +144,7 @@
+ # used by the NEO method. See NEO's documentation for more details.
+ #
+ set echo
+-setenv AUXDATA ~mike/gamess/auxdata
++setenv AUXDATA /usr/share/gamess
+ setenv EXTBAS /dev/null
+ setenv NUCBAS /dev/null
+ setenv POSBAS /dev/null
+@@ -153,12 +153,12 @@
+ setenv MCPPATH $AUXDATA/MCP
+ setenv BASPATH $AUXDATA/BASES
+ setenv QUANPOL $AUXDATA/QUANPOL
+-setenv MAKEFP ~$USER/scr/$JOB.efp
+-setenv GAMMA ~$USER/scr/$JOB.gamma
+-setenv TRAJECT ~$USER/scr/$JOB.trj
+-setenv RESTART ~$USER/scr/$JOB.rst
++setenv MAKEFP $SCR/$JOB.efp
++setenv GAMMA $SCR/$JOB.gamma
++setenv TRAJECT $SCR/$JOB.trj
++setenv RESTART $SCR/$JOB.rst
+ setenv INPUT $SCR/$JOB.F05
+-setenv PUNCH ~$USER/scr/$JOB.dat
++setenv PUNCH $SCR/$JOB.dat
+ setenv AOINTS $SCR/$JOB.F08
+ setenv MOINTS $SCR/$JOB.F09
+ setenv DICTNRY $SCR/$JOB.F10
+@@ -347,7 +347,7 @@
+ if (null$4 == null) set ELGNAME=ELGFILE
+ set echo
+ setenv AOINTS $SCR/$ELGNAME.F08
+- setenv ELGDOS ~$USER/scr/$JOB.ldos
++ setenv ELGDOS $SCR/$JOB.ldos
+ setenv ELGDAT $SCR/$ELGNAME.F71
+ setenv ELGPAR $SCR/$ELGNAME.F72
+ setenv ELGCUT $SCR/$ELGNAME.F74
+@@ -500,7 +500,7 @@
+ if ($os == AIX) set GMSPATH=/u1/mike/gamess
+ if ($os == Darwin) set GMSPATH=/Users/mike/desktop/gamess
+ if ($os == HP-UX) set GMSPATH=/zr/mike/gamess
+- if ($os == Linux) set GMSPATH=/cu/mike/gamess
++ if ($os == Linux) set GMSPATH=/usr/bin
+ if ($os == OSF1) set GMSPATH=/in/mike/gamess
+ if ($os == SunOS) set GMSPATH=/hf/mike/gamess
+ # special compilation for Sun E450 uSPARC (uname also= SunOS)
diff --git a/sci-chemistry/gamess/files/gamess-checktst.patch b/sci-chemistry/gamess/files/gamess-checktst.patch
new file mode 100644
index 000000000000..9fc1547e4540
--- /dev/null
+++ b/sci-chemistry/gamess/files/gamess-checktst.patch
@@ -0,0 +1,21 @@
+--- gamess.orig/tools/checktst/checktst 2008-12-30 16:33:09.000000000 +0100
++++ gamess/tools/checktst/checktst 2011-10-11 22:06:26.019798622 +0200
+@@ -6,7 +6,6 @@
+ #
+ # Only the path name in the very next line needs to be customized.
+ #
+-set GMSPATH=~/gamess
+
+ # The Ntest outputs are assumed to be named exam01.log, exam02.log, ...
+ # but the user will be allowed to specify the directory containing them.
+@@ -66,8 +65,8 @@
+ setenv tolW 0.1
+ setenv tolX 0.00001
+
+-set script=$GMSPATH/tools/checktst/exam
+-setenv chkabs $GMSPATH/tools/checktst/chkabs
++set script=./exam
++setenv chkabs ./chkabs
+
+ # If we don't see the message about GAMESS exiting normally,
+ # then there is surely a mistake, and we want to focus the
diff --git a/sci-chemistry/gamess/files/gamess-qmmm-tinker-fix-idate.patch b/sci-chemistry/gamess/files/gamess-qmmm-tinker-fix-idate.patch
new file mode 100644
index 000000000000..34f291382d41
--- /dev/null
+++ b/sci-chemistry/gamess/files/gamess-qmmm-tinker-fix-idate.patch
@@ -0,0 +1,20 @@
+diff -urN gamess/tinker.orig/Libtad.f gamess/tinker/Libtad.f
+--- gamess/tinker.orig/Libtad.f 2010-05-12 21:41:56.000000000 +0400
++++ gamess/tinker/Libtad.f 2010-12-08 01:05:31.000000000 +0300
+@@ -1332,11 +1332,15 @@
+ c and for Macintosh under Absoft Pro Fortran 5.0
+ c
+ integer hms(3)
++ integer tarray(3)
+ call itime (hms)
+ hour = hms(1)
+ minute = hms(2)
+ second = hms(3)
+- call idate (month,day,year)
++ call idate (tarray)
++ month = tarray(1)
++ day = tarray(2)
++ year = tarray(3)
+ c
+ c code for IBM RS/6000 under AIX appends an underscore
+ c
diff --git a/sci-chemistry/gamess/gamess-20110811.1.ebuild b/sci-chemistry/gamess/gamess-20110811.1.ebuild
new file mode 100644
index 000000000000..363353adb793
--- /dev/null
+++ b/sci-chemistry/gamess/gamess-20110811.1.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic pax-utils toolchain-funcs
+
+DESCRIPTION="A powerful quantum chemistry package"
+LICENSE="gamess"
+HOMEPAGE="http://www.msg.chem.iastate.edu/GAMESS/GAMESS.html"
+SRC_URI="
+ ${P}.tar.gz
+ qmmm-tinker? ( tinker.tar.Z )"
+
+SLOT="0"
+# NOTE: PLEASE do not stabilize gamess. It does not make sense
+# since the tarball has fetch restrictions and upstream only
+# provides the latest version. In other words: As soon as a
+# new version comes out the stable version will be useless since
+# users can not get at the tarball any more.
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="mpi neo pax_kernel qmmm-tinker"
+
+CDEPEND="
+ app-shells/tcsh
+ mpi? ( virtual/mpi )
+ virtual/blas"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ net-misc/openssh"
+
+S="${WORKDIR}/${PN}"
+
+RESTRICT="fetch"
+
+GAMESS_DOWNLOAD="http://www.msg.ameslab.gov/GAMESS/License_Agreement.html"
+GAMESS_VERSION="1 AUG 2011 (R1)"
+
+pkg_nofetch() {
+ echo
+ elog "Please download ${PN}-current.tar.gz from"
+ elog "${GAMESS_DOWNLOAD}."
+ elog "Be sure to select the version ${GAMESS_VERSION} tarball!!"
+ elog "Then move the tarball to"
+ elog "${DISTDIR}/${P}.tar.gz"
+ if use qmmm-tinker ; then
+ elog "Also download http://www.msg.ameslab.gov/GAMESS/tinker.tar.Z"
+ elog "and place tinker.tar.Z to ${DISTDIR}"
+ fi
+ echo
+}
+
+get_fcomp() {
+ case $(tc-getFC) in
+ *gfortran* )
+ FCOMP="gfortran" ;;
+ ifort )
+ FCOMP="ifc" ;;
+ * )
+ FCOMP=$(tc-getFC) ;;
+ esac
+}
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ get_fcomp
+ # currently amd64 is only supported with gfortran
+ if [[ "${ARCH}" == "amd64" ]] && [[ ${FCOMP} != *gfortran* ]];
+ then die "You will need gfortran to compile gamess on amd64"
+ fi
+
+ # note about qmmm-tinker
+ if use qmmm-tinker; then
+ einfo "By default MM subsistem is restricted to 1000 atoms"
+ einfo "if you want larger MM subsystems then you should set"
+ einfo "QMMM_GAMESS_MAXMM variable to needed value in your make.conf"
+ einfo "By default maximum number of atom classes types and size of"
+ einfo "hessian are restricted to 250, 500 and 1000000 respectively"
+ einfo "If you want larger sizes set:"
+ einfo "QMMM_GAMESS_MAXCLASS"
+ einfo "QMMM_GAMESS_MAXCTYP"
+ einfo "QMMM_GAMESS_MAXHESS"
+ einfo "in your make.conf"
+ fi
+
+ #note about mpi
+ if use mpi; then
+ ewarn ""
+ ewarn "You should adjust rungms script for your mpi implentation"
+ ewarn "because deafult one will not work"
+ ewarn ""
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ if use qmmm-tinker; then
+ mv tinker gamess/ || die "failed to move tinker directory"
+ fi
+}
+
+src_prepare() {
+ tc-export PKG_CONFIG
+ # apply LINUX-arch patches to gamess makesfiles
+ epatch "${FILESDIR}/${P}.gentoo.patch"
+ epatch "${FILESDIR}/${PN}-checktst.patch"
+ # select arch
+ # NOTE: please leave lked alone; it should be good as is!!
+ cd "${S}"
+ local active_arch;
+ if [[ "${ARCH}" == "amd64" ]]; then
+ active_arch="linux64";
+ else
+ active_arch="linux32";
+ fi
+
+ # for hardened-gcc let't turn off ssp, since it breakes
+ # a few routines
+ if use pax_kernel && [[ ${FCOMP} == g77 ]]; then
+ FFLAGS="${FFLAGS} -fno-stack-protector-all"
+ fi
+
+ # Enable mpi stuff
+ if use mpi; then
+ sed -e "s:set COMM = sockets:set COMM = mpi:g" \
+ -i ddi/compddi || die "Enabling mpi build failed"
+ sed -e "s:MPI_INCLUDE_PATH = ' ':MPI_INCLUDE_PATH = '-I/usr/include ':g" \
+ -i ddi/compddi || die "Enabling mpi build failed"
+ sed -e "s:MSG_LIBRARIES='../ddi/libddi.a -lpthread':MSG_LIBRARIES='../ddi/libddi.a -lmpi -lpthread':g" \
+ -i lked || die "Enabling mpi build failed"
+ fi
+
+ # enable NEO
+ if use neo; then
+ sed -e "s:NEO=false:NEO=true:" -i compall lked || \
+ die "Failed to enable NEO code"
+ else
+ sed -e "s:NEO=true:NEO=false:" -i compall lked || \
+ die "Failed to disable NEO code"
+ fi
+ # enable GAMESS-qmmm
+ if use qmmm-tinker; then
+ epatch "${FILESDIR}/${PN}-qmmm-tinker-fix-idate.patch"
+ sed -e "s:TINKER=false:TINKER=true:" -i compall lked || \
+ die "Failed to enable TINKER code"
+ if [ "x$QMMM_GAMESS_MAXMM" == "x" ]; then
+ einfo "No QMMM_GAMESS_MAXMM set. Using default value = 1000"
+ else
+ einfo "Setting QMMM_GAMESS_MAXMM to $QMMM_GAMESS_MAXMM"
+ sed -e "s:maxatm=1000:maxatm=$QMMM_GAMESS_MAXMM:g" \
+ -i tinker/sizes.i \
+ || die "Setting QMMM_GAMESS_MAXMM failed"
+ sed -e "s:MAXATM=1000:MAXATM=$QMMM_GAMESS_MAXMM:g" \
+ -i source/inputb.src \
+ || die "Setting QMMM_GAMESS_MAXMM failed"
+ fi
+ if [ "x$QMMM_GAMESS_MAXCLASS" == "x" ]; then
+ einfo "No QMMM_GAMESS_MAXMM set. Using default value = 250"
+ else
+ sed -e "s:maxclass=250:maxclass=$QMMM_GAMESS_MAXCLASS:g" \
+ -i tinker/sizes.i \
+ || die "Setting QMMM_GAMESS_MAXCLASS failed"
+ fi
+ if [ "x$QMMM_GAMESS_MAXCTYP" == "x" ]; then
+ einfo "No QMMM_GAMESS_MAXCTYP set. Using default value = 500"
+ else
+ sed -e "s:maxtyp=500:maxtyp=$QMMM_GAMESS_MAXCTYP:g" \
+ -i tinker/sizes.i \
+ || die "Setting QMMM_GAMESS_MAXCTYP failed"
+ fi
+ if [ "x$QMMM_GAMESS_MAXHESS" == "x" ]; then
+ einfo "No QMMM_GAMESS_MAXHESS set. Usingdefault value = 1000000"
+ else
+ sed -e "s:maxhess=1000000:maxhess=$QMMM_GAMESS_MAXHESS:g" \
+ -i tinker/sizes.i \
+ || die "Setting QMMM_GAMESS_MAXHESS failed"
+ fi
+ fi
+ # greate proper activate sourcefile
+ cp "./tools/actvte.code" "./tools/actvte.f" || \
+ die "Failed to create actvte.f"
+ sed -e "s/^\*UNX/ /" -i "./tools/actvte.f" || \
+ die "Failed to perform UNX substitutions in actvte.f"
+
+ # fix GAMESS' compall script to use proper CC
+ sed -e "s|\$CCOMP -c \$extraflags source/zunix.c|$(tc-getCC) -c \$extraflags source/zunix.c|" \
+ -i compall || die "Failed setting up compall script"
+
+ # insert proper FFLAGS into GAMESS' comp makefile
+ # in case we're using ifc let's strip all the gcc
+ # specific stuff
+ if [[ ${FCOMP} == "ifort" ]]; then
+ sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS} -quiet'/" \
+ -i comp || die "Failed setting up comp script"
+ elif ! use x86; then
+ sed -e "s/-malign-double //" \
+ -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS}'/" \
+ -i comp || die "Failed setting up comp script"
+ else
+ sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS}'/" \
+ -i comp || die "Failed setting up comp script"
+ fi
+
+ # fix up GAMESS' linker script;
+ sed -e "s/gentoo-LDOPTS=' '/LDOPTS='${LDFLAGS}'/" \
+ -i lked || die "Failed setting up lked script"
+ # fix up GAMESS' ddi TCP/IP socket build
+ sed -e "s/gentoo-CC = 'gcc'/CC = '$(tc-getCC)'/" \
+ -i ddi/compddi || die "Failed setting up compddi script"
+ # Creating install.info
+ cat > install.info <<-EOF
+ #!/bin/csh
+ setenv GMS_PATH $WORKDIR/gamess
+ setenv GMS_TARGET $active_arch
+ setenv GMS_FORTRAN $FCOMP
+ setenv GMS_MATHLIB atlas
+ setenv GMS_MATHLIB_PATH /usr/$(get_libdir)/atlas
+ setenv GMS_DDI_COMM sockets
+ EOF
+
+}
+
+src_compile() {
+ # build actvte
+ cd "${S}"/tools
+ ${FCOMP} -o actvte.x actvte.f || \
+ die "Failed to compile actvte.x"
+
+ # for hardened (PAX) users and ifc we need to turn
+ # MPROTECT off
+ if [[ ${FCOMP} == "ifort" ]] && use pax_kernel; then
+ pax-mark -PemRxS actvte.x
+ fi
+
+ # build gamess
+ cd "${S}"
+ ./compall || die "compall failed"
+
+ # build the ddi TCP/IP socket stuff
+ cd ${S}/"ddi"
+ ./compddi || die "compddi failed"
+
+ # finally, link it all together
+ cd "${S}"
+ ./lked || die "lked failed"
+
+ # for hardened (PAX) users and ifc we need to turn
+ # MPROTECT off
+ if [[ ${FCOMP} == "ifort" ]] && use pax_kernel; then
+ pax-mark -PemRxS ${PN}.00.x
+ fi
+}
+
+src_install() {
+ # the executables
+ dobin ${PN}.00.x rungms \
+ || die "Failed installing binaries"
+ if use !mpi; then
+ dobin ddi/ddikick.x \
+ || die "Failed installing binaries"
+ fi
+
+ # the docs
+ dodoc *.DOC qmnuc/*.DOC || die "Failed installing docs"
+
+ # install ericftm
+ insinto /usr/share/${PN}
+ doins auxdata/ericfmt.dat || die "Failed installing ericfmt.dat"
+
+ # install mcpdata
+ insinto /usr/share/${PN}/MCP
+ doins auxdata/MCP/* || die "Failed installing MCP"
+
+ # install BASES
+ insinto /usr/share/${PN}/BASES
+ doins auxdata/BASES/* || die "Failed installing BASES"
+
+ # install QUANPOL
+ insinto /usr/share/${PN}/QUANPOL
+ doins auxdata/QUANPOL/* || die "Failed installing QUANPOL"
+
+ # install tinker params in case of qmmm
+ if use qmmm-tinker ; then
+ dodoc tinker/simomm.doc || die "Failed installing docs"
+ insinto /usr/share/${PN}
+ doins -r tinker/params51 || die "Failed to install Tinker params"
+ fi
+
+ # install the tests the user should run, and
+ # fix up the runscript; also grab a copy of rungms
+ # so the user is ready to run the tests
+ insinto /usr/share/${PN}/tests
+ insopts -m0644
+ doins tests/* || die "Failed installing tests"
+ insopts -m0744
+ doins runall || die "Failed installing tests"
+ doins tools/checktst/checktst tools/checktst/chkabs || \
+ die "Failed to install main test checker"
+ doins tools/checktst/exam* || \
+ die "Failed to install individual test files"
+
+ insinto /usr/share/${PN}/neotests
+ insopts -m0644
+ doins -r qmnuc/neotests/* || die "Failed to install NEO tests"
+}
+
+pkg_postinst() {
+ echo
+ einfo "Before you use GAMESS for any serious work you HAVE"
+ einfo "to run the supplied test files located in"
+ einfo "/usr/share/gamess/tests and check them thoroughly."
+ einfo "Otherwise all scientific publications resulting from"
+ einfo "your GAMESS runs should be immediately rejected :)"
+ einfo "To do so copy the content of /usr/share/gamess/tests"
+ einfo "to some temporary location and execute './runall'. "
+ einfo "Then run the checktst script in the same directory to"
+ einfo "validate the tests."
+ einfo "Please consult TEST.DOC and the other docs!"
+
+ if [[ ${FCOMP} == "ifort" ]]; then
+ echo
+ ewarn "IMPORTANT NOTE: We STRONGLY recommend to stay away"
+ ewarn "from ifc-9.0 for now and use the ifc-8.1 series of"
+ ewarn "compilers UNLESS you can run through ALL of the "
+ ewarn "test cases (see above) successfully."
+ fi
+
+ echo
+ einfo "If you want to run on more than a single CPU"
+ einfo "you will have to acquaint yourself with the way GAMESS"
+ einfo "does multiprocessor runs and adjust rungms according to"
+ einfo "your target network architecture."
+ echo
+}
diff --git a/sci-chemistry/gamess/metadata.xml b/sci-chemistry/gamess/metadata.xml
new file mode 100644
index 000000000000..65e218a68820
--- /dev/null
+++ b/sci-chemistry/gamess/metadata.xml
@@ -0,0 +1,14 @@
+<?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>
+ <herd>sci-chemistry</herd>
+ <use>
+ <flag name="neo">Enable NEO for nuclear basis support</flag>
+ <flag name="pax_kernel">Make this package work on PAX kernels</flag>
+ <flag name="qmmm-tinker">Enable tinker qmmm code</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/gamessq/Manifest b/sci-chemistry/gamessq/Manifest
new file mode 100644
index 000000000000..de14dc2be506
--- /dev/null
+++ b/sci-chemistry/gamessq/Manifest
@@ -0,0 +1 @@
+DIST gamessq-1.2.tar.gz 293747 SHA256 f122cb78ba5c01d10dd20a9525215a82e4024ae3a3ec19bf895cddcfabbb246a
diff --git a/sci-chemistry/gamessq/gamessq-1.2.ebuild b/sci-chemistry/gamessq/gamessq-1.2.ebuild
new file mode 100644
index 000000000000..5d7745574da3
--- /dev/null
+++ b/sci-chemistry/gamessq/gamessq-1.2.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER="2.8"
+
+inherit eutils wxwidgets
+
+DESCRIPTION="Simple job manager for GAMESS-US"
+HOMEPAGE="http://www.msg.chem.iastate.edu/GAMESS/GamessQ/"
+SRC_URI="http://www.msg.chem.iastate.edu/GAMESS/GamessQ/download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="x11-libs/wxGTK:${WX_GTK_VER}"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ default
+ doicon src/icons/${PN}.ico
+ make_desktop_entry ${PN} gamessq ${PN}.ico "Science;Education"
+}
diff --git a/sci-chemistry/gamessq/metadata.xml b/sci-chemistry/gamessq/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/gamessq/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/gelemental/Manifest b/sci-chemistry/gelemental/Manifest
new file mode 100644
index 000000000000..6369272c939d
--- /dev/null
+++ b/sci-chemistry/gelemental/Manifest
@@ -0,0 +1,2 @@
+DIST gelemental-1.2.0.tar.bz2 460757 SHA256 4f2797200af98d74c71db0065506f99a97820392f39f67cf3ef42de6dca3859b SHA512 2e6ef2c22b389cff69728b01e1eb397578974362356f5132098f29a9e01a64be228a24686738bd84ea575cee5aef068d9ab3d6c20233f995ccc5f1a1cb5d5673 WHIRLPOOL 6814ce64ad66a872073af31460e9938f2ac385500af9a94a60d3ce28c85bad467ef09ce9a2596e0b3e508121959b662e77cba685a6d3359a5d840a9af9fa34bb
+DIST gelemental_1.2.0-8.debian.tar.gz 29877 SHA256 b03ddad5587fdfb279d570388105ea5fb3b16eebbb2626f1f293ff283456869e SHA512 83c236e3b91af304c96f28c0f12577821ee2f47c9e01fb1f3664228afb002dc19b1a71e6dcd6040d09ea991d131b147ea5b36283d8ead290d50014c15e69878c WHIRLPOOL 16bc07c03b88e7a0c161677302d2a9d2cdb74aa6baf702b0d6d2c2a6f2ec8fe21d626cc58ecb34850da8369bccb36b889f5391c013e0861c338bd68c1f38e3ca
diff --git a/sci-chemistry/gelemental/files/gelemental-1.2.0-doxygen.patch b/sci-chemistry/gelemental/files/gelemental-1.2.0-doxygen.patch
new file mode 100644
index 000000000000..8c904e844586
--- /dev/null
+++ b/sci-chemistry/gelemental/files/gelemental-1.2.0-doxygen.patch
@@ -0,0 +1,30 @@
+Author: Joachim Reichel <reichel@debian.org>
+Description: Skip installing (no longer generated) .dot and .gif files
+Origin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590382#15
+Bug-Debian: http://bugs.debian.org/590382
+Reviewed-By: Michael Banck <mbanck@debian.org>
+Forwarded: no
+Last-Update: 2010-09-22
+
+--- a/docs/api/Makefile.am
++++ b/docs/api/Makefile.am
+@@ -12,7 +12,7 @@
+ install-api: $(srcdir)/html/index.html
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)/$(apidir)
+- @dir='$(<D)'; for p in $$dir/*.html $$dir/*.css $$dir/*.png $$dir/*.gif $$dir/*.dot ; do \
++ @dir='$(<D)'; for p in $$dir/*.html $$dir/*.css $$dir/*.png ; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(apidir)/$$f"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(apidir)/$$f; \
+--- a/docs/api/Makefile.in
++++ b/docs/api/Makefile.in
+@@ -393,7 +393,7 @@
+ install-api: $(srcdir)/html/index.html
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)/$(apidir)
+- @dir='$(<D)'; for p in $$dir/*.html $$dir/*.css $$dir/*.png $$dir/*.gif $$dir/*.dot ; do \
++ @dir='$(<D)'; for p in $$dir/*.html $$dir/*.css $$dir/*.png ; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(apidir)/$$f"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(apidir)/$$f; \
diff --git a/sci-chemistry/gelemental/files/gelemental-1.2.0-gcc4.3.patch b/sci-chemistry/gelemental/files/gelemental-1.2.0-gcc4.3.patch
new file mode 100644
index 000000000000..8e69e98a5437
--- /dev/null
+++ b/sci-chemistry/gelemental/files/gelemental-1.2.0-gcc4.3.patch
@@ -0,0 +1,12 @@
+diff -Naru gelemental-1.2.0/libelemental/value.tcc gelemental-1.2.0.new/libelemental/value.tcc
+--- gelemental-1.2.0/libelemental/value.tcc 2007-09-25 01:10:16.000000000 -0400
++++ gelemental-1.2.0.new/libelemental/value.tcc 2008-10-19 10:08:35.000000000 -0400
+@@ -26,6 +26,8 @@
+ #error "value.tcc must be included from value.hh."
+ #endif
+
++#include <limits>
++
+ namespace Elemental {
+
+
diff --git a/sci-chemistry/gelemental/files/gelemental-1.2.0-glib-2.32.patch b/sci-chemistry/gelemental/files/gelemental-1.2.0-glib-2.32.patch
new file mode 100644
index 000000000000..eab2ad1f194e
--- /dev/null
+++ b/sci-chemistry/gelemental/files/gelemental-1.2.0-glib-2.32.patch
@@ -0,0 +1,46 @@
+ libelemental/misc/extras.cc | 2 +-
+ libelemental/misc/widgets.cc | 2 +-
+ src/main.cc | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libelemental/misc/extras.cc b/libelemental/misc/extras.cc
+index a8e5720..c042604 100644
+--- a/libelemental/misc/extras.cc
++++ b/libelemental/misc/extras.cc
+@@ -21,7 +21,7 @@
+
+ #include <algorithm>
+ #include <stdexcept>
+-#include <glib/gmem.h>
++#include <glib.h>
+ #include <glibmm/utility.h>
+
+ namespace misc {
+diff --git a/libelemental/misc/widgets.cc b/libelemental/misc/widgets.cc
+index 002310c..941d881 100644
+--- a/libelemental/misc/widgets.cc
++++ b/libelemental/misc/widgets.cc
+@@ -20,7 +20,7 @@
+ #include "macros.hh"
+ #include "widgets.hh"
+
+-#include <glib/gmessages.h>
++#include <glib.h>
+ #include <gtkmm/alignment.h>
+ #include <gtkmm/image.h>
+ #include <gtkmm/label.h>
+diff --git a/src/main.cc b/src/main.cc
+index 41cfe03..68bbb4c 100644
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -26,8 +26,8 @@
+ #include <clocale>
+ #include <iostream>
+ #include <locale>
+-#include <glib/goption.h>
+-#include <glib/gutils.h>
++#include <glib.h>
++#include <glib.h>
+ #include <glibmm/optionentry.h>
+ #include <gtk/gtkaboutdialog.h>
+ #include <gtk/gtkversion.h>
diff --git a/sci-chemistry/gelemental/gelemental-1.2.0-r1.ebuild b/sci-chemistry/gelemental/gelemental-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..78bfcff23630
--- /dev/null
+++ b/sci-chemistry/gelemental/gelemental-1.2.0-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils fdo-mime gnome2-utils eutils
+
+DESCRIPTION="Periodic table viewer that provides detailed information on the chemical elements"
+HOMEPAGE="http://freecode.com/projects/gelemental/"
+SRC_URI="
+ http://www.kdau.com/files/${P}.tar.bz2
+ mirror://debian/pool/main/g/${PN}/${PN}_${PV}-8.debian.tar.gz"
+
+LICENSE="GPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc static-libs"
+
+RDEPEND="
+ dev-cpp/gtkmm:2.4
+ dev-cpp/glibmm:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ dev-util/intltool
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc4.3.patch
+ "${FILESDIR}"/${P}-glib-2.32.patch
+ "${FILESDIR}"/${P}-doxygen.patch
+ "${WORKDIR}"/debian/patches/579183_adjust_size_middle_button.patch
+ "${WORKDIR}"/debian/patches/604612_fix_menu_category.patch
+ "${WORKDIR}"/debian/patches/604618_scrollable_properties_dialog.patch
+ "${WORKDIR}"/debian/patches/656372_element_renames.patch
+ "${WORKDIR}"/debian/patches/add_new_wave_theme.patch
+ "${WORKDIR}"/debian/patches/czech_translation_559028.patch
+ "${WORKDIR}"/debian/patches/fix_gtkmm_2.18.patch
+ "${WORKDIR}"/debian/patches/fix_zinc_german_translation.patch
+ "${WORKDIR}"/debian/patches/ftbfs_missing_limits.patch
+ "${WORKDIR}"/debian/patches/lp673285_link_in_about.patch
+ )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_configure() {
+ local myeconfargs=( $(use_enable doc api-docs) )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install apidir="/usr/share/doc/${PF}/html"
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-chemistry/gelemental/gelemental-1.2.0.ebuild b/sci-chemistry/gelemental/gelemental-1.2.0.ebuild
new file mode 100644
index 000000000000..fe562c2ce32b
--- /dev/null
+++ b/sci-chemistry/gelemental/gelemental-1.2.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils fdo-mime gnome2-utils eutils
+
+DESCRIPTION="Periodic table viewer that provides detailed information on the chemical elements"
+HOMEPAGE="http://freecode.com/projects/gelemental/"
+SRC_URI="http://www.kdau.com/files/${P}.tar.bz2"
+
+LICENSE="GPL-3 MIT"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc static-libs"
+
+RDEPEND="
+ dev-cpp/gtkmm:2.4
+ dev-cpp/glibmm:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ dev-util/intltool
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc4.3.patch
+ "${FILESDIR}"/${P}-glib-2.32.patch
+ "${FILESDIR}"/${P}-doxygen.patch )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_configure() {
+ local myeconfargs=( $(use_enable doc api-docs) )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install apidir="/usr/share/doc/${PF}/html"
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-chemistry/gelemental/metadata.xml b/sci-chemistry/gelemental/metadata.xml
new file mode 100644
index 000000000000..d63987f1d9ef
--- /dev/null
+++ b/sci-chemistry/gelemental/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-chemistry</herd>
+ <upstream>
+ <remote-id type="freecode">gelemental</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/ghemical/Manifest b/sci-chemistry/ghemical/Manifest
new file mode 100644
index 000000000000..f2af4d9880c3
--- /dev/null
+++ b/sci-chemistry/ghemical/Manifest
@@ -0,0 +1,2 @@
+DIST ghemical-2.99.2.tar.gz 2168844 SHA256 dbe4796582f8a125121e70c0171bc834d4a8121200354f2ef620583b767e6c4d
+DIST ghemical-3.0.0.tar.gz 2196716 SHA256 babb2bda93cf0c20f234452eeb7d19d1d8c0e4c4d611734f110f8de066a1bcb2 SHA512 d4dd0b063a4dea33fa7430e77a2da253c74079fd8b5f21e8c2b5da1383f3689b93305417e1bf0d4908b87c91afb33c3266dd6bd6fbcd768cc98614a3f730ee94 WHIRLPOOL 80dcc426bbd17d57a346d6703d2b5366c7489666f33bb9ec2a1f36cf0e133e2b6c944a5f328cd3882241812b0856c59b3b3cd1648d59498ca80467ea65fe7971
diff --git a/sci-chemistry/ghemical/files/2.99.2-docs.patch b/sci-chemistry/ghemical/files/2.99.2-docs.patch
new file mode 100644
index 000000000000..85f31dfd729f
--- /dev/null
+++ b/sci-chemistry/ghemical/files/2.99.2-docs.patch
@@ -0,0 +1,22 @@
+diff --git a/docs/user-docs/Makefile.am b/docs/user-docs/Makefile.am
+index 030f67c..dcb207b 100644
+--- a/docs/user-docs/Makefile.am
++++ b/docs/user-docs/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = images
+
+-helpfilesdir = $(datadir)/ghemical/@APPVERSION@/user-docs
++helpfilesdir = $(datadir)/doc/ghemical-@APPVERSION@/html
+ helpfiles_DATA = *.css *.html
+
+ EXTRA_DIST = $(helpfiles_DATA)
+diff --git a/docs/user-docs/images/Makefile.am b/docs/user-docs/images/Makefile.am
+index fae0ffd..a569151 100644
+--- a/docs/user-docs/images/Makefile.am
++++ b/docs/user-docs/images/Makefile.am
+@@ -1,4 +1,4 @@
+-helpimagesdir = $(datadir)/ghemical/@APPVERSION@/user-docs/images
++helpimagesdir = $(datadir)/doc/ghemical-@APPVERSION@/html/images
+ helpimages_DATA = *.png
+
+ EXTRA_DIST = $(helpimages_DATA)
diff --git a/sci-chemistry/ghemical/files/ghemical-gcc43.patch b/sci-chemistry/ghemical/files/ghemical-gcc43.patch
new file mode 100644
index 000000000000..93557d48720c
--- /dev/null
+++ b/sci-chemistry/ghemical/files/ghemical-gcc43.patch
@@ -0,0 +1,14 @@
+--- src-orig/pangofont_wcl.cpp 2008-11-30 16:15:23.932475487 -0600
++++ src/pangofont_wcl.cpp 2008-11-30 16:16:09.620396370 -0600
+@@ -22,6 +22,10 @@
+
+ #include <gtk/gtkgl.h>
+
++#include <string.h>
++
++#include <cstdlib>
++using namespace std;
+ /*################################################################################################*/
+
+ pangofont_wcl::pangofont_wcl(ogl_camera * cam) :
+
diff --git a/sci-chemistry/ghemical/ghemical-2.99.2-r2.ebuild b/sci-chemistry/ghemical/ghemical-2.99.2-r2.ebuild
new file mode 100644
index 000000000000..a87d1c1bba33
--- /dev/null
+++ b/sci-chemistry/ghemical/ghemical-2.99.2-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit autotools eutils
+
+DESCRIPTION="Chemical quantum mechanics and molecular mechanics"
+HOMEPAGE="http://bioinformatics.org/ghemical/"
+SRC_URI="http://bioinformatics.org/ghemical/download/current/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="openbabel seamonkey threads"
+
+RDEPEND="
+ dev-libs/glib:2
+ gnome-base/libglade:2.0
+ sci-chemistry/mpqc
+ >=sci-libs/libghemical-2.99
+ >=x11-libs/liboglappth-0.98
+ virtual/opengl
+ x11-libs/pango
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ openbabel? ( sci-chemistry/openbabel )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-docs.patch
+ eautoreconf
+}
+
+src_configure() {
+# With amd64, if you want gamess I recommend adding gamess and gtk-gamess to package.provided for now.
+
+# Change the built-in help browser.
+ if use seamonkey ; then
+ sed -i -e 's|mozilla|seamonkey|g' src/gtk_app.cpp || die "sed failed for seamonkey!"
+ else
+ sed -i -e 's|mozilla|firefox|g' src/gtk_app.cpp || die "sed failed for firefox!"
+ fi
+
+ econf \
+ $(use_enable openbabel) \
+ $(use_enable threads)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ make_desktop_entry /usr/bin/ghemical Ghemical /usr/share/ghemical/${PV}/pixmaps/ghemical.png
+}
diff --git a/sci-chemistry/ghemical/ghemical-3.0.0.ebuild b/sci-chemistry/ghemical/ghemical-3.0.0.ebuild
new file mode 100644
index 000000000000..df7a67c05f3f
--- /dev/null
+++ b/sci-chemistry/ghemical/ghemical-3.0.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit autotools eutils
+
+DESCRIPTION="Chemical quantum mechanics and molecular mechanics"
+HOMEPAGE="http://bioinformatics.org/ghemical/"
+SRC_URI="http://bioinformatics.org/ghemical/download/current/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="openbabel seamonkey threads"
+
+RDEPEND="
+ dev-libs/glib:2
+ gnome-base/libglade:2.0
+ sci-chemistry/mpqc
+ >=sci-libs/libghemical-3.0.0
+ >=x11-libs/liboglappth-1.0.0
+ virtual/opengl
+ x11-libs/pango
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ openbabel? ( sci-chemistry/openbabel )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/2.99.2-docs.patch
+ eautoreconf
+}
+
+src_configure() {
+# With amd64, if you want gamess I recommend adding gamess and gtk-gamess to package.provided for now.
+
+# Change the built-in help browser.
+ if use seamonkey ; then
+ sed -i -e 's|mozilla|seamonkey|g' src/gtk_app.cpp || die "sed failed for seamonkey!"
+ else
+ sed -i -e 's|mozilla|firefox|g' src/gtk_app.cpp || die "sed failed for firefox!"
+ fi
+
+ econf \
+ $(use_enable openbabel) \
+ $(use_enable threads)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ make_desktop_entry /usr/bin/ghemical Ghemical /usr/share/ghemical/${PV}/pixmaps/ghemical.png
+}
diff --git a/sci-chemistry/ghemical/metadata.xml b/sci-chemistry/ghemical/metadata.xml
new file mode 100644
index 000000000000..631ea739d033
--- /dev/null
+++ b/sci-chemistry/ghemical/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-chemistry</herd>
+<longdescription>
+Ghemical supports both quantum-mechanics (semi-empirical and ab initio) models
+and molecular mechanics models (there is an experimental Tripos 5.2-like force
+field for organic molecules). Also a tool for reduced protein models is
+included. Geometry optimization, molecular dynamics and a large set of
+visualization tools are currently available.
+</longdescription>
+<use>
+ <flag name='openbabel'>Use <pkg>sci-chemistry/openbabel</pkg> for file
+ conversions</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-chemistry/gopenmol/Manifest b/sci-chemistry/gopenmol/Manifest
new file mode 100644
index 000000000000..087c602229b0
--- /dev/null
+++ b/sci-chemistry/gopenmol/Manifest
@@ -0,0 +1 @@
+DIST gopenmol-3.00-linux.tar.gz 29615195 SHA256 314494a751f65c28d015fee854d2ee347fecbca6ccf31bb7e04db7eda6a16a23 SHA512 e28fb607fcfdd543f4e62d3d1bf8ba789bafda608bb6a16e534bfd48bb4f2e2741a9fa98b7ead25db7d5572bb92064c73ba59987b0c3c3193477c3735babefd3 WHIRLPOOL eed5015c81b2c6e4cb14faf3f3176b979a3e79d1bb014dbd10fd606de0452f502b004b4bcb85e5cea57191ed782b3f9afeee5027c155d48370f8960cbca12d75
diff --git a/sci-chemistry/gopenmol/files/3.00-impl-dec.patch b/sci-chemistry/gopenmol/files/3.00-impl-dec.patch
new file mode 100644
index 000000000000..e1d66c7aaa5d
--- /dev/null
+++ b/sci-chemistry/gopenmol/files/3.00-impl-dec.patch
@@ -0,0 +1,80 @@
+ density/density.c | 1 +
+ utility/g94cub2pl.c | 1 +
+ utility/gamess2plt.c | 1 +
+ utility/gcube2plt.c | 1 +
+ utility/jaguar2plt.c | 1 +
+ vss/vssmod.c | 1 +
+ 6 files changed, 6 insertions(+)
+
+diff --git a/density/density.c b/density/density.c
+index 130a48e..ee218c5 100755
+--- a/density/density.c
++++ b/density/density.c
+@@ -13,6 +13,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <malloc.h>
++#include <stdlib.h>
+
+ #define VERBOSE 0
+ #define BUFF_LEN 500
+diff --git a/utility/g94cub2pl.c b/utility/g94cub2pl.c
+index e773ab2..94fbcfd 100755
+--- a/utility/g94cub2pl.c
++++ b/utility/g94cub2pl.c
+@@ -315,6 +315,7 @@ which can be read by gOpenMol or SCARECROW.
+ #include <sys/types.h>
+ #include <malloc.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #define BUFF_LEN 256
+ #define BOHR_RADIUS 0.52917715 /* conversion constant */
+diff --git a/utility/gamess2plt.c b/utility/gamess2plt.c
+index 3f6108e..5da481d 100755
+--- a/utility/gamess2plt.c
++++ b/utility/gamess2plt.c
+@@ -86,6 +86,7 @@ which can be read by gOpenMol or SCARECROW.
+ #include <sys/types.h>
+ #include <malloc.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #define BUFF_LEN 256
+ #define BOHR_RADIUS 0.52917715 /* conversion constant */
+diff --git a/utility/gcube2plt.c b/utility/gcube2plt.c
+index c5f7b5e..711bad3 100755
+--- a/utility/gcube2plt.c
++++ b/utility/gcube2plt.c
+@@ -306,6 +306,7 @@ which can be read by gOpenMol or SCARECROW.
+ #include <sys/types.h>
+ #include <malloc.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #define BUFF_LEN 256
+ #define BOHR_RADIUS 0.52917715 /* conversion constant */
+diff --git a/utility/jaguar2plt.c b/utility/jaguar2plt.c
+index 657128c..96d6ac1 100755
+--- a/utility/jaguar2plt.c
++++ b/utility/jaguar2plt.c
+@@ -26,6 +26,7 @@ fastes running coordinate.
+ #include <sys/types.h>
+ #include <malloc.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #define BUFF_LEN 256
+ #define BOHR_RADIUS 0.52917715 /* conversion constant */
+diff --git a/vss/vssmod.c b/vss/vssmod.c
+index 957d2e5..9d73978 100755
+--- a/vss/vssmod.c
++++ b/vss/vssmod.c
+@@ -20,6 +20,7 @@ C- for the potentials
+ #include <math.h>
+ #include <string.h>
+ #include <malloc.h>
++#include <stdlib.h>
+
+ #define LINE_LEN 80
+ #define BUFF_LEN 500
diff --git a/sci-chemistry/gopenmol/files/3.00-include-config-for-plugins.patch b/sci-chemistry/gopenmol/files/3.00-include-config-for-plugins.patch
new file mode 100644
index 000000000000..a8602d07a03e
--- /dev/null
+++ b/sci-chemistry/gopenmol/files/3.00-include-config-for-plugins.patch
@@ -0,0 +1,11 @@
+--- gOpenMol-3.00.orig/src/plugins/Makefile 2005-12-02 19:38:08.000000000 -0800
++++ gOpenMol-3.00/src/plugins/Makefile 2005-12-02 19:37:29.000000000 -0800
+@@ -8,6 +8,8 @@
+ # Coded by: Eero Häkkinen
+ ##############################################################################
+
++include config.mk
++
+ build-all: build FORCE ;
+
+ all install install-local uninstall: FORCE
diff --git a/sci-chemistry/gopenmol/files/3.00-multilib.patch b/sci-chemistry/gopenmol/files/3.00-multilib.patch
new file mode 100644
index 000000000000..9ca263808622
--- /dev/null
+++ b/sci-chemistry/gopenmol/files/3.00-multilib.patch
@@ -0,0 +1,104 @@
+diff --git a/src/config.mk.ac b/src/config.mk.ac
+index b1061d9..374bc77 100755
+--- a/src/config.mk.ac
++++ b/src/config.mk.ac
+@@ -18,7 +18,7 @@ gomroot = $(libdir)/$(gomsubdir)
+ gomdataroot = $(datadir)/$(gomsubdir)
+ gombindir = $(gomroot)/bin
+ gomincdir = $(includedir)/$(gomsubdir)
+-gomlibdir = $(gomroot)/bin
++gomlibdir = $(gomroot)/GENTOOLIBDIR
+ # Tcl/Tk entries.
+ TCL_LIBRARY = @TCL_LIBRARY@
+ TK_LIBRARY = @TK_LIBRARY@
+diff --git a/src/plugins/Makefile b/src/plugins/Makefile
+index bb9af64..cf8a97d 100755
+--- a/src/plugins/Makefile
++++ b/src/plugins/Makefile
+@@ -22,7 +22,7 @@ all install install-local uninstall: FORCE
+ build compile clean clean-libs clean-objs: FORCE
+ -@for dir in *; do \
+ if test -f "$$dir/Makefile"; then \
+- ( cd "$$dir" && $(MAKE) $(MFLAGS) $@ ) ;\
++ ( cd "$$dir" && $(MAKE) $(MFLAGS) $@ ) || exit 1;\
+ fi ;\
+ done
+
+diff --git a/src/plugins/config.mk.ac b/src/plugins/config.mk.ac
+index 03e3f6b..eb30ea8 100755
+--- a/src/plugins/config.mk.ac
++++ b/src/plugins/config.mk.ac
+@@ -11,7 +11,7 @@ gomdataroot = ${datadir}/${gomsubdir}
+ gombindir = ${gomroot}/bin
+ gomincdir = ${gomsrcdir}/include/gomlib
+ #INS gomincdir = ${includedir}/${gomsubdir}
+-gomlibdir = ${gomroot}/bin
++gomlibdir = ${gomroot}/GENTOOLIBDIR
+ gomsrcdir = @abs_top_srcdir@
+ gombltdir = @abs_top_builddir@
+ #INS gomsrcdir = ${gomroot}/src
+diff --git a/src/plugins/rules.mk b/src/plugins/rules.mk
+index d41ed47..da133c6 100755
+--- a/src/plugins/rules.mk
++++ b/src/plugins/rules.mk
+@@ -43,12 +43,12 @@ $(LIBRARY): $(libdeps)
+ @$(RM) alldeps.dT
+
+ link-CC: FORCE
+- $(GOM_LINK_CC) $(PLUG_CFLAGS) -o $(LIBRARY) $(OBJECTS) \
+- $(PLUG_LDFLAGS) $(PLUG_LIBS) $(GOM_LINKFLAGS)
++ $(GOM_LINK_CC) $(GOM_LINKFLAGS) $(PLUG_CFLAGS) -o $(LIBRARY) $(OBJECTS) \
++ $(PLUG_LDFLAGS) $(PLUG_LIBS)
+
+ link-CXX: FORCE
+- $(GOM_LINK_CXX) $(PLUG_CXXFLAGS) -o $(LIBRARY) $(OBJECTS) \
+- $(PLUG_LDFLAGS) $(PLUG_LIBS) $(GOM_LINKFLAGS)
++ $(GOM_LINK_CXX) $(GOM_LINKFLAGS) $(PLUG_CXXFLAGS) -o $(LIBRARY) $(OBJECTS) \
++ $(PLUG_LDFLAGS) $(PLUG_LIBS)
+
+ # Rule to compile the source files.
+ # First make:
+diff --git a/src/unix/make/install.mk b/src/unix/make/install.mk
+index 3018946..98c061a 100755
+--- a/src/unix/make/install.mk
++++ b/src/unix/make/install.mk
+@@ -36,7 +36,7 @@ mkinstalldirs: mkinstalldirs-local mkinstalldirs-shared FORCE ;
+ mkinstalldirs-local: FORCE
+ $(MKDIR_P) '$(gomroot)' || test -d '$(gomroot)'
+ @$(set_show); set -e; \
+- for dir in bin src/plugins src/unix; do \
++ for dir in bin lib src/plugins src/unix; do \
+ dir='$(gomroot)'/$$dir; \
+ $$show $(MKDIR_P) "$$dir"; \
+ $(MKDIR_P) "$$dir" || test -d "$$dir"; \
+diff --git a/src/unix/make/utility.mk.ac b/src/unix/make/utility.mk.ac
+index 21ad59d..ee25ac7 100755
+--- a/src/unix/make/utility.mk.ac
++++ b/src/unix/make/utility.mk.ac
+@@ -47,8 +47,7 @@ BINARIES_F = ambera2b$(EXEEXT) \
+ xmol2bamber$(EXEEXT) \
+ xplor2charmm$(EXEEXT) \
+ gridasc2plt$(EXEEXT) \
+- gridbin2plt$(EXEEXT) \
+- icon8$(EXEEXT)
++ gridbin2plt$(EXEEXT)
+
+ BINARIES_JAR = xvibs.jar
+
+@@ -76,13 +75,13 @@ $(OBJECTS_C):
+ $(CC) -c $? $(CPPFLAGS) $(CFLAGS)
+
+ $(BINARIES_C):
+- $(CC) -o $@ $? $(CPPFLAGS) $(CFLAGS) $(STD_LIBS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o $@ $? $(CPPFLAGS) $(CFLAGS) $(STD_LIBS)
+
+ $(BINARIES_CXX):
+- $(CXX) -o $@ $? $(CPPFLAGS) $(CXXFLAGS) $(STD_LIBS) $(LDFLAGS)
++ $(CXX) $(LDFLAGS) -o $@ $? $(CPPFLAGS) $(CXXFLAGS) $(STD_LIBS)
+
+ $(BINARIES_F):
+- $(F77) -o $@ $? $(FFLAGS) $(STD_LIBS) $(LDFLAGS)
++ $(F77) $(LDFLAGS) -o $@ $? $(FFLAGS) $(STD_LIBS)
+
+ $(BINARIES_JAR):
+ cp $? $@
diff --git a/sci-chemistry/gopenmol/files/3.00-tcl8.6.patch b/sci-chemistry/gopenmol/files/3.00-tcl8.6.patch
new file mode 100644
index 000000000000..a4c3bce12468
--- /dev/null
+++ b/sci-chemistry/gopenmol/files/3.00-tcl8.6.patch
@@ -0,0 +1,32 @@
+ src/graphics/g_Mmain.c | 2 +-
+ src/parser/p_parser.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/graphics/g_Mmain.c b/src/graphics/g_Mmain.c
+index b9bb340..f044568 100755
+--- a/src/graphics/g_Mmain.c
++++ b/src/graphics/g_Mmain.c
+@@ -487,7 +487,7 @@ int gomp_Mmain(int argc, const char *argv[])
+ {
+ Tcl_Interp *interp;
+ interp = gomp_GetTclInterp();
+- sprintf(Temp,"'%s' problems creating the Tk window",interp->result);
++ sprintf(Temp,"'%s' problems creating the Tk window",Tcl_GetStringResult(interp));
+ gomp_PrintERROR(Temp);
+ return(1);
+ }
+diff --git a/src/parser/p_parser.c b/src/parser/p_parser.c
+index c9fd8ce..62eb05c 100755
+--- a/src/parser/p_parser.c
++++ b/src/parser/p_parser.c
+@@ -809,8 +809,8 @@ int gomp_TclRunScript()
+ if(value != (const char *)NULL) {
+ code = Tcl_EvalFile(interp , value);
+ if(code != TCL_OK) {
+- if(*interp->result != (char)NULL) {
+- gomp_PrintERROR(interp->result);
++ if(*Tcl_GetStringResult(interp) != (char)NULL) {
++ gomp_PrintERROR(Tcl_GetStringResult(interp));
+ return(1);
+ }
+ }
diff --git a/sci-chemistry/gopenmol/gopenmol-3.00-r2.ebuild b/sci-chemistry/gopenmol/gopenmol-3.00-r2.ebuild
new file mode 100644
index 000000000000..1a50d785d368
--- /dev/null
+++ b/sci-chemistry/gopenmol/gopenmol-3.00-r2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="2"
+
+inherit eutils multilib python
+
+DESCRIPTION="Tool for the visualization and analysis of molecular structures"
+HOMEPAGE="http://www.csc.fi/gopenmol/"
+SRC_URI="${HOMEPAGE}/distribute/${P}-linux.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-lang/tk
+ dev-tcltk/bwidget
+ media-libs/freeglut
+ virtual/jpeg
+ virtual/opengl
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXxf86vm"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/gOpenMol-${PV}/src"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-include-config-for-plugins.patch \
+ "${FILESDIR}"/${PV}-multilib.patch
+
+ sed \
+ -e "s:GENTOOLIBDIR:$(get_libdir):g" \
+ -i config.mk.ac plugins/config.mk.ac || die
+ sed "/GOM_TEMP/s:^.*$:GOM_TEMP=\"${EPREFIX}/tmp/:g" -i ../environment.txt || die
+}
+
+src_compile() {
+ default
+
+ # Plugins and Utilities are not built by default
+ cd "${S}"/plugins && emake
+ cd "${S}"/utility && emake
+}
+
+src_install() {
+ einstall
+
+ cd "${S}"/plugins && einstall
+ cd "${S}"/utility && einstall
+
+ dosym ../$(get_libdir)/gOpenMol-${PV}/bin/${PN} /usr/bin/${PN}
+
+ dodoc "${ED}"/usr/share/gOpenMol-${PV}/{docs/*,README*} || die
+
+ dodir /usr/share/doc/${PF}/html
+ mv -T "${ED}"/usr/share/gOpenMol-${PV}/help "${ED}"/usr/share/doc/${PF}/html || die
+ mv "${ED}"/usr/share/gOpenMol-${PV}/utility "${ED}"/usr/share/doc/${PF}/html || die
+
+ rm -rf \
+ "${ED}"/usr/$(get_libdir)/gOpenMol-${PV}/{src,install} \
+ "${ED}"/usr/share/gOpenMol-${PV}/{docs,README*,COPYRIGHT} || die
+
+ cat >> "${T}"/20${PN} <<- EOF
+ GOM_ROOT="${EPREFIX}"/usr/$(get_libdir)/gOpenMol-${PV}/
+ GOM_DATA="${EPREFIX}"/usr/share/gOpenMol-${PV}/data
+ GOM_HELP="${EPREFIX}"/usr/share/doc/${PVR}/html
+ GOM_DEMO="${EPREFIX}"/usr/share/gOpenMol-${PV}/demo
+ EOF
+
+ doenvd "${T}"/20${PN}
+}
+
+pkg_postinst() {
+ einfo "Run gOpenMol using the rungOpenMol script."
+}
diff --git a/sci-chemistry/gopenmol/gopenmol-3.00-r3.ebuild b/sci-chemistry/gopenmol/gopenmol-3.00-r3.ebuild
new file mode 100644
index 000000000000..b936d437e5a0
--- /dev/null
+++ b/sci-chemistry/gopenmol/gopenmol-3.00-r3.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-single-r1
+
+DESCRIPTION="Tool for the visualization and analysis of molecular structures"
+HOMEPAGE="http://www.csc.fi/gopenmol/"
+SRC_URI="${HOMEPAGE}/distribute/${P}-linux.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-lang/tk
+ dev-tcltk/bwidget
+ media-libs/freeglut
+ virtual/jpeg
+ virtual/opengl
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXxf86vm"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+S="${WORKDIR}/gOpenMol-${PV}/src"
+
+src_prepare() {
+ cd ..
+ epatch \
+ "${FILESDIR}"/${PV}-include-config-for-plugins.patch \
+ "${FILESDIR}"/${PV}-multilib.patch \
+ "${FILESDIR}"/${PV}-tcl8.6.patch \
+ "${FILESDIR}"/${PV}-impl-dec.patch
+
+ sed \
+ -e "s:GENTOOLIBDIR:$(get_libdir):g" \
+ -i src/{config.mk.ac,plugins/config.mk.ac} || die
+ sed "/GOM_TEMP/s:^.*$:GOM_TEMP=\"${EPREFIX}/tmp/:g" -i environment.txt || die
+}
+
+src_compile() {
+ default
+
+ # Plugins and Utilities are not built by default
+ cd "${S}"/plugins && emake
+ cd "${S}"/utility && emake
+}
+
+src_install() {
+ einstall
+
+ cd "${S}"/plugins && einstall
+ cd "${S}"/utility && einstall
+
+ dosym ../$(get_libdir)/gOpenMol-${PV}/bin/${PN} /usr/bin/${PN}
+
+ dodoc "${ED}"/usr/share/gOpenMol-${PV}/{docs/*,README*} || die
+
+ dodir /usr/share/doc/${PF}/html
+ mv -T "${ED}"/usr/share/gOpenMol-${PV}/help "${ED}"/usr/share/doc/${PF}/html || die
+ mv "${ED}"/usr/share/gOpenMol-${PV}/utility "${ED}"/usr/share/doc/${PF}/html || die
+
+ rm -rf \
+ "${ED}"/usr/$(get_libdir)/gOpenMol-${PV}/{src,install} \
+ "${ED}"/usr/share/gOpenMol-${PV}/{docs,README*,COPYRIGHT} || die
+
+ cat >> "${T}"/20${PN} <<- EOF
+ GOM_ROOT="${EPREFIX}"/usr/$(get_libdir)/gOpenMol-${PV}/
+ GOM_DATA="${EPREFIX}"/usr/share/gOpenMol-${PV}/data
+ GOM_HELP="${EPREFIX}"/usr/share/doc/${PVR}/html
+ GOM_DEMO="${EPREFIX}"/usr/share/gOpenMol-${PV}/demo
+ EOF
+
+ doenvd "${T}"/20${PN}
+}
+
+pkg_postinst() {
+ einfo "Run gOpenMol using the rungOpenMol script."
+}
diff --git a/sci-chemistry/gopenmol/metadata.xml b/sci-chemistry/gopenmol/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/gopenmol/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/gperiodic/Manifest b/sci-chemistry/gperiodic/Manifest
new file mode 100644
index 000000000000..659d4e28d9ce
--- /dev/null
+++ b/sci-chemistry/gperiodic/Manifest
@@ -0,0 +1 @@
+DIST gperiodic-2.0.10.tar.gz 131213 SHA256 78d72870c51c39e4a35c804c05b8ef5e39f88d42eced52b2934e21d74fb8d096 SHA512 23d0074ad5b0f9e25e8eee63f8c375e2448b1ee7c00f89e965b7dd8ce3f60f20251d7699a2f7a767228316144b946a5ac204a3e478c395767133f7fc801b51ba WHIRLPOOL b758b622bfb980aad45b0bb6e2850579408959c3bf700f4dbb21d4bc64168d2a589a9ed5974f75b5eaf7f6c9d593c69dbc9b470957b01457caa30eb356850f14
diff --git a/sci-chemistry/gperiodic/files/gperiodic-2.0.10-makefile.patch b/sci-chemistry/gperiodic/files/gperiodic-2.0.10-makefile.patch
new file mode 100644
index 000000000000..abdb5caae4f2
--- /dev/null
+++ b/sci-chemistry/gperiodic/files/gperiodic-2.0.10-makefile.patch
@@ -0,0 +1,64 @@
+Respect CC, CFLAGS, LDFLAGS
+Fix install paths
+Fix parallel build
+Drop DEPRECATED flags, bug #391099
+
+--- Makefile
++++ Makefile
+@@ -1,6 +1,5 @@
+-CC := gcc
+-CFLAGS := `pkg-config --cflags gtk+-2.0` -I. -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
+-LIBS :=`pkg-config --libs gtk+-2.0`
++CFLAGS += `pkg-config --cflags gtk+-2.0` -I.
++LIBS +=`pkg-config --libs gtk+-2.0`
+ bindir ?= /usr/bin
+ datadir ?= /usr/share
+ enable_nls ?= 1
+@@ -8,12 +7,11 @@
+ .c.o:
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $<
+
+-all:
+- make gperiodic
+- make -C po/ all enable_nls=$(enable_nls)
++all: gperiodic
++ $(MAKE) -C po/ all enable_nls=$(enable_nls)
+
+ gperiodic: gperiodic.o
+- $(CC) $(CFLAGS) -o gperiodic gperiodic.o $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o gperiodic gperiodic.o $(LIBS)
+ ifeq ($(strip),1)
+ strip gperiodic
+ endif
+@@ -23,24 +21,21 @@
+ gperiodic.o: gperiodic.c gperiodic.h table_data.h
+
+ install:
+- mkdir -p $(DESTDIR)$(bindir)
+- install -m 755 gperiodic $(DESTDIR)$(bindir)
+- mkdir -p $(DESTDIR)$(datadir)/applications
+- install -m 644 gperiodic.desktop $(DESTDIR)$(datadir)/applications
+- mkdir -p $(DESTDIR)$(datadir)/pixmaps
+- install -m 644 gperiodic.png $(DESTDIR)$(datadir)/pixmaps
+- install -m 644 gperiodic-crystal.png $(DESTDIR)$(datadir)/pixmaps
+- make -C po/ install enable_nls=$(enable_nls) datadir=$(datadir) DESTDIR=$(DESTDIR)
++ install -D -m 755 gperiodic $(DESTDIR)$(bindir)/gperiodic
++ install -D -m 644 gperiodic.desktop $(DESTDIR)$(datadir)/applications/gperiodic.desktop
++ install -D -m 644 gperiodic.png $(DESTDIR)$(datadir)/pixmaps/gperiodic.png
++ install -m 644 gperiodic-crystal.png $(DESTDIR)$(datadir)/pixmaps/gperiodic-crystal.png
++ $(MAKE) -C po/ install enable_nls=$(enable_nls) datadir=$(datadir) DESTDIR=$(DESTDIR)
+
+ uninstall:
+ rm -f $(bindir)/gperiodic \
+ $(datadir)/applications/gperiodic.desktop
+ $(datadir)/pixmaps/gperiodic.png \
+ $(datadir)/pixmaps/gperiodic-crystal.png
+- make -C po/ uninstall enable_nls=$(enable_nls) datadir=$(datadir) DESTDIR=$(DESTDIR)
++ $(MAKE) -C po/ uninstall enable_nls=$(enable_nls) datadir=$(datadir) DESTDIR=$(DESTDIR)
+
+ clean:
+ rm -f *.o gperiodic
+- make -C po/ clean
++ $(MAKE) -C po/ clean
+
+ .PHONY: install uninstall clean
diff --git a/sci-chemistry/gperiodic/files/gperiodic-2.0.10-nls.patch b/sci-chemistry/gperiodic/files/gperiodic-2.0.10-nls.patch
new file mode 100644
index 000000000000..de0bea04dc14
--- /dev/null
+++ b/sci-chemistry/gperiodic/files/gperiodic-2.0.10-nls.patch
@@ -0,0 +1,20 @@
+ po/Makefile | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/po/Makefile b/po/Makefile
+index d7d7d78..179dad6 100644
+--- a/po/Makefile
++++ b/po/Makefile
+@@ -26,10 +26,12 @@ endif
+
+ install:
+ $(MAKE) all
++ifeq ($(enable_nls),1)
+ for f in $(FILES_MO) ; do \
+ mkdir -p $(DESTDIR)$(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES ; \
+ install -m 644 $$f $(DESTDIR)$(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES/$(PACKAGE).mo ; \
+ done
++endif
+
+ uninstall:
+ for f in $(FILES_MO) ; do \
diff --git a/sci-chemistry/gperiodic/gperiodic-2.0.10-r2.ebuild b/sci-chemistry/gperiodic/gperiodic-2.0.10-r2.ebuild
new file mode 100644
index 000000000000..9c7dca1e1d0c
--- /dev/null
+++ b/sci-chemistry/gperiodic/gperiodic-2.0.10-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Periodic table application for Linux"
+HOMEPAGE="http://www.frantz.fi/software/gperiodic.php"
+SRC_URI="http://www.frantz.fi/software/${P}.tar.gz"
+
+KEYWORDS="amd64 x86"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="nls"
+
+RDEPEND="
+ sys-libs/ncurses:5
+ x11-libs/gtk+:2
+ x11-libs/cairo[X]
+ nls? ( sys-devel/gettext )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-makefile.patch \
+ "${FILESDIR}"/${P}-nls.patch
+ sed \
+ -e '/Encoding/d' \
+ -i ${PN}.desktop || die
+}
+
+src_compile() {
+ local myopts
+ use nls && myopts="enable_nls=1" || myopts="enable_nls=0"
+ emake CC=$(tc-getCC) ${myopts}
+}
+
+src_install() {
+ local myopts
+ use nls && myopts="enable_nls=1" || myopts="enable_nls=0"
+ emake DESTDIR="${D}" ${myopts} install
+ dodoc AUTHORS ChangeLog README NEWS
+ newdoc po/README README.translation
+}
diff --git a/sci-chemistry/gperiodic/gperiodic-2.0.10.ebuild b/sci-chemistry/gperiodic/gperiodic-2.0.10.ebuild
new file mode 100644
index 000000000000..f317a6b77afe
--- /dev/null
+++ b/sci-chemistry/gperiodic/gperiodic-2.0.10.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Periodic table application for Linux"
+HOMEPAGE="http://www.frantz.fi/software/gperiodic.php"
+SRC_URI="http://www.frantz.fi/software/${P}.tar.gz"
+
+KEYWORDS="amd64 x86"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="nls"
+
+RDEPEND="
+ sys-libs/ncurses:5
+ x11-libs/gtk+:2
+ x11-libs/cairo[X]
+ nls? ( sys-devel/gettext )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ # The author has removed "unnecessary automake/autoconf setup"
+
+ sed -i -e "s|-DGTK_DISABLE_DEPRECATED|${CFLAGS}|" Makefile || die
+ sed -i -e "/make clean/d" Makefile || die
+ sed -i -e "s|CC=gcc|CC=$(tc-getCC)|" Makefile || die
+ if ! use nls; then
+ sed -i -e "/make -C po/d" Makefile || die
+ fi
+}
+
+src_install() {
+ sed -i -e "s|/usr/bin|${ED}/usr/bin|" Makefile || die
+ sed -i -e "s|/usr/share|${ED}/usr/share|" Makefile || die
+ sed -i -e "s|/usr/share|${ED}/usr/share|" po/Makefile || die
+
+ # Create directories - Makefile is quite broken.
+ dodir \
+ /usr/bin \
+ /usr/share/pixmaps \
+ /usr/share/applications
+
+ default
+
+ # The man page seems to have been removed too.
+ newdoc po/README README.translation
+}
diff --git a/sci-chemistry/gperiodic/metadata.xml b/sci-chemistry/gperiodic/metadata.xml
new file mode 100644
index 000000000000..e87a8759836d
--- /dev/null
+++ b/sci-chemistry/gperiodic/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-chemistry</herd>
+ <longdescription>
+ GPeriodic is a program for looking up various data about elements from the
+ periodic table, based on the GTK2 toolkit. It also features a command line
+ interface.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/gromacs/Manifest b/sci-chemistry/gromacs/Manifest
new file mode 100644
index 000000000000..7cf2e013ff01
--- /dev/null
+++ b/sci-chemistry/gromacs/Manifest
@@ -0,0 +1,6 @@
+DIST gromacs-5.0.4.tar.gz 26342095 SHA256 78068eeccc0b950018ddb45c41280e53c8bedae4639dca48e17c940f8896b23b SHA512 bc62b623bf71dcaa948aaf7563a3d3afa973da0702062848a20323db202e862dcee413197dacd1472866ccb40fce7709e283177b1c6c49514064f23e6c46b5ee WHIRLPOOL d8458d3d563e015e830622ae0c924e896765a6329ffe4cb1a31c7aef3c804f392d29e3f1db5617051e85058403422f7d69a160a6c7cc810564696d88f9d50bd4
+DIST gromacs-5.0.5.tar.gz 26343524 SHA256 952c9d14879a12d03362b2233e47c51385dc99325bdde5223a2942938739bf4e SHA512 b45b2da5de48b0aa272b6d8583fd717762512fbd291ac35b414d23c430bf7b6db470f64e641728658e94784de9ddcde04242cfba09ff47931e01b85b8ca8fd73 WHIRLPOOL cc1f5f60d70780f8694acb16c96634d2aa8a16ff3d52be5ed4572dd37f80d9591f8060a0256f3e0f4a55069247398b8b52ad05efed691a0ab8619bc77aa64f76
+DIST gromacs-5.0.6.tar.gz 26351063 SHA256 e07e950c4cd6cb84b83b145b70a15c25338ad6a7d7d1a0a83cdbd51cad954952 SHA512 5bd11d2ab79cc94c1ecf10bb05c239f7a4aed426ba3da0e536076e5145ff854889f9f0808d87a8ce007d86fce8eff9b6a809ae5fb68478528ea405c335dbffb2 WHIRLPOOL e5898fa247016a4c52e7ddc77ba03f0d39df2b863607a79f4b88f7029a2467e22cd84a507c18b52b4015619341699bbede28939be485613ac145b499a7d0998d
+DIST regressiontests-5.0.4.tar.gz 65193251 SHA256 89ad9bc067035ac8f340319b538c446983d937b910067e871911d7afe2ecb3f0 SHA512 747725fa28c1c9525596bdeeb8809e45268e19036c11dac67d043aa1c51748688ca37eb6014eb7e819eb927a8b9ca2631d0ace4cdff8ed491b08c316c530ab65 WHIRLPOOL e15ccab0a0beefac41aeff11e2e596e971167f1590eed159ff82c4a8e3aec1d234287be597026951904ecfe6099f30ef3bcd48f2098b9f5201bde62e15fbc4f9
+DIST regressiontests-5.0.5.tar.gz 65204335 SHA256 e48b9934de89c23a63c9adc8ba9a5aa397cf5a4d1746165d833c556d5ce54833 SHA512 1a1d1a3398ba5d3cc9f68e0f401437ccbdf3265f3ea1100b3b0d314d61ccd467ce3e8492ee09a645c5aaf9c1ca0acdf5ed6213a61bbd689833f3ca002bd5c79b WHIRLPOOL 882c9d8fa45720a5a71811db898aa33b9323bfe60340e8c4f4e2ef537f02efb531c0f3a721ead0e98bdb96f1e9d71df24d1d0faae448ab3da096c694e2a9b593
+DIST regressiontests-5.0.6.tar.gz 65203643 SHA256 fd0a2408250dfc088ac9b401bc8702b8ba398a81db56c214d55f68f838d7c079 SHA512 dec41fbaa93784fb6438887eeef9f523add06032ae9801b83c492f5924872cd9b6a17e07d61cd7d8f999193d46384112e4c8046f4b2a3c28eb0c08f11c1ad8c6 WHIRLPOOL e6a8e99abc3b59be0f246769de0ebdef528caa24b930999dfbe0167a58696a68a31d0b819d2503e312977f0ec4d1ee2acb60e8eb691fab45e608250f2dfde728
diff --git a/sci-chemistry/gromacs/gromacs-5.0.4-r1.ebuild b/sci-chemistry/gromacs/gromacs-5.0.4-r1.ebuild
new file mode 100644
index 000000000000..b5d7896aa556
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-5.0.4-r1.ebuild
@@ -0,0 +1,284 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit bash-completion-r1 cmake-utils cuda eutils multilib readme.gentoo toolchain-funcs
+
+if [[ $PV = *9999* ]]; then
+ EGIT_REPO_URI="git://git.gromacs.org/gromacs.git
+ https://gerrit.gromacs.org/gromacs.git
+ git://github.com/gromacs/gromacs.git
+ http://repo.or.cz/r/gromacs.git"
+ EGIT_BRANCH="release-5-0"
+ inherit git-r3
+ KEYWORDS=""
+else
+ SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${PN}-${PV/_/-}.tar.gz
+ test? ( http://gerrit.gromacs.org/download/regressiontests-${PV}.tar.gz )"
+ KEYWORDS="~alpha ~amd64 ~arm ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+
+# see COPYING for details
+# http://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="X blas boost cuda +doc -double-precision +fftw lapack +make-symlinks mkl mpi +offensive openmp +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ X? (
+ x11-libs/libX11
+ x11-libs/libSM
+ x11-libs/libICE
+ )
+ blas? ( virtual/blas )
+ boost? ( >=dev-libs/boost-1.55 )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
+ fftw? ( sci-libs/fftw:3.0 )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi )
+ "
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ cuda? ( single-precision )
+ mkl? ( !blas !fftw !lapack )"
+
+DOCS=( AUTHORS README )
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ $(gcc-version) == "4.1" ]] && die "gcc 4.1 is not supported by gromacs"
+ use openmp && ! tc-has-openmp && \
+ die "Please switch to an openmp compatible compiler"
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="git://git.gromacs.org/regressiontests.git" \
+ EGIT_BRANCH="master" EGIT_COMMIT="master" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ cmake-utils_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+
+ #go from slowest to fastest acceleration
+ local acce="None"
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl && has_version "=sci-libs/mkl-10*"; then
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="${MKLROOT}/include"
+ -DMKL_LIBRARIES="$(echo /opt/intel/mkl/10.0.5.025/lib/*/libmkl.so);$(echo /opt/intel/mkl/10.0.5.025/lib/*/libiomp*.so)"
+ )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ $(cmake-utils_use X GMX_X11)
+ $(cmake-utils_use blas GMX_EXTERNAL_BLAS)
+ $(cmake-utils_use lapack GMX_EXTERNAL_LAPACK)
+ $(cmake-utils_use openmp GMX_OPENMP)
+ $(cmake-utils_use offensive GMX_COOL_QUOTES)
+ $(cmake-utils_use boost GMX_EXTERNAL_BOOST)
+ $(cmake-utils_use tng GMX_USE_TNG)
+ $(cmake-utils_use doc GMX_BUILD_MANUAL)
+ $(cmake-utils_use make-symlinks GMX_SYMLINK_OLD_BINARY_NAMES)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_SIMD="$acce"
+ -DGMX_LIB_INSTALL_DIR="$(get_libdir)"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DGMX_X86_AVX_GCC_MASKLOAD_BUG=OFF
+ -DGMX_USE_GCC44_BUG_WORKAROUND=OFF
+ -DBUILD_TESTING=OFF
+ -DGMX_BUILD_UNITTESTS=OFF
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local cuda=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && \
+ cuda=( -DGMX_GPU=ON )
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=OFF
+ $(cmake-utils_use threads GMX_THREAD_MPI)
+ "${cuda[@]}"
+ -DGMX_OPENMM=OFF
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ use mpi || continue
+ einfo "Configuring for ${x} precision with mpi"
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_THREAD_MPI=OFF
+ -DGMX_MPI=ON ${cuda}
+ -DGMX_OPENMM=OFF
+ -DGMX_BUILD_MDRUN_ONLY=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -DGMX_BUILD_MANUAL=OFF
+ -DGMX_BINARY_SUFFIX="_mpi${suffix}"
+ -DGMX_LIBS_SUFFIX="_mpi${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" CC="mpicc" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}_mpi/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile
+ # generate bash completion, not 100% necessary for
+ # rel ebuilds as bundled
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile completion
+ # not 100% necessary for rel ebuilds as available from website
+ if use doc; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile manual
+ fi
+ use mpi || continue
+ einfo "Compiling for ${x} precision with mpi"
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
+ cmake-utils_src_compile
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_make check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake-utils_src_install
+ if use doc; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+ #release ebuild does this automatically
+ if [[ $PV = *9999* ]]; then
+ cp "${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash "${ED}/usr/bin" || die
+ echo "complete -o nospace -F _gmx_compl gmx" > "${ED}/usr/bin/gmx-completion-gmx.bash" || die
+ fi
+ use mpi || continue
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
+ cmake-utils_src_install
+ done
+
+ if use tng; then
+ insinto /usr/include/tng
+ doins src/external/tng_io/include/tng/*h
+ fi
+ # drop unneeded stuff
+ rm "${ED}"usr/bin/GMXRC* || die
+ #concatenate all gmx-completion*, starting with gmx-completion.bash (fct defs)
+ #little hacckery as some gmx-completion* newlines ,so cat won't work
+ for x in "${ED}"usr/bin/gmx-completion{,?*}.bash ; do
+ echo $(<${x})
+ done > "${T}"/gmx-bashcomp || die
+ newbashcomp "${T}"/gmx-bashcomp gmx
+ bashcomp_alias gmx mdrun
+ rm "${ED}"usr/bin/gmx-completion{,?*}.bash || die
+ if use double-precision && use single-precision; then
+ bashcomp_alias gmx gmx_d
+ bashcomp_alias gmx mdrun_d
+ fi
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
+ einfo "http://dx.doi.org/10.1021/ct700301q"
+ einfo
+ readme.gentoo_print_elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-5.0.4.ebuild b/sci-chemistry/gromacs/gromacs-5.0.4.ebuild
new file mode 100644
index 000000000000..6d59d9789888
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-5.0.4.ebuild
@@ -0,0 +1,279 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit bash-completion-r1 cmake-utils cuda eutils multilib readme.gentoo toolchain-funcs
+
+if [[ $PV = *9999* ]]; then
+ EGIT_REPO_URI="git://git.gromacs.org/gromacs.git
+ https://gerrit.gromacs.org/gromacs.git
+ git://github.com/gromacs/gromacs.git
+ http://repo.or.cz/r/gromacs.git"
+ EGIT_BRANCH="release-5-0"
+ inherit git-r3
+ KEYWORDS=""
+else
+ SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${PN}-${PV/_/-}.tar.gz
+ test? ( http://gerrit.gromacs.org/download/regressiontests-${PV}.tar.gz )"
+ KEYWORDS="~alpha amd64 arm ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+
+# see COPYING for details
+# http://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="X blas boost cuda +doc -double-precision +fftw lapack +make-symlinks mkl mpi +offensive openmp +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ X? (
+ x11-libs/libX11
+ x11-libs/libSM
+ x11-libs/libICE
+ )
+ blas? ( virtual/blas )
+ boost? ( >=dev-libs/boost-1.55 )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
+ fftw? ( sci-libs/fftw:3.0 )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi )
+ "
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ cuda? ( single-precision )
+ mkl? ( !blas !fftw !lapack )"
+
+DOCS=( AUTHORS README )
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ $(gcc-version) == "4.1" ]] && die "gcc 4.1 is not supported by gromacs"
+ use openmp && ! tc-has-openmp && \
+ die "Please switch to an openmp compatible compiler"
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="git://git.gromacs.org/regressiontests.git" \
+ EGIT_BRANCH="master" EGIT_COMMIT="master" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ cmake-utils_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+
+ #go from slowest to fastest acceleration
+ local acce="None"
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl && has_version "=sci-libs/mkl-10*"; then
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="${MKLROOT}/include"
+ -DMKL_LIBRARIES="$(echo /opt/intel/mkl/10.0.5.025/lib/*/libmkl.so);$(echo /opt/intel/mkl/10.0.5.025/lib/*/libiomp*.so)"
+ )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ $(cmake-utils_use X GMX_X11)
+ $(cmake-utils_use blas GMX_EXTERNAL_BLAS)
+ $(cmake-utils_use lapack GMX_EXTERNAL_LAPACK)
+ $(cmake-utils_use openmp GMX_OPENMP)
+ $(cmake-utils_use offensive GMX_COOL_QUOTES)
+ $(cmake-utils_use boost GMX_EXTERNAL_BOOST)
+ $(cmake-utils_use tng GMX_USE_TNG)
+ $(cmake-utils_use doc GMX_BUILD_MANUAL)
+ $(cmake-utils_use make-symlinks GMX_SYMLINK_OLD_BINARY_NAMES)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_SIMD="$acce"
+ -DGMX_LIB_INSTALL_DIR="$(get_libdir)"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DGMX_X86_AVX_GCC_MASKLOAD_BUG=OFF
+ -DGMX_USE_GCC44_BUG_WORKAROUND=OFF
+ -DBUILD_TESTING=OFF
+ -DGMX_BUILD_UNITTESTS=OFF
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local cuda=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && \
+ cuda=( -DGMX_GPU=ON )
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=OFF
+ $(cmake-utils_use threads GMX_THREAD_MPI)
+ "${cuda[@]}"
+ -DGMX_OPENMM=OFF
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ use mpi || continue
+ einfo "Configuring for ${x} precision with mpi"
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_THREAD_MPI=OFF
+ -DGMX_MPI=ON ${cuda}
+ -DGMX_OPENMM=OFF
+ -DGMX_BUILD_MDRUN_ONLY=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -DGMX_BUILD_MANUAL=OFF
+ -DGMX_BINARY_SUFFIX="_mpi${suffix}"
+ -DGMX_LIBS_SUFFIX="_mpi${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" CC="mpicc" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}_mpi/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile
+ # generate bash completion, not 100% necessary for
+ # rel ebuilds as bundled
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile completion
+ # not 100% necessary for rel ebuilds as available from website
+ if use doc; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile manual
+ fi
+ use mpi || continue
+ einfo "Compiling for ${x} precision with mpi"
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
+ cmake-utils_src_compile
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_make check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake-utils_src_install
+ if use doc; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+ #release ebuild does this automatically
+ if [[ $PV = *9999* ]]; then
+ cp "${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash "${ED}/usr/bin" || die
+ echo "complete -o nospace -F _gmx_compl gmx" > "${ED}/usr/bin/gmx-completion-gmx.bash" || die
+ fi
+ use mpi || continue
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
+ cmake-utils_src_install
+ done
+ # drop unneeded stuff
+ rm "${ED}"usr/bin/GMXRC* || die
+ #concatenate all gmx-completion*, starting with gmx-completion.bash (fct defs)
+ #little hacckery as some gmx-completion* newlines ,so cat won't work
+ for x in "${ED}"usr/bin/gmx-completion{,?*}.bash ; do
+ echo $(<${x})
+ done > "${T}"/gmx-bashcomp || die
+ newbashcomp "${T}"/gmx-bashcomp gmx
+ bashcomp_alias gmx mdrun
+ rm "${ED}"usr/bin/gmx-completion{,?*}.bash || die
+ if use double-precision && use single-precision; then
+ bashcomp_alias gmx gmx_d
+ bashcomp_alias gmx mdrun_d
+ fi
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
+ einfo "http://dx.doi.org/10.1021/ct700301q"
+ einfo
+ readme.gentoo_print_elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-5.0.5.ebuild b/sci-chemistry/gromacs/gromacs-5.0.5.ebuild
new file mode 100644
index 000000000000..b5d7896aa556
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-5.0.5.ebuild
@@ -0,0 +1,284 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit bash-completion-r1 cmake-utils cuda eutils multilib readme.gentoo toolchain-funcs
+
+if [[ $PV = *9999* ]]; then
+ EGIT_REPO_URI="git://git.gromacs.org/gromacs.git
+ https://gerrit.gromacs.org/gromacs.git
+ git://github.com/gromacs/gromacs.git
+ http://repo.or.cz/r/gromacs.git"
+ EGIT_BRANCH="release-5-0"
+ inherit git-r3
+ KEYWORDS=""
+else
+ SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${PN}-${PV/_/-}.tar.gz
+ test? ( http://gerrit.gromacs.org/download/regressiontests-${PV}.tar.gz )"
+ KEYWORDS="~alpha ~amd64 ~arm ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+
+# see COPYING for details
+# http://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="X blas boost cuda +doc -double-precision +fftw lapack +make-symlinks mkl mpi +offensive openmp +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ X? (
+ x11-libs/libX11
+ x11-libs/libSM
+ x11-libs/libICE
+ )
+ blas? ( virtual/blas )
+ boost? ( >=dev-libs/boost-1.55 )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
+ fftw? ( sci-libs/fftw:3.0 )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi )
+ "
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ cuda? ( single-precision )
+ mkl? ( !blas !fftw !lapack )"
+
+DOCS=( AUTHORS README )
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ $(gcc-version) == "4.1" ]] && die "gcc 4.1 is not supported by gromacs"
+ use openmp && ! tc-has-openmp && \
+ die "Please switch to an openmp compatible compiler"
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="git://git.gromacs.org/regressiontests.git" \
+ EGIT_BRANCH="master" EGIT_COMMIT="master" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ cmake-utils_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+
+ #go from slowest to fastest acceleration
+ local acce="None"
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl && has_version "=sci-libs/mkl-10*"; then
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="${MKLROOT}/include"
+ -DMKL_LIBRARIES="$(echo /opt/intel/mkl/10.0.5.025/lib/*/libmkl.so);$(echo /opt/intel/mkl/10.0.5.025/lib/*/libiomp*.so)"
+ )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ $(cmake-utils_use X GMX_X11)
+ $(cmake-utils_use blas GMX_EXTERNAL_BLAS)
+ $(cmake-utils_use lapack GMX_EXTERNAL_LAPACK)
+ $(cmake-utils_use openmp GMX_OPENMP)
+ $(cmake-utils_use offensive GMX_COOL_QUOTES)
+ $(cmake-utils_use boost GMX_EXTERNAL_BOOST)
+ $(cmake-utils_use tng GMX_USE_TNG)
+ $(cmake-utils_use doc GMX_BUILD_MANUAL)
+ $(cmake-utils_use make-symlinks GMX_SYMLINK_OLD_BINARY_NAMES)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_SIMD="$acce"
+ -DGMX_LIB_INSTALL_DIR="$(get_libdir)"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DGMX_X86_AVX_GCC_MASKLOAD_BUG=OFF
+ -DGMX_USE_GCC44_BUG_WORKAROUND=OFF
+ -DBUILD_TESTING=OFF
+ -DGMX_BUILD_UNITTESTS=OFF
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local cuda=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && \
+ cuda=( -DGMX_GPU=ON )
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=OFF
+ $(cmake-utils_use threads GMX_THREAD_MPI)
+ "${cuda[@]}"
+ -DGMX_OPENMM=OFF
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ use mpi || continue
+ einfo "Configuring for ${x} precision with mpi"
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_THREAD_MPI=OFF
+ -DGMX_MPI=ON ${cuda}
+ -DGMX_OPENMM=OFF
+ -DGMX_BUILD_MDRUN_ONLY=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -DGMX_BUILD_MANUAL=OFF
+ -DGMX_BINARY_SUFFIX="_mpi${suffix}"
+ -DGMX_LIBS_SUFFIX="_mpi${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" CC="mpicc" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}_mpi/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile
+ # generate bash completion, not 100% necessary for
+ # rel ebuilds as bundled
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile completion
+ # not 100% necessary for rel ebuilds as available from website
+ if use doc; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile manual
+ fi
+ use mpi || continue
+ einfo "Compiling for ${x} precision with mpi"
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
+ cmake-utils_src_compile
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_make check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake-utils_src_install
+ if use doc; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+ #release ebuild does this automatically
+ if [[ $PV = *9999* ]]; then
+ cp "${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash "${ED}/usr/bin" || die
+ echo "complete -o nospace -F _gmx_compl gmx" > "${ED}/usr/bin/gmx-completion-gmx.bash" || die
+ fi
+ use mpi || continue
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
+ cmake-utils_src_install
+ done
+
+ if use tng; then
+ insinto /usr/include/tng
+ doins src/external/tng_io/include/tng/*h
+ fi
+ # drop unneeded stuff
+ rm "${ED}"usr/bin/GMXRC* || die
+ #concatenate all gmx-completion*, starting with gmx-completion.bash (fct defs)
+ #little hacckery as some gmx-completion* newlines ,so cat won't work
+ for x in "${ED}"usr/bin/gmx-completion{,?*}.bash ; do
+ echo $(<${x})
+ done > "${T}"/gmx-bashcomp || die
+ newbashcomp "${T}"/gmx-bashcomp gmx
+ bashcomp_alias gmx mdrun
+ rm "${ED}"usr/bin/gmx-completion{,?*}.bash || die
+ if use double-precision && use single-precision; then
+ bashcomp_alias gmx gmx_d
+ bashcomp_alias gmx mdrun_d
+ fi
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
+ einfo "http://dx.doi.org/10.1021/ct700301q"
+ einfo
+ readme.gentoo_print_elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-5.0.6.ebuild b/sci-chemistry/gromacs/gromacs-5.0.6.ebuild
new file mode 100644
index 000000000000..b5d7896aa556
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-5.0.6.ebuild
@@ -0,0 +1,284 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit bash-completion-r1 cmake-utils cuda eutils multilib readme.gentoo toolchain-funcs
+
+if [[ $PV = *9999* ]]; then
+ EGIT_REPO_URI="git://git.gromacs.org/gromacs.git
+ https://gerrit.gromacs.org/gromacs.git
+ git://github.com/gromacs/gromacs.git
+ http://repo.or.cz/r/gromacs.git"
+ EGIT_BRANCH="release-5-0"
+ inherit git-r3
+ KEYWORDS=""
+else
+ SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${PN}-${PV/_/-}.tar.gz
+ test? ( http://gerrit.gromacs.org/download/regressiontests-${PV}.tar.gz )"
+ KEYWORDS="~alpha ~amd64 ~arm ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+
+# see COPYING for details
+# http://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="X blas boost cuda +doc -double-precision +fftw lapack +make-symlinks mkl mpi +offensive openmp +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ X? (
+ x11-libs/libX11
+ x11-libs/libSM
+ x11-libs/libICE
+ )
+ blas? ( virtual/blas )
+ boost? ( >=dev-libs/boost-1.55 )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
+ fftw? ( sci-libs/fftw:3.0 )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi )
+ "
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ cuda? ( single-precision )
+ mkl? ( !blas !fftw !lapack )"
+
+DOCS=( AUTHORS README )
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ $(gcc-version) == "4.1" ]] && die "gcc 4.1 is not supported by gromacs"
+ use openmp && ! tc-has-openmp && \
+ die "Please switch to an openmp compatible compiler"
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="git://git.gromacs.org/regressiontests.git" \
+ EGIT_BRANCH="master" EGIT_COMMIT="master" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ cmake-utils_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+
+ #go from slowest to fastest acceleration
+ local acce="None"
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl && has_version "=sci-libs/mkl-10*"; then
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="${MKLROOT}/include"
+ -DMKL_LIBRARIES="$(echo /opt/intel/mkl/10.0.5.025/lib/*/libmkl.so);$(echo /opt/intel/mkl/10.0.5.025/lib/*/libiomp*.so)"
+ )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ $(cmake-utils_use X GMX_X11)
+ $(cmake-utils_use blas GMX_EXTERNAL_BLAS)
+ $(cmake-utils_use lapack GMX_EXTERNAL_LAPACK)
+ $(cmake-utils_use openmp GMX_OPENMP)
+ $(cmake-utils_use offensive GMX_COOL_QUOTES)
+ $(cmake-utils_use boost GMX_EXTERNAL_BOOST)
+ $(cmake-utils_use tng GMX_USE_TNG)
+ $(cmake-utils_use doc GMX_BUILD_MANUAL)
+ $(cmake-utils_use make-symlinks GMX_SYMLINK_OLD_BINARY_NAMES)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_SIMD="$acce"
+ -DGMX_LIB_INSTALL_DIR="$(get_libdir)"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DGMX_X86_AVX_GCC_MASKLOAD_BUG=OFF
+ -DGMX_USE_GCC44_BUG_WORKAROUND=OFF
+ -DBUILD_TESTING=OFF
+ -DGMX_BUILD_UNITTESTS=OFF
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local cuda=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && \
+ cuda=( -DGMX_GPU=ON )
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=OFF
+ $(cmake-utils_use threads GMX_THREAD_MPI)
+ "${cuda[@]}"
+ -DGMX_OPENMM=OFF
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ use mpi || continue
+ einfo "Configuring for ${x} precision with mpi"
+ mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_THREAD_MPI=OFF
+ -DGMX_MPI=ON ${cuda}
+ -DGMX_OPENMM=OFF
+ -DGMX_BUILD_MDRUN_ONLY=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -DGMX_BUILD_MANUAL=OFF
+ -DGMX_BINARY_SUFFIX="_mpi${suffix}"
+ -DGMX_LIBS_SUFFIX="_mpi${suffix}"
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" CC="mpicc" cmake-utils_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}_mpi/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile
+ # generate bash completion, not 100% necessary for
+ # rel ebuilds as bundled
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile completion
+ # not 100% necessary for rel ebuilds as available from website
+ if use doc; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_compile manual
+ fi
+ use mpi || continue
+ einfo "Compiling for ${x} precision with mpi"
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
+ cmake-utils_src_compile
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake-utils_src_make check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake-utils_src_install
+ if use doc; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+ #release ebuild does this automatically
+ if [[ $PV = *9999* ]]; then
+ cp "${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash "${ED}/usr/bin" || die
+ echo "complete -o nospace -F _gmx_compl gmx" > "${ED}/usr/bin/gmx-completion-gmx.bash" || die
+ fi
+ use mpi || continue
+ BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
+ cmake-utils_src_install
+ done
+
+ if use tng; then
+ insinto /usr/include/tng
+ doins src/external/tng_io/include/tng/*h
+ fi
+ # drop unneeded stuff
+ rm "${ED}"usr/bin/GMXRC* || die
+ #concatenate all gmx-completion*, starting with gmx-completion.bash (fct defs)
+ #little hacckery as some gmx-completion* newlines ,so cat won't work
+ for x in "${ED}"usr/bin/gmx-completion{,?*}.bash ; do
+ echo $(<${x})
+ done > "${T}"/gmx-bashcomp || die
+ newbashcomp "${T}"/gmx-bashcomp gmx
+ bashcomp_alias gmx mdrun
+ rm "${ED}"usr/bin/gmx-completion{,?*}.bash || die
+ if use double-precision && use single-precision; then
+ bashcomp_alias gmx gmx_d
+ bashcomp_alias gmx mdrun_d
+ fi
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
+ einfo "http://dx.doi.org/10.1021/ct700301q"
+ einfo
+ readme.gentoo_print_elog
+}
diff --git a/sci-chemistry/gromacs/metadata.xml b/sci-chemistry/gromacs/metadata.xml
new file mode 100644
index 000000000000..083289348b0d
--- /dev/null
+++ b/sci-chemistry/gromacs/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-chemistry</herd>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <use>
+ <flag name="cuda">Enable cuda non-bonded kernels</flag>
+ <flag name="double-precision">More precise calculations at the expense of speed</flag>
+ <flag name="single-precision">Single precision version of gromacs (default)</flag>
+ <flag name="boost">Enable external boost library</flag>
+ <flag name="tng">Enable new trajectory format - tng</flag>
+ <flag name="make-symlinks">Create symbolic links for pre-5.0 binary names</flag>
+ <!-- acceleration optimization flags -->
+ <flag name="offensive">Enable gromacs partly offensive quotes</flag>
+ <flag name="mkl">Use <pkg>sci-libs/mkl</pkg> for fft, blas, lapack routines</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/gsim/Manifest b/sci-chemistry/gsim/Manifest
new file mode 100644
index 000000000000..faf3cd3e2c9b
--- /dev/null
+++ b/sci-chemistry/gsim/Manifest
@@ -0,0 +1 @@
+DIST gsim-21.3.tar.gz 4100589 SHA256 d3dd161078862fa990b40ff5df988bb82c8469e17dda8e81eda5f1419742de47 SHA512 0a65ec416a11893fe9f249126ed8e7b9f7991dc8f02d6b62b01962de6dfabda805acdc3d7fc6939b609ff018f16cefff616f37ee906776712209460374bb225d WHIRLPOOL d8dde220a52608b5dc48e494fb1b0bad49f13f770e132641b9671cd544c951cdd03a4578bf983492dfb0b74567e51ef716ecbb828ba40b2a3385d26788b83bea
diff --git a/sci-chemistry/gsim/files/0.20.1-build.conf.patch b/sci-chemistry/gsim/files/0.20.1-build.conf.patch
new file mode 100644
index 000000000000..e0c68d222323
--- /dev/null
+++ b/sci-chemistry/gsim/files/0.20.1-build.conf.patch
@@ -0,0 +1,44 @@
+ gsim.pro | 25 +++++++++++++++----------
+ 1 files changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/gsim.pro b/gsim.pro
+index 7316aee..9278b6a 100755
+--- a/gsim.pro
++++ b/gsim.pro
+@@ -16,21 +16,26 @@
+ #CONFIG+=use_script
+
+ # Change directories locations for libcmatrix, MinUIT and muParser libraries
+-unix:INCLUDEPATH += /home/vjuser/gsim/libcmatrixR3/include \
+- /home/vjuser/gsim/Minuit2/include \
+- /usr/include/muParser
++#unix:INCLUDEPATH += /home/vjuser/gsim/libcmatrixR3/include \
++# /home/vjuser/gsim/Minuit2/include \
++# /usr/include/muParser
+
+-win32:INCLUDEPATH += "C:\gsim\libcmatrixR3\include" "C:\gsim\Minuit2\include" "C:\gsim\muparser\include"
++#win32:INCLUDEPATH += "C:\gsim\libcmatrixR3\include" "C:\gsim\Minuit2\include" "C:\gsim\muparser\include"
+
+-unix:LIBS += -lcmatrix -L/home/vjuser/gsim/libcmatrixR3/lib -lMinuit2 -L/home/vjuser/gsim/Minuit2/lib -L/home/vjuser/gsim/muparser/lib -lmuparser
++#unix:LIBS += -lcmatrix -L/home/vjuser/gsim/libcmatrixR3/lib -lMinuit2 -L/home/vjuser/gsim/Minuit2/lib -L/home/vjuser/gsim/muparser/lib -lmuparser
+
+-win32:LIBS += -lcmatrix -L"C:\gsim\libcmatrixR3\lib" -lMinuit2 -L"C:\gsim\Minuit2\lib" -L"C:\gsim\muparser\lib" -lmuparser
++#win32:LIBS += -lcmatrix -L"C:\gsim\libcmatrixR3\lib" -lMinuit2 -L"C:\gsim\Minuit2\lib" -L"C:\gsim\muparser\lib" -lmuparser
+
+ #Change directories location for libEMF (if used)
+-use_emf {
+- DEFINES+=USE_EMF_OUTPUT
+- unix:LIBS +=-lEMF -L/usr/include/libEmf
+- win32:LIBS +=-lgdi32
++#use_emf {
++# DEFINES+=USE_EMF_OUTPUT
++# unix:LIBS +=-lEMF -L/usr/include/libEmf
++# win32:LIBS +=-lgdi32
++#}
++
++GSIM_ROOT = .
++!include( $$GSIM_ROOT/build.conf ) {
++ message( "You need a build.conf file with local settings!" )
+ }
+
+ #################################################################################################
diff --git a/sci-chemistry/gsim/files/gsim-21.0-build.conf.patch b/sci-chemistry/gsim/files/gsim-21.0-build.conf.patch
new file mode 100644
index 000000000000..cbd529a49ac4
--- /dev/null
+++ b/sci-chemistry/gsim/files/gsim-21.0-build.conf.patch
@@ -0,0 +1,42 @@
+ gsim.pro | 23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/gsim.pro b/gsim.pro
+index f06e5d2..6e28178 100755
+--- a/gsim.pro
++++ b/gsim.pro
+@@ -16,20 +16,25 @@
+ #CONFIG+=use_script
+
+ # Change directories locations for libcmatrix, MinUIT and muParser libraries
+-unix:INCLUDEPATH += /home/dch1vz/libcmatrixR3/include \
+- /home/dch1vz/Minuit2/include \
++#unix:INCLUDEPATH += /home/dch1vz/libcmatrixR3/include \
++# /home/dch1vz/Minuit2/include \
+
+-win32:INCLUDEPATH += "C:\gsim\libcmatrixR3\include" "C:\gsim\Minuit2\include" "C:\gsim\muparser\include"
++#win32:INCLUDEPATH += "C:\gsim\libcmatrixR3\include" "C:\gsim\Minuit2\include" "C:\gsim\muparser\include"
+
+-unix:LIBS += -lcmatrix -L/home/dch1vz/libcmatrixR3/lib -lMinuit2Base -L/home/dch1vz/Minuit2/lib -lmuparser
++#unix:LIBS += -lcmatrix -L/home/dch1vz/libcmatrixR3/lib -lMinuit2Base -L/home/dch1vz/Minuit2/lib -lmuparser
+
+-win32:LIBS += -lcmatrix -L"C:\gsim\libcmatrixR3\lib" -lMinuit2 -L"C:\gsim\Minuit2\lib" -L"C:\gsim\muparser\lib" -lmuparser
++#win32:LIBS += -lcmatrix -L"C:\gsim\libcmatrixR3\lib" -lMinuit2 -L"C:\gsim\Minuit2\lib" -L"C:\gsim\muparser\lib" -lmuparser
+
+ #Change directories location for libEMF (if used)
+-use_emf {
+- DEFINES+=USE_EMF_OUTPUT
+- unix:LIBS +=-lEMF -L/usr/include/libEmf
+- win32:LIBS +=-lgdi32
++#use_emf {
++# DEFINES+=USE_EMF_OUTPUT
++# unix:LIBS +=-lEMF -L/usr/include/libEmf
++# win32:LIBS +=-lgdi32
++#}
++
++GSIM_ROOT = .
++!include( $$GSIM_ROOT/build.conf ) {
++ message( "You need a build.conf file with local settings!" )
+ }
+
+ #################################################################################################
diff --git a/sci-chemistry/gsim/files/gsim-21.3-build.conf.patch b/sci-chemistry/gsim/files/gsim-21.3-build.conf.patch
new file mode 100644
index 000000000000..da7d7b7b4457
--- /dev/null
+++ b/sci-chemistry/gsim/files/gsim-21.3-build.conf.patch
@@ -0,0 +1,49 @@
+ gsim.pro | 23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/gsim.pro b/gsim.pro
+index f88dc8a..579a91c 100755
+--- a/gsim.pro
++++ b/gsim.pro
+@@ -10,27 +10,32 @@
+
+ #Uncomment next line if you want to use EMF output
+ #EMF output requires libEMF or Wine on X11 systems and MAC(?)
+-CONFIG+=use_emf
++#CONFIG+=use_emf
+
+ #DO NOT UNCOMMENT NEXT LINE. The scripting possibilty won't work at the moment
+ #CONFIG+=use_script
+
+ # Change directories locations for libcmatrix, MinUIT and muParser libraries
+-unix:INCLUDEPATH += /home/dch0ph/libcmatrixR3nosse/include \
+- /home/dch1vz/Minuit2/include \
+- /home/dch1vz/muparser/include
++#unix:INCLUDEPATH += /home/dch0ph/libcmatrixR3nosse/include \
++# /home/dch1vz/Minuit2/include \
++# /home/dch1vz/muparser/include
+
+ win32:INCLUDEPATH += "C:\gsim\libcmatrixR3_qt4\include" "C:\gsim\Minuit2_qt4\include" "C:\gsim\muparser_qt4\include"
+
+-unix:LIBS += -lcmatrix -L/home/dch0ph/libcmatrixR3nosse/lib -lMinuit2Base -L/home/dch1vz/Minuit2/lib -L/home/dch1vz/muparser/lib -lmuparser
++#unix:LIBS += -lcmatrix -L/home/dch0ph/libcmatrixR3nosse/lib -lMinuit2Base -L/home/dch1vz/Minuit2/lib -L/home/dch1vz/muparser/lib -lmuparser
+
+ win32:LIBS += -lcmatrix -L"C:\gsim\libcmatrixR3_qt4\lib" -lMinuit2 -L"C:\gsim\Minuit2_qt4\lib" -L"C:\gsim\muparser_qt4\lib" -lmuparser
+
+ #Change directories location for libEMF (if used)
+-use_emf {
+- DEFINES+=USE_EMF_OUTPUT
+- unix:LIBS +=-lEMF -L/usr/include/libEmf
+- win32:LIBS +=-lgdi32
++#use_emf {
++# DEFINES+=USE_EMF_OUTPUT
++# unix:LIBS +=-lEMF -L/usr/include/libEmf
++# win32:LIBS +=-lgdi32
++#}
++
++GSIM_ROOT = .
++!include( $$GSIM_ROOT/build.conf ) {
++ message( "You need a build.conf file with local settings!" )
+ }
+
+ #################################################################################################
diff --git a/sci-chemistry/gsim/gsim-21.3.ebuild b/sci-chemistry/gsim/gsim-21.3.ebuild
new file mode 100644
index 000000000000..02d476379b72
--- /dev/null
+++ b/sci-chemistry/gsim/gsim-21.3.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils qt4-r2 toolchain-funcs
+
+DESCRIPTION="Programm for visualisation and processing of experimental and simulated NMR spectra"
+HOMEPAGE="http://sourceforge.net/projects/gsim/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="emf opengl"
+
+RDEPEND="
+ dev-cpp/muParser
+ media-libs/freetype
+ sci-libs/libcmatrix
+ sci-libs/minuit
+ virtual/blas
+ dev-qt/qtsvg:4
+ emf? ( media-libs/libemf )
+ opengl? ( dev-qt/qtopengl:4 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${P}-build.conf.patch )
+DOCS="release.txt README_GSIM.* quickstart.* changes.log programming.*"
+
+src_prepare() {
+ edos2unix ${PN}.pro
+
+ qt4-r2_src_prepare
+
+ cat >> build.conf <<- EOF
+ INCLUDEPATH += "${EPREFIX}/usr/include/libcmatrixR3/" \
+ "${EPREFIX}/usr/include/Minuit2" \
+ "${EPREFIX}/usr/include"
+ LIBS += -lcmatrix -lMinuit2 -lmuparser $($(tc-getPKG_CONFIG) --libs cblas)
+ EOF
+
+ use opengl && echo "CONFIG+=use_opengl" >> build.conf
+
+ if use emf; then
+ cat >> build.conf <<- EOF
+ CONFIG+=use_emf
+ DEFINES+=USE_EMF_OUTPUT
+ LIBS += -L\"${EPREFIX}/usr/include/libEMF\" -lEMF
+ EOF
+ fi
+ sed \
+ -e "s:quickstart.pdf:../share/doc/${PF}/quickstart.pdf:g" \
+ -e "s:README_GSIM.pdf:../share/doc/${PF}/README_GSIM.pdf:g" \
+ -i mainform.h || die
+}
+
+src_install() {
+ qt4-r2_src_install
+ dobin ${PN}
+ insinto /usr/share/${PN}
+ doins -r images ${PN}.ico
+ insinto /usr/share/${PN}/ui
+ doins *.ui
+}
diff --git a/sci-chemistry/gsim/metadata.xml b/sci-chemistry/gsim/metadata.xml
new file mode 100644
index 000000000000..9ebe36a07183
--- /dev/null
+++ b/sci-chemistry/gsim/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="emf">Support for .emf export</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">gsim</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/gtk-gamess/Manifest b/sci-chemistry/gtk-gamess/Manifest
new file mode 100644
index 000000000000..01eb84c1022f
--- /dev/null
+++ b/sci-chemistry/gtk-gamess/Manifest
@@ -0,0 +1 @@
+DIST gtk-gamess-2.00.tar.gz 174125 SHA256 f282cdb94ddccba196b2ea0964cc2c26e3a4db5c8ac3b9f51d72a5a0e45f9e0e SHA512 1eb5e4d23f2c1061b46211db4757530cf8223e93f548940f671f5f55b4cab7c183e629254b9b65ef1d5b3147c44f613489d7447e6658c235f3dc9fcd9e998636 WHIRLPOOL 6fe37b9490dccd42bfa67ddf625a55c0e5a5a229a27b05736980b2134803ea07c1ffe03e504cb2fedaaf9c7ca53b2924e87836c356945ca91f25c6e7842e04bd
diff --git a/sci-chemistry/gtk-gamess/gtk-gamess-2.00.ebuild b/sci-chemistry/gtk-gamess/gtk-gamess-2.00.ebuild
new file mode 100644
index 000000000000..2003819a2b56
--- /dev/null
+++ b/sci-chemistry/gtk-gamess/gtk-gamess-2.00.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GUI for GAMESS, a General Atomic and Molecular Electronic Structure System"
+HOMEPAGE="http://sourceforge.net/projects/gtk-gamess/"
+
+SRC_URI="mirror://sourceforge/gtk-gamess/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+
+KEYWORDS="~amd64 ~ppc ~x86"
+
+IUSE=""
+
+RDEPEND="
+ gnome-base/libglade:2.0
+ x11-libs/gtk+:2
+ dev-libs/libxml2:2
+ sci-chemistry/gamess"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README
+}
diff --git a/sci-chemistry/gtk-gamess/metadata.xml b/sci-chemistry/gtk-gamess/metadata.xml
new file mode 100644
index 000000000000..0ddae2afddfa
--- /dev/null
+++ b/sci-chemistry/gtk-gamess/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-chemistry</herd>
+ <maintainer>
+ <email>je_fro@gentoo.org</email>
+ <name>Jeff Gardner</name>
+ </maintainer>
+ <longdescription lang="en">
+GTK-Gamess is a frontend to GAMESS that allows users to queue up GAMESS
+calculations and run them sequentially.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">gtk-gamess</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/hollow/Manifest b/sci-chemistry/hollow/Manifest
new file mode 100644
index 000000000000..70844b442e80
--- /dev/null
+++ b/sci-chemistry/hollow/Manifest
@@ -0,0 +1 @@
+DIST hollow-1.2.zip 62554 SHA256 9a2d97ad95fc102c1fd537e4fba3c1041ca0ba28d7d2dc0ddc8968b9d1b8722e SHA512 e253680cc0fae286ec697b2dac822b9e165d509cc7eefb27bbcafae6ab2617c3edc8cd9c8beefcc9ef2eb920c9d839fd0bc25f79d22160d857b1705cefbc05ca WHIRLPOOL 83d5d811defe43f91b3516dec873793d9aa6a6a93b2850289c1dd560d53b48a900c8064a16a33692edadb74d1c95b453c2c6fb3ff589a364b7393342e55f6587
diff --git a/sci-chemistry/hollow/hollow-1.2-r1.ebuild b/sci-chemistry/hollow/hollow-1.2-r1.ebuild
new file mode 100644
index 000000000000..f98bc7158495
--- /dev/null
+++ b/sci-chemistry/hollow/hollow-1.2-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1
+
+DESCRIPTION="Production of surface images of proteins"
+HOMEPAGE="http://hollow.sourceforge.net/"
+#SRC_URI="mirror://sourceforge/${P}.zip"
+SRC_URI="http://hollow.sourceforge.net/${P}.zip"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="GPL-3"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND="${PYTHON_DEPS}
+ app-arch/unzip"
+
+src_install() {
+ python_setup
+ esvn_clean
+ python_foreach_impl python_domodule pdbstruct
+ python_moduleinto ${PN}
+ python_foreach_impl python_domodule *.py hollow.txt
+
+ python_foreach_impl python_newscript ${PN}.py ${PN}
+
+ dodoc README
+ python_optimize
+}
diff --git a/sci-chemistry/hollow/metadata.xml b/sci-chemistry/hollow/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/hollow/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/icm-browser/Manifest b/sci-chemistry/icm-browser/Manifest
new file mode 100644
index 000000000000..6a993f2d9017
--- /dev/null
+++ b/sci-chemistry/icm-browser/Manifest
@@ -0,0 +1 @@
+DIST icm-browser-3.6-1i.i386.rpm 81669297 SHA256 6be8fdea54b5c744d6f8d164caead7dc49325428e07de6be458d655d8de5aef5
diff --git a/sci-chemistry/icm-browser/files/90icm-browser b/sci-chemistry/icm-browser/files/90icm-browser
new file mode 100644
index 000000000000..554bb8a030c0
--- /dev/null
+++ b/sci-chemistry/icm-browser/files/90icm-browser
@@ -0,0 +1 @@
+MOLBROWSERPROHOME=/opt/icm-browser
diff --git a/sci-chemistry/icm-browser/files/icm-browser.xpm b/sci-chemistry/icm-browser/files/icm-browser.xpm
new file mode 100644
index 000000000000..f975898bdc6a
--- /dev/null
+++ b/sci-chemistry/icm-browser/files/icm-browser.xpm
@@ -0,0 +1,326 @@
+/* XPM */
+static char *icm_browser[] = {
+/* columns rows colors chars-per-pixel */
+"63 64 256 2 ",
+" c #7C0E13",
+". c #6C171B",
+"X c #5F3B3A",
+"o c #663436",
+"O c #5C554F",
+"+ c #6E756A",
+"@ c #90090F",
+"# c #B70003",
+"$ c #AD0C11",
+"% c #8A2B2D",
+"& c #A02C2E",
+"* c #C90104",
+"= c #DD050B",
+"- c #E30309",
+"; c #F2181A",
+": c #E71014",
+"> c #85605A",
+", c #837468",
+"< c #976263",
+"1 c #6D837A",
+"2 c #003EA9",
+"3 c #053CB8",
+"4 c #002EB9",
+"5 c #0044AC",
+"6 c #024BAC",
+"7 c #0045A6",
+"8 c #0D4DB4",
+"9 c #0745B6",
+"0 c #134EB9",
+"q c #1B54BB",
+"w c #1754B7",
+"e c #0E52B0",
+"r c #2057BE",
+"t c #59569B",
+"y c #534D99",
+"u c #556D9C",
+"i c #635EA0",
+"p c #4574B4",
+"a c #4978BA",
+"s c #4C6EAB",
+"d c #6C69A6",
+"f c #7878AE",
+"g c #1010DB",
+"h c #241FDC",
+"j c #1738C7",
+"k c #1027CD",
+"l c #292ADC",
+"z c #3031DC",
+"x c #241BE0",
+"c c #332AE1",
+"v c #423BE1",
+"b c #1849C2",
+"n c #1C50C0",
+"m c #2A4ACB",
+"M c #2558C1",
+"N c #2B5AC5",
+"B c #2C55C9",
+"V c #2756C5",
+"C c #355DCB",
+"Z c #355ECA",
+"A c #3947D7",
+"S c #3B5CD3",
+"D c #3E4ECC",
+"F c #3C61CD",
+"G c #3A65C7",
+"H c #3F62D0",
+"J c #465BCC",
+"K c #4652D5",
+"L c #4B77CB",
+"P c #547ACA",
+"I c #4564D4",
+"U c #4C64DA",
+"Y c #4C67D6",
+"T c #536BDC",
+"R c #5469DA",
+"E c #4E65C9",
+"W c #666CC7",
+"Q c #6C76D1",
+"! c #514DE5",
+"~ c #5B59E6",
+"^ c #4C4DE3",
+"/ c #625EEB",
+"( c #5C6DE2",
+") c #5766E3",
+"_ c #5E71E1",
+"` c #6469E7",
+"' c #6472E5",
+"] c #6C74EC",
+"[ c #6975E6",
+"{ c #7275EC",
+"} c #757CEB",
+"| c #726AF3",
+" . c #7B7AF3",
+".. c #7676F3",
+"X. c #6F67F2",
+"o. c #817FB9",
+"O. c #837DE9",
+"+. c #827EF6",
+"@. c #897FF8",
+"#. c #5B9986",
+"$. c #6E9987",
+"%. c #65AC9D",
+"&. c #5581BE",
+"*. c #5998A9",
+"=. c #6B87B2",
+"-. c #5CA9B6",
+";. c #67B1BF",
+":. c #76CCB9",
+">. c #6FD8B8",
+",. c #77D7B9",
+"<. c #70C3AC",
+"1. c #7BE4BD",
+"2. c #5787C6",
+"3. c #5A96C5",
+"4. c #4F89C4",
+"5. c #6589C1",
+"6. c #7397C8",
+"7. c #688BD4",
+"8. c #7589D8",
+"9. c #7094CD",
+"0. c #6EBCC8",
+"q. c #73BDC2",
+"w. c #64AAC2",
+"e. c #7785E6",
+"r. c #78D7C2",
+"t. c #74CCC3",
+"y. c #7DE8C1",
+"u. c #9E9E9E",
+"i. c #9C9E95",
+"p. c #8E918C",
+"a. c #A39C9B",
+"s. c #8CB89F",
+"d. c #A6A69F",
+"f. c #9D9DA4",
+"g. c #898AB1",
+"h. c #88A9B0",
+"j. c #94AAB0",
+"k. c #A3A3A3",
+"l. c #AAAAA5",
+"z. c #ABABAB",
+"x. c #A4A4AB",
+"c. c #B3ACA8",
+"v. c #B3B1AC",
+"b. c #A1A7B8",
+"n. c #ACB4B5",
+"m. c #B3B3B3",
+"M. c #BCBBB6",
+"N. c #BBBBBB",
+"B. c #B8B9B6",
+"V. c #C1BDBB",
+"C. c #89CCB9",
+"Z. c #B4C2B8",
+"A. c #AEC9B4",
+"S. c #82ECB4",
+"D. c #81E7B9",
+"F. c #88F4B4",
+"G. c #C4C3BC",
+"H. c #CAC9BF",
+"J. c #D2CFBF",
+"K. c #8987C8",
+"L. c #9798CB",
+"P. c #8986DA",
+"I. c #899CD6",
+"U. c #9A9ED1",
+"Y. c #8B95D1",
+"T. c #8AA2C6",
+"R. c #92ACD1",
+"E. c #A7A7C8",
+"W. c #BBBCC2",
+"Q. c #A6A7DB",
+"!. c #AAB4D5",
+"~. c #B0B7CE",
+"^. c #8A87E9",
+"/. c #8C94E9",
+"(. c #9998E7",
+"). c #8481F6",
+"_. c #8A85F8",
+"`. c #928DF8",
+"'. c #9A95F9",
+"]. c #9A96F6",
+"[. c #A39FF5",
+"{. c #A19CF9",
+"}. c #B1AFED",
+"|. c #A6B6EA",
+" X c #B6B6E6",
+".X c #ADAAF9",
+"XX c #A8A5F6",
+"oX c #B2ADF6",
+"OX c #B5B2FA",
+"+X c #BCBAF9",
+"@X c #B9B6F7",
+"#X c #A7A8E7",
+"$X c #93A9E1",
+"%X c #C3BDC3",
+"&X c #C0BCEC",
+"*X c #C0BEF6",
+"=X c #BAC3C8",
+"-X c #BDC5D3",
+";X c #B7C2D1",
+":X c #A7DAD8",
+">X c #9AEAD1",
+",X c #B3DCEC",
+"<X c #C3C3C3",
+"1X c #C4C4CA",
+"2X c #CBCBCB",
+"3X c #C8C8C5",
+"4X c #D1CECA",
+"5X c #D2D1CE",
+"6X c #D5D3CA",
+"7X c #C8CAD4",
+"8X c #CED2D7",
+"9X c #D3D3D3",
+"0X c #D9D7D4",
+"qX c #DBDAD5",
+"wX c #D4D4DA",
+"eX c #DBDBDB",
+"rX c #D4D8DD",
+"tX c #E1DFDA",
+"yX c #E0DCD6",
+"uX c #E5E3DD",
+"iX c #C6C8E2",
+"pX c #D4D4E4",
+"aX c #DEDEE3",
+"sX c #D9D8EB",
+"dX c #C4C2F4",
+"fX c #CCCAF4",
+"gX c #C5C3FA",
+"hX c #CCCBF9",
+"jX c #CBC7F5",
+"kX c #D1CFF8",
+"lX c #D5D4F4",
+"zX c #DDDCF7",
+"xX c #D4D2FB",
+"cX c #DBDAF9",
+"vX c #D6D8F9",
+"bX c #C5DDE9",
+"nX c #E1DEF9",
+"mX c #C3F9E4",
+"MX c #DAF2F3",
+"NX c #E3E4E3",
+"BX c #EBEAE5",
+"VX c #E3E2EE",
+"CX c #EBEBEB",
+"ZX c #E7E9E1",
+"AX c #F7F6EE",
+"SX c #E3E3F2",
+"DX c #E4E4FA",
+"FX c #ECECFA",
+"GX c #EBEBF2",
+"HX c #EDF4FA",
+"JX c #F4F4F2",
+"KX c #FDFCF5",
+"LX c #FEFEFE",
+"PX c #F5F7FB",
+"IX c #F3EFF2",
+"UX c None",
+/* pixels */
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.k.u.u.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.k.k.u.k.k.k.k.k.k.u.k.k.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.k.k.k.k.x.l.x.x.l.x.k.l.k.k.k.u.k.u.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.x.l.k.l.z.z.z.z.z.z.z.z.z.z.l.z.l.x.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.x.l.l.z.z.z.n.z.z.m.m.m.m.n.m.z.n.z.z.c.v.l.k.k.k.u.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.l.z.z.z.z.z.m.m.m.m.m.m.m.m.m.m.m.m.m.v.x.x.l.z.z.z.l.k.k.a.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.x.l.z.z.z.m.m.m.B.B.B.B.B.N.N.m.B.B.B.B.B.n.j.=.d g.f.z.l.x.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXk.k.k.l.z.z.z.m.m.m.B.N.N.N.N.N.N.N.%XN.N.N.N.N.V.B.q.*.t i d g.f.z.z.x.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXk.k.k.x.z.z.n.B.m.B.B.N.N.N.G.W.<X<X<X<X=X<X<X%X<XV.=XC.%.s t y d b.m.z.z.k.k.k.u.UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXk.k.x.l.z.v.m.m.B.N.N.N.<X<X<X<X<X<X<X3X3X3X3X3X<X<X3X<XC.*.u t i L.-XN.c.z.z.l.k.k.u.UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXk.k.k.z.z.n.m.m.B.N.N.%XW.<X<X3X1X2X2X3X2X2X4X2X2X3X5X5X<Xj.u t f E.sXpXN.n.n.z.z.l.k.k.u.UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXk.k.x.z.z.z.B.B.N.N.%X<X<X3X1X3X2X2X2X8X2X2X8X5X8X0X0X4X%Xb.f d K. XDXDXsXW.B.m.m.z.z.z.k.k.u.UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXu.k.x.l.z.m.m.B.B.V.Z.<X<X1X1X4X7X5X5X9X8X0XqXeXqX0X9X3XW.L.f K.#XdXcXDXnXpX<XB.B.m.m.z.z.k.k.u.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXu.k.k.l.z.m.m.B.N.N.=XG.1X3X2X4X4X5X0X0XqXeXtXtXyX0X1XE.L.L.P.(.}.gXxXxXcXzXpX3XN.N.B.m.m.z.z.x.k.u.u.UXUXUXUXUXUX",
+"UXUXUXUXUXUXk.k.x.l.z.m.B.N.N.W.<X3X2X2X2X9X0XqXqXtXuXuX0X1XE.L.Y.P.P.^.XXOXOX*XjXkXcXzXsX1X%XN.N.B.B.z.z.l.k.k.u.UXUXUXUXUXUX",
+"UXUXUXUXUXu.k.k.z.z.m.m.N.N.W.<X1X2X2X5X8X0XtXuXuX0X1X!.L.K.Q [ ..).`.'.XX.XOX@XdXhXvXcXsX2XG.=XW.N.B.m.z.z.l.k.k.u.UXUXUXUXUX",
+"UXUXUXUXUXk.k.l.z.m.B.B.N.W.1X3X2X2X5XqXuXuX8X7X!.U.8.W R ( ` .. .).`.'.[.XX.X@X+XjXxXcXsX5X3X<XW.N.N.B.B.z.z.x.k.u.UXUXUXUXUX",
+"UXUXUXUXu.k.l.z.z.m.N.N.=X<X<X3X2X0XyX0X-X~.I.P E I I U ) ( ] .. .)._.].].XX.X@X+XgXkXlXpX5X2X1X<XN.N.B.m.z.z.x.k.u.u.UXUXUXUX",
+"UXUXUXUXu.x.z.z.v.m.N.N.G.<X3X4X5X0X-XT.P G N Z B C I T _ ' [ { .+._.`.].[.XX.X@XgXfXpXwX5X2X2X<X<XW.B.B.m.n.l.k.k.u.UXUXUXUX",
+"UXUXUXu.k.x.z.z.m.B.N.N.<X1X4X5X5XT.a q e 8 n B Z F I Y T _ ] { .. .+._.`.].[..X@XfXpXeX0X9X2X2X3X3X<XN.N.m.m.z.l.k.u.u.UXUXUX",
+"UXUXUXu.k.l.z.m.m.B.W.%X3X3X5XyX=XP 5 2 8 w M N C F I Y T ( ( ` ] .. .+.`.]..X&XlXaXuXeXeX0X9X4X2X3X<XW.N.B.m.z.l.k.k.u.UXUXUX",
+"UXUXUXk.x.z.z.B.B.N.%X<X1X2X9XyX-Xa 5 5 0 w q N C Z I I U ) ) ( ` .`.XX@XfXlXVXCXBXNXuXeXeX9X4X7X1X<X<XN.B.m.z.z.x.k.u.UXUXUX",
+"UXUXu.k.l.z.z.m.B.N.<X<X2X4X0XtX-X&.6 5 8 0 q M N C S S U _ e./.XX+XxXDXPXKXKXJXCXCXNXNXaXeXwX9X4X2X3X<XN.N.m.m.z.l.k.u.u.UXUX",
+"UXUXk.k.x.z.m.m.N.V.<X3X2X2X0XtX8X5.6 5 8 8 q r V m Z L 7.|.vXHXLXLXLXLXLXLXKXJXJXCXCXNXNXeXrX0X5X2X1X<XN.N.B.n.z.z.x.u.u.UXUX",
+"UXUXu.k.z.z.m.m.N.W.<X2X2X5X0XtX8X3.5 5 e e 0 q m G 4.q.:XmXHXLXLXLXLXLXLXLXPXJXJXCXCXNXNXaXeX0X9X5X2X<X<XN.B.m.z.z.k.k.u.UXUX",
+"UXUXk.k.z.z.m.m.N.<X<X1X5X8XeXuXwX5.6 7 6 9 j D L w.t.y.D.s.a.c.8XPXLXLXLXLXLXLXJXJXCXBXNXtXeXeX9X2X2X1X%XN.B.m.m.z.x.k.u.UXUX",
+"UXu.k.x.z.m.m.B.N.<X<X2X2X9XqXuXrX6.6 2 3 j G 3.:.D.D.<.+ % % o > a.aXLXLXLXLXLXLXJXCXBXNXNXeXrX9X5X4X3X<XN.N.m.m.z.l.k.u.u.UX",
+"UXu.k.l.l.n.m.N.N.<X3X2X9X9XqXuXeX6.6 4 m R q.D.D.y.,., $ # * # @ o p.:X,XgXnXLXLXKXAXIXNXNXtXwX9X5X7X3X<X%XN.B.m.z.l.k.u.u.UX",
+"UXu.k.x.l.m.m.B.N.<X1X2X5X9XeXNXZX6.k k R :.F.S.1.y.p.& * - : = # . O %.0./.^.].*XSXAXAXCXNXaXeXwX5X5X1X<XV.N.m.m.z.z.k.u.u.UX",
+"UXu.k.l.z.m.m.N.N.<X3X2X5X9XeXuXZX X~ c I q.1.S.y.,.+ $ - ; ; : * @ X #.>.t.4.A ^ } }.aXCXZXaXeXwX5X2X2X3X=XN.m.m.z.l.x.u.u.UX",
+"UXk.k.k.z.m.m.B.N.<X1X4X5X8XrXtXZXNX X^.' 5.:.>.1.>., $ - ; ; : = @ X #.1.1.:.3.A c v } iXZXuXeX0X9X4X1X<XW.N.B.m.z.l.k.u.u.UX",
+"UXk.a.l.z.z.m.B.N.<X3X2X9X0XeXeXNXBXCXVXfX|.$XR.r.r.1 % # = : = $ O %.1.1.F.F.3.l g v (.aXNXyX0X8X2X2X<XW.N.B.z.z.l.k.u.u.UX",
+"UXu.k.x.z.n.m.N.N.<X1X2X4X8XwXeXtXZXIXKXKXHXzXvXbXmXC.> @ # # # @ o 1 ,.1.1.F.S.2.l x ~ }.NXuXeXwX5X2X3X<XN.N.B.m.z.l.k.u.u.UX",
+"UXu.k.x.z.m.m.B.N.<X3X2X2X8X0XeXaXNXNXCXJXKXLXLXPXPXMX3X< % . X + <.1.D.D.,.3.A l ` @XSXBXtX0X8X5X2X3X<XW.N.B.m.z.z.k.u.u.UX",
+"UXu.k.x.z.z.m.B.N.<X<X2X5X5X0XeXaXNXCXCXIXKXKXLXLXLXLXLXBXc.i.1 #.<.1.y.,.;.P A ! O.dXFXIXaXeXwX9X5X5X1X<XN.B.m.m.l.x.x.u.u.UX",
+"UXUXk.k.z.z.m.B.N.W.<X3X4X8X9XeXtXNXNXCXCXJXJXLXLXLXLXLXLXLXPXMXmX>Xt.w.2.U ! X.[.zXHXIXVXaXeX0X9X2X2X3X%XN.B.m.m.z.k.k.u.UXUX",
+"UXUXk.k.l.z.m.m.N.N.<X3X4X8X8XeXaXuXNXNXCXIXJXPXLXPXLXLXLXLXLXLXDX|.7.K ! X.`.@XvXFXFXDXSXaXeX0X8X2X3X<X<XN.m.m.z.z.k.u.u.UXUX",
+"UXUXu.k.l.z.z.m.N.N.<X3X2X2X9XwXeXaXNXNXBXGXJXIXKXLXLXLXLXPXzXoX^./ / X.@.{.@XjXkXlXzXSXVXeX0X8X5X2X3X<XN.N.B.m.z.l.k.k.u.UXUX",
+"UXUXu.k.x.z.m.m.B.N.=X<X3X3X9X0XqXaXNXNXBXCXJXKXKXLXLXHXkX(.{ ` ) / | _.{.XXoX@XgXvXzXDXVXaX9X9X4X1X1X<XN.N.m.m.z.z.k.u.u.UXUX",
+"UXUXUXk.k.l.z.m.B.B.W.<X3X1X2X8XwXeXtXNXCXCXAXAXHXsX|./.[ ) ^ ) ] .)._.`.{.XXOXdXkXcXDXSXeX8X5X5X1X<XV.N.N.m.m.z.x.k.u.UXUXUX",
+"UXUXUXk.k.l.z.z.m.B.N.<X3X3X3X8X8XqXuXBXBXNXiX!.$X8.R S K U _ ' ] .. .)._.'.{.OX+XhXvXnXaXwX5X2X3X<X<XW.N.m.m.z.l.k.u.u.UXUXUX",
+"UXUXUXu.k.x.z.z.m.B.N.W.<X<X2X4X0XqXqX-XR.9.2.H B B C H U T _ ' ] } . .).'.[..X@XgXxXsXrX9X2X2X1X<X%XN.B.n.z.z.l.k.u.u.UXUXUX",
+"UXUXUXUXu.k.z.z.z.m.B.N.W.<X3X2X2X;XT.a r 0 0 r n N S I Y T ( _ ' ] . .@.`.'.{.OXdXpXrX0X5X7X3X<X<XN.B.m.m.z.l.x.k.u.UXUXUXUX",
+"UXUXUXUXu.k.k.l.z.m.B.N.N.V.3X4XW.5.e 5 9 9 0 M N C F H Y R T _ ' ] ] .. ._.].oXdX8XwX9X5X2X3X<XG.N.N.B.m.z.z.l.k.u.u.UXUXUXUX",
+"UXUXUXUXUXk.k.x.z.m.m.B.N.N.3X4X~.p 2 5 e w q M N C C H I U U ) ) ' ] ..).'.}.iX8X0X9X5X5X1X<X<X=XB.N.B.m.z.z.x.k.u.UXUXUXUXUX",
+"UXUXUXUXUXu.k.k.l.z.z.m.N.N.<X4Xb.p 5 5 8 0 w M M N C C S I ) ) ( e./.#X XiX8X0X0X9X2X4X3X3X<XG.N.B.m.m.z.z.k.k.u.u.UXUXUXUXUX",
+"UXUXUXUXUXUXu.k.x.z.z.m.B.B.Z.<Xn.p 5 7 8 8 w q M V N C S T 8.I.#X XiX8XtXyXqX9X9X4X2X1X<X<X=XN.B.B.m.z.z.l.k.u.u.UXUXUXUXUXUX",
+"UXUXUXUXUXUXUXk.k.k.z.z.m.m.N.G.b.p 6 5 6 8 e q n b m Y 8.!.;X8XqXqXqXqX0X9X9X2X4X1X3X<X<X%XN.N.B.m.z.z.l.x.k.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXu.k.k.z.z.n.m.M.V.n.p 6 5 6 e 8 j m J Q U.1XqXqX0XqXqX5X5X5X2X4X2X1X3X<X<XN.W.B.m.m.z.z.z.k.k.u.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXu.k.k.l.z.z.m.V.b.s 5 7 6 3 j D Q U.=X6X5X9X5X9X4X2X5X2X1X3X<X<X<X<XN.N.N.B.m.m.m.z.z.x.k.u.u.UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXu.k.k.z.c.v.v.j.p 6 3 4 j E L.%X2XJ.4X2X3X3X3X3X3X1X3X1X3X<X<X<XW.N.N.B.B.m.n.z.l.k.k.u.u.UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXu.k.x.l.z.m.x.p 3 4 k S j.H.J.G.<X<X<X<X<X<X1X<X<X<X%X<XN.N.N.N.B.B.m.m.z.z.z.x.k.k.u.UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXu.a.k.l.v.f.E k g l 5.A.G.V.Z.V.%X<XW.<XW.=XG.<XZ.N.W.N.N.B.B.B.z.m.z.z.l.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXa.k.d.l.k.f K h l 5.A.M.N.N.N.N.N.N.N.N.B.N.N.N.B.B.B.m.B.m.z.z.z.l.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.c.k.g.W E g.n.B.m.m.m.m.B.B.B.m.B.B.B.m.m.m.m.m.n.z.z.z.l.x.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.l.l.l.l.z.z.z.z.n.m.m.B.m.m.m.m.m.m.z.z.z.m.z.z.l.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.d.l.c.l.l.l.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.x.k.k.k.k.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.k.k.k.l.x.x.l.l.z.l.z.z.l.x.l.k.x.d.k.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.k.k.k.k.k.x.k.k.x.x.d.x.k.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXk.k.u.u.k.k.u.u.k.u.u.k.u.u.k.k.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.u.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX"
+};
diff --git a/sci-chemistry/icm-browser/icm-browser-3.6.1i.ebuild b/sci-chemistry/icm-browser/icm-browser-3.6.1i.ebuild
new file mode 100644
index 000000000000..e16e92495fea
--- /dev/null
+++ b/sci-chemistry/icm-browser/icm-browser-3.6.1i.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 rpm eutils versionator
+
+MY_PV=$(replace_version_separator 2 '-' )
+MY_P="$PN-${MY_PV}"
+DESCRIPTION="MolSoft LCC ICM Browser"
+SRC_URI="${MY_P}.i386.rpm"
+HOMEPAGE="http://www.molsoft.com/icm_browser.html"
+
+LICENSE="MolSoft"
+SLOT=0
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="fetch"
+
+RDEPEND="!sci-chemistry/icm
+ virtual/libstdc++:3.3
+ >=app-arch/bzip2-1.0.6-r4[abi_x86_32(-)]
+ >=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
+ media-libs/libmng[abi_x86_32(-)]
+ >=media-libs/mesa-9.1.6[osmesa,abi_x86_32(-)]
+ >=media-libs/tiff-3.9.7-r1:3[abi_x86_32(-)]
+ >=sys-apps/keyutils-1.5.9-r1[abi_x86_32(-)]
+ virtual/jpeg:62[abi_x86_32(-)]
+ virtual/krb5[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdamage[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXfixes[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXrender[abi_x86_32(-)]
+ x11-libs/libXt[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libdrm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]
+"
+DEPEND=""
+
+S="${WORKDIR}/usr/${PN}-pro-${MY_PV}"
+
+pkg_nofetch() {
+ einfo "Please download ${SRC_URI} from "
+ einfo "${HOMEPAGE}"
+ einfo "and move it to ${DISTDIR}"
+}
+
+src_unpack() {
+ rpm_src_unpack
+}
+
+src_install () {
+ instdir=/opt/icm-browser
+ dodir "${instdir}"
+ dodir "${instdir}/licenses"
+ cp -pPR * "${D}/${instdir}"
+ doenvd "${FILESDIR}/90icm-browser"
+ exeinto ${instdir}
+ doexe "${S}/icmbrowserpro"
+ doexe "${S}/lmhostid"
+ doexe "${S}/txdoc"
+ dosym "${instdir}/icmbrowserpro" /opt/bin/icmbrowserpro
+ dosym "${instdir}/txdoc" /opt/bin/txdoc
+ dosym "${instdir}/lmhostid" /opt/bin/lmhostid
+ # make desktop entry
+ doicon "${FILESDIR}"/${PN}.xpm
+ make_desktop_entry "icmbrowserpro -g" "ICM Browser" ${PN} Chemistry
+}
+
+pkg_postinst () {
+ einfo
+ einfo "Documentation can be found in ${instdir}/man/"
+ einfo
+ einfo "If you want to upgrade free version of browser to pro version"
+ einfo "you should purchaise license from ${HOMEPAGE} and place it to"
+ einfo "${instdir}/licenses"
+ einfo
+}
diff --git a/sci-chemistry/icm-browser/metadata.xml b/sci-chemistry/icm-browser/metadata.xml
new file mode 100644
index 000000000000..3cfdd8f68922
--- /dev/null
+++ b/sci-chemistry/icm-browser/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-chemistry</herd>
+<maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/icm/Manifest b/sci-chemistry/icm/Manifest
new file mode 100644
index 000000000000..3ccc244f1352
--- /dev/null
+++ b/sci-chemistry/icm/Manifest
@@ -0,0 +1,2 @@
+DIST icm-3.7-2e-linux.sh 345626160 SHA256 89e2db76b6dbe0b5305e7e5dd67c43c3850924eb2383732881599991083af0cf SHA512 996955f70f24605d705e9ce44397b26306808c8f6742ac38d7b0926c0df11ad678d365c3b25926765a286c20be9ea5f27acba25fa6281f4222ac7859e3593b77 WHIRLPOOL 16d0205fbf2dc72db1d36a537ee43778b4b597ec103497cad146c935b7ed1c3bde1eaed76afa41554504b899f8f5c3ec72e958d4de3c5f29526a05a9f278ab85
+DIST icm-3.7-3b-linux.sh 361208642 SHA256 8dbdf3d0c56ede2d60eb0c32928c6194ed606898c0335a5ffa79c1d33c2d3195 SHA512 b2865623db3acc7b3cf81eceaacd0cacb540b402935a5cd5c1d52efec1cadb243f033f2331cd12748d92b493fd2872bb840068239a3776123904c68d6f19efa2 WHIRLPOOL 48161846010d6fdf58fecda2a330295dee334a20bfe94f3096c4d0bd19e2c2dc115a4b3116162d0ea5f694e8d53fe0c881df2845ac72b2f27c209d1f92ea8a8b
diff --git a/sci-chemistry/icm/files/90icm b/sci-chemistry/icm/files/90icm
new file mode 100644
index 000000000000..ce8966c406c3
--- /dev/null
+++ b/sci-chemistry/icm/files/90icm
@@ -0,0 +1,3 @@
+ICMHOME=/opt/icm
+LM_LICENSE_FILE=/opt/icm/licenses/license.dat
+MANPATH=/opt/icm/man
diff --git a/sci-chemistry/icm/files/icm.xpm b/sci-chemistry/icm/files/icm.xpm
new file mode 100644
index 000000000000..fd6e1ed3e2ed
--- /dev/null
+++ b/sci-chemistry/icm/files/icm.xpm
@@ -0,0 +1,326 @@
+/* XPM */
+static char *icm[] = {
+/* columns rows colors chars-per-pixel */
+"63 64 256 2 ",
+" c #7C0E13",
+". c #6C171B",
+"X c #5F3B3A",
+"o c #663436",
+"O c #5C554F",
+"+ c #6E756A",
+"@ c #90090F",
+"# c #B70003",
+"$ c #AD0C11",
+"% c #8A2B2D",
+"& c #A02C2E",
+"* c #C90104",
+"= c #DD050B",
+"- c #E30309",
+"; c #F2181A",
+": c #E71014",
+"> c #85605A",
+", c #837468",
+"< c #976263",
+"1 c #6D837A",
+"2 c #003EA9",
+"3 c #053CB8",
+"4 c #002EB9",
+"5 c #0044AC",
+"6 c #024BAC",
+"7 c #0045A6",
+"8 c #0D4DB4",
+"9 c #0745B6",
+"0 c #134EB9",
+"q c #1B54BB",
+"w c #1754B7",
+"e c #0E52B0",
+"r c #2057BE",
+"t c #59569B",
+"y c #534D99",
+"u c #556D9C",
+"i c #635EA0",
+"p c #4574B4",
+"a c #4978BA",
+"s c #4C6EAB",
+"d c #6C69A6",
+"f c #7878AE",
+"g c #1010DB",
+"h c #241FDC",
+"j c #1738C7",
+"k c #1027CD",
+"l c #292ADC",
+"z c #3031DC",
+"x c #241BE0",
+"c c #332AE1",
+"v c #423BE1",
+"b c #1849C2",
+"n c #1C50C0",
+"m c #2A4ACB",
+"M c #2558C1",
+"N c #2B5AC5",
+"B c #2C55C9",
+"V c #2756C5",
+"C c #355DCB",
+"Z c #355ECA",
+"A c #3947D7",
+"S c #3B5CD3",
+"D c #3E4ECC",
+"F c #3C61CD",
+"G c #3A65C7",
+"H c #3F62D0",
+"J c #465BCC",
+"K c #4652D5",
+"L c #4B77CB",
+"P c #547ACA",
+"I c #4564D4",
+"U c #4C64DA",
+"Y c #4C67D6",
+"T c #536BDC",
+"R c #5469DA",
+"E c #4E65C9",
+"W c #666CC7",
+"Q c #6C76D1",
+"! c #514DE5",
+"~ c #5B59E6",
+"^ c #4C4DE3",
+"/ c #625EEB",
+"( c #5C6DE2",
+") c #5766E3",
+"_ c #5E71E1",
+"` c #6469E7",
+"' c #6472E5",
+"] c #6C74EC",
+"[ c #6975E6",
+"{ c #7275EC",
+"} c #757CEB",
+"| c #726AF3",
+" . c #7B7AF3",
+".. c #7676F3",
+"X. c #6F67F2",
+"o. c #817FB9",
+"O. c #837DE9",
+"+. c #827EF6",
+"@. c #897FF8",
+"#. c #5B9986",
+"$. c #6E9987",
+"%. c #65AC9D",
+"&. c #5581BE",
+"*. c #5998A9",
+"=. c #6B87B2",
+"-. c #5CA9B6",
+";. c #67B1BF",
+":. c #76CCB9",
+">. c #6FD8B8",
+",. c #77D7B9",
+"<. c #70C3AC",
+"1. c #7BE4BD",
+"2. c #5787C6",
+"3. c #5A96C5",
+"4. c #4F89C4",
+"5. c #6589C1",
+"6. c #7397C8",
+"7. c #688BD4",
+"8. c #7589D8",
+"9. c #7094CD",
+"0. c #6EBCC8",
+"q. c #73BDC2",
+"w. c #64AAC2",
+"e. c #7785E6",
+"r. c #78D7C2",
+"t. c #74CCC3",
+"y. c #7DE8C1",
+"u. c #9E9E9E",
+"i. c #9C9E95",
+"p. c #8E918C",
+"a. c #A39C9B",
+"s. c #8CB89F",
+"d. c #A6A69F",
+"f. c #9D9DA4",
+"g. c #898AB1",
+"h. c #88A9B0",
+"j. c #94AAB0",
+"k. c #A3A3A3",
+"l. c #AAAAA5",
+"z. c #ABABAB",
+"x. c #A4A4AB",
+"c. c #B3ACA8",
+"v. c #B3B1AC",
+"b. c #A1A7B8",
+"n. c #ACB4B5",
+"m. c #B3B3B3",
+"M. c #BCBBB6",
+"N. c #BBBBBB",
+"B. c #B8B9B6",
+"V. c #C1BDBB",
+"C. c #89CCB9",
+"Z. c #B4C2B8",
+"A. c #AEC9B4",
+"S. c #82ECB4",
+"D. c #81E7B9",
+"F. c #88F4B4",
+"G. c #C4C3BC",
+"H. c #CAC9BF",
+"J. c #D2CFBF",
+"K. c #8987C8",
+"L. c #9798CB",
+"P. c #8986DA",
+"I. c #899CD6",
+"U. c #9A9ED1",
+"Y. c #8B95D1",
+"T. c #8AA2C6",
+"R. c #92ACD1",
+"E. c #A7A7C8",
+"W. c #BBBCC2",
+"Q. c #A6A7DB",
+"!. c #AAB4D5",
+"~. c #B0B7CE",
+"^. c #8A87E9",
+"/. c #8C94E9",
+"(. c #9998E7",
+"). c #8481F6",
+"_. c #8A85F8",
+"`. c #928DF8",
+"'. c #9A95F9",
+"]. c #9A96F6",
+"[. c #A39FF5",
+"{. c #A19CF9",
+"}. c #B1AFED",
+"|. c #A6B6EA",
+" X c #B6B6E6",
+".X c #ADAAF9",
+"XX c #A8A5F6",
+"oX c #B2ADF6",
+"OX c #B5B2FA",
+"+X c #BCBAF9",
+"@X c #B9B6F7",
+"#X c #A7A8E7",
+"$X c #93A9E1",
+"%X c #C3BDC3",
+"&X c #C0BCEC",
+"*X c #C0BEF6",
+"=X c #BAC3C8",
+"-X c #BDC5D3",
+";X c #B7C2D1",
+":X c #A7DAD8",
+">X c #9AEAD1",
+",X c #B3DCEC",
+"<X c #C3C3C3",
+"1X c #C4C4CA",
+"2X c #CBCBCB",
+"3X c #C8C8C5",
+"4X c #D1CECA",
+"5X c #D2D1CE",
+"6X c #D5D3CA",
+"7X c #C8CAD4",
+"8X c #CED2D7",
+"9X c #D3D3D3",
+"0X c #D9D7D4",
+"qX c #DBDAD5",
+"wX c #D4D4DA",
+"eX c #DBDBDB",
+"rX c #D4D8DD",
+"tX c #E1DFDA",
+"yX c #E0DCD6",
+"uX c #E5E3DD",
+"iX c #C6C8E2",
+"pX c #D4D4E4",
+"aX c #DEDEE3",
+"sX c #D9D8EB",
+"dX c #C4C2F4",
+"fX c #CCCAF4",
+"gX c #C5C3FA",
+"hX c #CCCBF9",
+"jX c #CBC7F5",
+"kX c #D1CFF8",
+"lX c #D5D4F4",
+"zX c #DDDCF7",
+"xX c #D4D2FB",
+"cX c #DBDAF9",
+"vX c #D6D8F9",
+"bX c #C5DDE9",
+"nX c #E1DEF9",
+"mX c #C3F9E4",
+"MX c #DAF2F3",
+"NX c #E3E4E3",
+"BX c #EBEAE5",
+"VX c #E3E2EE",
+"CX c #EBEBEB",
+"ZX c #E7E9E1",
+"AX c #F7F6EE",
+"SX c #E3E3F2",
+"DX c #E4E4FA",
+"FX c #ECECFA",
+"GX c #EBEBF2",
+"HX c #EDF4FA",
+"JX c #F4F4F2",
+"KX c #FDFCF5",
+"LX c #FEFEFE",
+"PX c #F5F7FB",
+"IX c #F3EFF2",
+"UX c None",
+/* pixels */
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.k.u.u.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.k.k.u.k.k.k.k.k.k.u.k.k.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.k.k.k.k.x.l.x.x.l.x.k.l.k.k.k.u.k.u.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.x.l.k.l.z.z.z.z.z.z.z.z.z.z.l.z.l.x.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.x.l.l.z.z.z.n.z.z.m.m.m.m.n.m.z.n.z.z.c.v.l.k.k.k.u.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.k.k.l.z.z.z.z.z.m.m.m.m.m.m.m.m.m.m.m.m.m.v.x.x.l.z.z.z.l.k.k.a.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.x.l.z.z.z.m.m.m.B.B.B.B.B.N.N.m.B.B.B.B.B.n.j.=.d g.f.z.l.x.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXk.k.k.l.z.z.z.m.m.m.B.N.N.N.N.N.N.N.%XN.N.N.N.N.V.B.q.*.t i d g.f.z.z.x.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXk.k.k.x.z.z.n.B.m.B.B.N.N.N.G.W.<X<X<X<X=X<X<X%X<XV.=XC.%.s t y d b.m.z.z.k.k.k.u.UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXk.k.x.l.z.v.m.m.B.N.N.N.<X<X<X<X<X<X<X3X3X3X3X3X<X<X3X<XC.*.u t i L.-XN.c.z.z.l.k.k.u.UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXk.k.k.z.z.n.m.m.B.N.N.%XW.<X<X3X1X2X2X3X2X2X4X2X2X3X5X5X<Xj.u t f E.sXpXN.n.n.z.z.l.k.k.u.UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXk.k.x.z.z.z.B.B.N.N.%X<X<X3X1X3X2X2X2X8X2X2X8X5X8X0X0X4X%Xb.f d K. XDXDXsXW.B.m.m.z.z.z.k.k.u.UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXu.k.x.l.z.m.m.B.B.V.Z.<X<X1X1X4X7X5X5X9X8X0XqXeXqX0X9X3XW.L.f K.#XdXcXDXnXpX<XB.B.m.m.z.z.k.k.u.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXu.k.k.l.z.m.m.B.N.N.=XG.1X3X2X4X4X5X0X0XqXeXtXtXyX0X1XE.L.L.P.(.}.gXxXxXcXzXpX3XN.N.B.m.m.z.z.x.k.u.u.UXUXUXUXUXUX",
+"UXUXUXUXUXUXk.k.x.l.z.m.B.N.N.W.<X3X2X2X2X9X0XqXqXtXuXuX0X1XE.L.Y.P.P.^.XXOXOX*XjXkXcXzXsX1X%XN.N.B.B.z.z.l.k.k.u.UXUXUXUXUXUX",
+"UXUXUXUXUXu.k.k.z.z.m.m.N.N.W.<X1X2X2X5X8X0XtXuXuX0X1X!.L.K.Q [ ..).`.'.XX.XOX@XdXhXvXcXsX2XG.=XW.N.B.m.z.z.l.k.k.u.UXUXUXUXUX",
+"UXUXUXUXUXk.k.l.z.m.B.B.N.W.1X3X2X2X5XqXuXuX8X7X!.U.8.W R ( ` .. .).`.'.[.XX.X@X+XjXxXcXsX5X3X<XW.N.N.B.B.z.z.x.k.u.UXUXUXUXUX",
+"UXUXUXUXu.k.l.z.z.m.N.N.=X<X<X3X2X0XyX0X-X~.I.P E I I U ) ( ] .. .)._.].].XX.X@X+XgXkXlXpX5X2X1X<XN.N.B.m.z.z.x.k.u.u.UXUXUXUX",
+"UXUXUXUXu.x.z.z.v.m.N.N.G.<X3X4X5X0X-XT.P G N Z B C I T _ ' [ { .+._.`.].[.XX.X@XgXfXpXwX5X2X2X<X<XW.B.B.m.n.l.k.k.u.UXUXUXUX",
+"UXUXUXu.k.x.z.z.m.B.N.N.<X1X4X5X5XT.a q e 8 n B Z F I Y T _ ] { .. .+._.`.].[..X@XfXpXeX0X9X2X2X3X3X<XN.N.m.m.z.l.k.u.u.UXUXUX",
+"UXUXUXu.k.l.z.m.m.B.W.%X3X3X5XyX=XP 5 2 8 w M N C F I Y T ( ( ` ] .. .+.`.]..X&XlXaXuXeXeX0X9X4X2X3X<XW.N.B.m.z.l.k.k.u.UXUXUX",
+"UXUXUXk.x.z.z.B.B.N.%X<X1X2X9XyX-Xa 5 5 0 w q N C Z I I U ) ) ( ` .`.XX@XfXlXVXCXBXNXuXeXeX9X4X7X1X<X<XN.B.m.z.z.x.k.u.UXUXUX",
+"UXUXu.k.l.z.z.m.B.N.<X<X2X4X0XtX-X&.6 5 8 0 q M N C S S U _ e./.XX+XxXDXPXKXKXJXCXCXNXNXaXeXwX9X4X2X3X<XN.N.m.m.z.l.k.u.u.UXUX",
+"UXUXk.k.x.z.m.m.N.V.<X3X2X2X0XtX8X5.6 5 8 8 q r V m Z L 7.|.vXHXLXLXLXLXLXLXKXJXJXCXCXNXNXeXrX0X5X2X1X<XN.N.B.n.z.z.x.u.u.UXUX",
+"UXUXu.k.z.z.m.m.N.W.<X2X2X5X0XtX8X3.5 5 e e 0 q m G 4.q.:XmXHXLXLXLXLXLXLXLXPXJXJXCXCXNXNXaXeX0X9X5X2X<X<XN.B.m.z.z.k.k.u.UXUX",
+"UXUXk.k.z.z.m.m.N.<X<X1X5X8XeXuXwX5.6 7 6 9 j D L w.t.y.D.s.a.c.8XPXLXLXLXLXLXLXJXJXCXBXNXtXeXeX9X2X2X1X%XN.B.m.m.z.x.k.u.UXUX",
+"UXu.k.x.z.m.m.B.N.<X<X2X2X9XqXuXrX6.6 2 3 j G 3.:.D.D.<.+ % % o > a.aXLXLXLXLXLXLXJXCXBXNXNXeXrX9X5X4X3X<XN.N.m.m.z.l.k.u.u.UX",
+"UXu.k.l.l.n.m.N.N.<X3X2X9X9XqXuXeX6.6 4 m R q.D.D.y.,., $ # * # @ o p.:X,XgXnXLXLXKXAXIXNXNXtXwX9X5X7X3X<X%XN.B.m.z.l.k.u.u.UX",
+"UXu.k.x.l.m.m.B.N.<X1X2X5X9XeXNXZX6.k k R :.F.S.1.y.p.& * - : = # . O %.0./.^.].*XSXAXAXCXNXaXeXwX5X5X1X<XV.N.m.m.z.z.k.u.u.UX",
+"UXu.k.l.z.m.m.N.N.<X3X2X5X9XeXuXZX X~ c I q.1.S.y.,.+ $ - ; ; : * @ X #.>.t.4.A ^ } }.aXCXZXaXeXwX5X2X2X3X=XN.m.m.z.l.x.u.u.UX",
+"UXk.k.k.z.m.m.B.N.<X1X4X5X8XrXtXZXNX X^.' 5.:.>.1.>., $ - ; ; : = @ X #.1.1.:.3.A c v } iXZXuXeX0X9X4X1X<XW.N.B.m.z.l.k.u.u.UX",
+"UXk.a.l.z.z.m.B.N.<X3X2X9X0XeXeXNXBXCXVXfX|.$XR.r.r.1 % # = : = $ O %.1.1.F.F.3.l g v (.aXNXyX0X8X2X2X<XW.N.B.z.z.l.k.u.u.UX",
+"UXu.k.x.z.n.m.N.N.<X1X2X4X8XwXeXtXZXIXKXKXHXzXvXbXmXC.> @ # # # @ o 1 ,.1.1.F.S.2.l x ~ }.NXuXeXwX5X2X3X<XN.N.B.m.z.l.k.u.u.UX",
+"UXu.k.x.z.m.m.B.N.<X3X2X2X8X0XeXaXNXNXCXJXKXLXLXPXPXMX3X< % . X + <.1.D.D.,.3.A l ` @XSXBXtX0X8X5X2X3X<XW.N.B.m.z.z.k.u.u.UX",
+"UXu.k.x.z.z.m.B.N.<X<X2X5X5X0XeXaXNXCXCXIXKXKXLXLXLXLXLXBXc.i.1 #.<.1.y.,.;.P A ! O.dXFXIXaXeXwX9X5X5X1X<XN.B.m.m.l.x.x.u.u.UX",
+"UXUXk.k.z.z.m.B.N.W.<X3X4X8X9XeXtXNXNXCXCXJXJXLXLXLXLXLXLXLXPXMXmX>Xt.w.2.U ! X.[.zXHXIXVXaXeX0X9X2X2X3X%XN.B.m.m.z.k.k.u.UXUX",
+"UXUXk.k.l.z.m.m.N.N.<X3X4X8X8XeXaXuXNXNXCXIXJXPXLXPXLXLXLXLXLXLXDX|.7.K ! X.`.@XvXFXFXDXSXaXeX0X8X2X3X<X<XN.m.m.z.z.k.u.u.UXUX",
+"UXUXu.k.l.z.z.m.N.N.<X3X2X2X9XwXeXaXNXNXBXGXJXIXKXLXLXLXLXPXzXoX^./ / X.@.{.@XjXkXlXzXSXVXeX0X8X5X2X3X<XN.N.B.m.z.l.k.k.u.UXUX",
+"UXUXu.k.x.z.m.m.B.N.=X<X3X3X9X0XqXaXNXNXBXCXJXKXKXLXLXHXkX(.{ ` ) / | _.{.XXoX@XgXvXzXDXVXaX9X9X4X1X1X<XN.N.m.m.z.z.k.u.u.UXUX",
+"UXUXUXk.k.l.z.m.B.B.W.<X3X1X2X8XwXeXtXNXCXCXAXAXHXsX|./.[ ) ^ ) ] .)._.`.{.XXOXdXkXcXDXSXeX8X5X5X1X<XV.N.N.m.m.z.x.k.u.UXUXUX",
+"UXUXUXk.k.l.z.z.m.B.N.<X3X3X3X8X8XqXuXBXBXNXiX!.$X8.R S K U _ ' ] .. .)._.'.{.OX+XhXvXnXaXwX5X2X3X<X<XW.N.m.m.z.l.k.u.u.UXUXUX",
+"UXUXUXu.k.x.z.z.m.B.N.W.<X<X2X4X0XqXqX-XR.9.2.H B B C H U T _ ' ] } . .).'.[..X@XgXxXsXrX9X2X2X1X<X%XN.B.n.z.z.l.k.u.u.UXUXUX",
+"UXUXUXUXu.k.z.z.z.m.B.N.W.<X3X2X2X;XT.a r 0 0 r n N S I Y T ( _ ' ] . .@.`.'.{.OXdXpXrX0X5X7X3X<X<XN.B.m.m.z.l.x.k.u.UXUXUXUX",
+"UXUXUXUXu.k.k.l.z.m.B.N.N.V.3X4XW.5.e 5 9 9 0 M N C F H Y R T _ ' ] ] .. ._.].oXdX8XwX9X5X2X3X<XG.N.N.B.m.z.z.l.k.u.u.UXUXUXUX",
+"UXUXUXUXUXk.k.x.z.m.m.B.N.N.3X4X~.p 2 5 e w q M N C C H I U U ) ) ' ] ..).'.}.iX8X0X9X5X5X1X<X<X=XB.N.B.m.z.z.x.k.u.UXUXUXUXUX",
+"UXUXUXUXUXu.k.k.l.z.z.m.N.N.<X4Xb.p 5 5 8 0 w M M N C C S I ) ) ( e./.#X XiX8X0X0X9X2X4X3X3X<XG.N.B.m.m.z.z.k.k.u.u.UXUXUXUXUX",
+"UXUXUXUXUXUXu.k.x.z.z.m.B.B.Z.<Xn.p 5 7 8 8 w q M V N C S T 8.I.#X XiX8XtXyXqX9X9X4X2X1X<X<X=XN.B.B.m.z.z.l.k.u.u.UXUXUXUXUXUX",
+"UXUXUXUXUXUXUXk.k.k.z.z.m.m.N.G.b.p 6 5 6 8 e q n b m Y 8.!.;X8XqXqXqXqX0X9X9X2X4X1X3X<X<X%XN.N.B.m.z.z.l.x.k.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXu.k.k.z.z.n.m.M.V.n.p 6 5 6 e 8 j m J Q U.1XqXqX0XqXqX5X5X5X2X4X2X1X3X<X<XN.W.B.m.m.z.z.z.k.k.u.u.UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXu.k.k.l.z.z.m.V.b.s 5 7 6 3 j D Q U.=X6X5X9X5X9X4X2X5X2X1X3X<X<X<X<XN.N.N.B.m.m.m.z.z.x.k.u.u.UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXu.k.k.z.c.v.v.j.p 6 3 4 j E L.%X2XJ.4X2X3X3X3X3X3X1X3X1X3X<X<X<XW.N.N.B.B.m.n.z.l.k.k.u.u.UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXu.k.x.l.z.m.x.p 3 4 k S j.H.J.G.<X<X<X<X<X<X1X<X<X<X%X<XN.N.N.N.B.B.m.m.z.z.z.x.k.k.u.UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXu.a.k.l.v.f.E k g l 5.A.G.V.Z.V.%X<XW.<XW.=XG.<XZ.N.W.N.N.B.B.B.z.m.z.z.l.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXa.k.d.l.k.f K h l 5.A.M.N.N.N.N.N.N.N.N.B.N.N.N.B.B.B.m.B.m.z.z.z.l.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.c.k.g.W E g.n.B.m.m.m.m.B.B.B.m.B.B.B.m.m.m.m.m.n.z.z.z.l.x.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.l.l.l.l.z.z.z.z.n.m.m.B.m.m.m.m.m.m.z.z.z.m.z.z.l.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.k.d.l.c.l.l.l.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.x.k.k.k.k.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.k.k.k.l.x.x.l.l.z.l.z.z.l.x.l.k.x.d.k.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.k.k.k.k.k.k.x.k.k.x.x.d.x.k.k.k.k.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXk.k.u.u.k.k.u.u.k.u.u.k.u.u.k.k.k.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXu.u.u.u.u.u.u.UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX"
+};
diff --git a/sci-chemistry/icm/icm-3.7.2e.ebuild b/sci-chemistry/icm/icm-3.7.2e.ebuild
new file mode 100644
index 000000000000..bee2194b3a88
--- /dev/null
+++ b/sci-chemistry/icm/icm-3.7.2e.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils unpacker versionator
+
+MY_PV=$(replace_version_separator 2 '-' )
+MY_P="$PN-${MY_PV}"
+
+DESCRIPTION="MolSoft LCC ICM Pro"
+HOMEPAGE="http://www.molsoft.com/icm_pro.html"
+SRC_URI="${MY_P}-linux.sh"
+
+LICENSE="MolSoft"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="32bit 64bit vim-syntax"
+
+REQUIRED_USE="^^ (
+ ( !32bit 64bit )
+ ( 32bit !64bit )
+ ( 32bit 64bit )
+ )"
+
+RESTRICT="fetch"
+
+DEPEND="!sci-chemistry/icm-browser
+ app-arch/unzip
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+ amd64? (
+ 64bit? (
+ =media-libs/tiff-3*
+ media-libs/libmng
+ app-crypt/mit-krb5
+ app-arch/bzip2
+ media-libs/libpng:1.2
+ || ( virtual/jpeg:62 media-libs/jpeg:62 )
+ x11-libs/libdrm
+ x11-libs/libX11
+ sys-apps/keyutils
+ )
+ 32bit? (
+ virtual/libstdc++:3.3
+ >=x11-libs/libX11-1.6.2[abi_x86_32(-)]
+ )
+ )
+ x86? (
+ =media-libs/tiff-3*
+ media-libs/libpng:1.2
+ media-libs/libmng
+ app-crypt/mit-krb5
+ app-arch/bzip2
+ x11-libs/libdrm
+ x11-libs/libX11
+ sys-apps/keyutils
+ )"
+RDEPEND="$DEPEND"
+
+S="${WORKDIR}"
+
+pkg_nofetch() {
+ einfo "Please download ${SRC_URI} from "
+ einfo "${HOMEPAGE}"
+ einfo "and move it to ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself
+ unpack ./data.tgz
+ rm ./data.tgz
+}
+
+src_install () {
+ instdir=/opt/icm
+ dodir "${instdir}"
+ dodir "${instdir}/licenses"
+ cp -pPR * "${D}/${instdir}"
+ rm "${D}/${instdir}/unzip"
+ doenvd "${FILESDIR}/90icm" || die
+ if use x86; then
+ dosym "${instdir}/icm" /opt/bin/icm || die
+ dosym "${instdir}/icmng" /opt/bin/icmng || die
+ rm "${D}/${instdir}/icm64" || die
+ rm "${D}/${instdir}/icmng64" || die
+ rm "${D}/${instdir}/icmora64" || die
+ rm "${D}/${instdir}/icmora64.bin" || die
+ rm -rf "${D}/${instdir}/lib64" || die
+ elif use amd64; then
+ if use 32bit; then
+ dosym "${instdir}/icm" /opt/bin/icm || die
+ dosym "${instdir}/icmng" /opt/bin/icmng || die
+ fi
+ if use 64bit; then
+ dosym "${instdir}/icm64" /opt/bin/icm64 || die
+ dosym "${instdir}/icmng64" /opt/bin/icmng64 || die
+ fi
+ if ! use 64bit; then
+ rm "${D}/${instdir}/icm64" || die
+ rm "${D}/${instdir}/icmng64" || die
+ rm "${D}/${instdir}/icmora64{,.bin}" || die
+ rm -rf "${D}/${instdir}/lib64" || die
+ fi
+ if ! use 32bit; then
+ rm "${D}/${instdir}/icm" || die
+ rm "${D}/${instdir}/icmng" || die
+ rm "${D}/${instdir}/icmora" || die
+ rm "${D}/${instdir}/icmora.bin" || die
+ rm -rf "${D}/${instdir}/lib32" || die
+ fi
+ fi
+ dosym "${instdir}/txdoc" /opt/bin/txdoc || die
+ dosym "${instdir}/lmhostid" /opt/bin/lmhostid || die
+ # install vim files
+ if use vim-syntax ; then
+ insinto /usr/share/vim/vimfiles/ftdetect
+ doins "${WORKDIR}/icm.vim"
+ insinto /usr/share/vim/vimfiles/syntax
+ doins "${WORKDIR}/icm.vim"
+ rm "${D}/${instdir}/icm.vim" || die
+ fi
+ # make desktop entry
+ doicon "${FILESDIR}/${PN}.xpm"
+ if use x86; then
+ make_desktop_entry "icm -g" "ICM Pro" ${PN} Chemistry
+ elif use amd64; then
+ use 32bit && make_desktop_entry "icm -g" "ICM Pro (32bit)" ${PN} Chemistry
+ use 64bit && make_desktop_entry "icm64 -g" "ICM Pro (64bit)" ${PN} Chemistry
+ fi
+}
+
+pkg_postinst () {
+ einfo
+ einfo "Documentation can be found in ${instdir}/man/"
+ einfo
+ einfo "You will need to place your license in ${instdir}/licenses/"
+ einfo
+
+}
diff --git a/sci-chemistry/icm/icm-3.7.3b.ebuild b/sci-chemistry/icm/icm-3.7.3b.ebuild
new file mode 100644
index 000000000000..bee2194b3a88
--- /dev/null
+++ b/sci-chemistry/icm/icm-3.7.3b.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils unpacker versionator
+
+MY_PV=$(replace_version_separator 2 '-' )
+MY_P="$PN-${MY_PV}"
+
+DESCRIPTION="MolSoft LCC ICM Pro"
+HOMEPAGE="http://www.molsoft.com/icm_pro.html"
+SRC_URI="${MY_P}-linux.sh"
+
+LICENSE="MolSoft"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="32bit 64bit vim-syntax"
+
+REQUIRED_USE="^^ (
+ ( !32bit 64bit )
+ ( 32bit !64bit )
+ ( 32bit 64bit )
+ )"
+
+RESTRICT="fetch"
+
+DEPEND="!sci-chemistry/icm-browser
+ app-arch/unzip
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+ amd64? (
+ 64bit? (
+ =media-libs/tiff-3*
+ media-libs/libmng
+ app-crypt/mit-krb5
+ app-arch/bzip2
+ media-libs/libpng:1.2
+ || ( virtual/jpeg:62 media-libs/jpeg:62 )
+ x11-libs/libdrm
+ x11-libs/libX11
+ sys-apps/keyutils
+ )
+ 32bit? (
+ virtual/libstdc++:3.3
+ >=x11-libs/libX11-1.6.2[abi_x86_32(-)]
+ )
+ )
+ x86? (
+ =media-libs/tiff-3*
+ media-libs/libpng:1.2
+ media-libs/libmng
+ app-crypt/mit-krb5
+ app-arch/bzip2
+ x11-libs/libdrm
+ x11-libs/libX11
+ sys-apps/keyutils
+ )"
+RDEPEND="$DEPEND"
+
+S="${WORKDIR}"
+
+pkg_nofetch() {
+ einfo "Please download ${SRC_URI} from "
+ einfo "${HOMEPAGE}"
+ einfo "and move it to ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself
+ unpack ./data.tgz
+ rm ./data.tgz
+}
+
+src_install () {
+ instdir=/opt/icm
+ dodir "${instdir}"
+ dodir "${instdir}/licenses"
+ cp -pPR * "${D}/${instdir}"
+ rm "${D}/${instdir}/unzip"
+ doenvd "${FILESDIR}/90icm" || die
+ if use x86; then
+ dosym "${instdir}/icm" /opt/bin/icm || die
+ dosym "${instdir}/icmng" /opt/bin/icmng || die
+ rm "${D}/${instdir}/icm64" || die
+ rm "${D}/${instdir}/icmng64" || die
+ rm "${D}/${instdir}/icmora64" || die
+ rm "${D}/${instdir}/icmora64.bin" || die
+ rm -rf "${D}/${instdir}/lib64" || die
+ elif use amd64; then
+ if use 32bit; then
+ dosym "${instdir}/icm" /opt/bin/icm || die
+ dosym "${instdir}/icmng" /opt/bin/icmng || die
+ fi
+ if use 64bit; then
+ dosym "${instdir}/icm64" /opt/bin/icm64 || die
+ dosym "${instdir}/icmng64" /opt/bin/icmng64 || die
+ fi
+ if ! use 64bit; then
+ rm "${D}/${instdir}/icm64" || die
+ rm "${D}/${instdir}/icmng64" || die
+ rm "${D}/${instdir}/icmora64{,.bin}" || die
+ rm -rf "${D}/${instdir}/lib64" || die
+ fi
+ if ! use 32bit; then
+ rm "${D}/${instdir}/icm" || die
+ rm "${D}/${instdir}/icmng" || die
+ rm "${D}/${instdir}/icmora" || die
+ rm "${D}/${instdir}/icmora.bin" || die
+ rm -rf "${D}/${instdir}/lib32" || die
+ fi
+ fi
+ dosym "${instdir}/txdoc" /opt/bin/txdoc || die
+ dosym "${instdir}/lmhostid" /opt/bin/lmhostid || die
+ # install vim files
+ if use vim-syntax ; then
+ insinto /usr/share/vim/vimfiles/ftdetect
+ doins "${WORKDIR}/icm.vim"
+ insinto /usr/share/vim/vimfiles/syntax
+ doins "${WORKDIR}/icm.vim"
+ rm "${D}/${instdir}/icm.vim" || die
+ fi
+ # make desktop entry
+ doicon "${FILESDIR}/${PN}.xpm"
+ if use x86; then
+ make_desktop_entry "icm -g" "ICM Pro" ${PN} Chemistry
+ elif use amd64; then
+ use 32bit && make_desktop_entry "icm -g" "ICM Pro (32bit)" ${PN} Chemistry
+ use 64bit && make_desktop_entry "icm64 -g" "ICM Pro (64bit)" ${PN} Chemistry
+ fi
+}
+
+pkg_postinst () {
+ einfo
+ einfo "Documentation can be found in ${instdir}/man/"
+ einfo
+ einfo "You will need to place your license in ${instdir}/licenses/"
+ einfo
+
+}
diff --git a/sci-chemistry/icm/metadata.xml b/sci-chemistry/icm/metadata.xml
new file mode 100644
index 000000000000..55d880878df8
--- /dev/null
+++ b/sci-chemistry/icm/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-chemistry</herd>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+ <use>
+ <flag name="32bit">Automatically generated description for 32bit</flag>
+ <flag name="64bit">Automatically generated description for 64bit</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/imosflm/Manifest b/sci-chemistry/imosflm/Manifest
new file mode 100644
index 000000000000..2ce7d893b7fd
--- /dev/null
+++ b/sci-chemistry/imosflm/Manifest
@@ -0,0 +1 @@
+DIST imosflm-1.0.7.zip 941784 SHA256 b067261b4d7ef2f1f7581ddeaa08252d29f889acf89ce190eb0d8b30aa94b107 SHA512 f3163e1f71c5b1e24d6b3fbd5a040bbcebae25485d1258eef4b2725821f5f96c1260adb2bcc3ab57179d7b9b9e538ddf0494ab9b5be259b98d138fddacec8c77 WHIRLPOOL bd2b6bcdcc241fde41fe2ba99bd1e2f47bc444c46ee36a5b332d5c018b81a9d649378110a8bffa48ffc67a19b04ede7e61846b53a250e5fe3058ec0313fda80c
diff --git a/sci-chemistry/imosflm/files/1.0.4-impl-dec.patch b/sci-chemistry/imosflm/files/1.0.4-impl-dec.patch
new file mode 100644
index 000000000000..5d0dd7010910
--- /dev/null
+++ b/sci-chemistry/imosflm/files/1.0.4-impl-dec.patch
@@ -0,0 +1,12 @@
+diff --git a/c/tkImageLoad.c b/c/tkImageLoad.c
+index e7c46f0..1496a15 100755
+--- a/c/tkImageLoad.c
++++ b/c/tkImageLoad.c
+@@ -12,6 +12,7 @@
+ #include <tcl.h>
+ #include <tk.h>
+ #include <assert.h>
++#include <stdlib.h>
+
+ #define HEADER_LINE_LENGTH 512
+ #define BYTES_PER_PIXEL 2
diff --git a/sci-chemistry/imosflm/files/1.0.4-tk.patch b/sci-chemistry/imosflm/files/1.0.4-tk.patch
new file mode 100644
index 000000000000..a90175194eb4
--- /dev/null
+++ b/sci-chemistry/imosflm/files/1.0.4-tk.patch
@@ -0,0 +1,50 @@
+--- c/tkImageLoad.c 2009-08-14 21:10:19.000000000 +0200
++++ c/tkImageLoad.c.new 2009-08-14 21:10:55.000000000 +0200
+@@ -19,6 +19,7 @@
+ //#define BLOCKED 1
+ //#define UNBLOCKED 1
+ #define IN_BLOCK_FLIP 1
++#define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
+
+ /* *********************************************************************/
+
+--- c/tkImageLoad.c 2009-08-14 21:13:29.000000000 +0200
++++ c/tkImageLoad.c.new 2009-08-14 21:14:59.000000000 +0200
+@@ -272,9 +272,11 @@
+ }
+ /* put the photo block into the image */
+ #ifdef __alpha
+- Tk_PhotoPutBlock(dp, &db, 0, 0, width, height);
++ Tk_PhotoPutBlock(dp, &db, 0, 0, width, height,
++ TK_PHOTO_COMPOSITE_OVERLAY);
+ #else
+- Tk_PhotoPutBlock(dp, &db, 0, 0, width, height, TK_PHOTO_COMPOSITE_SET);
++ Tk_PhotoPutBlock(dp, &db, 0, 0, width, height, TK_PHOTO_COMPOSITE_SET,
++ TK_PHOTO_COMPOSITE_OVERLAY);
+ #endif
+
+ /* Free the photo block's memory now it is finished with */
+@@ -417,9 +419,11 @@
+
+ /* put the photo block back into the image */
+ #ifdef __alpha
+- Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height);
++ Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height,
++ TK_PHOTO_COMPOSITE_OVERLAY);
+ #else
+- Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height,TK_PHOTO_COMPOSITE_SET);
++ Tk_PhotoPutBlock(photo, &block, 0, 0, block.width, block.height,TK_PHOTO_COMPOSITE_SET,
++ TK_PHOTO_COMPOSITE_OVERLAY);
+ #endif
+ /* Free the photo block's memory now it is finished with */
+ if (block.pixelPtr) {
+--- c/tkImageLoad.c 2009-08-14 21:15:06.000000000 +0200
++++ c/tkImageLoad.c.new 2009-08-14 21:16:53.000000000 +0200
+@@ -9,6 +9,7 @@
+ \************************************************************************/
+
+ #include <stdio.h>
++#include <string.h>
+ #include <tcl.h>
+ #include <tk.h>
+ #include <assert.h>
diff --git a/sci-chemistry/imosflm/files/1.0.7-libpng16.patch b/sci-chemistry/imosflm/files/1.0.7-libpng16.patch
new file mode 100644
index 000000000000..27efc6f36f4b
--- /dev/null
+++ b/sci-chemistry/imosflm/files/1.0.7-libpng16.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/467036
+
+--- src/contrast.tcl
++++ src/contrast.tcl
+@@ -3,7 +3,7 @@
+
+ package require palette
+
+-image create photo ::img::pixel_count_v -data "iVBORw0KGgoAAAANSUhEUgAAAA4AAABCCAIAAAGft0AHAAAABGdBTUEAAYagMeiWXwAAASFJREFUKJGtVFEWhCAINJ9H4f4n4jD7YauAA1jGT2EwAxNyMXMppZZu3bv6Q3t3iH7ob3fOPz3wdLoi7y8V1SOZp0NE02Hm7quc6VSVaokFKzMD8qKUUd0tyEQ0z1DchNQaud+JCHclzeIDOUCle7EjcA/XPZU4Klb9y2GDY68LVe8YiAihmXT052G9SQ0+m4yN2J7EZqrvnZpheMdGRLnq5/ViddTusPeux9o5G7fdsskrV9ej8rw3I80LhNUUgqmvwCY8izozZcvo5tGt1owfoGJhoEVtgcXg2da2gJa0JYESseRJ8gvyOYSGlxUkScYFoBoJB+RZrR+H2sWx2vEQrnv0pa4HYkFqF7UHrefRdjE5zQQFAp/Nqwf8XNePZ+AHq5sOPlXtupMAAAAASUVORK5CYII="
++image create photo ::img::pixel_count_v -data "iVBORw0KGgoAAAANSUhEUgAAAA4AAABCCAIAAAGft0AHAAAABGdBTUEAAYagMeiWXwAAASFJREFUeJytVFEWhCAINJ9H4f4n4jD7YauAA1jGT2EwAxNyMXMppZZu3bv6Q3t3iH7ob3fOPz3wdLoi7y8V1SOZp0NE02Hm7quc6VSVaokFKzMD8qKUUd0tyEQ0z1DchNQaud+JCHclzeIDOUCle7EjcA/XPZU4Klb9y2GDY68LVe8YiAihmXT052G9SQ0+m4yN2J7EZqrvnZpheMdGRLnq5/ViddTusPeux9o5G7fdsskrV9ej8rw3I80LhNUUgqmvwCY8izozZcvo5tGt1owfoGJhoEVtgcXg2da2gJa0JYESseRJ8gvyOYSGlxUkScYFoBoJB+RZrR+H2sWx2vEQrnv0pa4HYkFqF7UHrefRdjE5zQQFAp/Nqwf8XNePZ+AHq5sOPv4fGP4AAAAASUVORK5CYII="
+
+ class Contrast {
+ inherit Palette
diff --git a/sci-chemistry/imosflm/imosflm-1.0.7-r1.ebuild b/sci-chemistry/imosflm/imosflm-1.0.7-r1.ebuild
new file mode 100644
index 000000000000..e49667e50dc7
--- /dev/null
+++ b/sci-chemistry/imosflm/imosflm-1.0.7-r1.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 eutils multilib toolchain-funcs versionator
+
+MY_PV="$(delete_all_version_separators ${PV})"
+
+DESCRIPTION="A new GUI for the Mosflm crystallographic data processing tool"
+HOMEPAGE="http://www.mrc-lmb.cam.ac.uk/harry/imosflm"
+SRC_URI="${HOMEPAGE}/ver${MY_PV}/downloads/${P}.zip"
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-lang/tcl:0=
+ >=dev-tcltk/itcl-3.3
+ >=dev-tcltk/itk-3.3
+ >=dev-tcltk/iwidgets-4
+ >=dev-tcltk/tdom-0.8
+ >=dev-tcltk/tkimg-1.3
+ >=dev-tcltk/tktreectrl-2.1
+ dev-tcltk/anigif
+ dev-tcltk/combobox
+ dev-tcltk/tablelist
+ >=sci-chemistry/mosflm-7.0.9"
+DEPEND="app-arch/unzip"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-libpng16.patch
+}
+
+src_install(){
+ rm -rf lib/{*.so,anigif,combobox}
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r "${S}"/{src,bitmaps,lib}
+ fperms 775 /usr/$(get_libdir)/${PN}/src/imosflm
+
+ cat >> "${T}"/23imosflm <<- EOF
+ IMOSFLM_VERSION="${PV}"
+ EOF
+
+ doenvd "${T}"/23imosflm
+
+ make_wrapper imosflm /usr/$(get_libdir)/${PN}/src/imosflm
+}
diff --git a/sci-chemistry/imosflm/metadata.xml b/sci-chemistry/imosflm/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/imosflm/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/jmol/Manifest b/sci-chemistry/jmol/Manifest
new file mode 100644
index 000000000000..44e86a598441
--- /dev/null
+++ b/sci-chemistry/jmol/Manifest
@@ -0,0 +1,3 @@
+DIST Jmol-12.0.45-full.tar.gz 26501382 SHA256 f9a3fe242841f9b56a718f8da2efe4130e497afe2c12d77f2e68344c62d7f70e SHA512 b0e999335c039e5bde5e261c076f3eb75dd0c33a351445d5c086995d32b3fd03795b3a11dc57a06bf8ac39e74945f3c9f4547ecfbf18b56d827b9a42f5208c11 WHIRLPOOL d0bbae1fc5c96ddfb4dd29f6e09701e496a333a2f44ba266e2a24c60de2d36d73c2184bd9b8f6054b0955535d49856154d6101644ef0297b825c4f6745cfe3bb
+DIST Jmol-12.2.27-full.tar.gz 29493780 SHA256 f2ca3b810ea16a488f6f57003d2a407c8ac040d610479a7ae6d95631157db801 SHA512 a8608e64dc06b6d3b0cb7e911f0a224456a65bdc15c51d6b420ee6abf8d82cdcec9f54f6b1a51cfe032e2e074f173f50a88bcff783311de19ce9b95ad990ebca WHIRLPOOL ae0826eab7eb364acb4f30eb77850450b871a24d8940eaabaf8fe9f3770efc39deb604e3c5f875a695c0d33b516ad47d523982c7a6460f2421f961f50a7680bf
+DIST jmol-selfSignedCertificate.store.tar 10240 SHA256 416744934991ef4f1fa298c0afc8e855d43771de2f2278ed3fbc60f707ea46b2 SHA512 2c3e9d1183a0b174273346d0fba0729caa415ef53fe01629a4c47daa2393c9e18ca3f57984911e6340197429cf0ee581c64bb9b6072db902102976030d9f2c23 WHIRLPOOL 79dc2b2c95b304569f44bb986af3aa25150b0c5f8a9fc9b1698a979647800e60d0f20a7a4abbc89533a21f3d7f4b93a430840eed71bbe04b1cc0bdbcfae7fe63
diff --git a/sci-chemistry/jmol/files/12.0.45/jmol-manifest.patch b/sci-chemistry/jmol/files/12.0.45/jmol-manifest.patch
new file mode 100644
index 000000000000..3b43c219d94f
--- /dev/null
+++ b/sci-chemistry/jmol/files/12.0.45/jmol-manifest.patch
@@ -0,0 +1,96 @@
+diff -aurN jmol-11.0.3-orig/manifest/applet0.txt jmol-11.0.3/manifest/applet0.txt
+--- jmol-11.0.3-orig/manifest/applet0.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet0.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,6 @@
++Main-Class: JmolApplet
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
++
+diff -aurN jmol-11.0.3-orig/manifest/applet1.txt jmol-11.0.3/manifest/applet1.txt
+--- jmol-11.0.3-orig/manifest/applet1.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet1.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,6 @@
++Name: org/jmol/api/
++Sealed: false
++
++Name: org/jmol/applet/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet2.txt jmol-11.0.3/manifest/applet2.txt
+--- jmol-11.0.3-orig/manifest/applet2.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet2.txt 2007-05-16 01:56:19.000000000 -0500
+@@ -0,0 +1,3 @@
++Name: javax/vecmath/
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet3.txt jmol-11.0.3/manifest/applet3.txt
+--- jmol-11.0.3-orig/manifest/applet3.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet3.txt 2007-05-16 01:56:47.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/g3d/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet4.txt jmol-11.0.3/manifest/applet4.txt
+--- jmol-11.0.3-orig/manifest/applet4.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet4.txt 2007-05-16 01:57:05.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/adapter/smarter/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet5.txt jmol-11.0.3/manifest/applet5.txt
+--- jmol-11.0.3-orig/manifest/applet5.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet5.txt 2007-05-16 01:57:23.000000000 -0500
+@@ -0,0 +1,4 @@
++Name: org/openscience/jmol/ui/
++Sealed: true
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet6.txt jmol-11.0.3/manifest/applet6.txt
+--- jmol-11.0.3-orig/manifest/applet6.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet6.txt 2007-05-16 01:57:46.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/viewer/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/appletMain.txt jmol-11.0.3/manifest/appletMain.txt
+--- jmol-11.0.3-orig/manifest/appletMain.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/appletMain.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,5 @@
++Manifest-Version: 1.0
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
+diff -aurN jmol-11.0.3-orig/manifest/appletMonolithic.txt jmol-11.0.3/manifest/appletMonolithic.txt
+--- jmol-11.0.3-orig/manifest/appletMonolithic.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/appletMonolithic.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,7 @@
++Main-Class: JmolApplet
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet.txt jmol-11.0.3/manifest/applet.txt
+--- jmol-11.0.3-orig/manifest/applet.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,2 @@
++Manifest-Version: 1.0
++Sealed: true
+\ No newline at end of file
+diff -aurN jmol-11.0.3-orig/manifest/application.txt jmol-11.0.3/manifest/application.txt
+--- jmol-11.0.3-orig/manifest/application.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/application.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1 @@
++Main-Class: org.openscience.jmol.app.Jmol
+diff -aurN jmol-11.0.3-orig/manifest/jvxl.txt jmol-11.0.3/manifest/jvxl.txt
+--- jmol-11.0.3-orig/manifest/jvxl.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/jvxl.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1 @@
++Main-Class: org.openscience.jvxl.Jvxl
diff --git a/sci-chemistry/jmol/files/12.0.45/jmol-nointl.patch b/sci-chemistry/jmol/files/12.0.45/jmol-nointl.patch
new file mode 100644
index 000000000000..c1b22e83c615
--- /dev/null
+++ b/sci-chemistry/jmol/files/12.0.45/jmol-nointl.patch
@@ -0,0 +1,313 @@
+--- build.xml 2011-02-25 12:59:43.000000000 -0600
++++ build.xml.new 2011-02-27 12:16:02.398959959 -0600
+@@ -110,10 +110,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolGuide.docbook.xml, guide/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolUserGuide_fr/index.html">
+- <srcfiles dir="doc/source"
+- includes="JmolGuide_fr.docbook.xml, guide/*_fr.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -123,14 +119,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolHistory.xml,JmolHistoryToHtml.xsl,history/changes.xml" />
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_fr.xml,JmolHistoryToHtml.xsl,history/changes_fr.xml" />
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_nl.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_nl.xml,JmolHistoryToHtml.xsl,history/changes_nl.xml" />
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -140,14 +128,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolDevelopersGuide.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -157,14 +137,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolAppletGuide.docbook.xml, applet/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_fr.docbook.xml, applet/*_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -385,17 +357,12 @@
+ </target>
+
+ <target name="jar" id="jar"
+- depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars,main-i18n">
++ depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars">
+ <copy todir="${classes.dir}/org/openscience/jmol/Data/guide" >
+ <fileset dir="build/doc/JmolUserGuide">
+ <include name="**/*.html" />
+ </fileset>
+ </copy>
+- <copy todir="${classes.dir}/org/openscience/jmol/Data/guide_fr" >
+- <fileset dir="build/doc/JmolUserGuide_fr">
+- <include name="**/*.html" />
+- </fileset>
+- </copy>
+ <copy todir="${classes.dir}/org/openscience/jmol/Data" >
+ <fileset dir="build/doc/JmolHistory">
+ <include name="**/*.html" />
+@@ -587,18 +554,6 @@
+ <fileset dir="${appletjars.dir}" includes="**/*"/>
+ </jar>
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <jar destfile="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- manifest="manifest/applet_i18n.txt" >
+- <fileset dir="${applet.classes.dir}">
+- <include name="org/jmol/translation/JmolApplet/@{current.Jmol.language}/**" />
+- </fileset>
+- </jar>
+- </sequential>
+- </for>
+-
+ <jar destfile="${jmol.applet.build.dir}/JmolApplet0_Minimize.jar" manifest="manifest/applet.txt">
+ <fileset dir="${applet.classes.dir}">
+ <include name="org/jmol/minimize/**" />
+@@ -712,7 +667,6 @@
+ <include name="org/jmol/bspt/**" />
+ <include name="org/jmol/g3d/**" />
+ <include name="org/jmol/geodesic/**" />
+- <include name="org/jmol/i18n/**" />
+ <include name="org/jmol/modelset/**" />
+ <include name="org/jmol/script/**" />
+ <include name="org/jmol/shape/**" />
+@@ -738,7 +692,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolApplet0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <!-- changes to this must be replicated below for the signed applet -->
+@@ -851,16 +804,6 @@
+ keystore="selfSignedCertificate/selfSignedCertificate.store"
+ storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <signjar jar="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- signedjar="${jmol.applet.build.dir}/JmolAppletSigned0_i18n_@{current.Jmol.language}.jar"
+- keystore="selfSignedCertificate/selfSignedCertificate.store"
+- storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+- </sequential>
+- </for>
+-
+ <!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
+ <!-- this one must be treated specially because of jar indexing
+ we cannot simply rename the jar file, because the index has
+@@ -906,7 +849,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolAppletSigned0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <signjar jar="${jmol.applet.build.dir}/JmolAppletSigned0.jar"
+@@ -944,18 +886,6 @@
+ </fileset>
+ </jar>
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <jar destfile="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- manifest="manifest/applet_i18n.txt" >
+- <fileset dir="${applet.classes.dir}">
+- <include name="org/jmol/translation/JmolApplet/@{current.Jmol.language}/**" />
+- </fileset>
+- </jar>
+- </sequential>
+- </for>
+-
+ <jar destfile="${jmol.applet.build.dir}/JmolApplet0_Minimize.jar" manifest="manifest/applet.txt">
+ <fileset dir="${applet.classes.dir}">
+ <include name="org/jmol/minimize/**" />
+@@ -1069,7 +999,6 @@
+ <include name="org/jmol/bspt/**" />
+ <include name="org/jmol/g3d/**" />
+ <include name="org/jmol/geodesic/**" />
+- <include name="org/jmol/i18n/**" />
+ <include name="org/jmol/modelset/**" />
+ <include name="org/jmol/script/**" />
+ <include name="org/jmol/shape/**" />
+@@ -1095,7 +1024,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolApplet0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <!-- changes to this must be replicated below for the signed applet -->
+@@ -1104,7 +1032,7 @@
+ </target>
+
+ <target name="dist" id="dist"
+- depends="doc,main-i18n,main,signed-applet">
++ depends="doc,main,signed-applet">
+ <!-- first build binary distribution -->
+ <delete dir="build/dist/jmol-${version}"/>
+ <mkdir dir="build/dist/jmol-${version}"/>
+@@ -1163,7 +1091,6 @@
+ <fileset dir=".">
+ <include name="applet.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -1246,7 +1173,6 @@
+ <fileset dir=".">
+ <include name="apisio.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -1342,7 +1268,7 @@
+ <target name="xclean" id="xclean">
+ </target>
+
+- <target name="spotless" id="spotless" depends="clean,spotless-i18n">
++ <target name="spotless" id="spotless" depends="clean">
+ <delete dir="build"/>
+ <delete dir="${javadoc.dir}"/>
+ <delete dir="packaging/rpm/dist"/>
+@@ -1406,16 +1332,6 @@
+ <arg value="../../../doc/source/JmolGuide.docbook.xml" />
+ <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+ </java>
+- <echo message="Generating user's guide (fr)" />
+- <mkdir dir="build/doc/JmolUserGuide_fr" />
+- <java fork="true" dir="build/doc/JmolUserGuide_fr"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <jvmarg value="${proxyHost}" />
+- <jvmarg value="${proxyPort}" />
+- <arg value="../../../doc/source/JmolGuide_fr.docbook.xml" />
+- <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolHistory" id="jmolHistory"
+@@ -1430,26 +1346,6 @@
+ <arg value="../../../doc/source/JmolHistory.xml" />
+ <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+ </java>
+- <echo message="Generating history of changes (fr)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_fr.html" />
+- <arg value="../../../doc/source/JmolHistory_fr.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=fr" />
+- </java>
+- <echo message="Generating history of changes (nl)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_nl.html" />
+- <arg value="../../../doc/source/JmolHistory_nl.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=nl" />
+- </java>
+ </target>
+
+ <target name="jmolDevelopersGuide" id="jmolDevelopersGuide"
+@@ -1463,24 +1359,6 @@
+ <arg value="../../doc/source/JmolDevelopersGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating developer's guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_fr.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating developer's guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_de.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolAppletGuide" id="jmolAppletGuide" depends="initdoc"
+@@ -1494,24 +1372,6 @@
+ <arg value="../../doc/source/JmolAppletGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating applet guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_fr.html" />
+- <arg value="../../doc/source/JmolAppletGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating applet guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_de.html" />
+- <arg value="../../doc/source/JmolAppletGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="test" id="test" depends="main,compile-tests">
+@@ -1543,12 +1403,4 @@
+ <jar destfile="${tests.dir}/Tests.jar" basedir="${test-classes.dir}" />
+ </target>
+
+- <!-- i18n stuff -->
+- <target name="main-i18n" depends="classes">
+- <ant antfile="tools/build-i18n.xml" target="main-i18n"/>
+- </target>
+- <target name="spotless-i18n">
+- <ant antfile="tools/build-i18n.xml" target="spotless-i18n"/>
+- </target>
+-
+ </project>
diff --git a/sci-chemistry/jmol/files/caffeine.xyz b/sci-chemistry/jmol/files/caffeine.xyz
new file mode 100644
index 000000000000..f0325b049f3c
--- /dev/null
+++ b/sci-chemistry/jmol/files/caffeine.xyz
@@ -0,0 +1,26 @@
+24
+Caffeine
+H -3.3804130 -1.1272367 0.5733036
+N 0.9668296 -1.0737425 -0.8198227
+C 0.0567293 0.8527195 0.3923156
+N -1.3751742 -1.0212243 -0.0570552
+C -1.2615018 0.2590713 0.5234135
+C -0.3068337 -1.6836331 -0.7169344
+C 1.1394235 0.1874122 -0.2700900
+N 0.5602627 2.0839095 0.8251589
+O -0.4926797 -2.8180554 -1.2094732
+C -2.6328073 -1.7303959 -0.0060953
+O -2.2301338 0.7988624 1.0899730
+H 2.5496990 2.9734977 0.6229590
+C 2.0527432 -1.7360887 -1.4931279
+H -2.4807715 -2.7269528 0.4882631
+H -3.0089039 -1.9025254 -1.0498023
+H 2.9176101 -1.8481516 -0.7857866
+H 2.3787863 -1.1211917 -2.3743655
+H 1.7189877 -2.7489920 -1.8439205
+C -0.1518450 3.0970046 1.5348347
+C 1.8934096 2.1181245 0.4193193
+N 2.2861252 0.9968439 -0.2440298
+H -0.1687028 4.0436553 0.9301094
+H 0.3535322 3.2979060 2.5177747
+H -1.2074498 2.7537592 1.7203047
diff --git a/sci-chemistry/jmol/files/index.html b/sci-chemistry/jmol/files/index.html
new file mode 100644
index 000000000000..35a5d49217e2
--- /dev/null
+++ b/sci-chemistry/jmol/files/index.html
@@ -0,0 +1,14 @@
+<html>
+ <head>
+ <title>Jmol Test Page</title>
+ <div align="center"> <b>All the Sugar and Twice the Caffeine.</b> <br><br>
+ <script src="./Jmol.js"></script>
+ </head>
+ <body>
+ <script>
+ jmolInitialize("./"); // REQUIRED
+ jmolApplet(400, "load ./caffeine.xyz");
+ </script></div>
+ </body>
+</html>
+
diff --git a/sci-chemistry/jmol/files/jmol-11.0.3-manifest.patch b/sci-chemistry/jmol/files/jmol-11.0.3-manifest.patch
new file mode 100644
index 000000000000..3b43c219d94f
--- /dev/null
+++ b/sci-chemistry/jmol/files/jmol-11.0.3-manifest.patch
@@ -0,0 +1,96 @@
+diff -aurN jmol-11.0.3-orig/manifest/applet0.txt jmol-11.0.3/manifest/applet0.txt
+--- jmol-11.0.3-orig/manifest/applet0.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet0.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,6 @@
++Main-Class: JmolApplet
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
++
+diff -aurN jmol-11.0.3-orig/manifest/applet1.txt jmol-11.0.3/manifest/applet1.txt
+--- jmol-11.0.3-orig/manifest/applet1.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet1.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,6 @@
++Name: org/jmol/api/
++Sealed: false
++
++Name: org/jmol/applet/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet2.txt jmol-11.0.3/manifest/applet2.txt
+--- jmol-11.0.3-orig/manifest/applet2.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet2.txt 2007-05-16 01:56:19.000000000 -0500
+@@ -0,0 +1,3 @@
++Name: javax/vecmath/
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet3.txt jmol-11.0.3/manifest/applet3.txt
+--- jmol-11.0.3-orig/manifest/applet3.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet3.txt 2007-05-16 01:56:47.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/g3d/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet4.txt jmol-11.0.3/manifest/applet4.txt
+--- jmol-11.0.3-orig/manifest/applet4.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet4.txt 2007-05-16 01:57:05.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/adapter/smarter/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/applet5.txt jmol-11.0.3/manifest/applet5.txt
+--- jmol-11.0.3-orig/manifest/applet5.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet5.txt 2007-05-16 01:57:23.000000000 -0500
+@@ -0,0 +1,4 @@
++Name: org/openscience/jmol/ui/
++Sealed: true
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet6.txt jmol-11.0.3/manifest/applet6.txt
+--- jmol-11.0.3-orig/manifest/applet6.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet6.txt 2007-05-16 01:57:46.000000000 -0500
+@@ -0,0 +1,4 @@
++
++Name: org/jmol/viewer/
++Sealed: true
++
+diff -aurN jmol-11.0.3-orig/manifest/appletMain.txt jmol-11.0.3/manifest/appletMain.txt
+--- jmol-11.0.3-orig/manifest/appletMain.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/appletMain.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,5 @@
++Manifest-Version: 1.0
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
+diff -aurN jmol-11.0.3-orig/manifest/appletMonolithic.txt jmol-11.0.3/manifest/appletMonolithic.txt
+--- jmol-11.0.3-orig/manifest/appletMonolithic.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/appletMonolithic.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,7 @@
++Main-Class: JmolApplet
++Sealed: true
++
++Name: org/jmol/api/
++Sealed: false
++
++
+diff -aurN jmol-11.0.3-orig/manifest/applet.txt jmol-11.0.3/manifest/applet.txt
+--- jmol-11.0.3-orig/manifest/applet.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/applet.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1,2 @@
++Manifest-Version: 1.0
++Sealed: true
+\ No newline at end of file
+diff -aurN jmol-11.0.3-orig/manifest/application.txt jmol-11.0.3/manifest/application.txt
+--- jmol-11.0.3-orig/manifest/application.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/application.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1 @@
++Main-Class: org.openscience.jmol.app.Jmol
+diff -aurN jmol-11.0.3-orig/manifest/jvxl.txt jmol-11.0.3/manifest/jvxl.txt
+--- jmol-11.0.3-orig/manifest/jvxl.txt 1969-12-31 18:00:00.000000000 -0600
++++ jmol-11.0.3/manifest/jvxl.txt 2007-05-16 01:54:10.000000000 -0500
+@@ -0,0 +1 @@
++Main-Class: org.openscience.jvxl.Jvxl
diff --git a/sci-chemistry/jmol/files/jmol-11.0.3-nointl.patch b/sci-chemistry/jmol/files/jmol-11.0.3-nointl.patch
new file mode 100644
index 000000000000..25fd17e36c68
--- /dev/null
+++ b/sci-chemistry/jmol/files/jmol-11.0.3-nointl.patch
@@ -0,0 +1,266 @@
+--- jmol-11.0.3-orig/build.xml 2007-05-17 09:35:04.000000000 -0500
++++ jmol-11.0.3/build.xml 2007-05-17 09:40:21.000000000 -0500
+@@ -100,10 +100,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolGuide.docbook.xml, guide/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolUserGuide_fr/index.html">
+- <srcfiles dir="doc/source"
+- includes="JmolGuide_fr.docbook.xml, guide/*_fr.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -113,14 +109,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolHistory.xml,JmolHistoryToHtml.xsl,history/changes.xml" />
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_fr.xml,JmolHistoryToHtml.xsl,history/changes_fr.xml" />
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_nl.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_nl.xml,JmolHistoryToHtml.xsl,history/changes_nl.xml" />
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -130,14 +118,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolDevelopersGuide.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -147,14 +127,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolAppletGuide.docbook.xml, applet/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_fr.docbook.xml, applet/*_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -332,17 +304,12 @@
+ </target>
+
+ <target name="jar" id="jar"
+- depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars,main-i18n">
++ depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars">
+ <copy todir="${classes.dir}/org/openscience/jmol/Data/guide" >
+ <fileset dir="build/doc/JmolUserGuide">
+ <include name="**/*.html" />
+ </fileset>
+ </copy>
+- <copy todir="${classes.dir}/org/openscience/jmol/Data/guide_fr" >
+- <fileset dir="build/doc/JmolUserGuide_fr">
+- <include name="**/*.html" />
+- </fileset>
+- </copy>
+ <copy todir="${classes.dir}/org/openscience/jmol/Data" >
+ <fileset dir="build/doc/JmolHistory">
+ <include name="**/*.html" />
+@@ -462,7 +429,6 @@
+ <!-- note that this class is included in JmolApplet0.jar -->
+ <exclude name="org/jmol/api/JmolAppletInterface.class" />
+ <include name="org/jmol/applet/**" />
+- <include name="org/jmol/i18n/**" />
+ <include name="org/jmol/popup/**" />
+ </fileset>
+ </jar>
+@@ -502,12 +468,6 @@
+ </fileset>
+ </jar>
+
+- <jar destfile="${jmol.applet.build.dir}/JmolApplet_i18n.jar" manifest="manifest/applet_i18n.txt" >
+- <fileset dir="${applet.classes.dir}">
+- <include name="org/jmol/translation/**" />
+- </fileset>
+- </jar>
+-
+ <!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
+ <!-- changes to this must be replicated below for the signed applet -->
+ <jar destfile="${jmol.applet.build.dir}/JmolApplet0.jar"
+@@ -527,7 +487,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet4.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet5.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet6.jar" />
+- <pathelement path="${jmol.applet.build.dir}/JmolApplet_i18n.jar" />
+ </indexjars>
+ </jar>
+ <!-- changes to this must be replicated below for the signed applet -->
+@@ -564,10 +523,6 @@
+ signedjar="${jmol.applet.build.dir}/JmolAppletSigned6.jar"
+ keystore="selfSignedCertificate/selfSignedCertificate.store"
+ storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+- <signjar jar="${jmol.applet.build.dir}/JmolApplet_i18n.jar"
+- signedjar="${jmol.applet.build.dir}/JmolAppletSigned_i18n.jar"
+- keystore="selfSignedCertificate/selfSignedCertificate.store"
+- storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+
+ <!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
+ <!-- this one must be treated specially because of jar indexing
+@@ -589,7 +544,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned4.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned5.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned6.jar" />
+- <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned_i18n.jar" />
+ </indexjars>
+ </jar>
+ <signjar jar="${jmol.applet.build.dir}/JmolAppletSigned0.jar"
+@@ -599,7 +553,7 @@
+ </target>
+
+ <target name="dist" id="dist"
+- depends="doc,main-i18n,main,signed-applet">
++ depends="doc,main,signed-applet">
+ <!-- first build binary distribution -->
+ <delete dir="build/dist/jmol-${version}"/>
+ <mkdir dir="build/dist/jmol-${version}"/>
+@@ -655,7 +609,6 @@
+ <fileset dir=".">
+ <include name="applet.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -744,7 +697,6 @@
+ <fileset dir=".">
+ <include name="apisio.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -839,7 +791,7 @@
+ <target name="xclean" id="xclean">
+ </target>
+
+- <target name="spotless" id="spotless" depends="clean,spotless-i18n">
++ <target name="spotless" id="spotless" depends="clean">
+ <delete dir="build"/>
+ <delete dir="${javadoc.dir}"/>
+ <delete dir="packaging/rpm/dist"/>
+@@ -900,16 +852,6 @@
+ <arg value="../../../doc/source/JmolGuide.docbook.xml" />
+ <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+ </java>
+- <echo message="Generating user's guide (fr)" />
+- <mkdir dir="build/doc/JmolUserGuide_fr" />
+- <java fork="true" dir="build/doc/JmolUserGuide_fr"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <jvmarg value="${proxyHost}" />
+- <jvmarg value="${proxyPort}" />
+- <arg value="../../../doc/source/JmolGuide_fr.docbook.xml" />
+- <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolHistory" id="jmolHistory"
+@@ -924,26 +866,6 @@
+ <arg value="../../../doc/source/JmolHistory.xml" />
+ <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+ </java>
+- <echo message="Generating history of changes (fr)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_fr.html" />
+- <arg value="../../../doc/source/JmolHistory_fr.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=fr" />
+- </java>
+- <echo message="Generating history of changes (nl)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_nl.html" />
+- <arg value="../../../doc/source/JmolHistory_nl.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=nl" />
+- </java>
+ </target>
+
+ <target name="jmolDevelopersGuide" id="jmolDevelopersGuide"
+@@ -957,24 +879,6 @@
+ <arg value="../../doc/source/JmolDevelopersGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating developer's guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_fr.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating developer's guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_de.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolAppletGuide" id="jmolAppletGuide" depends="initdoc"
+@@ -988,24 +892,6 @@
+ <arg value="../../doc/source/JmolAppletGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating applet guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_fr.html" />
+- <arg value="../../doc/source/JmolAppletGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating applet guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_de.html" />
+- <arg value="../../doc/source/JmolAppletGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="test" id="test" depends="main,compile-tests">
+@@ -1036,12 +922,4 @@
+ <jar destfile="${tests.dir}/Tests.jar" basedir="${test-classes.dir}" />
+ </target>
+
+- <!-- i18n stuff -->
+- <target name="main-i18n" depends="classes">
+- <ant antfile="build-i18n.xml" target="main-i18n"/>
+- </target>
+- <target name="spotless-i18n">
+- <ant antfile="build-i18n.xml" target="spotless-i18n"/>
+- </target>
+-
+ </project>
diff --git a/sci-chemistry/jmol/files/jmol-12.2.27-nointl.patch b/sci-chemistry/jmol/files/jmol-12.2.27-nointl.patch
new file mode 100644
index 000000000000..0a43faaf653d
--- /dev/null
+++ b/sci-chemistry/jmol/files/jmol-12.2.27-nointl.patch
@@ -0,0 +1,330 @@
+--- orig-build.xml 2012-05-31 13:42:43.943062427 -0500
++++ build.xml 2012-05-31 14:01:01.691982062 -0500
+@@ -52,8 +52,6 @@
+
+ <property file="proxy.properties" />
+
+- <import file="tools/build-i18n.xml"/>
+-
+ <path id="project.class.path">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar" />
+@@ -111,10 +109,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolGuide.docbook.xml, guide/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolUserGuide_fr/index.html">
+- <srcfiles dir="doc/source"
+- includes="JmolGuide_fr.docbook.xml, guide/*_fr.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -124,14 +118,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolHistory.xml,JmolHistoryToHtml.xsl,history/changes.xml" />
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_fr.xml,JmolHistoryToHtml.xsl,history/changes_fr.xml" />
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolHistory/ChangeLog_nl.html">
+- <srcfiles dir="doc/source"
+- includes="JmolHistory_nl.xml,JmolHistoryToHtml.xsl,history/changes_nl.xml" />
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -141,14 +127,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolDevelopersGuide.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolDevelopersGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolDevelopersGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -158,14 +136,6 @@
+ <srcfiles dir="doc/source"
+ includes="JmolAppletGuide.docbook.xml, applet/*.docbook.xml"/>
+ </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_fr.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_fr.docbook.xml, applet/*_fr.docbook.xml"/>
+- </uptodate>
+- <uptodate targetfile="build/doc/JmolAppletGuide_de.html">
+- <srcfiles dir="doc/source"
+- includes="JmolAppletGuide_de.docbook.xml"/>
+- </uptodate>
+ </and>
+ </condition>
+
+@@ -388,17 +358,12 @@
+ </target>
+
+ <target name="jar" id="jar"
+- depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars,main-i18n">
++ depends="init,classes,jmolGuide,jmolHistory,jmolDevelopersGuide,libjars">
+ <copy todir="${classes.dir}/org/openscience/jmol/Data/guide" >
+ <fileset dir="build/doc/JmolUserGuide">
+ <include name="**/*.html" />
+ </fileset>
+ </copy>
+- <copy todir="${classes.dir}/org/openscience/jmol/Data/guide_fr" >
+- <fileset dir="build/doc/JmolUserGuide_fr">
+- <include name="**/*.html" />
+- </fileset>
+- </copy>
+ <copy todir="${classes.dir}/org/openscience/jmol/Data" >
+ <fileset dir="build/doc/JmolHistory">
+ <include name="**/*.html" />
+@@ -603,18 +568,6 @@
+ <fileset dir="${appletjars.dir}" includes="**/*"/>
+ </jar>
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <jar destfile="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- manifest="manifest/applet_i18n.txt" >
+- <fileset dir="${applet.classes.dir}">
+- <include name="org/jmol/translation/JmolApplet/@{current.Jmol.language}/**" />
+- </fileset>
+- </jar>
+- </sequential>
+- </for>
+-
+ <jar destfile="${jmol.applet.build.dir}/JmolApplet0_Minimize.jar" manifest="manifest/applet.txt">
+ <fileset dir="${applet.classes.dir}">
+ <include name="org/jmol/minimize/**" />
+@@ -729,7 +682,6 @@
+ <include name="org/jmol/constant/**" />
+ <include name="org/jmol/g3d/**" />
+ <include name="org/jmol/geodesic/**" />
+- <include name="org/jmol/i18n/**" />
+ <include name="org/jmol/modelset/**" />
+ <include name="org/jmol/script/**" />
+ <include name="org/jmol/shape/**" />
+@@ -755,7 +707,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolApplet0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <!-- changes to this must be replicated below for the signed applet -->
+@@ -868,16 +819,6 @@
+ keystore="selfSignedCertificate/selfSignedCertificate.store"
+ storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <signjar jar="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- signedjar="${jmol.applet.build.dir}/JmolAppletSigned0_i18n_@{current.Jmol.language}.jar"
+- keystore="selfSignedCertificate/selfSignedCertificate.store"
+- storepass="selfSignedCertificate" alias="selfSignedCertificate" />
+- </sequential>
+- </for>
+-
+ <!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
+ <!-- this one must be treated specially because of jar indexing
+ we cannot simply rename the jar file, because the index has
+@@ -905,7 +846,6 @@
+ <include name="org/jmol/shape/**" />
+ <include name="org/jmol/viewer/**" />
+ <include name="org/jmol/util/**" />
+- <include name="org/jmol/i18n/**" />
+ </fileset>
+ <indexjars>
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_Console.jar" />
+@@ -924,7 +864,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolAppletSigned0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolAppletSigned0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <signjar jar="${jmol.applet.build.dir}/JmolAppletSigned0.jar"
+@@ -963,18 +902,6 @@
+ </fileset>
+ </jar>
+
+- <for list="${all.JmolApplet.languages}" delimiter=","
+- param="current.Jmol.language">
+- <sequential>
+- <jar destfile="${jmol.applet.build.dir}/JmolApplet0_i18n_@{current.Jmol.language}.jar"
+- manifest="manifest/applet_i18n.txt" >
+- <fileset dir="${applet.classes.dir}">
+- <include name="org/jmol/translation/JmolApplet/@{current.Jmol.language}/**" />
+- </fileset>
+- </jar>
+- </sequential>
+- </for>
+-
+ <jar destfile="${jmol.applet.build.dir}/JmolApplet0_Minimize.jar" manifest="manifest/applet.txt">
+ <fileset dir="${applet.classes.dir}">
+ <include name="org/jmol/minimize/**" />
+@@ -1088,7 +1015,6 @@
+ <include name="org/jmol/constant/**" />
+ <include name="org/jmol/g3d/**" />
+ <include name="org/jmol/geodesic/**" />
+- <include name="org/jmol/i18n/**" />
+ <include name="org/jmol/modelset/**" />
+ <include name="org/jmol/script/**" />
+ <include name="org/jmol/shape/**" />
+@@ -1114,7 +1040,6 @@
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_ShapeSurface.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Smiles.jar" />
+ <pathelement path="${jmol.applet.build.dir}/JmolApplet0_Symmetry.jar" />
+- <fileset dir="${jmol.applet.build.dir}" includes="JmolApplet0_i18n_*.jar" />
+ </indexjars>
+ </jar>
+ <!-- changes to this must be replicated below for the signed applet -->
+@@ -1123,7 +1048,7 @@
+ </target>
+
+ <target name="dist" id="dist"
+- depends="doc,main-i18n,main,signed-applet">
++ depends="doc,main,signed-applet">
+ <!-- first build binary distribution -->
+ <delete dir="build/dist/jmol-${version}"/>
+ <mkdir dir="build/dist/jmol-${version}"/>
+@@ -1183,7 +1108,6 @@
+ <fileset dir=".">
+ <include name="applet.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -1278,7 +1202,6 @@
+ <fileset dir=".">
+ <include name="apisio.classes" />
+ <include name="build.xml" />
+- <include name="build-i18n.xml" />
+ </fileset>
+ </copy>
+
+@@ -1374,7 +1297,7 @@
+ <target name="xclean" id="xclean">
+ </target>
+
+- <target name="spotless" id="spotless" depends="clean,spotless-i18n">
++ <target name="spotless" id="spotless" depends="clean">
+ <delete dir="build"/>
+ <delete dir="${javadoc.dir}"/>
+ <delete dir="packaging/rpm/dist"/>
+@@ -1438,16 +1361,6 @@
+ <arg value="../../../doc/source/JmolGuide.docbook.xml" />
+ <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+ </java>
+- <echo message="Generating user's guide (fr)" />
+- <mkdir dir="build/doc/JmolUserGuide_fr" />
+- <java fork="true" dir="build/doc/JmolUserGuide_fr"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <jvmarg value="${proxyHost}" />
+- <jvmarg value="${proxyPort}" />
+- <arg value="../../../doc/source/JmolGuide_fr.docbook.xml" />
+- <arg value="../../${docbook-xsl}/html/chunk.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolHistory" id="jmolHistory"
+@@ -1462,26 +1375,6 @@
+ <arg value="../../../doc/source/JmolHistory.xml" />
+ <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+ </java>
+- <echo message="Generating history of changes (fr)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_fr.html" />
+- <arg value="../../../doc/source/JmolHistory_fr.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=fr" />
+- </java>
+- <echo message="Generating history of changes (nl)" />
+- <java fork="true" dir="build/doc/JmolHistory"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="ChangeLog_nl.html" />
+- <arg value="../../../doc/source/JmolHistory_nl.xml" />
+- <arg value="../../../doc/source/JmolHistoryToHtml.xsl" />
+- <arg value="lang=nl" />
+- </java>
+ </target>
+
+ <target name="jmolDevelopersGuide" id="jmolDevelopersGuide"
+@@ -1495,24 +1388,6 @@
+ <arg value="../../doc/source/JmolDevelopersGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating developer's guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_fr.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating developer's guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolDevelopersGuide_de.html" />
+- <arg value="../../doc/source/JmolDevelopersGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="jmolAppletGuide" id="jmolAppletGuide" depends="initdoc"
+@@ -1526,24 +1401,6 @@
+ <arg value="../../doc/source/JmolAppletGuide.docbook.xml" />
+ <arg value="../${docbook-xsl}/html/docbook.xsl" />
+ </java>
+- <echo message="Generating applet guide (fr)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_fr.html" />
+- <arg value="../../doc/source/JmolAppletGuide_fr.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+- <echo message="Generating applet guide (de)" />
+- <java fork="true" dir="build/doc"
+- classname="com.icl.saxon.StyleSheet"
+- classpath="${lib.dir}/saxon.jar" >
+- <arg value="-o" />
+- <arg value="JmolAppletGuide_de.html" />
+- <arg value="../../doc/source/JmolAppletGuide_de.docbook.xml" />
+- <arg value="../${docbook-xsl}/html/docbook.xsl" />
+- </java>
+ </target>
+
+ <target name="test" id="test" depends="main,compile-tests">
+@@ -1575,12 +1432,4 @@
+ <jar destfile="${tests.dir}/Tests.jar" basedir="${test-classes.dir}" />
+ </target>
+
+- <!-- i18n stuff -->
+- <target name="main-i18n" depends="classes">
+- <ant antfile="tools/build-i18n.xml" target="main-i18n"/>
+- </target>
+- <target name="spotless-i18n">
+- <ant antfile="tools/build-i18n.xml" target="spotless-i18n"/>
+- </target>
+-
+ </project>
diff --git a/sci-chemistry/jmol/jmol-12.0.45-r1.ebuild b/sci-chemistry/jmol/jmol-12.0.45-r1.ebuild
new file mode 100644
index 000000000000..0112130458e2
--- /dev/null
+++ b/sci-chemistry/jmol/jmol-12.0.45-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+WEBAPP_OPTIONAL="yes"
+
+inherit eutils webapp java-pkg-2 java-ant-2
+
+MY_P=Jmol
+
+DESCRIPTION="Java molecular viever for 3-D chemical structures"
+HOMEPAGE="http://jmol.sourceforge.net/"
+SRC_URI="
+ mirror://sourceforge/${PN}/${MY_P}-${PV}-full.tar.gz
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-selfSignedCertificate.store.tar"
+
+WEBAPP_MANUAL_SLOT="yes"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+LICENSE="LGPL-2.1"
+IUSE="client-only vhosts"
+
+COMMON_DEP="
+ dev-java/commons-cli:1
+ dev-java/itext:0
+ sci-libs/jmol-acme:0
+ sci-libs/vecmath-objectclub:0"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON_DEP}"
+DEPEND=">=virtual/jdk-1.4
+ !client-only? ( ${WEBAPP_DEPEND} )
+ ${COMMON_DEP}"
+
+pkg_setup() {
+ use client-only || webapp_pkg_setup
+ java-pkg-2_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}/${PN}-nointl.patch \
+ "${FILESDIR}"/${PV}/${PN}-manifest.patch
+
+ mkdir "${S}"/selfSignedCertificate || die "Failed to create Cert directory."
+ cp "${WORKDIR}"/selfSignedCertificate.store "${S}"/selfSignedCertificate/ \
+ || die "Failed to install Cert file."
+
+ rm -v "${S}"/*.jar "${S}"/plugin-jars/*.jar || die
+ cd "${S}/jars"
+
+# We still have to use netscape.jar on amd64 until a nice way to include plugin.jar comes along.
+ if use amd64; then
+ mv -v netscape.jar netscape.tempjar || die "Failed to move netscape.jar."
+ rm -v *.jar *.tar.gz || die "Failed to remove jars."
+ mv -v netscape.tempjar netscape.jar || die "Failed to move netscape.tempjar."
+ fi
+
+ java-pkg_jar-from vecmath-objectclub vecmath-objectclub.jar vecmath1.2-1.14.jar
+ java-pkg_jar-from itext iText.jar itext-1.4.5.jar
+ java-pkg_jar-from jmol-acme jmol-acme.jar Acme.jar
+ java-pkg_jar-from commons-cli-1 commons-cli.jar commons-cli-1.0.jar
+
+ mkdir -p "${S}/build/appjars" || die
+}
+
+src_compile() {
+ # prevent absorbing dep's classes
+ eant -Dlibjars.uptodate=true main
+}
+
+src_install() {
+ java-pkg_dojar build/Jmol.jar
+ dohtml -r build/doc/* || die "Failed to install html docs."
+ dodoc *.txt doc/*license* || die "Failed to install licenses."
+
+ java-pkg_dolauncher ${PN} --main org.openscience.jmol.app.Jmol \
+ --java_args "-Xmx512m"
+
+ if ! use client-only ; then
+ webapp_src_preinst
+ cp Jmol.js build/Jmol.jar "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp build/JmolApplet*.jar "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp applet.classes "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp -r build/classes/* "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp -r build/appletjars/* "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp "${FILESDIR}"/caffeine.xyz "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp "${FILESDIR}"/index.html "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+
+ webapp_src_install
+ fi
+}
+
+pkg_postinst() {
+ use client-only || webapp_pkg_postinst
+}
+
+pkg_prerm() {
+ use client-only || webapp_pkg_prerm
+}
diff --git a/sci-chemistry/jmol/jmol-12.2.27-r1.ebuild b/sci-chemistry/jmol/jmol-12.2.27-r1.ebuild
new file mode 100644
index 000000000000..0e48dbb2d725
--- /dev/null
+++ b/sci-chemistry/jmol/jmol-12.2.27-r1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+WEBAPP_OPTIONAL="yes"
+
+inherit eutils webapp java-pkg-2 java-ant-2
+
+MY_P=Jmol
+
+DESCRIPTION="Java molecular viever for 3-D chemical structures"
+HOMEPAGE="http://jmol.sourceforge.net/"
+SRC_URI="
+ mirror://sourceforge/${PN}/${MY_P}-${PV}-full.tar.gz
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-selfSignedCertificate.store.tar"
+
+LICENSE="LGPL-2.1"
+KEYWORDS="~x86 ~amd64"
+IUSE="+client-only vhosts"
+
+WEBAPP_MANUAL_SLOT="yes"
+SLOT="0"
+
+COMMON_DEP="
+ dev-java/commons-cli:1
+ dev-java/itext:0
+ sci-libs/jmol-acme:0
+ sci-libs/vecmath-objectclub:0
+ sci-libs/naga"
+RDEPEND=">=virtual/jre-1.5
+ ${COMMON_DEP}"
+DEPEND=">=virtual/jdk-1.5
+ dev-java/saxon:6.5
+ !client-only? ( ${WEBAPP_DEPEND} )
+ ${COMMON_DEP}"
+
+pkg_setup() {
+ use client-only || webapp_pkg_setup
+ java-pkg-2_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-nointl.patch
+
+ rm -v "${S}"/*.jar "${S}"/plugin-jars/*.jar || die
+ cd "${S}/jars"
+
+# We still have to use netscape.jar on amd64 until a nice way to include plugin.jar comes along.
+ if use amd64; then
+ mv -v netscape.jar netscape.tempjar || die "Failed to move netscape.jar."
+ rm -v *.jar *.tar.gz || die "Failed to remove jars."
+ mv -v netscape.tempjar netscape.jar || die "Failed to move netscape.tempjar."
+ fi
+
+ java-pkg_jar-from vecmath-objectclub vecmath-objectclub.jar vecmath1.2-1.14.jar
+ java-pkg_jar-from itext iText.jar itext-1.4.5.jar
+ java-pkg_jar-from jmol-acme jmol-acme.jar Acme.jar
+ java-pkg_jar-from commons-cli-1 commons-cli.jar commons-cli-1.0.jar
+ java-pkg_jar-from naga
+ java-pkg_jar-from --build-only saxon-6.5 saxon.jar
+
+ mkdir -p "${S}/build/appjars" || die
+}
+
+src_compile() {
+ # prevent absorbing dep's classes
+ eant -Dlibjars.uptodate=true main
+}
+
+src_install() {
+ java-pkg_dojar build/Jmol.jar
+ dohtml -r build/doc/* || die "Failed to install html docs."
+ dodoc *.txt doc/*license* || die "Failed to install licenses."
+
+ java-pkg_dolauncher ${PN} --main org.openscience.jmol.app.Jmol \
+ --java_args "-Xmx512m"
+
+ if ! use client-only ; then
+ webapp_src_preinst
+ cp Jmol.js build/Jmol.jar "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp build/JmolApplet*.jar "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp applet.classes "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp -r build/classes/* "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp -r build/appletjars/* "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp "${FILESDIR}"/caffeine.xyz "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+ cp "${FILESDIR}"/index.html "${ED}"${MY_HTDOCSDIR} || die "${cmd} failed."
+
+ webapp_src_install
+ fi
+}
+
+pkg_postinst() {
+ use client-only || webapp_pkg_postinst
+}
+
+pkg_prerm() {
+ use client-only || webapp_pkg_prerm
+}
diff --git a/sci-chemistry/jmol/metadata.xml b/sci-chemistry/jmol/metadata.xml
new file mode 100644
index 000000000000..9e4d1db2e0a2
--- /dev/null
+++ b/sci-chemistry/jmol/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-chemistry</herd>
+ <maintainer>
+ <email>je_fro@gentoo.org</email>
+ <name>Jeff Gardner</name>
+ </maintainer>
+ <use>
+ <flag name="client-only">Install the viewer only, no applet files for httpd
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">jmol</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/ksdssp/Manifest b/sci-chemistry/ksdssp/Manifest
new file mode 100644
index 000000000000..c0946b22157e
--- /dev/null
+++ b/sci-chemistry/ksdssp/Manifest
@@ -0,0 +1 @@
+DIST ksdssp-040728.shar 104347 SHA256 0e47de4147724035519f9e845724407c472b99219bbb41c35f3ae1150ae8ef4c SHA512 17c32bea1f32acfd31353d0378fe2a664a8922db8b929da4b9b10ac279013946911acd2a26ab3ab227ae160352c8313dcf742fae8c139a90ac11f772f17a1689 WHIRLPOOL a5f70b8268150388ec1e21e798c4e651b19503293f08ca581a9a9d73e9ffd40c1472988c12bcbac53bdbae5e1557a27f1a2846b28b96bc338500592cc6604748
diff --git a/sci-chemistry/ksdssp/ksdssp-040728-r1.ebuild b/sci-chemistry/ksdssp/ksdssp-040728-r1.ebuild
new file mode 100644
index 000000000000..e3d856999d94
--- /dev/null
+++ b/sci-chemistry/ksdssp/ksdssp-040728-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs
+
+DESCRIPTION="An open source implementation of sci-chemistry/dssp"
+HOMEPAGE="http://www.cgl.ucsf.edu/Overview/software.html"
+SRC_URI="mirror://gentoo/${P}.shar"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sci-libs/libpdb++"
+DEPEND="${RDEPEND}
+ app-arch/sharutils"
+
+S="${WORKDIR}"/${PN}
+
+src_unpack() {
+ "${EPREFIX}/usr/bin/unshar" "${DISTDIR}"/${A} || die
+}
+
+src_compile() {
+ emake \
+ CXX="$(tc-getCXX)" \
+ PDBINCDIR="${EPREFIX}/usr/include/libpdb++" \
+ BINDIR="${EPREFIX}/usr/bin" \
+ .TARGET="${PN}.csh" \
+ .CURDIR="${S}" \
+ CC="$(tc-getCXX)" \
+ LINKER="$(tc-getCXX)" \
+ OPT="${CXXFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ ${PN} ${PN}.csh
+}
+
+src_install() {
+ dobin ${PN}{,.csh}
+ dodoc README
+ dohtml ${PN}.html
+ doman ${PN}.1
+}
diff --git a/sci-chemistry/ksdssp/ksdssp-040728.ebuild b/sci-chemistry/ksdssp/ksdssp-040728.ebuild
new file mode 100644
index 000000000000..3910b349697c
--- /dev/null
+++ b/sci-chemistry/ksdssp/ksdssp-040728.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs
+
+DESCRIPTION="ksdssp is an open source implementation of dssp"
+HOMEPAGE="http://www.cgl.ucsf.edu/Overview/software.html"
+SRC_URI="mirror://gentoo/${P}.shar"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD"
+IUSE=""
+
+RDEPEND="sci-libs/libpdb++"
+DEPEND="
+ ${RDEPEND}
+ app-arch/sharutils"
+
+S="${WORKDIR}"/${PN}
+
+src_unpack() {
+ "${EPREFIX}"/usr/bin/unshar "${DISTDIR}"/${A}
+}
+
+src_compile() {
+ emake \
+ CXX="$(tc-getCXX)" \
+ PDBINCDIR="${EPREFIX}/usr/include/libpdb++" \
+ BINDIR="${EPREFIX}/usr/bin" \
+ .TARGET="${PN}.csh" \
+ .CURDIR="${S}" \
+ CC="$(tc-getCXX)" \
+ LINKER="$(tc-getCXX)" \
+ OPT="${CXXFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ ${PN} ${PN}.csh
+}
+
+src_install() {
+ dobin ${PN}{,.csh}
+}
diff --git a/sci-chemistry/ksdssp/metadata.xml b/sci-chemistry/ksdssp/metadata.xml
new file mode 100644
index 000000000000..1837bbc07a6e
--- /dev/null
+++ b/sci-chemistry/ksdssp/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/makecif/Manifest b/sci-chemistry/makecif/Manifest
new file mode 100644
index 000000000000..b489a33454fd
--- /dev/null
+++ b/sci-chemistry/makecif/Manifest
@@ -0,0 +1 @@
+DIST makecif-5.6.6.tar.gz 3797710 SHA256 fdcc1bee70583da3161f0d46eb792d965c04f08f0ad3033f730486550e859d1f SHA512 874c69d85b55ef22057c1113418218d7fd0a1e795f04673f3d64cd015230ab47ad8bdb0277ca9b389cc3edf397dc63c2c1cdd35837a86bc5d2a595d9ae534dbc WHIRLPOOL 5ecc1f7d06445d34e1d5d97ad98fd4c9d21db1e1611a9d89e25f0228a7b2cce5fa631b470687b3e6f7085c932cee6c5d8d4da2e6473406a22d63a26645f56be7
diff --git a/sci-chemistry/makecif/files/5.6.6-makefile.patch b/sci-chemistry/makecif/files/5.6.6-makefile.patch
new file mode 100644
index 000000000000..186abb92b7d8
--- /dev/null
+++ b/sci-chemistry/makecif/files/5.6.6-makefile.patch
@@ -0,0 +1,49 @@
+diff --git a/src/makefile b/src/makefile
+index 6c8264a..acdec20 100755
+--- a/src/makefile
++++ b/src/makefile
+@@ -22,6 +22,8 @@ MAKEDIC = $(MAKECIF)/dic/
+ # setenv BLANC_FORT "f77 -O1"
+ #
+
++all: makecif_all libcheck_all modcheck_all emin_all
++
+ clean:
+ rm -f temp_makecif_path.fh
+ rm -f ../bin/*
+@@ -118,7 +120,7 @@ makecif.o: makecif.f lib_com.fh crd_com.fh
+ $(BLANC_FORT) -c makecif.f
+
+ mkcif: main_makecif.o make_lib11.o make_lib12.o make_lib2.o make_vdw.o make_CIF.o make_crd1.o make_crd2.o make_new1.o make_new2.o make_rst1.o make_rst2.o make_PDB.o makecif.o make_unix.o make_subr_2.o make_subr.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o libcheck.o
+- $(BLANC_FORT) -o ../bin/makecif main_makecif.o makecif.o make_vdw.o make_CIF.o make_PDB.o make_crd1.o make_crd2.o make_new1.o make_new2.o make_rst1.o make_rst2.o make_unix.o make_subr_2.o make_subr.o make_lib11.o make_lib12.o make_lib2.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o libcheck.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/makecif main_makecif.o makecif.o make_vdw.o make_CIF.o make_PDB.o make_crd1.o make_crd2.o make_new1.o make_new2.o make_rst1.o make_rst2.o make_unix.o make_subr_2.o make_subr.o make_lib11.o make_lib12.o make_lib2.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o libcheck.o
+ # -------------
+ libcheck.o: libcheck.f lib_com.fh crd_com.fh
+ $(BLANC_FORT) -c libcheck.f
+@@ -130,7 +132,7 @@ main_libcheck.o: main_libcheck.f libcheck_version.fh
+ $(BLANC_FORT) -c main_libcheck.f
+
+ lbcheck: main_libcheck.o make_subr_2.o make_subr.o make_lib11.o make_lib12.o make_lib2.o libcheck.o make_PDB.o make_CIF.o make_new1.o make_new2.o make_crd1.o make_crd2.o make_unix.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o
+- $(BLANC_FORT) -o ../bin/libcheck main_libcheck.o libcheck.o make_PDB.o make_CIF.o make_new1.o make_new2.o make_crd1.o make_crd2.o make_lib11.o make_lib12.o make_lib2.o make_unix.o make_subr_2.o make_subr.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/libcheck main_libcheck.o libcheck.o make_PDB.o make_CIF.o make_new1.o make_new2.o make_crd1.o make_crd2.o make_lib11.o make_lib12.o make_lib2.o make_unix.o make_subr_2.o make_subr.o set_num.o vdw_flexible.o emin.o libcheck_min.o math_refmac.o iheap_sort.o cell_symm_subrs.o subnumrec.o mol2_file.o sdf_files.o
+ # ------------
+
+ emin.o: emin.f crd_com.fh atom_com.fh
+@@ -143,7 +145,7 @@ main_emin.o: main_emin.f
+ $(BLANC_FORT) -c main_emin.f
+
+ emn: main_emin.o emin_new.o angle_subr.o make_unix.o make_CIF.o make_subr_2.o make_subr.o
+- $(BLANC_FORT) -o ../bin/emin main_emin.o emin_new.o make_CIF.o angle_subr.o make_unix.o make_subr_2.o make_subr.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/emin main_emin.o emin_new.o make_CIF.o angle_subr.o make_unix.o make_subr_2.o make_subr.o
+
+ # -------------
+
+@@ -155,7 +157,7 @@ main_modcheck.o: main_modcheck.f
+ $(BLANC_FORT) -c main_modcheck.f
+
+ mdcheck: main_modcheck.o modcheck.o mod_subr.o make_CIF.o make_unix.o make_subr_2.o make_subr.o
+- $(BLANC_FORT) -o ../bin/modcheck main_modcheck.o make_CIF.o modcheck.o mod_subr.o make_unix.o make_subr_2.o make_subr.o
++ $(BLANC_FORT) ${LDFLAGS} -o ../bin/modcheck main_modcheck.o make_CIF.o modcheck.o mod_subr.o make_unix.o make_subr_2.o make_subr.o
+
+
+ # ======================================
diff --git a/sci-chemistry/makecif/makecif-5.6.6-r1.ebuild b/sci-chemistry/makecif/makecif-5.6.6-r1.ebuild
new file mode 100644
index 000000000000..509117f300af
--- /dev/null
+++ b/sci-chemistry/makecif/makecif-5.6.6-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 toolchain-funcs
+
+DESCRIPTION="PDB --> CIF convertor"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/makecif.html"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+LICENSE="ccp4"
+IUSE=""
+
+S="${WORKDIR}"/${PN}
+
+DEPEND=""
+RDEPEND="
+ !>=sci-chemistry/refmac-5.6
+ sci-libs/monomer-db"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-makefile.patch
+}
+
+src_compile() {
+ emake -C src clean
+ emake \
+ -C src \
+ BLANC_FORT="$(tc-getFC) ${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dobin bin/*
+ dodoc readme
+}
diff --git a/sci-chemistry/makecif/makecif-5.6.6.ebuild b/sci-chemistry/makecif/makecif-5.6.6.ebuild
new file mode 100644
index 000000000000..3a5f70a8b259
--- /dev/null
+++ b/sci-chemistry/makecif/makecif-5.6.6.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 toolchain-funcs
+
+DESCRIPTION="PDB --> CIF convertor"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/makecif.html"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="ccp4"
+IUSE=""
+
+S="${WORKDIR}"/${PN}
+
+DEPEND=""
+RDEPEND="
+ !>=sci-chemistry/refmac-5.6
+ sci-libs/monomer-db"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-makefile.patch
+}
+
+src_compile() {
+ cd src && emake clean
+ emake \
+ BLANC_FORT="$(tc-getFC) ${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dobin bin/*
+ dodoc readme
+}
diff --git a/sci-chemistry/makecif/metadata.xml b/sci-chemistry/makecif/metadata.xml
new file mode 100644
index 000000000000..993c1d1ffcda
--- /dev/null
+++ b/sci-chemistry/makecif/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+PDB - CIF convertor
+check and create correct structure description
+create the list of restraints
+create dictionary description of new ligands
+rebuild missing atoms
+create tree like structure
+also the part of REFMAC
+can use additional user's dictionary
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/mars/Manifest b/sci-chemistry/mars/Manifest
new file mode 100644
index 000000000000..6266916bc856
--- /dev/null
+++ b/sci-chemistry/mars/Manifest
@@ -0,0 +1 @@
+DIST mars-1.2_linux.tar.gz 2058733 SHA256 c909aa781296d806f89c8d51d89b7345c3e94dd33fc8cc72554573a78ff21b2b SHA512 ba7ec4e94cf5918d22405022c75feabf3e5b345d96075eabf50eb24857101575bb41d15e5686822c2b2f25ba554aa7d7a2b65122dd47304939234a4a884ae4d2 WHIRLPOOL 3cbc59474d776cc79d3c392ae55ce6effe13ae088ff544afd3537daf157adc2c14e1074a38b937e197c87d262f37371dc7109d31f758d25c4c210847a5fb6a79
diff --git a/sci-chemistry/mars/mars-1.2.ebuild b/sci-chemistry/mars/mars-1.2.ebuild
new file mode 100644
index 000000000000..3e3aa6a7948f
--- /dev/null
+++ b/sci-chemistry/mars/mars-1.2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+MY_P="${P}_linux"
+
+DESCRIPTION="Robust automatic backbone assignment of proteins"
+HOMEPAGE="http://www.mpibpc.mpg.de/groups/zweckstetter/_links/software_mars.htm"
+SRC_URI="http://www.mpibpc.mpg.de/groups/zweckstetter/_software_files/_${PN}/${MY_P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="all-rights-reserved"
+IUSE="examples"
+
+RDEPEND="sci-biology/psipred"
+DEPEND=""
+
+RESTRICT=mirror
+
+S="${WORKDIR}"/${MY_P}
+
+QA_PREBUILT="opt/mars/*"
+
+src_install() {
+ dobin bin/runmars*
+
+ exeinto /opt/${PN}/
+ doexe bin/{${PN},calcJC-S2,runmars*,*.awk} *.awk
+ insinto /opt/${PN}/
+ doins bin/*.{tab,txt}
+ if use examples; then
+ insinto /usr/share/${PN}/
+ doins -r examples
+ fi
+
+ cat >> "${T}"/23mars <<- EOF
+ MARSHOME="${EPREFIX}/opt/${PN}"
+ EOF
+
+ doenvd "${T}"/23mars
+}
diff --git a/sci-chemistry/mars/metadata.xml b/sci-chemistry/mars/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/mars/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/massxpert/Manifest b/sci-chemistry/massxpert/Manifest
new file mode 100644
index 000000000000..2288ccad80f4
--- /dev/null
+++ b/sci-chemistry/massxpert/Manifest
@@ -0,0 +1,2 @@
+DIST massxpert-2.0.5.tar.gz 13603475 SHA256 11f7f1599a587be923ed0b58e753e1f9296e0c3c0acfb5e3980579e768600e5c SHA512 49c1d8fa4324907d04c79dddad66eecae34ba1dded98594838b4cbb88ad022abe3f8fbd7f2aeee73baafc17a03397b1776f2e6fdabf4e2ac4e4f6d6eeb86ca2f WHIRLPOOL dba641144835d303eaf181a70aabee11dc14a43c8fe508ad33eb2ffe3c1c8a11eaa1ae066a8e9134e9d6c891cea5fc2dba503ca5e53acf62eb8b532d52c1bf3e
+DIST massxpert-3.4.0.tar.bz2 16544044 SHA256 b06314722b4cbdf68dc76e55933a79487848c655fc65341a8dbc707ed89cc9e8 SHA512 50e8eaab145ab7fa225725b113d6840168b88db7d2ee194b176bc88eabf4f44c20f8dc0680986d659de1f94f2e0c6ae10d54e17e2d8b3b5aa6a9a9bf57a508de WHIRLPOOL 4578801c2dd4eee7390eadb299f3d55af29d0a48365f96ba6d6488a07792e47882e191f8eda05b6b261d9a972bf7f92f160d4a5fbbcc216ed7ffda32fcfee6ed
diff --git a/sci-chemistry/massxpert/files/massxpert-2.0.5-gentoo.patch b/sci-chemistry/massxpert/files/massxpert-2.0.5-gentoo.patch
new file mode 100644
index 000000000000..63cbe2340008
--- /dev/null
+++ b/sci-chemistry/massxpert/files/massxpert-2.0.5-gentoo.patch
@@ -0,0 +1,84 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8085e0a..eaae8ce 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,10 +23,10 @@ SET (CMAKE_VERBOSE_MAKEFILE ON)
+
+ #############################################################
+ # Enable warnings and treat them as errors
+-SET (PEDANTIC TRUE CACHE BOOL "Should we compile with -Wall -Werror.")
++SET (PEDANTIC TRUE CACHE BOOL "Should we compile with -Wall.")
+
+ IF (PEDANTIC)
+- ADD_DEFINITIONS (-Wall -Werror)
++ ADD_DEFINITIONS (-Wall)
+ ENDIF (PEDANTIC)
+
+ #############################################################
+@@ -51,9 +51,9 @@ ENDIF (WIN32)
+ IF (UNIX AND NOT APPLE)
+ SET (MASSXPERT_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
+ SET (MASSXPERT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/massxpert)
+- SET (MASSXPERT_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/massxpert/plugins)
++ SET (MASSXPERT_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/massxpert/plugins)
+ SET (MASSXPERT_LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/massxpert/locales)
+- SET (MASSXPERT_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/massxpert)
++ SET (MASSXPERT_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/massxpert-${VERSION})
+ SET (MASSXPERT_USERMAN_DIR ${MASSXPERT_DOC_DIR}/usermanual)
+ ENDIF (UNIX AND NOT APPLE)
+
+@@ -122,10 +122,6 @@ IF (${BUILD_PROGRAM})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The desktop file
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert.desktop
+@@ -165,10 +161,6 @@ IF (${BUILD_DATA})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The manual pages (data)
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert-data.7
+@@ -201,10 +193,6 @@ IF (${BUILD_USERMANUAL})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The manual pages (user manual)
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert-doc.7
+diff --git a/gui/configurationSettingsDlg.cpp b/gui/configurationSettingsDlg.cpp
+index bf595d5..82cad21 100644
+--- a/gui/configurationSettingsDlg.cpp
++++ b/gui/configurationSettingsDlg.cpp
+@@ -309,13 +309,11 @@ namespace massXpert
+ bool
+ ConfigurationSettingsDlg::checkLocalizationDir(const QDir &dir)
+ {
+- // At the moment there is the french translation: massxpert_fr.qm
++ // Gentoo provides optional installing of translations.
++ // If you decide not to have translations, then this check
++ // would fail.
+
+- QString filePath(dir.absolutePath() +
+- QDir::separator() +
+- "massxpert_fr.qm");
+-
+- return QFile::exists(filePath);
++ return true;
+ }
+
+
diff --git a/sci-chemistry/massxpert/files/massxpert-3.4.0-gentoo.patch b/sci-chemistry/massxpert/files/massxpert-3.4.0-gentoo.patch
new file mode 100644
index 000000000000..fc0fc4f606cf
--- /dev/null
+++ b/sci-chemistry/massxpert/files/massxpert-3.4.0-gentoo.patch
@@ -0,0 +1,91 @@
+ CMakeLists.txt | 20 ++++----------------
+ gui/configurationSettingsDlg.cpp | 10 ++++------
+ 2 files changed, 8 insertions(+), 22 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fec954b..b87d157 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,10 +24,10 @@ SET (CMAKE_VERBOSE_MAKEFILE ON)
+ #############################################################
+ # Enable warnings and treat them as errors, on GNU/Linux only
+ IF (UNIX)
+- SET (PEDANTIC TRUE CACHE BOOL "Should we compile with -Wall -Werror.")
++ SET (PEDANTIC TRUE CACHE BOOL "Should we compile with -Wall.")
+
+ IF (PEDANTIC)
+- ADD_DEFINITIONS (-Wall -Werror)
++ ADD_DEFINITIONS (-Wall)
+ ENDIF (PEDANTIC)
+ ENDIF (UNIX)
+
+@@ -64,12 +64,12 @@ IF (UNIX AND NOT APPLE)
+ # Plugin-specific stuff, some distros set CMAKE_INSTALL_LIBDIR to
+ # /usr/lib64 (Fedora64, for example)
+ IF (NOT CMAKE_INSTALL_LIBDIR)
+- SET (CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
++ SET (CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+ ENDIF (NOT CMAKE_INSTALL_LIBDIR)
+ SET (MASSXPERT_PLUGIN_DIR ${CMAKE_INSTALL_LIBDIR}/massxpert/plugins)
+
+ SET (MASSXPERT_LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/massxpert/locales)
+- SET (MASSXPERT_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/massxpert)
++ SET (MASSXPERT_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/massxpert-${VERSION})
+ SET (MASSXPERT_USERMAN_DIR ${MASSXPERT_DOC_DIR}/usermanual)
+ ENDIF (UNIX AND NOT APPLE)
+
+@@ -144,10 +144,6 @@ IF (${BUILD_PROGRAM})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The desktop file
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert.desktop
+@@ -185,10 +181,6 @@ IF (${BUILD_DATA})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The manual pages (data)
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert-data.7
+@@ -219,10 +211,6 @@ IF (${BUILD_USERMANUAL})
+ ###############
+ # install stuff
+
+- # The license file
+- INSTALL (FILES COPYING
+- DESTINATION ${MASSXPERT_DOC_DIR})
+-
+ # The manual pages (user manual)
+ IF (UNIX AND NOT APPLE)
+ INSTALL (FILES massxpert-doc.7
+diff --git a/gui/configurationSettingsDlg.cpp b/gui/configurationSettingsDlg.cpp
+index bf595d5..82cad21 100644
+--- a/gui/configurationSettingsDlg.cpp
++++ b/gui/configurationSettingsDlg.cpp
+@@ -309,13 +309,11 @@ namespace massXpert
+ bool
+ ConfigurationSettingsDlg::checkLocalizationDir(const QDir &dir)
+ {
+- // At the moment there is the french translation: massxpert_fr.qm
++ // Gentoo provides optional installing of translations.
++ // If you decide not to have translations, then this check
++ // would fail.
+
+- QString filePath(dir.absolutePath() +
+- QDir::separator() +
+- "massxpert_fr.qm");
+-
+- return QFile::exists(filePath);
++ return true;
+ }
+
+
diff --git a/sci-chemistry/massxpert/massxpert-2.0.5.ebuild b/sci-chemistry/massxpert/massxpert-2.0.5.ebuild
new file mode 100644
index 000000000000..ba0ee2dd9491
--- /dev/null
+++ b/sci-chemistry/massxpert/massxpert-2.0.5.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit cmake-utils
+
+DESCRIPTION="A software suite to predict/analyze mass spectrometric data on (bio)polymers"
+HOMEPAGE="http://massxpert.org"
+SRC_URI="http://download.tuxfamily.org/${PN}/source/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc"
+
+RDEPEND="dev-qt/qtsvg:4[debug?]"
+DEPEND="${DEPEND}
+ doc? ( virtual/latex-base )"
+
+MASSXPERT_LANGS="fr"
+
+for L in ${MASSXPERT_LANGS}; do
+ IUSE="${IUSE} linguas_${L}"
+done
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+
+ local langs=
+ for lingua in ${LINGUAS}; do
+ if has ${lingua} ${MASSXPERT_LANGS}; then
+ langs="${langs} ${PN}_${lingua}.qm"
+ fi
+ done
+
+ sed -i -e "s/\(SET (massxpert_TRANSLATIONS \).*/\1${langs})/" \
+ gui/CMakeLists.txt || die "setting up translations failed"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_PROGRAM=1
+ -DBUILD_DATA=1
+ )
+ use doc && mycmakeargs+=( -DBUILD_USERMANUAL=1 )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ doicon "gui/images/${PN}-icon-32.xpm" || die "installing icon failed"
+ dodoc TODO || die "dodoc failed"
+}
diff --git a/sci-chemistry/massxpert/massxpert-3.4.0.ebuild b/sci-chemistry/massxpert/massxpert-3.4.0.ebuild
new file mode 100644
index 000000000000..b9aa2467f5d6
--- /dev/null
+++ b/sci-chemistry/massxpert/massxpert-3.4.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Software suite to predict/analyze mass spectrometric data on (bio)polymers"
+HOMEPAGE="http://massxpert.org"
+SRC_URI="http://download.tuxfamily.org/${PN}/source/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc"
+
+RDEPEND="dev-qt/qtsvg:4[debug?]"
+DEPEND="${DEPEND}
+ doc? ( virtual/latex-base )"
+
+MASSXPERT_LANGS="fr"
+
+for L in ${MASSXPERT_LANGS}; do
+ IUSE="${IUSE} linguas_${L}"
+done
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+
+ local langs=
+ for lingua in ${LINGUAS}; do
+ if has ${lingua} ${MASSXPERT_LANGS}; then
+ langs="${langs} ${PN}_${lingua}.qm"
+ fi
+ done
+
+ sed -i -e "s/\(SET (massxpert_TRANSLATIONS \).*/\1${langs})/" \
+ gui/CMakeLists.txt || die "setting up translations failed"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_PROGRAM=1
+ -DBUILD_DATA=1
+ )
+ use doc && mycmakeargs+=( -DBUILD_USERMANUAL=1 )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ doicon "gui/images/${PN}-icon-32.xpm"
+ dodoc TODO
+}
diff --git a/sci-chemistry/massxpert/metadata.xml b/sci-chemistry/massxpert/metadata.xml
new file mode 100644
index 000000000000..a4137981114b
--- /dev/null
+++ b/sci-chemistry/massxpert/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>je_fro@gentoo.org</email>
+ <name>Jeff Gardner</name>
+ </maintainer>
+ <longdescription lang="en">
+Prediction and analysis of mass spectrometric data for proteomic projects.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/mdanalysis/Manifest b/sci-chemistry/mdanalysis/Manifest
new file mode 100644
index 000000000000..a87a92b28ed1
--- /dev/null
+++ b/sci-chemistry/mdanalysis/Manifest
@@ -0,0 +1 @@
+DIST MDAnalysis-0.7.7.tar.gz 3262287 SHA256 9dd72b776bf7f2be83da562a638895a94f629422798cc309c14965795847eac1 SHA512 c26085c767ec213d5aa27709029e5a3b9df786c10e23e3841ffc9644e2fd66c8add0358f013c51a95fa3452c5c900b44901db736830504b669916ea45a924712 WHIRLPOOL 2acaa02d641d67bef4cd9ec311c787f57884d83bf350b46af9e862ca6d3a03a6d4ff3d71a2e866f5ab57e29036c5a3182a167e3bcc492667e9a5a60778de0b39
diff --git a/sci-chemistry/mdanalysis/mdanalysis-0.7.7.ebuild b/sci-chemistry/mdanalysis/mdanalysis-0.7.7.ebuild
new file mode 100644
index 000000000000..aab36560129d
--- /dev/null
+++ b/sci-chemistry/mdanalysis/mdanalysis-0.7.7.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+MY_PN="MDAnalysis"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A python library to analyze and manipulate molecular dynamics trajectories"
+HOMEPAGE="https://code.google.com/p/mdanalysis/"
+SRC_URI="https://mdanalysis.googlecode.com/files/${MY_P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-biology/biopython[${PYTHON_USEDEP}]
+ dev-python/networkx[${PYTHON_USEDEP}]
+ dev-python/scientificpython[${PYTHON_USEDEP}]
+ dev-python/GridDataFormats[${PYTHON_USEDEP}]
+ dev-python/netcdf4-python[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}"/${MY_P}
diff --git a/sci-chemistry/mdanalysis/metadata.xml b/sci-chemistry/mdanalysis/metadata.xml
new file mode 100644
index 000000000000..5ef07a39e7e1
--- /dev/null
+++ b/sci-chemistry/mdanalysis/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</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/mead/Manifest b/sci-chemistry/mead/Manifest
new file mode 100644
index 000000000000..b86a2a21886e
--- /dev/null
+++ b/sci-chemistry/mead/Manifest
@@ -0,0 +1 @@
+DIST mead-2.2.7.tar.gz 806319 RMD160 9adf9743e44061779f9ac3b9064abb9164ad3e58 SHA1 6d3bbda29a5f8fdf26600e036ca8debacc37b90e SHA256 fd2a4b357bbd847ac9b255563034d7e71bf16cf59efa371d966b6fbbe9b4cd7c
diff --git a/sci-chemistry/mead/files/mead-2.2.7-gcc43.patch b/sci-chemistry/mead/files/mead-2.2.7-gcc43.patch
new file mode 100644
index 000000000000..673f25890e74
--- /dev/null
+++ b/sci-chemistry/mead/files/mead-2.2.7-gcc43.patch
@@ -0,0 +1,22 @@
+--- mead-2.2.7.orig/libmead/AtomSet.h
++++ mead-2.2.7/libmead/AtomSet.h
+@@ -31,8 +31,7 @@
+
+ #include <map>
+ #include <list>
+-#include <string>
+-using std::string;
++#include <string.h>
+ #include "MEAD/Atom.h"
+ #include "MEAD/Coord.h"
+ #include "MEAD/AtomID.h"
+--- mead-2.2.7.orig/libmead/DielCubeRep.h
++++ mead-2.2.7/libmead/DielCubeRep.h
+@@ -31,6 +31,7 @@
+
+ #include "MEAD/CubeLatSpec.h"
+ #include "MEAD/globals.h"
++#include <string.h>
+
+ class DielCubeRep {
+ public:
diff --git a/sci-chemistry/mead/files/mead-2.2.7-respect-cflags.patch b/sci-chemistry/mead/files/mead-2.2.7-respect-cflags.patch
new file mode 100644
index 000000000000..61c54737778e
--- /dev/null
+++ b/sci-chemistry/mead/files/mead-2.2.7-respect-cflags.patch
@@ -0,0 +1,57 @@
+diff -Naur mead-2.2.7-orig/apps/libmso/Makefile.in mead-2.2.7/apps/libmso/Makefile.in
+--- mead-2.2.7-orig/apps/libmso/Makefile.in 2004-12-10 14:33:49.000000000 -0600
++++ mead-2.2.7/apps/libmso/Makefile.in 2009-02-15 16:32:40.000000000 -0600
+@@ -35,8 +35,8 @@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+
+ ALL_CPPFLAGS = -I. $(LOCALINCS) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+ .SUFFIXES:
+ .SUFFIXES: .cc .o
+diff -Naur mead-2.2.7-orig/apps/Makefile.common.in mead-2.2.7/apps/Makefile.common.in
+--- mead-2.2.7-orig/apps/Makefile.common.in 2004-11-19 16:49:56.000000000 -0600
++++ mead-2.2.7/apps/Makefile.common.in 2009-02-15 16:32:22.000000000 -0600
+@@ -36,10 +36,10 @@
+ LIBS = @LIBS@ -lm
+
+ ALL_CPPFLAGS = -I. $(LOCALINCS) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+-CXXLINK = $(CXX) $(ALL_CPPFLAGS) $(CXX_DEBUGFLAGS) $(CXX_OPTFLAGS) \
++CXXLINK = $(CXX) $(ALL_CPPFLAGS) @CXXFLAGS@ \
+ $(LDFLAGS)
+
+ .SUFFIXES: .cc .o
+diff -Naur mead-2.2.7-orig/libmead/Makefile.in mead-2.2.7/libmead/Makefile.in
+--- mead-2.2.7-orig/libmead/Makefile.in 2008-03-04 14:18:22.000000000 -0600
++++ mead-2.2.7/libmead/Makefile.in 2009-02-15 16:31:56.000000000 -0600
+@@ -99,8 +99,8 @@
+ INCLUDES = -I$(top_srcdir)
+
+ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS) $(CXX_SHAREDFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+
+
+diff -Naur mead-2.2.7-orig/swig/Makefile.in mead-2.2.7/swig/Makefile.in
+--- mead-2.2.7-orig/swig/Makefile.in 2007-11-27 15:57:17.000000000 -0600
++++ mead-2.2.7/swig/Makefile.in 2009-02-15 16:34:35.000000000 -0600
+@@ -58,7 +58,7 @@
+ CXX_FLAGS = @CXX_NOOPTFLAGS@ @CXX_DEBUGFLAGS@ @CXX_SHAREDFLAGS@
+ CXX_DYNLIB_FLAGS = @CXX_DYNLIB_FLAGS@
+
+-ALL_CXXFLAGS = $(CPP_FLAGS) $(CXX_FLAGS)
++ALL_CXXFLAGS = $(CPP_FLAGS) @CXXFLAGS@ @CXX_SHAREDFLAGS@
+
+ MEADINC = -I$(top_srcdir) -I$(srcdir)
+ MEADLIBS = -L../libmead -lmead
diff --git a/sci-chemistry/mead/files/mead-2.2.7-respect-flags.patch b/sci-chemistry/mead/files/mead-2.2.7-respect-flags.patch
new file mode 100644
index 000000000000..9ffb238ece8c
--- /dev/null
+++ b/sci-chemistry/mead/files/mead-2.2.7-respect-flags.patch
@@ -0,0 +1,74 @@
+diff --git a/apps/Makefile.common.in b/apps/Makefile.common.in
+index 15c61ae..f15d71d 100644
+--- a/apps/Makefile.common.in
++++ b/apps/Makefile.common.in
+@@ -36,10 +36,10 @@ REGEX_CPP = @REGEX_CPP@
+ LIBS = @LIBS@ -lm
+
+ ALL_CPPFLAGS = -I. $(LOCALINCS) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+-CXXLINK = $(CXX) $(ALL_CPPFLAGS) $(CXX_DEBUGFLAGS) $(CXX_OPTFLAGS) \
++CXXLINK = $(CXX) $(ALL_CPPFLAGS) @CXXFLAGS@ \
+ $(LDFLAGS)
+
+ .SUFFIXES: .cc .o
+diff --git a/apps/libmso/Makefile.in b/apps/libmso/Makefile.in
+index 249c25b..9d23665 100644
+--- a/apps/libmso/Makefile.in
++++ b/apps/libmso/Makefile.in
+@@ -35,8 +35,8 @@ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+
+ ALL_CPPFLAGS = -I. $(LOCALINCS) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+ .SUFFIXES:
+ .SUFFIXES: .cc .o
+diff --git a/apps/redti/Makefile.in b/apps/redti/Makefile.in
+index c4aa5ca..9561bf3 100644
+--- a/apps/redti/Makefile.in
++++ b/apps/redti/Makefile.in
+@@ -21,7 +21,7 @@ CFLAGS = @CFLAGS@
+ redti_objs = redti.o rfixpro.o rfixprosee.o pfix.o tc.o
+
+ redti : $(redti_objs)
+- $(CC) $(CFLAGS) $(redti_objs) -lm -o redti
++ $(CC) $(CFLAGS) $(LDFLAGS) $(redti_objs) -lm -o redti
+
+ appname = redti
+ include ../Makefile.common
+diff --git a/libmead/Makefile.in b/libmead/Makefile.in
+index 3d4d5f0..8b4a4ac 100644
+--- a/libmead/Makefile.in
++++ b/libmead/Makefile.in
+@@ -99,8 +99,8 @@ PYTHONINC = @PYTHONINC@
+ INCLUDES = -I$(top_srcdir)
+
+ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) $(REGEX_CPP) $(CXX_DEFS)
+-ALL_CXXFLAGS = $(CXX_OPTFLAGS) $(CXX_DEBUGFLAGS) $(CXX_SHAREDFLAGS)
+-ALL_CFLAGS = $(CC_DEBUGFLAGS) $(CC_OPTFLAGS)
++ALL_CXXFLAGS = @CXXFLAGS@
++ALL_CFLAGS = @CFLAGS@
+
+
+
+diff --git a/swig/Makefile.in b/swig/Makefile.in
+index 81b3b4e..8410307 100644
+--- a/swig/Makefile.in
++++ b/swig/Makefile.in
+@@ -58,7 +58,7 @@ CPP_FLAGS = -DSWIG @CPPFLAGS@
+ CXX_FLAGS = @CXX_NOOPTFLAGS@ @CXX_DEBUGFLAGS@ @CXX_SHAREDFLAGS@
+ CXX_DYNLIB_FLAGS = @CXX_DYNLIB_FLAGS@
+
+-ALL_CXXFLAGS = $(CPP_FLAGS) $(CXX_FLAGS)
++ALL_CXXFLAGS = $(CPP_FLAGS) @CXXFLAGS@ @CXX_SHAREDFLAGS@
+
+ MEADINC = -I$(top_srcdir) -I$(srcdir)
+ MEADLIBS = -L../libmead -lmead
diff --git a/sci-chemistry/mead/mead-2.2.7-r1.ebuild b/sci-chemistry/mead/mead-2.2.7-r1.ebuild
new file mode 100644
index 000000000000..fd67abb3c345
--- /dev/null
+++ b/sci-chemistry/mead/mead-2.2.7-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Macroscopic Electrostatics with Atomic Detail"
+HOMEPAGE="http://www.teokem.lu.se/~ulf/Methods/mead.html"
+SRC_URI="ftp://ftp.scripps.edu/pub/bashford/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE="python"
+
+RESTRICT="fetch"
+
+pkg_nofetch() {
+ elog "Download ${SRC_URI}"
+ elog "and place it in ${DISTDIR}."
+ elog
+ elog "Use \"anonymous\" as a login, and an email address as a password."
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-respect-flags.patch
+ epatch "${FILESDIR}"/${P}-gcc43.patch
+}
+
+src_compile() {
+ econf \
+ ${conf_opts} \
+ || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ # package hates emake DESTDIR="${D}" install
+ einstall || die "install failed"
+}
diff --git a/sci-chemistry/mead/mead-2.2.7.ebuild b/sci-chemistry/mead/mead-2.2.7.ebuild
new file mode 100644
index 000000000000..fd67abb3c345
--- /dev/null
+++ b/sci-chemistry/mead/mead-2.2.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Macroscopic Electrostatics with Atomic Detail"
+HOMEPAGE="http://www.teokem.lu.se/~ulf/Methods/mead.html"
+SRC_URI="ftp://ftp.scripps.edu/pub/bashford/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE="python"
+
+RESTRICT="fetch"
+
+pkg_nofetch() {
+ elog "Download ${SRC_URI}"
+ elog "and place it in ${DISTDIR}."
+ elog
+ elog "Use \"anonymous\" as a login, and an email address as a password."
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-respect-flags.patch
+ epatch "${FILESDIR}"/${P}-gcc43.patch
+}
+
+src_compile() {
+ econf \
+ ${conf_opts} \
+ || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ # package hates emake DESTDIR="${D}" install
+ einstall || die "install failed"
+}
diff --git a/sci-chemistry/mead/metadata.xml b/sci-chemistry/mead/metadata.xml
new file mode 100644
index 000000000000..9ac9ffdb3a41
--- /dev/null
+++ b/sci-chemistry/mead/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/metadata.xml b/sci-chemistry/metadata.xml
new file mode 100644
index 000000000000..c60d4c31553f
--- /dev/null
+++ b/sci-chemistry/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sci-chemistry category contains software that can be used
+ in chemistral scientific environments.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sci-chemistry enthält Software, welche in chemischen
+ und chemietechnischen Umgebungen genutzt werden kann.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sci-chemistry contiene programas que pueden ser utilizados
+ en entornos relacionados con la química.
+ </longdescription>
+ <longdescription lang="ja">
+ sci-chemistryカテゴリーには化学の科学的な分野に利用される
+ フトウェアが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De sci-chemistry categorie bevat software die in scheikundige omgevingen
+ gebruikt kan worden.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sci-chemistry chứa các phần mềm dùng trong hoá học.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sci-chemistry contiene programmi per la chimica.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sci-chemistry contém programas que podem ser usados
+ em ambientes relacionados a química.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sci-chemistry zawiera programy naukowe związane z chemią.
+ </longdescription>
+</catmetadata>
+
diff --git a/sci-chemistry/mm-align/Manifest b/sci-chemistry/mm-align/Manifest
new file mode 100644
index 000000000000..a1e08c44269c
--- /dev/null
+++ b/sci-chemistry/mm-align/Manifest
@@ -0,0 +1 @@
+DIST MM-align-20120321.tar.xz 20072 SHA256 0158a93a06257b885630ab7bed3b7bf8dca2ee12217c84d019829a1e34f3eeb3
diff --git a/sci-chemistry/mm-align/files/CMakeLists.txt b/sci-chemistry/mm-align/files/CMakeLists.txt
new file mode 100644
index 000000000000..635ffdd67418
--- /dev/null
+++ b/sci-chemistry/mm-align/files/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required (VERSION 2.6)
+project (MM-align Fortran)
+add_executable(MMalign MM-align.f)
+
+install (TARGETS MMalign DESTINATION bin)
diff --git a/sci-chemistry/mm-align/metadata.xml b/sci-chemistry/mm-align/metadata.xml
new file mode 100644
index 000000000000..2634f696a953
--- /dev/null
+++ b/sci-chemistry/mm-align/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+MM-align is an algorithm for structurally aligning multiple-chain
+protein-protein complexes. The algorithm is built on a heuristic
+iteration of a modified Needleman-Wunsch dynamic programming (DP)
+algorithm, with the alignment score specified by the inter-complex residue
+distances. The multiple chains in each complex are first joined, in every
+possible order, and then simultaneously aligned with cross-chain alignments
+prevented. The alignments of interface residues are enhanced by an
+interface-specific weighting factor. An optimal alignment between two complexes,
+as well as the overall TM-score, will be reported for each comparison.
+What is the difference between TM-align and MM-align? TM-align is for aligning
+monomer protein structures while MM-align is designed for aligning
+multiple-chain protein complex structures. Although one can still use TM-align
+to align protein complexes after manually joining the chains, this will lead
+to suboptimal alignments with unphysical cross alignments. Therefore, the
+best result will be obtained if one uses TM-align to monomer structures and
+MM-align for multimer structures.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/mm-align/mm-align-20120321.ebuild b/sci-chemistry/mm-align/mm-align-20120321.ebuild
new file mode 100644
index 000000000000..c0ef57c832af
--- /dev/null
+++ b/sci-chemistry/mm-align/mm-align-20120321.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils fortran-2
+
+DESCRIPTION="Protein Complex Structural Alignment"
+HOMEPAGE="http://zhanglab.ccmb.med.umich.edu/MM-align/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/MM-align-${PV}.tar.xz"
+
+SLOT="0"
+LICENSE="tm-align"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+S="${WORKDIR}"
+
+src_prepare() {
+ cp "${FILESDIR}"/CMakeLists.txt . || die
+}
diff --git a/sci-chemistry/molden/Manifest b/sci-chemistry/molden/Manifest
new file mode 100644
index 000000000000..e78207790325
--- /dev/null
+++ b/sci-chemistry/molden/Manifest
@@ -0,0 +1,2 @@
+DIST molden4.8.tar.gz 2969701 SHA256 314d9b9bdede2fd63d1e2f26e0212711576952244634fc28ea6c97ce2f7029b1 SHA512 11f2406e54a077d044369b5eee4a8a1c1b10f052188d33d4162af0151a1e76a1d5274d8788bbc3610905ff271b0bd2100990b77540a0290ad608bd5c29b839e3 WHIRLPOOL 838d66a4e17651dfd2bab893fa9b36ca8d722c879b9f10adb00c3c4e59974ae73e13060e6a559286c651ab35e1cea084049677277cc4b455e68a95c6c210dcf9
+DIST molden5.0.tar.gz 3063244 SHA256 c9cf8f656adf2f2c7a8b8b64fa07b5feaa9c3ca36c4803e1f58ac33de1cffdc4 SHA512 bf45849bf4efb67bc552767c28a6df6e5106a7d8ac2d73db2c7218412fb6cd2f2785c2be83a8589a5664ba9c0ca052cef5eb155c665ee1f3d6c7fe208f806a6b WHIRLPOOL ab7f1118b000a8df36cbaf23fddabb21bd291a2388e3aa5599e609ffa792bec01bf7df52a98f7e70125b504f7866e48ec6d5ce029ecd0e40c7bab7b8627c5c86
diff --git a/sci-chemistry/molden/files/molden-4.7-implicit-dec.patch b/sci-chemistry/molden/files/molden-4.7-implicit-dec.patch
new file mode 100644
index 000000000000..dd5aba4f17da
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-4.7-implicit-dec.patch
@@ -0,0 +1,12 @@
+diff --git a/silly.c b/silly.c
+index 57d07e8..102156a 100644
+--- a/silly.c
++++ b/silly.c
+@@ -13,6 +13,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
++#include <string.h>
+
+ #ifndef WIN32
+ #include <GL/gl.h>
diff --git a/sci-chemistry/molden/files/molden-4.8-ambfor.patch b/sci-chemistry/molden/files/molden-4.8-ambfor.patch
new file mode 100644
index 000000000000..1ececa7f57e9
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-4.8-ambfor.patch
@@ -0,0 +1,12 @@
+diff -Naur molden4.8/ambfor/makefile molden4.8.new/ambfor/makefile
+--- molden4.8/ambfor/makefile 2009-12-19 06:14:32.000000000 -0500
++++ molden4.8.new/ambfor/makefile 2010-02-25 22:33:41.000000000 -0500
+@@ -32,7 +32,7 @@
+ $(LDR) -o ambmd md.o verlet.o allocmd.o $(OBJS) $(LIBS)
+
+ ambfor.o: ambfor.f
+- ${FC} -c -g -ffast-math -funroll-loops -m32 -o ambfor.o ambfor.f
++ ${FC} $(FFLAGS) -c ambfor.f -o ambfor.o
+
+ allocmd.o: alloc.c
+ $(CC) $(CFLAGS) -DMD -c alloc.c -o allocmd.o
diff --git a/sci-chemistry/molden/files/molden-4.8-ldflags.patch b/sci-chemistry/molden/files/molden-4.8-ldflags.patch
new file mode 100644
index 000000000000..92fa6c665f3f
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-4.8-ldflags.patch
@@ -0,0 +1,26 @@
+diff --git a/makefile b/makefile
+index 81147a3..9e2353e 100644
+--- a/makefile
++++ b/makefile
+@@ -224,10 +224,10 @@ all: molden gmolden ambfor/ambfor ambfor/ambmd surf/surf
+
+
+ molden: $(OBJS) mpdum.o xwin.o
+- $(LDR) -o molden $(OBJS) mpdum.o xwin.o $(LIBS)
++ $(LDR) $(LDFLAGS) -o molden $(OBJS) mpdum.o xwin.o $(LIBS)
+
+ gmolden: $(OBJS) mpdum.o xwingl.o
+- $(LDR) -o gmolden $(OBJS) mpdum.o xwingl.o $(LIBSG)
++ $(LDR) $(LDFLAGS) -o gmolden $(OBJS) mpdum.o xwingl.o $(LIBSG)
+
+ ambfor/ambfor: ambfor/*.f ambfor/*.c
+ $(MAKE) -C ambfor FC=${FC} FFLAGS="${FFLAGS}" LDR="${LDR}" CFLAGS="${CFLAGS}"
+@@ -269,7 +269,7 @@ short_wrl: short_wrl.o
+ # Moldens OpenGL helper program
+
+ moldenogl: oglmol.o silly.o
+- $(CC) -o moldenogl oglmol.o silly.o $(LIBSOGL)
++ $(CC) $(LDFLAGS) -o moldenogl oglmol.o silly.o $(LIBSOGL)
+
+ # conversion of CADPAC output to molden format
+
diff --git a/sci-chemistry/molden/files/molden-4.8-overflow.patch b/sci-chemistry/molden/files/molden-4.8-overflow.patch
new file mode 100644
index 000000000000..7cbd7f436f57
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-4.8-overflow.patch
@@ -0,0 +1,38 @@
+ xwin.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/xwin.c b/xwin.c
+index f395909..092edff 100644
+--- a/xwin.c
++++ b/xwin.c
+@@ -13552,7 +13552,7 @@ void NewActiveStruct()
+ #ifdef CRAY
+ _fcd ztr;
+ #else
+- char ztr;
++ char ztr[4];
+ #endif
+ #endif
+
+@@ -13650,8 +13650,10 @@ void NewActiveStruct()
+ */
+ clfpstr->ihashz = 0;
+ #else
+- strncpy(&ztr,HetAtm[j],3);
+- parhet_(&j1,&ztr);
++ if (HetAtm[j] != NULL) {
++ strncpy(ztr,HetAtm[j],3);
++ parhet_(&j1,ztr);
++ }
+ #endif
+ #endif
+ }
+@@ -27353,7 +27355,7 @@ char *errstr;
+ UpdateZME();
+ RedrawScroll(&zscroll);
+ }
+- strcpy(ZMEerr,errstr);
++ strncpy(ZMEerr,errstr,MAXZMEERR);
+ RedrawStatus();
+ }
+
diff --git a/sci-chemistry/molden/files/molden-5.0-ambfor.patch b/sci-chemistry/molden/files/molden-5.0-ambfor.patch
new file mode 100644
index 000000000000..9656ff7a79be
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-5.0-ambfor.patch
@@ -0,0 +1,16 @@
+ ambfor/makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/ambfor/makefile b/ambfor/makefile
+index 8627a11..dbc23a1 100644
+--- a/ambfor/makefile
++++ b/ambfor/makefile
+@@ -47,7 +47,7 @@ ambmd: md.o verlet.o qvdw.o allocmd.o $(OBJS)
+ $(LDR) -o ambmd md.o verlet.o qvdw.o allocmd.o $(OBJS) $(LIBS)
+
+ ambfor.o: ambfor.f
+- ${FC} -c -g -ffast-math -funroll-loops -o ambfor.o ambfor.f
++ ${FC} $(FFLAGS) -c -o ambfor.o ambfor.f
+
+ allocmd.o: alloc.c
+ $(CC) $(CFLAGS) -DMD -c alloc.c -o allocmd.o
diff --git a/sci-chemistry/molden/files/molden-5.0-overflow.patch b/sci-chemistry/molden/files/molden-5.0-overflow.patch
new file mode 100644
index 000000000000..4fc406266935
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-5.0-overflow.patch
@@ -0,0 +1,16 @@
+ xwin.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/xwin.c b/xwin.c
+index f395909..092edff 100644
+--- a/xwin.c
++++ b/xwin.c
+@@ -27353,7 +27355,7 @@ char *errstr;
+ UpdateZME();
+ RedrawScroll(&zscroll);
+ }
+- strcpy(ZMEerr,errstr);
++ strncpy(ZMEerr,errstr,MAXZMEERR);
+ RedrawStatus();
+ }
+
diff --git a/sci-chemistry/molden/metadata.xml b/sci-chemistry/molden/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/molden/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/molden/molden-4.8-r2.ebuild b/sci-chemistry/molden/molden-4.8-r2.ebuild
new file mode 100644
index 000000000000..943f7cc4fb05
--- /dev/null
+++ b/sci-chemistry/molden/molden-4.8-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic toolchain-funcs
+
+MY_P="${PN}${PV}"
+
+DESCRIPTION="Display molecular density from GAMESS-UK, GAMESS-US, GAUSSIAN and Mopac/Ampac"
+HOMEPAGE="http://www.cmbi.kun.nl/~schaft/molden/molden.html"
+SRC_URI="ftp://ftp.cmbi.kun.nl/pub/molgraph/${PN}/${MY_P}.tar.gz"
+
+LICENSE="MOLDEN"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="opengl"
+
+RDEPEND="
+ x11-libs/libXmu
+ virtual/glu
+ opengl? (
+ media-libs/freeglut
+ virtual/opengl )"
+DEPEND="${RDEPEND}
+ x11-misc/gccmakedep
+ app-editors/vim"
+ # vim provides ex, which the build system uses (surf/Makefile, at least)
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-ambfor.patch \
+ "${FILESDIR}"/${P}-overflow.patch \
+ "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${PN}-4.7-implicit-dec.patch
+ sed \
+ -e 's:makedepend:gccmakedep:g' \
+ -e "s:/usr/include/sgidefs.h::g" \
+ -i surf/Makefile || die
+ sed 's:shell g77:shell $(FC):g' -i makefile || die
+}
+
+src_compile() {
+ # Use -mieee on alpha, according to the Makefile
+ use alpha && append-flags -mieee
+
+ # Honor CC, CFLAGS, FC, and FFLAGS from environment;
+ # unfortunately a bash bug prevents us from doing typeset and
+ # assignment on the same line.
+ typeset -a args
+ args=(
+ CC="$(tc-getCC) ${CFLAGS}" \
+ FC="$(tc-getFC)" \
+ LDR="$(tc-getFC)" \
+ FFLAGS="${FFLAGS}" )
+
+ einfo "Building Molden..."
+ emake -j1 "${args[@]}"
+ if use opengl ; then
+ einfo "Building Molden OpenGL helper..."
+ emake -j1 "${args[@]}" moldenogl
+ fi
+}
+
+src_install() {
+ dobin ${PN} g${PN}
+ if use opengl ; then
+ dobin ${PN}ogl
+ fi
+
+ dodoc HISTORY README REGISTER
+ cd doc
+ uncompress * && dodoc *
+}
diff --git a/sci-chemistry/molden/molden-5.0.ebuild b/sci-chemistry/molden/molden-5.0.ebuild
new file mode 100644
index 000000000000..e4ad3b6d802d
--- /dev/null
+++ b/sci-chemistry/molden/molden-5.0.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic toolchain-funcs
+
+MY_P="${PN}${PV}"
+
+DESCRIPTION="Display molecular density from GAMESS-UK, GAMESS-US, GAUSSIAN and Mopac/Ampac"
+HOMEPAGE="http://www.cmbi.kun.nl/~schaft/molden/molden.html"
+SRC_URI="ftp://ftp.cmbi.kun.nl/pub/molgraph/${PN}/${MY_P}.tar.gz"
+
+LICENSE="MOLDEN"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="opengl"
+
+RDEPEND="
+ x11-libs/libXmu
+ virtual/glu
+ opengl? (
+ media-libs/freeglut
+ virtual/opengl )"
+DEPEND="${RDEPEND}
+ x11-misc/gccmakedep
+ app-editors/vim"
+ # vim provides ex, which the build system uses (surf/Makefile, at least)
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-ambfor.patch \
+ "${FILESDIR}"/${P}-overflow.patch \
+ "${FILESDIR}"/${PN}-4.8-ldflags.patch \
+ "${FILESDIR}"/${PN}-4.7-implicit-dec.patch
+ sed \
+ -e 's:makedepend:gccmakedep:g' \
+ -e "s:/usr/include/sgidefs.h::g" \
+ -i surf/Makefile || die
+ sed 's:shell g77:shell $(FC):g' -i makefile || die
+}
+
+src_compile() {
+ # Use -mieee on alpha, according to the Makefile
+ use alpha && append-flags -mieee
+
+ # Honor CC, CFLAGS, FC, and FFLAGS from environment;
+ # unfortunately a bash bug prevents us from doing typeset and
+ # assignment on the same line.
+ typeset -a args
+ args=(
+ CC="$(tc-getCC) ${CFLAGS}" \
+ FC="$(tc-getFC)" \
+ LDR="$(tc-getFC)" \
+ FFLAGS="${FFLAGS}" )
+
+ einfo "Building Molden..."
+ emake -j1 "${args[@]}"
+ if use opengl ; then
+ einfo "Building Molden OpenGL helper..."
+ emake -j1 "${args[@]}" moldenogl
+ fi
+}
+
+src_install() {
+ dobin ${PN} g${PN}
+ if use opengl ; then
+ dobin ${PN}ogl
+ fi
+
+ dodoc HISTORY README REGISTER
+ cd doc
+ uncompress * && dodoc *
+}
diff --git a/sci-chemistry/moldy/Manifest b/sci-chemistry/moldy/Manifest
new file mode 100644
index 000000000000..9e0e3883fa2f
--- /dev/null
+++ b/sci-chemistry/moldy/Manifest
@@ -0,0 +1 @@
+DIST moldy-2.16e.tar.gz 488410 RMD160 ef9c1c6cf1afa6e28e78a51a6a771d127aac2c83 SHA1 e7984f59170a11b5dab0beae89c5f4cf4da20ad1 SHA256 51abefc5e7de355022f48084382c30e72738cc1f21cd3d67fde7f047f1822ea8
diff --git a/sci-chemistry/moldy/files/2.16e-as-needed.patch b/sci-chemistry/moldy/files/2.16e-as-needed.patch
new file mode 100644
index 000000000000..67399e08560e
--- /dev/null
+++ b/sci-chemistry/moldy/files/2.16e-as-needed.patch
@@ -0,0 +1,65 @@
+diff --git a/Makefile.in b/Makefile.in
+index 0b02f00..ec588a8 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -115,25 +115,25 @@ VMSBUILD= compile_moldy.com link_moldy.com defcomm.com\
+
+ DOSBUILD= Makefile.mak OFILES.RSP SHAKOBJS.RSP Makefile.w32
+
+-all: moldy utilities Makefile
++all: moldy utilities
+
+ moldy: $(OFILES) $(EXTRA_OBJ) $(HFILES)
+- $(CC) -o moldy $(LDFLAGS) $(OFILES) $(EXTRA_OBJ) $(LIBS)
++ $(CC) $(LDFLAGS) -o moldy $(LDFLAGS) $(OFILES) $(EXTRA_OBJ) $(LIBS)
+
+ moldyext: moldyext.c $(LIBOBJS) $(HFILES)
+- $(CC) $(CFLAGS) -o moldyext $(OPT) $(DEFS) $(LDFLAGS1) moldyext.c $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o moldyext $(OPT) $(DEFS) $(LDFLAGS1) moldyext.c $(LIBOBJS) $(LIBS)
+
+ manalyze: manalyze.c $(HFILES)
+- $(CC) $(CFLAGS) -o manalyze $(OPT) $(DEFS) $(LDFLAGS1) manalyze.c $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o manalyze $(OPT) $(DEFS) $(LDFLAGS1) manalyze.c $(LIBS)
+
+ dumpanal: dumpanal.c xdr.o $(HFILES)
+- $(CC) $(CFLAGS) -o dumpanal $(OPT) $(DEFS) $(LDFLAGS1) dumpanal.c xdr.o $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o dumpanal $(OPT) $(DEFS) $(LDFLAGS1) dumpanal.c xdr.o $(LIBS)
+
+ dumpext: dumpext.c xdr.o utlsup.o matrix.o $(LIBOBJS) $(HFILES)
+- $(CC) $(CFLAGS) -o dumpext $(OPT) $(DEFS) $(LDFLAGS1) dumpext.c xdr.o utlsup.o matrix.o $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o dumpext $(OPT) $(DEFS) $(LDFLAGS1) dumpext.c xdr.o utlsup.o matrix.o $(LIBOBJS) $(LIBS)
+
+ dumpconv: dumpconv.c xdr.o $(HFILES)
+- $(CC) $(CFLAGS) -o dumpconv $(OPT) $(DEFS) $(LDFLAGS1) dumpconv.c xdr.o $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o dumpconv $(OPT) $(DEFS) $(LDFLAGS1) dumpconv.c xdr.o $(LIBS)
+
+ #mdtraj: mdtraj.o $(SHAKOBJS) $(LIBOBJS)
+ # $(CC) -o mdtraj $(LDFLAGS) mdtraj.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+@@ -142,21 +142,21 @@ mdshak: mdshak.o $(SHAKOBJS) $(LIBOBJS)
+ $(CC) -o mdshak $(LDFLAGS) mdshak.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+
+ msd: msd.o $(SHAKOBJS) $(LIBOBJS)
+- $(CC) -o msd $(LDFLAGS1) msd.o $(SHAKOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) -o msd $(LDFLAGS1) msd.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+
+ mdvaf: mdvaf.o $(SHAKOBJS) $(LIBOBJS)
+- $(CC) -o mdvaf $(LDFLAGS1) mdvaf.o $(SHAKOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) -o mdvaf $(LDFLAGS1) mdvaf.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+ mdavpos: mdavpos.o $(SHAKOBJS) $(LIBOBJS)
+- $(CC) -o mdavpos $(LDFLAGS1) mdavpos.o $(SHAKOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) -o mdavpos $(LDFLAGS1) mdavpos.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+
+ mdbond: mdbond.o $(SHAKOBJS) $(LIBOBJS)
+- $(CC) -o mdbond $(LDFLAGS1) mdbond.o $(SHAKOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) -o mdbond $(LDFLAGS1) mdbond.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+
+ bdist: bdist.c $(HFILES)
+- $(CC) $(CFLAGS) -o bdist $(OPT) $(DEFS) $(LDFLAGS1) bdist.c $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o bdist $(OPT) $(DEFS) $(LDFLAGS1) bdist.c $(LIBOBJS) $(LIBS)
+
+ ransub: ransub.o $(SHAKOBJS) $(LIBOBJS)
+- $(CC) -o ransub $(LDFLAGS1) ransub.o $(SHAKOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS)
++ $(CC) $(LDFLAGS) -o ransub $(LDFLAGS1) ransub.o $(SHAKOBJS) $(LIBOBJS) $(LIBS)
+
+ utilities: $(UTILS) $(UTILS2)
+
diff --git a/sci-chemistry/moldy/metadata.xml b/sci-chemistry/moldy/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/moldy/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/moldy/moldy-2.16e-r2.ebuild b/sci-chemistry/moldy/moldy-2.16e-r2.ebuild
new file mode 100644
index 000000000000..27db651f82a3
--- /dev/null
+++ b/sci-chemistry/moldy/moldy-2.16e-r2.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 toolchain-funcs
+
+DESCRIPTION="Molecular dynamics simulations platform"
+HOMEPAGE="http://www.ccp5.ac.uk/moldy/moldy.html"
+SRC_URI="ftp://ftp.earth.ox.ac.uk/pub/keith/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="doc examples"
+
+DEPEND="doc? ( virtual/latex-base )"
+RDEPEND=""
+
+S="${WORKDIR}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-as-needed.patch
+ sed \
+ -e 's:-O2::g' \
+ -e 's:-ffast-math::g' \
+ -i configure || die
+}
+
+src_configure() {
+ #Individuals may want to edit the OPT* variables below.
+ #From the READ.ME:
+ #You may need to "hand-tune" compiler or optimization options,
+ #which may be specified by setting the OPT and OPT2 environment
+ #variables. OPT2 is used to compile only the most performance-critical
+ #modules and usually will select a very high level of optimization.
+ #It should be safe to select an optimization which means "treat all
+ #function arguments as restricted pointers which are not aliased to
+ #any other object". OPT is used for less preformance-critical modules
+ #and may be set to a lower level of optimization than OPT2.
+
+ OPT="${CFLAGS}" \
+ OPT2="${CFLAGS} ${CFLAGS_OPT}" \
+ CC=$(tc-getCC) \
+ econf
+}
+
+src_compile() {
+ emake
+ # To prevent sandbox violations by metafont
+ if use doc; then
+ VARTEXFONTS="${T}"/fonts emake moldy.pdf
+ fi
+}
+
+src_install() {
+ dodir /usr/bin
+ emake prefix="${ED}"/usr install
+ dodoc BENCHMARK READ.ME RELNOTES
+
+ if use examples; then
+ rm Makefile.in configure.in config.h.in
+ insinto /usr/share/${PN}/examples/
+ doins *.in *.out control.* || die
+ fi
+ if use doc; then
+ insinto /usr/share/doc/${PF}/pdf
+ newins moldy.pdf moldy-manual.pdf
+ fi
+}
diff --git a/sci-chemistry/molequeue/Manifest b/sci-chemistry/molequeue/Manifest
new file mode 100644
index 000000000000..8511144b0f00
--- /dev/null
+++ b/sci-chemistry/molequeue/Manifest
@@ -0,0 +1 @@
+DIST molequeue-0.7.1.tar.gz 658745 SHA256 cdf184936a73e382b8cbff02768b9a04a3a64fec658d6dde4f6574236a73d3bf SHA512 09bdd45c1b2833be3a4f4cd3a0ade8d51276f8da150b0206d9c4a0d3b4999c58bc6cb3df48b9be70907d47c11bbd22aacc7c8d9ae401aa2f21a43405d6a8e3cd WHIRLPOOL 7ea17582495145b9d616bf1df58fbae3d4a6876c1490d5efdcefae1804cf7d29b08543a112ac7c033e2d2e18aa1537ed73a80f75484c90c7319f52dd469b5812
diff --git a/sci-chemistry/molequeue/metadata.xml b/sci-chemistry/molequeue/metadata.xml
new file mode 100644
index 000000000000..e7326743bc35
--- /dev/null
+++ b/sci-chemistry/molequeue/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+MoleQueue is an open-source, cross-platform, system-tray resident desktop
+application for abstracting, managing, and coordinating the execution of tasks
+both locally and on remote computational resources. It is built and tested and
+Linux, Mac OS X, and Windows, with nightly binaries currently available for
+Mac OS X and Windows. Users can set up local and remote queues that describe
+where the task will be executed. Each queue can have programs, with templates
+to facilitate the execution of the program. Input files can be staged, and
+output files collected using a standard interface.
+</longdescription>
+ <use>
+ <flag name="zeromq">Build with <pkg>net-libs/zeromq</pkg> support</flag>
+ <flag name="client">Build the client application</flag>
+ <flag name="server">Build the serve application</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">molequeue</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/molequeue/molequeue-0.7.1.ebuild b/sci-chemistry/molequeue/molequeue-0.7.1.ebuild
new file mode 100644
index 000000000000..a7700f58577a
--- /dev/null
+++ b/sci-chemistry/molequeue/molequeue-0.7.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils multilib python-single-r1 versionator virtualx
+
+DESCRIPTION="Abstract, manage and coordinate execution of tasks"
+HOMEPAGE="http://www.openchemistry.org/OpenChemistry/project/molequeue.html"
+SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+client doc server test +zeromq"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ server? ( client )
+ test? ( server )"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ zeromq? ( net-libs/cppzmq:0= )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable test TESTING)
+ $(cmake-utils_use_use zeromq ZERO_MQ)
+ $(cmake-utils_use_build doc DOCUMENTATION)
+ $(cmake-utils_use client MoleQueue_BUILD_CLIENT)
+ $(cmake-utils_use server MoleQueue_BUILD_APPLICATION)
+ -DINSTALL_LIBRARY_DIR=$(get_libdir)
+ )
+ use zeromq && \
+ mycmakeargs+=( -DZeroMQ_ROOT_DIR=\"${EPREFIX}/usr\" )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile all $(usex doc documentation "")
+}
+
+src_test() {
+ VIRTUALX_COMMAND=cmake-utils_src_test
+ virtualmake
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${BUILD_DIR}"/docs/html/. )
+ cmake-utils_src_install
+}
diff --git a/sci-chemistry/molmol/Manifest b/sci-chemistry/molmol/Manifest
new file mode 100644
index 000000000000..3b9280e4b834
--- /dev/null
+++ b/sci-chemistry/molmol/Manifest
@@ -0,0 +1,2 @@
+DIST molmol-2k.2.0-doc.tar.gz 1062297 SHA256 07e1c3fd04ffe7c9e9d91eaefa0bf72e6d0913a981eec3bf0879bfc65537a6be SHA512 131f747a5762859398ebe9b676a07df56c82c8864ecc035ec914f1dea74dafcd67f87993421dfe5899c640470c7e1e1ef03ae262b04a9b360ae329eb19a331fe WHIRLPOOL b74f47149c4dce8199722075fda17c9cbe22263eec57b647ef543b15386d53b267ee85d5a2c44a4fda7e533fd6ccdafb82fbbbd71e671ec4e1fd58e07363677c
+DIST molmol-2k.2.0-src.tar.gz 1088805 SHA256 1104dcb1b2517581c7d6b1695ff2e92f4076ad34afc48dd896eec38e5acf2287 SHA512 6ab01a6fd3d19752634a2cf22919a20e43d195768bd4bdacd5f0bbe016c3058c94915bad4c7fa64dcd86576be39cad0ae112cb62f5e69ffb10041518101e7a9b WHIRLPOOL e258ede83ac4a8fe9b4a9274588ced7e1294415d864c909ed83e3e56d36512e1388e6f77e45da614bc19992a265d32b739c54aace7faa28971c61a01bba27541
diff --git a/sci-chemistry/molmol/files/cast.patch b/sci-chemistry/molmol/files/cast.patch
new file mode 100644
index 000000000000..16ac411c76e5
--- /dev/null
+++ b/sci-chemistry/molmol/files/cast.patch
@@ -0,0 +1,21 @@
+diff --git a/src/data/DataDist.c b/src/data/DataDist.c
+index 7f7121f..18eef33 100644
+--- a/src/data/DataDist.c
++++ b/src/data/DataDist.c
+@@ -27,6 +27,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <stdint.h>
+
+ #include <hashtab.h>
+
+@@ -89,7 +90,7 @@ hashInter(void *p, unsigned size)
+ {
+ TabEntryInter *entryP = p;
+
+- return ((unsigned) entryP->atom1P + (unsigned) entryP->atom2P) % size;
++ return ((unsigned)(uintptr_t) entryP->atom1P + (unsigned)(uintptr_t) entryP->atom2P) % size;
+ }
+
+ static int
diff --git a/sci-chemistry/molmol/files/ldflags.patch b/sci-chemistry/molmol/files/ldflags.patch
new file mode 100644
index 000000000000..ff6e06ef490c
--- /dev/null
+++ b/sci-chemistry/molmol/files/ldflags.patch
@@ -0,0 +1,13 @@
+diff --git a/src/main/Makefile b/src/main/Makefile
+index 74530fa..102d1b7 100644
+--- a/src/main/Makefile
++++ b/src/main/Makefile
+@@ -22,7 +22,7 @@ SRC = $(OBJ:.o=.c)
+ default: $(PROGRAM)
+
+ $(PROGRAM): $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB)
+- $(CC) -o $@ $(CFLAGS) $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB) $(SYSLIB)
++ $(CC) $(CFLAGS) ${LDFLAGS} -o $@ $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB) $(SYSLIB)
+
+ clean:
+ rm -f $(OBJ) $(PROGRAM) core *.ps
diff --git a/sci-chemistry/molmol/files/libpng15.patch b/sci-chemistry/molmol/files/libpng15.patch
new file mode 100644
index 000000000000..cd27e4906608
--- /dev/null
+++ b/sci-chemistry/molmol/files/libpng15.patch
@@ -0,0 +1,32 @@
+--- src/motogl/MotOGLDump.c
++++ src/motogl/MotOGLDump.c
+@@ -248,7 +248,7 @@
+ pngErrHand(png_structp pngStrucP, char *errMsg)
+ {
+ IORaiseError(errMsg);
+- longjmp(pngStrucP->jmpbuf, 1);
++ longjmp(png_jmpbuf(pngStrucP), 1);
+ }
+ #endif
+
+@@ -357,7 +357,7 @@
+ return IO_RES_ERR;
+ }
+
+- if (setjmp(pngStrucP->jmpbuf)) {
++ if (setjmp(png_jmpbuf(pngStrucP))) {
+ if (cBuf != NULL)
+ free(cBuf);
+ if (fBuf != NULL)
+@@ -368,10 +368,7 @@
+
+ png_init_io(pngStrucP, ImgFileP);
+
+- pngInfoP->width = imgW;
+- pngInfoP->height = imgH;
+- pngInfoP->bit_depth = 8;
+- pngInfoP->color_type = PNG_COLOR_TYPE_RGB;
++ png_set_IHDR(pngStrucP, pngInfoP, imgW, imgH, 8, PNG_COLOR_TYPE_RGB, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ png_write_info(pngStrucP, pngInfoP);
+ }
+ #endif
diff --git a/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch b/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
new file mode 100644
index 000000000000..14cc83b63e9e
--- /dev/null
+++ b/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
@@ -0,0 +1,356 @@
+ src/calc/CalcRmsd.c | 8 ++++----
+ src/cmdfig/FigUtil.c | 46 +++++++++++++++++++++++-----------------------
+ src/cmdio/ExWriteSec.c | 6 +++---
+ src/data/DataDist.c | 2 +-
+ src/data/DataHand.c | 8 ++++----
+ src/expr/ExprScan.c | 2 +-
+ src/iodev/IODev.c | 2 --
+ src/motif/MotifDial.c | 2 +-
+ src/motif/MotifMainW.c | 4 ++--
+ src/os/GFile.c | 2 +-
+ src/prim/PrimDraw.c | 2 +-
+ src/prim/RibbonCalc.c | 12 ++++++------
+ src/pudev/PuMainW.c | 2 +-
+ src/tty/TTY.c | 2 +-
+ tools/src/IsoSurface.c | 22 +++++++++++-----------
+ 15 files changed, 60 insertions(+), 62 deletions(-)
+
+diff --git a/src/calc/CalcRmsd.c b/src/calc/CalcRmsd.c
+index 0e4629e..ed99e76 100644
+--- a/src/calc/CalcRmsd.c
++++ b/src/calc/CalcRmsd.c
+@@ -1025,10 +1025,10 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
+ }
+
+ for (propI = 0; propI < 2; propI++) {
+- if (groupNo == 0 || propI == 0 && ! calc1)
++ if (groupNo == 0 || (propI == 0 && ! calc1))
+ continue;
+
+- if (groupNo == 0 || propI == 1 && ! calc2)
++ if (groupNo == 0 || (propI == 1 && ! calc2))
+ continue;
+
+ Report("\nAverage RMSD, dev., min. and max of ");
+@@ -1052,8 +1052,8 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
+ Report(" ");
+
+ for (groupI2 = 0; groupI2 < groupNo; groupI2++) {
+- if (groupI1 < groupI2 &&
+- groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo ||
++ if (((groupI1 < groupI2) &&
++ (groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo)) ||
+ groupInfoP[groupI1].membNo == 0 ||
+ groupInfoP[groupI2].membNo == 0) {
+ groupInfoP[groupI2].stat.avg = 0.0f;
+diff --git a/src/cmdfig/FigUtil.c b/src/cmdfig/FigUtil.c
+index 20d403a..b8dc3a6 100644
+--- a/src/cmdfig/FigUtil.c
++++ b/src/cmdfig/FigUtil.c
+@@ -44,29 +44,29 @@ typedef struct {
+ } TabEntry;
+
+ static TabEntry GreekTab[] = {
+- "ALPHA", 'a',
+- "BETA", 'b',
+- "CHI", 'c',
+- "DELTA", 'd',
+- "EPSILON", 'e',
+- "PHI" , 'f',
+- "GAMMA", 'g',
+- "ETA", 'h',
+- "IOTA", 'i',
+- "KAPPA", 'k',
+- "LAMBDA", 'l',
+- "MU", 'm',
+- "NU", 'n',
+- "PI", 'p',
+- "THETA", 'q',
+- "RHO", 'r',
+- "SIGMA", 's',
+- "TAU", 't',
+- "UPSILON", 'u',
+- "OMEGA", 'w',
+- "XI", 'x',
+- "PSI", 'y',
+- "ZETA", 'z'
++ {"ALPHA", 'a'},
++ {"BETA", 'b'},
++ {"CHI", 'c'},
++ {"DELTA", 'd'},
++ {"EPSILON", 'e'},
++ {"PHI" , 'f'},
++ {"GAMMA", 'g'},
++ {"ETA", 'h'},
++ {"IOTA", 'i'},
++ {"KAPPA", 'k'},
++ {"LAMBDA", 'l'},
++ {"MU", 'm'},
++ {"NU", 'n'},
++ {"PI", 'p'},
++ {"THETA", 'q'},
++ {"RHO", 'r'},
++ {"SIGMA", 's'},
++ {"TAU", 't'},
++ {"UPSILON", 'u'},
++ {"OMEGA", 'w'},
++ {"XI", 'x'},
++ {"PSI", 'y'},
++ {"ZETA", 'z'}
+ };
+
+ int
+diff --git a/src/cmdio/ExWriteSec.c b/src/cmdio/ExWriteSec.c
+index 7f705d4..8da8336 100644
+--- a/src/cmdio/ExWriteSec.c
++++ b/src/cmdio/ExWriteSec.c
+@@ -250,9 +250,9 @@ writeSecondary(DhResP *resPA, int resNo)
+
+ if (neighLStart != NO_RES) {
+ if (num != neighLEnd + 1 ||
+- neighNum != neighREnd + 1 && neighNum != neighREnd - 1 ||
+- neighREnd > neighRStart && neighNum != neighREnd + 1 ||
+- neighREnd < neighRStart && neighNum != neighREnd - 1) {
++ (neighNum != neighREnd + 1 && neighNum != neighREnd - 1) ||
++ (neighREnd > neighRStart && neighNum != neighREnd + 1) ||
++ (neighREnd < neighRStart && neighNum != neighREnd - 1)) {
+ writeNeigh(neighLStart, neighLEnd, neighRStart, neighREnd);
+ neighLStart = NO_RES;
+ } else {
+diff --git a/src/data/DataDist.c b/src/data/DataDist.c
+index 18eef33..c683f9e 100644
+--- a/src/data/DataDist.c
++++ b/src/data/DataDist.c
+@@ -117,7 +117,7 @@ fillIntra(TabEntryIntra *entryP, DhAtomP atom1P, DhAtomP atom2P)
+ entryP->atom2I = DhAtomGetNumber(atom2P);
+
+ if (entryP->res1I > entryP->res2I ||
+- entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I) {
++ (entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I)) {
+ t = entryP->res1I;
+ entryP->res1I = entryP->res2I;
+ entryP->res2I = t;
+diff --git a/src/data/DataHand.c b/src/data/DataHand.c
+index b20e29c..368aad3 100644
+--- a/src/data/DataHand.c
++++ b/src/data/DataHand.c
+@@ -2043,8 +2043,8 @@ applyBondList(PropRefP refP, LINLIST bondL, int groupNum,
+ groupNum1 = getGroupNum(bondAddP->res1P->molP);
+ groupNum2 = getGroupNum(bondAddP->res2P->molP);
+ if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
+- (groupNum1 == groupNum && groupNum2 == groupNum ||
+- groupNum < 0 && groupNum1 != groupNum2))
++ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
++ (groupNum < 0 && groupNum1 != groupNum2)))
+ applyF(bondP, atom1P, atom2P, clientData);
+ }
+ bondAddP = nextBondAddP;
+@@ -2367,8 +2367,8 @@ callDistApply(PropRefP refP, DhDistP distP, int groupNum,
+ groupNum1 = getGroupNum(distP->res1P->molP);
+ groupNum2 = getGroupNum(distP->res2P->molP);
+ if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
+- (groupNum1 == groupNum && groupNum2 == groupNum ||
+- groupNum < 0 && groupNum1 != groupNum2))
++ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
++ (groupNum < 0 && groupNum1 != groupNum2)))
+ applyF(distP, atom1P, atom2P, clientData);
+ }
+ }
+diff --git a/src/expr/ExprScan.c b/src/expr/ExprScan.c
+index dcef69e..6266b4d 100644
+--- a/src/expr/ExprScan.c
++++ b/src/expr/ExprScan.c
+@@ -221,7 +221,7 @@ ExprScanGetSym(void)
+ for (;;) {
+ if (isdigit(ch)) {
+ DStrAppChar(StrVal, ch);
+- } else if (ch == '.' && ExprStr[1] != '.' ||
++ } else if ((ch == '.' && ExprStr[1] != '.') ||
+ ch == 'e' || ch == 'E') {
+ DStrAppChar(StrVal, ch);
+ isFloat = TRUE;
+diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c
+index 9c04ce8..aa4f9a7 100644
+--- a/src/iodev/IODev.c
++++ b/src/iodev/IODev.c
+@@ -44,7 +44,6 @@ extern void IOMotifGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ extern void IOMotifOGLSetDev(void);
+-extern void IOMotifOGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ extern void IOMotifXGLSetDev(void);
+@@ -76,7 +75,6 @@ static DevListEntry DevList[] = {
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ {"Motif/OpenGL", IOMotifOGLSetDev},
+- {"Motif/OpenGLD", IOMotifOGLDSetDev},
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ {"Motif/XGL", IOMotifXGLSetDev},
+diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c
+index 2514549..6e3bfd7 100644
+--- a/src/motif/MotifDial.c
++++ b/src/motif/MotifDial.c
+@@ -1323,7 +1323,7 @@ PuMotifAddGizmoCB(PuGizmo gizmo, PuGizmoCBType type,
+
+ switch (type) {
+ case PU_CT_ACTIVATE:
+- if (gType == GIZMO_TEXT_FIELD || GIZMO_TEXT)
++ if (gType == (GIZMO_TEXT_FIELD | GIZMO_TEXT))
+ XtAddCallback(gizmo, XmNactivateCallback, textActivateCB, infoP);
+ else if (gType == GIZMO_BUTTON)
+ XtAddCallback(gizmo, XmNactivateCallback, gizmoGenCB, infoP);
+diff --git a/src/motif/MotifMainW.c b/src/motif/MotifMainW.c
+index abbb444..77ce8fd 100644
+--- a/src/motif/MotifMainW.c
++++ b/src/motif/MotifMainW.c
+@@ -80,8 +80,8 @@ checkPressOrExpose(Display *dpy, XEvent *eventP, XPointer arg)
+ {
+ Window *winP = (Window *) arg;
+
+- return eventP->type == ButtonPress && eventP->xbutton.window == *winP ||
+- eventP->type == Expose && eventP->xexpose.window == *winP;
++ return (eventP->type == ButtonPress && eventP->xbutton.window == *winP) ||
++ (eventP->type == Expose && eventP->xexpose.window == *winP);
+ }
+
+ static void
+diff --git a/src/os/GFile.c b/src/os/GFile.c
+index d0d63b6..08d48c7 100644
+--- a/src/os/GFile.c
++++ b/src/os/GFile.c
+@@ -385,7 +385,7 @@ GFileEOF(GFile gf)
+ {
+ if (gf->format == GF_FORMAT_MEMORY)
+ return gf->currP == NULL ||
+- gf->currP->nextP == NULL && gf->currPos == gf->currP->len;
++ (gf->currP->nextP == NULL && gf->currPos == gf->currP->len);
+ else
+ return feof(gf->fp);
+ }
+diff --git a/src/prim/PrimDraw.c b/src/prim/PrimDraw.c
+index 32bd593..ba89c57 100644
+--- a/src/prim/PrimDraw.c
++++ b/src/prim/PrimDraw.c
+@@ -461,7 +461,7 @@ drawRibbon(PrimObjP primP)
+ }
+
+ if (partP->paint == RP_ATOM ||
+- partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0)
++ (partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0))
+ SgSetColor(attrP->colR, attrP->colG, attrP->colB);
+
+ if (partP->paint == RP_ATOM_SMOOTH)
+diff --git a/src/prim/RibbonCalc.c b/src/prim/RibbonCalc.c
+index 09874cf..0849d03 100644
+--- a/src/prim/RibbonCalc.c
++++ b/src/prim/RibbonCalc.c
+@@ -907,7 +907,7 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
+ getSplinePoints(partP, ribbonP, ePar, partP->endPar, ePNo + 1,
+ parA + sPNo + mPNo - 1, xA + sPNo + mPNo - 1, dzA + sPNo + mPNo - 1);
+
+- if (partP->style == RS_ROUND && partP->midRad == 0.0f ||
++ if ((partP->style == RS_ROUND && partP->midRad == 0.0f) ||
+ BreakInterrupted()) {
+ /* draw only one line */
+ partP->traceNo = 1;
+@@ -1128,15 +1128,15 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
+ Vec3Copy(partP->traceA[traceI].nvA[pointI], nv);
+ }
+
+- if (pointI == 0 && partP->startStyle == RE_SHARP ||
+- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)
++ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
++ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW))
+ Vec3Copy(partP->polyA[polyI].xA[traceNo - 1 - traceI], x);
+ else if (pointI == pointNo - 1 && partP->endStyle == RE_SHARP)
+ Vec3Copy(partP->polyA[polyI].xA[traceI], x);
+ }
+
+- if (pointI == 0 && partP->startStyle == RE_SHARP ||
+- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW) {
++ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
++ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)) {
+ Vec3Copy(x, dy);
+ Vec3Cross(x, dx);
+ Vec3Copy(partP->polyA[polyI].nv, x);
+@@ -1327,7 +1327,7 @@ RibbonCalc(PrimObjP primP)
+
+ if (! partP->pointValid || prec != partP->prec ||
+ startRad != partP->startRad ||
+- partP->style == RS_ROUND && midRad != partP->midRad ||
++ (partP->style == RS_ROUND && midRad != partP->midRad) ||
+ endRad != partP->endRad || radChanged) {
+ for (i = 0; i < partP->traceNo; i++) {
+ free(partP->traceA[i].xA);
+diff --git a/src/pudev/PuMainW.c b/src/pudev/PuMainW.c
+index 73d183b..d287345 100644
+--- a/src/pudev/PuMainW.c
++++ b/src/pudev/PuMainW.c
+@@ -57,7 +57,7 @@ PuSetTextField(PuTextFieldChoice fieldChoice, char *text)
+ if (text[0] != LOCK_CHAR)
+ return;
+ text++;
+- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0') {
++ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0')) {
+ StatusLocked = FALSE;
+ text = " ";
+ }
+diff --git a/src/tty/TTY.c b/src/tty/TTY.c
+index 0090f75..22adfef 100644
+--- a/src/tty/TTY.c
++++ b/src/tty/TTY.c
+@@ -164,7 +164,7 @@ PuTTYSwitchFullscreen(BOOL onOff)
+ void
+ PuTTYSetTextField(PuTextFieldChoice fieldChoice, char *text)
+ {
+- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0')
++ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0'))
+ return;
+
+ switch (fieldChoice) {
+diff --git a/tools/src/IsoSurface.c b/tools/src/IsoSurface.c
+index 5e11a98..09f89d0 100644
+--- a/tools/src/IsoSurface.c
++++ b/tools/src/IsoSurface.c
+@@ -104,19 +104,19 @@ typedef struct {
+ } Strip;
+
+ static CubeDesc CubeEven = {
+- 0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
+- 3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}},
+- 0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}},
+- 3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}},
+- 5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}
++ {{0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
++ {3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}}},
++ {0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}}},
++ {3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}}},
++ {5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}}}
+ };
+
+ static CubeDesc CubeOdd = {
+- 1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
+- 2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}},
+- 1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}},
+- 2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}},
+- 7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}
++ {{1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
++ {2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}}},
++ {1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}}},
++ {2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}}},
++ {7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}}}
+ };
+
+ static BOOL Initialized = FALSE;
+@@ -158,7 +158,7 @@ fillFaces(TetDesc *tetP)
+ static BOOL
+ equalPair(int i00, int i01, int i10, int i11)
+ {
+- return i00 == i10 && i01 == i11 || i00 == i11 && i01 == i10;
++ return (i00 == i10 && i01 == i11) || (i00 == i11 && i01 == i10);
+ }
+
+ static int
diff --git a/sci-chemistry/molmol/files/opengl.patch b/sci-chemistry/molmol/files/opengl.patch
new file mode 100644
index 000000000000..c1db35d9013d
--- /dev/null
+++ b/sci-chemistry/molmol/files/opengl.patch
@@ -0,0 +1,96 @@
+ molmol | 65 +++++++++--------------------------------------------------------
+ 1 file changed, 9 insertions(+), 56 deletions(-)
+
+diff --git a/molmol b/molmol
+index 7863225..b6c75ce 100755
+--- a/molmol
++++ b/molmol
+@@ -11,55 +11,8 @@ ostype=`uname`
+ osrel=`uname -r`
+ osmaj=`echo $osrel | awk -F. '{print $1}'`
+ osmin=`echo $osrel | awk -F. '{print $2}'`
+-localdev=
+-glxdev=
+-
+-if [ $ostype = "IRIX" -o $ostype = "IRIX64" ]; then
+- if [ $osmaj -eq 6 -a $osmin -ge 2 -o $osmaj -gt 6 ]; then
+- arch=sgi6
+- localdev=Motif/OpenGL
+- glxdev=Motif/OpenGL
+- elif [ $osmaj -eq 5 -a $osmin -ge 3 -o $osmaj -gt 5 ]; then
+- arch=sgi5
+- localdev=Motif/OpenGL
+- glxdev=Motif/OpenGL
+- else
+- arch=sgi4
+- localdev=Motif/GL
+- fi
+- MONITOR=72HZ; export MONITOR
+-elif [ $ostype = "AIX" ]; then
+- arch=aix
+- localdev=Motif/OpenGL
+-elif [ $ostype = "HP-UX" ]; then
+- arch=hp
+- localdev=Motif/OpenGL
+- glxdev=Motif/OpenGL
+-elif [ $ostype = "OSF1" ]; then
+- arch=dec
+- localdev=Motif/OpenGL
+-elif [ $ostype = "Linux" ]; then
+- arch=lnx
+- localdev=Motif/OpenGL
+-elif [ $ostype = "SunOS" ]; then
+- if [ $osmaj -eq 5 -a $osmin -ge 4 -o $osmaj -gt 5 ]; then
+- arch=sol
+- localdev=Motif/OpenGL
+- else
+- arch=sun
+- fi
+-else
+- arch=unknown
+-fi
+-
+-if [ $ostype = "SunOS" ]; then
+- xdpy=/usr/openwin/bin/xdpyinfo
+-elif [ $ostype = "HP-UX" ]; then
+- xdpy=/usr/contrib/bin/X11/xdpyinfo
+-else
+- xdpy=/usr/bin/X11/xdpyinfo
+-fi
+-
++localdev=Motif/OpenGL
++glxdev=Motif/OpenGL
+ printUsage () {
+ echo "Usage: molmol -ht2as [-o dev] [-r range] [-f macro] files"
+ echo ""
+@@ -121,15 +74,15 @@ done
+
+ magictmp=/tmp/molmol_magic$$
+
+-if [ ! -d $HOME/molmol ]; then
+- mkdir $HOME/molmol
++if [ ! -d $HOME/.molmol ]; then
++ mkdir $HOME/.molmol
+ fi
+-startmacro=$HOME/molmol/options.mac
++startmacro=$HOME/.molmol/options.mac
+ cp /dev/null $startmacro
+
+ if [ -n "$*" ]; then
+- if [ -f $HOME/molmol/dump ]; then
+- mv -f $HOME/molmol/dump $HOME/molmol/dump.old
++ if [ -f $HOME/.molmol/dump ]; then
++ mv -f $HOME/.molmol/dump $HOME/.molmol/dump.old
+ fi
+ echo "0 long 0x3b7a12f9 MOLMOL" > $magictmp
+ echo "0 long 0xf9127a3b MOLMOL" >> $magictmp
+@@ -209,7 +162,7 @@ elif [ -x $xdpy ]; then
+ fi
+
+ if [ "$input" = "-" -o -n "$nograph" ]; then
+- $MOLMOLHOME/molmol.$arch $xopt
++ $MOLMOLHOME/molmol $xopt
+ else
+- $MOLMOLHOME/molmol.$arch $xopt < /dev/null
++ $MOLMOLHOME/molmol $xopt < /dev/null
+ fi
diff --git a/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff b/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff
new file mode 100644
index 000000000000..0ad57d93e107
--- /dev/null
+++ b/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff
@@ -0,0 +1,103 @@
+Only in molmol_rh9: makedef
+diff -ru molmol_rh9_unpatched/makedef.lnx molmol_rh9/makedef.lnx
+--- molmol_rh9_unpatched/makedef.lnx 2003-01-20 16:10:18.000000000 -0500
++++ molmol_rh9/makedef.lnx 2003-05-06 10:40:08.000000000 -0400
+@@ -1,31 +1,38 @@
+ # definitions for Linux
+
+-MISSFUNC = -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow \
+- -Dsinf=sin -Dcosf=cos -Dtanf=tan \
+- -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 \
+- -Dfabsf=fabs -Dceilf=ceil
+-MCPPFLAGS = $(MISSFUNC)
+-MCFLAGS = -O2
+-
+-RANLIB = /bin/true
+-WAIT = /usr/bin/sleep 2
+-SHELL = /bin/sh
+-CPP = /lib/cpp
+-CC = /usr/bin/gcc
++#TIFFDIR = $(TOP)/tiff-v3.4/libtiff
++#JPEGDIR = $(TOP)/../libjpeg/jpeg-6a
++#PNGDIR = $(TOP)/../libpng/libpng-0.89c
++#ZLIBDIR = $(TOP)/../libpng/zlib-1.0.2
++
++IMGDEF = -DTIFF_SUPPORT -DJPEG_SUPPORT -DPNG_SUPPORT
++IMGLIB = -ltiff -ljpeg -lpng -lz
++IMGINCL = # -I$(TIFFDIR) -I$(JPEGDIR) -I$(PNGDIR) -I$(ZLIBDIR)
++
++XINCL = -I/usr/X11R6/include
++
++CC=gcc
++MCPPFLAGS =
++MCFLAGS =-pipe -O3 -ffast-math -march=i686 -mcpu=i686
++
++RANLIB = /bin/true
++WAIT = sleep 2
++SHELL = /bin/sh
++CPP = /lib/cpp
+
+-SGDEVDIR = x11 no pov rib vrml1 vrml2 ps fm
+-
+-SGDEVDEF = -DSG_DEV_X11 -DSG_DEV_NO -DSG_DEV_POV -DSG_DEV_RIB -DSG_DEV_VRML1 -DSG_DEV_VRML2 -DSG_DEV_PS -DSG_DEV_CPS -DSG_DEV_FM3 -DSG_DEV_FM4
++SGDEVDIR = ogl x11 no pov rib vrml1 vrml2 ps fm
++SGDEVDEF = -DSG_DEV_OGL -DSG_DEV_X11 -DSG_DEV_NO -DSG_DEV_POV -DSG_DEV_RIB -DSG_DEV_VRML1 -DSG_DEV_VRML2 -DSG_DEV_PS -DSG_DEV_CPS -DSG_DEV_FM3 -DSG_DEV_FM4
+
+ PUDEVDIR = motif tty
+ PUDEVDEF = -DPU_DEV_MOTIF -DPU_DEV_TTY
+
+-IODEVDIR = motx11 ttyno
+-IODEVDEF = -DIO_DEV_MOTIF_X11 -DIO_DEV_TTY_NO
++IODEVDIR = motogl motx11 ttyno
++IODEVDEF = -DIO_DEV_MOTIF_OGL -DIO_DEV_MOTIF_X11 -DIO_DEV_TTY_NO
+
++OPENGLDEF = -DOPENGL_SGI_STEREO
+ MOTIFDEF = -DFUNCPROTO
+
+-SYSLIB = -L/usr/X11R6/lib -lXm -lXt -lXpm -lX11 -lm -lc -lieee
++SYSLIB = -lGLw -lGLU -lGL -lXm -lXpm -lXt -lXext -lX11 -lm
+
+ TOOLSDIR = $(TOP)/tools
+-SGDIR = $(TOP)/sg
++SGDIR = $(TOP)/sg
+diff -ru molmol_rh9_unpatched/src/motogl/MotOGL.c molmol_rh9/src/motogl/MotOGL.c
+--- molmol_rh9_unpatched/src/motogl/MotOGL.c 2000-05-29 12:31:51.000000000 -0400
++++ molmol_rh9/src/motogl/MotOGL.c 2003-05-06 11:51:05.000000000 -0400
+@@ -31,7 +31,7 @@
+ #include <Xm/XmStrDefs.h>
+
+ #define BOOL MOTIF_BOOL /* hack to avoid naming conflict */
+-#include <X11/GLw/GLwMDrawA.h>
++#include <GL/GLwMDrawA.h>
+ #undef BOOL
+
+ #include <sg.h>
+diff -ru molmol_rh9_unpatched/src/os/GFile.c molmol_rh9/src/os/GFile.c
+--- molmol_rh9_unpatched/src/os/GFile.c 2001-06-17 14:59:17.000000000 -0400
++++ molmol_rh9/src/os/GFile.c 2003-05-06 12:34:34.000000000 -0400
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <memory.h>
+ #include <ctype.h>
++#include <errno.h>
+
+ #include <linlist.h>
+
+@@ -38,7 +39,7 @@
+ const INT32 GFMagic = 0x3b7a12f9;
+
+ #ifndef __linux__
+-extern char *sys_errlist[];
++extern char *strerror();
+ #endif
+ extern int errno;
+
+@@ -81,7 +82,7 @@
+ {
+ if (msg == NULL) {
+ if (NextMsg == NULL)
+- msg = sys_errlist[errno];
++ msg = strerror(errno);
+ else
+ msg = NextMsg;
+ }
diff --git a/sci-chemistry/molmol/files/prefix.patch b/sci-chemistry/molmol/files/prefix.patch
new file mode 100644
index 000000000000..89f17b2e984e
--- /dev/null
+++ b/sci-chemistry/molmol/files/prefix.patch
@@ -0,0 +1,22 @@
+diff --git a/molmol b/molmol
+index e774abf..9f10558 100755
+--- a/molmol
++++ b/molmol
+@@ -57,7 +57,7 @@ if [ $ostype = "SunOS" ]; then
+ elif [ $ostype = "HP-UX" ]; then
+ xdpy=/usr/contrib/bin/X11/xdpyinfo
+ else
+- xdpy=/usr/bin/X11/xdpyinfo
++ xdpy=@GENTOO_PORTAGE_EPREFIX@/usr/bin/xdpyinfo
+ fi
+
+ printUsage () {
+@@ -119,7 +119,7 @@ while [ -n "$*" ]; do
+ esac
+ done
+
+-magictmp=/tmp/molmol_magic$$
++magictmp=@GENTOO_PORTAGE_EPREFIX@/tmp/molmol_magic$$
+
+ if [ ! -d $HOME/molmol ]; then
+ mkdir $HOME/molmol
diff --git a/sci-chemistry/molmol/files/wild.patch b/sci-chemistry/molmol/files/wild.patch
new file mode 100644
index 000000000000..8be9baf92203
--- /dev/null
+++ b/sci-chemistry/molmol/files/wild.patch
@@ -0,0 +1,1866 @@
+ include/cmd_dial.h | 1 +
+ include/cmd_io.h | 7 +-
+ include/cmd_struc.h | 1 +
+ include/curr_dir.h | 1 +
+ include/data_hand.h | 6 +
+ src/cip/cmd_tab.h | 3 +
+ src/cmddial/ExDialColor.c | 314 +++++++++++++++++++++++++++++++-----------
+ src/cmddial/ExDialRes.c | 340 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/cmddial/Makefile | 2 +-
+ src/cmdio/ExPdb.c | 70 +++++++++-
+ src/cmdstruc/ExBuild.c | 123 +++++++++++++++++
+ src/data/DataHand.c | 114 +++++++++++++++-
+ src/iodev/IODev.c | 2 +
+ src/main/MolInit.c | 5 +-
+ src/main/MolMol.c | 2 +-
+ src/motif/MotifDial.c | 32 ++---
+ src/motogl/MotOGLDump.c | 2 +-
+ src/os/CurrDir.c | 46 ++-----
+ src/os/ProgDir.c | 25 +++-
+ src/win/WinDial.c | 255 +++++++++++++++++-----------------
+ src/winogl/WinOGLDump.c | 7 +-
+ 21 files changed, 1073 insertions(+), 285 deletions(-)
+
+diff --git a/include/cmd_dial.h b/include/cmd_dial.h
+index f60e918..47fb8f8 100644
+--- a/include/cmd_dial.h
++++ b/include/cmd_dial.h
+@@ -29,6 +29,7 @@ extern ErrCode ExUserInterface(char *);
+
+ extern ErrCode ExDialColor(char *);
+ extern ErrCode ExDialMol(char *);
++extern ErrCode ExDialRes(char *);
+ extern ErrCode ExDialMeasure(char *);
+ extern ErrCode ExDialRmsd(char *);
+ extern ErrCode ExDialSelect(char *);
+diff --git a/include/cmd_io.h b/include/cmd_io.h
+index 79b173c..9a7b12c 100644
+--- a/include/cmd_io.h
++++ b/include/cmd_io.h
+@@ -30,15 +30,16 @@ extern ErrCode ExReadAng(char *);
+ extern ErrCode ExReadDg(char *);
+ extern ErrCode ExReadDump(char *);
+ extern ErrCode ExReadLib(char *);
+-extern ErrCode ExReadPdb(char *);
+-extern ErrCode ExReadSeq(char *);
+-extern ErrCode ExReadShift(char *);
+ extern ErrCode ExReadLimit(char *);
+ extern ErrCode ExReadListAng(char *);
+ extern ErrCode ExReadListDg(char *);
+ extern ErrCode ExReadListPdb(char *);
++extern ErrCode ExReadOldPdb(char *);
+ extern ErrCode ExReadOmap(char *);
++extern ErrCode ExReadPdb(char *);
+ extern ErrCode ExReadPot(char *);
++extern ErrCode ExReadSeq(char *);
++extern ErrCode ExReadShift(char *);
+ extern ErrCode ExReadSybyl(char *);
+ extern ErrCode ExReadXyz(char *);
+ extern ErrCode ExWriteAng(char *);
+diff --git a/include/cmd_struc.h b/include/cmd_struc.h
+index e0d729f..f4950b9 100644
+--- a/include/cmd_struc.h
++++ b/include/cmd_struc.h
+@@ -33,6 +33,7 @@ extern ErrCode ExAddDist(char *);
+ extern ErrCode ExAddLimit(char *);
+ extern ErrCode ExAddPseudo(char *);
+ extern ErrCode ExAddRes(char *);
++extern ErrCode ExMakeMolCyclic(char *);
+ extern ErrCode ExChangeRes(char *);
+ extern ErrCode ExFirstMol(char *);
+ extern ErrCode ExFlipAtom(char *);
+diff --git a/include/curr_dir.h b/include/curr_dir.h
+index c7895c4..04e404d 100644
+--- a/include/curr_dir.h
++++ b/include/curr_dir.h
+@@ -26,6 +26,7 @@
+ #ifndef _CURR_DIR_H_
+ #define _CURR_DIR_H_
+
++extern void CurrDirSet(char *dir);
+ extern char *CurrDirGet(void);
+
+ #endif /* _CURR_DIR_H_ */
+diff --git a/include/data_hand.h b/include/data_hand.h
+index 4462328..74a716a 100644
+--- a/include/data_hand.h
++++ b/include/data_hand.h
+@@ -112,6 +112,7 @@ extern void DhMolMoveFirst(DhMolP);
+ extern void DhMolDestroy(DhMolP);
+
+ extern DhResP DhResNew(DhMolP, DhResDefP, DhSeqPos);
++extern DhResP DhResNewCyclic(DhMolP, DhResDefP, DhSeqPos);
+ extern void DhResMutate(DhResP, DhResDefP, DhMutationKind);
+ extern void DhResSetNeigh(DhResP, DhNeighChoice, DhResP);
+ extern BOOL DhResDestroy(DhResP);
+@@ -287,6 +288,7 @@ extern void DhMolGetTransVect(DhMolP, Vec3);
+ extern MolAttrP DhMolGetAttr(DhMolP);
+
+ extern DSTR DhResGetName(DhResP);
++extern DhAtomP DhResGetAtomA(DhResP);
+ extern int DhResGetNumber(DhResP);
+
+ extern DSTR DhAtomGetName(DhAtomP);
+@@ -335,6 +337,10 @@ extern void DhResAnglesChanged(DhResP);
+ extern void DhResDockPrev(DhResP);
+ extern void DhResDockNext(DhResP);
+ extern void DhResCalcAtom(DhResP, DSTR);
++extern DhResP DhResPrev(DhResP resP);
++extern DhResP DhResNext(DhResP resP);
++extern DhResP DhResFirst(DhMolP molP);
++extern DhResP DhResLast(DhMolP molP);
+
+ /* dump/undump */
+
+diff --git a/src/cip/cmd_tab.h b/src/cip/cmd_tab.h
+index 0b73f65..cf7bc2a 100644
+--- a/src/cip/cmd_tab.h
++++ b/src/cip/cmd_tab.h
+@@ -108,6 +108,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
+ {"DialColor", ExDialColor, US_NONE},
+ {"DialMeasure", ExDialMeasure, US_NONE},
+ {"DialMol", ExDialMol, US_NONE},
++ {"DialRes", ExDialRes, US_NONE},
+ {"DialRmsd", ExDialRmsd, US_NONE},
+ {"DialSelect", ExDialSelect, US_NONE},
+ {"DialStyle", ExDialStyle, US_NONE},
+@@ -164,6 +165,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
+ {"ListSelectedDist", ExListSelected, US_NONE},
+ {"ListSelectedMol", ExListSelected, US_NONE},
+ {"ListSelectedRes", ExListSelected, US_NONE},
++ {"MakeMolCyclic", ExMakeMolCyclic, US_ALL},
+ {"MaterialAtom", ExMaterial, US_ALL},
+ {"MaterialBond", ExMaterial, US_ALL},
+ {"MaterialDist", ExMaterial, US_ALL},
+@@ -213,6 +215,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
+ {"ReadListDg", ExReadListDg, US_ALL},
+ {"ReadListPdb", ExReadListPdb, US_ALL},
+ {"ReadLol", ExReadLimit, US_ALL},
++ {"ReadOldPdb", ExReadOldPdb, US_ALL},
+ {"ReadOmap", ExReadOmap, US_ALL},
+ {"ReadPdb", ExReadPdb, US_ALL},
+ {"ReadPot", ExReadPot, US_ALL},
+diff --git a/src/cmddial/ExDialColor.c b/src/cmddial/ExDialColor.c
+index f960e1d..e827c4f 100644
+--- a/src/cmddial/ExDialColor.c
++++ b/src/cmddial/ExDialColor.c
+@@ -43,6 +43,9 @@
+ #define NAME_LEN 100
+ #define NUM_LEN 6
+ #define CMD_NO 7
++#define MAXRGBVALUE 255
++#define ICOLOR(c) (int) ((float)c * (float)MAXRGBVALUE)
++#define FCOLOR(c) (float) ((float)c / (float)MAXRGBVALUE)
+
+ #define EPS ((float) 1.0e-5)
+
+@@ -56,8 +59,8 @@ typedef struct {
+ static ColorDesc *ColorList;
+ static int ColorNo = 0;
+ static BOOL DialOn = FALSE;
+-static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo;
+-static DSTR NameStr = NULL, RStr, GStr, BStr;
++static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo, rGizmo, gGizmo, bGizmo;
++static DSTR NameStr = NULL, RStr, GStr, BStr, rStr, gStr, bStr;
+
+ static char *LabelList[] = {
+ "Back",
+@@ -136,22 +139,50 @@ editCB(PuGizmo g, char *name, void *clientData, void *callData)
+ char *field = clientData;
+ PuTextCBStruc *callP = callData;
+
+- if (field[0] == 'N')
++ if (field[0] == 'N') {
+ DStrAssignStr(NameStr, callP->newText);
+- else if (field[0] == 'R')
++ }
++ else if (field[0] == 'R') {
+ DStrAssignStr(RStr, callP->newText);
+- else if (field[0] == 'G')
++ }
++ else if (field[0] == 'G') {
+ DStrAssignStr(GStr, callP->newText);
+- else
++ }
++ else if (field[0] == 'B') {
+ DStrAssignStr(BStr, callP->newText);
++ }
++ else if (field[0] == 'r') {
++ DStrAssignStr(rStr, callP->newText);
++ }
++ else if (field[0] == 'g') {
++ DStrAssignStr(gStr, callP->newText);
++ }
++ else if (field[0] == 'b') {
++ DStrAssignStr(bStr, callP->newText);
++ }
+ }
+
+ static void
+ updateFields(int colorI)
+ {
++ char buf[10];
++ float f;
++
+ PuSetStr(RGizmo, PU_SC_TEXT, ColorList[colorI].r);
+ PuSetStr(GGizmo, PU_SC_TEXT, ColorList[colorI].g);
+ PuSetStr(BGizmo, PU_SC_TEXT, ColorList[colorI].b);
++
++ f = atof(ColorList[colorI].r);
++ (void) sprintf(buf, "%i", ICOLOR(f));
++ PuSetStr(rGizmo, PU_SC_TEXT, buf);
++
++ f = atof(ColorList[colorI].g);
++ (void) sprintf(buf, "%i", ICOLOR(f));
++ PuSetStr(gGizmo, PU_SC_TEXT, buf);
++
++ f = atof(ColorList[colorI].b);
++ (void) sprintf(buf, "%i", ICOLOR(f));
++ PuSetStr(bGizmo, PU_SC_TEXT, buf);
+ }
+
+ static void
+@@ -190,17 +221,96 @@ activateCB(PuGizmo g, char *name, void *clientData, void *callData)
+ {
+ char *field = clientData;
+ int i;
++ float f;
++ char buf[10];
+
+ if (field[0] == 'N') {
+ for (i = 0; i < ColorNo; i++)
+ if (strcmp(ColorList[i].name, DStrToStr(NameStr)) == 0) {
+- updateFields(i);
+- break;
++ updateFields(i);
++ break;
+ }
+ } else {
++ if (field[0] == 'R') {
++ f = atof(DStrToStr(RStr));
++ if (f>1.0) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(RStr, buf);
++ PuSetStr(RGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(rStr, buf);
++ PuSetStr(rGizmo, PU_SC_TEXT, buf);
++ }
++ else if (field[0] == 'G') {
++ f = atof(DStrToStr(GStr));
++ if (f>1.0) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(GStr, buf);
++ PuSetStr(GGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(gStr, buf);
++ PuSetStr(gGizmo, PU_SC_TEXT, buf);
++ }
++ else if (field[0] == 'B') {
++ f = atof(DStrToStr(BStr));
++ if (f>1.0) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(BStr, buf);
++ PuSetStr(BGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(bStr, buf);
++ PuSetStr(bGizmo, PU_SC_TEXT, buf);
++ }
++ else if (field[0] == 'r') {
++ i = atoi(DStrToStr(rStr));
++ if (i>MAXRGBVALUE) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(rStr, buf);
++ PuSetStr(rGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(RStr, buf);
++ PuSetStr(RGizmo, PU_SC_TEXT, buf);
++ }
++ else if (field[0] == 'g') {
++ i = atoi(DStrToStr(gStr));
++ if (i>MAXRGBVALUE) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(gStr, buf);
++ PuSetStr(gGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(GStr, buf);
++ PuSetStr(GGizmo, PU_SC_TEXT, buf);
++ }
++ else if (field[0] == 'b') {
++ i = atoi(DStrToStr(bStr));
++ if (i>MAXRGBVALUE) {
++ f=1.0;
++ i=MAXRGBVALUE;
++ sprintf(buf,"%i", ICOLOR(f));
++ DStrAssignStr(bStr, buf);
++ PuSetStr(bGizmo, PU_SC_TEXT, buf);
++ }
++ sprintf(buf,"%1.3f", FCOLOR(i));
++ DStrAssignStr(BStr, buf);
++ PuSetStr(BGizmo, PU_SC_TEXT, buf);
++ }
+ showName();
+ }
+-
+ showColor();
+ }
+
+@@ -258,13 +368,20 @@ showAttr(AttrP attrP)
+ {
+ char buf[10];
+
+- (void) sprintf(buf, "%5.3f", attrP->colR);
++ (void) sprintf(buf, "%1.3f", attrP->colR);
+ PuSetStr(RGizmo, PU_SC_TEXT, buf);
+- (void) sprintf(buf, "%5.3f", attrP->colG);
++ (void) sprintf(buf, "%1.3f", attrP->colG);
+ PuSetStr(GGizmo, PU_SC_TEXT, buf);
+- (void) sprintf(buf, "%5.3f", attrP->colB);
++ (void) sprintf(buf, "%1.3f", attrP->colB);
+ PuSetStr(BGizmo, PU_SC_TEXT, buf);
+
++ (void) sprintf(buf, "%i", ICOLOR(attrP->colR));
++ PuSetStr(rGizmo, PU_SC_TEXT, buf);
++ (void) sprintf(buf, "%i", ICOLOR(attrP->colG));
++ PuSetStr(gGizmo, PU_SC_TEXT, buf);
++ (void) sprintf(buf, "%i", ICOLOR(attrP->colB));
++ PuSetStr(bGizmo, PU_SC_TEXT, buf);
++
+ showName();
+ showColor();
+ }
+@@ -315,107 +432,152 @@ buildDial(void)
+ PuGizmo g;
+ PuConstraints con;
+ int i;
+-
+- DialGizmo = PuCreateDialog("Color Dialog", 7, 5);
+- PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
+-
+- con.x = 0;
+- con.w = 1;
+- con.h = 1;
+-
+- g = PuCreateLabel(DialGizmo, "Name");
+- con.y = 0;
+- PuSetConstraints(g, con);
+- PuSwitchGizmo(g, TRUE);
+-
+- g = PuCreateLabel(DialGizmo, "Red");
+- con.y = 1;
+- PuSetConstraints(g, con);
+- PuSwitchGizmo(g, TRUE);
+-
+- g = PuCreateLabel(DialGizmo, "Green");
+- con.y = 2;
+- PuSetConstraints(g, con);
+- PuSwitchGizmo(g, TRUE);
+-
+- g = PuCreateLabel(DialGizmo, "Blue");
+- con.y = 3;
+- PuSetConstraints(g, con);
+- PuSwitchGizmo(g, TRUE);
+-
+- con.x = 1;
+- con.w = 2;
+- con.h = 1;
+-
+ NameStr = DStrNew();
++
+ RStr = DStrNew();
+ GStr = DStrNew();
+ BStr = DStrNew();
++ rStr = DStrNew();
++ gStr = DStrNew();
++ bStr = DStrNew();
++
+ DStrAssignStr(RStr, "0.0");
+ DStrAssignStr(GStr, "0.0");
+ DStrAssignStr(BStr, "0.0");
++ DStrAssignStr(rStr, "0");
++ DStrAssignStr(gStr, "0");
++ DStrAssignStr(bStr, "0");
+
++ DialGizmo = PuCreateDialog("Color Dialog", 3, 20);
++ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
++
++ con.x = 1;
++ con.y = 0;
++ con.w = 2;
++ con.h = 3;
++ ColGizmo = PuCreateColorField(DialGizmo, "Color");
++ PuSetConstraints(ColGizmo, con);
++ PuSetConstraints(ColGizmo, con);
++ showColor();
++ PuSwitchGizmo(ColGizmo, TRUE);
++
++ con.x = 0;
++ con.y = 4;
++ con.w = 1;
++ con.h = 1;
++ g = PuCreateLabel(DialGizmo, "Name");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++ con.x = 1;
++ con.w = 2;
++ con.h = 1;
+ NameGizmo = PuCreateTextField(DialGizmo, "Name", DStrToStr(NameStr));
+- con.y = 0;
+ PuSetConstraints(NameGizmo, con);
+- PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 13);
++ PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 10);
+ PuAddGizmoCB(NameGizmo, PU_CT_MODIFY, editCB, "N", NULL);
+ PuAddGizmoCB(NameGizmo, PU_CT_ACTIVATE, activateCB, "N", NULL);
+ showName();
+ PuSwitchGizmo(NameGizmo, TRUE);
+
+- RGizmo = PuCreateTextField(DialGizmo, "Red", DStrToStr(RStr));
+- con.y = 1;
++ con.x = 1;
++ con.y = 5;
++ con.w = 2;
++ con.h = 5;
++ g = PuCreateList(DialGizmo, "Color List");
++ for (i = 0; i < ColorNo; i++)
++ PuAddListEntry(g, ColorList[i].name, FALSE);
++ PuSetConstraints(g, con);
++ PuSetBool(g, PU_BC_AUTO_DESEL, TRUE);
++ PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL);
++ PuSwitchGizmo(g, TRUE);
++
++ con.x = 1;
++ con.y = 11;
++ con.w = 1;
++ con.h = 1;
++ g = PuCreateLabel(DialGizmo, "Float");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++ con.x = 2;
++ con.y = 11;
++ g = PuCreateLabel(DialGizmo, "RGB");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++
++ con.x = 0;
++ con.y = 12;
++ con.w = 1;
++ con.h = 1;
++ g = PuCreateLabel(DialGizmo, "Red");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++ con.x = 1;
++ RGizmo = PuCreateTextField(DialGizmo, "RED", DStrToStr(RStr));
+ PuSetConstraints(RGizmo, con);
+ PuSetInt(RGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
+ PuAddGizmoCB(RGizmo, PU_CT_MODIFY, editCB, "R", NULL);
+ PuAddGizmoCB(RGizmo, PU_CT_ACTIVATE, activateCB, "R", NULL);
+ PuSwitchGizmo(RGizmo, TRUE);
++ con.x = 2;
++ rGizmo = PuCreateTextField(DialGizmo, "red", DStrToStr(rStr));
++ PuSetConstraints(rGizmo, con);
++ PuSetInt(rGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
++ PuAddGizmoCB(rGizmo, PU_CT_MODIFY, editCB, "r", NULL);
++ PuAddGizmoCB(rGizmo, PU_CT_ACTIVATE, activateCB, "r", NULL);
++ PuSwitchGizmo(rGizmo, TRUE);
+
+- GGizmo = PuCreateTextField(DialGizmo, "Green", DStrToStr(GStr));
+- con.y = 2;
++ con.x = 0;
++ con.y = 13;
++ con.w = 1;
++ con.h = 1;
++ g = PuCreateLabel(DialGizmo, "Green");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++ con.x = 1;
++ GGizmo = PuCreateTextField(DialGizmo, "GREEN", DStrToStr(GStr));
+ PuSetConstraints(GGizmo, con);
+ PuSetInt(GGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
+ PuAddGizmoCB(GGizmo, PU_CT_MODIFY, editCB, "G", NULL);
+ PuAddGizmoCB(GGizmo, PU_CT_ACTIVATE, activateCB, "G", NULL);
+ PuSwitchGizmo(GGizmo, TRUE);
++ con.x = 2;
++ gGizmo = PuCreateTextField(DialGizmo, "green", DStrToStr(gStr));
++ PuSetConstraints(gGizmo, con);
++ PuSetInt(gGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
++ PuAddGizmoCB(gGizmo, PU_CT_MODIFY, editCB, "g", NULL);
++ PuAddGizmoCB(gGizmo, PU_CT_ACTIVATE, activateCB, "g", NULL);
++ PuSwitchGizmo(gGizmo, TRUE);
+
+- BGizmo = PuCreateTextField(DialGizmo, "Blue", DStrToStr(BStr));
+- con.y = 3;
++ con.x = 0;
++ con.y = 14;
++ con.w = 1;
++ con.h = 1;
++ g = PuCreateLabel(DialGizmo, "Blue");
++ PuSetConstraints(g, con);
++ PuSwitchGizmo(g, TRUE);
++ con.x = 1;
++ BGizmo = PuCreateTextField(DialGizmo, "BLUE", DStrToStr(BStr));
+ PuSetConstraints(BGizmo, con);
+ PuSetInt(BGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
+ PuAddGizmoCB(BGizmo, PU_CT_MODIFY, editCB, "B", NULL);
+ PuAddGizmoCB(BGizmo, PU_CT_ACTIVATE, activateCB, "B", NULL);
+ PuSwitchGizmo(BGizmo, TRUE);
++ con.x = 2;
++ bGizmo = PuCreateTextField(DialGizmo, "blue", DStrToStr(bStr));
++ PuSetConstraints(bGizmo, con);
++ PuSetInt(bGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
++ PuAddGizmoCB(bGizmo, PU_CT_MODIFY, editCB, "b", NULL);
++ PuAddGizmoCB(bGizmo, PU_CT_ACTIVATE, activateCB, "b", NULL);
++ PuSwitchGizmo(bGizmo, TRUE);
+
+- ColGizmo = PuCreateColorField(DialGizmo, "Color");
+- con.x = 3;
+- con.y = 0;
+- con.w = 2;
+- con.h = 4;
+- PuSetConstraints(ColGizmo, con);
+- showColor();
+- PuSwitchGizmo(ColGizmo, TRUE);
+-
+- g = PuCreateList(DialGizmo, "Color List");
+- for (i = 0; i < ColorNo; i++)
+- PuAddListEntry(g, ColorList[i].name, FALSE);
+- con.x = 5;
+- con.y = 0;
+- con.w = 2;
+- con.h = 4;
+- PuSetConstraints(g, con);
+- PuSetBool(g, PU_BC_AUTO_DESEL, TRUE);
+- PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL);
+- PuSwitchGizmo(g, TRUE);
+-
+- con.y = 4;
++ con.x = 0;
++ con.y = 15;
+ con.w = 1;
+ con.h = 1;
+-
+ for (i = 0; i < CMD_NO; i++) {
+ g = PuCreateButton(DialGizmo, LabelList[i]);
+- con.x = i;
++ con.x = i%3;
++ if (i%3 == 0) con.y++;
+ PuSetConstraints(g, con);
+ PuAddGizmoCB(g, PU_CT_ACTIVATE, cmdCB, NULL, NULL);
+ PuSwitchGizmo(g, TRUE);
+diff --git a/src/cmddial/ExDialRes.c b/src/cmddial/ExDialRes.c
+new file mode 100644
+index 0000000..06925ff
+--- /dev/null
++++ b/src/cmddial/ExDialRes.c
+@@ -0,0 +1,340 @@
++/*
++************************************************************************
++*
++* ExDialMol.c - DialMol command
++*
++* Copyright (c) 1994-98
++*
++* ETH Zuerich
++* Institut fuer Molekularbiologie und Biophysik
++* ETH-Hoenggerberg
++* CH-8093 Zuerich
++*
++* SPECTROSPIN AG
++* Industriestr. 26
++* CH-8117 Faellanden
++*
++* All Rights Reserved
++*
++* Date of last modification : 98/08/17
++* Pathname of SCCS file : /tmp_mnt/net/sn/homeb/rkoradi/molmol-master/src/cmddial/SCCS/s.ExDialMol.c
++* SCCS identification : 1.10
++*
++************************************************************************
++*/
++
++#include <cmd_dial.h>
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++
++#include <break.h>
++#include <pu.h>
++#include <arg.h>
++#include <cip.h>
++#include <data_hand.h>
++
++#define PROP_NO 3
++
++typedef struct {
++ char *label;
++ char *propName;
++ char *cmd;
++} PropDesc;
++typedef struct {
++ char *name;
++ BOOL active;
++} Residue;
++
++static BOOL DialOn = FALSE;
++static PuGizmo DialGizmo = NULL, ListGizmo;
++static int CurrProp;
++static PropRefP CurrRefP;
++static int MolNo, MolI;
++static BOOL *MolStateA;
++static BOOL SuppressUpdate = FALSE;
++static PropDesc PropTab[] = {
++ {"sel", PROP_SELECTED, "SelectRes"},
++ {"disp", PROP_DISPLAYED, "DefPropRes 'displayed'"},
++ {"move", PROP_MOVABLE, "DefProRes 'movable'"}
++};
++static Residue ResidueTab[] = {
++ {"ARG", FALSE},
++ {"CYS", FALSE},
++ {"PRO", FALSE},
++ {"ASP", FALSE},
++ {"PHE", FALSE},
++ {"LEU", FALSE},
++ {"GLU", FALSE},
++ {"PRO", FALSE},
++ {"TYR", FALSE},
++ {"GLY", FALSE},
++ {"ASN", FALSE},
++ {"ALA", FALSE},
++ {"SER", FALSE},
++ {"THR", FALSE},
++ {"LYS", FALSE},
++ {"ILE", FALSE}
++};
++
++static void
++countMol(DhResP molP, void *clientData)
++{
++ MolNo++;
++}
++
++
++
++static void
++addMol(DhResP molP, void *clientData)
++{
++
++
++ DSTR name;
++ DSTR residue;
++ char buf[10];
++ char buf2[5];
++ BOOL propVal;
++ int j;
++ name = DStrNew();
++ residue = DStrNew();
++
++
++ j= DhResGetNumber(molP);
++ (void) sprintf(buf, "%5d " , j);
++
++ DStrAssignStr(name, buf);
++ DStrAssignStr(residue, buf2);
++ DStrAppStr(name, " ");
++
++ DStrAppDStr(residue, DhResGetName(molP));
++ DStrAppDStr(name, DhResGetName(molP));
++ propVal = DhResGetProp(CurrRefP, molP);
++
++
++
++ if (! BreakCheck(10)){
++ PuAddListEntry(ListGizmo, DStrToStr(name), propVal);
++
++ }
++
++
++
++ MolStateA[MolI] = propVal;
++
++ DStrFree(name);
++
++ MolI++;
++}
++
++static void
++selectMolCB(PuGizmo g, char *name, void *clientData, void *callData)
++{
++ PuSelectCBStruc *callP = callData;
++ DSTR cmd;
++ BOOL isFirst;
++ char buf[10];
++ int num, startI, i;
++
++ (void) sscanf(name, "%d", &num);
++ MolStateA[num - 1] = callP->onOff;
++
++ if (! callP->last)
++ return;
++
++ cmd = DStrNew();
++ DStrAssignStr(cmd, PropTab[CurrProp].cmd);
++ isFirst = TRUE;
++
++ for (i = 0; i < MolNo; i++) {
++ if (i == 0 || ! MolStateA[i - 1])
++ startI = i;
++ if (MolStateA[i] && (i == MolNo - 1 || ! MolStateA[i + 1])) {
++ if (isFirst)
++ DStrAppStr(cmd, " 'num = ");
++ else
++ DStrAppStr(cmd, ",");
++ (void) sprintf(buf, "%d", startI + 1);
++ DStrAppStr(cmd, buf);
++ if (i > startI) {
++ DStrAppStr(cmd, "..");
++ (void) sprintf(buf, "%d", i + 1);
++ DStrAppStr(cmd, buf);
++ }
++
++ isFirst = FALSE;
++ }
++ }
++
++ if (isFirst)
++ DStrAppStr(cmd, " '0'");
++ else
++ DStrAppStr(cmd, "'");
++
++ SuppressUpdate = TRUE;
++ CipExecCmd(DStrToStr(cmd));
++ SuppressUpdate = FALSE;
++
++ DStrFree(cmd);
++}
++
++static void
++buildList(void)
++{
++ int lineNo;
++
++ MolNo = 0;
++ DhApplyRes(PropGetRef(PROP_ALL, FALSE), countMol, NULL);
++ if (MolNo > 0) {
++ if (MolStateA == NULL)
++ MolStateA = malloc(MolNo * sizeof(*MolStateA));
++ else
++ MolStateA = realloc(MolStateA, MolNo * sizeof(*MolStateA));
++ lineNo = MolNo;
++ if (lineNo > 40)
++ lineNo = 40;
++ } else {
++ lineNo = 1;
++ }
++
++ PuSetInt(ListGizmo, PU_IC_ENTRY_NO, lineNo);
++
++ MolI = 0;
++ BreakActivate(TRUE);
++ DhApplyRes(PropGetRef(PROP_ALL, FALSE), addMol, NULL);
++ BreakActivate(FALSE);
++
++ PuSwitchGizmo(ListGizmo, TRUE);
++}
++
++static void
++updateList(void)
++{
++ if (SuppressUpdate)
++ return;
++
++ PuSwitchGizmo(ListGizmo, FALSE);
++ PuRemoveListEntries(ListGizmo, 0, MolNo);
++ buildList();
++}
++
++static void
++selectPropCB(PuGizmo g, char *name, void *clientData, void *callData)
++{
++ PuSelectCBStruc *callP = callData;
++ PropRefP newPropP;
++ int i;
++
++ if (! callP->onOff)
++ return;
++
++ for (i = 0; i < PROP_NO; i++)
++ if (strcmp(name, PropTab[i].label) == 0)
++ break;
++
++ newPropP = PropGetRef(PropTab[i].propName, FALSE);
++
++ if (newPropP != CurrRefP) {
++ CurrRefP = newPropP;
++ CurrProp = i;
++ updateList();
++ }
++}
++
++static void
++popdownCB(PuGizmo g, char *name, void *clientData, void *callData)
++{
++ PuSwitchGizmo(DialGizmo, FALSE);
++ DialOn = FALSE;
++}
++
++static void
++listCB(void *clientData)
++{
++ updateList();
++}
++
++static void
++helpCB(PuGizmo g, char *name, void *clientData, void *callData)
++{
++ CipShowHelpFile(DialGizmo, "DialMol");
++}
++
++static void
++buildDial(void)
++{
++
++ PuGizmo g;
++ int i;
++
++ CurrProp = 0;
++ CurrRefP = PropGetRef(PropTab[CurrProp].propName, FALSE);
++
++ DialGizmo = PuCreateDialog("Residue Dialog", 0, 0);
++ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
++
++ g = PuCreateRadioBox(DialGizmo, "Property");
++ for (i = 0; i < PROP_NO; i++)
++ PuAddToggle(g, PropTab[i].label, i == 0);
++ PuAddGizmoCB(g, PU_CT_SELECT, selectPropCB, NULL, NULL);
++ PuSwitchGizmo(g, TRUE);
++
++ ListGizmo = PuCreateList(DialGizmo, "Molecules");
++ PuAddGizmoCB(ListGizmo, PU_CT_SELECT, selectMolCB, NULL, NULL);
++ PuSetBool(ListGizmo, PU_BC_MULT_SEL, TRUE);
++ buildList();
++
++ PuAddGizmoCB(DialGizmo, PU_CT_CLOSE, popdownCB, NULL, NULL);
++ PuAddGizmoCB(DialGizmo, PU_CT_HELP, helpCB, NULL, NULL);
++
++}
++
++ErrCode
++ExDialRes(char *cmd)
++{
++ ArgDescr arg;
++ EnumEntryDescr enumEntry[2];
++ ErrCode errCode;
++
++ arg.type = AT_ENUM;
++
++ ArgInit(&arg, 1);
++
++ arg.prompt = "Residue Dialog";
++ arg.u.enumD.entryP = enumEntry;
++ arg.u.enumD.n = 2;
++
++ enumEntry[0].str = "off";
++ enumEntry[1].str = "on";
++
++ enumEntry[0].onOff = DialOn;
++ enumEntry[1].onOff = ! DialOn;
++ if (DialOn)
++ arg.v.intVal = 0;
++ else
++ arg.v.intVal = 1;
++
++ errCode = ArgGet(&arg, 1);
++ if (errCode != EC_OK) {
++ ArgCleanup(&arg, 1);
++ return errCode;
++ }
++
++ DialOn = (arg.v.intVal == 1);
++
++ ArgCleanup(&arg, 1);
++
++ if (DialOn) {
++ if (DialGizmo == NULL) {
++ buildDial();
++ DhAddMolListCB(listCB, NULL);
++ }
++ PuSwitchGizmo(DialGizmo, TRUE);
++ } else {
++ if (DialGizmo != NULL)
++ PuSwitchGizmo(DialGizmo, FALSE);
++ }
++
++ return EC_OK;
++}
+\ No newline at end of file
+diff --git a/src/cmddial/Makefile b/src/cmddial/Makefile
+index d94609d..66fdea9 100644
+--- a/src/cmddial/Makefile
++++ b/src/cmddial/Makefile
+@@ -8,7 +8,7 @@ CPPFLAGS = $(INCLUDES) $(MCPPFLAGS)
+ CFLAGS = $(CPPFLAGS) $(MCFLAGS)
+
+ OBJ = ExDialColor.o ExDialSelect.o ExDialStyle.o ExDialMol.o ExDialMeas.o \
+- ExDialRmsd.o ExUserInterf.o ExRecordMac.o
++ ExDialRes.o ExDialRmsd.o ExUserInterf.o ExRecordMac.o
+ SRC = $(OBJ:.o=.c)
+
+ default: $(LIBDIR)/libcmd.a
+diff --git a/src/cmdio/ExPdb.c b/src/cmdio/ExPdb.c
+index 8447c4c..fde9c73 100644
+--- a/src/cmdio/ExPdb.c
++++ b/src/cmdio/ExPdb.c
+@@ -1,7 +1,7 @@
+ /*
+ ************************************************************************
+ *
+-* ExPdb.c - ReadPdb, ReadListPdb and WritePdb commands
++* ExPdb.c - ReadPdb, ReadOldPdb, ReadListPdb and WritePdb commands
+ *
+ * Copyright (c) 1994-98
+ *
+@@ -105,7 +105,7 @@ compFunc(void *p1, void *p2)
+ }
+
+ static void
+-readTransTab(BOOL pdbToIntern)
++readTransTab(BOOL pdbToIntern, BOOL isNewNomenclature)
+ {
+ GFile gf;
+ GFileRes res;
+@@ -114,7 +114,7 @@ readTransTab(BOOL pdbToIntern)
+
+ TransTab = TreeOpen(sizeof(TransTabEntry), compFunc);
+ gf = SetupOpen(PN_PDB_ATOMS, "PdbAtoms", FALSE);
+- if (gf == NULL)
++ if (gf == NULL || isNewNomenclature)
+ return;
+
+ if (pdbToIntern) {
+@@ -675,7 +675,7 @@ ExReadPdb(char *cmd)
+ return errCode;
+ }
+
+- readTransTab(TRUE);
++ readTransTab(TRUE, TRUE);
+ UnknownErrInit();
+
+ if (replace) {
+@@ -755,7 +755,7 @@ ExReadListPdb(char *cmd)
+
+ FileNamePath(fileName);
+
+- readTransTab(TRUE);
++ readTransTab(TRUE,TRUE);
+ UnknownErrInit();
+ inName = DStrNew();
+ pdbName = DStrNew();
+@@ -932,7 +932,7 @@ ExWritePdb(char *cmd)
+ if (gf == NULL)
+ return EC_ERROR;
+
+- readTransTab(FALSE);
++ readTransTab(FALSE,TRUE);
+
+ CHECK_RES(GFileWriteStr(gf, "HEADER Structure from"));
+ CHECK_RES(GFileWriteStr(gf, PROG_NAME));
+@@ -987,3 +987,61 @@ ExWritePdb(char *cmd)
+
+ return EC_OK;
+ }
++
++ErrCode
++ExReadOldPdb(char *cmd)
++{
++ BOOL replace;
++ DSTR name;
++ int molNo, readNo;
++ DhMolP *molPA;
++ ErrCode errCode;
++ DSTR errStr;
++
++ replace = (strncmp(cmd, "Replace", 7) == 0);
++
++ name = DStrNew();
++ errCode = ArgGetFilename(name, CurrDirGet(), "*.pdb", TRUE);
++ if (errCode != EC_OK) {
++ DStrFree(name);
++ return errCode;
++ }
++
++ readTransTab(TRUE, FALSE);
++ UnknownErrInit();
++
++ if (replace) {
++ molNo = SelMolGet(NULL, 0);
++ if (molNo > 0) {
++ molPA = malloc(molNo * sizeof(*molPA));
++ (void) SelMolGet(molPA, molNo);
++ }
++ } else {
++ molNo = 0;
++ molPA = NULL;
++ }
++
++ BreakActivate(TRUE);
++ errCode = readFile(molPA, molNo, name, &readNo);
++ BreakActivate(FALSE);
++
++ DStrFree(name);
++ TreeClose(TransTab);
++ if (molNo > 0)
++ free(molPA);
++
++ if (errCode != EC_OK)
++ return EC_ERROR;
++
++ if (replace)
++ GraphMolChanged(PROP_SELECTED);
++
++ errStr = UnknownErrGet();
++ if (errStr != NULL) {
++ CipSetError(DStrToStr(errStr));
++ DStrFree(errStr);
++ return EC_WARNING;
++ }
++
++ return EC_OK;
++}
+diff --git a/src/cmdstruc/ExBuild.c b/src/cmdstruc/ExBuild.c
+index 32bc650..7f003b2 100644
+--- a/src/cmdstruc/ExBuild.c
++++ b/src/cmdstruc/ExBuild.c
+@@ -31,11 +31,16 @@
+ #include <data_hand.h>
+ #include <data_sel.h>
+ #include <graph_draw.h>
++#include <pu.h>
+
+ #define ARG_NUM 1
+
+ static int CurrPos = 1;
+ static int CurrKind = 0;
++static PuTextWindow TextW;
++static DhMolP LastMolP=NULL;
++static BOOL messageWindowCreated=FALSE;
++static BOOL cyclicResidueFound=FALSE;
+
+ ErrCode
+ ExNewMol(char *cmd)
+@@ -206,3 +211,121 @@ ExChangeRes(char *cmd)
+
+ return EC_OK;
+ }
++
++static void
++writeInt(int num)
++{
++ char buf[10];
++ (void) sprintf(buf, "%5d ", num);
++ PuWriteStr(TextW, buf);
++}
++
++static void
++checkMolCyclic(DhMolP molP, void *clientData)
++{
++ DhResP resP;
++ DSTR resName = DStrNew();
++ DStrAssignStr(resName, "XXX");
++
++ resP = DhResFirst(molP);
++ while (resP != NULL) {
++ if (DStrCmp(resName, DhResGetName(resP)) == 0) {
++ cyclicResidueFound=TRUE;
++ }
++ resP = DhResNext(resP);
++ }
++
++ if (cyclicResidueFound && !messageWindowCreated) {
++ TextW = PuCreateTextWindow("MakeMolCyclic");
++ PuWriteStr(TextW, "--------------------------------------------------\n");
++ messageWindowCreated=TRUE;
++ }
++ if (cyclicResidueFound) {
++ PuWriteStr(TextW, "Error -");
++ writeInt(DhMolGetNumber(molP) + 1);
++ PuWriteStr(TextW, DStrToStr(DhMolGetName(molP)));
++ PuWriteStr(TextW, " already made cyclic!\n");
++ }
++}
++
++static void
++makeMolCyclic(DhMolP molP, void *clientData)
++{
++ DhResP xResP, yResP;
++ Vec3 firstCoord, lastCoord, midCoord;
++ DhResP firstResP, lastResP;
++ DhAtomP caAtomP;
++ DSTR atomName = DStrNew();
++ DhResDefP resDefP = (DhResDefP) clientData;
++
++ DStrAssignStr(atomName, "CA");
++
++ xResP = DhResNewCyclic(molP, resDefP, SP_FIRST);
++ DhResInit(xResP);
++ yResP = DhResNewCyclic(molP, resDefP, SP_LAST);
++ DhResInit(yResP);
++
++ xResP = DhResFirst(molP);
++
++ firstResP = DhResNext(xResP);
++ caAtomP = NULL;
++ while (caAtomP == NULL && firstResP != NULL) {
++ caAtomP = DhAtomFindName(firstResP, atomName, FALSE);
++ firstResP = DhResNext(firstResP);
++ }
++ if (caAtomP == NULL) {
++ return;
++ }
++ DhAtomGetCoord(caAtomP, firstCoord);
++
++ yResP = DhResLast(molP);
++ lastResP = DhResPrev(yResP);
++ caAtomP = NULL;
++ while (caAtomP == NULL && lastResP != NULL) {
++ caAtomP = DhAtomFindName(lastResP, atomName, FALSE);
++ lastResP = DhResPrev(lastResP);
++ }
++ if (caAtomP == NULL) {
++ return;
++ }
++
++ DhAtomGetCoord(caAtomP, lastCoord);
++
++ midCoord[0] = (firstCoord[0]+lastCoord[0])/2;
++ midCoord[1] = (firstCoord[1]+lastCoord[1])/2;
++ midCoord[2] = (firstCoord[2]+lastCoord[2])/2;
++
++ DhAtomSetCoord(DhResGetAtomA(xResP), midCoord);
++ DhAtomSetCoord(DhResGetAtomA(yResP), midCoord);
++}
++
++ErrCode
++ExMakeMolCyclic(char *cmd)
++{
++ int ind=0;
++ DhResDefP resDefP;
++ DSTR resName = DStrNew();
++
++ messageWindowCreated=FALSE;
++ cyclicResidueFound=FALSE;
++ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), checkMolCyclic, NULL);
++ if (cyclicResidueFound) {
++ DSTR msg = DStrNew();
++ DStrAssignStr(msg, "Error cyclic molecules selected");
++ PuSetTextField(PU_TF_STATUS, DStrToStr(msg));
++ DStrFree(msg);
++ return EC_OK;
++ }
++
++ DStrAssignStr(resName, "XXX");
++ resDefP = DhResDefGet(resName);
++ if (resDefP == NULL) {
++ CipSetError("error cyclic marker residue 'XXX' not found in residue library");
++ return EC_ERROR;
++ }
++
++ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), makeMolCyclic, resDefP);
++ GraphMolChanged(PROP_SELECTED);
++ GraphRedrawNeeded();
++ return EC_OK;
++}
+diff --git a/src/data/DataHand.c b/src/data/DataHand.c
+index 368aad3..d020c20 100644
+--- a/src/data/DataHand.c
++++ b/src/data/DataHand.c
+@@ -994,9 +994,11 @@ BOOL
+ DhResDestroy(DhResP resP)
+ {
+ /* can only destroy first or last residue of molecule! */
++ DhMolP molP;
+ if (resP == ListFirst(resP->molP->resL)) {
++ molP = resP->molP;
+ ListRemove(resP->molP->resL, resP);
+- setEquivI(ListFirst(resP->molP->resL), NULL);
++ setEquivI((DhResP)ListFirst(molP->resL), NULL);
+ return TRUE;
+ } else if (resP == ListLast(resP->molP->resL)) {
+ ListRemove(resP->molP->resL, resP);
+@@ -2842,6 +2844,18 @@ DhResGetName(DhResP resP)
+ return resP->defP->name;
+ }
+
++DhAtomP
++DhResGetAtomA(DhResP resP)
++{
++ return resP->atomA;
++}
++
++DhResDefP
++DhResGetDefP(DhResP resP)
++{
++ return resP->defP;
++}
++
+ int
+ DhResGetNumber(DhResP resP)
+ {
+@@ -3313,3 +3327,101 @@ DhAltCoordListGet(void)
+ {
+ return AltCoordList;
+ }
++
++static void
++initResCyclic(DhResP resP)
++{
++ DhResDefP defP;
++ DhResP prevResP, nextResP;
++ DhAtomP atomP, equivAtomP;
++ int i;
++
++ defP = resP->defP;
++
++ resP->neighLeftP = NULL;
++ resP->neighRightP = NULL;
++
++ resP->atomA = malloc(defP->atomNo * sizeof(*resP->atomA));
++ resP->bondA = malloc(defP->bondNo * sizeof(*resP->bondA));
++ resP->angleA = malloc(defP->angleNo * sizeof(*resP->angleA));
++
++ for (i = 0; i < defP->atomNo; i++)
++ initAtom(resP->atomA + i, resP);
++
++ for (i = defP->firstBondI; i <= defP->lastBondI; i++)
++ initBond(resP->bondA + i, resP);
++
++ for (i = 0; i < defP->angleNo; i++) {
++ resP->angleA[i].resP = resP;
++ resP->angleA[i].val = 0.0f;
++ resP->angleA[i].minVal = DH_ANGLE_MIN;
++ resP->angleA[i].maxVal = DH_ANGLE_MAX;
++ resP->angleA[i].changed = FALSE;
++ resP->angleA[i].propTab = PropNewTab(FALSE);
++ }
++
++ resP->propTab = PropNewTab(FALSE);
++
++ for (i = 0; i < EQUIV_NO; i++) {
++ resP->equivI[i] = -1;
++ }
++
++ prevResP = ListPrev(resP->molP->resL, resP);
++ nextResP = ListNext(resP->molP->resL, resP);
++}
++
++DhResP
++DhResNewCyclic(DhMolP molP, DhResDefP defP, DhSeqPos pos)
++{
++ struct DhResS resS;
++ DhResP resP, prevResP, nextResP;
++
++ resS.molP = molP;
++ resS.defP = defP;
++
++ if (pos == SP_FIRST) {
++ nextResP = ListFirst(molP->resL);
++ if (nextResP == NULL)
++ resS.num = 1;
++ else
++ resS.num = nextResP->num - 1;
++
++ resP = ListInsertFirst(molP->resL, &resS);
++ } else {
++ prevResP = ListLast(molP->resL);
++ if (prevResP == NULL)
++ resS.num = 1;
++ else
++ resS.num = prevResP->num + 1;
++
++ resP = ListInsertLast(molP->resL, &resS);
++ }
++
++ initResCyclic(resP);
++
++ return resP;
++}
++
++DhResP
++DhResPrev(DhResP resP)
++{
++ return (DhResP) ListPrev(resP->molP->resL, resP);
++}
++
++DhResP
++DhResNext(DhResP resP)
++{
++ return (DhResP) ListNext(resP->molP->resL, resP);
++}
++
++DhResP
++DhResFirst(DhMolP molP)
++{
++ return (DhResP) ListFirst(molP->resL);
++}
++
++DhResP
++DhResLast(DhMolP molP)
++{
++ return (DhResP) ListLast(molP->resL);
++}
+diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c
+index aa4f9a7..9c04ce8 100644
+--- a/src/iodev/IODev.c
++++ b/src/iodev/IODev.c
+@@ -44,6 +44,7 @@ extern void IOMotifGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ extern void IOMotifOGLSetDev(void);
++extern void IOMotifOGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ extern void IOMotifXGLSetDev(void);
+@@ -75,6 +76,7 @@ static DevListEntry DevList[] = {
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ {"Motif/OpenGL", IOMotifOGLSetDev},
++ {"Motif/OpenGLD", IOMotifOGLDSetDev},
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ {"Motif/XGL", IOMotifXGLSetDev},
+diff --git a/src/main/MolInit.c b/src/main/MolInit.c
+index a7c467a..fccccd3 100644
+--- a/src/main/MolInit.c
++++ b/src/main/MolInit.c
+@@ -313,8 +313,9 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName)
+
+ SgSetDoubleBuffer(TRUE);
+
+- ProgDirSet("MOLMOLHOME", "/usr/molmol");
++ ProgDirSet("MOLMOLHOME", argv[0]);
+ SetupSetDir("setup");
++ CurrDirSet(getenv("HOME"));
+- UserFileSetDir(CurrDirGet(), "molmol");
++ UserFileSetDir(CurrDirGet(), ".molmol");
+ GFileSetErrorHandler(handleFileError);
+
+@@ -326,7 +327,7 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName)
+ IOSetErrorHandler(handleIOError);
+
+ PuSetTextField(PU_TF_TITLE,
+- "MOLMOL - MOLecule analysis and MOLecule display");
++ "MOLMOL - MOLecule analysis and MOLecule display - JCU V1.0.8");
+
+ gf = UserFileOpenRead("par");
+ if (gf != NULL) {
+diff --git a/src/main/MolMol.c b/src/main/MolMol.c
+index 6f825e8..902b50a 100644
+--- a/src/main/MolMol.c
++++ b/src/main/MolMol.c
+@@ -30,5 +30,5 @@
+ int
+ main(int argc, char *argv[])
+ {
+- return MolInit("Motif/X11", argc, argv, NULL);
++ return MolInit("Motif/OpenGL", argc, argv, NULL);
+ }
+diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c
+index 6e3bfd7..8fe0c5a 100644
+--- a/src/motif/MotifDial.c
++++ b/src/motif/MotifDial.c
+@@ -1115,26 +1115,24 @@ PuMotifSetStr(PuGizmo gizmo, PuStrChoice choice, char *val)
+ void
+ PuMotifSetColor(PuGizmo gizmo, float r, float g, float b)
+ {
+- Display *dpy;
+- int screen;
+- Pixel pix;
+- XColor col;
++ Display *display;
++ Pixel pixel;
++ XColor color;
++ Colormap colormap;
+
+- dpy = XtDisplay(gizmo);
+- screen = DefaultScreen(dpy);
+- XtVaGetValues(gizmo,
+- XmNbackground, &pix,
+- NULL);
++ display = XtDisplay(gizmo);
++ XtVaGetValues(gizmo, XmNbackground, &pixel, NULL);
++ colormap = DefaultColormapOfScreen(XtScreen(gizmo));
+
+- if (pix == BlackPixel(dpy, screen))
+- return;
++ color.pixel = pixel;
++ color.red = FLOAT2SHORT(r);
++ color.green = FLOAT2SHORT(g);
++ color.blue = FLOAT2SHORT(b);
++ color.flags = DoRed | DoGreen | DoBlue;
+
+- col.pixel = pix;
+- col.red = FLOAT2SHORT(r);
+- col.green = FLOAT2SHORT(g);
+- col.blue = FLOAT2SHORT(b);
+- col.flags = DoRed | DoGreen | DoBlue;
+- XStoreColor(dpy, DefaultColormap(dpy, screen), &col);
++ XFreeColors(display, colormap, &pixel, 1, 0);
++ XAllocColor(display, colormap, &color);
++ XtVaSetValues(gizmo, XmNbackground, color.pixel, NULL);
+ }
+
+ void
+diff --git a/src/motogl/MotOGLDump.c b/src/motogl/MotOGLDump.c
+index 54a4222..3bc25cc 100644
+--- a/src/motogl/MotOGLDump.c
++++ b/src/motogl/MotOGLDump.c
+@@ -302,7 +302,7 @@ writeImg(void)
+ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+
+ if (Quality < 100)
+- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS);
++ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
+ else
+ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+
+diff --git a/src/os/CurrDir.c b/src/os/CurrDir.c
+index edee778..7d2b242 100644
+--- a/src/os/CurrDir.c
++++ b/src/os/CurrDir.c
+@@ -26,9 +26,9 @@
+ #include <curr_dir.h>
+
+ #include <stdlib.h>
+-#ifdef WIN32
+-#include <direct.h>
+ #include <string.h>
++#ifdef WIN32
++#include <direct.h>
+ #else
+ #include <unistd.h>
+ #include <errno.h>
+@@ -36,43 +36,15 @@
+
+ static char *CurrDir = NULL;
+
++void
++CurrDirSet(char *dir)
++{
++ CurrDir = malloc(strlen(dir) + 1);
++ (void) strcpy(CurrDir, dir);
++}
++
+ char *
+ CurrDirGet(void)
+ {
+-#ifdef WIN32
+- int len, i;
+-#else
+- int size = 10;
+-#endif
+-
+- if (CurrDir != NULL)
+- return CurrDir;
+-
+-#ifdef WIN32
+- CurrDir = _getcwd(NULL, 0);
+- if (CurrDir != NULL) {
+- len = strlen(CurrDir);
+- for (i = 0; i < len; i++)
+- if (CurrDir[i] == '\\')
+- CurrDir[i] = '/';
+- return CurrDir;
+- }
+-#else
+- CurrDir = malloc(size);
+- for (;;) {
+- if (getcwd(CurrDir, size) != NULL)
+- return CurrDir;
+- if (errno != ERANGE)
+- break;
+- size *= 2;
+- CurrDir = realloc(CurrDir, size);
+- }
+-#endif
+-
+- /* cannot get current directory, return root directory */
+- CurrDir = realloc(CurrDir, 2);
+- CurrDir[0] = '/';
+- CurrDir[1] = '\0';
+-
+ return CurrDir;
+ }
+diff --git a/src/os/ProgDir.c b/src/os/ProgDir.c
+index 7abb08d..79ede45 100644
+--- a/src/os/ProgDir.c
++++ b/src/os/ProgDir.c
+@@ -45,10 +45,6 @@ ProgDirSet(char *envVar, char *defVal)
+ dir = getenv(envVar);
+ if (dir == NULL) {
+ len = GetModuleFileName(NULL, exePath, sizeof(exePath));
+- if (len == 0) {
+- ProgDir = defVal;
+- return;
+- }
+ len--;
+ while (len > 0 && exePath[len] != '\\')
+ len--;
+@@ -65,9 +61,24 @@ ProgDirSet(char *envVar, char *defVal)
+ if (ProgDir[i] == '\\')
+ ProgDir[i] = '/';
+ #else
+- ProgDir = getenv(envVar);
+- if (ProgDir == NULL)
+- ProgDir = defVal;
++ char *dir;
++ char *exePath;
++ int len;
++ dir = getenv(envVar);
++ if (dir == NULL) {
++ exePath = defVal;
++ len = strlen(exePath);
++ len--;
++ while (len > 0 && exePath[len] != '/')
++ len--;
++ dir = exePath;
++ } else {
++ len = strlen(dir);
++ }
++
++ ProgDir = malloc(len + 1);
++ (void) strncpy(ProgDir, dir, len);
++
+ #endif
+ }
+
+diff --git a/src/win/WinDial.c b/src/win/WinDial.c
+index 61d6432..e880559 100644
+--- a/src/win/WinDial.c
++++ b/src/win/WinDial.c
+@@ -1072,148 +1072,143 @@ dialProc(HWND w, UINT msgKind, WPARAM wParam, LPARAM lParam)
+ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
+
+ switch (notifyCode) {
+- case BN_CLICKED:
+- if (childId < infoP->u.dial.childNo) {
++ case BN_CLICKED:
++ if (childId < infoP->u.dial.childNo) {
+ childP = (GizmoInfo *) GetWindowLong(GetFocus(), GWL_USERDATA);
+- if (childP->type == GIZMO_TOGGLE) {
+- boxP = childP->u.toggle.boxP;
+- if (boxP->type == GIZMO_RADIO_BOX) {
+- for (i = 0; i < infoP->u.dial.childNo; i++) {
+- cP = infoP->u.dial.childPA[i];
+- if (cP->type != GIZMO_TOGGLE)
+- continue;
+- if (cP->u.toggle.boxP != boxP)
+- continue;
+- onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0);
+- if (onOff && cP != childP) {
+- cP->u.toggle.onOff = FALSE;
+- SendMessage(cP->w, BM_SETCHECK, FALSE, 0);
+- selectStruc.onOff = FALSE;
+- callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc);
+- break;
+- }
+- }
+- if (cP != childP) {
+- childP->u.toggle.onOff = TRUE;
+- SendMessage(childP->w, BM_SETCHECK, TRUE, 0);
+- selectStruc.onOff = TRUE;
+- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
+- }
+- } else {
+- onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0);
+- childP->u.toggle.onOff = onOff;
+- SendMessage(childP->w, BM_SETCHECK, onOff, 0);
+- selectStruc.onOff = onOff;
+- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
+- }
+- } else {
+- callCB(childP, PU_CT_ACTIVATE, childP->name, NULL);
+- if (childP->type == GIZMO_TEXT_FIELD &&
+- childP->u.text.historySize > 0)
+- childP->u.text.firstMod = TRUE;
+- }
+- } else {
+- buttonI = childId - infoP->u.dial.childNo;
+- callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL);
+- }
++ if (childP->type == GIZMO_TOGGLE) {
++ boxP = childP->u.toggle.boxP;
++ if (boxP->type == GIZMO_RADIO_BOX) {
++ for (i = 0; i < infoP->u.dial.childNo; i++) {
++ cP = infoP->u.dial.childPA[i];
++ if (cP->type != GIZMO_TOGGLE) continue;
++ if (cP->u.toggle.boxP != boxP) continue;
++ onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0);
++ if (onOff && cP != childP) {
++ cP->u.toggle.onOff = FALSE;
++ SendMessage(cP->w, BM_SETCHECK, FALSE, 0);
++ selectStruc.onOff = FALSE;
++ callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc);
++ break;
++ }
++ }
++ if (cP != childP) {
++ childP->u.toggle.onOff = TRUE;
++ SendMessage(childP->w, BM_SETCHECK, TRUE, 0);
++ selectStruc.onOff = TRUE;
++ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
++ }
++ } else {
++ onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0);
++ childP->u.toggle.onOff = onOff;
++ SendMessage(childP->w, BM_SETCHECK, onOff, 0);
++ selectStruc.onOff = onOff;
++ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
++ }
++ } else {
++ callCB(childP, PU_CT_ACTIVATE, childP->name, NULL);
++ if (childP->type == GIZMO_TEXT_FIELD && childP->u.text.historySize > 0) childP->u.text.firstMod = TRUE;
++ }
++ } else {
++ buttonI = childId - infoP->u.dial.childNo;
++ callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL);
++ }
+ return TRUE;
+- case EN_UPDATE:
+- textEdit(childP);
+- return TRUE;
+- case LBN_SELCHANGE:
+- for (i = 0; i < childP->u.list.entryNo; i++)
+- if (SendMessage(childW, LB_GETSEL, i, 0) !=
+- childP->u.list.entryA[i].onOff)
+- lastI = i;
+
+- for (i = 0; i < childP->u.list.entryNo; i++) {
+- onOff = SendMessage(childW, LB_GETSEL, i, 0);
+- if (onOff != childP->u.list.entryA[i].onOff) {
+- if (! childP->u.list.autoDesel)
++ case EN_UPDATE:
++ textEdit(childP);
++ return TRUE;
++
++ case LBN_SELCHANGE:
++ for (i = 0; i < childP->u.list.entryNo; i++)
++ if (SendMessage(childW, LB_GETSEL, i, 0) != childP->u.list.entryA[i].onOff)
++ lastI = i;
++
++ for (i = 0; i < childP->u.list.entryNo; i++) {
++ onOff = SendMessage(childW, LB_GETSEL, i, 0);
++ if (onOff != childP->u.list.entryA[i].onOff) {
++ if (! childP->u.list.autoDesel)
+ childP->u.list.entryA[i].onOff = onOff;
+- selectStruc.onOff = onOff;
+- selectStruc.last = (i == lastI);
+- callCB(childP, PU_CT_SELECT,
+- childP->u.list.entryA[i].str, &selectStruc);
+- }
+- }
+-
+- if (childP->u.list.autoDesel)
+- SendMessage(childW, LB_SETCURSEL, -1, 0);
+-
+- return TRUE;
++ selectStruc.onOff = onOff;
++ selectStruc.last = (i == lastI);
++ callCB(childP, PU_CT_SELECT,
++ childP->u.list.entryA[i].str, &selectStruc);
++ }
++ }
++ if (childP->u.list.autoDesel)
++ SendMessage(childW, LB_SETCURSEL, -1, 0);
++ return TRUE;
+ }
++ break;
+
+- break;
+- case WM_VSCROLL:
+- childW = (HWND) lParam;
+- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
+- scrollCode = LOWORD(wParam);
++ case WM_VSCROLL:
++ childW = (HWND) lParam;
++ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
++ scrollCode = LOWORD(wParam);
+
+- if (scrollCode == SB_LINEUP) {
+- upHistory(childP->u.scroll.textP);
+- } else if (scrollCode == SB_LINEDOWN) {
+- downHistory(childP->u.scroll.textP);
+- } else {
+- return FALSE;
+- }
+- return TRUE;
+- case WM_HSCROLL:
+- scrollCode = LOWORD(wParam);
+- if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK)
+- return FALSE;
++ if (scrollCode == SB_LINEUP) {
++ upHistory(childP->u.scroll.textP);
++ } else if (scrollCode == SB_LINEDOWN) {
++ downHistory(childP->u.scroll.textP);
++ } else {
++ return FALSE;
++ }
++ return TRUE;
++ case WM_HSCROLL:
++ scrollCode = LOWORD(wParam);
++ if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK)
++ return FALSE;
+
+- scrollPos = (int)(short)HIWORD(wParam);
+- childW = (HWND) lParam;
+- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
++ scrollPos = (int)(short)HIWORD(wParam);
++ childW = (HWND) lParam;
++ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
+
+- floatStruc.oldVal = childP->u.slider.val;
+- childP->u.slider.val = scrollPos / childP->u.slider.factor;
+- SetScrollPos(childW, SB_CTL,
+- (int) (childP->u.slider.val * childP->u.slider.factor),
+- TRUE);
++ floatStruc.oldVal = childP->u.slider.val;
++ childP->u.slider.val = scrollPos / childP->u.slider.factor;
++ SetScrollPos(childW, SB_CTL,
++ (int) (childP->u.slider.val * childP->u.slider.factor), TRUE);
+
+- if (childP->u.slider.valuatorCB == NULL) {
+- floatStruc.newVal = childP->u.slider.val;
+- callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc);
+- } else {
+- valStruc.act = PU_MA_ACTIVATE;
+- valStruc.name = childP->name;
+- valStruc.val = childP->u.slider.val;
+- childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc);
+- }
++ if (childP->u.slider.valuatorCB == NULL) {
++ floatStruc.newVal = childP->u.slider.val;
++ callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc);
++ } else {
++ valStruc.act = PU_MA_ACTIVATE;
++ valStruc.name = childP->name;
++ valStruc.val = childP->u.slider.val;
++ childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc);
++ }
++ return TRUE;
+
+- return TRUE;
+- case WM_PAINT:
+- for (childId = 0; childId < infoP->u.dial.childNo; childId++) {
+- childP = infoP->u.dial.childPA[childId];
+- if (childP->type == GIZMO_COLOR_FIELD)
+- paintColor(childP->w,
+- childP->u.color.r, childP->u.color.g, childP->u.color.b);
+- }
+- break;
+- case WM_MOVE:
+- if (infoP->u.dial.outside) {
+- WinPlaceChanged(infoP->w);
+- return TRUE;
+- }
+- break;
+- case WM_CLOSE:
+- buttonNo = 0;
+- for (i = 0; i < BUTTON_NO; i++)
+- if (infoP->u.dial.buttonSwitchA[i])
+- buttonNo++;
+- if (buttonNo == 0)
+- ShowWindow(infoP->w, SW_HIDE);
+- return TRUE;
+- case WM_DESTROY:
+- WinRemoveDialog(w);
+- for (childId = 0; childId < infoP->u.dial.childNo; childId++)
+- freeInfo(infoP->u.dial.childPA[childId]);
+- freeInfo(infoP);
+- return TRUE;
+- }
++ case WM_PAINT:
++ for (childId = 0; childId < infoP->u.dial.childNo; childId++) {
++ childP = infoP->u.dial.childPA[childId];
++ if (childP->type == GIZMO_COLOR_FIELD)
++ paintColor(childP->w,
++ childP->u.color.r, childP->u.color.g, childP->u.color.b);
++ }
++ break;
+
++ case WM_MOVE:
++ if (infoP->u.dial.outside) {
++ WinPlaceChanged(infoP->w);
++ return TRUE;
++ }
++ break;
++ case WM_CLOSE:
++ buttonNo = 0;
++ for (i = 0; i < BUTTON_NO; i++) {
++ if (infoP->u.dial.buttonSwitchA[i]) buttonNo++;
++ if (buttonNo == 0) {
++ ShowWindow(infoP->w, SW_HIDE);
++ }
++ }
++ return TRUE;
++ case WM_DESTROY:
++ WinRemoveDialog(w);
++ for (childId = 0; childId < infoP->u.dial.childNo; childId++)
++ freeInfo(infoP->u.dial.childPA[childId]);
++ freeInfo(infoP);
++ return TRUE;
++ }
+ return FALSE;
+ }
+
+diff --git a/src/winogl/WinOGLDump.c b/src/winogl/WinOGLDump.c
+index 0a7d61a..a8ce850 100644
+--- a/src/winogl/WinOGLDump.c
++++ b/src/winogl/WinOGLDump.c
+@@ -44,6 +44,7 @@
+ #endif
+ #ifdef PNG_SUPPORT
+ #include <png.h>
++#include <pngpriv.h>
+ #endif
+
+ #include "winogl_int.h"
+@@ -251,7 +252,7 @@ static void
+ pngErrHand(png_structp pngStrucP, char *errMsg)
+ {
+ IORaiseError(errMsg);
+- longjmp(pngStrucP->jmpbuf, 1);
++ longjmp(pngStrucP->longjmp_buffer, 1);
+ }
+ #endif
+
+@@ -314,7 +315,7 @@ writeImg(void)
+ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+
+ if (Quality < 100)
+- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS);
++ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
+ else
+ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+
+@@ -369,7 +370,7 @@ writeImg(void)
+ return IO_RES_ERR;
+ }
+
+- if (setjmp(pngStrucP->jmpbuf)) {
++ if (setjmp(pngStrucP->longjmp_buffer)) {
+ if (cBuf != NULL)
+ free(cBuf);
+ if (fBuf != NULL)
diff --git a/sci-chemistry/molmol/metadata.xml b/sci-chemistry/molmol/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/molmol/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
new file mode 100644
index 000000000000..a8658310e612
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils multilib prefix toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+SRC_URI="
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ || (
+ ( media-libs/mesa
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
+
+ epatch "${FILESDIR}"/prefix.patch
+ eprefixify molmol
+
+ epatch "${FILESDIR}"/ldflags.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
+ -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
+ -e "s:^CC.*:CC = $(tc-getCC):" \
+ -i "${S}"/makedef || die
+
+ epatch "${FILESDIR}"/cast.patch
+ epatch "${FILESDIR}"/libpng15.patch
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ newexe src/main/molmol molmol.lnx
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ dodoc HISTORY README
+}
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
new file mode 100644
index 000000000000..366d41a75bd9
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils multilib prefix toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+SRC_URI="
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ || (
+ ( media-libs/mesa
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
+
+ epatch "${FILESDIR}"/prefix.patch
+ eprefixify molmol
+
+ epatch "${FILESDIR}"/ldflags.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
+ -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
+ -e "s:^CC.*:CC = $(tc-getCC):" \
+ -i "${S}"/makedef || die
+
+ epatch "${FILESDIR}"/cast.patch
+ epatch "${FILESDIR}"/libpng15.patch
+
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ epatch "${FILESDIR}"/${P}-fink.patch
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ newexe src/main/molmol molmol.lnx
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ dodoc HISTORY README
+}
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild
new file mode 100644
index 000000000000..e463ff241d06
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib prefix toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+SRC_URI="
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ || (
+ ( media-libs/mesa
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
+
+ epatch "${FILESDIR}"/prefix.patch
+ eprefixify molmol
+
+ epatch "${FILESDIR}"/ldflags.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
+ -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
+ -e "s:^CC.*:CC = $(tc-getCC):" \
+ -i "${S}"/makedef || die
+
+ epatch "${FILESDIR}"/cast.patch
+ epatch "${FILESDIR}"/libpng15.patch
+
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ epatch "${FILESDIR}"/${P}-fink.patch
+
+ tc-export AR
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ newexe src/main/molmol molmol.lnx
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ dodoc HISTORY README
+}
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild
new file mode 100644
index 000000000000..8def42023aac
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib prefix toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+SRC_URI="
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ || (
+ ( media-libs/mesa
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
+
+ epatch "${FILESDIR}"/ldflags.patch
+ epatch "${FILESDIR}"/opengl.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s:ksh:sh:" \
+ -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR};MOLMOLDEV=\"Motif/OpenGL\":" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
+ -e "s:^CC.*:CC = $(tc-getCC):" \
+ -i "${S}"/makedef || die
+
+ epatch "${FILESDIR}"/cast.patch
+ epatch "${FILESDIR}"/libpng15.patch
+
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ epatch "${FILESDIR}"/${P}-fink.patch
+
+ epatch "${FILESDIR}"/wild.patch
+ tc-export AR
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ doexe src/main/molmol
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ dodoc HISTORY README
+}
diff --git a/sci-chemistry/molrep/Manifest b/sci-chemistry/molrep/Manifest
new file mode 100644
index 000000000000..7206bd5555b8
--- /dev/null
+++ b/sci-chemistry/molrep/Manifest
@@ -0,0 +1,2 @@
+DIST molrep-11.0.02.tar.gz 3594084 SHA256 6acb00bc91ad76027461ce6055eda72c8de34e5243449a31d5ede9e537e9adce
+DIST molrep-11.0.03.tar.gz 3643087 SHA256 f4c317713b0dddf0ca883734f0bfe27600b50f8d4dd354ea8ae8245e21ce4392 SHA512 d9ff351e3754871d100c41aa9b8af48e3588768320f5ed92e536fac5e24114ca5df6497103d0b077455fc4e30e2d3d085aeb63854eb88dc8e74259b4e1683dc8 WHIRLPOOL b16e128e3ca7f1734ca79f70decab3e262d47b6a37c49e46c4c7d51f3fd8093cd3a0f20e487caeb5e9aa0a37a9fd050588cad3e99ad46e1866d05ff4a8ed0bb6
diff --git a/sci-chemistry/molrep/files/10.2.35-respect-FLAGS.patch b/sci-chemistry/molrep/files/10.2.35-respect-FLAGS.patch
new file mode 100644
index 000000000000..d81ec793b510
--- /dev/null
+++ b/sci-chemistry/molrep/files/10.2.35-respect-FLAGS.patch
@@ -0,0 +1,61 @@
+--- src/makefile 2009-02-27 16:51:46.492890717 +0100
++++ src/makefile.new 2009-02-27 16:52:18.295619642 +0100
+@@ -5,8 +5,8 @@
+
+ BIN = $(MOLREP)/bin
+
+-OBJS = main_molrep_mtz.o molrep.o molrep1.o molrep2.o molrep3.o molrep_prog.o molrep_prog1.o molrep_prog2.o molrep_subr.o molrep_dummy.o molrep_sym.o molrep_unix.o
+-OBJSL = main_molrep_mtz.o molrep.o molrep1.o molrep2.o molrep3.o molrep_prog.o molrep_prog1.o molrep_prog2.o molrep_subr.o molrep_sym.o molrep_unix.o
++OBJS = main_molrep_mtz.o molrep.o molrep1.o molrep2.o molrep3.o molrep_prog.o molrep_prog1.o molrep_prog2.o molrep_subr.o molrep_dummy.o molrep_sym_ccp4.o molrep_unix_ccp4.o
++OBJSL = main_molrep_mtz.o molrep.o molrep1.o molrep2.o molrep3.o molrep_prog.o molrep_prog1.o molrep_prog2.o molrep_subr.o molrep_sym_ccp4.o molrep_unix_ccp4.o
+
+
+ all: molrep
+@@ -19,31 +19,31 @@
+ # -----------------------------
+
+ molrep.o: molrep.f
+- $(MR_FORT) -c molrep.f
++ $(MR_FORT) $(FFLAGS) -c molrep.f
+ molrep1.o: molrep1.f
+- $(MR_FORT) -c molrep1.f
++ $(MR_FORT) $(FFLAGS) -c molrep1.f
+ molrep2.o: molrep2.f
+- $(MR_FORT) -c molrep2.f
++ $(MR_FORT) $(FFLAGS) -c molrep2.f
+ molrep3.o: molrep3.f
+- $(MR_FORT) -c molrep3.f
++ $(MR_FORT) $(FFLAGS) -c molrep3.f
+ molrep_prog.o: molrep_prog.f
+- $(MR_FORT) -c molrep_prog.f
++ $(MR_FORT) $(FFLAGS) -c molrep_prog.f
+ molrep_prog1.o: molrep_prog1.f
+- $(MR_FORT) -c molrep_prog1.f
++ $(MR_FORT) $(FFLAGS) -c molrep_prog1.f
+ molrep_prog2.o: molrep_prog2.f
+- $(MR_FORT) -c molrep_prog2.f
++ $(MR_FORT) $(FFLAGS) -c molrep_prog2.f
+ molrep_subr.o: molrep_subr.f
+- $(MR_FORT) -c molrep_subr.f
+-molrep_sym.o: molrep_sym.f
+- $(MR_FORT) -c molrep_sym.f
++ $(MR_FORT) $(FFLAGS) -c molrep_subr.f
++molrep_sym_ccp4.o: molrep_sym.f
++ $(MR_FORT) $(FFLAGS) -c molrep_sym_ccp4.f
+ main_molrep_mtz.o: main_molrep_mtz.f molrep_version.fh molrep_keywords.fh
+- $(MR_FORT) -c main_molrep_mtz.f
+-molrep_unix.o: molrep_unix.f
+- $(MR_FORT) -c molrep_unix.f
++ $(MR_FORT) $(FFLAGS) -c main_molrep_mtz.f
++molrep_unix_ccp4.o: molrep_unix.f
++ $(MR_FORT) $(FFLAGS) -c molrep_unix_ccp4.f
+ molrep_dummy.o: molrep_dummy.f
+- $(MR_FORT) -c molrep_dummy.f
++ $(MR_FORT) $(FFLAGS) -c molrep_dummy.f
+
+ molrep: $(OBJS)
+- $(MR_FORT) -o $(BIN)/molrep $(OBJSL) $(MR_LIBRARY)
++ $(MR_FORT) $(FFLAGS) $(LDFLAGS) -o $(BIN)/molrep $(OBJSL) $(MR_LIBRARY)
+
+ # --------------------------------
+
diff --git a/sci-chemistry/molrep/files/11.0.00-respect-FLAGS.patch b/sci-chemistry/molrep/files/11.0.00-respect-FLAGS.patch
new file mode 100644
index 000000000000..c18b9a1e3f0d
--- /dev/null
+++ b/sci-chemistry/molrep/files/11.0.00-respect-FLAGS.patch
@@ -0,0 +1,12 @@
+diff --git a/src/makefile b/src/makefile
+index 30d0de7..10dd68f 100755
+--- a/src/makefile
++++ b/src/makefile
+@@ -46,6 +46,6 @@ molrep_dummy.o: molrep_dummy.f
+ $(MR_FORT) -c molrep_dummy.f
+
+ molrep: $(OBJS)
+- $(MR_FORT) -o $(BIN)/molrep $(OBJSL) $(MR_LIBRARY)
++ $(MR_FORT) $(LDFLAGS) -o $(BIN)/molrep $(OBJSL) $(MR_LIBRARY)
+
+ # --------------------------------
diff --git a/sci-chemistry/molrep/files/11.0.00-test.patch b/sci-chemistry/molrep/files/11.0.00-test.patch
new file mode 100644
index 000000000000..d90cfb8c7b35
--- /dev/null
+++ b/sci-chemistry/molrep/files/11.0.00-test.patch
@@ -0,0 +1,191 @@
+diff --git a/molrep_check/em.bat b/molrep_check/em.bat
+index 2f0f992..96ddd75 100755
+--- a/molrep_check/em.bat
++++ b/molrep_check/em.bat
+@@ -8,6 +8,8 @@ $MR_TEST/molrep -m ../em/model.pdb -f ../em/pel.map -po out/ -ps scr/ -i <<stop
+ # --------------------------------
+ _NMON 6
+ stop
++echo $?
++[[ $? ]] || exit 1
+ # --------------------------------
+ #
+ # 2. Atomic model --> EM map
+@@ -20,6 +22,7 @@ $MR_TEST/molrep -m ../em/model.pdb -f ../em/pel.map -po out/ -ps scr/ -i <<stop
+ _NMON 6
+ _prf y
+ stop
++[[ $? ]] || exit 1
+ # --------------------------------
+ #
+ # 3. Atomic model --> EM map
+@@ -36,6 +39,7 @@ _ncs 322
+ _centre 0.500 0.490 0.490
+ _angles 0.0 0.0 90.0
+ stop
++[[ $? ]] || exit 1
+ # --------------------------------
+ #
+ cp out/molrep.pdb hexamer.pdb
+@@ -52,6 +56,7 @@ $MR_TEST/molrep -mx hexamer.pdb -f ../em/pel.map -po out/ -ps scr/ -i <<stop
+ # --------------------------------
+ _DOM s
+ stop
++[[ $? ]] || exit 1
+ # --------------------------------
+ #
+ # 5. EM --> X-ray
+@@ -60,6 +65,7 @@ stop
+ $MR_TEST/molrep -f ../em/p2.cif -m ../em/pel.map -po out/ -ps scr/ -i <<stop
+ # --------------------------------
+ stop
++[[ $? ]] || exit 1
+ # --------------------------------
+ #
+ # 6. Placing the model to a particular orientation and position.
+@@ -72,4 +78,5 @@ $MR_TEST/molrep -f ../em/p2.cif -m ../em/pel.map -po out/ -ps scr/ -i <<stop
+ _fun s
+ _file_t ../em/tab
+ stop
++[[ $? ]] || exit 1
+ #==========================================
+diff --git a/molrep_check/mr.bat b/molrep_check/mr.bat
+index 284a4cd..6e00695 100755
+--- a/molrep_check/mr.bat
++++ b/molrep_check/mr.bat
+@@ -10,6 +10,7 @@
+ $MR_TEST/molrep -f ../data/test.mtz -m ../data/test_mod.pdb -po out/ -ps scr/ -i <<stop
+ # --------------------------------
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -26,6 +27,7 @@ _nmon 2
+ _COMPL .5
+ _SIM .7
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -46,6 +48,7 @@ $MR_TEST/molrep -f ../data/test.cif -m ../data/test_mod.pdb -mx ../data/test_mod
+ # --------------------------------
+ _NP 3
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -67,6 +70,7 @@ $MR_TEST/molrep -f ../data/test.cif -m ../data/test_mod.pdb -po out/ -ps scr/ -i
+ _NMON 2
+ _NP 3
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -85,6 +89,7 @@ _NPT 3
+ _NPTD 3
+ _DYAD D
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -103,6 +108,7 @@ _NP 3
+ _NPT 10
+ _NMR 3
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -118,6 +124,7 @@ _PRF Y
+ _compl 1.
+ _sim .2
+ stop
++[[ $? ]] || exit 1
+ #
+ # =================================================================
+ #
+@@ -136,6 +143,7 @@ _ph PH
+ _fom FOM
+ #
+ stop
++[[ $? ]] || exit 1
+ # =================================================================
+ #
+ # 9. use sequence
+@@ -145,6 +153,7 @@ stop
+ $MR_TEST/molrep -f ../data/s100.mtz -m ../data/monomer.pdb -s ../data/s100.seq -po out/ -ps scr/ -i <<stop
+ # --------------------------------
+ stop
++[[ $? ]] || exit 1
+ # =================================================================
+ #
+ # 10. Locked RF
+@@ -157,6 +166,7 @@ _lock y
+ _file_tsrf ../data/srf.tab
+ _nsrf 1
+ stop
++[[ $? ]] || exit 1
+ # =================================================================
+ #
+ # 11. Multi-monomer search using NCS, SELF = 'A' means to compute Self RF and
+@@ -169,6 +179,7 @@ $MR_TEST/molrep -f ../data/s100.mtz -m ../data/monomer.pdb -m2 ../data/monomer.p
+ _self a
+ _nsrf 1
+ stop
++[[ $? ]] || exit 1
+ # =================================================================
+ #
+ # 12. use pst
+@@ -179,6 +190,7 @@ $MR_TEST/molrep -f ../data/pst.mtz -m ../data/model_pst.pdb -po out/ -ps scr/ -i
+ # --------------------------------
+ #
+ stop
++[[ $? ]] || exit 1
+ # =================================================================
+ #
+ # 13. space group check
+@@ -189,7 +201,8 @@ $MR_TEST/molrep -f ../data/test.mtz -m ../data/test_mod.pdb -po out/ -ps scr/ -i
+ # --------------------------------
+ _sg all
+ #
+-stop
++s[[ $? ]] || exit 1
++top
+ # ==========================================================
+ #
+ # 14. Example for finding HA position by MR solution.
+@@ -206,6 +219,7 @@ _SIGFD SIGFD3
+ #
+ _FUN d
+ stop
++[[ $? ]] || exit 1
+ # ==========================================================
+ #
+ # 15. Example for HA search by multi-copy search
+@@ -225,6 +239,7 @@ _diff h
+ _dyad y
+ _nmon 4
+ stop
++[[ $? ]] || exit 1
+ # ==========================================================
+ #
+ # 16. Example HA for search by translation function
+@@ -242,6 +257,7 @@ _FUN t
+ _diff h
+ _nmon 4
+ stop
++[[ $? ]] || exit 1
+ # ==========================================================
+ #
+ # 17. Example for Self RF for Heavy Atom structure in derivative.
+@@ -258,4 +274,5 @@ _SIGFD SIGFD3
+ _FUN r
+ _diff h
+ stop
++[[ $? ]] || exit 1
+ # ==========================================================
diff --git a/sci-chemistry/molrep/files/11.0.03-EOR.patch b/sci-chemistry/molrep/files/11.0.03-EOR.patch
new file mode 100644
index 000000000000..430629e8dcc1
--- /dev/null
+++ b/sci-chemistry/molrep/files/11.0.03-EOR.patch
@@ -0,0 +1,16 @@
+ src/molrep.f | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/molrep.f b/src/molrep.f
+index eac0cfc..94f74c6 100755
+--- a/src/molrep.f
++++ b/src/molrep.f
+@@ -1257,7 +1257,7 @@ C CHECK_DENS_FILE( 2 )
+ LEN1 = 1
+ IF(LEN.GT.60) LEN1 = LEN - 59
+ WRITE(LINE,'(''Input MODEL_2(fixed)_file:'',A)')
+- * NAME2(LEN11:LEN)
++ * NAME2(LEN1:LEN)
+ CALL MSGDOC(MDoc,LINE)
+
+ ENDIF
diff --git a/sci-chemistry/molrep/metadata.xml b/sci-chemistry/molrep/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/molrep/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/molrep/molrep-11.0.02.ebuild b/sci-chemistry/molrep/molrep-11.0.02.ebuild
new file mode 100644
index 000000000000..51ff6cb26524
--- /dev/null
+++ b/sci-chemistry/molrep/molrep-11.0.02.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 multilib toolchain-funcs
+
+DESCRIPTION="molecular replacement program"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/molrep.html"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-libs/ccp4-libs-6.1.3
+ sci-libs/mmdb
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/11.0.00-respect-FLAGS.patch \
+ "${FILESDIR}"/11.0.00-test.patch
+}
+
+src_compile() {
+ cd "${S}"/src
+ emake clean
+ emake \
+ MR_FORT="$(tc-getFC) ${FFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ MR_LIBRARY="-L${EPREFIX}/usr/$(get_libdir) -lccp4f -lccp4c $($(tc-getPKG_CONFIG) --libs mmdb lapack) -lccif -lstdc++ -lm"
+}
+
+src_test() {
+ export MR_TEST="${S}/bin/"
+ cd "${S}"/molrep_check/work
+ mkdir out scr
+ cp ../*.bat .
+ bash em.bat || die
+ bash mr.bat || die
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe bin/${PN}
+ dosym ../libexec/ccp4/bin/${PN} /usr/bin/${PN}
+ dodoc readme doc/${PN}.rtf
+}
diff --git a/sci-chemistry/molrep/molrep-11.0.03-r1.ebuild b/sci-chemistry/molrep/molrep-11.0.03-r1.ebuild
new file mode 100644
index 000000000000..3a0d7538b481
--- /dev/null
+++ b/sci-chemistry/molrep/molrep-11.0.03-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic fortran-2 multilib toolchain-funcs
+
+DESCRIPTION="molecular replacement program"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/molrep.html"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.gz"
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-libs/ccp4-libs-6.1.3
+ sci-libs/mmdb
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/11.0.00-respect-FLAGS.patch \
+ "${FILESDIR}"/11.0.00-test.patch \
+ "${FILESDIR}"/${PV}-EOR.patch
+ [[ $(tc-getFC) =~ gfortran ]] && append-fflags -fno-second-underscore
+}
+
+src_compile() {
+ cd "${S}"/src
+ emake clean
+ emake \
+ MR_FORT="$(tc-getFC) ${FFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ MR_LIBRARY="-L${EPREFIX}/usr/$(get_libdir) -lccp4f -lccp4c $($(tc-getPKG_CONFIG) --libs mmdb lapack) -lccif -lstdc++ -lm"
+}
+
+src_test() {
+ export MR_TEST="${S}/bin/"
+ cd "${S}"/molrep_check/work
+ mkdir out scr
+ cp ../*.bat .
+ bash em.bat || die
+ bash mr.bat || die
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe bin/${PN}
+ dosym ../libexec/ccp4/bin/${PN} /usr/bin/${PN}
+ dodoc readme doc/${PN}.rtf
+}
diff --git a/sci-chemistry/molscript/Manifest b/sci-chemistry/molscript/Manifest
new file mode 100644
index 000000000000..d1fa0a225a02
--- /dev/null
+++ b/sci-chemistry/molscript/Manifest
@@ -0,0 +1 @@
+DIST molscript-2.1.2.tar.gz 412497 SHA256 01252931f5a3542d5659ddaa4ebceaed2e75becb8ed150dfa14b59da9a63ca01 SHA512 0f82936da3123770c0fdb703094dbb5289cc39e9f9ffd034d8dba563f8d615788f67040d38158ac2f203b480c5838a7d8e71ca07bc5098181c1e3cfea26703a4 WHIRLPOOL 1588f4dd47117f8da797a8bf62a2eba071106b1faca4f79b06e3093fe76092cae54476f1a0be995e3637173561ae6003fded264dd6d3a424d235488f95085a75
diff --git a/sci-chemistry/molscript/files/2.1.2-ldflags.patch b/sci-chemistry/molscript/files/2.1.2-ldflags.patch
new file mode 100644
index 000000000000..8867bc10a6b5
--- /dev/null
+++ b/sci-chemistry/molscript/files/2.1.2-ldflags.patch
@@ -0,0 +1,22 @@
+diff --git a/Makefile.complete b/Makefile.complete
+index 4ad535a..b565266 100644
+--- a/Makefile.complete
++++ b/Makefile.complete
+@@ -91,7 +91,7 @@ clean:
+
+ #------------------------------------------------------------
+ molscript: $(OBJ) clib/clib.a
+- $(CC) -o molscript $(COPT) $(OBJ) $(YLIB) clib/clib.a \
++ $(CC) $(LDFLAGS) -o molscript $(COPT) $(OBJ) $(YLIB) clib/clib.a \
+ $(GLUTLINK) $(JPEGLINK) $(PNGLINK) $(GIFLINK) $(ZLIBLINK) -lm
+
+ molscript.tab.o: molscript.tab.c molscript.tab.h
+@@ -147,7 +147,7 @@ gif_img.o: gif_img.c gif_img.h global.h graphics.h image.h opengl.h
+
+ #------------------------------------------------------------
+ molauto: molauto.o clib/clib.a
+- $(CC) -o molauto molauto.o clib/clib.a -lm
++ $(CC) $(LDFLAGS) -o molauto molauto.o clib/clib.a -lm
+
+ molauto.o: molauto.c
+
diff --git a/sci-chemistry/molscript/files/2.1.2-libpng15.patch b/sci-chemistry/molscript/files/2.1.2-libpng15.patch
new file mode 100644
index 000000000000..9ed1b85909e8
--- /dev/null
+++ b/sci-chemistry/molscript/files/2.1.2-libpng15.patch
@@ -0,0 +1,19 @@
+--- png_img.c
++++ png_img.c
+@@ -18,6 +18,7 @@
+
+ #include <GL/gl.h>
+
++#include <zlib.h>
+ #include <png.h>
+
+ #include "clib/str_utils.h"
+@@ -69,7 +70,7 @@
+ info_ptr = png_create_info_struct (png_ptr);
+ if (info_ptr == NULL)
+ yyerror ("png_img: could not create PNG info structure");
+- if (setjmp (png_ptr->jmpbuf)) yyerror ("png_img: could not setjmp");
++ if (setjmp (png_jmpbuf(png_ptr))) yyerror ("png_img: could not setjmp");
+
+ png_init_io (png_ptr, outfile);
+ png_set_compression_level (png_ptr, compression_level);
diff --git a/sci-chemistry/molscript/files/2.1.2-prll.patch b/sci-chemistry/molscript/files/2.1.2-prll.patch
new file mode 100644
index 000000000000..e4c972a10533
--- /dev/null
+++ b/sci-chemistry/molscript/files/2.1.2-prll.patch
@@ -0,0 +1,10 @@
+diff --git a/Makefile.complete b/Makefile.complete
+index 92ef20a..e3f68e3 100644
+--- a/Makefile.complete
++++ b/Makefile.complete
+@@ -153,4 +153,4 @@ molauto.o: molauto.c
+
+ #------------------------------------------------------------
+ clib/clib.a:
+- cd clib; make clib.a CFLAGS="-I. $(CFLAGS)" OPENGLCLIBOBJ="$(OPENGLCLIBOBJ)"
++ $(MAKE) -C clib clib.a CFLAGS="-I. $(CFLAGS)" OPENGLCLIBOBJ="$(OPENGLCLIBOBJ)"
diff --git a/sci-chemistry/molscript/files/fix-makefile-shared.patch b/sci-chemistry/molscript/files/fix-makefile-shared.patch
new file mode 100644
index 000000000000..a9947a61a665
--- /dev/null
+++ b/sci-chemistry/molscript/files/fix-makefile-shared.patch
@@ -0,0 +1,62 @@
+diff -urN molscript-2.1.2.orig/Makefile.complete molscript-2.1.2/Makefile.complete
+--- molscript-2.1.2.orig/Makefile.complete 1998-11-25 01:04:39.000000000 -0800
++++ molscript-2.1.2/Makefile.complete 2005-11-21 12:28:06.000000000 -0800
+@@ -23,9 +23,9 @@
+
+ # OpenGL and GLUT for X (UNIX).
+ # Must be modified for Windows 95/NT. <---
+-GLUTDIR = $(FREEWAREDIR)/glut
+-GLUTLINK = $(GLUTDIR)/lib/glut/libglut.a -lGLU -lGL -lXmu -lXext -lX11
+-OPENGLFLAG = -DOPENGL_SUPPORT -I$(GLUTDIR)/include
++GLUTDIR = $(FREEWAREDIR)
++GLUTLINK = -lglut -lGLU -lGL -lXmu -lXext -lX11
++OPENGLFLAG = -DOPENGL_SUPPORT -I$(GLUTDIR)/include/GL
+ OPENGLOBJ = opengl.o
+ OPENGLCLIBOBJ = ogl_utils.o ogl_body.o ogl_bitmap_character.o
+
+@@ -35,25 +35,25 @@
+
+ # JPEG image file format; requires the JPEG library.
+ # Comment out these lines if the JPEG library is not available. <---
+-JPEGDIR = $(FREEWAREDIR)/jpeg
+-JPEGLINK = $(JPEGDIR)/libjpeg.a
+-JPEGFLAG = -DJPEG_SUPPORT -I$(JPEGDIR)
++JPEGDIR = $(FREEWAREDIR)
++JPEGLINK = -ljpeg
++JPEGFLAG = -DJPEG_SUPPORT
+ JPEGOBJ = jpeg_img.o
+
+ # PNG image file format; requires the PNG library and the zlib library.
+ # Comment out these lines if the PNG and zlib libraries are not available. <---
+-ZLIBDIR = $(FREEWAREDIR)/zlib
+-ZLIBLINK = $(ZLIBDIR)/libz.a
+-PNGDIR = $(FREEWAREDIR)/libpng
+-PNGLINK = $(PNGDIR)/libpng.a
+-PNGFLAG = -DPNG_SUPPORT -I$(PNGDIR) -I$(ZLIBDIR)
++ZLIBDIR = $(FREEWAREDIR)
++ZLIBLINK = -lz
++PNGDIR = $(FREEWAREDIR)
++PNGLINK = -lpng
++PNGFLAG = -DPNG_SUPPORT
+ PNGOBJ = png_img.o
+
+ # GIF image file format; requires the gd 1.3 library.
+ # Comment out these lines if the gd 1.3 library is not available. <---
+-GIFDIR = $(FREEWAREDIR)/gd
+-GIFLINK = $(GIFDIR)/libgd.a
+-GIFFLAG = -DGIF_SUPPORT -I$(GIFDIR)
++GIFDIR = $(FREEWAREDIR)
++GIFLINK = -lgd
++GIFFLAG = -DGIF_SUPPORT
+ GIFOBJ = gif_img.o
+
+ # SGI IRIX's C compiler.
+@@ -62,7 +62,7 @@
+ COPT = -O1
+ # Correctness flags:
+ #CCHECK = -ansi -fullwarn -g -DSELECT_DEBUG
+-CCHECK = -ansi -fullwarn
++CCHECK = -ansi
+ #CCHECK = -ansi -fullwarn -DNDEBUG
+
+ # General cc compile flags.
diff --git a/sci-chemistry/molscript/files/glutbitmap.h b/sci-chemistry/molscript/files/glutbitmap.h
new file mode 100644
index 000000000000..9584bb129daa
--- /dev/null
+++ b/sci-chemistry/molscript/files/glutbitmap.h
@@ -0,0 +1,32 @@
+#ifndef __glutbitmap_h__
+#define __glutbitmap_h__
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+#define GLUT_NO_LIB_PRAGMA /* Avoid auto library linking when building
+ the GLUT library itself. */
+#include <GL/glut.h>
+
+typedef struct {
+ const GLsizei width;
+ const GLsizei height;
+ const GLfloat xorig;
+ const GLfloat yorig;
+ const GLfloat advance;
+ const GLubyte *bitmap;
+} BitmapCharRec, *BitmapCharPtr;
+
+typedef struct {
+ const char *name;
+ const int num_chars;
+ const int first;
+ const BitmapCharRec * const *ch;
+} BitmapFontRec, *BitmapFontPtr;
+
+typedef void *GLUTbitmapFont;
+
+#endif /* __glutbitmap_h__ */
diff --git a/sci-chemistry/molscript/metadata.xml b/sci-chemistry/molscript/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/molscript/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/molscript/molscript-2.1.2-r2.ebuild b/sci-chemistry/molscript/molscript-2.1.2-r2.ebuild
new file mode 100644
index 000000000000..9440dce9820c
--- /dev/null
+++ b/sci-chemistry/molscript/molscript-2.1.2-r2.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 toolchain-funcs
+
+DESCRIPTION="Display molecular 3D structures, such as proteins, in both schematic and detailed representations"
+HOMEPAGE="http://www.avatar.se/molscript/"
+SRC_URI="${P}.tar.gz"
+
+LICENSE="glut molscript"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ media-libs/freeglut
+ media-libs/gd:2=
+ media-libs/libpng:0=
+ virtual/jpeg:0=
+ || (
+ x11-libs/libXmu
+ x11-libs/libXext
+ x11-libs/libX11
+ )"
+RDEPEND="${DEPEND}"
+
+RESTRICT="fetch"
+
+pkg_nofetch() {
+ elog "Please visit ${HOMEPAGE}"
+ elog "and get ${A}."
+ elog "Place it in ${DISTDIR}"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/fix-makefile-shared.patch \
+ "${FILESDIR}"/${PV}-ldflags.patch \
+ "${FILESDIR}"/${PV}-prll.patch \
+ "${FILESDIR}"/${PV}-libpng15.patch
+
+ # Provide glutbitmap.h, because freeglut doesn't have it
+ cp "${FILESDIR}"/glutbitmap.h "${S}"/clib/ || die
+
+ # Stop an incredibly hacky include
+ sed \
+ -e 's:<../lib/glut/glutbitmap.h>:"glutbitmap.h":g' \
+ -i "${S}"/clib/ogl_bitmap_character.c || die
+}
+
+src_compile() {
+ # Prefix of programs it links with
+ export FREEWAREDIR="${EPREFIX}/usr"
+
+ ln -s Makefile.complete Makefile || die
+
+ emake \
+ CC="$(tc-getCC)" \
+ COPT="${CFLAGS}"
+}
+
+src_install() {
+ dobin molscript molauto
+ dohtml "${S}"/doc/*.html
+}
diff --git a/sci-chemistry/molsketch/Manifest b/sci-chemistry/molsketch/Manifest
new file mode 100644
index 000000000000..28ee7103bdb4
--- /dev/null
+++ b/sci-chemistry/molsketch/Manifest
@@ -0,0 +1,2 @@
+DIST Molsketch-0.2.0-Source.tar.gz 276809 SHA256 05e058bf71fc99e5dda56ef1779a82c8885b2001d1af5dce92d959bf56d8a5d0 SHA512 e72c3b2103d70964ada8bd57cc40c16ae30d0a7c2c45521ca3c7a4c4586270e06707e5d662983a2d0f214b16b12afbfa439b58568873537f70f8ac735aa28d26 WHIRLPOOL 1711ef1e45aa09eda1b6dfa44589b0f235ac533914b343b3802d44faae1f658b668e418014d81a5a797f06132c0c72085eb64b9e8c1f7e22650d4655783cca46
+DIST Molsketch-0.3.0-src.tar.gz 337388 SHA256 078b05bfd591930430bc1e5df802af27bdf40718b9218ba6435eadc209d4d1bc SHA512 405553c9d84f0ce9d70a237834f8273dd5010b95868434f9b1b9042fd626e2782c5d3da7d17d9485946210e48e86d0c2de8385d80667018dbc833c3928d076d4 WHIRLPOOL 659717039bf294072117a8e7dc1cb590c6804d3dbde625aa16451bfdb6371933c71f6241fee1e38cec696bdb89e19111c30cf6ed17810daf09b75272080fbb31
diff --git a/sci-chemistry/molsketch/files/molsketch-0.2.0-openbabel-231.patch b/sci-chemistry/molsketch/files/molsketch-0.2.0-openbabel-231.patch
new file mode 100644
index 000000000000..41ddf01df5f8
--- /dev/null
+++ b/sci-chemistry/molsketch/files/molsketch-0.2.0-openbabel-231.patch
@@ -0,0 +1,54 @@
+ CMakeLists.txt | 12 ++++++------
+ libmolsketch/src/stereocenteritem.cpp | 2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a4b5d29..f472b40 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,10 +12,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ # compiler issues are fixed and more warnings are issued. #
+ ###########################################################
+ if (CMAKE_COMPILER_IS_GNUCXX)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wchar-subscripts")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -fno-common")
++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align")
++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wchar-subscripts")
++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security")
++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -fno-common")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-check-new -fno-common")
+@@ -32,7 +32,7 @@ set(CPACK_SOURCE_IGNORE_FILES "/build;/.git")
+ include(CPack)
+
+ # Unit testing, mainly useful for developers and so defaults to off
+-option(ENABLE_TESTS "Enable unit testing" ON)
++option(ENABLE_TESTS "Enable unit testing" OFF)
+ if(ENABLE_TESTS)
+ set(QT_USE_QTTEST TRUE)
+ enable_testing()
+@@ -48,7 +48,7 @@ configure_file("${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
+ add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+
+ # Enabling debugging symbols
+-set(CMAKE_BUILD_TYPE Debug)
++# set(CMAKE_BUILD_TYPE Debug)
+
+ # Enabling shared libraries
+ set(BUILD_SHARED_LIBS OFF)
+diff --git a/libmolsketch/src/stereocenteritem.cpp b/libmolsketch/src/stereocenteritem.cpp
+index 44a8015..20f2a4a 100644
+--- a/libmolsketch/src/stereocenteritem.cpp
++++ b/libmolsketch/src/stereocenteritem.cpp
+@@ -63,7 +63,7 @@ namespace Molsketch {
+ graphsym.GetSymmetry(symmetry_classes);
+
+ //std::vector<unsigned long> atomIds = FindTetrahedralAtoms(obmol, symmetry_classes);
+- std::vector<OpenBabel::StereogenicUnit> units = FindStereogenicUnits(obmol, symmetry_classes);
++ OpenBabel::OBStereoUnitSet units = FindStereogenicUnits(obmol, symmetry_classes);
+
+ for (unsigned int i = 0; i < units.size(); ++i) {
+ if (units.at(i).type == OpenBabel::OBStereo::Tetrahedral) {
diff --git a/sci-chemistry/molsketch/files/molsketch-0.3.0-_DEFAULT_SOURCE.patch b/sci-chemistry/molsketch/files/molsketch-0.3.0-_DEFAULT_SOURCE.patch
new file mode 100644
index 000000000000..af3b5ceedac6
--- /dev/null
+++ b/sci-chemistry/molsketch/files/molsketch-0.3.0-_DEFAULT_SOURCE.patch
@@ -0,0 +1,16 @@
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e3cd0fe..64c18a2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,7 +19,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-check-new -fno-common")
+- add_definitions(-D_BSD_SOURCE)
++ add_definitions(-D_DEFAULT_SOURCE)
+ endif (CMAKE_COMPILER_IS_GNUCXX)
+
+ # Enable CPack
diff --git a/sci-chemistry/molsketch/files/molsketch-0.3.0-desktop.patch b/sci-chemistry/molsketch/files/molsketch-0.3.0-desktop.patch
new file mode 100644
index 000000000000..fd44e88c7870
--- /dev/null
+++ b/sci-chemistry/molsketch/files/molsketch-0.3.0-desktop.patch
@@ -0,0 +1,19 @@
+ molsketch/src/molsketch.desktop | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/molsketch/src/molsketch.desktop b/molsketch/src/molsketch.desktop
+index a4a5418..4e0a2ef 100644
+--- a/molsketch/src/molsketch.desktop
++++ b/molsketch/src/molsketch.desktop
+@@ -5,9 +5,9 @@ Type=Application
+ Name=molsKetch
+ TryExec=molsketch
+ Exec=molsketch
+-Icon=molsketch.png
++Icon=molsketch
+ DocPath=molsketch/index.html
+-MimeType=chemical/x-cml
++MimeType=chemical/x-cml;
+ Terminal=false
+ Categories=Qt;Education;Science;
+ GenericName=2D molecular structures editor
diff --git a/sci-chemistry/molsketch/files/molsketch-0.3.0-no-quotes.patch b/sci-chemistry/molsketch/files/molsketch-0.3.0-no-quotes.patch
new file mode 100644
index 000000000000..db7be800e385
--- /dev/null
+++ b/sci-chemistry/molsketch/files/molsketch-0.3.0-no-quotes.patch
@@ -0,0 +1,16 @@
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 64c18a2..75c2fb7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -97,7 +97,7 @@ endif(Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5PrintSupport_FO
+ if(FORCEQt4)
+ add_definitions(-DQTVERSIONSUFFIX="")
+ else(FORCEQt4)
+- add_definitions(-DQTVERSIONSUFFIX="\\\"-qt5\\\"")
++ add_definitions(-DQTVERSIONSUFFIX="-qt5")
+ endif(FORCEQt4)
+
+ # and OpenBabel2
diff --git a/sci-chemistry/molsketch/metadata.xml b/sci-chemistry/molsketch/metadata.xml
new file mode 100644
index 000000000000..58bc5230b1ab
--- /dev/null
+++ b/sci-chemistry/molsketch/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ Molsketch is a 2D molecular editing tool. Its goal is to help you draw
+ molecules quick and easily. Of course you're creation can be exported
+ afterwards in high quality in a number of vector and bitmap formats.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">molsketch</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/molsketch/molsketch-0.2.0-r1.ebuild b/sci-chemistry/molsketch/molsketch-0.2.0-r1.ebuild
new file mode 100644
index 000000000000..f3184d8d27fd
--- /dev/null
+++ b/sci-chemistry/molsketch/molsketch-0.2.0-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multilib
+
+MY_P=${P/m/M}-Source
+
+DESCRIPTION="A drawing tool for 2D molecular structures"
+HOMEPAGE="http://molsketch.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ >=sci-chemistry/openbabel-2.2
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-qt/qttest:4
+ >=dev-qt/qthelp-4.7.0:4[compat]"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-openbabel-231.patch
+ )
+
+src_prepare() {
+ sed -e "/LIBRARY DESTINATION/ s/lib/$(get_libdir)/g" \
+ -i libmolsketch/src/CMakeLists.txt || die #351246
+ sed -e "s:doc/molsketch:doc/${PF}:g" \
+ -i molsketch/src/{CMakeLists.txt,mainwindow.cpp} || die
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DOPENBABEL2_INCLUDE_DIR="${EPREFIX}/usr/include/openbabel-2.0"
+ -DCMAKE_DISABLE_FIND_PACKAGE_KDE4=ON
+ )
+ cmake-utils_src_configure
+}
diff --git a/sci-chemistry/molsketch/molsketch-0.3.0.ebuild b/sci-chemistry/molsketch/molsketch-0.3.0.ebuild
new file mode 100644
index 000000000000..3fec18fd5362
--- /dev/null
+++ b/sci-chemistry/molsketch/molsketch-0.3.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR=ninja
+
+inherit cmake-utils multilib qmake-utils
+
+MY_P=${P/m/M}-src
+
+DESCRIPTION="A drawing tool for 2D molecular structures"
+HOMEPAGE="http://molsketch.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/${PN}/Molsketch/Lithium%20${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+DEPEND="
+ >=sci-chemistry/openbabel-2.2
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtprintsupport:5
+ dev-qt/qtsvg:5
+ dev-qt/qtwidgets:5
+ "
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P%%-src}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-_DEFAULT_SOURCE.patch
+ "${FILESDIR}"/${P}-desktop.patch
+ "${FILESDIR}"/${P}-no-quotes.patch
+ )
+
+src_prepare() {
+ sed -e "/LIBRARY DESTINATION/ s/lib/$(get_libdir)/g" \
+ -i {obabeliface,libmolsketch/src}/CMakeLists.txt || die #351246
+ sed -e "s:doc/molsketch:doc/${PF}:g" \
+ -i molsketch/src/{CMakeLists.txt,mainwindow.cpp} || die
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DOPENBABEL2_INCLUDE_DIR="${EPREFIX}/usr/include/openbabel-2.0"
+ -DCMAKE_DISABLE_FIND_PACKAGE_KDE4=ON
+ -DENABLE_TESTS=$(usex test "ON" "OFF")
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ dosym ${PN}-qt5 /usr/bin/${PN}
+}
diff --git a/sci-chemistry/mongochem/Manifest b/sci-chemistry/mongochem/Manifest
new file mode 100644
index 000000000000..480c14f5f8a7
--- /dev/null
+++ b/sci-chemistry/mongochem/Manifest
@@ -0,0 +1 @@
+DIST mongochem-0.7.0.tar.gz 448002 SHA256 a93f53e8d945f2e3b97efac8187cfaeae0a7e491265cd65d66d25e34577cf883 SHA512 076f79c9dbed372cc760c972d5529fc3a10ea23ba2a58bf1034b736c5394a9283223562c0d6d14a135cdf87786a222991ca613765484d5a36c31f65c2ccccb05 WHIRLPOOL 4b044e00e44b1333e3faec04e15eaf46e7b17eecd4c155099fc5f06dc9c62bde70adc8bb8a9793df9b305efc89f5e44bdea77eeaac1da3554c002cba117fe8c1
diff --git a/sci-chemistry/mongochem/metadata.xml b/sci-chemistry/mongochem/metadata.xml
new file mode 100644
index 000000000000..411a151f03ae
--- /dev/null
+++ b/sci-chemistry/mongochem/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">OpenChemistry/mongochem</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/mongochem/mongochem-0.7.0.ebuild b/sci-chemistry/mongochem/mongochem-0.7.0.ebuild
new file mode 100644
index 000000000000..5e6b2b642692
--- /dev/null
+++ b/sci-chemistry/mongochem/mongochem-0.7.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+inherit cmake-utils vcs-snapshot
+
+DESCRIPTION="Application for managing large collections of chemical data"
+HOMEPAGE="http://www.openchemistry.org/"
+#SRC_URI="http://openchemistry.org/files/v0.5/${P}.tar.gz"
+SRC_URI="https://github.com/OpenChemistry/mongochem/archive/df36ebce92024dd4fd1c70eb37eb84e4c51120ff.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-db/mongodb[sharedclient]
+ dev-libs/boost[threads]
+ sci-libs/avogadrolibs[qt4]
+ sci-libs/chemkit
+ sci-libs/vtk[qt4,rendering]
+ sci-chemistry/molequeue
+"
+DEPEND="${RDEPEND}"
diff --git a/sci-chemistry/mopac7/Manifest b/sci-chemistry/mopac7/Manifest
new file mode 100644
index 000000000000..d352d6ff544a
--- /dev/null
+++ b/sci-chemistry/mopac7/Manifest
@@ -0,0 +1,3 @@
+DIST dcart.f 11044 SHA256 cdc4082b6b3811eca25eaf674e9345fcd37f58dfbdca3c5d72e9c4e88c47dec9 SHA512 788a184fd8419ff742e49c1a652d5ea093f9114dbe4f272665b8fb9eeac2afb7f7042628c288f2b81d0f54d8a7ef2f400490cd3aff39dda59a6d70a0deab5b80 WHIRLPOOL 399d7cf92d6fd27bb785c3f81eb24ec9615144b3e8605779d1f1f645ea16644a858428d8dfce44c102a495f984e1ae158fe7743ad0bef2b957ea10adc94ccb73
+DIST gmxmop.f 38956 SHA256 918bfac91b1dab65f7a8f759c3fd49e40be19bbddb6869d95f8e345830b93b67 SHA512 38bb2e5749c4d3c8c24f15682f72e40cb4edb6517c7916cecee1d21675b1870c0fe331ba2ec40312408dec473141e7742d1e155d4b64f1c2a25bfa4e11885194 WHIRLPOOL a0adaf3df1167d9675197f71ae2cd5a9a583eef4523b9a074d39291032dbfe0428349ebf78fabd88ed7e1deb5af093be319c9f19cab019deb52f0fb6e3924998
+DIST mopac7-1.15.tar.gz 764547 SHA256 6d7ac5d78522db70f7794fd816cea32829cfa9e93774202fe80ba5a54375fbaa SHA512 e0ccd643caa6dbd7e156867530d79e50e10243f5e3b5f8bc57781e68e1daf26f2a0e6987fff00afe07eb0fcb98cbd9f01e4cfa5d20acc0d8ab3cca632968636e WHIRLPOOL fe4d71e3900b8fe09697275c25bc239e8f94e97d2a570bf6df03c5bd59a3b2ab80bc7f255f739f09c0fc54037e9739b38cec205590ad3cb31ad58fe2067562d2
diff --git a/sci-chemistry/mopac7/files/Makefile b/sci-chemistry/mopac7/files/Makefile
new file mode 100644
index 000000000000..50370b3c2784
--- /dev/null
+++ b/sci-chemistry/mopac7/files/Makefile
@@ -0,0 +1,23 @@
+VERSION = GENTOOVERSION
+MAJOR = 1
+
+LIBS = -lgfortran -lf2c
+
+objects := $(patsubst %.f,%.o,$(wildcard *.f))
+
+all: libgmxmopac7
+
+clean:
+ rm -f moldat.*f deriv.* mopac7*.* compfg.* dcart.*
+
+%.o: %.f
+ $(FC) $(FFLAGS) -fPIC -c $<
+
+libgmxmopac7: $(objects)
+ $(FC) -shared $(LDFLAGS) -Wl,-soname,libgmxmopac7.so.$(MAJOR) -o $@.so.$(VERSION) $^ $(LIBS)
+ ln -sf $@.so.$(VERSION) libgmxmopac7.so
+
+static: $(objects)
+ ar rcv libgmxmopac7.a *.o
+ ranlib libgmxmopac7.a
+
diff --git a/sci-chemistry/mopac7/metadata.xml b/sci-chemistry/mopac7/metadata.xml
new file mode 100644
index 000000000000..839734dd5d8b
--- /dev/null
+++ b/sci-chemistry/mopac7/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-chemistry</herd>
+ <use>
+ <flag name="gmxmopac7">Add support library for gromacs</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/mopac7/mopac7-1.15-r1.ebuild b/sci-chemistry/mopac7/mopac7-1.15-r1.ebuild
new file mode 100644
index 000000000000..ce0c326678ec
--- /dev/null
+++ b/sci-chemistry/mopac7/mopac7-1.15-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools fortran-2 flag-o-matic toolchain-funcs
+
+DESCRIPTION="Autotooled, updated version of a powerful, fast semi-empirical package"
+HOMEPAGE="http://sourceforge.net/projects/mopac7/"
+SRC_URI="
+ http://www.bioinformatics.org/ghemical/download/current/${P}.tar.gz
+ http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/dcart.f
+ http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/gmxmop.f"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux"
+IUSE="gmxmopac7 static-libs"
+
+DEPEND="dev-libs/libf2c"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Install the executable
+ sed -i \
+ -e "s:noinst_PROGRAMS = mopac7:bin_PROGRAMS = mopac7:g" \
+ fortran/Makefile.am \
+ || die "sed failed: install mopac7"
+ # Install the script to run the executable
+ sed -i \
+ -e "s:EXTRA_DIST = autogen.sh run_mopac7:bin_SCRIPTS = run_mopac7:g" \
+ Makefile.am \
+ || die "sed failed: install run_mopac7"
+
+ eautoreconf
+ append-fflags -std=legacy -fno-automatic
+}
+
+src_compile() {
+ emake
+ if use gmxmopac7; then
+ einfo "Making mopac7 lib for gromacs"
+ mkdir "${S}"/fortran/libgmxmopac7 && cd "${S}"/fortran/libgmxmopac7
+ cp -f ../SIZES ../*.f "${FILESDIR}"/Makefile . || die
+ emake clean
+ cp -f "${DISTDIR}"/gmxmop.f "${DISTDIR}"/dcart.f . || die
+ sed "s:GENTOOVERSION:${PV}:g" -i Makefile
+ emake FC=$(tc-getFC)
+ use static-libs && emake static
+ fi
+}
+
+src_install() {
+ # A correct fix would have a run_mopac7.in with @bindir@ that gets
+ # replaced by configure, and run_mopac7 added to AC_OUTPUT in configure.ac
+ sed -i "s:./fortran/mopac7:mopac7:g" run_mopac7 || die
+
+ default
+
+ if use gmxmopac7; then
+ cd "${S}"/fortran/libgmxmopac7
+ dolib.so libgmxmopac7.so*
+ use static-libs && dolib.a libgmxmopac7.a
+ fi
+}
diff --git a/sci-chemistry/mopac7/mopac7-1.15.ebuild b/sci-chemistry/mopac7/mopac7-1.15.ebuild
new file mode 100644
index 000000000000..167561f7ed96
--- /dev/null
+++ b/sci-chemistry/mopac7/mopac7-1.15.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools fortran-2 toolchain-funcs
+
+DESCRIPTION="Autotooled, updated version of a powerful, fast semi-empirical package"
+HOMEPAGE="http://sourceforge.net/projects/mopac7/"
+SRC_URI="
+ http://www.bioinformatics.org/ghemical/download/current/${P}.tar.gz
+ http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/dcart.f
+ http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/gmxmop.f"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux"
+IUSE="gmxmopac7 static-libs"
+
+DEPEND="dev-libs/libf2c"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Install the executable
+ sed -i \
+ -e "s:noinst_PROGRAMS = mopac7:bin_PROGRAMS = mopac7:g" \
+ fortran/Makefile.am \
+ || die "sed failed: install mopac7"
+ # Install the script to run the executable
+ sed -i \
+ -e "s:EXTRA_DIST = autogen.sh run_mopac7:bin_SCRIPTS = run_mopac7:g" \
+ Makefile.am \
+ || die "sed failed: install run_mopac7"
+
+ eautoreconf
+}
+
+src_configure() {
+ #set -std=legacy -fno-automatic according to
+ #http://www.bioinformatics.org/pipermail/ghemical-devel/2008-August/000763.html
+ FFLAGS="${FFLAGS} -std=legacy -fno-automatic" econf
+}
+
+src_compile() {
+ emake
+ if use gmxmopac7; then
+ einfo "Making mopac7 lib for gromacs"
+ mkdir "${S}"/fortran/libgmxmopac7 && cd "${S}"/fortran/libgmxmopac7
+ cp -f ../SIZES ../*.f "${FILESDIR}"/Makefile . || die
+ emake clean
+ cp -f "${DISTDIR}"/gmxmop.f "${DISTDIR}"/dcart.f . || die
+ sed "s:GENTOOVERSION:${PV}:g" -i Makefile
+ emake FC=$(tc-getFC)
+ if use static-libs; then
+ emake static
+ fi
+ fi
+}
+
+src_install() {
+ # A correct fix would have a run_mopac7.in with @bindir@ that gets
+ # replaced by configure, and run_mopac7 added to AC_OUTPUT in configure.ac
+ sed -i "s:./fortran/mopac7:mopac7:g" run_mopac7
+
+ make DESTDIR="${D}" install || die
+ dodoc AUTHORS README ChangeLog
+ if use gmxmopac7; then
+ cd "${S}"/fortran/libgmxmopac7
+ dolib.so libgmxmopac7.so*
+ if use static-libs; then
+ dolib.a libgmxmopac7.a
+ fi
+ fi
+}
diff --git a/sci-chemistry/mosflm/Manifest b/sci-chemistry/mosflm/Manifest
new file mode 100644
index 000000000000..80df134c833e
--- /dev/null
+++ b/sci-chemistry/mosflm/Manifest
@@ -0,0 +1 @@
+DIST mosflm709.tgz 3324010 SHA256 d22b05211f274b50c284d4c14fcb456c52b13344e2a48d5f45855fe87f82f6d1 SHA512 aa85f8459f280e0e1d2d54041029ef072346ecef3ffcc7724eb524469e1b77dfbd95aac8b46f2b9682d605a4e5931d9c13f1162d5f3bcff08644db7e79a6316c WHIRLPOOL b3a82858a8d2a3162bc0fcfb3bf7fb7b01cfc6bca80b34643e7c6caae54b1ef1e2b24a58617ffe2b0423ca6626d51e31b49c0dba6a82ed5c61fa10d044e0d3b8
diff --git a/sci-chemistry/mosflm/files/7.0.6-Makefile.patch b/sci-chemistry/mosflm/files/7.0.6-Makefile.patch
new file mode 100644
index 000000000000..a35232f6e8c0
--- /dev/null
+++ b/sci-chemistry/mosflm/files/7.0.6-Makefile.patch
@@ -0,0 +1,13 @@
+--- Makefile 2008-10-17 16:15:30.000000000 +0200
++++ Makefile.new 2009-02-20 21:52:34.000000000 +0100
+@@ -22,7 +22,7 @@
+ CBFLIBS = cbf/lib/libcbf.a
+ JPGLIBS = jpg/libjpeg.a
+
+-all: $(DPSLIBS) $(CBFLIBS) $(JPGLIBS)
+- cd mosflm ; make
++all: dpslibs cbflibs
++ +make -C mosflm
+
+ ##########################################################################
+
diff --git a/sci-chemistry/mosflm/files/7.0.6-impl-dec.patch b/sci-chemistry/mosflm/files/7.0.6-impl-dec.patch
new file mode 100644
index 000000000000..da393eb93fe6
--- /dev/null
+++ b/sci-chemistry/mosflm/files/7.0.6-impl-dec.patch
@@ -0,0 +1,36 @@
+diff --git a/mosflm/bravais_fortran.c b/mosflm/bravais_fortran.c
+index 3d68cad..800bd0e 100644
+--- a/mosflm/bravais_fortran.c
++++ b/mosflm/bravais_fortran.c
+@@ -2,6 +2,7 @@
+ #include <stdlib.h>
+ #include <math.h>
+ #include "../util/util.h"
++#include "../util/bravais.h"
+
+ /* bravais_fortran_(): This routine converts array from FORTRAN program
+ to structure for call to bravais
+diff --git a/mosflm/chelp.c b/mosflm/chelp.c
+index b2aaefc..fa44ab0 100644
+--- a/mosflm/chelp.c
++++ b/mosflm/chelp.c
+@@ -5,6 +5,7 @@
+ /* modified for Linux by Joachim Meyer jmeyer@embl-heidelberg.de 1998.05.19 */
+
+ #include "chelp.h"
++#include <stdio.h>
+
+ #if CALL_LIKE_HPUX
+ void chelp ()
+diff --git a/mosflm/pck.c b/mosflm/pck.c
+index ec094fc..288671d 100644
+--- a/mosflm/pck.c
++++ b/mosflm/pck.c
+@@ -17,6 +17,7 @@
+ #include <math.h>
+ #include <ctype.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #define BYTE char
+ #define WORD short int
diff --git a/sci-chemistry/mosflm/files/7.0.6-parallel.patch b/sci-chemistry/mosflm/files/7.0.6-parallel.patch
new file mode 100644
index 000000000000..f735c7ce5cf7
--- /dev/null
+++ b/sci-chemistry/mosflm/files/7.0.6-parallel.patch
@@ -0,0 +1,28 @@
+--- cbf/Makefile 2009-08-31 09:35:06.000000000 +0200
++++ cbf/Makefile.new 2009-08-31 10:44:46.000000000 +0200
+@@ -362,6 +362,8 @@
+ $(EXAMPLES)/img.h \
+ $(INCLUDE)/md5.h
+
++OBJ = $(subst .c,.o,$(SOURCE))
++
+ #
+ # Compile the library and examples
+ #
+@@ -379,11 +381,14 @@
+ $(LIB):
+ mkdir $(LIB)
+
++
++.c.o: $(SOURCE) $(HEADERS)
++ $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $<
++
+ #
+ # CBF library
+ #
+-$(LIB)/libcbf.a: $(SOURCE) $(HEADERS) $(COMMONDEP)
+- $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $(SOURCE)
++$(LIB)/libcbf.a: $(OBJ) $(COMMONDEP)
+ $(AR) cr $@ *.o
+ rm *.o
+ if [ -f $(RANLIB) ]; then $(RANLIB) $@ ; fi
diff --git a/sci-chemistry/mosflm/files/7.0.7-parallel.patch b/sci-chemistry/mosflm/files/7.0.7-parallel.patch
new file mode 100644
index 000000000000..df0a8b63273a
--- /dev/null
+++ b/sci-chemistry/mosflm/files/7.0.7-parallel.patch
@@ -0,0 +1,92 @@
+ Makefile | 21 ++++++++++-----------
+ cbf/Makefile | 9 +++++++--
+ 2 files changed, 17 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 37f4c7e..51d4164 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,8 +22,8 @@ DPSLIBS = lib/DPSLIB.a
+ CBFLIBS = cbf/lib/libcbf.a
+ JPGLIBS = jpg/libjpeg.a
+
+-all: $(DPSLIBS) $(CBFLIBS) $(JPGLIBS)
+- cd mosflm ; make
++all: $(DPSLIBS)
++ $(MAKE) -C mosflm
+
+ ##########################################################################
+ # #
+@@ -47,22 +47,21 @@ dpslibs:
+
+ cbflibs:
+ rm -f `find ./cbf -name "*.a" -print`
+- cd cbf ; make all ; if [ -f $(RANLIB) ]; \
+- then $(RANLIB) lib/libcbf.a; fi
++ $(MAKE) -C cbf all
+
+ jpglibs:
+- cd jpg ; if [ ! -f Makefile ]; then ./configure ; fi; make libjpeg.a
++ cd jpg ; if [ ! -f Makefile ]; then ./configure ; fi; $(MAKE) libjpeg.a
+
+ ${DPSLIBS}:
+- make dpslibs
++ $(MAKE) dpslibs
+
+ ${CBFLIBS}:
+- make cbflibs
++ $(MAKE) cbflibs
+
+ ${JPGLIBS}:
+- make jpglibs
++ $(MAKE) jpglibs
+
+-libs: ${DPSLIBS} ${CBFLIBS} ${JPGLIBS}
++libs: ${DPSLIBS} ${CBFLIBS}
+ @echo "****************************************************************"
+ @echo " Making libraries for system ${HOSTTYPE}"
+ @echo "****************************************************************"
+@@ -71,11 +70,11 @@ ipmosflm: libs
+ @echo "****************************************************************"
+ @echo " Making IPMOSFLM for system ${HOSTTYPE}"
+ @echo "****************************************************************"
+- cd mosflm ; make ipmosflm
++ $(MAKE) -C mosflm ipmosflm
+
+ force:
+ rm bin/ipmosflm
+- make ipmosflm
++ $(MAKE) ipmosflm
+
+ install:
+ @echo "the executable is in ${MOSHOME}/bin/ipmosflm"
+diff --git a/cbf/Makefile b/cbf/Makefile
+index e61497c..c3c94ac 100644
+--- a/cbf/Makefile
++++ b/cbf/Makefile
+@@ -362,6 +362,8 @@ HEADERS = $(INCLUDE)/cbf.h \
+ $(EXAMPLES)/img.h \
+ $(INCLUDE)/md5.h
+
++OBJ = $(subst .c,.o,$(SOURCE))
++
+ #
+ # Compile the library and examples
+ #
+@@ -379,11 +381,14 @@ $(INSTALLDIR):
+ $(LIB):
+ mkdir $(LIB)
+
++
++.c.o: $(SOURCE) $(HEADERS)
++ $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $<
++
+ #
+ # CBF library
+ #
+-$(LIB)/libcbf.a: $(SOURCE) $(HEADERS) $(COMMONDEP)
+- $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $(SOURCE)
++$(LIB)/libcbf.a: $(OBJ) $(COMMONDEP)
+ $(AR) cr $@ *.o
+ rm *.o
+ if [ -f $(RANLIB) ]; then $(RANLIB) $@ ; fi
diff --git a/sci-chemistry/mosflm/files/7.0.9-parallel.patch b/sci-chemistry/mosflm/files/7.0.9-parallel.patch
new file mode 100644
index 000000000000..38c6fc45a5c0
--- /dev/null
+++ b/sci-chemistry/mosflm/files/7.0.9-parallel.patch
@@ -0,0 +1,92 @@
+ Makefile | 21 ++++++++++-----------
+ cbf/Makefile | 9 +++++++--
+ 2 files changed, 17 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3d2f543..2219d8d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,8 +22,8 @@ DPSLIBS = lib/DPSLIB.a
+ CBFLIBS = cbf/lib/libcbf.a
+ JPGLIBS = jpg/libjpeg.a
+
+-all: $(DPSLIBS) $(CBFLIBS) $(JPGLIBS)
+- cd mosflm ; make
++all: $(DPSLIBS)
++ $(MAKE) -C mosflm
+
+ dpslibs:
+ @-find . -name "*a" -delete
+@@ -32,22 +32,21 @@ dpslibs:
+
+ cbflibs:
+ @-find ./cbf -name "*.a" -delete
+- cd cbf ; make all ; if [ -f $(RANLIB) ]; \
+- then $(RANLIB) lib/libcbf.a; fi
++ $(MAKE) -C cbf all
+
+ jpglibs:
+- cd jpg ; if [ ! -f Makefile ]; then ./configure ; fi; make libjpeg.a
++ cd jpg ; if [ ! -f Makefile ]; then ./configure ; fi; $(MAKE) libjpeg.a
+
+ ${DPSLIBS}:
+- make dpslibs
++ $(MAKE) dpslibs
+
+ ${CBFLIBS}:
+- make cbflibs
++ $(MAKE) cbflibs
+
+ ${JPGLIBS}:
+- make jpglibs
++ $(MAKE) jpglibs
+
+-libs: ${DPSLIBS} ${CBFLIBS} ${JPGLIBS}
++libs: ${DPSLIBS} ${CBFLIBS}
+ @echo "****************************************************************"
+ @echo " Making libraries for system ${HOSTTYPE}"
+ @echo "****************************************************************"
+@@ -56,11 +55,11 @@ ipmosflm: libs
+ @echo "****************************************************************"
+ @echo " Making IPMOSFLM for system ${HOSTTYPE}"
+ @echo "****************************************************************"
+- cd mosflm ; make ipmosflm
++ $(MAKE) -C mosflm ipmosflm
+
+ force:
+ @-rm -f bin/ipmosflm
+- make ipmosflm
++ $(MAKE) ipmosflm
+
+ install:
+ @echo "the executable is in ${MOSHOME}/bin/ipmosflm"
+diff --git a/cbf/Makefile b/cbf/Makefile
+index e61497c..c3c94ac 100644
+--- a/cbf/Makefile
++++ b/cbf/Makefile
+@@ -362,6 +362,8 @@ HEADERS = $(INCLUDE)/cbf.h \
+ $(EXAMPLES)/img.h \
+ $(INCLUDE)/md5.h
+
++OBJ = $(subst .c,.o,$(SOURCE))
++
+ #
+ # Compile the library and examples
+ #
+@@ -379,11 +381,14 @@ $(INSTALLDIR):
+ $(LIB):
+ mkdir $(LIB)
+
++
++.c.o: $(SOURCE) $(HEADERS)
++ $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $<
++
+ #
+ # CBF library
+ #
+-$(LIB)/libcbf.a: $(SOURCE) $(HEADERS) $(COMMONDEP)
+- $(CC) $(CFLAGS) $(INCLUDES) $(WARNINGS) -c $(SOURCE)
++$(LIB)/libcbf.a: $(OBJ) $(COMMONDEP)
+ $(AR) cr $@ *.o
+ rm *.o
+ if [ -f $(RANLIB) ]; then $(RANLIB) $@ ; fi
diff --git a/sci-chemistry/mosflm/files/mosflm-7.0.7-buffer-overflow.patch b/sci-chemistry/mosflm/files/mosflm-7.0.7-buffer-overflow.patch
new file mode 100644
index 000000000000..90158eb458d5
--- /dev/null
+++ b/sci-chemistry/mosflm/files/mosflm-7.0.7-buffer-overflow.patch
@@ -0,0 +1,16 @@
+ mosflm/pilatus_c.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/mosflm/pilatus_c.c b/mosflm/pilatus_c.c
+index 1eaae26..cce5a02 100644
+--- a/mosflm/pilatus_c.c
++++ b/mosflm/pilatus_c.c
+@@ -34,7 +34,7 @@ delete them later */
+ int cbf_int[16];
+ long cbf_int4[16];
+ double cbf_double[16];
+- char cbf_char[16][24];
++ char cbf_char[16][32];
+ /* temporary from cbfwrap.c - pilatus doesn't have these, so we'll
+ delete them later */
+ int id, index, iindex;
diff --git a/sci-chemistry/mosflm/files/mosflm-7.0.7-impl-dec.patch b/sci-chemistry/mosflm/files/mosflm-7.0.7-impl-dec.patch
new file mode 100644
index 000000000000..32f251f8e00c
--- /dev/null
+++ b/sci-chemistry/mosflm/files/mosflm-7.0.7-impl-dec.patch
@@ -0,0 +1,29 @@
+ mosflm/mosflm_jpeg.c | 1 +
+ src/dps/index/ind_gen_direct.c | 2 ++
+ 2 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/mosflm/mosflm_jpeg.c b/mosflm/mosflm_jpeg.c
+index 2b32b2e..54684d0 100644
+--- a/mosflm/mosflm_jpeg.c
++++ b/mosflm/mosflm_jpeg.c
+@@ -76,6 +76,7 @@ G. Winter
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #if (defined _MSC_VER)
+ /* no need to do this for __MINGW_ (Mingw gcc) this is just about unique!*/
+ #define S_IRWXU S_IREAD|S_IWRITE|S_IEXEC
+diff --git a/src/dps/index/ind_gen_direct.c b/src/dps/index/ind_gen_direct.c
+index 6e143df..2eea61b 100644
+--- a/src/dps/index/ind_gen_direct.c
++++ b/src/dps/index/ind_gen_direct.c
+@@ -41,6 +41,8 @@
+ /* #include <malloc.h> */
+ #include "util.h"
+ #include "ind_gen_direct.h"
++#include "ind_help.h"
++#include "ind_sort_merge.h"
+ /* char *strcat( char *, const char *); */
+
+
diff --git a/sci-chemistry/mosflm/files/mosflm-7.0.9-buffer-overflow.patch b/sci-chemistry/mosflm/files/mosflm-7.0.9-buffer-overflow.patch
new file mode 100644
index 000000000000..bb4a16bf30fc
--- /dev/null
+++ b/sci-chemistry/mosflm/files/mosflm-7.0.9-buffer-overflow.patch
@@ -0,0 +1,16 @@
+ mosflm/pilatus_c.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/mosflm/pilatus_c.c b/mosflm/pilatus_c.c
+index 4a85b26..9893e0c 100644
+--- a/mosflm/pilatus_c.c
++++ b/mosflm/pilatus_c.c
+@@ -34,7 +34,7 @@ delete them later */
+ int cbf_int[16] = {0};
+ long cbf_int4[16] = {0};
+ double cbf_double[16] = {0};
+- char cbf_char[16][24] = {' '};
++ char cbf_char[16][32] = {' '};
+ /* temporary from cbfwrap.c - pilatus doesn't have these, so we'll
+ delete them later */
+ int id, index, iindex;
diff --git a/sci-chemistry/mosflm/metadata.xml b/sci-chemistry/mosflm/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/mosflm/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/mosflm/mosflm-7.0.9.ebuild b/sci-chemistry/mosflm/mosflm-7.0.9.ebuild
new file mode 100644
index 000000000000..3aa74ced3d94
--- /dev/null
+++ b/sci-chemistry/mosflm/mosflm-7.0.9.ebuild
@@ -0,0 +1,74 @@
+# 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 versionator
+
+MY_PV="$(delete_all_version_separators)"
+MY_P="${PN}${MY_PV}"
+
+DESCRIPTION="A program for integrating single crystal diffraction data from area detectors"
+HOMEPAGE="http://www.mrc-lmb.cam.ac.uk/harry/mosflm/"
+SRC_URI="${HOMEPAGE}ver${MY_PV}/build-it-yourself/${MY_P}.tgz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ app-shells/tcsh
+ sci-libs/cbflib
+ sci-libs/ccp4-libs
+ sys-libs/ncurses
+ virtual/jpeg:0=
+ x11-libs/libxdl_view"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed \
+ -e "s:../cbf/lib/libcbf.a:-lcbf -limg:g" \
+ -e "s:../jpg/libjpeg.a:-ljpeg:g" \
+ -i ${PN}/Makefile || die
+
+ sed \
+ -e '/jinclude.h/d' \
+ -i mosflm/mosflm_jpeg.c || die
+
+ cp DATETIME.C mosflm/datetime.c || die
+
+ epatch \
+ "${FILESDIR}"/${PV}-parallel.patch \
+ "${FILESDIR}"/7.0.6-impl-dec.patch \
+ "${FILESDIR}"/${P}-buffer-overflow.patch \
+ "${FILESDIR}"/${PN}-7.0.7-impl-dec.patch
+
+ rm -rf test.f {cbf,jpg}/*.{h,c} || die
+}
+
+src_compile() {
+ emake \
+ MOSHOME="${S}" \
+ DPS="${S}" \
+ FC=$(tc-getFC) \
+ FLINK=$(tc-getFC) \
+ CC=$(tc-getCC) \
+ AR_FLAGS=vru \
+ MOSLIBS="-lccp4f -lccp4c -lxdl_view $($(tc-getPKG_CONFIG) --libs ncurses) -lXt -lmmdb -lccif -lstdc++" \
+ MCFLAGS="-O0 -fno-second-underscore" \
+ MOSFLAGS="${FFLAGS} -fno-second-underscore" \
+ FFLAGS="${FFLAGS} -fno-second-underscore" \
+ CFLAGS="${CFLAGS}" \
+ MOSCFLAGS="${CFLAGS}" \
+ LFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe bin/ipmosflm
+ dosym ../libexec/ccp4/bin/ip${PN} /usr/bin/ip${PN}
+}
diff --git a/sci-chemistry/mpqc/Manifest b/sci-chemistry/mpqc/Manifest
new file mode 100644
index 000000000000..4f7c28d17b0f
--- /dev/null
+++ b/sci-chemistry/mpqc/Manifest
@@ -0,0 +1 @@
+DIST mpqc-2.3.1.tar.bz2 2521392 SHA256 18f162ca9cb8b3b05372b0ec3d02b4b8a4a7aabfc7b2abead350ddef8f048ecc SHA512 34f24f72c6c0024e72d47c7fd17927ca2a88020b30d22a791954fbc933f67ed6dd6741ee8a80ddd4fdb007f1a357b5f5ea7fc284cab85474bf60e9f29aaaa747 WHIRLPOOL 504e5be36673b85494866b8a09588964dd9b352208c4d08a1365cbc06b39dfe91dc6050a0e16cbd713b43b3e92d86cbe40f53a44a644f224e84340dd065e54ab
diff --git a/sci-chemistry/mpqc/files/mpqc-2.3.1-as-needed.patch b/sci-chemistry/mpqc/files/mpqc-2.3.1-as-needed.patch
new file mode 100644
index 000000000000..a917c0aaff70
--- /dev/null
+++ b/sci-chemistry/mpqc/files/mpqc-2.3.1-as-needed.patch
@@ -0,0 +1,163 @@
+--- mpqc-2.3.1.orig/src/lib/chemistry/molecule/Makefile 2005-05-26 08:00:29.000000000 +0200
++++ mpqc-2.3.1/src/lib/chemistry/molecule/Makefile 2010-02-13 14:28:46.514285918 +0100
+@@ -66,6 +66,12 @@
+ interface:: $(DEPENDINCLUDE)
+
+ LIBS = $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/LIBS.h)
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCcontainer.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCclass.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCkeyval.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCoptimize.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCscmat.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCsymmetry.la
+
+ LD = $(CXX)
+
+--- mpqc-2.3.1.orig/src/lib/chemistry/qc/wfn/Makefile 2004-06-12 06:50:35.000000000 +0200
++++ mpqc-2.3.1/src/lib/chemistry/qc/wfn/Makefile 2010-02-13 14:20:06.911896080 +0100
+@@ -48,6 +48,12 @@
+
+ LIBS = $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/../dft/LIBS.h)
+
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCisosurf.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCsolvent.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCbasis.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCdft.la \
++ $(SRCDIR)/$(TOPDIR)/lib/libSCintv3.la
++
+ wfntest:: wfntest.$(OBJSUF) $(LIBS)
+ $(LTLINK) $(CXX) $(LDFLAGS) -o wfntest $^ $(SYSLIBS) $(LTLINKBINOPTS)
+
+--- mpqc-2.3.1.orig/src/lib/chemistry/qc/intv3/Makefile 2002-04-04 01:08:04.000000000 +0200
++++ mpqc-2.3.1/src/lib/chemistry/qc/intv3/Makefile 2010-02-13 14:04:15.393432311 +0100
+@@ -52,6 +52,8 @@
+ LIBOBJ = $(LIBSRC:%.c=%.$(OBJSUF))
+ LIBOBJ := $(LIBOBJ:%.cc=%.$(OBJSUF))
+
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCoint3.la
++
+ DISTFILES = $(TESTCSRC) $(INC) atoms.sgen Makefile LIBS.h
+
+ DEPENDINCLUDE = $(INC) $(GENINC) $(SGENINC)
+--- mpqc-2.3.1.orig/src/lib/chemistry/qc/mbpt/Makefile 2005-07-07 17:54:05.000000000 +0200
++++ mpqc-2.3.1/src/lib/chemistry/qc/mbpt/Makefile 2010-02-13 14:12:38.975370147 +0100
+@@ -44,6 +44,7 @@
+ CSRCS = bzerofast.c
+
+ LIBOBJ= $(CXXSRCS:%.cc=%.$(OBJSUF)) $(CSRCS:%.c=%.$(OBJSUF))
++LIBADD= $(SRCDIR)/$(TOPDIR)/lib/libSCsymmetry.la
+
+ default:: $(DEPENDINCLUDE)
+
+--- mpqc-2.3.1.orig/src/lib/chemistry/qc/basis/Makefile 2004-02-11 01:24:43.000000000 +0100
++++ mpqc-2.3.1/src/lib/chemistry/qc/basis/Makefile 2010-02-13 14:04:15.395432868 +0100
+@@ -59,6 +59,7 @@
+ DISTFILES = $(CXXSRC) $(INC) Makefile $(TESTSRC) $(TESTFILES)
+
+ LIBOBJ= $(CXXSRC:%.cc=%.$(OBJSUF))
++LIBADD = $(SYSLIBS)
+
+ default:: $(DEPENDINCLUDE)
+
+--- mpqc-2.3.1.orig/src/lib/math/scmat/Makefile 2003-09-16 17:07:03.000000000 +0200
++++ mpqc-2.3.1/src/lib/math/scmat/Makefile 2010-02-13 14:27:36.028370446 +0100
+@@ -75,6 +75,8 @@
+ DISTFILES = $(CXXSRC) $(INC) scmat.h $(WEBSRC) Makefile LIBS.h \
+ $(TESTSRC) $(TESTFILES)
+
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCgroup.la $(SYSLIBS)
++
+ LIBS = $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/LIBS.h)
+
+ matrixtest:
+--- mpqc-2.3.1.orig/src/lib/util/class/Makefile 2005-05-26 08:00:49.000000000 +0200
++++ mpqc-2.3.1/src/lib/util/class/Makefile 2010-02-13 14:04:15.396433004 +0100
+@@ -41,6 +41,7 @@
+
+ BIN_OR_LIB = LIB
+ TARGET_TO_MAKE = libSCclass
++LIBADD = $(SYSLIBS)
+
+ TESTCXXSRC = classtest.cc scextest.cc
+ DISTFILES = $(CXXSRC) $(INC) Makefile LIBS.h $(TESTCXXSRC)
+--- mpqc-2.3.1.orig/src/lib/util/state/Makefile 2005-05-26 08:00:51.000000000 +0200
++++ mpqc-2.3.1/src/lib/util/state/Makefile 2010-02-13 14:22:06.302369965 +0100
+@@ -50,6 +50,7 @@
+
+ BIN_OR_LIB = LIB
+ TARGET_TO_MAKE = libSCstate
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCkeyval.la
+
+ default:: $(DEPENDINCLUDE)
+
+--- mpqc-2.3.1.orig/src/lib/util/group/Makefile 2005-07-30 02:30:18.000000000 +0200
++++ mpqc-2.3.1/src/lib/util/group/Makefile 2010-02-13 14:21:38.582370124 +0100
+@@ -61,6 +61,7 @@
+
+ BIN_OR_LIB = LIB
+ TARGET_TO_MAKE = libSCgroup
++LIBADD = $(SRCDIR)/$(TOPDIR)/lib/libSCkeyval.la
+
+ TESTCXXSRC = pooltest.cc messtest.cc rnglocktest.cc thrtest.cc prttest.cc
+ DISTFILES = $(REQUIREDCXXSRC) $(OPTIONALCXXSRC) $(INC) \
+--- mpqc-2.3.1.orig/src/lib/util/Makefile 2001-08-07 00:29:56.000000000 +0200
++++ mpqc-2.3.1/src/lib/util/Makefile 2010-02-13 14:40:23.611369920 +0100
+@@ -5,7 +5,7 @@
+
+ include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile
+
+-SUBDIRS = options ref container class state misc keyval group render
++SUBDIRS = options keyval ref container class state misc group render
+
+ include $(SRCDIR)/$(TOPDIR)/lib/GlobalSubDirs
+
+--- mpqc-2.3.1.orig/lib/GlobalRules 2010-02-13 19:47:19.019432588 +0100
++++ mpqc-2.3.1/lib/GlobalRules 2010-02-13 19:47:57.760370198 +0100
+@@ -75,7 +75,7 @@
+ $(RANLIB) $@
+
+ $(TOPDIR)/lib/$(TARGET_TO_MAKE).la: $(LIBOBJ)
+- $(LTLINK) $(CXX) -o $@ $^ $(wildcard $(TMPLREPO)/*.o) $(LTLINKLIBOPTS)
++ $(LTLINK) $(CXX) $(LDFLAGS) -o $@ $^ $(wildcard $(TMPLREPO)/*.o) $(LTLINKLIBOPTS) $(LIBADD)
+
+ else
+
+@@ -104,7 +104,7 @@
+ endif
+
+ $(TOPDIR)/lib/$(TARGET_TO_MAKE).la: $(LIBOBJ)
+- $(LTLINK) $(CXX) -o $@ $^ $(LTLINKLIBOPTS)
++ $(LTLINK) $(CXX) $(LDFLAGS) -o $@ $^ $(LTLINKLIBOPTS) $(LIBADD)
+
+ endif
+
+--- mpqc-2.3.1.orig/doc/devsamp/Makefile 2004-04-28 22:45:14.000000000 +0200
++++ mpqc-2.3.1/doc/devsamp/Makefile 2010-02-13 19:58:56.958452043 +0100
+@@ -9,4 +9,4 @@
+ LTLINKBINOPTS := $(shell $(SCCONFIG) --ltlinkbinopts)
+
+ mp2: mp2.o
+- $(LTLINK) $(CXX) $(CXXFLAGS) -o $@ $^ -L$(LIBDIR) -lmpqc $(LIBS) $(LTLINKBINOPTS)
++ $(LTLINK) $(CXX) $(LDFLAGS) $(CXXFLAGS) -o $@ $^ -L$(LIBDIR) -lmpqc $(LIBS) $(LTLINKBINOPTS)
+--- mpqc-2.3.1.orig/src/bin/mpqc/Makefile 2005-07-28 18:57:47.000000000 +0200
++++ mpqc-2.3.1/src/bin/mpqc/Makefile 2010-02-13 19:57:40.484216235 +0100
+@@ -82,7 +82,7 @@
+ $(RANLIB) $@
+
+ $(TOPDIR)/lib/libmpqc.la: $(BINOBJ)
+- $(LTLINK) $(CXX) -o $@ $^ $(LTLINKLIBOPTS)
++ $(LTLINK) $(CXX) $(LDFLAGS) -o $@ $^ $(LTLINKLIBOPTS)
+
+ install_devel:: $(TOPDIR)/lib/libmpqc.$(LIBSUF)
+ $(INSTALL) $(INSTALLDIROPT) $(installroot)$(libdir)
+--- mpqc-2.3.1.orig/src/lib/chemistry/qc/Makefile.orig 2010-06-18 18:09:58.192621760 +0000
++++ mpqc-2.3.1/src/lib/chemistry/qc/Makefile 2010-06-18 18:10:10.350261767 +0000
+@@ -33,7 +33,7 @@
+ include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile
+ include $(TOPDIR)/lib/Makedirlist
+
+-SUBDIRS = basis oint3 intv3 wfn scf dft mbpt
++SUBDIRS = basis oint3 intv3 dft wfn scf mbpt
+ ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_PSI),yes)
+ SUBDIRS := $(SUBDIRS) psi
+ endif
diff --git a/sci-chemistry/mpqc/files/mpqc-2.3.1-blas.patch b/sci-chemistry/mpqc/files/mpqc-2.3.1-blas.patch
new file mode 100644
index 000000000000..b99c82fb71da
--- /dev/null
+++ b/sci-chemistry/mpqc/files/mpqc-2.3.1-blas.patch
@@ -0,0 +1,55 @@
+ configure.in | 36 +++---------------------------------
+ 1 files changed, 3 insertions(+), 33 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index ee82977..caae1f9 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1487,44 +1487,14 @@ AC_LANG_CPLUSPLUS
+ LIBSSAV="$LIBS"
+ LIBS="$LIBSSAV $FLIBS"
+
+-LIBBLAS=""
+-F77_DGEMM=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DAXPY`
+-AC_CHECK_FUNC($F77_DGEMM,HAVE_BLAS=yes,[
+- AC_CHECK_LIB(essl,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lessl"],
+- AC_CHECK_LIB(blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lblas"])
+- )]
+-)
+-if test X$HAVE_BLAS != Xyes; then
+- LIBSSAV2="$LIBS"
+- LIBS="-latlas $LIBS"
+- AC_CHECK_LIB(f77blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lf77blas -latlas"],
+- LIBS="$LIBSSAV2")
+-fi
+-AC_SUBST(HAVE_BLAS)
+-if test X$HAVE_BLAS != Xyes; then
+- echo "WARNING: Could not link to the BLAS library. It can be obtained at"
+- echo "http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs"
+- echo "to specify the name of the library."
+- AC_MSG_ERROR([BLAS is required to complete the build])
+-fi
++PKG_CHECK_MODULES([BLAS], [blas], [LIBBLAS="${BLAS_LIBS}"])
+
+ LIBS="$LIBSSAV $LIBBLAS $FLIBS"
+
+-LIBLAPACK=""
+-F77_DGESVD=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DGESVD`
+-AC_CHECK_FUNC($F77_DGESVD,HAVE_LAPACK=yes,[
+- AC_CHECK_LIB(lapack,$F77_DGESVD,[HAVE_LAPACK=yes;LIBLAPACK="-llapack"]
+- )]
+-)
+-AC_SUBST(HAVE_LAPACK)
+-if test X$HAVE_LAPACK != Xyes; then
+- echo "Could not link to the LAPACK library. It can be obtained at"
+- echo "http://www.netlib.org/lapack. Use --with-libdirs and/or --with-libs"
+- echo "to specify the name of the library."
+- AC_MSG_ERROR([LAPACK is required to complete the build])
+-fi
++PKG_CHECK_MODULES([LAPACK], [lapack], [LIBLAPACK="${LAPACK_LIBS}"])
+
+ FLIBS="$LIBLAPACK $LIBBLAS $FLIBS"
++
+ AC_LANG_RESTORE
+
+ dnl ----------- check for Scalable BLAS library --------------
diff --git a/sci-chemistry/mpqc/files/mpqc-2.3.1-respect-ldflags.patch b/sci-chemistry/mpqc/files/mpqc-2.3.1-respect-ldflags.patch
new file mode 100644
index 000000000000..c38c9579ddde
--- /dev/null
+++ b/sci-chemistry/mpqc/files/mpqc-2.3.1-respect-ldflags.patch
@@ -0,0 +1,25 @@
+--- mpqc-2.3.1.orig/configure.in 2006-03-22 19:04:54.000000000 +0100
++++ mpqc-2.3.1/configure.in 2010-02-13 17:46:19.545557872 +0100
+@@ -10,6 +10,8 @@
+ AC_CONFIG_HEADER(src/lib/scconfig.h)
+ AC_CONFIG_AUX_DIR(bin)
+
++m4_include([lib/autoconf/cca.m4])
++m4_include([lib/autoconf/acinclude.m4])
+ AC_CANONICAL_SYSTEM
+
+ AC_DEFINE_UNQUOTED(HOST_ARCH, "$host")
+@@ -473,12 +473,10 @@
+ echo Using FORTRAN runtime libraries: $withval
+ )
+
+-LDFLAGS=
+-LIBDIRS=
+ AC_ARG_WITH(libdirs,
+ [ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
+ LIBDIRS=$withval
+-LDFLAGS=$withval
++LDFLAGS="$LDFLAGS $withval"
+ echo Using extra library directories: $withval
+ )
+
diff --git a/sci-chemistry/mpqc/files/mpqc-2.3.1-test-failure-hack.patch b/sci-chemistry/mpqc/files/mpqc-2.3.1-test-failure-hack.patch
new file mode 100644
index 000000000000..91fcc30d0d90
--- /dev/null
+++ b/sci-chemistry/mpqc/files/mpqc-2.3.1-test-failure-hack.patch
@@ -0,0 +1,11 @@
+--- mpqc-2.3.1.orig/src/bin/mpqc/validate/Makefile 2006-03-22 19:03:51.000000000 +0100
++++ mpqc-2.3.1/src/bin/mpqc/validate/Makefile 2010-02-13 20:26:12.496370219 +0100
+@@ -52,7 +52,7 @@
+ # Also need to see if --mpqc was specified. If not, then add
+ # --mpqc ../../mpqc.
+ ifeq ($(filter --mpqc%, $(ALL_MPQCRUN_ARGS)),)
+-ALL_MPQCRUN_ARGS:=--mpqc ../../mpqc $(ALL_MPQCRUN_ARGS)
++ALL_MPQCRUN_ARGS:=--mpqc "LD_LIBRARY_PATH=\"../../../../../lib/.libs/\" ../../mpqc" $(ALL_MPQCRUN_ARGS)
+ endif
+
+ ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_MBPTR12),yes)
diff --git a/sci-chemistry/mpqc/metadata.xml b/sci-chemistry/mpqc/metadata.xml
new file mode 100644
index 000000000000..6526df6225a9
--- /dev/null
+++ b/sci-chemistry/mpqc/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">mpqc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/mpqc/mpqc-2.3.1-r1.ebuild b/sci-chemistry/mpqc/mpqc-2.3.1-r1.ebuild
new file mode 100644
index 000000000000..3eb6e335be7f
--- /dev/null
+++ b/sci-chemistry/mpqc/mpqc-2.3.1-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="The Massively Parallel Quantum Chemistry Program"
+HOMEPAGE="http://www.mpqc.org/"
+SRC_URI="mirror://sourceforge/mpqc/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE="doc threads tk"
+
+RDEPEND="
+ virtual/blas
+ virtual/lapack
+ tk? ( dev-lang/tk )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ sys-devel/flex
+ sys-apps/sed
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # do not install tkmolrender if not requested
+ if ! use tk; then
+ sed \
+ -e "s:.*/bin/molrender/tkmolrender.*::" \
+ -e "s:.*\$(INSTALLBINOPT) tkmolrender.*::" \
+ -e "s:/bin/rm -f tkmolrender::" \
+ -i "./src/bin/molrender/Makefile" \
+ || die "failed to disable tkmolrender"
+ fi
+}
+
+src_compile() {
+ # Only shared will work on ppc64 - bug #62124
+ # But we always want shared libraries
+ econf \
+ $(use_enable threads) \
+ --enable-shared \
+ ${myconf}
+
+ sed \
+ -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \
+ -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \
+ -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \
+ lib/LocalMakefile
+ emake || die "emake failed"
+}
+
+src_test() {
+ cd "${S}"/src/bin/mpqc/validate
+
+ # we'll only run the small test set, since the
+ # medium and large ones take >10h and >24h on my
+ # 1.8Ghz P4M
+ emake -j1 check0 || die "failed in test routines"
+}
+
+src_install() {
+ emake -j1 installroot="${D}" install install_devel install_inc \
+ || die "install failed"
+
+ dodoc CHANGES CITATION README || die "failed to install docs"
+
+ # make extended docs
+ if use doc; then
+ cd "${S}"/doc
+ emake -j1 all || die "failed to generate documentation"
+ doman man/man1/* man/man3/* || \
+ die "failed to install man pages"
+ dohtml -r html/
+ fi
+}
+
+pkg_postinst() {
+ echo
+ einfo "MPQC can be picky with regard to compilation flags."
+ einfo "If during mpqc runs you have trouble converging or "
+ einfo "experience oscillations during SCF interations, "
+ einfo "consider recompiling with less aggressive CFLAGS/CXXFLAGS."
+ einfo "Particularly, replacing -march=pentium4 by -march=pentium3"
+ einfo "might help if you encounter problems with correlation "
+ einfo "consistent basis sets."
+ echo
+}
diff --git a/sci-chemistry/mpqc/mpqc-2.3.1-r2.ebuild b/sci-chemistry/mpqc/mpqc-2.3.1-r2.ebuild
new file mode 100644
index 000000000000..0ce954f73374
--- /dev/null
+++ b/sci-chemistry/mpqc/mpqc-2.3.1-r2.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="The Massively Parallel Quantum Chemistry Program"
+HOMEPAGE="http://www.mpqc.org/"
+SRC_URI="mirror://sourceforge/mpqc/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 x86"
+IUSE="doc mpi threads tk"
+
+RDEPEND="
+ virtual/blas
+ virtual/lapack
+ mpi? ( virtual/mpi[cxx] )
+ tk? ( dev-lang/tk )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ sys-devel/flex
+ sys-apps/sed
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-as-needed.patch \
+ "${FILESDIR}"/${P}-respect-ldflags.patch \
+ "${FILESDIR}"/${P}-test-failure-hack.patch
+ # do not install tkmolrender if not requested
+ if ! use tk; then
+ sed \
+ -e "s:.*/bin/molrender/tkmolrender.*::" \
+ -e "s:.*\$(INSTALLBINOPT) tkmolrender.*::" \
+ -e "s:/bin/rm -f tkmolrender::" \
+ -i "./src/bin/molrender/Makefile" \
+ || die "failed to disable tkmolrender"
+ fi
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC CXX
+ if use mpi; then
+ export CC=mpicc
+ export CXX=mpicxx
+ fi
+ econf \
+ $(use_enable threads) \
+ $(use_enable mpi parallel) \
+ --enable-shared \
+ ${myconf}
+
+ sed \
+ -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \
+ -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \
+ -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \
+ lib/LocalMakefile
+}
+
+src_test() {
+ cd "${S}"/src/bin/mpqc/validate
+
+ # we'll only run the small test set, since the
+ # medium and large ones take >10h and >24h on my
+ # 1.8Ghz P4M
+ emake -j1 check0 || die "failed in test routines"
+}
+
+src_install() {
+ emake installroot="${D}" install install_devel install_inc \
+ || die "install failed"
+
+ dodoc CHANGES CITATION README || die "failed to install docs"
+
+ # make extended docs
+ if use doc; then
+ cd "${S}"/doc
+ emake -j1 all || die "failed to generate documentation"
+ doman man/man1/* man/man3/* || \
+ die "failed to install man pages"
+ dohtml -r html/
+ fi
+}
+
+pkg_postinst() {
+ echo
+ einfo "MPQC can be picky with regard to compilation flags."
+ einfo "If during mpqc runs you have trouble converging or "
+ einfo "experience oscillations during SCF interations, "
+ einfo "consider recompiling with less aggressive CFLAGS/CXXFLAGS."
+ einfo "Particularly, replacing -march=pentium4 by -march=pentium3"
+ einfo "might help if you encounter problems with correlation "
+ einfo "consistent basis sets."
+ echo
+}
diff --git a/sci-chemistry/mpqc/mpqc-2.3.1-r3.ebuild b/sci-chemistry/mpqc/mpqc-2.3.1-r3.ebuild
new file mode 100644
index 000000000000..d457ffebfc72
--- /dev/null
+++ b/sci-chemistry/mpqc/mpqc-2.3.1-r3.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+AUTOTOOLS_AUTORECONF=yes
+
+inherit autotools-utils toolchain-funcs
+
+DESCRIPTION="The Massively Parallel Quantum Chemistry Program"
+HOMEPAGE="http://www.mpqc.org/"
+SRC_URI="mirror://sourceforge/mpqc/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE="doc mpi threads static-libs tk"
+
+RDEPEND="
+ virtual/blas
+ virtual/lapack
+ mpi? ( virtual/mpi[cxx] )
+ tk? ( dev-lang/tk )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ sys-devel/flex
+ sys-apps/sed
+ virtual/pkgconfig
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-as-needed.patch
+ "${FILESDIR}"/${P}-respect-ldflags.patch
+ "${FILESDIR}"/${P}-test-failure-hack.patch
+ "${FILESDIR}"/${P}-blas.patch
+ )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+DOCS=(CHANGES CITATION README)
+
+src_prepare() {
+ # do not install tkmolrender if not requested
+ if ! use tk; then
+ sed \
+ -e "s:.*/bin/molrender/tkmolrender.*::" \
+ -e "s:.*\$(INSTALLBINOPT) tkmolrender.*::" \
+ -e "s:/bin/rm -f tkmolrender::" \
+ -i "./src/bin/molrender/Makefile" \
+ || die "failed to disable tkmolrender"
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ tc-export CC CXX
+ if use mpi; then
+ export CC=mpicc
+ export CXX=mpicxx
+ fi
+ local myeconfargs=(
+ $(use_enable threads)
+ $(use_enable mpi parallel) )
+
+ autotools-utils_src_configure
+ sed \
+ -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \
+ -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \
+ -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \
+ -i lib/LocalMakefile || die
+}
+
+src_test() {
+ cd "${AUTOTOOLS_BUILD_DIR}"/src/bin/mpqc/validate
+
+ # we'll only run the small test set, since the
+ # medium and large ones take >10h and >24h on my
+ # 1.8Ghz P4M
+ emake -j1 check1
+}
+
+src_install() {
+ autotools-utils_src_install installroot="${D}" install install_devel install_inc
+
+ # make extended docs
+ if use doc; then
+ cd "${AUTOTOOLS_BUILD_DIR}"/doc
+ emake -j1 all
+ doman man/man1/* man/man3/*
+ dohtml -r html
+ fi
+}
+
+pkg_postinst() {
+ echo
+ einfo "MPQC can be picky with regard to compilation flags."
+ einfo "If during mpqc runs you have trouble converging or "
+ einfo "experience oscillations during SCF interations, "
+ einfo "consider recompiling with less aggressive CFLAGS/CXXFLAGS."
+ einfo "Particularly, replacing -march=pentium4 by -march=pentium3"
+ einfo "might help if you encounter problems with correlation "
+ einfo "consistent basis sets."
+ echo
+}
diff --git a/sci-chemistry/mrbump/Manifest b/sci-chemistry/mrbump/Manifest
new file mode 100644
index 000000000000..db81a16d3eba
--- /dev/null
+++ b/sci-chemistry/mrbump/Manifest
@@ -0,0 +1 @@
+DIST mrbump-0.4.4.tar.gz 9220116 RMD160 2b81e1aee9d2cf697c14712a7a7afe3f06c67a68 SHA1 eb474602bbfc3ec8e3d1282b2c6b3000c7194558 SHA256 499634815cf316ca273900252dab16b91f6421b0f85a548108258f9934dccd6a
diff --git a/sci-chemistry/mrbump/files/0.4.4-superpose.patch b/sci-chemistry/mrbump/files/0.4.4-superpose.patch
new file mode 100644
index 000000000000..c9941e9ece2a
--- /dev/null
+++ b/sci-chemistry/mrbump/files/0.4.4-superpose.patch
@@ -0,0 +1,11 @@
+--- share/mrbump/include/mr/Ensemble.py 2008-07-28 16:40:47.000000000 +0200
++++ share/mrbump/include/mr/Ensemble.py.new 2009-08-26 22:26:44.000000000 +0200
+@@ -29,7 +29,7 @@
+ self.superposeEXE=os.path.join(os.environ['CBIN'], 'superpose.exe')
+ self.pdbsetEXE=os.path.join(os.environ['CBIN'], 'pdbset.exe')
+ else:
+- self.superposeEXE=os.path.join(os.environ['CBIN'], 'superpose')
++ self.superposeEXE=os.path.join(os.environ['CBIN'], 'superpose-ccp4')
+ self.pdbsetEXE=os.path.join(os.environ['CBIN'], 'pdbset')
+
+ self.SPxyz_template=''
diff --git a/sci-chemistry/mrbump/metadata.xml b/sci-chemistry/mrbump/metadata.xml
new file mode 100644
index 000000000000..4aaae064be71
--- /dev/null
+++ b/sci-chemistry/mrbump/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher (jlec)</name>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/sci-chemistry/mrbump/mrbump-0.4.4.ebuild b/sci-chemistry/mrbump/mrbump-0.4.4.ebuild
new file mode 100644
index 000000000000..66ec9309e1cd
--- /dev/null
+++ b/sci-chemistry/mrbump/mrbump-0.4.4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit eutils multilib python
+
+DESCRIPTION="An automated scheme for Molecular Replacement"
+HOMEPAGE="http://www.ccp4.ac.uk/MrBUMP"
+SRC_URI="${HOMEPAGE}/release/${P}.tar.gz"
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="X perl"
+
+RDEPEND=">=sci-chemistry/ccp4-apps-6.1.3[X?]
+ || ( sci-biology/mafft
+ sci-biology/clustalw:2
+ sci-biology/probcons
+ sci-biology/t-coffee )
+ sci-biology/fasta
+ X? ( media-gfx/graphviz )
+ perl? ( dev-perl/SOAP-Lite )"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_unpack(){
+ unpack ${A}
+ cd "${S}"
+ unpack ./"${PN}".tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-superpose.patch
+ python_convert_shebangs 2 setup_lib/*
+}
+
+src_install(){
+ insinto /usr/$(get_libdir)/ccp4/ccp4i
+ doins -r ccp4i/{MrBUMP-ccp4i.tar.gz,MrBUMP/{help,scripts,tasks,templates}} || \
+ die "failed to install interface"
+
+ insinto /usr/share/${PN}
+ doins -r share/${PN}/{data,include} || die "failed to install mrbump data"
+
+ dobin share/${PN}/bin/* || die "failed to install binaries"
+
+ dodoc README.txt || die
+ dohtml html/mrbump_doc.html || die
+}
diff --git a/sci-chemistry/msms-bin/Manifest b/sci-chemistry/msms-bin/Manifest
new file mode 100644
index 000000000000..7cffef46c709
--- /dev/null
+++ b/sci-chemistry/msms-bin/Manifest
@@ -0,0 +1,2 @@
+DIST msms_i86Linux2_2.6.1.tar.gz 112762 RMD160 5bbf6102471026112e4f688f56f0a6b8730124c9 SHA1 6ee76d87f3ac3ae543a15d2ea9f86bf3f67d5d4c SHA256 ab4f9e60df6fe18a5ac05550bf074b287792638a818a047697ead049d8737caf
+DIST msms_i86_64Linux2_2.6.1.tar.gz 593147 RMD160 a239db5e85afc445c32a165f4086d186010ab123 SHA1 39f9aa955016927138c4014ec0bb40c6a8df18a2 SHA256 5f0ca50360b5938e74c538e0399d582abc4a40ef4cf410e66f31a1f91e6e3e1f
diff --git a/sci-chemistry/msms-bin/metadata.xml b/sci-chemistry/msms-bin/metadata.xml
new file mode 100644
index 000000000000..51426ab8d003
--- /dev/null
+++ b/sci-chemistry/msms-bin/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-chemistry</herd>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/msms-bin/msms-bin-2.6.1-r1.ebuild b/sci-chemistry/msms-bin/msms-bin-2.6.1-r1.ebuild
new file mode 100644
index 000000000000..8b4267088281
--- /dev/null
+++ b/sci-chemistry/msms-bin/msms-bin-2.6.1-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="MSMS allows to compute very efficiently triangulations of Solvent Excluded Surfaces"
+HOMEPAGE="http://mgl.scripps.edu/people/sanner/html/msms_home.html"
+SRC_URI="
+ amd64? ( msms_i86_64Linux2_2.6.1.tar.gz )
+ x86? ( msms_i86Linux2_2.6.1.tar.gz )
+"
+
+LICENSE="MSMS"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RESTRICT="fetch"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="${EROOT#/}opt/bin/.*"
+
+pkg_nofetch() {
+ einfo "Please download ${A} from http://mgltools.scripps.edu/downloads#msms and place it to ${DISTDIR}"
+}
+
+src_install() {
+ doman msms.1
+ dodoc README msms.html ReleaseNotes
+ exeinto /opt/bin
+ if use amd64; then
+ newexe ${PN%-bin}.x86_64Linux2.${PV} msms
+ elif use x86; then
+ newexe ${PN%-bin}.i86Linux2.${PV} msms
+ fi
+ insinto /usr/share/${PN}/
+ doins atmtypenumbers
+ sed \
+ -e 's:nawk:awk:g' \
+ -e "s:./atmtypenumbers:${EPREFIX}/usr/share/${PN}/atmtypenumbers:g" \
+ -i pdb_to_xyz* || die
+ dobin pdb_to_xyz*
+}
diff --git a/sci-chemistry/mustang/Manifest b/sci-chemistry/mustang/Manifest
new file mode 100644
index 000000000000..46a7a80261ed
--- /dev/null
+++ b/sci-chemistry/mustang/Manifest
@@ -0,0 +1 @@
+DIST mustang_v3.2.1.tgz 161216 RMD160 980dd41e24a65f02e77a4b0d60364bbb8423f0d0 SHA1 0a9b55633bfa836d9851be115e2815f8d17839ca SHA256 38f8ec10f15466a42ade770eb6c3ed0ed2449bb070a53b5e8d3125f2596b1556
diff --git a/sci-chemistry/mustang/files/mustang-3-gcc43.patch b/sci-chemistry/mustang/files/mustang-3-gcc43.patch
new file mode 100644
index 000000000000..ef2818b92ed8
--- /dev/null
+++ b/sci-chemistry/mustang/files/mustang-3-gcc43.patch
@@ -0,0 +1,55 @@
+diff -u MUSTANG_v.3.orig/src/ew_2.cpp MUSTANG_v.3/src/ew_2.cpp
+--- MUSTANG_v.3.orig/src/ew_2.cpp 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/ew_2.cpp 2008-12-09 10:47:22.000000000 -0700
+@@ -36,6 +36,7 @@
+ using std::ifstream;
+
+ #include<math.h>
++#include <cstdlib>
+ #include "macros.h"
+ #include "globals.h"
+ #include "ew.h"
+diff -u MUSTANG_v.3.orig/src/multiple_superposition.cpp MUSTANG_v.3/src/multiple_superposition.cpp
+--- MUSTANG_v.3.orig/src/multiple_superposition.cpp 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/multiple_superposition.cpp 2008-12-09 10:49:00.000000000 -0700
+@@ -51,6 +51,7 @@
+ #include "alloc_routines.h"
+ #include "de_alloc_routines.h"
+ #include <cmath>
++#include <cstdlib>
+ #define THRESH 0.0001
+
+ void MOVE_TO_CENTER_OF_GRAVITY( int NSTRUC , int NRES , float ***R , float **CMs )
+diff -u MUSTANG_v.3.orig/src/multiple_superposition.h MUSTANG_v.3/src/multiple_superposition.h
+--- MUSTANG_v.3.orig/src/multiple_superposition.h 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/multiple_superposition.h 2008-12-09 10:48:11.000000000 -0700
+@@ -25,3 +25,4 @@
+ #define MULT_SUPERPOSE
+ void M_SUPERPOSE( int , int , float***, float** , float*** ) ;
+ #endif
++#include <cstdlib>
+diff -u MUSTANG_v.3.orig/src/pdb_ripper.h MUSTANG_v.3/src/pdb_ripper.h
+--- MUSTANG_v.3.orig/src/pdb_ripper.h 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/pdb_ripper.h 2008-12-09 10:46:47.000000000 -0700
+@@ -29,4 +29,5 @@
+ void PARSE_ENTIRE_PDB_STRUCTURE( char * , int ) ;
+
+ #endif
++#include <cstdlib>
+
+diff -u MUSTANG_v.3.orig/src/progress_align.h MUSTANG_v.3/src/progress_align.h
+--- MUSTANG_v.3.orig/src/progress_align.h 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/progress_align.h 2008-12-09 10:47:50.000000000 -0700
+@@ -25,3 +25,4 @@
+ #define PROG_ALGN_H
+ void PROGRESSIVE_ALIGNMENT_USING_EXTENDED_EDGE_WEIGHTS() ;
+ #endif
++#include <cstdlib>
+diff -u MUSTANG_v.3.orig/src/read_structures.h MUSTANG_v.3/src/read_structures.h
+--- MUSTANG_v.3.orig/src/read_structures.h 2008-01-15 11:18:34.000000000 -0700
++++ MUSTANG_v.3/src/read_structures.h 2008-12-09 10:46:22.000000000 -0700
+@@ -26,3 +26,4 @@
+ void READ_STRUCTURES( char **paths );
+ void READ_ENTIRE_PDBS( char **paths) ;
+ #endif
++#include <cstdlib>
diff --git a/sci-chemistry/mustang/files/mustang-3.2.1-gcc-4.7.patch b/sci-chemistry/mustang/files/mustang-3.2.1-gcc-4.7.patch
new file mode 100644
index 000000000000..9e5dea85afeb
--- /dev/null
+++ b/sci-chemistry/mustang/files/mustang-3.2.1-gcc-4.7.patch
@@ -0,0 +1,16 @@
+ src/superpose_on_core_2.cpp | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/src/superpose_on_core_2.cpp b/src/superpose_on_core_2.cpp
+index ae137de..059dfe3 100644
+--- a/src/superpose_on_core_2.cpp
++++ b/src/superpose_on_core_2.cpp
+@@ -55,6 +55,8 @@ using std::ofstream ;
+ #include "multiple_superposition.h"
+ #include "3D_manip_functions.h"
+
++#include <unistd.h>
++
+ int **core_columns ;
+ int *core_columns_2 , NCORE = 0 ;
+ int **algn_to_seq_hash ;
diff --git a/sci-chemistry/mustang/metadata.xml b/sci-chemistry/mustang/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/mustang/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/mustang/mustang-3.2.1.ebuild b/sci-chemistry/mustang/mustang-3.2.1.ebuild
new file mode 100644
index 000000000000..4486569db228
--- /dev/null
+++ b/sci-chemistry/mustang/mustang-3.2.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_PN="MUSTANG"
+SRC_P="${PN}_v${PV}"
+MY_P="${MY_PN}_v${PV}"
+
+DESCRIPTION="MUltiple STructural AligNment AlGorithm"
+HOMEPAGE="http://www.csse.monash.edu.au/~karun/Site/mustang.html"
+SRC_URI="http://www.csse.unimelb.edu.au/~arun/${PN}/${SRC_P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc-4.7.patch
+}
+
+src_compile() {
+ emake \
+ CPP=$(tc-getCXX) \
+ CPPFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+ ./bin/${P} -f ./data/test/test_zf-CCHH || die
+}
+
+src_install() {
+ newbin bin/${P} mustang
+ doman man/${PN}.1
+ dodoc README
+}
+
+pkg_postinst() {
+ elog "If you use this program for an academic paper, please cite:"
+ elog "Arun S. Konagurthu, James C. Whisstock, Peter J. Stuckey, and Arthur M. Lesk"
+ elog "Proteins: Structure, Function, and Bioinformatics. 64(3):559-574, Aug. 2006"
+}
diff --git a/sci-chemistry/namd/Manifest b/sci-chemistry/namd/Manifest
new file mode 100644
index 000000000000..80b19cddaea7
--- /dev/null
+++ b/sci-chemistry/namd/Manifest
@@ -0,0 +1,2 @@
+DIST NAMD_2.10_Source.tar.gz 9200234 SHA256 a5282c172524c2fbe6b9ba56f2de8c84f1093405c914ffbc70442dd0dd4e4289 SHA512 3712a03841fad76c502ac4e41469162ff78e6152560d0f6855d61d2b5583241a661e2a3e7446029b56a6f6f1100f25cb51b2c3df6571542397961d3bb625bc92 WHIRLPOOL b97e47c1d73d505620c26a2eca2e2e91807ebeff19e8820d9be7ea6ddd84c59cd5839846a18a2615ae993a1a6fc22b90e5080cf9d8a72aa412f6b81354e0f284
+DIST NAMD_2.9_Source.tar.gz 8814042 SHA256 9ba6a1f87d4600a62847728d7c223295be214f9a72b5bb62552f74d644108424 SHA512 0644814a2799b560d9dcf807ba0047325bc9f0a26e3831b0465d95180784f038d69595e036daac85d59cd919c92d11a0343031975d99deb1fa3052c8a649bdd6 WHIRLPOOL 5494ccb2ee2f2792fe52ad7dcfe6da9d11453f0a9b0859d30698dea56b00d92fae73465967f82bd708abee5cd4ff50b0a6ffde86451e859e2f515af203e09286
diff --git a/sci-chemistry/namd/files/namd-2.10-gentoo.patch b/sci-chemistry/namd/files/namd-2.10-gentoo.patch
new file mode 100644
index 000000000000..e578c131c36d
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.10-gentoo.patch
@@ -0,0 +1,124 @@
+diff -Naur NAMD_2.10_Source.orig/arch/Linux-x86_64.fftw NAMD_2.10_Source/arch/Linux-x86_64.fftw
+--- NAMD_2.10_Source.orig/arch/Linux-x86_64.fftw 2015-03-06 17:53:44.170416075 -0700
++++ NAMD_2.10_Source/arch/Linux-x86_64.fftw 2015-03-06 17:54:46.641162629 -0700
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux-x86_64
++FFTDIR=/usr
+ FFTINCL=-I$(FFTDIR)/include
+-FFTLIB=-L$(FFTDIR)/lib -lsrfftw -lsfftw
++FFTLIB=-L$(FFTDIR)/gentoo-libdir -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
+diff -Naur NAMD_2.10_Source.orig/arch/Linux-x86_64.tcl NAMD_2.10_Source/arch/Linux-x86_64.tcl
+--- NAMD_2.10_Source.orig/arch/Linux-x86_64.tcl 2015-03-06 17:53:44.170416075 -0700
++++ NAMD_2.10_Source/arch/Linux-x86_64.tcl 2015-03-06 17:54:46.641162629 -0700
+@@ -1,9 +1,9 @@
+
+ #TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64
+-TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64-threaded
++TCLDIR=/usr
+ TCLINCL=-I$(TCLDIR)/include
+ #TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl
+-TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl -lpthread
++TCLLIB=-L$(TCLDIR)/gentoo-libdir -ltcl8.5 -ldl -lpthread
+ TCLFLAGS=-DNAMD_TCL
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
+diff -Naur NAMD_2.10_Source.orig/Makefile NAMD_2.10_Source/Makefile
+--- NAMD_2.10_Source.orig/Makefile 2015-03-06 17:53:44.170416075 -0700
++++ NAMD_2.10_Source/Makefile 2015-03-06 18:01:32.645966590 -0700
+@@ -389,10 +389,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/gentoo-charm $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/gentoo-libdir
+ CHARM_MODULES = -module NeighborLB -module HybridLB -module RefineLB -module GreedyLB -module CkMulticast
+ #CHARM_MODULES = -module NeighborLB -module HybridLB -module RefineLB -module GreedyLB
+ #CHARM_MODULES = -module msa -module NeighborLB -module HybridLB -module RefineLB -module GreedyLB
+@@ -418,7 +418,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen sortreplicas flipdcd flipbinpdb charmrun
++BINARIES = namd2 psfgen sortreplicas flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -434,7 +434,7 @@
+
+ namd2: $(MKINCDIR) $(MKDSTDIR) $(OBJS) $(LIBS)
+ $(MAKEBUILDINFO)
+- $(CHARMC) -verbose -ld++-option \
++ $(CHARMC) $(LDFLAGS) -verbose -ld++-option \
+ '$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS) $(CXXMICOPTS)' \
+ "$(CHARM_MODULES)" -language charm++ \
+ $(BUILDINFO).o \
+@@ -484,11 +484,8 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(MKDSTDIR) $(SBOBJS) $(PLUGINOBJS)
+- $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
++ $(CC) $(SBCFLAGS) $(LDFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+ psfgen.exe: $(MKDSTDIR) $(SBOBJS) $(PLUGINOBJS) $(TCLDLL)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+@@ -506,7 +503,7 @@
+ $(CC) $(CFLAGS) -o diffbinpdb $(SRCDIR)/diffbinpdb.c -lm
+
+ flipdcd: $(SRCDIR)/flipdcd.c
+- $(CC) $(CFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
+ echo "#!/bin/sh\necho unavailable on this platform" > $@; \
+ chmod +x $@
+
+@@ -516,7 +513,7 @@
+ chmod +x $@
+
+ fixdcd: $(SRCDIR)/fixdcd.c
+- $(CC) $(CFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
+
+ dumpdcd: $(SRCDIR)/dumpdcd.c
+ $(CC) $(CFLAGS) -o dumpdcd $(SRCDIR)/dumpdcd.c
+@@ -711,9 +708,7 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb sortreplicas psfgen charmrun namd2
+-
+-WINDOWS_RELEASE_FILES = $(LIBCUDARTSO) $(WINDOWSBINARIES) $(TCLDLL)
++RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb sortreplicas psfgen namd2
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -724,17 +719,9 @@
+ for f in `find $(RELEASE_DIR_NAME)/lib -name CVS`; do \
+ /bin/rm -rf $$f; \
+ done
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
+- fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+- fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+ -for f in $(RELEASE_FILES); do echo $$f; $(LDD) $(RELEASE_DIR_NAME)/$$f; done
+
+ winrelease: winall
diff --git a/sci-chemistry/namd/files/namd-2.6-gentoo.patch b/sci-chemistry/namd/files/namd-2.6-gentoo.patch
new file mode 100644
index 000000000000..9a71de8d3bd7
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.6-gentoo.patch
@@ -0,0 +1,107 @@
+diff -Naur NAMD_2.6_Source/Makefile NAMD_2.6_Source.new/Makefile
+--- NAMD_2.6_Source/Makefile 2006-08-30 00:19:25.000000000 -0400
++++ NAMD_2.6_Source.new/Makefile 2006-09-19 15:56:17.000000000 -0400
+@@ -232,10 +232,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/charm-5.9 $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/lib
+
+ # Libraries we may have changed
+ LIBS = $(PLUGINLIB) $(DPMTALIBS) $(DPMELIBS) $(TCLDLL)
+@@ -255,7 +255,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen charmrun flipdcd flipbinpdb
++BINARIES = namd2 psfgen flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -284,11 +284,6 @@
+ $(CHARMOPTS) \
+ -lm -o namd2
+
+-charmrun: $(CHARM)/bin/charmrun # XXX
+- $(COPY) $(CHARM)/bin/charmrun $@
+-
+-windowsbinaries: namd2.exe psfgen.exe charmd.exe charmd_faceless.exe charmrun.exe
+-
+ namd2.exe: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
+ $(MAKEBUILDINFO)
+ $(CHARMC) -verbose \
+@@ -309,9 +304,6 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(DSTDIR) $(SBOBJS)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+@@ -571,9 +563,7 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = flipdcd flipbinpdb psfgen charmrun namd2
+-
+-WIN32_RELEASE_FILES = namd2.exe psfgen.exe charmrun.exe charmd.exe charmd_faceless.exe $(TCLDLL)
++RELEASE_FILES = flipdcd flipbinpdb psfgen namd2
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -582,17 +572,9 @@
+ for f in $(DOC_FILES); do cp .rootdir/$$f $(RELEASE_DIR_NAME); done
+ cp -r .rootdir/lib $(RELEASE_DIR_NAME)
+ /bin/rm -rf $(RELEASE_DIR_NAME)/lib/CVS $(RELEASE_DIR_NAME)/lib/*/CVS
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
+- fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+- fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+ -for f in $(RELEASE_FILES); do echo $$f; $(LDD) $$f; done
+
+ winrelease: winall
+diff -Naur NAMD_2.6_Source/arch/Linux-i686.fftw NAMD_2.6_Source.new/arch/Linux-i686.fftw
+--- NAMD_2.6_Source/arch/Linux-i686.fftw 2004-02-20 17:38:36.000000000 -0500
++++ NAMD_2.6_Source.new/arch/Linux-i686.fftw 2006-09-19 15:52:32.000000000 -0400
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux
+-FFTINCL=-I$(FFTDIR)/include -I$(HOME)/fftw/include
+-FFTLIB=-L$(FFTDIR)/lib -L$(HOME)/fftw/lib -lsrfftw -lsfftw
++#FFTDIR=/Projects/namd2/fftw/linux
++FFTINCL=-I/usr/include
++FFTLIB=-L/usr/lib -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
+diff -Naur NAMD_2.6_Source/arch/Linux-i686.tcl NAMD_2.6_Source.new/arch/Linux-i686.tcl
+--- NAMD_2.6_Source/arch/Linux-i686.tcl 2004-10-27 17:40:55.000000000 -0400
++++ NAMD_2.6_Source.new/arch/Linux-i686.tcl 2006-09-19 15:56:45.000000000 -0400
+@@ -1,8 +1,8 @@
+
+-TCLDIR=/Projects/namd2/tcl/linux
++#TCLDIR=/Projects/namd2/tcl/linux
+ #TCLDIR=$(HOME)/tcl/cray-xt3
+-TCLINCL=-I$(TCLDIR)/include -I$(HOME)/tcl/include
+-TCLLIB=-L$(TCLDIR)/lib -L$(HOME)/tcl/lib -ltcl8.3 -ldl
++TCLINCL=-I/usr/include
++TCLLIB=-L/usr/lib -L$(HOME)/tcl/lib -ltcl -ldl
+ TCLFLAGS=-DNAMD_TCL -DUSE_NON_CONST
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
diff --git a/sci-chemistry/namd/files/namd-2.7-gentoo.patch b/sci-chemistry/namd/files/namd-2.7-gentoo.patch
new file mode 100644
index 000000000000..28a580e3113c
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.7-gentoo.patch
@@ -0,0 +1,117 @@
+diff -aurN NAMD_2.7b1_Source.orig/Make.charm NAMD_2.7b1_Source/Make.charm
+--- NAMD_2.7b1_Source.orig/Make.charm 2009-06-07 15:15:11.000000000 -0500
++++ NAMD_2.7b1_Source/Make.charm 2009-06-07 15:15:11.000000000 -0500
+@@ -2,5 +2,5 @@
+ # The config script will override this setting if there is a directory
+ # called charm-6.1 or charm in the NAMD base directory.
+
+-CHARMBASE = /Projects/namd2/charm-6.1
++CHARMBASE = /usr/include/charm-6.1.2
+
+diff -aurN NAMD_2.7b1_Source.orig/Makefile NAMD_2.7b1_Source/Makefile
+--- NAMD_2.7b1_Source.orig/Makefile 2009-06-07 15:15:11.000000000 -0500
++++ NAMD_2.7b1_Source/Makefile 2009-06-07 15:15:11.000000000 -0500
+@@ -297,10 +297,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/gentoo-charm $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/gentoo-libdir
+
+ # Libraries we may have changed
+ LIBS = $(CUDAOBJS) $(PLUGINLIB) $(DPMTALIBS) $(DPMELIBS) $(TCLDLL)
+@@ -320,7 +320,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen charmrun flipdcd flipbinpdb
++BINARIES = namd2 psfgen flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -351,14 +351,6 @@
+ $(CHARMOPTS) \
+ -lm -o namd2
+
+-charmrun: $(CHARM)/bin/charmrun # XXX
+- $(COPY) $(CHARM)/bin/charmrun $@
+-
+-WINDOWSBINARIES = namd2.exe psfgen.exe
+-# WINDOWSBINARIES = namd2.exe psfgen.exe charmd.exe charmd_faceless.exe charmrun.exe
+-
+-windowsbinaries: $(WINDOWSBINARIES)
+-
+ namd2.exe: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS) $(TCLDLL)
+ $(MAKEBUILDINFO)
+ $(CHARMC) -verbose \
+@@ -381,9 +373,6 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(DSTDIR) $(SBOBJS) $(PLUGINOBJS)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+@@ -700,9 +689,7 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = flipdcd flipbinpdb psfgen charmrun namd2
+-
+-WINDOWS_RELEASE_FILES = $(WINDOWSBINARIES) $(TCLDLL)
++RELEASE_FILES = flipdcd flipbinpdb psfgen namd2
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -711,17 +698,9 @@
+ for f in $(DOC_FILES); do cp .rootdir/$$f $(RELEASE_DIR_NAME); done
+ cp -r .rootdir/lib $(RELEASE_DIR_NAME)
+ /bin/rm -rf $(RELEASE_DIR_NAME)/lib/CVS $(RELEASE_DIR_NAME)/lib/*/CVS
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
+- fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+- fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+ -for f in $(RELEASE_FILES); do echo $$f; $(LDD) $$f; done
+
+ winrelease: winall
+diff -aurN NAMD_2.7b1_Source.orig/arch/Linux-x86_64.fftw NAMD_2.7b1_Source/arch/Linux-x86_64.fftw
+--- NAMD_2.7b1_Source.orig/arch/Linux-x86_64.fftw 2009-06-07 15:15:11.000000000 -0500
++++ NAMD_2.7b1_Source/arch/Linux-x86_64.fftw 2009-06-07 15:15:11.000000000 -0500
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux-x86_64
++FFTDIR=/usr
+ FFTINCL=-I$(FFTDIR)/include
+-FFTLIB=-L$(FFTDIR)/lib -lsrfftw -lsfftw
++FFTLIB=-L$(FFTDIR)/gentoo-libdir -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
+diff -aurN NAMD_2.7b1_Source.orig/arch/Linux-x86_64.tcl NAMD_2.7b1_Source/arch/Linux-x86_64.tcl
+--- NAMD_2.7b1_Source.orig/arch/Linux-x86_64.tcl 2009-06-07 15:15:11.000000000 -0500
++++ NAMD_2.7b1_Source/arch/Linux-x86_64.tcl 2009-06-07 18:25:07.000000000 -0500
+@@ -1,7 +1,7 @@
+
+-TCLDIR=/Projects/namd2/tcl/linux-x86_64
++TCLDIR=/usr
+ TCLINCL=-I$(TCLDIR)/include
+-TCLLIB=-L$(TCLDIR)/lib -ltcl8.3 -ldl
++TCLLIB=-L$(TCLDIR)/gentoo-libdir -ltcl -ldl
+ TCLFLAGS=-DNAMD_TCL
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
diff --git a/sci-chemistry/namd/files/namd-2.7-iml-dec.patch b/sci-chemistry/namd/files/namd-2.7-iml-dec.patch
new file mode 100644
index 000000000000..e5ee3bd6c818
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.7-iml-dec.patch
@@ -0,0 +1,24 @@
+diff --git a/src/flipbinpdb.c b/src/flipbinpdb.c
+index 94b71ba..01a2529 100644
+--- a/src/flipbinpdb.c
++++ b/src/flipbinpdb.c
+@@ -9,6 +9,7 @@
+ #include <sys/mman.h>
+ #include <fcntl.h>
+ #include <stdio.h>
++#include <stdlib.h>
+
+ #ifndef MAP_FILE
+ #define MAP_FILE 0
+diff --git a/src/flipdcd.c b/src/flipdcd.c
+index 8ec85b7..1c23433 100644
+--- a/src/flipdcd.c
++++ b/src/flipdcd.c
+@@ -13,6 +13,7 @@
+ #include <sys/mman.h>
+ #include <fcntl.h>
+ #include <stdio.h>
++#include <stdlib.h>
+
+ #ifndef MAP_FILE
+ #define MAP_FILE 0
diff --git a/sci-chemistry/namd/files/namd-2.7-ldflags.patch b/sci-chemistry/namd/files/namd-2.7-ldflags.patch
new file mode 100644
index 000000000000..686eba83a2de
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.7-ldflags.patch
@@ -0,0 +1,41 @@
+diff --git a/Makefile b/Makefile
+index fd20f12..0821bed 100644
+--- a/Makefile
++++ b/Makefile
+@@ -339,7 +339,7 @@ all: $(BINARIES) $(LIBCUDARTSO)
+
+ namd2: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
+ $(MAKEBUILDINFO)
+- $(CHARMC) -verbose -ld++-option \
++ $(CHARMC) $(LDFLAGS) -verbose -ld++-option \
+ "$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS)" \
+ -module NeighborLB -module commlib -language charm++ \
+ $(BUILDINFO).o \
+@@ -394,23 +394,23 @@ charmrun.exe:
+ $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+
+ psfgen: $(DSTDIR) $(SBOBJS) $(PLUGINOBJS)
+- $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
++ $(CC) $(SBCFLAGS) $(LDFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+ psfgen.exe: $(DSTDIR) $(SBOBJS) $(PLUGINOBJS) $(TCLDLL)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+ flipdcd: $(SRCDIR)/flipdcd.c
+- $(CC) $(CFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
+ echo "#!/bin/sh\necho unavailable on this platform" > $@; \
+ chmod +x $@
+
+ flipbinpdb: $(SRCDIR)/flipbinpdb.c
+- $(CC) $(CFLAGS) -o $@ $(SRCDIR)/flipbinpdb.c || \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRCDIR)/flipbinpdb.c || \
+ echo "#!/bin/sh\necho unavailable on this platform" > $@; \
+ chmod +x $@
+
+ fixdcd: $(SRCDIR)/fixdcd.c
+- $(CC) $(CFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
+
+ dumpdcd: $(SRCDIR)/dumpdcd.c
+ $(CC) $(CFLAGS) -o dumpdcd $(SRCDIR)/dumpdcd.c
diff --git a/sci-chemistry/namd/files/namd-2.7_beta2-gentoo.patch b/sci-chemistry/namd/files/namd-2.7_beta2-gentoo.patch
new file mode 100644
index 000000000000..898d6b5d0980
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.7_beta2-gentoo.patch
@@ -0,0 +1,126 @@
+diff -ur NAMD_2.7b2_Source.orig//arch/Linux-x86_64.fftw NAMD_2.7b2_Source//arch/Linux-x86_64.fftw
+--- NAMD_2.7b2_Source.orig//arch/Linux-x86_64.fftw 2010-04-23 14:40:54.566510874 -0500
++++ NAMD_2.7b2_Source//arch/Linux-x86_64.fftw 2010-04-23 14:41:08.106528893 -0500
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux-x86_64
++FFTDIR=/usr
+ FFTINCL=-I$(FFTDIR)/include
+-FFTLIB=-L$(FFTDIR)/lib -lsrfftw -lsfftw
++FFTLIB=-L$(FFTDIR)/gentoo-libdir -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
+diff -ur NAMD_2.7b2_Source.orig//arch/Linux-x86_64.tcl NAMD_2.7b2_Source//arch/Linux-x86_64.tcl
+--- NAMD_2.7b2_Source.orig//arch/Linux-x86_64.tcl 2010-04-23 14:40:54.566510874 -0500
++++ NAMD_2.7b2_Source//arch/Linux-x86_64.tcl 2010-04-23 14:41:08.106528893 -0500
+@@ -1,7 +1,7 @@
+
+-TCLDIR=/Projects/namd2/tcl/linux-x86_64
++TCLDIR=/usr
+ TCLINCL=-I$(TCLDIR)/include
+-TCLLIB=-L$(TCLDIR)/lib -ltcl8.3 -ldl
++TCLLIB=-L$(TCLDIR)/gentoo-libdir -ltcl8.5 -ldl
+ TCLFLAGS=-DNAMD_TCL
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
+diff -ur NAMD_2.7b2_Source.orig//Make.charm NAMD_2.7b2_Source//Make.charm
+--- NAMD_2.7b2_Source.orig//Make.charm 2010-04-23 14:40:54.556517020 -0500
++++ NAMD_2.7b2_Source//Make.charm 2010-04-23 14:42:16.026530011 -0500
+@@ -2,5 +2,5 @@
+ # The config script will override this setting if there is a directory
+ # called charm-6.1 or charm in the NAMD base directory.
+
+-CHARMBASE = /Projects/namd2/charm-6.1.3
++CHARMBASE = /usr/include/charm-6.1.3
+
+Only in NAMD_2.7b2_Source/: Make.charm.~1~
+Only in NAMD_2.7b2_Source/: Make.charm.porig
+diff -ur NAMD_2.7b2_Source.orig//Makefile NAMD_2.7b2_Source//Makefile
+--- NAMD_2.7b2_Source.orig//Makefile 2010-04-23 14:40:54.556517020 -0500
++++ NAMD_2.7b2_Source//Makefile 2010-04-23 14:42:59.446523306 -0500
+@@ -300,10 +300,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/gentoo-charm $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/gentoo-libdir
+
+ # Libraries we may have changed
+ LIBS = $(CUDAOBJS) $(PLUGINLIB) $(DPMTALIBS) $(DPMELIBS) $(TCLDLL)
+@@ -323,7 +323,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen charmrun flipdcd flipbinpdb
++BINARIES = namd2 psfgen flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -354,9 +354,6 @@
+ $(CHARMOPTS) \
+ -lm -o namd2
+
+-charmrun: $(CHARM)/bin/charmrun # XXX
+- $(COPY) $(CHARM)/bin/charmrun $@
+-
+ $(LIBCUDARTSO):
+ if [ -r $(CUDADIR)/lib64/$(LIBCUDARTSO) ]; then \
+ $(COPY) $(CUDADIR)/lib64/$(LIBCUDARTSO) $@; \
+@@ -364,10 +361,6 @@
+ $(COPY) $(CUDADIR)/lib/$(LIBCUDARTSO) $@; \
+ fi
+
+-WINDOWSBINARIES = namd2.exe psfgen.exe
+-# WINDOWSBINARIES = namd2.exe psfgen.exe charmd.exe charmd_faceless.exe charmrun.exe
+-windowsbinaries: $(WINDOWSBINARIES)
+-
+ namd2.exe: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS) $(TCLDLL)
+ $(MAKEBUILDINFO)
+ $(CHARMC) -verbose \
+@@ -390,9 +383,6 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(DSTDIR) $(SBOBJS) $(PLUGINOBJS)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+@@ -716,9 +706,7 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb psfgen charmrun namd2
+-
+-WINDOWS_RELEASE_FILES = $(WINDOWSBINARIES) $(TCLDLL)
++RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb psfgen namd2
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -727,17 +715,9 @@
+ for f in $(DOC_FILES); do cp .rootdir/$$f $(RELEASE_DIR_NAME); done
+ cp -r .rootdir/lib $(RELEASE_DIR_NAME)
+ /bin/rm -rf $(RELEASE_DIR_NAME)/lib/CVS $(RELEASE_DIR_NAME)/lib/*/CVS
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
+- fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+- fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+ -for f in $(RELEASE_FILES); do echo $$f; $(LDD) $$f; done
+
+ winrelease: winall
+Only in NAMD_2.7b2_Source/: Makefile.porig
diff --git a/sci-chemistry/namd/files/namd-2.9-gentoo.patch b/sci-chemistry/namd/files/namd-2.9-gentoo.patch
new file mode 100644
index 000000000000..583cc52645df
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-2.9-gentoo.patch
@@ -0,0 +1,151 @@
+diff -Naur NAMD_2.9_Source.original/Make.charm NAMD_2.9_Source/Make.charm
+--- NAMD_2.9_Source.original/Make.charm 2012-02-29 19:12:11.000000000 -0700
++++ NAMD_2.9_Source/Make.charm 2013-09-13 21:23:26.000000000 -0600
+@@ -2,5 +2,5 @@
+ # The config script will override this setting if there is a directory
+ # called charm-6.4.0 or charm in the NAMD base directory.
+
+-CHARMBASE = /Projects/namd2/charm-6.4.0
++CHARMBASE = /usr/include/charm-6.4.0
+
+diff -Naur NAMD_2.9_Source.original/Makefile NAMD_2.9_Source/Makefile
+--- NAMD_2.9_Source.original/Makefile 2012-04-27 09:53:24.000000000 -0600
++++ NAMD_2.9_Source/Makefile 2013-09-13 21:30:15.000000000 -0600
+@@ -344,10 +344,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/gentoo-charm $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/gentoo-libdir
+ CHARM_MODULES = -module NeighborLB -module HybridLB -module RefineLB -module GreedyLB
+ #CHARM_MODULES = -module msa -module NeighborLB -module HybridLB -module RefineLB -module GreedyLB
+ #MSA = -DCHARM_HAS_MSA
+@@ -370,7 +370,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen sortreplicas charmrun flipdcd flipbinpdb
++BINARIES = namd2 psfgen sortreplicas flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -386,7 +386,7 @@
+
+ namd2: $(MKINCDIR) $(MKDSTDIR) $(OBJS) $(LIBS)
+ $(MAKEBUILDINFO)
+- $(CHARMC) -verbose -ld++-option \
++ $(CHARMC) $(LDFLAGS) -verbose -ld++-option \
+ "$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS)" \
+ "$(CHARM_MODULES)" -language charm++ \
+ $(BUILDINFO).o \
+@@ -402,16 +402,9 @@
+ $(EXTRALINKLIBS) \
+ -lm -o namd2
+
+-charmrun: $(CHARM)/bin/charmrun # XXX
+- $(COPY) $(CHARM)/bin/charmrun $@
+-
+ $(LIBCUDARTSO):
+ $(COPY) $(CUDASODIR)/$(LIBCUDARTSO) $@;
+
+-WINDOWSBINARIES = namd2.exe psfgen.exe sortreplicas.exe
+-# WINDOWSBINARIES = namd2.exe psfgen.exe charmd.exe charmd_faceless.exe charmrun.exe
+-windowsbinaries: $(WINDOWSBINARIES)
+-
+ namd2.exe: $(MKINCDIR) $(MKDSTDIR) $(OBJS) $(LIBS) $(TCLDLL)
+ $(MAKEBUILDINFO)
+ $(CHARMC) -verbose \
+@@ -434,11 +427,8 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(MKDSTDIR) $(SBOBJS) $(PLUGINOBJS)
+- $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
++ $(CC) $(SBCFLAGS) $(LDFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+ psfgen.exe: $(MKDSTDIR) $(SBOBJS) $(PLUGINOBJS) $(TCLDLL)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(PLUGINOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+@@ -456,7 +446,7 @@
+ $(CC) $(CFLAGS) -o diffbinpdb $(SRCDIR)/diffbinpdb.c -lm
+
+ flipdcd: $(SRCDIR)/flipdcd.c
+- $(CC) $(CFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRCDIR)/flipdcd.c || \
+ echo "#!/bin/sh\necho unavailable on this platform" > $@; \
+ chmod +x $@
+
+@@ -466,7 +456,7 @@
+ chmod +x $@
+
+ fixdcd: $(SRCDIR)/fixdcd.c
+- $(CC) $(CFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o fixdcd $(SRCDIR)/fixdcd.c
+
+ dumpdcd: $(SRCDIR)/dumpdcd.c
+ $(CC) $(CFLAGS) -o dumpdcd $(SRCDIR)/dumpdcd.c
+@@ -665,9 +655,7 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb sortreplicas psfgen charmrun namd2
+-
+-WINDOWS_RELEASE_FILES = $(LIBCUDARTSO) $(WINDOWSBINARIES) $(TCLDLL)
++RELEASE_FILES = $(LIBCUDARTSO) flipdcd flipbinpdb sortreplicas psfgen namd2
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -678,17 +666,9 @@
+ for f in `find $(RELEASE_DIR_NAME)/lib -name CVS`; do \
+ /bin/rm -rf $$f; \
+ done
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
+- fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+- fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+ -for f in $(RELEASE_FILES); do echo $$f; $(LDD) $(RELEASE_DIR_NAME)/$$f; done
+
+ winrelease: winall
+diff -Naur NAMD_2.9_Source.original/arch/Linux-x86_64.fftw NAMD_2.9_Source/arch/Linux-x86_64.fftw
+--- NAMD_2.9_Source.original/arch/Linux-x86_64.fftw 2009-02-21 21:16:04.000000000 -0700
++++ NAMD_2.9_Source/arch/Linux-x86_64.fftw 2013-09-13 20:55:02.000000000 -0600
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux-x86_64
++FFTDIR=/usr
+ FFTINCL=-I$(FFTDIR)/include
+-FFTLIB=-L$(FFTDIR)/lib -lsrfftw -lsfftw
++FFTLIB=-L$(FFTDIR)/gentoo-libdir -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
+diff -Naur NAMD_2.9_Source.original/arch/Linux-x86_64.tcl NAMD_2.9_Source/arch/Linux-x86_64.tcl
+--- NAMD_2.9_Source.original/arch/Linux-x86_64.tcl 2011-06-17 14:38:43.000000000 -0600
++++ NAMD_2.9_Source/arch/Linux-x86_64.tcl 2013-09-13 20:56:30.000000000 -0600
+@@ -1,9 +1,9 @@
+
+ #TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64
+-TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64-threaded
++TCLDIR=/usr
+ TCLINCL=-I$(TCLDIR)/include
+ #TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl
+-TCLLIB=-L$(TCLDIR)/lib -ltcl8.5 -ldl -lpthread
++TCLLIB=-L$(TCLDIR)/gentoo-libdir -ltcl8.5 -ldl -lpthread
+ TCLFLAGS=-DNAMD_TCL
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
diff --git a/sci-chemistry/namd/files/namd-barrier-fix-gentoo.patch b/sci-chemistry/namd/files/namd-barrier-fix-gentoo.patch
new file mode 100644
index 000000000000..40e8e68b5ba3
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-barrier-fix-gentoo.patch
@@ -0,0 +1,61 @@
+# patch to fix compile error on gcc-3.x
+
+diff -Naur NAMD_2.6b1_Source/src/BackEnd.C NAMD_2.6b1_Source_patched/src/BackEnd.C
+--- NAMD_2.6b1_Source/src/BackEnd.C 2003-12-31 06:37:15.000000000 +0000
++++ NAMD_2.6b1_Source_patched/src/BackEnd.C 2005-08-22 18:59:59.000000000 +0000
+@@ -162,7 +162,7 @@
+ }
+
+ // start QD and scheduler
+-void BackEnd::barrier(void) {
++void BackEnd::namd_barrier(void) {
+ awaken();
+ suspend();
+ }
+diff -Naur NAMD_2.6b1_Source/src/BackEnd.h NAMD_2.6b1_Source_patched/src/BackEnd.h
+--- NAMD_2.6b1_Source/src/BackEnd.h 2000-01-29 00:20:05.000000000 +0000
++++ NAMD_2.6b1_Source_patched/src/BackEnd.h 2005-08-22 18:59:47.000000000 +0000
+@@ -17,7 +17,7 @@
+
+ static void suspend(void); // Let message code run...
+ static void awaken(void); // ...then return
+- static void barrier(void); // Let message code run, then return
++ static void namd_barrier(void); // Let message code run, then return
+ static void ExitSchedOn(int pe); // Tell a remote processor to stop
+ // his scheduler
+
+diff -Naur NAMD_2.6b1_Source/src/ScriptTcl.C NAMD_2.6b1_Source_patched/src/ScriptTcl.C
+--- NAMD_2.6b1_Source/src/ScriptTcl.C 2005-06-23 18:47:00.000000000 +0000
++++ NAMD_2.6b1_Source_patched/src/ScriptTcl.C 2005-08-22 19:00:21.000000000 +0000
+@@ -56,7 +56,7 @@
+ }
+
+ void ScriptTcl::barrier() {
+- BackEnd::barrier();
++ BackEnd::namd_barrier();
+ }
+
+ void ScriptTcl::initcheck() {
+diff -Naur NAMD_2.6b1_Source/src/main.C NAMD_2.6b1_Source_patched/src/main.C
+--- NAMD_2.6b1_Source/src/main.C 2005-05-27 22:56:49.000000000 +0000
++++ NAMD_2.6b1_Source_patched/src/main.C 2005-08-22 19:17:34.000000000 +0000
+@@ -67,7 +67,9 @@
+
+ #ifndef NOHOSTNAME
+ iout << iINFO <<
+- "Sending usage information to NAMD developers via UDP. Sent data is:\n"
++ "Markus says: I don't want to send usage information \n"
++ << endi;
++ iout << iINFO << "to NAMD developers :) Data not sent is:\n"
+ << endi;
+
+ char sendbuf[TBSOFT_TRACK_MAXLEN];
+@@ -88,7 +90,7 @@
+ sprintf(sendbuf, "1 %s %s %s %s %s %s %s",
+ program, versionnum, platform, numcpus, miscinfo, host, user);
+ iout << iINFO << sendbuf << "\n" << endi;
+- send_dgram(TBSOFT_TRACK_HOST, TBSOFT_TRACK_PORT, sendbuf, strlen(sendbuf));
++ //send_dgram(TBSOFT_TRACK_HOST, TBSOFT_TRACK_PORT, sendbuf, strlen(sendbuf));
+
+ #endif
+ return 0;
diff --git a/sci-chemistry/namd/files/namd-fftw-lib-gentoo.patch b/sci-chemistry/namd/files/namd-fftw-lib-gentoo.patch
new file mode 100644
index 000000000000..731ea2337e91
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-fftw-lib-gentoo.patch
@@ -0,0 +1,15 @@
+# adjust paths for proper linking to fftw libs
+
+--- NAMD_2.6b1_Source/arch/Linux-i686.fftw 2004-02-20 22:38:36.000000000 +0000
++++ NAMD_2.6b1_Source_patched/arch/Linux-i686.fftw 2005-08-22 18:50:38.000000000 +0000
+@@ -1,7 +1,7 @@
+
+-FFTDIR=/Projects/namd2/fftw/linux
+-FFTINCL=-I$(FFTDIR)/include -I$(HOME)/fftw/include
+-FFTLIB=-L$(FFTDIR)/lib -L$(HOME)/fftw/lib -lsrfftw -lsfftw
++#FFTDIR=/Projects/namd2/fftw/linux
++FFTINCL=-I/usr/include
++FFTLIB=-L/usr/lib -lsrfftw -lsfftw
+ FFTFLAGS=-DNAMD_FFTW
+ FFT=$(FFTINCL) $(FFTFLAGS)
+
diff --git a/sci-chemistry/namd/files/namd-makefile-gentoo.patch b/sci-chemistry/namd/files/namd-makefile-gentoo.patch
new file mode 100644
index 000000000000..4ee5822ccb8f
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-makefile-gentoo.patch
@@ -0,0 +1,88 @@
+# provide paths for charm++ provided includes/libraries/binaries
+
+--- NAMD_2.6b1_Source-patched/Makefile 2005-07-22 18:50:58.000000000 +0000
++++ NAMD_2.6b1_Source/Makefile 2005-09-30 02:28:35.000000000 +0000
+@@ -227,10 +227,10 @@
+ $(DSTDIR)/stringhash.o
+
+ # definitions for Charm routines
+-CHARMC = $(CHARM)/bin/charmc
+-CHARMXI = $(CHARM)/bin/charmc
+-CHARMINC = $(CHARM)/include $(COPTD)CMK_OPTIMIZE=1
+-CHARMLIB = $(CHARM)/lib
++CHARMC = /usr/bin/charmc
++CHARMXI = /usr/bin/charmc
++CHARMINC = /usr/include/charm-5.9 $(COPTD)CMK_OPTIMIZE=1
++CHARMLIB = /usr/lib
+
+ # Libraries we may have changed
+ LIBS = $(PLUGINLIB) $(DPMTALIBS) $(DPMELIBS) $(TCLDLL)
+@@ -250,7 +250,7 @@
+
+ # Add new executables here.
+
+-BINARIES = namd2 psfgen charmrun flipdcd flipbinpdb
++BINARIES = namd2 psfgen flipdcd flipbinpdb
+
+ # This should be rebuilt at every compile, but not on Win32.
+ BUILDINFO = $(DSTDIR)/buildinfo
+@@ -279,10 +279,7 @@
+ $(CHARMOPTS) \
+ -lm -o namd2
+
+-charmrun: $(CHARM)/bin/charmrun # XXX
+- $(COPY) $(CHARM)/bin/charmrun $@
+-
+-win32binaries: namd2.exe psfgen.exe charmd.exe charmd_faceless.exe charmrun.exe
++win32binaries: namd2.exe psfgen.exe charmd.exe charmd_faceless.exe
+
+ namd2.exe: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
+ $(MAKEBUILDINFO)
+@@ -304,9 +301,6 @@
+ charmd_faceless.exe:
+ $(COPY) $(CHARM)/bin/charmd_faceless.exe charmd_faceless.exe
+
+-charmrun.exe:
+- $(COPY) $(CHARM)/bin/charmrun.exe charmrun.exe
+-
+ psfgen: $(DSTDIR) $(SBOBJS)
+ $(CC) $(SBCFLAGS) -o psfgen $(SBOBJS) $(TCLLIB) $(TCLAPPLIB) -lm
+
+@@ -565,9 +559,9 @@
+
+ DOC_FILES = README.txt announce.txt license.txt notes.txt
+
+-RELEASE_FILES = namd2 psfgen charmrun flipdcd flipbinpdb
++RELEASE_FILES = namd2 psfgen flipdcd flipbinpdb
+
+-WIN32_RELEASE_FILES = namd2.exe psfgen.exe charmrun.exe charmd.exe charmd_faceless.exe $(TCLDLL)
++WIN32_RELEASE_FILES = namd2.exe psfgen.exe charmd.exe charmd_faceless.exe $(TCLDLL)
+
+ release: all
+ $(ECHO) Creating release $(RELEASE_DIR_NAME)
+@@ -575,18 +569,18 @@
+ cp $(RELEASE_FILES) $(RELEASE_DIR_NAME)
+ for f in $(DOC_FILES); do cp .rootdir/$$f $(RELEASE_DIR_NAME); done
+ cp -r .rootdir/lib $(RELEASE_DIR_NAME)
+- if [ -r $(CHARM)/bin/charmd ]; then \
+- $(COPY) $(CHARM)/bin/charmd $(RELEASE_DIR_NAME); \
++ if [ -r /usr/bin/charmd ]; then \
++ $(COPY) /usr/bin/charmd $(RELEASE_DIR_NAME); \
+ fi
+- if [ -r $(CHARM)/bin/charmd_faceless ]; then \
+- $(COPY) $(CHARM)/bin/charmd_faceless $(RELEASE_DIR_NAME); \
++ if [ -r /usr/bin/charmd_faceless ]; then \
++ $(COPY) /usr/bin/charmd_faceless $(RELEASE_DIR_NAME); \
+ fi
+ chmod -R a+rX $(RELEASE_DIR_NAME)
+ tar cf $(RELEASE_DIR_NAME).tar $(RELEASE_DIR_NAME)
+ gzip $(RELEASE_DIR_NAME).tar
+- echo $(CHARM)
+- ls -l $(CHARM)/lib
+- echo $(CHARM)
++ echo /usr
++ ls -l /usr/lib
++ echo /usr
+ file $(RELEASE_FILES)
+
+ winrelease: winall
diff --git a/sci-chemistry/namd/files/namd-tcl-lib-gentoo.patch b/sci-chemistry/namd/files/namd-tcl-lib-gentoo.patch
new file mode 100644
index 000000000000..0e6f0dd337e5
--- /dev/null
+++ b/sci-chemistry/namd/files/namd-tcl-lib-gentoo.patch
@@ -0,0 +1,16 @@
+# adjust paths for proper linking to tcl libs
+
+--- NAMD_2.6b1_Source/arch/Linux-i686.tcl 2004-10-27 21:40:55.000000000 +0000
++++ NAMD_2.6b1_Source_patched/arch/Linux-i686.tcl 2005-09-14 20:50:14.000000000 +0000
+@@ -1,8 +1,8 @@
+
+-TCLDIR=/Projects/namd2/tcl/linux
++#TCLDIR=/Projects/namd2/tcl/linux
+ #TCLDIR=$(HOME)/tcl/cray-xt3
+-TCLINCL=-I$(TCLDIR)/include -I$(HOME)/tcl/include
+-TCLLIB=-L$(TCLDIR)/lib -L$(HOME)/tcl/lib -ltcl8.3 -ldl
++TCLINCL=-I/usr/include
++TCLLIB=-L/usr/lib -L$(HOME)/tcl/lib -ltcl -ldl
+ TCLFLAGS=-DNAMD_TCL -DUSE_NON_CONST
+ TCL=$(TCLINCL) $(TCLFLAGS)
+
diff --git a/sci-chemistry/namd/metadata.xml b/sci-chemistry/namd/metadata.xml
new file mode 100644
index 000000000000..c73650100bed
--- /dev/null
+++ b/sci-chemistry/namd/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-chemistry</herd>
+ <maintainer>
+ <email>nicolasbock@gentoo.org</email>
+ <name>Nicolas Bock</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/namd/namd-2.10.ebuild b/sci-chemistry/namd/namd-2.10.ebuild
new file mode 100644
index 000000000000..05e3fd7275dd
--- /dev/null
+++ b/sci-chemistry/namd/namd-2.10.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+DESCRIPTION="A powerful and highly parallelized molecular dynamics code"
+LICENSE="namd"
+HOMEPAGE="http://www.ks.uiuc.edu/Research/namd/"
+
+MY_PN="NAMD"
+
+SRC_URI="${MY_PN}_${PV}_Source.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RESTRICT="fetch"
+
+RDEPEND="
+ >=sys-cluster/charm-6.5.1-r2
+ sci-libs/fftw:3.0
+ dev-lang/tcl:0="
+
+DEPEND="${RDEPEND}
+ app-shells/tcsh"
+
+NAMD_ARCH="Linux-x86_64-g++"
+
+NAMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=NAMD"
+
+S="${WORKDIR}/${MY_PN}_${PV}_Source"
+
+pkg_nofetch() {
+ echo
+ einfo "Please download ${MY_PN}_${PV}_Source.tar.gz from"
+ einfo "${NAMD_DOWNLOAD}"
+ einfo "after agreeing to the license and then move it to"
+ einfo "${DISTDIR}"
+ einfo "Be sure to select the ${PV} version!"
+ echo
+}
+
+src_prepare() {
+ CHARM_VERSION=$(best_version sys-cluster/charm | cut -d- -f3)
+
+ # apply a few small fixes to make NAMD compile and
+ # link to the proper libraries
+ epatch "${FILESDIR}"/namd-2.10-gentoo.patch
+ epatch "${FILESDIR}"/namd-2.7-iml-dec.patch
+ sed \
+ -e "/CHARMBASE =/s:= .*:= /usr/bin/charm-${CHARM_VERSION}:" \
+ -i Make.charm || die
+
+ # Remove charm distribution. We don't need it.
+ rm -f charm-*.tar
+
+ # proper compiler and cflags
+ sed \
+ -e "s/g++.*/$(tc-getCXX)/" \
+ -e "s/gcc.*/$(tc-getCC)/" \
+ -e "s/CXXOPTS = .*/CXXOPTS = ${CXXFLAGS} ${LDFLAGS}/" \
+ -e "s/COPTS = .*/COPTS = ${CFLAGS} ${LDFLAGS}/" \
+ -i arch/${NAMD_ARCH}.arch || die
+
+ sed \
+ -e "s/gentoo-libdir/$(get_libdir)/g" \
+ -e "s/gentoo-charm/charm-${CHARM_VERSION}/g" \
+ -i Makefile || die "Failed gentooizing Makefile."
+ sed -e "s@/lib@/$(get_libdir)@g" -e '/FFTDIR=/s@=.*@=/usr@' -i arch/Linux-x86_64.fftw3 || die
+ sed -e "s/gentoo-libdir/$(get_libdir)/g" -i arch/Linux-x86_64.tcl || die
+}
+
+src_configure() {
+ # configure
+ ./config ${NAMD_ARCH} --with-fftw3 --charm-arch . || die
+}
+
+src_compile() {
+ # build namd
+ cd "${S}/${NAMD_ARCH}"
+ emake
+}
+
+src_install() {
+ dodoc announce.txt license.txt notes.txt
+ cd "${S}/${NAMD_ARCH}"
+
+ # the binaries
+ dobin ${PN}2 psfgen flipbinpdb flipdcd
+}
+
+pkg_postinst() {
+ echo
+ einfo "For detailed instructions on how to run and configure"
+ einfo "NAMD please consults the extensive documentation at"
+ einfo "http://www.ks.uiuc.edu/Research/namd/"
+ einfo "and the NAMD tutorials available at"
+ einfo "http://www.ks.uiuc.edu/Training/Tutorials/"
+ einfo "Have fun :)"
+ echo
+}
diff --git a/sci-chemistry/namd/namd-2.9-r1.ebuild b/sci-chemistry/namd/namd-2.9-r1.ebuild
new file mode 100644
index 000000000000..feeba40a7c45
--- /dev/null
+++ b/sci-chemistry/namd/namd-2.9-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+DESCRIPTION="A powerful and highly parallelized molecular dynamics code"
+LICENSE="namd"
+HOMEPAGE="http://www.ks.uiuc.edu/Research/namd/"
+
+MY_PN="NAMD"
+
+SRC_URI="${MY_PN}_${PV}_Source.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RESTRICT="fetch"
+
+RDEPEND="
+ >=sys-cluster/charm-6.5.1-r2
+ sci-libs/fftw:3.0
+ dev-lang/tcl:0="
+
+DEPEND="${RDEPEND}
+ app-shells/tcsh"
+
+NAMD_ARCH="Linux-x86_64-g++"
+
+NAMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=NAMD"
+
+S="${WORKDIR}/${MY_PN}_${PV}_Source"
+
+pkg_nofetch() {
+ echo
+ einfo "Please download ${MY_PN}_${PV}_Source.tar.gz from"
+ einfo "${NAMD_DOWNLOAD}"
+ einfo "after agreeing to the license and then move it to"
+ einfo "${DISTDIR}"
+ einfo "Be sure to select the ${PV} version!"
+ echo
+}
+
+src_prepare() {
+ CHARM_VERSION=$(best_version sys-cluster/charm | cut -d- -f3)
+
+ # apply a few small fixes to make NAMD compile and
+ # link to the proper libraries
+ epatch "${FILESDIR}"/namd-2.9-gentoo.patch
+ epatch "${FILESDIR}"/namd-2.7-iml-dec.patch
+ sed \
+ -e "s:charm-.\+:charm-${CHARM_VERSION}:" \
+ -i Make.charm || die
+
+ # Remove charm distribution. We don't need it.
+ rm -f charm-6.4.0.tar || die
+
+ # proper compiler and cflags
+ sed \
+ -e "s/g++.*/$(tc-getCXX)/" \
+ -e "s/gcc.*/$(tc-getCC)/" \
+ -e "s/CXXOPTS = .*/CXXOPTS = ${CXXFLAGS} ${LDFLAGS}/" \
+ -e "s/COPTS = .*/COPTS = ${CFLAGS} ${LDFLAGS}/" \
+ -i arch/${NAMD_ARCH}.arch || die
+
+ sed \
+ -e "s/gentoo-libdir/$(get_libdir)/g" \
+ -e "s/gentoo-charm/charm-${CHARM_VERSION}/g" \
+ -i Makefile || die "Failed gentooizing Makefile."
+ sed -e "s@/lib@/$(get_libdir)@g" -e '/FFTDIR=/s@=.*@=/usr@' -i arch/Linux-x86_64.fftw3 || die
+ sed -e "s/gentoo-libdir/$(get_libdir)/g" -i arch/Linux-x86_64.tcl || die
+}
+
+src_configure() {
+ # configure
+ ./config ${NAMD_ARCH} --with-fftw3 --charm-arch . || die
+}
+
+src_compile() {
+ # build namd
+ cd "${S}/${NAMD_ARCH}"
+ emake
+}
+
+src_install() {
+ dodoc announce.txt license.txt notes.txt
+ cd "${S}/${NAMD_ARCH}"
+
+ # the binaries
+ dobin ${PN}2 psfgen flipbinpdb flipdcd
+}
+
+pkg_postinst() {
+ echo
+ einfo "For detailed instructions on how to run and configure"
+ einfo "NAMD please consults the extensive documentation at"
+ einfo "http://www.ks.uiuc.edu/Research/namd/"
+ einfo "and the NAMD tutorials available at"
+ einfo "http://www.ks.uiuc.edu/Training/Tutorials/"
+ einfo "Have fun :)"
+ echo
+}
diff --git a/sci-chemistry/nmrglue/Manifest b/sci-chemistry/nmrglue/Manifest
new file mode 100644
index 000000000000..4eb824ac2a3b
--- /dev/null
+++ b/sci-chemistry/nmrglue/Manifest
@@ -0,0 +1,2 @@
+DIST nmrglue-0.4-corrected.tar.gz 128298 SHA256 85c45750aef431f2c1326a9f4856eeac4da8aedbc94c6255de6e08e3ea35f316 SHA512 c2376ba8e8f993e6e4b536d67d4a780087ac8f811b2d5a846ff8b4785b02c0a4e86956c4205f90a17c5c0a2dc620d75fb7886fbad9cca314b548e3368137eda0 WHIRLPOOL eb8a2a5064b5fa5b60d16a70cf51667daa55f1584ed9d0ca3092af4672ed2c5cef56d135e82b35c107856d338fb0893248a1719b673a4e96c1edb2fb75243d08
+DIST nmrglue-0.5.tar.gz 142604 SHA256 a05c880bd0d5f0b388156409e18a5618742f829f2532d19970d05b11bfcc6103 SHA512 2a4b94eb6bae966000bfdee4dd16f4e312568915fb5f19f59f84c6deff690703f54f76366d3f9299f7ec187192ff64f2bf62836617a424d4c5c895c67d819af2 WHIRLPOOL 78f9d094a2ab1ebc01f452717fdc1cdeccc27951195c9dd6e97069a575722acf25442009b4ccede03ad728b0767fced4a2220a8072ccc1d604a9f62e9c45af4a
diff --git a/sci-chemistry/nmrglue/files/nmrglue-0.5-nohyper.patch b/sci-chemistry/nmrglue/files/nmrglue-0.5-nohyper.patch
new file mode 100644
index 000000000000..103f5b154d0b
--- /dev/null
+++ b/sci-chemistry/nmrglue/files/nmrglue-0.5-nohyper.patch
@@ -0,0 +1,33 @@
+From ba1eee9e71623110511545c058afe2a92e139aa5 Mon Sep 17 00:00:00 2001
+From: Jonathan Helmus <jjhelmus@gmail.com>
+Date: Tue, 3 Mar 2015 19:47:05 -0600
+Subject: [PATCH] pipe_proc.py tp function correctly sets FDSIZE.
+
+Fixes issue #27
+---
+ nmrglue/process/pipe_proc.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/nmrglue/process/pipe_proc.py b/nmrglue/process/pipe_proc.py
+index 79b6303..8c1271c 100644
+--- a/nmrglue/process/pipe_proc.py
++++ b/nmrglue/process/pipe_proc.py
+@@ -1527,13 +1527,16 @@ def tp(dic, data, hyper=False, nohyper=False, auto=False, nohdr=False):
+ data = np.array(p.tp_hyper(data), dtype="complex64")
+ else:
+ data = p.tp(data)
+- if dic[fn2 + "QUADFLAG"] != 1 and nohyper is not True:
++ if dic[fn2 + "QUADFLAG"] != 1 and nohyper is False:
+ # unpack complex as needed
+ data = np.array(p.c2ri(data), dtype="complex64")
+
+ # update the dimentionality and order
+ dic["FDSLICECOUNT"] = data.shape[0]
+- if data.dtype == 'float32':
++ if (data.dtype == 'float32') and (nohyper is True):
++ # when nohyper is True and the new last dimension was complex
++ # prior to transposing then FDSIZE is set as if the dimension was
++ # converted to complex data, that is half the actual size.
+ dic["FDSIZE"] = data.shape[1] / 2
+ else:
+ dic["FDSIZE"] = data.shape[1]
diff --git a/sci-chemistry/nmrglue/metadata.xml b/sci-chemistry/nmrglue/metadata.xml
new file mode 100644
index 000000000000..d1c1fa8f0564
--- /dev/null
+++ b/sci-chemistry/nmrglue/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Nmrglue has the ability to read, write and convert between a number of NMR file
+formats including Agilent/Varian, Bruker, NMRPipe, Sparky, SIMPSON, Rowland NMR
+Toolkit files. The files, which are represented in Python as dictionaries of
+spectral parameters and NumPy ndarray objects, can be easily examined, modified
+and processed as desired.
+
+Nmrglue provides a number of functions for processing NMR data such as
+apodization, spectral shifting, Fourier and other transformations, baseline
+smoothing and flattening, and linear prediction modeling and extrapolation.
+In addition new processing schemes can be implemented easily using the nmrglue
+provided functions and the multitude of numerical routines provided by the NumPy
+and SciPy packages.
+
+When used in conjunction with the matplotlib (or other) python plotting library
+nmrglue can be used to create publication quality figures of NMR spectrum or
+examine data interactively.
+</longdescription>
+ <upstream>
+ <remote-id type="github">jjhelmus/nmrglue</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/nmrglue/nmrglue-0.4.ebuild b/sci-chemistry/nmrglue/nmrglue-0.4.ebuild
new file mode 100644
index 000000000000..d39fd44820ce
--- /dev/null
+++ b/sci-chemistry/nmrglue/nmrglue-0.4.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="A module for working with NMR data in Python"
+HOMEPAGE="http://nmrglue.com/"
+SRC_URI="https://nmrglue.googlecode.com/files/${P}-corrected.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-python/ipython[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]"
+DEPEND=""
diff --git a/sci-chemistry/nmrglue/nmrglue-0.5-r1.ebuild b/sci-chemistry/nmrglue/nmrglue-0.5-r1.ebuild
new file mode 100644
index 000000000000..08dd91a5ab21
--- /dev/null
+++ b/sci-chemistry/nmrglue/nmrglue-0.5-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit distutils-r1
+
+DESCRIPTION="A module for working with NMR data in Python"
+HOMEPAGE="http://nmrglue.com/"
+SRC_URI="https://github.com/jjhelmus/nmrglue/releases/download/v${PV}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+RDEPEND="
+ dev-python/ipython[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]"
+DEPEND="
+ test? (
+ ${RDEPEND}
+ dev-python/nose[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=( "${FILESDIR}"/${P}-nohyper.patch )
+
+python_test() {
+ nosetests --verbosity=3 || die
+}
diff --git a/sci-chemistry/numbat/Manifest b/sci-chemistry/numbat/Manifest
new file mode 100644
index 000000000000..6c26ed4a268f
--- /dev/null
+++ b/sci-chemistry/numbat/Manifest
@@ -0,0 +1 @@
+DIST Numbat-0.999.tar.gz 1791471 SHA256 aef72903f262c5a25e542429f3cc7aca4d2dbc920c08b59847d5cb325855e9ab SHA512 0887f77905bbb476b0d12a7015d5d5745023740acc974ea9cd452de7d38a75a92e6090015127588b38ba62353d38c2be20f57be5df3011b51050c4934dfd206c WHIRLPOOL 8282bf5481a93d17a833f809c28d927d681d6d5016552a07b9267bdb78e99fc568370321567d7d6a87a84f31eea8fae9494c1ae8c0109157fca779c7c06805d9
diff --git a/sci-chemistry/numbat/files/numbat-0.999-gnuplot.patch b/sci-chemistry/numbat/files/numbat-0.999-gnuplot.patch
new file mode 100644
index 000000000000..942f5871e50b
--- /dev/null
+++ b/sci-chemistry/numbat/files/numbat-0.999-gnuplot.patch
@@ -0,0 +1,42 @@
+ src/error_analysis.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/error_analysis.c b/src/error_analysis.c
+index eb86a6f..c0edf5f 100644
+--- a/src/error_analysis.c
++++ b/src/error_analysis.c
+@@ -848,11 +848,11 @@ void write_sanson_mac(FILE * F, char * name_plot, char * name_world, int number_
+ }
+
+ fprintf(F, "reset\n");
+- fprintf(F, "set noxtics\n");
+- fprintf(F, "set noytics\n");
++ fprintf(F, "unset xtics\n");
++ fprintf(F, "unset ytics\n");
+ fprintf(F, "set angles degrees\n");
+- fprintf(F, "set nogrid\n");
+- fprintf(F, "set noborder\n");
++ fprintf(F, "unset grid\n");
++ fprintf(F, "unset border\n");
+ //fprintf(F, "width=40\n");
+ //fprintf(F, "height=width*(3./4.)\n");
+ //fprintf(F, "set xrange [-width : width]\n");
+@@ -867,12 +867,12 @@ void write_sanson_mac(FILE * F, char * name_plot, char * name_world, int number_
+ fprintf(F, "YC(lat,lon)=(lon-long0)*cos(lat)\n");
+ fprintf(F, "plot '%s' using (YC($2,$1)):(XC($2,$1)) t '' with lines lw 0.1 lt -1", name_world);
+ for(i = 0; i < number_of_tensor; i++){
+- fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points %d", name_plot,
+- 6*i+2, 6*i+1, 6*i+2, 6*i+1, 3*i+1);
+- fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points %d", name_plot,
+- 6*i+4, 6*i+3, 6*i+4, 6*i+3, 3*i+2);
+- fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points %d", name_plot,
+- 6*i+6, 6*i+5, 6*i+6, 6*i+5, 3*i+3);
++ fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points", name_plot,
++ 6*i+2, 6*i+1, 6*i+2, 6*i+1);
++ fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points", name_plot,
++ 6*i+4, 6*i+3, 6*i+4, 6*i+3);
++ fprintf(F, ", '%s' using (YC($%d,$%d)):(XC($%d,$%d)) t '' with points", name_plot,
++ 6*i+6, 6*i+5, 6*i+6, 6*i+5);
+ }
+ fprintf(F, "\n");
+ //fprintf(F, "pause 2\n");
diff --git a/sci-chemistry/numbat/metadata.xml b/sci-chemistry/numbat/metadata.xml
new file mode 100644
index 000000000000..054dc8435cf6
--- /dev/null
+++ b/sci-chemistry/numbat/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Numbat is a user friendly software that fits dX-tensor to a set of PCS
+measurements and a structure from a PDB file. It has also been designed to
+assist in the semi automatic process of PCS assignment. A detailed description
+of the software can be found in this publication:
+
+Christophe Schmitz, Mitchell J. Stanton-Cook, Xun-Cheng Su, Gottfried Otting,
+and Thomas Huber (2008). Numbat: an interactive software tool for fitting
+Δχ-tensors to molecular coordinates using pseudocontact shifts. Journal of
+Biomolecular NMR. 41:179-189.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/numbat/numbat-0.999-r1.ebuild b/sci-chemistry/numbat/numbat-0.999-r1.ebuild
new file mode 100644
index 000000000000..c34f931aa5b1
--- /dev/null
+++ b/sci-chemistry/numbat/numbat-0.999-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils
+
+MY_PN="Numbat"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="new user-friendly method built for automatic dX-tensor determination"
+HOMEPAGE="http://www.nmr.chem.uu.nl/~christophe/numbat.html"
+SRC_URI="http://comp-bio.anu.edu.au/private/downloads/Numbat/${MY_P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+CDEPEND="
+ gnome-base/libglade:2.0
+ sci-libs/gsl
+ x11-libs/gtk+:2"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ sci-chemistry/molmol
+ sci-chemistry/pymol
+ sci-visualization/gnuplot"
+
+S="${WORKDIR}"/${MY_P}
+
+PATCHES=(
+# "${FILESDIR}"/${P}-glade.patch
+ "${FILESDIR}"/${P}-gnuplot.patch )
+
+src_prepare() {
+ sed \
+ -e '/COPYING/d' \
+ -e "s:doc/numbat:share/doc/${PF}:g" \
+ -i Makefile.am src/common.h || die
+ rm missing
+ emake distclean
+ autotools-utils_src_prepare
+}
+
+src_install() {
+ docompress -x /usr/share/doc/${PF}
+ autotools-utils_src_install
+}
diff --git a/sci-chemistry/oasis/Manifest b/sci-chemistry/oasis/Manifest
new file mode 100644
index 000000000000..e87a831c1fe3
--- /dev/null
+++ b/sci-chemistry/oasis/Manifest
@@ -0,0 +1 @@
+DIST oasis4.0_Linux.zip 6714528 SHA256 56da70ce0c2750aaddf64ad2cd7852fc341d2022209484beb356b4e73dec61ba SHA512 b43b8315e8e3bc8531e11021605100f231635e2363256a19ed0f51015913221eb9e37b3891b9b1239bf83c9ada8f65a1bdc79ec5745201436f8c3b5019bd4bf7 WHIRLPOOL 24d337391997d036bd657ab22aecc77d36f7fa0af573d17433869a29640a8a10368c75ebee114071c577cc0cce34d838271147599d99e2c389088b8c6185f41b
diff --git a/sci-chemistry/oasis/files/4.0-makefile.patch b/sci-chemistry/oasis/files/4.0-makefile.patch
new file mode 100644
index 000000000000..f27a350a1fd2
--- /dev/null
+++ b/sci-chemistry/oasis/files/4.0-makefile.patch
@@ -0,0 +1,15 @@
+diff --git a/src/Makefile b/src/Makefile
+index 1e9128f..eb9edaf 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -20,8 +20,8 @@ IRIX:
+ @ ${F77} -O2 -mips3 -nocpp -OPT:Olimit=1500 -w -rpath ${CCP4_LIB} -o oasis4-0 oasis4-0.f -L${CCP4_LIB}/src -lccp4f -lccp4c -lmmdb -lC -lm -L/usr/lib32 -lblas
+ @ ${F77} -O2 -mips3 -nocpp -OPT:Olimit=1500 -w -rpath ${CCP4_LIB} -o fnp2fp fnp2fp.f -L${CCP4_LIB}/src -lccp4f -lccp4c -lmmdb -lC -lm -L/usr/lib32 -lblas
+ Linux:
+- @ ${F77} -O -w -fno-second-underscore -fno-globals -fno-automatic -o oasis4-0 oasis4-0.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lg2c -lm -L${CCP4_LIB}
+- @ ${F77} -O -w -fno-second-underscore -fno-globals -fno-automatic -o fnp2fp fnp2fp.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lg2c -lm -L${CCP4_LIB}
++ ${F77} $(CFLAGS) $(LDFLAGS) -o oasis oasis4-0.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lm -L${CCP4_LIB}
++ ${F77} $(CFLAGS) $(LDFLAGS) -o fnp2fp fnp2fp.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lm -L${CCP4_LIB}
+ Darwin:
+ @ ${F77} -O2 -fno-second-underscore -o fnp2fp fnp2fp.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lgcc_s.10.5 -lSystem -lm
+ @ ${F77} -O2 -fno-second-underscore -o oasis4-0 oasis4-0.f -L${CCP4_LIB} -lccp4f -lccp4c -lmmdb -lstdc++ -lgcc_s.10.5 -lSystem -lm
diff --git a/sci-chemistry/oasis/metadata.xml b/sci-chemistry/oasis/metadata.xml
new file mode 100644
index 000000000000..8412c2f3d312
--- /dev/null
+++ b/sci-chemistry/oasis/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-chemistry</herd>
+ <use>
+ <flag name="minimal">Restricts functionality on free software</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/oasis/oasis-4.0-r3.ebuild b/sci-chemistry/oasis/oasis-4.0-r3.ebuild
new file mode 100644
index 000000000000..8c259f6be9a3
--- /dev/null
+++ b/sci-chemistry/oasis/oasis-4.0-r3.ebuild
@@ -0,0 +1,70 @@
+# 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
+
+MY_P="${PN}${PV}_Linux"
+
+DESCRIPTION="A direct-method program for SAD/SIR phasing"
+HOMEPAGE="http://cryst.iphy.ac.cn/Project/protein/protein-I.html"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${MY_P}.zip"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="ccp4 oasis"
+IUSE="examples +minimal"
+
+RDEPEND="
+ sci-chemistry/ccp4-apps
+ sci-chemistry/pymol
+ sci-libs/mmdb:0
+ sci-visualization/gnuplot
+ !minimal? (
+ sci-chemistry/solve-resolve-bin
+ sci-chemistry/arp-warp-bin
+ )"
+DEPEND="${RDEPEND}
+ sci-libs/ccp4-libs"
+
+S="${WORKDIR}"/${MY_P}
+
+src_prepare() {
+ rm bin/{fnp2fp,gnuplot,oasis4-0,seq} || die
+ epatch "${FILESDIR}"/${PV}-makefile.patch
+}
+
+src_compile() {
+ emake \
+ -C src \
+ F77="$(tc-getFC)" \
+ CFLAGS="${FFLAGS}" \
+ CCP4_LIB="${EPREFIX}/usr/$(get_libdir)" \
+ Linux
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe src/{${PN},fnp2fp}
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/*.*sh
+
+ insinto /usr/share/doc/${PF}/html
+ doins bin/html/*
+ dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/html
+ chmod 755 "${ED}"/usr/share/doc/${PF}/html/*.{*sh,awk} || die
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+
+ cat >> "${T}"/25oasis <<- EOF
+ oasisbin="${EPREFIX}/usr/$(get_libdir)/${PN}"
+ EOF
+
+ doenvd "${T}"/25oasis
+}
diff --git a/sci-chemistry/openbabel-perl/Manifest b/sci-chemistry/openbabel-perl/Manifest
new file mode 100644
index 000000000000..082e5b029843
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/Manifest
@@ -0,0 +1 @@
+DIST openbabel-2.3.2.tar.gz 20509105 SHA256 4eaca26679aa6cc85ebf96af19191472ac63ca442c36b0427b369c3a25705188 SHA512 d0e1f8b758ffdd65ec6c31d988bffe3279355e286ce69fad12c5905b3b832e2b73ee95b1061b1576aba1ee9fe4da5e31ec30350c473be17493c657dc80caf919 WHIRLPOOL 74eff18b73d24c8f702e5573a58ba6afba8402e9ce8782de95dc0568575a7d2d632dbc8e8a98b3cd25efdfa7379494f7dcd449342c81ddf73f42a387bce77aaa
diff --git a/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-makefile.patch b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-makefile.patch
new file mode 100644
index 000000000000..597c9a79c103
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-makefile.patch
@@ -0,0 +1,28 @@
+ scripts/CMakeLists.txt | 2 +-
+ scripts/perl/Makefile.PL | 1 +
+ 2 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index bf2527b..3c45111 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -223,7 +223,7 @@ if (DO_PERL_BINDINGS)
+ COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/Makefile.PL ${openbabel_BINARY_DIR}/scripts/perl
+ COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/OpenBabel.pm ${openbabel_BINARY_DIR}/scripts/perl
+ COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp ${openbabel_BINARY_DIR}/scripts/perl
+- COMMAND PERL5LIB=${openbabel_SOURCE_DIR}/scripts/perl/inc SRC_DIR=${openbabel_SOURCE_DIR} OBJ_DIR=${openbabel_BINARY_DIR} ${PERL_EXECUTABLE} ${openbabel_BINARY_DIR}/scripts/perl/Makefile.PL ${PERL_PREFIX_TEXT}
++ COMMAND PERL5LIB=${openbabel_SOURCE_DIR}/scripts/perl/inc SRC_DIR=${openbabel_SOURCE_DIR} OBJ_DIR=${openbabel_BINARY_DIR} ${PERL_EXECUTABLE} ${openbabel_BINARY_DIR}/scripts/perl/Makefile.PL INSTALLDIRS=vendor ${PERL_PREFIX_TEXT}
+ COMMAND PERL5LIB=${openbabel_SOURCE_DIR}/scripts/perl/inc make
+ DEPENDS ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp
+ WORKING_DIRECTORY ${openbabel_BINARY_DIR}/scripts/perl
+diff --git a/scripts/perl/Makefile.PL b/scripts/perl/Makefile.PL
+index a3a2116..44ad27d 100644
+--- a/scripts/perl/Makefile.PL
++++ b/scripts/perl/Makefile.PL
+@@ -32,5 +32,6 @@ WriteMakefile(
+ 'CC' => $CC,
+ 'LD' => '$(CC)',
+ 'INC' => '-I../../include -I'.$cmakesrcdir.'/include',
++ 'DESTDIR' => @ENV{"D"},
+ 'OBJECT' => 'openbabel-perl.o'
+ );
diff --git a/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-swig.patch b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-swig.patch
new file mode 100644
index 000000000000..6beacf74880c
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.0-swig.patch
@@ -0,0 +1,25 @@
+ scripts/CMakeLists.txt | 6 +-----
+ 1 files changed, 1 insertions(+), 5 deletions(-)
+
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index bf2527b..16feeb4 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -8,16 +8,12 @@ if (RUN_SWIG)
+ # SWIG_EXECUTABLE - the path to the swig executable
+ # SWIG_VERSION - the version number of the swig executable
+
+- find_package(SWIG)
++ find_package(SWIG 2.0.0)
+ if (NOT SWIG_FOUND)
+ message(STATUS "SWIG NOT found")
+ return()
+ endif (NOT SWIG_FOUND)
+ message(STATUS "SWIG version is ${SWIG_VERSION}")
+- if (NOT ${SWIG_VERSION} STREQUAL "2.0.0" AND NOT ${SWIG_VERSION} STREQUAL "2.0.1")
+- message(STATUS "SWIG version 2.0.0 exactly is required")
+- return()
+- endif (NOT ${SWIG_VERSION} STREQUAL "2.0.0" AND NOT ${SWIG_VERSION} STREQUAL "2.0.1")
+ endif (RUN_SWIG)
+
+ ###################
diff --git a/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.1-makefile.patch b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.1-makefile.patch
new file mode 100644
index 000000000000..88248b4432f1
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.1-makefile.patch
@@ -0,0 +1,9 @@
+--- scripts/perl/Makefile.PL
++++ scripts/perl/Makefile.PL
+@@ -37,5 +37,6 @@ 'LDFROM' => $ldfrom,
+ 'CC' => $CC,
+ 'LD' => '$(CC)',
+ 'INC' => '-I../../include -I'.$cmakesrcdir.'/include',
++ 'DESTDIR' => @ENV{"D"},
+ 'OBJECT' => 'openbabel-perl.o'
+ );
diff --git a/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-bindings_only.patch b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-bindings_only.patch
new file mode 100644
index 000000000000..92e126a77d86
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-bindings_only.patch
@@ -0,0 +1,108 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 449f4b4..1c9ad00 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -252,7 +252,8 @@ if(NOT MSVC)
+ }
+ " SCANDIR_NEEDS_CONST)
+
+- set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}")
++ set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}"
++ CACHE PATH "Set to system install for bindings only build")
+ add_definitions(-DOB_MODULE_PATH="\\"${OB_MODULE_PATH}\\"")
+
+ # Add some visibility support when using GCC
+@@ -380,7 +381,8 @@ if(UNIX AND BUILD_SHARED)
+ if(APPLE)
+ set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR})
+ else()
+- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
++ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}"
++ CACHE PATH "Set sane rpath")
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+@@ -477,6 +479,13 @@ endif()
+ # Should the language bindings be regenereted?
+ option(RUN_SWIG "Generate language bindings with SWIG" OFF)
+
++# Build bindings only
++option(BINDINGS_ONLY "Build bindings only" OFF)
++
++# Point to library if building bindings only
++set(BABEL_SYSTEM_LIBRARY ${BABEL_LIBRARY}
++ CACHE PATH "Point to openbabel library if building bindings only")
++
+ # Should all bindings be built?
+ option(ALL_BINDINGS "Build all languages bindings" OFF)
+
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index 16e9000..8f92e91 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -92,16 +92,30 @@ if (DO_PYTHON_BINDINGS)
+ endif(RUN_SWIG)
+
+ add_library(bindings_python MODULE ${openbabel_SOURCE_DIR}/scripts/python/openbabel-python.cpp)
+- target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_LIBRARY})
++ if(BINDINGS_ONLY)
++ target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_SYSTEM_LIBRARY})
++ else()
++ target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_LIBRARY})
++ endif()
++
+ if(NOT WIN32)
+ set_target_properties(bindings_python PROPERTIES
+ OUTPUT_NAME _openbabel
+ PREFIX ""
+ SUFFIX .so )
+- add_dependencies(bindings_python openbabel)
+- install(TARGETS bindings_python LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+- install(FILES ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py DESTINATION ${LIB_INSTALL_DIR})
+- install(FILES ${openbabel_SOURCE_DIR}/scripts/python/pybel.py DESTINATION ${LIB_INSTALL_DIR})
++ if(NOT BINDINGS_ONLY)
++ add_dependencies(bindings_python openbabel)
++ endif()
++
++ install(TARGETS bindings_python
++ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
++ install(FILES ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py
++ DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
++ install(FILES ${openbabel_SOURCE_DIR}/scripts/python/pybel.py
++ DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
+ else(NOT WIN32)
+ set_target_properties(bindings_python PROPERTIES
+ OUTPUT_NAME _openbabel
+@@ -231,13 +245,25 @@ if (DO_PERL_BINDINGS)
+ endif (RUN_SWIG)
+
+ add_library(bindings_perl MODULE ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp)
+- target_link_libraries(bindings_perl ${PERL_LIBRARY} ${BABEL_LIBRARY} ${PERL_EXTRA_LINK_FLAGS})
++ if(BINDINGS_ONLY)
++ target_link_libraries(bindings_perl ${PERL_LIBRARY} ${BABEL_SYSTEM_LIBRARY} ${PERL_EXTRA_LINK_FLAGS})
++ else()
++ target_link_libraries(bindings_perl ${PERL_LIBRARY} ${BABEL_LIBRARY} ${PERL_EXTRA_LINK_FLAGS})
++ endif()
++
+ set_target_properties(bindings_perl PROPERTIES
+ PREFIX ""
+ OUTPUT_NAME OpenBabel)
+- add_dependencies(bindings_perl openbabel)
+- install(TARGETS bindings_perl LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+- install(FILES ${openbabel_SOURCE_DIR}/scripts/perl/OpenBabel.pm DESTINATION ${LIB_INSTALL_DIR})
++ if(NOT BINDINGS_ONLY)
++ add_dependencies(bindings_perl openbabel)
++ endif()
++
++ install(TARGETS bindings_perl
++ LIBRARY DESTINATION ${LIB_INSTALL_DIR}/auto/Chemistry/OpenBabel/
++ COMPONENT bindings_perl)
++ install(FILES ${openbabel_SOURCE_DIR}/scripts/perl/OpenBabel.pm
++ DESTINATION ${LIB_INSTALL_DIR}/Chemistry/
++ COMPONENT bindings_perl)
+
+ endif (DO_PERL_BINDINGS)
+
diff --git a/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-trunk_cmake.patch b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-trunk_cmake.patch
new file mode 100644
index 000000000000..b72a622a3afb
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/files/openbabel-perl-2.3.2-trunk_cmake.patch
@@ -0,0 +1,41 @@
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index e7298ce..16e9000 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -231,36 +239,6 @@ if (DO_PERL_BINDINGS)
+ install(TARGETS bindings_perl LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+ install(FILES ${openbabel_SOURCE_DIR}/scripts/perl/OpenBabel.pm DESTINATION ${LIB_INSTALL_DIR})
+
+- set(PERL_INSTALLDIRS_TEXT "")
+- if (OBPERL_INSTALLDIRS)
+- set(PERL_INSTALLDIRS_TEXT "INSTALLDIRS=${OBPERL_INSTALLDIRS}")
+- endif (OBPERL_INSTALLDIRS)
+-
+- if (NOT MSVC)
+- add_custom_target(pre_bindings_perl ALL
+- # Create the scripts/perl directory; we cannot do this inside
+- # bindings_perl as the WORKING_DIRECTORY needs to already exist!
+- COMMAND ${CMAKE_COMMAND} -E make_directory ${openbabel_BINARY_DIR}/scripts/perl
+- )
+- add_custom_target(bindings_perl ALL
+- COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/Makefile.PL ${openbabel_BINARY_DIR}/scripts/perl
+- COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/OpenBabel.pm ${openbabel_BINARY_DIR}/scripts/perl
+- COMMAND ${CMAKE_COMMAND} -E copy ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp ${openbabel_BINARY_DIR}/scripts/perl
+- COMMAND PERL5LIB=${openbabel_SOURCE_DIR}/scripts/perl/inc SRC_DIR=${openbabel_SOURCE_DIR} OBJ_DIR=${openbabel_BINARY_DIR} ${PERL_EXECUTABLE} ${openbabel_BINARY_DIR}/scripts/perl/Makefile.PL ${PERL_PREFIX_TEXT} ${PERL_INSTALLDIRS_TEXT}
+- COMMAND PERL5LIB=${openbabel_SOURCE_DIR}/scripts/perl/inc make
+- DEPENDS openbabel ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp
+- WORKING_DIRECTORY ${openbabel_BINARY_DIR}/scripts/perl
+- )
+- add_dependencies(bindings_perl pre_bindings_perl openbabel)
+- install(CODE "execute_process(COMMAND make install DESTDIR=\$ENV{DESTDIR} WORKING_DIRECTORY ${openbabel_BINARY_DIR}/scripts/perl)")
+-
+- else (NOT MSVC)
+- add_library(bindings_perl MODULE ${openbabel_SOURCE_DIR}/scripts/perl/openbabel-perl.cpp)
+- target_link_libraries(bindings_perl ${PERL_LIBRARY} ${BABEL_LIBRARY})
+- set_target_properties(bindings_perl PROPERTIES
+- OUTPUT_NAME openbabel_perl )
+- endif(NOT MSVC)
+-
+ endif (DO_PERL_BINDINGS)
+
+ ###################
diff --git a/sci-chemistry/openbabel-perl/metadata.xml b/sci-chemistry/openbabel-perl/metadata.xml
new file mode 100644
index 000000000000..068b6b2c4442
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/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-chemistry</herd>
+ <longdescription>
+OpenBabel is a chemical toolbox designed to speak the many languages of
+chemical data. It's an open, collaborative project allowing anyone to
+search, convert, analyze, or store data from molecular modeling, chemistry,
+solid-state materials, biochemistry, or related areas.
+This package enables to access OpenBabel library from Perl programs.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">openbabel</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/openbabel-perl/openbabel-perl-2.3.2.ebuild b/sci-chemistry/openbabel-perl/openbabel-perl-2.3.2.ebuild
new file mode 100644
index 000000000000..71a41ba76d7d
--- /dev/null
+++ b/sci-chemistry/openbabel-perl/openbabel-perl-2.3.2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils eutils perl-module
+
+DESCRIPTION="Perl bindings for OpenBabel"
+HOMEPAGE="http://openbabel.sourceforge.net/"
+SRC_URI="mirror://sourceforge/openbabel/openbabel-${PV}.tar.gz"
+
+KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+RDEPEND="
+ dev-lang/perl:=
+ ~sci-chemistry/openbabel-${PV}"
+DEPEND="${RDEPEND}
+ >=dev-util/cmake-2.4.8
+ >=dev-lang/swig-2"
+
+S="${WORKDIR}/openbabel-${PV}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-trunk_cmake.patch \
+ "${FILESDIR}"/${P}-bindings_only.patch
+ perl_set_version
+}
+
+src_configure() {
+ local mycmakeargs="${mycmakeargs}
+ -DCMAKE_INSTALL_RPATH=
+ -DBINDINGS_ONLY=ON
+ -DBABEL_SYSTEM_LIBRARY="${EPREFIX}/usr/$(get_libdir)/libopenbabel.so"
+ -DOB_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/openbabel/${PV}"
+ -DLIB_INSTALL_DIR="${D}/${VENDOR_ARCH}"
+ -DPERL_BINDINGS=ON
+ -DRUN_SWIG=ON"
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile bindings_perl
+}
+
+src_test() {
+ mkdir "${CMAKE_BUILD_DIR}/$(get_libdir)/Chemistry"
+ cp \
+ "${CMAKE_USE_DIR}/scripts/perl/OpenBabel.pm" \
+ "${CMAKE_BUILD_DIR}/$(get_libdir)/Chemistry/"
+ for i in "${CMAKE_USE_DIR}"/scripts/perl/t/*; do
+ einfo "Running test: ${i}"
+ perl -I"${CMAKE_BUILD_DIR}/$(get_libdir)" "${i}" || die
+ done
+}
+
+src_install() {
+ cd "${CMAKE_BUILD_DIR}"
+ cmake -DCOMPONENT=bindings_perl -P cmake_install.cmake
+}
diff --git a/sci-chemistry/openbabel-python/Manifest b/sci-chemistry/openbabel-python/Manifest
new file mode 100644
index 000000000000..082e5b029843
--- /dev/null
+++ b/sci-chemistry/openbabel-python/Manifest
@@ -0,0 +1 @@
+DIST openbabel-2.3.2.tar.gz 20509105 SHA256 4eaca26679aa6cc85ebf96af19191472ac63ca442c36b0427b369c3a25705188 SHA512 d0e1f8b758ffdd65ec6c31d988bffe3279355e286ce69fad12c5905b3b832e2b73ee95b1061b1576aba1ee9fe4da5e31ec30350c473be17493c657dc80caf919 WHIRLPOOL 74eff18b73d24c8f702e5573a58ba6afba8402e9ce8782de95dc0568575a7d2d632dbc8e8a98b3cd25efdfa7379494f7dcd449342c81ddf73f42a387bce77aaa
diff --git a/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-bindings_only.patch b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-bindings_only.patch
new file mode 100644
index 000000000000..2e776b4029ec
--- /dev/null
+++ b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-bindings_only.patch
@@ -0,0 +1,209 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 449f4b4..1c9ad00 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -252,7 +252,8 @@ if(NOT MSVC)
+ }
+ " SCANDIR_NEEDS_CONST)
+
+- set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}")
++ set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}"
++ CACHE PATH "Set to system install for bindings only build")
+ add_definitions(-DOB_MODULE_PATH="\\"${OB_MODULE_PATH}\\"")
+
+ # Add some visibility support when using GCC
+@@ -380,7 +381,8 @@ if(UNIX AND BUILD_SHARED)
+ if(APPLE)
+ set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR})
+ else()
+- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
++ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}"
++ CACHE PATH "Set sane rpath")
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+@@ -477,6 +479,13 @@ endif()
+ # Should the language bindings be regenereted?
+ option(RUN_SWIG "Generate language bindings with SWIG" OFF)
+
++# Build bindings only
++option(BINDINGS_ONLY "Build bindings only" OFF)
++
++# Point to library if building bindings only
++set(BABEL_SYSTEM_LIBRARY ${BABEL_LIBRARY}
++ CACHE PATH "Point to openbabel library if building bindings only")
++
+ # Should all bindings be built?
+ option(ALL_BINDINGS "Build all languages bindings" OFF)
+
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index 16e9000..ecd2295 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -92,16 +92,30 @@ if (DO_PYTHON_BINDINGS)
+ endif(RUN_SWIG)
+
+ add_library(bindings_python MODULE ${openbabel_SOURCE_DIR}/scripts/python/openbabel-python.cpp)
+- target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_LIBRARY})
++ if(BINDINGS_ONLY)
++ target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_SYSTEM_LIBRARY})
++ else()
++ target_link_libraries(bindings_python ${PYTHON_LIBRARIES} ${BABEL_LIBRARY})
++ endif()
++
+ if(NOT WIN32)
+ set_target_properties(bindings_python PROPERTIES
+ OUTPUT_NAME _openbabel
+ PREFIX ""
+ SUFFIX .so )
+- add_dependencies(bindings_python openbabel)
+- install(TARGETS bindings_python LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+- install(FILES ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py DESTINATION ${LIB_INSTALL_DIR})
+- install(FILES ${openbabel_SOURCE_DIR}/scripts/python/pybel.py DESTINATION ${LIB_INSTALL_DIR})
++ if(NOT BINDINGS_ONLY)
++ add_dependencies(bindings_python openbabel)
++ endif()
++
++ install(TARGETS bindings_python
++ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
++ install(FILES ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py
++ DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
++ install(FILES ${openbabel_SOURCE_DIR}/scripts/python/pybel.py
++ DESTINATION ${LIB_INSTALL_DIR}
++ COMPONENT bindings_python)
+ else(NOT WIN32)
+ set_target_properties(bindings_python PROPERTIES
+ OUTPUT_NAME _openbabel
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 7841782..6f3495f 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -2,7 +2,12 @@
+ add_definitions(-DTESTDATADIR="\\"${CMAKE_SOURCE_DIR}/test/files/\\"")
+
+ # define FORMATDIR for location of format plugin binaries
+-add_definitions(-DFORMATDIR="\\"${openbabel_BINARY_DIR}/lib/\\"")
++if(BINDINGS_ONLY)
++ set(FORMATDIR "${OB_MODULE_PATH}/")
++else()
++ set(FORMATDIR "${openbabel_BINARY_DIR}/lib${LIB_SUFFIX}/")
++endif()
++add_definitions(-DFORMATDIR="\\"${FORMATDIR}/\\"")
+
+ ###########################################################
+ # new tests using obtest.h
+@@ -89,7 +94,7 @@ foreach(test ${tests})
+ add_test(${test}_Test ${TEST_PATH}/test_${test})
+ set_tests_properties(${test}_Test PROPERTIES
+ FAIL_REGULAR_EXPRESSION "ERROR;FAIL;Test failed"
+- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
++ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}")
+ endforeach(test ${tests})
+
+ ############################################################
+@@ -152,7 +157,7 @@ if(WITH_INCHI)
+ ${TEST_PATH}/test_inchiwrite ${inchidata}/${test} ${inchidata}/${test}.txt)
+ set_tests_properties(inchi${test}_Test PROPERTIES
+ FAIL_REGULAR_EXPRESSION "Not ok"
+- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
++ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ )
+ endforeach(test ${inchitests})
+ endif(WITH_INCHI)
+@@ -166,7 +171,7 @@ foreach(test ${old_tests})
+ add_test(${test}_Test ${TEST_PATH}/test_${test})
+ set_tests_properties(${test}_Test PROPERTIES
+ FAIL_REGULAR_EXPRESSION "not ok"
+- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
++ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ )
+ endforeach(test ${old_tests})
+
+@@ -181,8 +186,8 @@ if(NOT BUILD_SHARED AND NOT BUILD_MIXED)
+ endif()
+ install(TARGETS roundtrip
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+
+ ###########################
+@@ -199,10 +204,10 @@ if(NOT MINGW AND NOT CYGWIN)
+ babel sym smartssym fastsearch unique kekule)
+ foreach(pytest ${pytests})
+ SET_SOURCE_FILES_PROPERTIES(test${pytest}.py PROPERTIES
+- PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib"
+- BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib"
++ PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
++ BABEL_LIBDIR "${FORMATDIR}"
+ BABEL_DATADIR "${CMAKE_SOURCE_DIR}/data"
+- LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib"
++ LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ )
+ ADD_PYTHON_TEST(pytest_${pytest} test${pytest}.py)
+ set_tests_properties(pytest_${pytest} PROPERTIES
+@@ -221,10 +226,10 @@ if (PYTHON_BINDINGS)
+ bindings _pybel example)
+ foreach(pybindtest ${pybindtests})
+ SET_SOURCE_FILES_PROPERTIES(test${pybindtest}.py PROPERTIES
+- PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib"
+- BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib"
++ PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
++ BABEL_LIBDIR "${FORMATDIR}"
+ BABEL_DATADIR "${CMAKE_SOURCE_DIR}/data"
+- LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib"
++ LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ )
+ if(MSVC)
+ SET_SOURCE_FILES_PROPERTIES(test${pybindtest}.py PROPERTIES
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index 1f547bf..fb98441 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -38,8 +38,8 @@ if(BUILD_SHARED)
+ target_link_libraries(${tool} ${BABEL_LIBRARY})
+ install(TARGETS ${tool}
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ endforeach(tool)
+
+@@ -53,8 +53,8 @@ if(BUILD_SHARED)
+ target_link_libraries(obspectrophore ${BABEL_LIBRARY})
+ install(TARGETS obspectrophore
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+
+ # obgrep -- requires getopt
+@@ -66,8 +66,8 @@ if(BUILD_SHARED)
+ target_link_libraries(obgrep ${BABEL_LIBRARY})
+ install(TARGETS obgrep
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ endif(NOT MINIMAL_BUILD)
+
+@@ -146,7 +146,7 @@ else(BUILD_SHARED)
+
+ install(TARGETS babel
+ RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib)
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
+
+ endif(BUILD_SHARED)
diff --git a/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-swig-3.0.3.patch b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-swig-3.0.3.patch
new file mode 100644
index 000000000000..d30efd55bd92
--- /dev/null
+++ b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-swig-3.0.3.patch
@@ -0,0 +1,97 @@
+ scripts/openbabel-python.i | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/scripts/openbabel-python.i b/scripts/openbabel-python.i
+index 7cb8f24..d893129 100644
+--- a/scripts/openbabel-python.i
++++ b/scripts/openbabel-python.i
+@@ -227,7 +227,7 @@ CAST_GENERICDATA_TO(SquarePlanarStereo)
+ %include <openbabel/math/transform3d.h>
+ %include <openbabel/math/spacegroup.h>
+
+-# CloneData should be used instead of the following method
++// CloneData should be used instead of the following method
+ %ignore OpenBabel::OBBase::SetData;
+ %include <openbabel/base.h>
+
+@@ -289,7 +289,7 @@ OBMol.BeginResidues = OBMol.EndResidues = OBMol.BeginResidue = OBMol.EndResidue
+ %ignore OpenBabel::OBDescriptor::LessThan;
+ %include <openbabel/descriptor.h>
+
+-# Ignore shadowed methods
++// Ignore shadowed methods
+ %ignore OpenBabel::OBForceField::VectorSubtract(const double *const, const double *const, double *);
+ %ignore OpenBabel::OBForceField::VectorMultiply(const double *const, const double, double *);
+ %include <openbabel/forcefield.h>
+@@ -310,7 +310,7 @@ OBMol.BeginResidues = OBMol.EndResidues = OBMol.BeginResidue = OBMol.EndResidue
+
+ %warnfilter(503) OpenBabel::OBBitVec; // Not wrapping any of the overloaded operators
+ %include <openbabel/bitvec.h>
+-# Ignore shadowed method
++// Ignore shadowed method
+ %ignore OpenBabel::OBRotor::GetRotAtoms() const;
+ %include <openbabel/rotor.h>
+ %ignore OpenBabel::Swab;
+@@ -321,13 +321,13 @@ OBMol.BeginResidues = OBMol.EndResidues = OBMol.BeginResidue = OBMol.EndResidue
+ %include <openbabel/math/align.h>
+ #endif
+
+-# The following %ignores avoid warning messages due to shadowed classes.
+-# This does not imply a loss of functionality as (in this case)
+-# the shadowed class is identical (from the point of view of SWIG) to
+-# the shadowing class.
+-# This is because C++ references (&) are transformed by SWIG back into
+-# pointers, so that OBAtomIter(OBMol &) would be treated the same as
+-# OBAtomIter(OBMol *).
++// The following %ignores avoid warning messages due to shadowed classes.
++// This does not imply a loss of functionality as (in this case)
++// the shadowed class is identical (from the point of view of SWIG) to
++// the shadowing class.
++// This is because C++ references (&) are transformed by SWIG back into
++// pointers, so that OBAtomIter(OBMol &) would be treated the same as
++// OBAtomIter(OBMol *).
+
+ %ignore OBAtomAtomIter(OBAtom &);
+ %ignore OBAtomBondIter(OBAtom &);
+@@ -346,9 +346,9 @@ OBMol.BeginResidues = OBMol.EndResidues = OBMol.BeginResidue = OBMol.EndResidue
+ %ignore OBResidueIter(OBMol &);
+ %ignore OBResidueAtomIter(OBResidue &);
+
+-# These classes are renamed so that they can be replaced by Python
+-# classes of the same name which provide Pythonic iterators
+-# (see %pythoncode section below)
++// These classes are renamed so that they can be replaced by Python
++// classes of the same name which provide Pythonic iterators
++// (see %pythoncode section below)
+
+ %rename(_OBAtomAtomIter) OpenBabel::OBAtomAtomIter;
+ %rename(_OBAtomBondIter) OpenBabel::OBAtomBondIter;
+@@ -367,8 +367,8 @@ OBMol.BeginResidues = OBMol.EndResidues = OBMol.BeginResidue = OBMol.EndResidue
+
+ %include <openbabel/obiter.h>
+
+-# The following class, OBiter, is subclassed to provide Python iterators
+-# equivalent to the C++ iterators in obiter.h and the plugin iterators
++// The following class, OBiter, is subclassed to provide Python iterators
++// equivalent to the C++ iterators in obiter.h and the plugin iterators
+
+ %pythoncode %{
+ class OBIter(object):
+@@ -459,7 +459,7 @@ def double_array(mylist):
+ return c
+ %}
+
+-# Copy some of the global variables in cvar into the openbabel namespace
++// Copy some of the global variables in cvar into the openbabel namespace
+
+ %pythoncode %{
+ obErrorLog = cvar.obErrorLog
+@@ -470,7 +470,7 @@ atomtyper = cvar.atomtyper
+ aromtyper = cvar.aromtyper
+ %}
+
+-# Functions to set the log file to std::cout and std::cerr
++// Functions to set the log file to std::cout and std::cerr
+
+ %ignore OBForceField::SetLogFile(std::ostream *pos);
+ %extend OpenBabel::OBForceField {
diff --git a/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-testpybel.patch b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-testpybel.patch
new file mode 100644
index 000000000000..7a0114975fff
--- /dev/null
+++ b/sci-chemistry/openbabel-python/files/openbabel-python-2.3.2-testpybel.patch
@@ -0,0 +1,28 @@
+From b34edb6de512e5735d87cb0893804a4abd14f9b7 Mon Sep 17 00:00:00 2001
+From: baoilleach <baoilleach@71e0b675-c112-0410-beda-96664073b5c2>
+Date: Mon, 1 Oct 2012 20:40:36 +0000
+Subject: [PATCH] scripts/python/testpybel.py: Minor fix to enable failing
+ test to pass. Failures due to the new MOL Chiral Flag data
+ that I stored a while ago.
+
+git-svn-id: https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk@5022 71e0b675-c112-0410-beda-96664073b5c2
+---
+ scripts/python/examples/testpybel.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/python/examples/testpybel.py b/scripts/python/examples/testpybel.py
+index aa5fcd4..7951851 100644
+--- a/scripts/python/examples/testpybel.py
++++ b/scripts/python/examples/testpybel.py
+@@ -336,7 +336,7 @@ class TestPybel(TestToolkit):
+ tpsaname = "TPSA"
+ Nbits = 3
+ Nfpbits = 32
+- datakeys = ['NSC', 'Comment', 'OpenBabel Symmetry Classes']
++ datakeys = ['NSC', 'Comment', 'OpenBabel Symmetry Classes', 'MOL Chiral Flag']
+
+ def testFP_FP3(self):
+ "Checking the results from FP3"
+--
+1.7.12.3
+
diff --git a/sci-chemistry/openbabel-python/metadata.xml b/sci-chemistry/openbabel-python/metadata.xml
new file mode 100644
index 000000000000..2fec701db8fc
--- /dev/null
+++ b/sci-chemistry/openbabel-python/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-chemistry</herd>
+ <longdescription>
+OpenBabel is a chemical toolbox designed to speak the many languages of
+chemical data. It's an open, collaborative project allowing anyone to
+search, convert, analyze, or store data from molecular modeling, chemistry,
+solid-state materials, biochemistry, or related areas. This package enables
+to access OpenBabel library from Python programs.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">openbabel</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/openbabel-python/openbabel-python-2.3.2.ebuild b/sci-chemistry/openbabel-python/openbabel-python-2.3.2.ebuild
new file mode 100644
index 000000000000..593e536eb844
--- /dev/null
+++ b/sci-chemistry/openbabel-python/openbabel-python-2.3.2.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit cmake-utils eutils multilib python-r1
+
+DESCRIPTION="Python bindings for OpenBabel (including Pybel)"
+HOMEPAGE="http://openbabel.sourceforge.net/"
+SRC_URI="mirror://sourceforge/openbabel/openbabel-${PV}.tar.gz"
+
+KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ !sci-chemistry/babel
+ ~sci-chemistry/openbabel-${PV}
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ >=dev-lang/swig-2"
+
+S="${WORKDIR}"/openbabel-${PV}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-testpybel.patch
+ "${FILESDIR}"/${P}-bindings_only.patch
+ "${FILESDIR}"/${P}-swig-3.0.3.patch
+ )
+
+src_prepare() {
+ cmake-utils_src_prepare
+ sed \
+ -e "s:\"\.\.\":\"${EPREFIX}/usr\":g" \
+ -i test/testbabel.py || die
+ swig -python -c++ -small -O -templatereduce -naturalvar \
+ -I"${EPREFIX}/usr/include/openbabel-2.0" \
+ -o scripts/python/openbabel-python.cpp \
+ -DHAVE_EIGEN \
+ -outdir scripts/python \
+ scripts/openbabel-python.i \
+ || die "Regeneration of openbabel-python.cpp failed"
+}
+
+src_configure() {
+ my_impl_src_configure() {
+ local mycmakeargs="${mycmakeargs}
+ -DCMAKE_INSTALL_RPATH=
+ -DBINDINGS_ONLY=ON
+ -DBABEL_SYSTEM_LIBRARY="${EPREFIX}/usr/$(get_libdir)/libopenbabel.so"
+ -DOB_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/openbabel/${PV}"
+ -DLIB_INSTALL_DIR="${ED}/usr/$(get_libdir)/${EPYTHON}/site-packages"
+ -DPYTHON_BINDINGS=ON
+ -DPYTHON_EXECUTABLE=${PYTHON}
+ -DPYTHON_INCLUDE_DIR="${EPREFIX}/usr/include/${EPYTHON}"
+ -DPYTHON_INCLUDE_PATH="${EPREFIX}/usr/include/${EPYTHON}"
+ -DPYTHON_LIBRARY="${EPREFIX}/usr/$(get_libdir)/lib${EPYTHON}.so"
+ -DENABLE_TESTS=ON"
+
+ cmake-utils_src_configure
+ }
+
+ python_foreach_impl my_impl_src_configure
+}
+
+src_compile() {
+ python_foreach_impl cmake-utils_src_make bindings_python
+}
+
+src_test() {
+ python_foreach_impl cmake-utils_src_test -R py
+}
+
+src_install() {
+ my_impl_src_install() {
+ cd "${BUILD_DIR}" || die
+
+ cmake -DCOMPONENT=bindings_python -P cmake_install.cmake
+
+ python_optimize
+ }
+
+ python_foreach_impl my_impl_src_install
+}
diff --git a/sci-chemistry/openbabel/Manifest b/sci-chemistry/openbabel/Manifest
new file mode 100644
index 000000000000..082e5b029843
--- /dev/null
+++ b/sci-chemistry/openbabel/Manifest
@@ -0,0 +1 @@
+DIST openbabel-2.3.2.tar.gz 20509105 SHA256 4eaca26679aa6cc85ebf96af19191472ac63ca442c36b0427b369c3a25705188 SHA512 d0e1f8b758ffdd65ec6c31d988bffe3279355e286ce69fad12c5905b3b832e2b73ee95b1061b1576aba1ee9fe4da5e31ec30350c473be17493c657dc80caf919 WHIRLPOOL 74eff18b73d24c8f702e5573a58ba6afba8402e9ce8782de95dc0568575a7d2d632dbc8e8a98b3cd25efdfa7379494f7dcd449342c81ddf73f42a387bce77aaa
diff --git a/sci-chemistry/openbabel/files/openbabel-2.3.2-test_lib_path.patch b/sci-chemistry/openbabel/files/openbabel-2.3.2-test_lib_path.patch
new file mode 100644
index 000000000000..1354f52685c6
--- /dev/null
+++ b/sci-chemistry/openbabel/files/openbabel-2.3.2-test_lib_path.patch
@@ -0,0 +1,27 @@
+diff -ru old/openbabel-2.3.0/test/CMakeLists.txt new/openbabel-2.3.0/test/CMakeLists.txt
+--- old/openbabel-2.3.0/test/CMakeLists.txt 2010-10-26 17:39:01.000000000 +0300
++++ new/openbabel-2.3.0/test/CMakeLists.txt 2010-11-14 18:13:32.000000000 +0200
+@@ -2,7 +2,7 @@
+ add_definitions(-DTESTDATADIR="\\"${CMAKE_SOURCE_DIR}/test/files/\\"")
+
+ # define FORMATDIR for location of format plugin binaries
+-add_definitions(-DFORMATDIR="\\"${openbabel_BINARY_DIR}/lib/\\"")
++add_definitions(-DFORMATDIR="\\"${openbabel_BINARY_DIR}/lib${LIB_SUFFIX}/\\"")
+
+ ###########################################################
+ # new tests using obtest.h
+@@ -32,12 +35,12 @@ set(tests
+ uniqueid
+ )
+
+-if (EIGEN2_FOUND)
++if(EIGEN2_FOUND OR EIGEN3_FOUND)
+ set(tests
+ align
+ ${tests}
+ )
+-endif (EIGEN2_FOUND)
++endif()
+
+ set(TEST_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
diff --git a/sci-chemistry/openbabel/metadata.xml b/sci-chemistry/openbabel/metadata.xml
new file mode 100644
index 000000000000..3353dfa452a4
--- /dev/null
+++ b/sci-chemistry/openbabel/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-chemistry</herd>
+ <longdescription>
+ Open Babel is a chemical toolbox designed to speak the many languages of
+ chemical data. It's an open, collaborative project allowing anyone to
+ search, convert, analyze, or store data from molecular modeling, chemistry,
+ solid-state materials, biochemistry, or related areas.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">openbabel</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/openbabel/openbabel-2.3.2.ebuild b/sci-chemistry/openbabel/openbabel-2.3.2.ebuild
new file mode 100644
index 000000000000..c0a06edd6006
--- /dev/null
+++ b/sci-chemistry/openbabel/openbabel-2.3.2.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER="2.8"
+
+inherit cmake-utils eutils wxwidgets
+
+DESCRIPTION="Interconverts file formats used in molecular modeling"
+HOMEPAGE="http://openbabel.sourceforge.net/"
+SRC_URI="mirror://sourceforge/openbabel/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="doc openmp test wxwidgets"
+
+RDEPEND="
+ !sci-chemistry/babel
+ dev-cpp/eigen:3
+ dev-libs/libxml2:2
+ sci-libs/inchi
+ sys-libs/zlib
+ wxwidgets? ( x11-libs/wxGTK:2.8[X] )"
+DEPEND="${RDEPEND}
+ >=dev-util/cmake-2.4.8
+ doc? ( app-doc/doxygen )"
+
+DOCS="AUTHORS ChangeLog NEWS README THANKS doc/*.inc doc/README* doc/*.mol2"
+
+PATCHES=( "${FILESDIR}"/${P}-test_lib_path.patch )
+
+pkg_setup() {
+ if use openmp; then
+ if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
+ ewarn "OpenMP is not available in your current selected gcc"
+ die "need openmp capable gcc"
+ fi
+ FORTRAN_NEED_OPENMP=1
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=""
+ mycmakeargs="${mycmakeargs}
+ -DOPENBABEL_USE_SYSTEM_INCHI=ON
+ $(cmake-utils_use_enable openmp OPENMP)
+ $(cmake-utils_use wxwidgets BUILD_GUI)"
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ dohtml doc/{*.html,*.png}
+ if use doc ; then
+ insinto /usr/share/doc/${PF}/API/html
+ doins doc/API/html/*
+ fi
+
+ cmake-utils_src_install
+}
+
+src_test() {
+ local mycmakeargs=""
+ mycmakeargs="${mycmakeargs}
+ -DOPENBABEL_USE_SYSTEM_INCHI=ON
+ -DPYTHON_EXECUTABLE=false
+ $(cmake-utils_use_enable openmp OPENMP)
+ $(cmake-utils_use wxwidgets BUILD_GUI)
+ $(cmake-utils_use_enable test TESTS)"
+
+ cmake-utils_src_configure
+ cmake-utils_src_compile
+ cmake-utils_src_test -E py
+}
+
+pkg_postinst() {
+ optfeature "perl support" sci-chemistry/openbabel-perl
+ optfeature "python support" sci-chemistry/openbabel-python
+}
diff --git a/sci-chemistry/ortep3/Manifest b/sci-chemistry/ortep3/Manifest
new file mode 100644
index 000000000000..97e21c481c22
--- /dev/null
+++ b/sci-chemistry/ortep3/Manifest
@@ -0,0 +1 @@
+DIST ortep.f 177237 SHA256 622cdd2801d3959c08f71514de865cc18511fd8522b0b229467d0387047fc374
diff --git a/sci-chemistry/ortep3/metadata.xml b/sci-chemistry/ortep3/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/ortep3/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/ortep3/ortep3-1.0.3-r1.ebuild b/sci-chemistry/ortep3/ortep3-1.0.3-r1.ebuild
new file mode 100644
index 000000000000..3850c40e6854
--- /dev/null
+++ b/sci-chemistry/ortep3/ortep3-1.0.3-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit fortran-2 toolchain-funcs
+
+DESCRIPTION="Thermal ellipsoid plot program for crystal structure illustrations"
+HOMEPAGE="http://www.ornl.gov/sci/ortep/"
+SRC_URI="ftp://ftp.ornl.gov/pub/ortep/src/ortep.f"
+
+SLOT="0"
+LICENSE="public-domain"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ sci-libs/pgplot
+ x11-libs/libX11"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ cp "${DISTDIR}"/${A} "${S}" || die
+}
+
+src_compile() {
+ COMMAND="$(tc-getFC) ${FFLAGS:- -O2} ${LDFLAGS} -o ${PN} ortep.f -lpgplot -lX11"
+ echo ${COMMAND}
+ ${COMMAND} || die "Compilation failed"
+}
+
+src_install() {
+ dobin ${PN}
+}
diff --git a/sci-chemistry/p3d/Manifest b/sci-chemistry/p3d/Manifest
new file mode 100644
index 000000000000..9b2f9b5b9c4d
--- /dev/null
+++ b/sci-chemistry/p3d/Manifest
@@ -0,0 +1 @@
+DIST p3d-0.4.3.tar.gz 7213577 RMD160 2a251097bf7f83b27e519b20e4110fe330b2b6a3 SHA1 ced099dcaa28517c6095c1153f3a19bb6c78494c SHA256 b968eb37c0d27ad1f4f46f8a942fb2b62fbcdb50b31a1e66875e2cdc036a9932
diff --git a/sci-chemistry/p3d/metadata.xml b/sci-chemistry/p3d/metadata.xml
new file mode 100644
index 000000000000..bd602bd0e68a
--- /dev/null
+++ b/sci-chemistry/p3d/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+p3d was developed in order to offer a Python module that is powerful and fast,
+yet intuitive to use. The simplicity of p3d is due to the usage of object
+oriented programming (i.e. atoms are treated as vectors), the implementation
+of a query parser that translates queries readable by humans into a combination
+of algebra set operations the fact that no additional Python packages are
+necessary. The speed is due to the usage of a binary space partitioning (BSP)
+tree which allows very fast queries in 3D (Henry et al. 1980). The additional
+synergy is obtained by the flexible combination of both speed and complexity in
+the queries to the structural data. The combination of these factors makes p3d
+the optimal module to rapidly develop new and powerful bioinformatic tools that
+follow the Python philosophy of making the source code readable.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/p3d/p3d-0.4.3.ebuild b/sci-chemistry/p3d/p3d-0.4.3.ebuild
new file mode 100644
index 000000000000..294acb075860
--- /dev/null
+++ b/sci-chemistry/p3d/p3d-0.4.3.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit distutils versionator
+
+MY_P="${PN}-$(replace_version_separator 3 -)"
+GITHUB_ID="gb8b9a75"
+
+DESCRIPTION="Python module for structural bioinformatics"
+HOMEPAGE="http://p3d.fufezan.net/"
+SRC_URI="https://nodeload.github.com/fu/${PN}/tarball/${PV} -> ${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="GPL-3"
+IUSE="examples"
+
+src_prepare() {
+ mv fu* ${P}
+ distutils_src_prepare
+}
+
+src_install() {
+ distutils_src_install
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r pdbs exampleScripts || die
+ fi
+}
diff --git a/sci-chemistry/p3d/p3d-9999.ebuild b/sci-chemistry/p3d/p3d-9999.ebuild
new file mode 100644
index 000000000000..e0f8087a0cc2
--- /dev/null
+++ b/sci-chemistry/p3d/p3d-9999.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit git-2 distutils versionator
+
+DESCRIPTION="Python module for structural bioinformatics"
+HOMEPAGE="http://p3d.fufezan.net/"
+SRC_URI=""
+EGIT_REPO_URI="git://github.com/fu/p3d.git"
+
+SLOT="0"
+KEYWORDS=""
+LICENSE="GPL-3"
+IUSE="examples"
+
+S="${WORKDIR}"/${PN}
+
+src_install() {
+ distutils_src_install
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r pdbs exampleScripts || die
+ fi
+}
diff --git a/sci-chemistry/parassign/Manifest b/sci-chemistry/parassign/Manifest
new file mode 100644
index 000000000000..d4edb48300ce
--- /dev/null
+++ b/sci-chemistry/parassign/Manifest
@@ -0,0 +1 @@
+DIST PARAssign_Linux_x64_86.tgz 76693208 SHA256 56a322a8825c13cd3e7d90998471c47fb6062e79e2d20108b4fb6ed24664c89d SHA512 63018b0f1e3ce7821cebb90cd59ef5fdfa44b7ce6776956184b55a6247009f5e9df435332772dfa0db7294308c4d930ff0104daf45a46df709fb132dac10bd79 WHIRLPOOL 87ae85974f2a84c3814d261390e011f7ef2a012881df15f0f8ba4a7b5e88992e7932f12566847eaa38958394f7a243a4f0d536375e4640377d6f183e793bccc5
diff --git a/sci-chemistry/parassign/metadata.xml b/sci-chemistry/parassign/metadata.xml
new file mode 100644
index 000000000000..144ad6d646ca
--- /dev/null
+++ b/sci-chemistry/parassign/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+The use of paramagnetic NMR data for the refinement of structures of proteins
+and protein complexes is widespread. However, the power of paramagnetism for
+protein assignment has not yet been fully exploited. PARAssign is software that
+uses pseudocontact shift data derived from several paramagnetic centers attached
+to the protein to obtain amide and methyl assignments. The ability of PARAssign
+to perform assignment when the positions of the paramagnetic centers are known
+and unknown is demonstrated. PARAssign has been tested using synthetic data for
+methyl assignment of a 47 kDa protein, and using both synthetic and experimental
+data for amide assignment of a 14 kDa protein. The complex fitting space
+involved in such an assignment procedure necessitates that good starting
+conditions are found, both regarding placement and strength of paramagnetic
+centers. These starting conditions are obtained through automated tensor
+placement and user-defined tensor parameters. The results presented herein
+demonstrate that PARAssign is able to successfully perform resonance assignment
+in large systems with a high degree of reliability. This software provides a
+method for obtaining the assignments of large systems, which may previously have
+been unassignable, by using 2D NMR spectral data and a known protein structure.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/parassign/parassign-20130522.ebuild b/sci-chemistry/parassign/parassign-20130522.ebuild
new file mode 100644
index 000000000000..8ecbd0060d10
--- /dev/null
+++ b/sci-chemistry/parassign/parassign-20130522.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 python-r1
+
+DESCRIPTION="Assign protein nuclei solely on the basis of pseudocontact shifts (PCS)"
+HOMEPAGE="http://protchem.lic.leidenuniv.nl/software/parassign/registration"
+SRC_URI="PARAssign_Linux_x64_86.tgz"
+RESTRICT="fetch"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ dev-python/cython[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/scientificpython[${PYTHON_USEDEP}]
+ sci-biology/biopython[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]"
+
+S="${WORKDIR}"/PARAssign_Linux_x64_86/
+
+src_prepare() {
+ sed \
+ -e '1i#!/usr/bin/python2' \
+ -i code/*py || die
+
+ if use x86; then
+ sed \
+ -e "s:munkres64:munkres:g" \
+ -i modules/setup.py || die
+ elif use amd64; then
+ sed \
+ -e "s:munkres:munkres64:g" \
+ -i code/*py || die
+ fi
+ cd modules || die
+ rm *o *c || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ cd modules || die
+ distutils-r1_src_compile
+}
+
+src_install() {
+ python_parallel_foreach_impl python_doscript code/* || die
+
+ dodoc PARAssign_Tutorial.pdf README
+
+ cd modules || die
+ distutils-r1_src_install
+}
diff --git a/sci-chemistry/pdb-extract/Manifest b/sci-chemistry/pdb-extract/Manifest
new file mode 100644
index 000000000000..328a586d96cd
--- /dev/null
+++ b/sci-chemistry/pdb-extract/Manifest
@@ -0,0 +1,2 @@
+DIST pdb-extract-v3.004-prod-src.tar.gz 942450 RMD160 3d5d46e668a52109678fdf59afbe664dac1643f9 SHA1 7b5d7ce200d33e68fa352cd3658e382bc37e9768 SHA256 58bef2aba4869cdd16a79ddc588da5596a2ccd1f5c925f300b63b6d8299bb953
+DIST pdb-extract-v3.11-prod-src.tar.gz 1016140 RMD160 8845b8ec69b398c22fc398df34d056ed11c1f085 SHA1 4fb471068c220cbae9cbf0a8116fcb288c28b36b SHA256 cc56ab58e4b4f0914dcd61834cae673ade5b12688861ea5f0197a33f5939d131
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.004-Makefile.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-Makefile.patch
new file mode 100644
index 000000000000..3a6f5498ffba
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-Makefile.patch
@@ -0,0 +1,46 @@
+--- Makefile 2008-12-05 14:36:44.000000000 +0100
++++ Makefile.new 2008-12-05 14:37:21.000000000 +0100
+@@ -19,13 +19,7 @@
+ CHECKOUT_SCRIPT_MODULE = util
+ CHECKOUT_SCRIPT = checkout.sh
+
+-LIBDIRS = cifobj-common-v4.1 \
+- tables-v8.0 \
+- regex-v2.2 \
+- cif-file-v1.0 \
+- misclib-v2.2 \
+- cifparse-obj-v7.0 \
+- $(EXTRACT)
++LIBDIRS = $(EXTRACT)
+
+ all: compile
+
+--- pdb-extract-v3.0/Makefile 2008-12-05 14:42:58.000000000 +0100
++++ pdb-extract-v3.0/Makefile.new 2008-12-05 14:42:15.510315392 +0100
+@@ -6,6 +6,7 @@
+
+ M_INCL_DIR = ../include
+ M_LIB_DIR = ../lib
++M_LIB_DIR_GENTOO = @GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR
+ M_BIN_DIR = ../bin
+
+ PROJ_DIR = .
+@@ -37,12 +38,12 @@
+ include ../etc/Makefile.platform
+
+ # Dependent libraries for the pdbml-parser
+-CIF_FILE_LIB = $(M_LIB_DIR)/cif-file.a
+-CIFPARSE_LIB = $(M_LIB_DIR)/cifparse-obj.a
+-CIF_TABLE_LIB = $(M_LIB_DIR)/cif-table-obj.a
+-CIFOBJ_COMMON_LIB = $(M_LIB_DIR)/cifobj-common.a
+-REGEX_LIB = $(M_LIB_DIR)/regex.a
+-MISCLIB_LIB = $(M_LIB_DIR)/misclib.a
++CIF_FILE_LIB = $(M_LIB_DIR_GENTOO)/cif-file.a
++CIFPARSE_LIB = $(M_LIB_DIR_GENTOO)/cifparse-obj.a
++CIF_TABLE_LIB = $(M_LIB_DIR_GENTOO)/tables.a
++CIFOBJ_COMMON_LIB = $(M_LIB_DIR_GENTOO)/common.a
++REGEX_LIB = $(M_LIB_DIR_GENTOO)/regex.a
++MISCLIB_LIB = $(M_LIB_DIR_GENTOO)/misclib.a
+
+ ALL_DEP_LIBS = $(CIF_FILE_LIB) $(CIFPARSE_LIB) \
+ $(CIF_TABLE_LIB) $(CIFOBJ_COMMON_LIB) $(REGEX_LIB) $(MISCLIB_LIB)
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.004-cflags-install.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-cflags-install.patch
new file mode 100644
index 000000000000..cdf48e4784c6
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-cflags-install.patch
@@ -0,0 +1,199 @@
+diff -Naur pdb-extract-v3.004-prod-src/Makefile pdb-extract-v3.004-prod-src.new/Makefile
+--- pdb-extract-v3.004-prod-src/Makefile 2007-09-11 11:19:46.000000000 -0400
++++ pdb-extract-v3.004-prod-src.new/Makefile 2009-12-03 21:34:10.000000000 -0500
+@@ -52,7 +52,7 @@
+ echo "------------------------------------------------------------"; \
+ echo "**** Making $$libdir ****"; \
+ echo "------------------------------------------------------------"; \
+- (cd $$libdir && $(MAKE) -f $(MAKEFILE) "OPT=-O" install) || exit 1; \
++ (cd $$libdir && $(MAKE) -f $(MAKEFILE) C_OPT="${CFLAGS}" CCC_OPT="${CXXFLAGS}" F_OPT="${FFLAGS}" LDFLAGS_OPT="${LDFLAGS}" install) || exit 1; \
+ done
+
+ beta:
+diff -Naur pdb-extract-v3.004-prod-src/etc/make.platform.darwin3 pdb-extract-v3.004-prod-src.new/etc/make.platform.darwin3
+--- pdb-extract-v3.004-prod-src/etc/make.platform.darwin3 2007-09-11 11:19:46.000000000 -0400
++++ pdb-extract-v3.004-prod-src.new/etc/make.platform.darwin3 2009-12-03 21:34:10.000000000 -0500
+@@ -91,7 +91,7 @@
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -159,7 +159,7 @@
+ STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
+
+ # Fortran linker
+ F77_LINKER=f77
+diff -Naur pdb-extract-v3.004-prod-src/etc/make.platform.darwin4 pdb-extract-v3.004-prod-src.new/etc/make.platform.darwin4
+--- pdb-extract-v3.004-prod-src/etc/make.platform.darwin4 2007-09-11 11:19:46.000000000 -0400
++++ pdb-extract-v3.004-prod-src.new/etc/make.platform.darwin4 2009-12-03 21:34:10.000000000 -0500
+@@ -92,7 +92,7 @@
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -160,7 +160,7 @@
+ STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
+
+ # Fortran linker
+ F77_LINKER=f77
+diff -Naur pdb-extract-v3.004-prod-src/etc/make.platform.gnu3 pdb-extract-v3.004-prod-src.new/etc/make.platform.gnu3
+--- pdb-extract-v3.004-prod-src/etc/make.platform.gnu3 2007-09-11 11:19:46.000000000 -0400
++++ pdb-extract-v3.004-prod-src.new/etc/make.platform.gnu3 2009-12-03 21:34:10.000000000 -0500
+@@ -6,6 +6,8 @@
+ ##
+ ##########################################################################
+
++LIBDIR=@GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR
++
+ #-----Lexer and Parser section-------------------------------------------#
+
+ # Lexer executable
+@@ -89,7 +91,7 @@
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -107,8 +109,8 @@
+ C_WARNINGS=$(WARNINGS)
+
+ # C compiler flags
+-CFLAGS=$(OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
+-CFLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
++CFLAGS=$(C_OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
++CFLAGS_NONANSI=$(C_OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+
+ ## C++ compiler
+@@ -128,9 +130,9 @@
+ EXT=C
+
+ # C++ compiler flags
+-C++FLAGS=$(OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
++C++FLAGS=$(CCC_OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+-C++FLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
++C++FLAGS_NONANSI=$(CCC_OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
+ $(DEFINES) $(INCLUDES)
+ # C++FLAGS_RELAXED should be set to avoid warnings reported by third party
+ # source code that is not maintained by PDB
+@@ -144,7 +146,7 @@
+ F77=f77
+
+ # Fortran compiler flags
+-FFLAGS=-O -u
++FFLAGS=$(F_OPT)
+
+ # Additional Fortran libraries
+ F77LIBS=
+@@ -154,11 +156,11 @@
+ #-----Linkers section----------------------------------------------------#
+
+ # Static linking option. If not defined, dynamic linking is used.
+-STATIC_LINKING=-static
++STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
+-LDFLAGS_NO_STATIC=$(ABI) -w
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
++LDFLAGS_NO_STATIC=$(LDFLAGS_OPT) $(ABI) -w
+
+ # Fortran linker
+ F77_LINKER=f77
+diff -Naur pdb-extract-v3.004-prod-src/etc/make.platform.gnu4 pdb-extract-v3.004-prod-src.new/etc/make.platform.gnu4
+--- pdb-extract-v3.004-prod-src/etc/make.platform.gnu4 2007-09-11 11:19:46.000000000 -0400
++++ pdb-extract-v3.004-prod-src.new/etc/make.platform.gnu4 2009-12-03 21:34:10.000000000 -0500
+@@ -6,6 +6,8 @@
+ ##
+ ##########################################################################
+
++LIBDIR=@GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR
++
+ #-----Lexer and Parser section-------------------------------------------#
+
+ # Lexer executable
+@@ -34,7 +36,7 @@
+
+ # WARNINGS_AS_ERRORS defines flags to instruct all compilers to treat all
+ # warnings as errors.
+-WARNINGS_AS_ERRORS=-Werror
++WARNINGS_AS_ERRORS=
+
+ # ALL_WARNINGS defines flags to instruct all compilers to report all
+ # warnings.
+@@ -90,7 +92,7 @@
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -108,8 +110,8 @@
+ C_WARNINGS=$(WARNINGS)
+
+ # C compiler flags
+-CFLAGS=$(OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
+-CFLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
++CFLAGS=$(C_OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
++CFLAGS_NONANSI=$(C_OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+
+ ## C++ compiler
+@@ -129,9 +131,9 @@
+ EXT=C
+
+ # C++ compiler flags
+-C++FLAGS=$(OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
++C++FLAGS=$(CCC_OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+-C++FLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
++C++FLAGS_NONANSI=$(CCC_OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
+ $(DEFINES) $(INCLUDES)
+ # C++FLAGS_RELAXED should be set to avoid warnings reported by third party
+ # source code that is not maintained by PDB
+@@ -145,7 +147,7 @@
+ F77=f77
+
+ # Fortran compiler flags
+-FFLAGS=-O -u
++FFLAGS=$(F_OPT)
+
+ # Additional Fortran libraries
+ F77LIBS=
+@@ -155,11 +157,11 @@
+ #-----Linkers section----------------------------------------------------#
+
+ # Static linking option. If not defined, dynamic linking is used.
+-STATIC_LINKING=-static
++STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
+-LDFLAGS_NO_STATIC=$(ABI) -w
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
++LDFLAGS_NO_STATIC=$(LDFLAGS_OPT) $(ABI) -w
+
+ # Fortran linker
+ F77_LINKER=f77
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.004-env.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-env.patch
new file mode 100644
index 000000000000..6506713742b6
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-env.patch
@@ -0,0 +1,11 @@
+--- pdb-extract-v3.0/src/extract.C 2007-09-11 17:19:48.000000000 +0200
++++ pdb-extract-v3.0/src/extract.C.new 2008-12-05 17:49:59.000000000 +0100
+@@ -1689,7 +1689,7 @@
+ open_file_error(inpfile, "get_mmcif");
+ }
+
+- (!strcmp_case(CCP4,"yes"))? temp = getenv("CCP4"): temp = getenv("PDB_EXTRACT");
++ (!strcmp_case(CCP4,"yes"))? temp = getenv("CCP4"): temp = getenv("PDB_EXTRACT_ROOT");
+ if(temp != NULL) {
+ strcpy(pdb_extract, "");
+ strcpy(pdb_extract_sf, "");
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.004-gcc-4.3.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-gcc-4.3.patch
new file mode 100644
index 000000000000..6907399c27df
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.004-gcc-4.3.patch
@@ -0,0 +1,20 @@
+--- cifobj-common-v4.1/src/GenString.C 2008-11-13 10:44:01.000000000 +0100
++++ cifobj-common-v4.1/src/GenString.C.new 2008-11-13 10:43:54.000000000 +0100
+@@ -144,6 +144,7 @@
+ #include <string>
+ #include <algorithm>
+ #include <sstream>
++#include <string.h>
+
+ #include "GenString.h"
+
+--- tables-v8.0/src/ISTable.C 2007-09-11 17:19:47.000000000 +0200
++++ tables-v8.0/src/ISTable.C.new 2008-11-13 10:48:18.000000000 +0100
+@@ -150,6 +150,7 @@
+ #include <sstream>
+ #include <iostream>
+ #include <iomanip>
++#include <limits.h>
+
+ #include "Exceptions.h"
+ #include "GenString.h"
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.11-cflags-install.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.11-cflags-install.patch
new file mode 100644
index 000000000000..7383811b5bfd
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.11-cflags-install.patch
@@ -0,0 +1,207 @@
+ Makefile | 2 +-
+ etc/make.platform.darwin3 | 4 ++--
+ etc/make.platform.darwin4 | 4 ++--
+ etc/make.platform.gnu3 | 20 +++++++++++---------
+ etc/make.platform.gnu4 | 20 +++++++++++---------
+ 5 files changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 627d256..72c7e59 100644
+--- a/Makefile
++++ b/Makefile
+@@ -52,7 +52,7 @@ compile:
+ echo "------------------------------------------------------------"; \
+ echo "**** Making $$libdir ****"; \
+ echo "------------------------------------------------------------"; \
+- (cd $$libdir && $(MAKE) -f $(MAKEFILE) "OPT=-O" install) || exit 1; \
++ (cd $$libdir && $(MAKE) -f $(MAKEFILE) C_OPT="${CFLAGS}" CCC_OPT="${CXXFLAGS}" F_OPT="${FFLAGS}" LDFLAGS_OPT="${LDFLAGS}" install) || exit 1; \
+ done
+
+ beta:
+diff --git a/etc/make.platform.darwin3 b/etc/make.platform.darwin3
+index c5f7b06..4c1c97c 100644
+--- a/etc/make.platform.darwin3
++++ b/etc/make.platform.darwin3
+@@ -91,7 +91,7 @@ GDEFINES=$(PLATFORM) $(COMPILER)
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -159,7 +159,7 @@ F77LIBS=
+ STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
+
+ # Fortran linker
+ F77_LINKER=f77
+diff --git a/etc/make.platform.darwin4 b/etc/make.platform.darwin4
+index 4619b34..f481fdb 100644
+--- a/etc/make.platform.darwin4
++++ b/etc/make.platform.darwin4
+@@ -92,7 +92,7 @@ GDEFINES=$(PLATFORM) $(COMPILER)
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -160,7 +160,7 @@ F77LIBS=
+ STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
+
+ # Fortran linker
+ F77_LINKER=f77
+diff --git a/etc/make.platform.gnu3 b/etc/make.platform.gnu3
+index 7fd442e..9bec4dc 100644
+--- a/etc/make.platform.gnu3
++++ b/etc/make.platform.gnu3
+@@ -6,6 +6,8 @@
+ ##
+ ##########################################################################
+
++LIBDIR=@GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR
++
+ #-----Lexer and Parser section-------------------------------------------#
+
+ # Lexer executable
+@@ -89,7 +91,7 @@ GDEFINES=$(PLATFORM) $(COMPILER)
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -107,8 +109,8 @@ NON_ANSI_C_FLAG=
+ C_WARNINGS=$(WARNINGS)
+
+ # C compiler flags
+-CFLAGS=$(OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
+-CFLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
++CFLAGS=$(C_OPT) $(ABI) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
++CFLAGS_NONANSI=$(C_OPT) $(ABI) $(NON_ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+
+ ## C++ compiler
+@@ -128,9 +130,9 @@ C_PLUS_WARNINGS=$(WARNINGS) $(NO_DEPRECATED)
+ EXT=C
+
+ # C++ compiler flags
+-C++FLAGS=$(OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
++C++FLAGS=$(CCC_OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) $(DEFINES) \
+ $(INCLUDES)
+-C++FLAGS_NONANSI=$(OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
++C++FLAGS_NONANSI=$(CCC_OPT) $(ABI) $(NON_ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
+ $(DEFINES) $(INCLUDES)
+ # C++FLAGS_RELAXED should be set to avoid warnings reported by third party
+ # source code that is not maintained by PDB
+@@ -144,7 +146,7 @@ C++FLAGS_RELAXED=$(OPT) $(ABI) $(ANSI_C_PLUS_FLAG) $(NO_DEPRECATED) $(DEFINES) \
+ F77=f77
+
+ # Fortran compiler flags
+-FFLAGS=-O -u
++FFLAGS=$(F_OPT)
+
+ # Additional Fortran libraries
+ F77LIBS=
+@@ -154,11 +156,11 @@ F77LIBS=
+ #-----Linkers section----------------------------------------------------#
+
+ # Static linking option. If not defined, dynamic linking is used.
+-STATIC_LINKING=-static
++STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
+-LDFLAGS_NO_STATIC=$(ABI) -w
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
++LDFLAGS_NO_STATIC=$(LDFLAGS_OPT) $(ABI) -w
+
+ # Fortran linker
+ F77_LINKER=f77
+diff --git a/etc/make.platform.gnu4 b/etc/make.platform.gnu4
+index 78a0007..bc85308 100644
+--- a/etc/make.platform.gnu4
++++ b/etc/make.platform.gnu4
+@@ -6,6 +6,8 @@
+ ##
+ ##########################################################################
+
++LIBDIR=@GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR
++
+ #-----Lexer and Parser section-------------------------------------------#
+
+ # Lexer executable
+@@ -34,7 +36,7 @@ ABI=
+
+ # WARNINGS_AS_ERRORS defines flags to instruct all compilers to treat all
+ # warnings as errors.
+-WARNINGS_AS_ERRORS=-Werror
++WARNINGS_AS_ERRORS=
+
+ # ALL_WARNINGS defines flags to instruct all compilers to report all
+ # warnings.
+@@ -90,7 +92,7 @@ GDEFINES=$(PLATFORM) $(COMPILER)
+ DEFINES=$(GDEFINES) $(LDEFINES)
+
+ ## Global include directories
+-GINCLUDES=
++GINCLUDES=-I@GENTOO_PORTAGE_EPREFIX@/usr/include/cifparse-obj
+
+ # Collect all include directories from global include directories and
+ # include directories specified in module makefile
+@@ -108,8 +110,8 @@ NON_ANSI_C_FLAG=
+ C_WARNINGS=$(WARNINGS)
+
+ # C compiler flags
+-CFLAGS=$(OPT) $(ABI) $(PIC) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
+-CFLAGS_NONANSI=$(OPT) $(ABI) $(PIC) $(NON_ANSI_C_FLAG) $(DEFINES) $(INCLUDES)
++CFLAGS=$(C_OPT) $(ABI) $(PIC) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
++CFLAGS_NONANSI=$(C_OPT) $(ABI) $(PIC) $(NON_ANSI_C_FLAG) $(DEFINES) $(INCLUDES)
+
+ ## C++ compiler
+ ## This part defines C++ compiler information
+@@ -128,9 +130,9 @@ C_PLUS_WARNINGS=$(WARNINGS) $(NO_DEPRECATED)
+ EXT=C
+
+ # C++ compiler flags
+-C++FLAGS=$(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
++C++FLAGS=$(CCC_OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
+ $(DEFINES) $(INCLUDES)
+-C++FLAGS_NONANSI=$(OPT) $(ABI) $(PIC) $(NON_ANSI_C_PLUS_FLAG) \
++C++FLAGS_NONANSI=$(CCC_OPT) $(ABI) $(PIC) $(NON_ANSI_C_PLUS_FLAG) \
+ $(C_PLUS_WARNINGS) $(DEFINES) $(INCLUDES)
+
+ # C++FLAGS_RELAXED should be set to avoid warnings reported by third party
+@@ -145,7 +147,7 @@ C++FLAGS_RELAXED=$(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(NO_DEPRECATED) \
+ F77=f77
+
+ # Fortran compiler flags
+-FFLAGS=-O -u
++FFLAGS=$(F_OPT)
+
+ # Additional Fortran libraries
+ F77LIBS=
+@@ -158,8 +160,8 @@ F77LIBS=
+ STATIC_LINKING=
+
+ # Linker flags
+-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
+-LDFLAGS_NO_STATIC=$(ABI) -w
++LDFLAGS=$(LDFLAGS_OPT) $(ABI) -w $(STATIC_LINKING)
++LDFLAGS_NO_STATIC=$(LDFLAGS_OPT) $(ABI) -w
+
+ # Fortran linker
+ F77_LINKER=f77
diff --git a/sci-chemistry/pdb-extract/files/pdb-extract-3.11-gcc-4.7.patch b/sci-chemistry/pdb-extract/files/pdb-extract-3.11-gcc-4.7.patch
new file mode 100644
index 000000000000..5284bd745d53
--- /dev/null
+++ b/sci-chemistry/pdb-extract/files/pdb-extract-3.11-gcc-4.7.patch
@@ -0,0 +1,64 @@
+ common-v4.5/src/mapped_ptr_vector.C | 14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/common-v4.5/src/mapped_ptr_vector.C b/common-v4.5/src/mapped_ptr_vector.C
+index d7c61f3..e20a236 100644
+--- a/common-v4.5/src/mapped_ptr_vector.C
++++ b/common-v4.5/src/mapped_ptr_vector.C
+@@ -263,12 +263,12 @@ void mapped_ptr_vector<T, StringCompareT>::push_back(T* inP,
+ _vector.push_back(inP);
+
+ typename tIndex::value_type valuePair(inP->GetName(),
+- make_pair(_vector.size() - 1, fileIndex));
++ std::make_pair(_vector.size() - 1, fileIndex));
+
+ _index.insert(valuePair);
+
+ _currentName = inP->GetName();
+- _currentIndices = make_pair(_vector.size() - 1, fileIndex);
++ _currentIndices = std::make_pair(_vector.size() - 1, fileIndex);
+
+ }
+
+@@ -281,12 +281,12 @@ void mapped_ptr_vector<T, StringCompareT>::push_back(const string& name,
+ _vector.push_back(NULL);
+
+ typename tIndex::value_type valuePair(name,
+- make_pair(_vector.size() - 1, fileIndex));
++ std::make_pair(_vector.size() - 1, fileIndex));
+
+ _index.insert(valuePair);
+
+ _currentName = name;
+- _currentIndices = make_pair(_vector.size() - 1, fileIndex);
++ _currentIndices = std::make_pair(_vector.size() - 1, fileIndex);
+ }
+
+
+@@ -454,7 +454,7 @@ void mapped_ptr_vector<T, StringCompareT>::erase(const string& name)
+ if (is_equal(_currentName, name, keyComp))
+ {
+ _currentName.clear();
+- _currentIndices = make_pair(_vector.size(), (unsigned int)0);
++ _currentIndices = std::make_pair(_vector.size(), (unsigned int)0);
+ }
+
+ }
+@@ -539,7 +539,7 @@ pair<unsigned int, unsigned int> mapped_ptr_vector<T, StringCompareT>::get_indic
+ if (_vector.empty())
+ {
+ // Empty container. Return invalid index.
+- return(make_pair(_vector.size(), (unsigned int)0));
++ return(std::make_pair(_vector.size(), (unsigned int)0));
+ }
+
+ typename tIndex::key_compare keyComp = _index.key_comp();
+@@ -563,7 +563,7 @@ pair<unsigned int, unsigned int> mapped_ptr_vector<T, StringCompareT>::get_indic
+ else
+ {
+ // Not found. Return invalid index.
+- return(make_pair(_vector.size(), (unsigned int)0));
++ return(std::make_pair(_vector.size(), (unsigned int)0));
+ }
+ }
+
diff --git a/sci-chemistry/pdb-extract/metadata.xml b/sci-chemistry/pdb-extract/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/pdb-extract/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/pdb-extract/pdb-extract-3.004-r2.ebuild b/sci-chemistry/pdb-extract/pdb-extract-3.004-r2.ebuild
new file mode 100644
index 000000000000..836d76f5c007
--- /dev/null
+++ b/sci-chemistry/pdb-extract/pdb-extract-3.004-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs multilib prefix
+
+MY_P="${PN}-v${PV}-prod-src"
+
+DESCRIPTION="Tools for extracting mmCIF data from structure determination applications"
+HOMEPAGE="http://sw-tools.pdb.org/apps/PDB_EXTRACT/index.html"
+SRC_URI="http://sw-tools.pdb.org/apps/PDB_EXTRACT/${MY_P}.tar.gz"
+
+LICENSE="PDB"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="!<app-text/html-xml-utils-5.3"
+DEPEND="${RDEPEND}
+ >=sci-libs/cifparse-obj-7.025"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-cflags-install.patch \
+ "${FILESDIR}"/${P}-gcc-4.3.patch \
+ "${FILESDIR}"/${P}-Makefile.patch \
+ "${FILESDIR}"/${P}-env.patch
+
+ sed -i "s:GENTOOLIBDIR:$(get_libdir):g" \
+ pdb-extract-v3.0/Makefile \
+ || die "Failed to fix libdir"
+
+ # Get rid of unneeded directories, to make sure we use system files
+ ebegin "Deleting redundant directories"
+ rm -rf cif-file-v1.0 cifobj-common-v4.1 cifparse-obj-v7.0 \
+ misclib-v2.2 regex-v2.2 tables-v8.0
+ eend
+
+ sed -i \
+ -e "s:^\(CCC=\).*:\1$(tc-getCXX):g" \
+ -e "s:^\(CC=\).*:\1$(tc-getCC):g" \
+ -e "s:^\(GINCLUDES=\).*:\1-I${EPREFIX}/usr/include/cifparse-obj:g" \
+ -e "s:^\(LIBDIR=\).*:\1${EPREFIX}/usr/$(get_libdir):g" \
+ "${S}"/etc/make.* \
+ || die "Failed to fix makefiles"
+
+ eprefixify pdb-extract-v3.0/Makefile etc/*
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin
+ doexe bin/pdb_extract{,_sf} bin/extract \
+ || die "failed to install binaries"
+ insinto /usr/include/rcsb
+ doins include/* || die "failed to install include files"
+ dodoc README* || die "failed to install docs"
+ insinto /usr/share/rcsb/
+ doins -r pdb-extract-data || die "failed to install data files"
+
+ cat >> "${T}"/envd <<- EOF
+ PDB_EXTRACT="${EPREFIX}/usr/share/rcsb/"
+ PDB_EXTRACT_ROOT="${EPREFIX}/usr/"
+ EOF
+
+ newenvd "${T}"/envd 20pdb-extract \
+ || die "failed to install env files"
+}
diff --git a/sci-chemistry/pdb-extract/pdb-extract-3.11.ebuild b/sci-chemistry/pdb-extract/pdb-extract-3.11.ebuild
new file mode 100644
index 000000000000..04351c8a125a
--- /dev/null
+++ b/sci-chemistry/pdb-extract/pdb-extract-3.11.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs multilib prefix
+
+MY_P="${PN}-v${PV}-prod-src"
+
+DESCRIPTION="Tools for extracting mmCIF data from structure determination applications"
+HOMEPAGE="http://sw-tools.pdb.org/apps/PDB_EXTRACT/index.html"
+SRC_URI="http://sw-tools.pdb.org/apps/PDB_EXTRACT/${MY_P}.tar.gz"
+
+LICENSE="PDB"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="!<app-text/html-xml-utils-5.3"
+DEPEND="${RDEPEND}
+ >=sci-libs/cifparse-obj-7.025"
+
+S="${WORKDIR}/${MY_P}"
+
+MAKEOPTS+=" -j1"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-cflags-install.patch \
+ "${FILESDIR}"/${P}-gcc-4.7.patch \
+ "${FILESDIR}"/${PN}-3.004-env.patch
+
+ sed -i \
+ -e "s:^\(CCC=\).*:\1$(tc-getCXX):g" \
+ -e "s:^\(CC=\).*:\1$(tc-getCC):g" \
+ -e "s:^\(GINCLUDES=\).*:\1-I${EPREFIX}/usr/include/cifparse-obj:g" \
+ -e "s:^\(LIBDIR=\).*:\1${EPREFIX}/usr/$(get_libdir):g" \
+ "${S}"/etc/make.* \
+ || die "Failed to fix makefiles"
+
+ eprefixify pdb-extract-v3.0/Makefile etc/*
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin
+ doexe bin/pdb_extract{,_sf} bin/extract
+ insinto /usr/include/rcsb
+ doins include/*
+ dodoc README*
+ insinto /usr/share/rcsb/
+ doins -r pdb-extract-data
+
+ cat >> "${T}"/envd <<- EOF
+ PDB_EXTRACT="${EPREFIX}/usr/share/rcsb/"
+ PDB_EXTRACT_ROOT="${EPREFIX}/usr/"
+ EOF
+
+ newenvd "${T}"/envd 20pdb-extract
+}
diff --git a/sci-chemistry/pdb-tools/Manifest b/sci-chemistry/pdb-tools/Manifest
new file mode 100644
index 000000000000..bf2e4bfa7dce
--- /dev/null
+++ b/sci-chemistry/pdb-tools/Manifest
@@ -0,0 +1 @@
+DIST pdbTools_0.2.1.tar.gz 103835 SHA256 317a5246e806a2b3d0425d080d679646fc77388e3e855412527603f945fa37ae SHA512 9c43c10e8739f8a34dbb1a3bba710cc727f7d8392ff979681371bd4460c67203253fb01852438eb93b214c4a009789608d200ca551f30399652fb76d702cf724 WHIRLPOOL 36d8cf71ba9f9b28e3ad59828539f4e94bbb8bc4514f050ddcbec63857b154ecdc7c32c2945c0d15f4d718c4fe5ab3adcb2e62a4368bfd819b80e9641a9dfd88
diff --git a/sci-chemistry/pdb-tools/metadata.xml b/sci-chemistry/pdb-tools/metadata.xml
new file mode 100644
index 000000000000..13e9a3c93979
--- /dev/null
+++ b/sci-chemistry/pdb-tools/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">pdb-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r1.ebuild b/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r1.ebuild
new file mode 100644
index 000000000000..ad4ab1dec397
--- /dev/null
+++ b/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit fortran-2 python-single-r1 toolchain-funcs
+
+MY_PN="pdbTools"
+
+DESCRIPTION="Tools for manipulating and doing calculations on wwPDB macromolecule structure files"
+HOMEPAGE="http://code.google.com/p/pdb-tools/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_PN}_${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_PN}_${PV}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ fortran-2_pkg_setup
+}
+
+src_prepare() {
+ sed \
+ -e "s:script_dir,\"pdb_data\":\"${EPREFIX}/usr/share/${PN}\",\"pdb_data\":g" \
+ -i pdb_sasa.py || die
+ sed \
+ -e "/satk_path =/s:^.*$:satk_path = \"${EPREFIX}/usr/bin\":g" \
+ -i pdb_satk.py || die
+ sed \
+ -e 's:> %:>%:g' \
+ -i pdb_seq.py || die
+}
+
+src_compile() {
+ mkdir bin
+ cd satk
+ for i in *.f; do
+ einfo "$(tc-getFC) ${FFLAGS} ${LDFLAGS} ${i} -o ${i/.f}"
+ $(tc-getFC) ${FFLAGS} -c ${i} -o ${i/.f/.o} || die
+ $(tc-getFC) ${LDFLAGS} -o ../bin/${i/.f} ${i/.f/.o} || die
+ sed \
+ -e "s:${i/.f}.out:${i/.f}:g" \
+ -i ../pdb_satk.py || die
+ done
+}
+
+src_install() {
+ local script
+ insinto /usr/share/${PN}
+ doins -r pdb_data/peptides
+ rm -rf pdb_data/peptides || die
+
+ python_domodule helper pdb_data
+
+ python_moduleinto ${PN/-/_}
+ python_domodule *.py
+
+ for i in pdb_*.py; do
+ cat > ${i/.py} <<- EOF
+ #!${EPREFIX}/bin/bash
+ ${PYTHON} -O "$(python_get_sitedir)/${PN/-/_}/${i}" \$@
+ EOF
+ dobin ${i/.py}
+ done
+
+ dobin bin/*
+ dodoc README
+}
diff --git a/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r2.ebuild b/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r2.ebuild
new file mode 100644
index 000000000000..e56798f3c95b
--- /dev/null
+++ b/sci-chemistry/pdb-tools/pdb-tools-0.2.1-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit fortran-2 python-single-r1 toolchain-funcs
+
+MY_PN="pdbTools"
+
+DESCRIPTION="Tools for manipulating and doing calculations on wwPDB macromolecule structure files"
+HOMEPAGE="http://code.google.com/p/pdb-tools/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_PN}_${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_PN}_${PV}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ fortran-2_pkg_setup
+}
+
+src_prepare() {
+ sed \
+ -e "s:script_dir,\"pdb_data\":\"${EPREFIX}/usr/share/${PN}\",\"pdb_data\":g" \
+ -i pdb_sasa.py || die
+ sed \
+ -e "/satk_path =/s:^.*$:satk_path = \"${EPREFIX}/usr/bin\":g" \
+ -i pdb_satk.py || die
+ sed \
+ -e 's:> %:>%:g' \
+ -i pdb_seq.py || die
+
+ sed \
+ -e "/import/s:helper:${PN/-/_}.helper:g" \
+ -i *.py || die
+}
+
+src_compile() {
+ mkdir bin
+ cd satk
+ for i in *.f; do
+ einfo "$(tc-getFC) ${FFLAGS} ${LDFLAGS} ${i} -o ${i/.f}"
+ $(tc-getFC) ${FFLAGS} -c ${i} -o ${i/.f/.o} || die
+ $(tc-getFC) ${LDFLAGS} -o ../bin/${i/.f} ${i/.f/.o} || die
+ sed \
+ -e "s:${i/.f}.out:${i/.f}:g" \
+ -i ../pdb_satk.py || die
+ done
+}
+
+src_install() {
+ local script
+ insinto /usr/share/${PN}
+ doins -r pdb_data/peptides
+ rm -rf pdb_data/peptides || die
+
+ python_domodule pdb_data
+
+ python_moduleinto ${PN/-/_}
+ python_domodule helper *.py
+
+ for i in pdb_*.py; do
+ cat > ${i/.py} <<- EOF
+ #!${EPREFIX}/bin/bash
+ ${PYTHON} -O "$(python_get_sitedir)/${PN/-/_}/${i}" \$@
+ EOF
+ dobin ${i/.py}
+ done
+
+ dobin bin/*
+ dodoc README
+}
diff --git a/sci-chemistry/pdb2pqr/Manifest b/sci-chemistry/pdb2pqr/Manifest
new file mode 100644
index 000000000000..a34457524075
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/Manifest
@@ -0,0 +1 @@
+DIST pdb2pqr-src-1.9.0.tar.gz 9051969 SHA256 d9d91bf27a023732be33d1d780ef283ae28d3b0e256c53e86c37ac001dd7ef53 SHA512 7f3f191cca9879a0e166e82700c706f8c99bb66558a218e54845f10c3324b6c45d413da80b0782d96a8d56df1463262609db075aba3768db3942cb928ee7b98f WHIRLPOOL 4a4b883200dad3e7467392e508c2372ad6876e78005da14e5747f3b7b12d0e3d5695e3cc590812b835ae67703819b201620809dff05af0a7c363c23d22046bae
diff --git a/sci-chemistry/pdb2pqr/files/pdb2pka b/sci-chemistry/pdb2pqr/files/pdb2pka
new file mode 100644
index 000000000000..2406b0c4773f
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/files/pdb2pka
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+import subprocess
+import site
+import sys
+import os
+
+sitepackages = site.getsitepackages()[0]
+
+_cmd=[os.path.join(sitepackages, "pdb2pqr", "pdb2pka", "pka.py")]
+_cmd.extend(sys.argv[1:])
+
+subprocess.call(_cmd, stdout=sys.stdout, stderr=sys.stderr)
diff --git a/sci-chemistry/pdb2pqr/files/pdb2pqr b/sci-chemistry/pdb2pqr/files/pdb2pqr
new file mode 100644
index 000000000000..8c0635aea94e
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/files/pdb2pqr
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+import subprocess
+import site
+import sys
+import os
+
+sitepackages = site.getsitepackages()[0]
+
+_cmd=[os.path.join(sitepackages, "pdb2pqr", "pdb2pqr.py")]
+_cmd.extend(sys.argv[1:])
+
+subprocess.call(_cmd, stdout=sys.stdout, stderr=sys.stderr)
diff --git a/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-flags.patch b/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-flags.patch
new file mode 100644
index 000000000000..fac32b233e6b
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-flags.patch
@@ -0,0 +1,45 @@
+ pdb2pka/SConscript | 9 ++++++++-
+ pdb2pka/substruct/SConscript | 6 ++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/pdb2pka/SConscript b/pdb2pka/SConscript
+index 583cdc5..6c30011 100644
+--- a/pdb2pka/SConscript
++++ b/pdb2pka/SConscript
+@@ -1,4 +1,11 @@
+ Import('env')
++import os
++
++env['CCFLAGS'].extend(os.environ['CXXFLAGS'].split())
++env['LINKFLAGS'].extend(os.environ['LDFLAGS'].split())
++env['CXX'] = os.environ['CXX']
++env['LINK'] = os.environ['CXX']
++
+
+ if env['REBUILD_SWIG']:
+ pyc = env.LoadableModule('_pMC_mult', ['pMC_mult.cpp', 'pMC_mult.i'])
+@@ -9,4 +16,4 @@ Default(pyc)
+
+ algorithms_module = SConscript('substruct/SConscript')
+
+-Return('pyc algorithms_module')
+\ No newline at end of file
++Return('pyc algorithms_module')
+diff --git a/pdb2pka/substruct/SConscript b/pdb2pka/substruct/SConscript
+index 7dbcdb0..56fb577 100644
+--- a/pdb2pka/substruct/SConscript
++++ b/pdb2pka/substruct/SConscript
+@@ -1,7 +1,13 @@
+ import distutils
+ import numpy
++import os
+ Import('env')
+
++env['CCFLAGS'].extend(os.environ['CXXFLAGS'].split())
++env['LINKFLAGS'].extend(os.environ['LDFLAGS'].split())
++env['CXX'] = os.environ['CXX']
++env['LINK'] = os.environ['CXX']
++
+ env.Append(CPPPATH=[distutils.sysconfig.get_python_inc(), numpy.get_include()])
+
+ algorithms_pyc = env.LoadableModule('Algorithms', ['Algorithms.cpp'])
diff --git a/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-install-py.patch b/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-install-py.patch
new file mode 100644
index 000000000000..2695b013c66a
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/files/pdb2pqr-1.9.0-install-py.patch
@@ -0,0 +1,15 @@
+ SConscript-install.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/SConscript-install.py b/SConscript-install.py
+index e2f9f09..1fdf1a8 100644
+--- a/SConscript-install.py
++++ b/SConscript-install.py
+@@ -41,6 +41,7 @@ def installFile(file_name, build_target='install'):
+ if GetOption("clean"):
+ env.Default(result)
+ Alias(build_target, env.Install(env['PREFIX']+dirname(file_name), result))
++ Alias(build_target, env.Install(env['PREFIX']+dirname(file_name), target))
+ else:
+ Alias(build_target, env.Install(env['PREFIX']+dirname(file_name), target))
+
diff --git a/sci-chemistry/pdb2pqr/metadata.xml b/sci-chemistry/pdb2pqr/metadata.xml
new file mode 100644
index 000000000000..81003ba2152a
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/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>
+ <use>
+ <flag name="opal">Add web interface via opal</flag>
+ <flag name="pdb2pka">Install experimental pdb2pka interface</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">Electrostatics/apbs-pdb2pqr</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/pdb2pqr/pdb2pqr-1.9.0-r1.ebuild b/sci-chemistry/pdb2pqr/pdb2pqr-1.9.0-r1.ebuild
new file mode 100644
index 000000000000..7359b9094128
--- /dev/null
+++ b/sci-chemistry/pdb2pqr/pdb2pqr-1.9.0-r1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit scons-utils fortran-2 flag-o-matic python-r1 toolchain-funcs
+
+DESCRIPTION="An automated pipeline for performing Poisson-Boltzmann electrostatics calculations"
+HOMEPAGE="http://www.poissonboltzmann.org/"
+SRC_URI="https://github.com/Electrostatics/apbs-${PN}/releases/download/${P}/${PN}-src-${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+IUSE="doc examples opal +pdb2pka"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-chemistry/openbabel-python[${PYTHON_USEDEP}]
+ opal? ( dev-python/zsi[${PYTHON_USEDEP}] )
+ pdb2pka? ( sci-chemistry/apbs[${PYTHON_USEDEP},-mpi] )"
+DEPEND="${RDEPEND}
+ dev-lang/swig:0"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-flags.patch
+ "${FILESDIR}"/${P}-install-py.patch
+)
+
+pkg_setup() {
+ if [[ -z ${MAXATOMS} ]]; then
+ einfo "If you like to have support for more then 10000 atoms,"
+ einfo "export MAXATOMS=\"your value\""
+ export MAXATOMS=10000
+ else
+ einfo "Allow usage of ${MAXATOMS} during calculations"
+ fi
+ fortran-2_pkg_setup
+}
+
+src_prepare() {
+ find -type f \( -name "*\.pyc" -o -name "*\.pyo" \) -delete || die
+
+ export CXXFLAGS="${CXXFLAGS}"
+ export LDFLAGS="${LDFLAGS}"
+
+ epatch ${PATCHES[@]}
+ tc-export CXX
+ rm -rf scons || die
+
+ python_copy_sources
+}
+
+src_configure() {
+ python_configure() {
+ cd "${BUILD_DIR}" || die
+
+ cat > build_config.py <<- EOF
+ PREFIX="${D}/$(python_get_sitedir)/${PN}"
+ #URL="http://<COMPUTER NAME>/pdb2pqr/"
+ APBS="${EPREFIX}/usr/bin/apbs"
+ #OPAL="http://nbcr-222.ucsd.edu/opal2/services/pdb2pqr_1.8"
+ #APBS_OPAL="http://nbcr-222.ucsd.edu/opal2/services/apbs_1.3"
+ MAX_ATOMS=${MAXATOMS}
+ BUILD_PDB2PKA=$(usex pdb2pka True False)
+ REBUILD_SWIG=True
+ EOF
+ }
+
+ python_foreach_impl python_configure
+}
+
+src_compile() {
+ python_compile() {
+ cd "${BUILD_DIR}" || die
+ escons
+ }
+ python_foreach_impl python_compile
+}
+
+src_test() {
+ python_test() {
+ local myesconsargs=( -j1 )
+ cd "${BUILD_DIR}" || die
+ escons test
+ escons advtest
+ escons complete-test
+ }
+ python_foreach_impl python_test
+}
+
+src_install() {
+ dodir /usr/share/doc/${PF}/html
+ python_install() {
+ local lib
+
+ cd "${BUILD_DIR}" || die
+
+ escons install
+
+ find "${D}$(python_get_sitedir)"/${PN}/{jmol,examples,doc,contrib} -delete || die
+
+ python_doscript "${FILESDIR}"/{${PN},pdb2pka}
+
+ for lib in apbslib.py{,c,o}; do
+ dosym ../../apbs/${lib} $(python_get_sitedir)/${PN}/pdb2pka/${lib}
+ done
+ dosym ../../_apbslib.so $(python_get_sitedir)/${PN}/pdb2pka/_apbslib.so
+ python_optimize
+ }
+ python_foreach_impl python_install
+
+ if use doc; then
+ pushd doc > /dev/null
+ docinto html
+ dodoc -r *.html images pydoc
+ popd > /dev/null
+ fi
+
+ use examples && \
+ insinto /usr/share/${PN}/ && \
+ doins -r examples
+
+ dodoc *md NEWS
+}
diff --git a/sci-chemistry/pdbcat/Manifest b/sci-chemistry/pdbcat/Manifest
new file mode 100644
index 000000000000..80690fe7ac00
--- /dev/null
+++ b/sci-chemistry/pdbcat/Manifest
@@ -0,0 +1 @@
+DIST pdbcat-1.3.tar.gz 12750 SHA256 a9c554c00b34e5131ca1be61aad9332ab26eca5a905b716c47f657521368babc SHA512 369ac0c4c1d8396eaa0450feb9852d2d75ebd9862a2e403ccd42a2801e924f99c28c5d71c0b66feb4588076a8948b503823d2c75420128dd04d020253f821f4c WHIRLPOOL ba6599d06814929bf23c83bb6df7084592fcc23603a8e3116e2661df3c9d97b335c627d09249be6c862466b2d83a0100d94b366df171e1c45ec6221a22b2ca78
diff --git a/sci-chemistry/pdbcat/files/CMakeLists.txt b/sci-chemistry/pdbcat/files/CMakeLists.txt
new file mode 100644
index 000000000000..7a6f348f5929
--- /dev/null
+++ b/sci-chemistry/pdbcat/files/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.6)
+project (pdbcat)
+add_executable(pdbcat
+ Common.C
+ Common.h
+ pdbcat.C
+ PDBData.C
+ PDBData.h)
+
+install (TARGETS pdbcat DESTINATION bin)
+
diff --git a/sci-chemistry/pdbcat/files/pdbcat-1.3-gcc.patch b/sci-chemistry/pdbcat/files/pdbcat-1.3-gcc.patch
new file mode 100644
index 000000000000..b45c36bd8a8d
--- /dev/null
+++ b/sci-chemistry/pdbcat/files/pdbcat-1.3-gcc.patch
@@ -0,0 +1,17 @@
+ pdbcat.C | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/pdbcat.C b/pdbcat.C
+index 0786d9b..387edf9 100644
+--- a/pdbcat.C
++++ b/pdbcat.C
+@@ -17,7 +17,8 @@
+ #include <stdlib.h> // for exit
+ #include <stdio.h> // for feof() and other file manip stuff
+ #include <string.h> // for strcasecmp
+-#include <iostream.h>
++#include <iostream>
++using namespace std;
+ #include "Common.h"
+ #include "PDBData.h"
+
diff --git a/sci-chemistry/pdbcat/metadata.xml b/sci-chemistry/pdbcat/metadata.xml
new file mode 100644
index 000000000000..54c920d084c3
--- /dev/null
+++ b/sci-chemistry/pdbcat/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+The Brookhaven Protein Data Bank stores atomic coordinate information
+for protein structures in a column based format. This is designed to
+be read easily read by FORTRAN programs. Indeed, if you get the
+format description (from anonymous ftp to ftp.pdb.bnl.gov, the file
+/pub/format.desc.ps) they show the single input line needed to read
+each record type.
+However, I am a C/C++ programmer in the Unix environment. It is a
+easier for me to deal with field based input than column based ones.
+If the fields are white space delimited I can easily use awk and perl
+to manipulate the coordinate information. So I needed some way to
+convert the ATOM and HETATM records of PDB files from the standard
+column based format to a field based one and back again. It needed
+to denote missing fields if they exist.
+That converter is `pdbcat'.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/pdbcat/pdbcat-1.3.ebuild b/sci-chemistry/pdbcat/pdbcat-1.3.ebuild
new file mode 100644
index 000000000000..f0d0b263a446
--- /dev/null
+++ b/sci-chemistry/pdbcat/pdbcat-1.3.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+DESCRIPTION="Manipulate and process PDB files using commonly available tools such as Perl, awk, etc"
+HOMEPAGE="http://www.ks.uiuc.edu/Development/MDTools/pdbcat/"
+SRC_URI="http://www.ks.uiuc.edu/Development/MDTools/${PN}/files/${P}.tar.gz"
+
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+PATCHES=( "${FILESDIR}"/${P}-gcc.patch )
+DOCS=( README )
+
+src_prepare() {
+ cp "${FILESDIR}"/CMakeLists.txt . || die
+ cmake-utils_src_prepare
+}
diff --git a/sci-chemistry/pdbcns/Manifest b/sci-chemistry/pdbcns/Manifest
new file mode 100644
index 000000000000..f6f839594082
--- /dev/null
+++ b/sci-chemistry/pdbcns/Manifest
@@ -0,0 +1 @@
+DIST pdbcns.2.0.010504.perl.tgz 6806 RMD160 9398bb4e766b45365827663e8cf72eee63ec42a7 SHA1 61f9a8655b2d6d2df6709d8b5bc853de0498fe4f SHA256 a2c66e44e036b6a1ff2eff90b59c4adf20edb70d3f704bd7bc7f356040d8f98a
diff --git a/sci-chemistry/pdbcns/metadata.xml b/sci-chemistry/pdbcns/metadata.xml
new file mode 100644
index 000000000000..1837bbc07a6e
--- /dev/null
+++ b/sci-chemistry/pdbcns/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pdbcns/pdbcns-2.0.010504.ebuild b/sci-chemistry/pdbcns/pdbcns-2.0.010504.ebuild
new file mode 100644
index 000000000000..94b8c6138845
--- /dev/null
+++ b/sci-chemistry/pdbcns/pdbcns-2.0.010504.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Convert atom names for common amino acids and nucleic acid bases from PDB format to CNS or back"
+HOMEPAGE="http://www.mybiosoftware.com/3d-molecular-model/314/"
+#SRC_URI="http://kinemage.biochem.duke.edu/php/downlode.php?filename=/downloads/software/scripts/${PN}.${PV}.perl.tgz"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${PN}.${PV}.perl.tgz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ dev-lang/perl"
+
+S="${WORKDIR}"/${PN}
+
+src_install() {
+ newbin ${PN}*.pl ${PN}
+ dohtml *html
+}
diff --git a/sci-chemistry/pdbmat/Manifest b/sci-chemistry/pdbmat/Manifest
new file mode 100644
index 000000000000..2a19bccb5f04
--- /dev/null
+++ b/sci-chemistry/pdbmat/Manifest
@@ -0,0 +1 @@
+DIST pdbmat-3.89.tar.gz 124727 SHA256 98f75acd3da3f172213de0688825abad8b3a59c516b5b4ac411a494f6d355f72 SHA512 2c7f8f32344fe1abc662878c2556c10bd6671e683787231827399866f485389c3a63253b00d5a5bdbe8d0b8b779891e846962c9372d927b94c45f0fac59a4fb6 WHIRLPOOL 62f0b8cb2a99797d49c427a085ad24b41e045ba96433cb8c1769c614402cf729737b2335fcb356ad42de1e24079eadccd2c3db6eaa8ff062eb1249a13723b7f0
diff --git a/sci-chemistry/pdbmat/files/CMakeLists.txt b/sci-chemistry/pdbmat/files/CMakeLists.txt
new file mode 100644
index 000000000000..2f1937d84b3f
--- /dev/null
+++ b/sci-chemistry/pdbmat/files/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required (VERSION 2.6)
+project (PDBMAT Fortran)
+
+option (EXAMPLES "Instal additional example files" OFF)
+
+add_executable(diagstd diagstd.f)
+add_executable(pdbmat pdbmat.f)
+
+install (TARGETS diagstd pdbmat DESTINATION bin)
+install (FILES diagstd.README pdbmat.README DESTINATION share/doc/pdbmat)
+
+if ( EXAMPLES )
+ install (DIRECTORY ../Try_ENM2011 DESTINATION share/pdbmat/examples)
+endif (EXAMPLES)
diff --git a/sci-chemistry/pdbmat/metadata.xml b/sci-chemistry/pdbmat/metadata.xml
new file mode 100644
index 000000000000..d542eb59e001
--- /dev/null
+++ b/sci-chemistry/pdbmat/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+A fortran program in which Tirion's model (also called the Elastic Network
+Model) is implemented. Within the frame of this model, atoms (particles)
+less than cutoff (angstroms) away from each others are linked by springs of
+same strength. Alternatively, a list of interacting atoms can be given to the
+program.
+Requirements: a file with the coordinates of the system, in PDB (Protein Data
+Bank) or "x y z mass" format.
+
+Output: the hessian (the mass-weighted second derivatives of energy matrix),
+in the "i j non-zero-ij-matrix-element" format.
+
+Diagstd, a fortran program with a standard diagonalization routine, can next
+be used in order to obtain the corresponding normal modes of the system. If
+the system is large, the RTB approximation can prove usefull (see below).
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/pdbmat/pdbmat-3.89.ebuild b/sci-chemistry/pdbmat/pdbmat-3.89.ebuild
new file mode 100644
index 000000000000..89445471ef73
--- /dev/null
+++ b/sci-chemistry/pdbmat/pdbmat-3.89.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils fortran-2
+
+DESCRIPTION="Calculate Tirion's model from pdb structures"
+HOMEPAGE="http://ecole.modelisation.free.fr/modes.html"
+SRC_URI="http://ecole.modelisation.free.fr/enm2011.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="CeCILL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+S="${WORKDIR}"/Source_ENM2011
+
+src_prepare() {
+ cp "${FILESDIR}"/CMakeLists.txt . || die
+}
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use examples EXAMPLES)
+ )
+ cmake-utils_src_configure
+}
diff --git a/sci-chemistry/phaser/Manifest b/sci-chemistry/phaser/Manifest
new file mode 100644
index 000000000000..33872db5dc96
--- /dev/null
+++ b/sci-chemistry/phaser/Manifest
@@ -0,0 +1 @@
+DIST ccp4-6.1.13-phaser-cctbx-src.tar.gz 22021353 SHA256 e6c4365cb34da5ce2dd5f1e74b8927258064016194446163418c8a3139a4b804
diff --git a/sci-chemistry/phaser/files/phaser-2.1.4-chmod.patch b/sci-chemistry/phaser/files/phaser-2.1.4-chmod.patch
new file mode 100644
index 000000000000..5311cb332785
--- /dev/null
+++ b/sci-chemistry/phaser/files/phaser-2.1.4-chmod.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py b/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
+index 3b1bd3a..8939a74 100755
+--- a/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
++++ b/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
+@@ -802,8 +802,6 @@ class environment:
+ else:
+ action = self.write_bin_sh_dispatcher
+ ext = ""
+- try: os.chmod(source_file, 0755)
+- except OSError: pass
+ target_file_ext = target_file + ext
+ remove_or_rename(target_file_ext)
+ try: action(source_file, target_file_ext)
diff --git a/sci-chemistry/phaser/metadata.xml b/sci-chemistry/phaser/metadata.xml
new file mode 100644
index 000000000000..6b4826474daa
--- /dev/null
+++ b/sci-chemistry/phaser/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <description>ccp4 maintainer</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/phaser/phaser-2.1.4.ebuild b/sci-chemistry/phaser/phaser-2.1.4.ebuild
new file mode 100644
index 000000000000..86fa57f52603
--- /dev/null
+++ b/sci-chemistry/phaser/phaser-2.1.4.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils flag-o-matic python-single-r1 toolchain-funcs
+
+CCP4VER="6.1.13"
+
+DESCRIPTION="A program for phasing macromolecular crystal structures"
+HOMEPAGE="http://www-structmed.cimr.cam.ac.uk/phaser"
+SRC_URI="ftp://ftp.ccp4.ac.uk/ccp4/${CCP4VER}/ccp4-${CCP4VER}-${PN}-cctbx-src.tar.gz"
+
+LICENSE="|| ( phaser phaser-com ccp4 )"
+SLOT="0"
+#KEYWORDS="~amd64 ~x86"
+KEYWORDS=""
+IUSE="openmp"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-shells/tcsh"
+
+S="${WORKDIR}"/ccp4-${CCP4VER}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/phaser-2.1.4-chmod.patch \
+ "${FILESDIR}"/phaser-2.1.4-ldflags.patch
+
+ use openmp && append-flags -fopenmp
+
+ for i in ${CXXFLAGS}; do
+ OPTS="${OPTS} \"${i}\","
+ done
+
+ OPTS=${OPTS%,}
+
+ sed -i \
+ -e "s:opts = \[.*\]$:opts = \[${OPTS}\]:g" \
+ "${S}"/lib/cctbx/cctbx_sources/libtbx/SConscript || die
+
+ for i in ${LDFLAGS}; do
+ OPTSLD="${OPTSLD} \"${i}\","
+ done
+
+ sed -i \
+ -e "s:env_etc.shlinkflags .* \"-shared\":env_etc.shlinkflags = \[ ${OPTSLD} \"-shared\"\]:g" \
+ -e "s:\[\"-static:\[${OPTSLD} \"-static:g" \
+ "${S}"/lib/cctbx/cctbx_sources/libtbx/SConscript || die
+
+}
+
+src_configure() {
+ local compiler
+ local mtype
+ local mversion
+ local nproc
+
+ # Valid compilers are win32_cl, sunos_CC, unix_gcc, unix_ecc,
+ # unix_icc, unix_icpc, tru64_cxx, hp_ux11_aCC, irix_CC,
+ # darwin_c++, darwin_gcc. The build systems seems to prepend
+ # unix_ all by itself. Can this be derived from $(tc-getCC)?
+ compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+
+ # Breaks cross compilation.
+ mtype=$(src/${PN}/bin/machine_type)
+ mversion=$(src/${PN}/bin/machine_version)
+
+ einfo "Creating build directory"
+ mkdir build
+ cd build
+ ln -sf "${S}/lib/cctbx/cctbx_sources/scons" scons
+ ln -sf "${S}/lib/cctbx/cctbx_sources/libtbx" libtbx
+
+ einfo "Configuring phaser components"
+ $(PYTHON) "libtbx/configure.py" \
+ --build=release \
+ --compiler=${compiler} \
+ --repository="${S}"/src/${PN}/source \
+ --repository="${S}"/lib/cctbx/cctbx_sources \
+ --static_libraries \
+ ccp4io="${S}" \
+ mmtbx \
+ phaser || die "configure.py failed"
+}
+
+src_compile() {
+ nproc=`echo "-j1 ${MAKEOPTS}" \
+ | sed -e "s/.*\(-j\s*\|--jobs=\)\([0-9]\+\).*/\2/"`
+
+ cd build
+ einfo "Setting up build environment"
+ source setpaths.sh
+
+ einfo "Compiling phaser components"
+ libtbx.scons -j ${nproc} || die "libtbx.scons failed"
+}
+
+src_install() {
+ dobin build/exe/phaser || die
+
+ cat >> "${T}"/53${PN} <<- EOF
+ PHASER="${EPREFIX}/usr/bin"
+ PHASER_ENVIRONMENT="1"
+ PHASER_MTYPE="${mtype}"
+ PHASER_MVERSION="${mversion}"
+ PHASER_VERSION="${PV}"
+ EOF
+
+ doenvd "${T}"/53${PN} || die
+}
diff --git a/sci-chemistry/platon/Manifest b/sci-chemistry/platon/Manifest
new file mode 100644
index 000000000000..df5e86cadaa7
--- /dev/null
+++ b/sci-chemistry/platon/Manifest
@@ -0,0 +1 @@
+DIST platon-20110126.tar.gz 10893404 SHA256 23651224b5f3653c82673f7d6c2339cfee1e8f59ad32fa51d7c9770f5cb014d6
diff --git a/sci-chemistry/platon/files/20110126-buffer-overflow.patch b/sci-chemistry/platon/files/20110126-buffer-overflow.patch
new file mode 100644
index 000000000000..548bd2b20ca4
--- /dev/null
+++ b/sci-chemistry/platon/files/20110126-buffer-overflow.patch
@@ -0,0 +1,15 @@
+--- xdrvr.c 2010-06-27 15:21:49.026967128 +0200
++++ xdrvr_new.c 2010-06-27 15:22:57.132069867 +0200
+@@ -864,11 +864,9 @@
+ int zdate_(string)
+ char *string;
+ {
+- static char tmp[25];
+ time_t now;
+ now = time(NULL);
+- strcpy(tmp,ctime(&now));
+- strncpy(string,tmp,25);
++ strncpy(string,ctime(&now),25);
+ return(1);
+ }
+ int slaap_(int *i) \ No newline at end of file
diff --git a/sci-chemistry/platon/metadata.xml b/sci-chemistry/platon/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/platon/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/platon/platon-20110126.ebuild b/sci-chemistry/platon/platon-20110126.ebuild
new file mode 100644
index 000000000000..2c376a367c25
--- /dev/null
+++ b/sci-chemistry/platon/platon-20110126.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Versatile, SHELX-97 compatible, multipurpose crystallographic tool"
+HOMEPAGE="http://www.cryst.chem.uu.nl/platon/"
+SRC_URI="http://www.cryst.chem.uu.nl/xraysoft/unix/${PN}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+# Can't do libf2c dependent on whether <gcc-4 is selected for the build,
+# so we must always require it
+RDEPEND="x11-libs/libX11"
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${PN}"
+
+pkg_nofetch() {
+ elog "If there is a digest mismatch, please file a bug"
+ elog "at https://bugs.gentoo.org/ -- a version bump"
+ elog "is probably required."
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ gunzip platon.f.gz xdrvr.c.gz || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-buffer-overflow.patch
+}
+
+src_compile() {
+ # easy to ICE, at least on gcc 4.3
+ strip-flags
+
+ COMMAND="$(tc-getCC) -c ${CFLAGS} xdrvr.c"
+ echo ${COMMAND}
+ ${COMMAND} || die "Compilation of xdrvr.c failed"
+ COMMAND="$(tc-getFC) -c ${FFLAGS:- -O2} -fno-second-underscore platon.f"
+ echo ${COMMAND}
+ ${COMMAND} || die "Compilation of platon.f failed"
+ COMMAND="$(tc-getFC) -o platon ${LDFLAGS} platon.o xdrvr.o -lX11 ${F2C}"
+ echo ${COMMAND}
+ ${COMMAND} || die "Linking failed"
+}
+
+src_install() {
+ dobin platon
+
+ for bin in pluton s cifchk helena stidy; do
+ dosym platon /usr/bin/${bin}
+ done
+
+ insinto /usr/$(get_libdir)/platon
+ doins check.def
+
+ echo "CHECKDEF=\"${EPREFIX}/usr/$(get_libdir)/platon/check.def\"" > "${T}"/env.d
+ newenvd "${T}"/env.d 50platon
+
+ dodoc README.*
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r TEST
+ fi
+}
diff --git a/sci-chemistry/pointless/Manifest b/sci-chemistry/pointless/Manifest
new file mode 100644
index 000000000000..63884312ae57
--- /dev/null
+++ b/sci-chemistry/pointless/Manifest
@@ -0,0 +1,2 @@
+DIST pointless-1.6.14.tar.gz 423657 SHA256 68f0c1f65239b1451310fe885c2b9d51fc558de7b43af1e584750e05dc5635d8 SHA512 9dd524a7c842edc01206450c52ca1a01e8e3ee6f9ff71742789943ee10e006b5452b0be3aa509dd16bb85f1b9c3d7954616a78ec2fef2daea7c0ab42cdaa42b9 WHIRLPOOL 5085afbd88713384039ef2c2b4b2f7fddd8f078dca9df54062b0415e970791868c61df98f4044b4e061077a73b4e129b6e5db34852d64cace48108db9c6ae50f
+DIST pointless-1.6.2.tar.gz 412244 SHA256 5e09ca592ea565e8ace142fc0edff39d0ab723f4ac6e2cadd6ba571d667c80f6
diff --git a/sci-chemistry/pointless/files/1.5.1-gcc4.4.patch b/sci-chemistry/pointless/files/1.5.1-gcc4.4.patch
new file mode 100644
index 000000000000..ca67dbd3f336
--- /dev/null
+++ b/sci-chemistry/pointless/files/1.5.1-gcc4.4.patch
@@ -0,0 +1,12 @@
+diff --git a/string_util.hh b/string_util.hh
+index 66af6f3..047512b 100644
+--- a/string_util.hh
++++ b/string_util.hh
+@@ -3,6 +3,7 @@
+
+ #include <string>
+ #include <vector>
++#include <stdio.h>
+ #include "range.hh"
+
+ //======================================================================
diff --git a/sci-chemistry/pointless/metadata.xml b/sci-chemistry/pointless/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/pointless/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pointless/pointless-1.6.14-r1.ebuild b/sci-chemistry/pointless/pointless-1.6.14-r1.ebuild
new file mode 100644
index 000000000000..d983cb290242
--- /dev/null
+++ b/sci-chemistry/pointless/pointless-1.6.14-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fortran-2 multilib python-single-r1 toolchain-funcs
+
+DESCRIPTION="Scores crystallographic Laue and space groups"
+HOMEPAGE="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/pointless.html"
+SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+ sci-chemistry/ccp4-apps
+ >=sci-libs/ccp4-libs-6.1.3-r10
+ sci-libs/clipper
+ sci-libs/fftw:2.1
+ sci-libs/mmdb
+ >=sci-libs/cctbx-2010.03.29.2334-r3[${PYTHON_USEDEP}]"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/1.5.1-gcc4.4.patch
+}
+
+src_compile() {
+ emake \
+ -f Makefile.make \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ CLIB="${EPREFIX}/usr/$(get_libdir)" \
+ CCTBX_VERSION=2010 \
+ ICCP4=-I"${EPREFIX}/usr/include/ccp4" \
+ ITBX="-I${EPREFIX}/usr/include" \
+ ICLPR="-I${EPREFIX}/$(python_get_sitedir)/" \
+ LTBX="-L${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build/lib -lcctbx" \
+ SLIB="-L${EPREFIX}/usr/$(get_libdir) -lgfortran"
+}
+
+src_install() {
+ dobin pointless othercell
+}
diff --git a/sci-chemistry/pointless/pointless-1.6.14.ebuild b/sci-chemistry/pointless/pointless-1.6.14.ebuild
new file mode 100644
index 000000000000..158bde017aea
--- /dev/null
+++ b/sci-chemistry/pointless/pointless-1.6.14.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit eutils fortran-2 multilib python toolchain-funcs
+
+DESCRIPTION="Scores crystallographic Laue and space groups"
+HOMEPAGE="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/pointless.html"
+SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ sci-chemistry/ccp4-apps
+ >=sci-libs/ccp4-libs-6.1.3-r10
+ sci-libs/clipper
+ sci-libs/fftw:2.1
+ sci-libs/mmdb
+ >=sci-libs/cctbx-2010.03.29.2334-r3"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python_set_active_version 2
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/1.5.1-gcc4.4.patch
+}
+
+src_compile() {
+ emake \
+ -f Makefile.make \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ CLIB="${EPREFIX}/usr/$(get_libdir)" \
+ CCTBX_VERSION=2010 \
+ ICCP4=-I"${EPREFIX}/usr/include/ccp4" \
+ ITBX="-I${EPREFIX}/usr/include" \
+ ICLPR="-I${EPREFIX}/$(python_get_sitedir)/" \
+ LTBX="-L${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build/lib -lcctbx" \
+ SLIB="-L${EPREFIX}/usr/$(get_libdir) -lgfortran" \
+ || die
+}
+
+src_install() {
+ dobin pointless othercell || die
+}
diff --git a/sci-chemistry/pointless/pointless-1.6.2.ebuild b/sci-chemistry/pointless/pointless-1.6.2.ebuild
new file mode 100644
index 000000000000..2b9f0ad4faa0
--- /dev/null
+++ b/sci-chemistry/pointless/pointless-1.6.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
+
+PYTHON_DEPEND="2"
+
+inherit eutils fortran-2 multilib python toolchain-funcs
+
+DESCRIPTION="Scores crystallographic Laue and space groups"
+HOMEPAGE="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/pointless.html"
+SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ sci-chemistry/ccp4-apps
+ >=sci-libs/ccp4-libs-6.1.3-r10
+ sci-libs/clipper
+ sci-libs/fftw:2.1
+ sci-libs/mmdb
+ >=sci-libs/cctbx-2010.03.29.2334-r3"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python_pkg_setup
+ python_set_active_version 2
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/1.5.1-gcc4.4.patch
+}
+
+src_compile() {
+ emake \
+ -f Makefile.make \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ CLIB="${EPREFIX}/usr/$(get_libdir)" \
+ CCTBX_VERSION=2010 \
+ ICCP4=-I"${EPREFIX}/usr/include/ccp4" \
+ ITBX="-I${EPREFIX}/usr/include" \
+ ICLPR="-I${EPREFIX}/$(python_get_sitedir)/" \
+ LTBX="-L${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build/lib -lcctbx" \
+ SLIB="-L${EPREFIX}/usr/$(get_libdir) -lgfortran"
+}
+
+src_install() {
+ dobin pointless othercell
+}
diff --git a/sci-chemistry/povscript+/Manifest b/sci-chemistry/povscript+/Manifest
new file mode 100644
index 000000000000..86635b8f451c
--- /dev/null
+++ b/sci-chemistry/povscript+/Manifest
@@ -0,0 +1,2 @@
+DIST molscript-2.1.2pov2.19.tar.gz 845101 SHA256 4d35ed30898508df85c1db6e18385b56f8aed1f79db65195be6fdb23d3c49b68 SHA512 11796552a889ae309ebac31047440732921cd300d89ad284beb3655e2797fe1a68adf9a5a7e54e6668ea240c5b0897c22f65d839870ee43591854976000ab05f WHIRLPOOL cf19cf28304f49a1de6a1d787de18c939b4dcd5ae2d813ac48e8d5f2a572de4cee6bafdd8613e47ca7a5b5b3891108308c808687162deb23d39dcd07a69dcd35
+DIST molscript-2.1.2pov2.20.tar.gz 822930 SHA256 a3a9ae8792fbfba1df6e279c913db3ee4a89612c94b6088be874ed69372ab7a6 SHA512 f7cae4d9b583a05962742ee36ec717f0ecac6bb88086bcfa484b51b0d2e16a15920bc7c09d9d777453d7ef7b81be444924d15a889e4725bfca7bf517d4e52db2 WHIRLPOOL 8c12ea5ebc234f2277e04e502a314cb0065cb717e1cff067d9ad8d306395972f2b6d7589f3a7e58dfa019dc3eb0cf11582ee9b92f1bb3b17c8f9cfc5c4b57a2a
diff --git a/sci-chemistry/povscript+/files/povscript+-2.1.2.2.19-libpng15.patch b/sci-chemistry/povscript+/files/povscript+-2.1.2.2.19-libpng15.patch
new file mode 100644
index 000000000000..054967d6555c
--- /dev/null
+++ b/sci-chemistry/povscript+/files/povscript+-2.1.2.2.19-libpng15.patch
@@ -0,0 +1,19 @@
+--- src/png_img.c
++++ src/png_img.c
+@@ -18,6 +18,7 @@
+
+ #include MS_GL_H
+
++#include <zlib.h>
+ #include <png.h>
+
+ #include "clib/str_utils.h"
+@@ -69,7 +70,7 @@
+ info_ptr = png_create_info_struct (png_ptr);
+ if (info_ptr == NULL)
+ yyerror ("png_img: could not create PNG info structure");
+- if (setjmp (png_ptr->jmpbuf)) yyerror ("png_img: could not setjmp");
++ if (setjmp (png_jmpbuf(png_ptr))) yyerror ("png_img: could not setjmp");
+
+ png_init_io (png_ptr, outfile);
+ png_set_compression_level (png_ptr, compression_level);
diff --git a/sci-chemistry/povscript+/metadata.xml b/sci-chemistry/povscript+/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/povscript+/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/povscript+/povscript+-2.1.2.2.19.ebuild b/sci-chemistry/povscript+/povscript+-2.1.2.2.19.ebuild
new file mode 100644
index 000000000000..a36a07a34519
--- /dev/null
+++ b/sci-chemistry/povscript+/povscript+-2.1.2.2.19.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils versionator
+
+V1=$(get_version_component_range 1 ${PV})
+V2=$(get_version_component_range 2 ${PV})
+V3=$(get_version_component_range 3 ${PV})
+V4=$(get_version_component_range 4 ${PV})
+V5=$(get_version_component_range 5 ${PV})
+
+MY_P=molscript-${V1}.${V2}.${V3}pov${V4}.${V5}
+
+DESCRIPTION="Modified molscript that uses POV-Ray, does thermal ellipsoids, and more"
+HOMEPAGE="https://sites.google.com/site/timfenn/povscript"
+SRC_URI="https://sites.google.com/site/timfenn/povscript/${MY_P}.tar.gz"
+
+LICENSE="glut molscript"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-libs/glib:2
+ media-libs/freeglut
+ media-libs/giflib
+ >=media-libs/libpng-1.4
+ sci-libs/gts
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ virtual/opengl
+ x11-libs/libX11"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-libpng15.patch
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ cd "${D}"/usr/bin
+ mv molscript povscript+
+ mv molauto povauto+
+}
+
+pkg_postinst() {
+ elog "You must install media-gfx/povray to use the POV backend,"
+ elog "which is one of the main features of this over molscript."
+}
diff --git a/sci-chemistry/povscript+/povscript+-2.1.2.2.20.ebuild b/sci-chemistry/povscript+/povscript+-2.1.2.2.20.ebuild
new file mode 100644
index 000000000000..fb12cea4396a
--- /dev/null
+++ b/sci-chemistry/povscript+/povscript+-2.1.2.2.20.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator
+
+V1=$(get_version_component_range 1 ${PV})
+V2=$(get_version_component_range 2 ${PV})
+V3=$(get_version_component_range 3 ${PV})
+V4=$(get_version_component_range 4 ${PV})
+V5=$(get_version_component_range 5 ${PV})
+
+MY_P=molscript-${V1}.${V2}.${V3}pov${V4}.${V5}
+
+DESCRIPTION="Modified molscript that uses POV-Ray, does thermal ellipsoids, and more"
+HOMEPAGE="https://sites.google.com/site/timfenn/povscript"
+SRC_URI="https://sites.google.com/site/timfenn/povscript/${MY_P}.tar.gz"
+
+SLOT="0"
+LICENSE="glut molscript"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-libs/glib:2
+ media-libs/freeglut
+ media-libs/giflib
+ >=media-libs/libpng-1.4
+ sci-libs/gts
+ sys-libs/zlib
+ virtual/glu
+ virtual/jpeg
+ virtual/opengl
+ x11-libs/libX11"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.1.2.2.19-libpng15.patch
+}
+
+src_install() {
+ default
+
+ cd "${ED}"/usr/bin || die
+ mv molscript povscript+ || die
+ mv molauto povauto+ || die
+}
+
+pkg_postinst() {
+ elog "You must install media-gfx/povray to use the POV backend,"
+ elog "which is one of the main features of this over molscript."
+}
diff --git a/sci-chemistry/prekin/Manifest b/sci-chemistry/prekin/Manifest
new file mode 100644
index 000000000000..58c94aa2baad
--- /dev/null
+++ b/sci-chemistry/prekin/Manifest
@@ -0,0 +1 @@
+DIST prekin.6.51.081122.src.tgz 350756 SHA256 74a771cd8be000df13ac908f23a2e945e8bd3590884c6bc6ccff75804cc0fb7a
diff --git a/sci-chemistry/prekin/files/6.51.081122-Makefile.patch b/sci-chemistry/prekin/files/6.51.081122-Makefile.patch
new file mode 100644
index 000000000000..5fd9d00d9b06
--- /dev/null
+++ b/sci-chemistry/prekin/files/6.51.081122-Makefile.patch
@@ -0,0 +1,41 @@
+diff --git a/Makefile.linux b/Makefile.linux
+index 65a021a..3daacd8 100755
+--- a/Makefile.linux
++++ b/Makefile.linux
+@@ -1,15 +1,15 @@
+ #
+-CFLAGS = -I/usr/X11R6/include
++CFLAGS += -I/usr/X11R6/include
+
+ ifeq ($(MAKECMDGOALS),debug)
+ CFLAGS = -g -I/usr/X11R6/include
+ endif
+
+-LIBS = -L/usr/lib -L/usr/X11R6/lib -lXmu -lXm -lXt -lSM -lICE -lXext -lX11
++LIBS = -L/usr/GENTOOLIBDIR -L/usr/X11R6/lib -lXmu -lXm -lXt -lSM -lICE -lXext -lX11
+
+ ifeq ($(MAKECMDGOALS),nogui)
+-CFLAGS = -D NOGUI -I/usr/X11R6/include
+-LIBS = -L/usr/lib -L/usr/X11R6/lib -lXmu -lXt -lSM -lICE -lXext -lX11
++CFLAGS += -D NOGUI -I/usr/X11R6/include
++LIBS = -L/usr/GENTOOLIBDIR -L/usr/X11R6/lib -lXmu -lXt -lSM -lICE -lXext -lX11
+ endif
+
+ FIN = -lm -pthread #for RH9.0, ok for RH7.3 & RH8.0
+@@ -26,13 +26,13 @@ OBJS = PKINANGL.o PKINCRTL.o PKINCSBS.o PKINCSUB.o PKINCOUT.o PKINMENU.o PKINROT
+ # Commands specific to clients created by this Makefile
+
+ prekin: $(OBJS)
+- cc -o prekin $(CFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
++ cc -o prekin $(CFLAGS) $(LDFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
+
+ debug: $(OBJS)
+- cc -o prekin $(CFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
++ cc -o prekin $(CFLAGS) $(LDFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
+
+ nogui: $(OBJS)
+- cc -o prekin $(CFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
++ cc -o prekin $(CFLAGS) $(LDFLAGS) $(OBJS) -L/usr/X11R6/lib $(LIBS) -ldl $(FIN)
+
+ clean:
+ rm *.o
diff --git a/sci-chemistry/prekin/files/6.51.081122-overflow.patch b/sci-chemistry/prekin/files/6.51.081122-overflow.patch
new file mode 100644
index 000000000000..27bc01d61a52
--- /dev/null
+++ b/sci-chemistry/prekin/files/6.51.081122-overflow.patch
@@ -0,0 +1,28 @@
+diff --git a/PKIN.h b/PKIN.h
+index 6cb6670..c9c6b89 100755
+--- a/PKIN.h
++++ b/PKIN.h
+@@ -533,8 +533,8 @@ EXTERN float xnext,ynext,znext,onext,Bnext,Uvalnext;
+ EXTERN char aspectstrnext[MAXaspects+3]; /*in parens: (XXXX)*/
+
+ /* possible overlap with earlier PREKIN variables */
+-EXTERN char word[256],texts[256],temps[256];
+-EXTERN char alertstr[256],alertstr2[256],alertstr3[256];
++EXTERN char word[256],texts[256],temps[512];
++EXTERN char alertstr[1024],alertstr2[256],alertstr3[256];
+ EXTERN char oldstr[256],olderstr[256],newstr[256],InfoStr[256],MolNameStr[16];
+ EXTERN char NameStr[256],OutfileStr[256],ScriptinStr[256],ShortNameStr[256];
+ EXTERN char DirStr[256],PDBfileStr[256],helpoutStr[256]; /*040425 helpout*/
+diff --git a/PKINCOUT.c b/PKINCOUT.c
+index af8eb24..a9f3a5f 100755
+--- a/PKINCOUT.c
++++ b/PKINCOUT.c
+@@ -17,7 +17,7 @@ static float VRMLx=0,VRMLy=0,VRMLz=0;
+ void writeoutput()
+ {
+ char cntl[5]; /* 4 actual characters */
+- char kol[20],extra[256],aname[13];
++ char kol[20],extra[256],aname[32];
+ char chain[32],atoms[32],cpks[32],hygen[32],hbond[32];
+ char subname[32],allstr[32];
+ char mastername[32]; /*051128*/
diff --git a/sci-chemistry/prekin/metadata.xml b/sci-chemistry/prekin/metadata.xml
new file mode 100644
index 000000000000..9ac9ffdb3a41
--- /dev/null
+++ b/sci-chemistry/prekin/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/prekin/prekin-6.51.081122-r1.ebuild b/sci-chemistry/prekin/prekin-6.51.081122-r1.ebuild
new file mode 100644
index 000000000000..9e0521c7dbcc
--- /dev/null
+++ b/sci-chemistry/prekin/prekin-6.51.081122-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit toolchain-funcs eutils multilib
+
+MY_P=${PN}.${PV}
+
+DESCRIPTION="Prepares molecular kinemages (input files for Mage & KiNG) from PDB-format coordinate files"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/prekin.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/${PN}/${MY_P}.src.tgz"
+
+LICENSE="richardson"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="X"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ X? ( >=x11-libs/motif-2.3:0 )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-Makefile.patch \
+ "${FILESDIR}"/${PV}-overflow.patch
+ sed \
+ -e 's:cc:$(CC):g' \
+ -e "s:GENTOOLIBDIR:$(get_libdir):g" \
+ "${S}"/Makefile.linux > Makefile || die
+}
+
+src_compile() {
+ local mytarget
+
+ if use X; then
+ mytarget="${PN}"
+ else
+ mytarget="nogui"
+ fi
+
+ emake CC="$(tc-getCC)" ${mytarget} || die
+}
+
+src_install() {
+ dobin "${S}"/prekin || die
+}
diff --git a/sci-chemistry/probe/Manifest b/sci-chemistry/probe/Manifest
new file mode 100644
index 000000000000..f5dd9226d404
--- /dev/null
+++ b/sci-chemistry/probe/Manifest
@@ -0,0 +1,2 @@
+DIST probe.2.12.110413.src.zip 262460 SHA256 90cd0a693683958a8ac05d13a47c2b464f2939df24369bf5c568f59913756de4 SHA512 ac6a92f1666d1819c0dede5ea97113c9e03271c42b829d88a2b65041dec7f853441fc61e94e48782078884a9a69c1043432ca3576768d31bfe9190d3ea1da4c8 WHIRLPOOL f6e6ec43016d14114ae5cbfdbfd1cdb5bdf0c6a1c34742b0fef0cfe5ee39409a41b4b2127fbefe526d66d99c33b91ef5e3ea4c9de33784f9ea493700e8bc8784
+DIST probe.2.13.110909.src.zip 131063 SHA256 df14b76d27a7c43b2b57c315d0ad71cdf6acc7943c43195a797162be7816fa71 SHA512 5efa066873d0e139da66bf8edb541fe42df94e99cab171ad8d06a8a6f5caada982ef5b18481e748b224dbed86f63c99237d04ecd107c82855b44de91fb6d2b16 WHIRLPOOL 12f6fefe1b03b71268f39fa3aa7ad796230c76c2e029b8dc86955abd43c8e3f09f7591f84cd79c7ba11037d5b323c922ddf36abf6911d556981f5cc21378912f
diff --git a/sci-chemistry/probe/files/2.12.110413-as-needed.patch b/sci-chemistry/probe/files/2.12.110413-as-needed.patch
new file mode 100644
index 000000000000..95368625505d
--- /dev/null
+++ b/sci-chemistry/probe/files/2.12.110413-as-needed.patch
@@ -0,0 +1,38 @@
+ Makefile | 13 ++++++-------
+ 1 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e6a740e..8f74d6a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,14 +1,12 @@
+-MACHINEFLAGS =
+-CFLAGS = $(MACHINEFLAGS)
+-LFLAGS = -lm $(MACHINEFLAGS)
++LIBS = -lm
+ OBJLIST = dots.o abin.o readPDBrecs.o geom3d.o utility.o select.o \
+- parse.o atomprops.o stdconntable.o autobondrot.o
++ parse.o atomprops.o stdconntable.o autobondrot.o hybrid_36_c.o
+
+ .c.o:
+- cc -c $*.c $(CFLAGS)
++ $(CC) $(CFLAGS) -c $*.c
+
+ probe: probe.o $(OBJLIST)
+- cc -o $@ probe.o $(OBJLIST) $(LFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ probe.o $(OBJLIST) $(LIBS)
+
+ clean:
+ @rm -f *.o *.ckp
+@@ -30,9 +28,10 @@ parse.o: ./parse.h ./utility.h parse.c
+ probe.o: ./abin.h ./atomprops.h ./autobondrot.h ./dots.h ./geom3d.h \
+ ./parse.h ./probe.h ./readPDBrecs.h ./select.h \
+ ./stdconntable.h ./utility.h probe.c
+-readPDBrecs.o: ./geom3d.h ./readPDBrecs.h ./utility.h readPDBrecs.c
++readPDBrecs.o: ./geom3d.h ./readPDBrecs.h ./utility.h ./hybrid_36_c.h readPDBrecs.c
+ select.o: ./abin.h ./atomprops.h ./geom3d.h ./parse.h ./select.h \
+ ./stdconntable.h ./utility.h select.c
+ stdconntable.o: ./stdconntable.h stdconntable.c
+ utility.o: utility.c
++hybrid_36_c.o: ./hybrid_36_c.h hybrid_36_c.c
+ # DO NOT DELETE THIS 2nd LINE -- make depend uses it
diff --git a/sci-chemistry/probe/files/as-needed.patch b/sci-chemistry/probe/files/as-needed.patch
new file mode 100644
index 000000000000..9ddecf5f569e
--- /dev/null
+++ b/sci-chemistry/probe/files/as-needed.patch
@@ -0,0 +1,21 @@
+diff --git a/Makefile b/Makefile
+index 68d7469..bcb821c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ MACHINEFLAGS =
+ CFLAGS = $(MACHINEFLAGS)
+-LFLAGS = -lm $(MACHINEFLAGS)
++LFLAGS = -lm
+ OBJLIST = dots.o abin.o readPDBrecs.o geom3d.o utility.o select.o \
+ parse.o atomprops.o stdconntable.o autobondrot.o hybrid_36_c.o
+
+@@ -8,7 +8,7 @@ OBJLIST = dots.o abin.o readPDBrecs.o geom3d.o utility.o select.o \
+ cc -c $*.c $(CFLAGS)
+
+ probe: probe.o $(OBJLIST)
+- cc -o $@ probe.o $(OBJLIST) $(LFLAGS)
++ cc $(MACHINEFLAGS) -o $@ probe.o $(OBJLIST) $(LFLAGS)
+
+ clean:
+ @rm -f *.o *.ckp
diff --git a/sci-chemistry/probe/files/probe-2.13.110909-as-needed.patch b/sci-chemistry/probe/files/probe-2.13.110909-as-needed.patch
new file mode 100644
index 000000000000..df7040c3ba1d
--- /dev/null
+++ b/sci-chemistry/probe/files/probe-2.13.110909-as-needed.patch
@@ -0,0 +1,25 @@
+ Makefile | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9031bd0..8f74d6a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,14 +1,12 @@
+-MACHINEFLAGS =
+-CFLAGS = $(MACHINEFLAGS)
+-LFLAGS = -static -lm $(MACHINEFLAGS)
++LIBS = -lm
+ OBJLIST = dots.o abin.o readPDBrecs.o geom3d.o utility.o select.o \
+ parse.o atomprops.o stdconntable.o autobondrot.o hybrid_36_c.o
+
+ .c.o:
+- cc -c $*.c $(CFLAGS)
++ $(CC) $(CFLAGS) -c $*.c
+
+ probe: probe.o $(OBJLIST)
+- cc -o $@ probe.o $(OBJLIST) $(LFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ probe.o $(OBJLIST) $(LIBS)
+
+ clean:
+ @rm -f *.o *.ckp
diff --git a/sci-chemistry/probe/metadata.xml b/sci-chemistry/probe/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/probe/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/probe/probe-2.12.110413.ebuild b/sci-chemistry/probe/probe-2.12.110413.ebuild
new file mode 100644
index 000000000000..bb0a36a232de
--- /dev/null
+++ b/sci-chemistry/probe/probe-2.12.110413.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}.${PV}"
+
+DESCRIPTION="Evaluates atomic packing within or between molecules"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/probe.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/probe/${MY_P}.src.zip"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}"/trunk
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-as-needed.patch
+ # Respect CC
+ sed -i \
+ -e 's:cc:$(CC):g' \
+ "${S}"/Makefile || die
+ tc-export CC
+}
+
+src_install() {
+ dobin "${S}"/probe
+ dodoc "${S}"/README*
+}
diff --git a/sci-chemistry/probe/probe-2.13.110909.ebuild b/sci-chemistry/probe/probe-2.13.110909.ebuild
new file mode 100644
index 000000000000..a841b16de30f
--- /dev/null
+++ b/sci-chemistry/probe/probe-2.13.110909.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}.${PV}"
+
+DESCRIPTION="Evaluates atomic packing within or between molecules"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/probe.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/probe/${MY_P}.src.zip"
+
+SLOT="0"
+LICENSE="richardson"
+KEYWORDS="amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}"/${MY_P}.src
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-as-needed.patch
+ tc-export CC
+}
+
+src_install() {
+ dobin "${S}"/probe
+ dodoc "${S}"/README*
+}
diff --git a/sci-chemistry/procheck/Manifest b/sci-chemistry/procheck/Manifest
new file mode 100644
index 000000000000..c50c49d67536
--- /dev/null
+++ b/sci-chemistry/procheck/Manifest
@@ -0,0 +1,3 @@
+DIST procheck-3.5.4-README 6585 SHA256 202d5b4d9ffaebdad19c368e6e6fd8ab54744c511609b1c609ef46c21fa0ffa0 SHA512 c6eff94cef9b67fd61884e88fa77ec381553d4dba53f477023738e1e44a6191c4241b14543ee7ecb93b049f16f262db2a09cf5d1a63248057633aab290f1f82a WHIRLPOOL 53a618978a9285e8a8f09c7ebd3e34951a8c1056c0894c1f4e4c11f73ad3127829322c9c7597fc6dea98f1fa4c40552e6caf383eed15aaeef0594cf93887d196
+DIST procheck-3.5.4-manual.tar.gz 517840 SHA256 3c2faa505be05102ccbe23473abdddc1cd4dc87c6b5e74222b7ea5c27b18db5a
+DIST procheck-3.5.4.tar.gz 522013 SHA256 4923fe5a7b86d5369fd639d0c77cfb866e574f076ec8c52424d746e843a404f4 SHA512 1dd78b53070484fbcdca51001fd147ab13fd5e51b3d1da54fd529531917c31012393751ee514f0c79d579b17a1701dde04f81b1c9ac27b2b835a43fa96785ecc WHIRLPOOL 2732981bdbb5269567019a645b401009bd48d782ab20b4f68bd213a90f7248a9fa3f46ab3a026aa0515a677a99826040d4c3f5464816ed4390b5091a6a98b375
diff --git a/sci-chemistry/procheck/files/3.5.4-ldflags.patch b/sci-chemistry/procheck/files/3.5.4-ldflags.patch
new file mode 100644
index 000000000000..453aebe3211f
--- /dev/null
+++ b/sci-chemistry/procheck/files/3.5.4-ldflags.patch
@@ -0,0 +1,49 @@
+diff --git a/Makefile b/Makefile
+index c5bb58f..0394b0a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,31 +35,31 @@ distrib :
+ # Individual executables
+ # ----------------------
+ anglen : anglen.o
+- $(F77) $(FOPTS) -o $@ anglen.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ anglen.o
+ clean : clean.o
+- $(F77) $(FOPTS) -o $@ clean.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ clean.o
+ rmsdev : rmsdev.o
+- $(F77) $(FOPTS) -o $@ rmsdev.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ rmsdev.o
+ secstr : secstr.o
+- $(F77) $(FOPTS) -o $@ secstr.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ secstr.o
+ gfac2pdb : gfac2pdb.o ps.o
+- $(F77) $(FOPTS) -o $@ gfac2pdb.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ gfac2pdb.o ps.o
+ pplot : pplot.o ps.o
+- $(F77) $(FOPTS) -o $@ pplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ pplot.o ps.o
+ bplot : bplot.o ps.o
+- $(F77) $(FOPTS) -o $@ bplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ bplot.o ps.o
+ tplot : tplot.o ps.o
+- $(F77) $(FOPTS) -o $@ tplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ tplot.o ps.o
+ mplot : mplot.o ps.o
+- $(F77) $(FOPTS) -o $@ mplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ mplot.o ps.o
+ vplot : vplot.o ps.o
+- $(F77) $(FOPTS) -o $@ vplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ vplot.o ps.o
+ viol2pdb : viol2pdb.o ps.o
+- $(F77) $(FOPTS) -o $@ viol2pdb.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ viol2pdb.o ps.o
+ wirplot : wirplot.o ps.o
+- $(F77) $(FOPTS) -o $@ wirplot.o ps.o
++ $(F77) $(FOPTS) $(LDFLAGS) -o $@ wirplot.o ps.o
+ nb : nb.c
+- $(CC) $(COPTS) -o nb nb.c $(CLIBS)
++ $(CC) $(COPTS) $(LDFLAGS) -o nb nb.c $(CLIBS)
+
+ # Individual rules for FORTRAN files with .inc files
+ # --------------------------------------------------
diff --git a/sci-chemistry/procheck/files/procheck-3.5.4-close.patch b/sci-chemistry/procheck/files/procheck-3.5.4-close.patch
new file mode 100644
index 000000000000..16a0658e654d
--- /dev/null
+++ b/sci-chemistry/procheck/files/procheck-3.5.4-close.patch
@@ -0,0 +1,35 @@
+diff --git a/pplot.f b/pplot.f
+index 7e06e68..c86b2b2 100644
+--- a/pplot.f
++++ b/pplot.f
+@@ -4720,6 +4720,7 @@ C---- Initialise variables
+ SCORE(IDIST) = 0.0
+ 50 CONTINUE
+
++ REWIND(3)
+ C---- If the required residue is of a greater number than that required,
+ C read through the file until come to it
+ IF (IRESID.GT.INRES) THEN
+diff --git a/ps.f b/ps.f
+index b652a7d..858b8e5 100644
+--- a/ps.f
++++ b/ps.f
+@@ -1705,12 +1705,14 @@ CVAX - CARRIAGECONTROL='LIST',
+ C---- If this is an existing file, then read through all its records until
+ C get to the end of file
+ IF (.NOT.NEWFIL) THEN
++ CLOSE(14)
++ OPEN(14, file=fname, status='old', position='append', err=900)
+
+ C---- Loop through the file until reach the end
+- 100 CONTINUE
+- READ(14,110,END=500) IREC
+- 110 FORMAT(A)
+- GO TO 100
++C 100 CONTINUE
++C READ(14,110,END=500) IREC
++C 110 FORMAT(A)
++C GO TO 100
+
+ C---- If this is a new file, then write the header records to it
+ ELSE \ No newline at end of file
diff --git a/sci-chemistry/procheck/metadata.xml b/sci-chemistry/procheck/metadata.xml
new file mode 100644
index 000000000000..b3618ba38c1c
--- /dev/null
+++ b/sci-chemistry/procheck/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/procheck/procheck-3.5.4-r1.ebuild b/sci-chemistry/procheck/procheck-3.5.4-r1.ebuild
new file mode 100644
index 000000000000..855c2badf4d0
--- /dev/null
+++ b/sci-chemistry/procheck/procheck-3.5.4-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 multilib toolchain-funcs versionator
+
+DESCRIPTION="Checks the stereochemical quality of a protein structure"
+HOMEPAGE="http://www.biochem.ucl.ac.uk/~roman/procheck/procheck.html"
+SRC_URI="
+ ${P}.tar.gz ${P}-README
+ doc? ( ${P}-manual.tar.gz )"
+
+LICENSE="procheck"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND="app-shells/tcsh"
+DEPEND="${RDEPEND}"
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${PN}"
+
+pkg_nofetch() {
+ elog "Please visit http://www.ebi.ac.uk/thornton-srv/software/PROCHECK/download.html"
+ elog "And follow the instruction for downloading."
+ elog "Files should be stored in following way"
+ elog "${PN}.tar.gz -> ${DISTDIR}/${P}.tar.gz"
+ elog "README -> ${DISTDIR}/${P}-README"
+ if use doc; then
+ elog "manual.tar.gz -> ${DISTDIR}/${P}-manual.tar.gz"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-ldflags.patch
+}
+
+src_compile() {
+ emake \
+ F77=$(tc-getFC) \
+ CC=$(tc-getCC) \
+ COPTS="${CFLAGS}" \
+ FOPTS="${FFLAGS}"
+}
+
+src_install() {
+ for i in *.scr; do
+ newbin ${i} ${i%.scr}
+ done
+
+ exeinto /usr/$(get_libdir)/${PN}/
+ doexe \
+ anglen \
+ clean \
+ rmsdev \
+ secstr \
+ gfac2pdb \
+ pplot \
+ bplot \
+ tplot \
+ mplot \
+ vplot \
+ viol2pdb \
+ wirplot \
+ nb
+ dodoc "${DISTDIR}"/${P}-README
+
+ insinto /usr/$(get_libdir)/${PN}/
+ doins *.dat *.prm
+ newins resdefs.dat resdefs.data
+
+ cat >> "${T}"/30${PN} <<- EOF
+ prodir="${EPREFIX}/usr/$(get_libdir)/${PN}/"
+ EOF
+
+ doenvd "${T}"/30${PN}
+
+ if use doc; then
+ pushd "${WORKDIR}"
+ dohtml -r manual
+ popd
+ fi
+}
diff --git a/sci-chemistry/procheck/procheck-3.5.4-r2.ebuild b/sci-chemistry/procheck/procheck-3.5.4-r2.ebuild
new file mode 100644
index 000000000000..0c4683e03a72
--- /dev/null
+++ b/sci-chemistry/procheck/procheck-3.5.4-r2.ebuild
@@ -0,0 +1,88 @@
+# 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 versionator
+
+DESCRIPTION="Checks the stereochemical quality of a protein structure"
+HOMEPAGE="http://www.biochem.ucl.ac.uk/~roman/procheck/procheck.html"
+SRC_URI="
+ ${P}.tar.gz ${P}-README
+ doc? ( ${P}-manual.tar.gz )"
+
+LICENSE="procheck"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND="app-shells/tcsh"
+DEPEND="${RDEPEND}"
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${PN}"
+
+pkg_nofetch() {
+ elog "Please visit http://www.ebi.ac.uk/thornton-srv/software/PROCHECK/download.html"
+ elog "And follow the instruction for downloading."
+ elog "Files should be stored in following way"
+ elog "${PN}.tar.gz -> ${DISTDIR}/${P}.tar.gz"
+ elog "README -> ${DISTDIR}/${P}-README"
+ use doc && elog "manual.tar.gz -> ${DISTDIR}/${P}-manual.tar.gz"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-ldflags.patch \
+ "${FILESDIR}"/${P}-close.patch
+}
+
+src_compile() {
+ emake \
+ F77=$(tc-getFC) \
+ CC=$(tc-getCC) \
+ COPTS="${CFLAGS}" \
+ FOPTS="${FFLAGS} -std=legacy"
+}
+
+src_install() {
+ for i in *.scr; do
+ newbin ${i} ${i%.scr}
+ done
+
+ exeinto /usr/libexec/${PN}/
+ doexe \
+ anglen \
+ clean \
+ rmsdev \
+ secstr \
+ gfac2pdb \
+ pplot \
+ bplot \
+ tplot \
+ mplot \
+ vplot \
+ viol2pdb \
+ wirplot \
+ nb
+ dodoc "${DISTDIR}"/${P}-README
+
+ insinto /usr/libexec/${PN}/
+ doins *.dat *.prm
+ newins resdefs.dat resdefs.data
+
+ cat >> "${T}"/30${PN} <<- EOF
+ prodir="${EPREFIX}/usr/libexec/${PN}/"
+ EOF
+
+ doenvd "${T}"/30${PN}
+
+ if use doc; then
+ pushd "${WORKDIR}" > /dev/null
+ docinto html
+ dodoc -r manual
+ popd > /dev/null
+ fi
+}
diff --git a/sci-chemistry/prodecomp/Manifest b/sci-chemistry/prodecomp/Manifest
new file mode 100644
index 000000000000..ffead0387fc2
--- /dev/null
+++ b/sci-chemistry/prodecomp/Manifest
@@ -0,0 +1 @@
+DIST prodecomp-3.0.tar.bz2 18377446 SHA256 097b97aa6503ff1aecd4147a6e3ef9997807773a7ef58aab8b10baf73b65e457 SHA512 8d23f174e125d4c7776432a37b063d2f39af8497050bd7f7ff358c67d509b1eef2c2865596efae632855fd583fb52c233b67d0e667c6c2a03ba6f5a2f2ac9b0d WHIRLPOOL c06f4bf32e3d5ff4f2b5f1b1c4fd03d7a5b734651707e6fc101ce0ea5ba17c9377edb60166c4e9313b616b37bd580febea01bf62a71e15389174b301c4d70738
diff --git a/sci-chemistry/prodecomp/metadata.xml b/sci-chemistry/prodecomp/metadata.xml
new file mode 100644
index 000000000000..a91e9092dc52
--- /dev/null
+++ b/sci-chemistry/prodecomp/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ PRODECOMP (PROjection DECOMPosition) is a software tool for
+ decomposition of 2D projections of high-dimensional NMR spectra to a set
+ of components (defined in turn by one-dimensional "shapes").
+ Simultaneous analysis of projections from one or several
+ high-dimensional experiments provide unambigous chemical shifts for
+ large spin systems. The latter can be used for backbone and side-chain
+ assignments as well as structural studies of proteins
+ (Malmodin and Billeter 2005; 2006; Staykova et al. 2008a,b).
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/prodecomp/prodecomp-3.0.ebuild b/sci-chemistry/prodecomp/prodecomp-3.0.ebuild
new file mode 100644
index 000000000000..28791c9108ba
--- /dev/null
+++ b/sci-chemistry/prodecomp/prodecomp-3.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit python-single-r1
+
+DESCRIPTION="Decomposition-based analysis of NMR projections"
+HOMEPAGE="http://www.lundberg.gu.se/nmr/software.php?program=PRODECOMP"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="sci-libs/scipy[${PYTHON_USEDEP}]"
+DEPEND=""
+
+S="${WORKDIR}"/NMRProjAnalys
+
+src_install() {
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r ExampleData Results
+ fi
+
+ dodoc ProjTools/Manual.pdf
+ rm -rf ProjTools/Manual.pdf ProdecompOutput || die
+
+ python_moduleinto ${PN}
+ python_domodule ProjTools/.
+ python_optimize
+
+ cat >> "${T}"/${PN} <<- EOF
+ #!/bin/bash
+ ${PYTHON} -O "${EPREFIX}"/$(python_get_sitedir)/${PN}/ProjAnalys.py $@
+ EOF
+ dobin "${T}"/${PN}
+
+ dosym ../../../../share/doc/${PF}/Manual.pdf $(python_get_sitedir)/${PN}/Manual.pdf
+}
diff --git a/sci-chemistry/propka/Manifest b/sci-chemistry/propka/Manifest
new file mode 100644
index 000000000000..5f7630e69501
--- /dev/null
+++ b/sci-chemistry/propka/Manifest
@@ -0,0 +1 @@
+DIST propka-3.1_p140511.tar.xz 151284 SHA256 42b4f6b98bbbefa11fba5e603aa33f1747362746c1170c9958ad408dc34e39af SHA512 c2938af41ed386e267cd045b14e34779889b3c206016d747b68c400f2c8b37bd50cc3b74d055d931476065ac6817a2dd2cb87d68de9911adfff1c8e34a667fc3 WHIRLPOOL 0553ef5f519d41af508885f1900a68627fcf3fb2f901c5d1cef54fe6a5774ef08caf42bf5e80f08cba4c76c9e330be89502e648cf5604aca411c168d4ecda6fa
diff --git a/sci-chemistry/propka/metadata.xml b/sci-chemistry/propka/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/propka/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/propka/propka-3.1_p140511.ebuild b/sci-chemistry/propka/propka-3.1_p140511.ebuild
new file mode 100644
index 000000000000..d390752866d6
--- /dev/null
+++ b/sci-chemistry/propka/propka-3.1_p140511.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Prediction of the pKa values of ionizable groups in proteins and protein-ligand complexes"
+HOMEPAGE="http://propka.ki.ku.dk/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="all-rights-reserved"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+RESTRICT="mirror bindist"
+
+python_prepare_all() {
+ sed -e "/exclude/s:scripts:\', \'Tests:g" \
+ -i setup.py || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ cd Tests || die
+ ${PYTHON} runtest.py || die
+}
+
+python_install_all() {
+ dosym ${PN}31 /usr/bin/${PN}
+ distutils-r1_python_install_all
+}
diff --git a/sci-chemistry/psi/Manifest b/sci-chemistry/psi/Manifest
new file mode 100644
index 000000000000..c7fb8a8d6271
--- /dev/null
+++ b/sci-chemistry/psi/Manifest
@@ -0,0 +1 @@
+DIST psi-3.4.0.tar.gz 7413072 SHA256 c87a7f63cb4e34bfd1a8b3731474eb417d9933338327143415a985bcedb619d4 SHA512 b13d2464502545cceec3a3b6048b505b918da26730c1614617b04ee6c1d637c9f799ef7fd92ad9554fa2db87617004aa810a6a81400a04df3c06787d51654ca6 WHIRLPOOL 9c0b9de2c9fbed298eaf958f0c135cadff16eac8754d4064dba0ac2275aabd36204bcad92f90236030bc62ef9917b967653ec608e40ad631e70a0ce1c16f2127
diff --git a/sci-chemistry/psi/files/3.4.0-destdir.patch b/sci-chemistry/psi/files/3.4.0-destdir.patch
new file mode 100644
index 000000000000..45db9529aa4d
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-destdir.patch
@@ -0,0 +1,41 @@
+diff --git a/Makefile.in b/Makefile.in
+index aca5a16..2e49f0a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -8,6 +8,7 @@ subdirs = lib include src
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
++datarootdir = @datarootdir@
+ VPATH = @srcdir@
+ top_objdir = .
+
+diff --git a/lib/ruby/Makefile.in b/lib/ruby/Makefile.in
+index b31ce7f..e099e1b 100644
+--- a/lib/ruby/Makefile.in
++++ b/lib/ruby/Makefile.in
+@@ -29,10 +29,10 @@ ccenergy.rb cclambda.rb chkpt.rb color.rb deriv2.rb frequ
+ cceom.rb ccsort.rb cints.rb cphf.rb detci.rb input.rb optking.rb psi3.rb testcases.rb
+
+ install: $(RUBYSRC)
+- $(MKDIRS) $(rubydatadir)
++ $(MKDIRS) $(DESTDIR)/$(rubydatadir)
+ for rbfile in $(RUBYSRC); \
+ do \
+- ($(INSTALL_DATA) $(srcdir)/$${rbfile} $(rubydatadir)) || exit 1; \
++ ($(INSTALL_DATA) $(srcdir)/$${rbfile} $(DESTDIR)/$(rubydatadir)) || exit 1; \
+ done
+
+ install_man:
+diff --git a/src/bin/Makefile.in b/src/bin/Makefile.in
+index e1abb46..4eddf8d 100644
+--- a/src/bin/Makefile.in
++++ b/src/bin/Makefile.in
+@@ -65,6 +65,7 @@ targetclean:
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
++datarootdir = @datarootdir@
+ top_objdir = ../..
+
+ $(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
diff --git a/sci-chemistry/psi/files/3.4.0-dont-build-libint.patch b/sci-chemistry/psi/files/3.4.0-dont-build-libint.patch
new file mode 100644
index 000000000000..0d65cee8a1a9
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-dont-build-libint.patch
@@ -0,0 +1,13 @@
+diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
+index 42e025d..b098a36 100644
+--- a/src/lib/Makefile.in
++++ b/src/lib/Makefile.in
+@@ -2,7 +2,7 @@
+ .PHONY: default all install depend clean dclean targetclean
+
+ subdirs = libipv1 libciomr libchkpt libqt libpsio libiwl libdpd libutil \
+- liboptions libmoinfo libint libderiv libr12 libbasis libmints
++ liboptions libmoinfo libbasis libmints
+
+ all: default
+
diff --git a/sci-chemistry/psi/files/3.4.0-fortify.patch b/sci-chemistry/psi/files/3.4.0-fortify.patch
new file mode 100644
index 000000000000..5f098399ad3f
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-fortify.patch
@@ -0,0 +1,58 @@
+ src/bin/ccenergy/get_params.cc | 2 +-
+ src/bin/cclambda/get_params.cc | 2 +-
+ src/bin/ccresponse/get_params.cc | 2 +-
+ src/bin/ccsort/get_params.cc | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bin/ccenergy/get_params.cc b/src/bin/ccenergy/get_params.cc
+index 53f4c83..a2fa932 100644
+--- a/src/bin/ccenergy/get_params.cc
++++ b/src/bin/ccenergy/get_params.cc
+@@ -193,7 +193,7 @@ void get_params()
+ }
+ }
+ else if(params.local) {
+- local.weakp = (char *) malloc(4 * sizeof(char));
++ local.weakp = (char *) malloc(5 * sizeof(char));
+ sprintf(local.weakp, "%s", "NONE");
+ }
+
+diff --git a/src/bin/cclambda/get_params.cc b/src/bin/cclambda/get_params.cc
+index 4a9d2c8..8a2ae17 100644
+--- a/src/bin/cclambda/get_params.cc
++++ b/src/bin/cclambda/get_params.cc
+@@ -150,7 +150,7 @@ void get_params(void)
+ }
+ }
+ else if(params.local) {
+- local.weakp = (char *) malloc(4 * sizeof(char));
++ local.weakp = (char *) malloc(5 * sizeof(char));
+ sprintf(local.weakp, "%s", "NONE");
+ }
+
+diff --git a/src/bin/ccresponse/get_params.cc b/src/bin/ccresponse/get_params.cc
+index a96db13..5c40aa0 100644
+--- a/src/bin/ccresponse/get_params.cc
++++ b/src/bin/ccresponse/get_params.cc
+@@ -207,7 +207,7 @@ void get_params()
+ }
+ }
+ else if(params.local) {
+- local.weakp = (char *) malloc(4 * sizeof(char));
++ local.weakp = (char *) malloc(5 * sizeof(char));
+ sprintf(local.weakp, "%s", "NONE");
+ }
+
+diff --git a/src/bin/ccsort/get_params.cc b/src/bin/ccsort/get_params.cc
+index ad7f0c3..6ee1993 100644
+--- a/src/bin/ccsort/get_params.cc
++++ b/src/bin/ccsort/get_params.cc
+@@ -120,7 +120,7 @@ void get_params()
+ }
+ }
+ else if(params.local) {
+- local.weakp = (char *) malloc(4 * sizeof(char));
++ local.weakp = (char *) malloc(5 * sizeof(char));
+ sprintf(local.weakp, "%s", "NONE");
+ }
+
diff --git a/sci-chemistry/psi/files/3.4.0-gcc-4.3.patch b/sci-chemistry/psi/files/3.4.0-gcc-4.3.patch
new file mode 100644
index 000000000000..8283e6d8d8ea
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-gcc-4.3.patch
@@ -0,0 +1,293 @@
+diff --git a/src/bin/mcscf/block_matrix.cc b/src/bin/mcscf/block_matrix.cc
+index fe1e131..3ad0bcd 100644
+--- a/src/bin/mcscf/block_matrix.cc
++++ b/src/bin/mcscf/block_matrix.cc
+@@ -1,6 +1,7 @@
+ #include "block_matrix.h"
+ #include "matrix_base.h"
+ #include "memory_manager.h"
++#include <cstdio>
+
+ extern FILE* outfile;
+
+diff --git a/src/bin/mcscf/block_vector.cc b/src/bin/mcscf/block_vector.cc
+index fb383c7..36f55d4 100644
+--- a/src/bin/mcscf/block_vector.cc
++++ b/src/bin/mcscf/block_vector.cc
+@@ -1,6 +1,7 @@
+ #include "block_vector.h"
+ #include "vector_base.h"
+ #include "memory_manager.h"
++#include <cstdio>
+
+ extern FILE* outfile;
+
+diff --git a/src/bin/mcscf/sblock_matrix.cc b/src/bin/mcscf/sblock_matrix.cc
+index 61aa7cc..4da4263 100644
+--- a/src/bin/mcscf/sblock_matrix.cc
++++ b/src/bin/mcscf/sblock_matrix.cc
+@@ -1,4 +1,5 @@
+ #include <cstdlib>
++#include <cstdio>
+ #include <psifiles.h>
+ #include "sblock_matrix.h"
+
+@@ -103,4 +104,4 @@ void SBlockMatrix::check(const char* cstr)
+ }
+ }
+
+-}}
+\ No newline at end of file
++}}
+diff --git a/src/bin/mcscf/sblock_vector.cc b/src/bin/mcscf/sblock_vector.cc
+index 63c3926..f24fc5b 100644
+--- a/src/bin/mcscf/sblock_vector.cc
++++ b/src/bin/mcscf/sblock_vector.cc
+@@ -1,4 +1,5 @@
+ #include <cstdlib>
++#include <cstdio>
+ #include <psifiles.h>
+
+ #include "sblock_vector.h"
+@@ -58,4 +59,4 @@ void SBlockVector::check(const char* cstr)
+ }
+ }
+
+-}}
+\ No newline at end of file
++}}
+diff --git a/src/bin/mcscf/scf.cc b/src/bin/mcscf/scf.cc
+index 77318fd..7d1e17f 100644
+--- a/src/bin/mcscf/scf.cc
++++ b/src/bin/mcscf/scf.cc
+@@ -5,6 +5,7 @@
+
+ #include <iostream>
+ #include <cmath>
++#include <cstdio>
+
+ extern FILE* outfile;
+
+diff --git a/src/bin/mcscf/scf_Feff.cc b/src/bin/mcscf/scf_Feff.cc
+index 584aa83..8a99c3b 100644
+--- a/src/bin/mcscf/scf_Feff.cc
++++ b/src/bin/mcscf/scf_Feff.cc
+@@ -1,4 +1,5 @@
+ #include <liboptions/liboptions.h>
++#include <cstdio>
+
+ #include "scf.h"
+
+diff --git a/src/bin/mcscf/scf_canonicalize_MO.cc b/src/bin/mcscf/scf_canonicalize_MO.cc
+index a2b3915..96bb6cc 100644
+--- a/src/bin/mcscf/scf_canonicalize_MO.cc
++++ b/src/bin/mcscf/scf_canonicalize_MO.cc
+@@ -1,6 +1,7 @@
+ #include "scf.h"
+
+ #include <liboptions/liboptions.h>
++#include <cstdio>
+
+ namespace psi{ namespace mcscf{
+
+diff --git a/src/bin/mcscf/scf_check_orthonormality.cc b/src/bin/mcscf/scf_check_orthonormality.cc
+index 63fbbbb..a13436c 100644
+--- a/src/bin/mcscf/scf_check_orthonormality.cc
++++ b/src/bin/mcscf/scf_check_orthonormality.cc
+@@ -1,5 +1,6 @@
+ #include <iostream>
+ #include <cmath>
++#include <cstdio>
+
+ #include "scf.h"
+
+diff --git a/src/bin/mcscf/scf_compute_energy.cc b/src/bin/mcscf/scf_compute_energy.cc
+index fe7ee6d..20194eb 100644
+--- a/src/bin/mcscf/scf_compute_energy.cc
++++ b/src/bin/mcscf/scf_compute_energy.cc
+@@ -1,4 +1,5 @@
+ #include <iostream>
++#include <cstdio>
+
+ #include "scf.h"
+
+diff --git a/src/bin/mcscf/scf_diis.cc b/src/bin/mcscf/scf_diis.cc
+index 9bcde15..261492a 100644
+--- a/src/bin/mcscf/scf_diis.cc
++++ b/src/bin/mcscf/scf_diis.cc
+@@ -1,4 +1,5 @@
+ #include <iostream>
++#include <cstdio>
+
+ #include <liboptions/liboptions.h>
+
+diff --git a/src/bin/mcscf/scf_iterate_scf_equations.cc b/src/bin/mcscf/scf_iterate_scf_equations.cc
+index 9e96360..3a3acc3 100644
+--- a/src/bin/mcscf/scf_iterate_scf_equations.cc
++++ b/src/bin/mcscf/scf_iterate_scf_equations.cc
+@@ -1,6 +1,7 @@
+ #include <cstdlib>
+ #include <iostream>
+ #include <cmath>
++#include <cstdio>
+
+ #include <liboptions/liboptions.h>
+
+diff --git a/src/bin/mcscf/scf_pairs.cc b/src/bin/mcscf/scf_pairs.cc
+index b0a8c9d..af5fc35 100644
+--- a/src/bin/mcscf/scf_pairs.cc
++++ b/src/bin/mcscf/scf_pairs.cc
+@@ -1,4 +1,5 @@
+ #include <iostream>
++#include <cstdio>
+
+ #include <libmoinfo/libmoinfo.h>
+
+diff --git a/src/bin/mcscf/scf_print_eigenvectors_and_MO.cc b/src/bin/mcscf/scf_print_eigenvectors_and_MO.cc
+index 3aac92a..e28e9e3 100644
+--- a/src/bin/mcscf/scf_print_eigenvectors_and_MO.cc
++++ b/src/bin/mcscf/scf_print_eigenvectors_and_MO.cc
+@@ -3,6 +3,7 @@
+ #include <string>
+ #include <utility>
+ #include <algorithm>
++#include <cstdio>
+
+ #include <libmoinfo/libmoinfo.h>
+
+diff --git a/src/bin/psimrcc/blas_algorithms.cc b/src/bin/psimrcc/blas_algorithms.cc
+index bb36025..0a5a3e2 100644
+--- a/src/bin/psimrcc/blas_algorithms.cc
++++ b/src/bin/psimrcc/blas_algorithms.cc
+@@ -1,5 +1,6 @@
+ #include <libmoinfo/libmoinfo.h>
+ #include <libutil/libutil.h>
++#include <cstdio>
+
+ #include "blas.h"
+ #include "memory_manager.h"
+diff --git a/src/bin/psimrcc/blas_compatibile.cc b/src/bin/psimrcc/blas_compatibile.cc
+index 8de6d73..7caf4f3 100644
+--- a/src/bin/psimrcc/blas_compatibile.cc
++++ b/src/bin/psimrcc/blas_compatibile.cc
+@@ -1,6 +1,7 @@
+ #include "blas.h"
+ #include <libutil/libutil.h>
+ #include <cstdlib>
++#include <cstdio>
+
+ extern FILE *infile, *outfile;
+
+diff --git a/src/bin/psimrcc/blas_parser.cc b/src/bin/psimrcc/blas_parser.cc
+index d211a24..78fe60a 100644
+--- a/src/bin/psimrcc/blas_parser.cc
++++ b/src/bin/psimrcc/blas_parser.cc
+@@ -3,6 +3,7 @@
+ #include "debugging.h"
+ #include <libutil/libutil.h>
+ #include <algorithm>
++#include <cstdio>
+
+ namespace psi{ namespace psimrcc{
+
+diff --git a/src/bin/psimrcc/blas_solve.cc b/src/bin/psimrcc/blas_solve.cc
+index b138a5b..f5dcdfc 100644
+--- a/src/bin/psimrcc/blas_solve.cc
++++ b/src/bin/psimrcc/blas_solve.cc
+@@ -1,6 +1,7 @@
+ #include "blas.h"
+ #include "debugging.h"
+ #include <libmoinfo/libmoinfo.h>
++#include <cstdio>
+
+ namespace psi{ namespace psimrcc{
+
+diff --git a/src/bin/psimrcc/index.cc b/src/bin/psimrcc/index.cc
+index 3465d88..68c2b77 100644
+--- a/src/bin/psimrcc/index.cc
++++ b/src/bin/psimrcc/index.cc
+@@ -5,6 +5,7 @@
+ ***************************************************************************/
+ #include <iostream>
+ #include <algorithm>
++#include <cstdio>
+
+ #include <libmoinfo/libmoinfo.h>
+
+diff --git a/src/bin/psimrcc/operation.cc b/src/bin/psimrcc/operation.cc
+index edbaed5..f4e881f 100644
+--- a/src/bin/psimrcc/operation.cc
++++ b/src/bin/psimrcc/operation.cc
+@@ -7,6 +7,7 @@
+ #include "debugging.h"
+ #include "blas.h"
+ #include <libutil/libutil.h>
++#include <cstdio>
+
+ namespace psi{ namespace psimrcc{
+
+diff --git a/src/bin/psimrcc/operation_compute.cc b/src/bin/psimrcc/operation_compute.cc
+index 7d2553c..72a1b39 100644
+--- a/src/bin/psimrcc/operation_compute.cc
++++ b/src/bin/psimrcc/operation_compute.cc
+@@ -11,6 +11,7 @@
+ #include "algebra_interface.h"
+ #include <libmoinfo/libmoinfo.h>
+ #include <cstdlib>
++#include <cstdio>
+
+ extern FILE *infile, *outfile;
+
+diff --git a/src/bin/psimrcc/sort_out_of_core.cc b/src/bin/psimrcc/sort_out_of_core.cc
+index 3f255c9..8fa31a3 100644
+--- a/src/bin/psimrcc/sort_out_of_core.cc
++++ b/src/bin/psimrcc/sort_out_of_core.cc
+@@ -8,6 +8,7 @@
+ #include "sort.h"
+ #include "matrix.h"
+ #include <libmoinfo/libmoinfo.h>
++#include <cstdio>
+
+ extern FILE* outfile;
+
+diff --git a/src/lib/libmoinfo/moinfo_model_space.cc b/src/lib/libmoinfo/moinfo_model_space.cc
+index 3bf2030..0a63cde 100644
+--- a/src/lib/libmoinfo/moinfo_model_space.cc
++++ b/src/lib/libmoinfo/moinfo_model_space.cc
+@@ -1,6 +1,7 @@
+ #include <iostream>
+ #include <cmath>
+ #include <cstdlib>
++#include <cstdio>
+
+ #include <psifiles.h>
+ #include <liboptions/liboptions.h>
+@@ -322,4 +323,4 @@ vector<string> MOInfo::get_matrix_names(std::string str)
+ return(names);
+ }
+
+-}
+\ No newline at end of file
++}
+diff --git a/src/lib/libmoinfo/moinfo_slaterdeterminant.cc b/src/lib/libmoinfo/moinfo_slaterdeterminant.cc
+index 8831cd5..a046679 100644
+--- a/src/lib/libmoinfo/moinfo_slaterdeterminant.cc
++++ b/src/lib/libmoinfo/moinfo_slaterdeterminant.cc
+@@ -1,4 +1,5 @@
+ #include <iostream>
++#include <cstdio>
+ #include "moinfo.h"
+
+ extern FILE *infile, *outfile;
+diff --git a/src/lib/libutil/stl_string.cc b/src/lib/libutil/stl_string.cc
+index 0ec247d..f719dcd 100644
+--- a/src/lib/libutil/stl_string.cc
++++ b/src/lib/libutil/stl_string.cc
+@@ -2,6 +2,7 @@
+ #include <cmath>
+ #include <iomanip>
+ #include <algorithm>
++#include <cstdio>
+
+ #include "libutil.h"
+
diff --git a/sci-chemistry/psi/files/3.4.0-ldflags.patch b/sci-chemistry/psi/files/3.4.0-ldflags.patch
new file mode 100644
index 000000000000..9d7f2767e8ec
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-ldflags.patch
@@ -0,0 +1,21 @@
+Respect LDFLAGS
+
+--- configure.ac
++++ configure.ac
+@@ -288,15 +288,13 @@
+ )
+ AC_SUBST(LDLIBS)
+
+-LDFLAGS=
+ LIBDIRS=
+ AC_ARG_WITH(libdirs,
+ [ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
+ LIBDIRS=$withval
+-LDFLAGS=$withval
+ AC_MSG_RESULT([Using extra library directories: $withval])
+ )
+-AC_SUBST(LDFLAGS)
++AC_SUBST(LIBDIRS)
+
+ AC_CHECK_PROGS(PERL,perl,perl) AC_SUBST(PERL)
+
diff --git a/sci-chemistry/psi/files/3.4.0-man_paths.patch b/sci-chemistry/psi/files/3.4.0-man_paths.patch
new file mode 100644
index 000000000000..02cced160847
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-man_paths.patch
@@ -0,0 +1,25 @@
+Fix man paths
+
+http://bugs.gentoo.org/show_bug.cgi?id=326185
+
+--- src/bin/nonbonded/Makefile.in
++++ src/bin/nonbonded/Makefile.in
+@@ -19,5 +19,5 @@
+ endif
+
+ install_man:: nonbonded.1
+- $(MKDIRS) $(mandir)/man1
+- $(INSTALL_INCLUDE) $^ $(mandir)/man1
++ $(MKDIRS) $(DESTDIR)$(mandir)/man1
++ $(INSTALL_INCLUDE) $^ $(DESTDIR)$(mandir)/man1
+--- src/bin/intder/Makefile.in
++++ src/bin/intder/Makefile.in
+@@ -21,6 +21,6 @@
+ endif
+
+ install_man:: intder.1
+- $(MKDIRS) $(mandir)/man1
+- $(INSTALL_INCLUDE) $^ $(mandir)/man1
++ $(MKDIRS) $(DESTDIR)$(mandir)/man1
++ $(INSTALL_INCLUDE) $^ $(DESTDIR)$(mandir)/man1
+
diff --git a/sci-chemistry/psi/files/3.4.0-parallel_fix.patch b/sci-chemistry/psi/files/3.4.0-parallel_fix.patch
new file mode 100644
index 000000000000..65234fb40dcb
--- /dev/null
+++ b/sci-chemistry/psi/files/3.4.0-parallel_fix.patch
@@ -0,0 +1,400 @@
+--- Makefile.in
++++ Makefile.in
+@@ -17,62 +17,19 @@
+ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+
+-all:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making in $${dir} && $(MAKE) all) || exit 1; \
+- done
+-
+-install: install_host
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making depend in $${dir} && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making clean in $${dir} && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making dclean in $${dir} && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs) tests doc; \
+- do \
+- (cd $${dir} && echo Making clean in $${dir} && $(MAKE) targetclean) || exit 1; \
+- done
++all clean install install_inc install_man depend dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ tests:
+- (cd tests && echo Running test suite... && $(MAKE)) || exit 1;
++ $(MAKE) -C tests
+
+ testsclean:
+- (cd tests && echo Cleaning test suite... && $(MAKE) clean) || exit 1;
++ $(MAKE) -C tests clean
+
+ doc:
+- (cd doc && echo Building documentation... && $(MAKE)) || exit 1;
++ $(MAKE) -C doc
+
+ $(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
+ cd $(top_srcdir) && autoconf
+--- lib/Makefile.in
++++ lib/Makefile.in
+@@ -31,7 +31,7 @@
+ $(INSTALL_DATA) $(srcdir)/psi.dat $(DESTDIR)$(pkgdatadir)
+ for dir in $(subdirs); \
+ do \
+- (cd $${dir}; echo Making in $${dir}; $(MAKE) install) || exit 1; \
++ $(MAKE) -C $$dir install; \
+ done
+
+ install_man: macro.psi
+--- src/Makefile.in
++++ src/Makefile.in
+@@ -6,53 +6,10 @@
+
+ default: all
+
+-all:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making in $${dir} && $(MAKE) all) || exit 1; \
+- done
+-
+-install:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making install in $${dir} && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making depend in $${dir} && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making clean in $${dir} && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making dclean in $${dir} && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo Making clean in $${dir} && $(MAKE) targetclean) || exit 1; \
+- done
++all clean install depend dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
+--- src/lib/Makefile.in
++++ src/lib/Makefile.in
+@@ -4,56 +4,10 @@
+ subdirs = libipv1 libciomr libchkpt libqt libpsio libiwl libdpd libutil \
+ liboptions libmoinfo libbasis libmints
+
+-all: default
+-
+-default:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making in $${dir} ... && $(MAKE) default) || exit 1; \
+- done
+-
+-install:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making depend in $${dir} ... && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making dclean in $${dir} ... && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) targetclean) || exit 1; \
+- done
+-
++all clean install install_inc install_man depend dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ #
+ # keep the configuration information and makefile up-to-date
+--- src/bin/Makefile.in
++++ src/bin/Makefile.in
+@@ -13,55 +13,10 @@
+ subdirs += psirb
+ endif
+
+-all: default
+-
+-default:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making in $${dir} ... && $(MAKE) default) || exit 1; \
+- done
+-
+-install:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making depend in $${dir} ... && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making dclean in $${dir} ... && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) targetclean) || exit 1; \
+- done
++all install depend clean dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
+--- src/samples/Makefile.in
++++ src/samples/Makefile.in
+@@ -5,55 +5,10 @@
+
+ subdirs = mints
+
+-all: default
+-
+-default:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making in $${dir} ... && $(MAKE) default) || exit 1; \
+- done
+-
+-install:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making depend in $${dir} ... && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making dclean in $${dir} ... && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) targetclean) || exit 1; \
+- done
++all install depend clean dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
+--- src/util/Makefile.in
++++ src/util/Makefile.in
+@@ -3,55 +3,10 @@
+
+ subdirs = tocprint psi2molden
+
+-all: default
+-
+-default:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making in $${dir} ... && $(MAKE) default) || exit 1; \
+- done
+-
+-install:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install) || exit 1; \
+- done
+-
+-install_inc:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_inc) || exit 1; \
+- done
+-
+-install_man:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making install in $${dir} ... && $(MAKE) install_man) || exit 1; \
+- done
+-
+-depend:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making depend in $${dir} ... && $(MAKE) depend) || exit 1; \
+- done
+-
+-clean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) clean) || exit 1; \
+- done
+-
+-dclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making dclean in $${dir} ... && $(MAKE) dclean) || exit 1; \
+- done
+-
+-targetclean:
+- for dir in $(subdirs); \
+- do \
+- (cd $${dir} && echo ... Making clean in $${dir} ... && $(MAKE) targetclean) || exit 1; \
+- done
++all install depend clean dclean targetclean:
++ for dir in $(subdirs); do \
++ $(MAKE) -C $$dir $@; \
++ done
+
+ top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
+--- src/lib/libipv1/Makefile.in
++++ src/lib/libipv1/Makefile.in
+@@ -58,4 +58,4 @@
+ # in case DODEPEND is no
+ #
+
+-ip_read.o: y.tab.h
++ip_read.o: y.tab.c y.tab.h
diff --git a/sci-chemistry/psi/files/psi-3.4.0-parallel-make.patch b/sci-chemistry/psi/files/psi-3.4.0-parallel-make.patch
new file mode 100644
index 000000000000..2805cb195e24
--- /dev/null
+++ b/sci-chemistry/psi/files/psi-3.4.0-parallel-make.patch
@@ -0,0 +1,19 @@
+diff --git a/src/lib/libipv1/Makefile.in b/src/lib/libipv1/Makefile.in
+index eafe8e2..141bf3b 100644
+--- a/src/lib/libipv1/Makefile.in
++++ b/src/lib/libipv1/Makefile.in
+@@ -33,10 +33,12 @@ LIBOBJ = $(ALLCSRC:%.c=%.o) $(ALLCXXSRC:%.cc=%.o)
+
+ include ../MakeRules
+
+-y.tab.c y.tab.h: parse.y
++y.tab.h: y.tab.c
++
++y.tab.c: parse.y
+ $(YACC) -v -d $<
+
+-scan.c: scan.l
++scan.c: scan.l y.tab.h
+ $(LEX) -t $^ > scan.c
+
+ install_inc:: $(ALLINCLUDE)
diff --git a/sci-chemistry/psi/files/use-external-libint.patch b/sci-chemistry/psi/files/use-external-libint.patch
new file mode 100644
index 000000000000..1d9ce91e3111
--- /dev/null
+++ b/sci-chemistry/psi/files/use-external-libint.patch
@@ -0,0 +1,37 @@
+--- psi3.orig/src/bin/cints/Makefile.in 2003-11-14 08:15:19.000000000 -0800
++++ psi3/src/bin/cints/Makefile.in 2006-02-10 22:42:31.000000000 -0800
+@@ -51,25 +51,25 @@
+ # and form the list of the libraries. Remember that libderiv and libr12
+ # depend on libint, and hence need to come first for GNU ld to work.
+ #
+-INTLIBS := -lPSI_int
++INTLIBS := -lint
+ ifeq ($(findstring MP2R12,$(SUBDIRS)),MP2R12)
+- ifneq ($(findstring -lPSI_r12,$(INTLIBS)),-lPSI_r12)
+- INTLIBS := -lPSI_r12 $(INTLIBS)
++ ifneq ($(findstring -lr12,$(INTLIBS)),-lr12)
++ INTLIBS := -lr12 $(INTLIBS)
+ endif
+ endif
+ ifeq ($(findstring R12_Ints,$(SUBDIRS)),R12_Ints)
+- ifneq ($(findstring -lPSI_r12,$(INTLIBS)),-lPSI_r12)
+- INTLIBS := -lPSI_r12 $(INTLIBS)
++ ifneq ($(findstring -lr12,$(INTLIBS)),-lr12)
++ INTLIBS := -lr12 $(INTLIBS)
+ endif
+ endif
+ ifeq ($(findstring Default_Deriv1,$(SUBDIRS)),Default_Deriv1)
+- ifneq ($(findstring -lPSI_deriv,$(INTLIBS)),-lPSI_deriv)
+- INTLIBS := -lPSI_deriv $(INTLIBS)
++ ifneq ($(findstring -lderiv,$(INTLIBS)),-lderiv)
++ INTLIBS := -lderiv $(INTLIBS)
+ endif
+ endif
+ ifeq ($(findstring Default_Deriv2,$(SUBDIRS)),Default_Deriv2)
+- ifneq ($(findstring -lderiv,$(INTLIBS)),-lPSI_deriv)
+- INTLIBS := -lPSI_deriv $(INTLIBS)
++ ifneq ($(findstring -lderiv,$(INTLIBS)),-lderiv)
++ INTLIBS := -lderiv $(INTLIBS)
+ endif
+ endif
+
diff --git a/sci-chemistry/psi/metadata.xml b/sci-chemistry/psi/metadata.xml
new file mode 100644
index 000000000000..3774ad2a405f
--- /dev/null
+++ b/sci-chemistry/psi/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">psicode</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/psi/psi-3.4.0-r2.ebuild b/sci-chemistry/psi/psi-3.4.0-r2.ebuild
new file mode 100644
index 000000000000..9a42b877dc16
--- /dev/null
+++ b/sci-chemistry/psi/psi-3.4.0-r2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils fortran-2 multilib toolchain-funcs
+
+DESCRIPTION="Suite of ab initio quantum chemistry programs to compute various molecular properties"
+HOMEPAGE="http://www.psicode.org/"
+SRC_URI="mirror://sourceforge/psicode/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="static-libs test"
+
+RDEPEND="
+ !sci-visualization/extrema
+ virtual/blas
+ virtual/lapack
+ >=sci-libs/libint-1.1.4"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-lang/perl )"
+
+S="${WORKDIR}/${PN}${PV:0:1}"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-dont-build-libint.patch
+ "${FILESDIR}"/use-external-libint.patch
+ "${FILESDIR}"/${PV}-gcc-4.3.patch
+ "${FILESDIR}"/${PV}-destdir.patch
+ "${FILESDIR}"/${P}-parallel-make.patch
+ "${FILESDIR}"/${PV}-man_paths.patch
+ "${FILESDIR}"/${PV}-ldflags.patch
+ "${FILESDIR}"/${PV}-parallel_fix.patch
+ "${FILESDIR}"/${PV}-fortify.patch
+ )
+
+src_prepare() {
+ autotools-utils_src_prepare
+ # Broken test
+ sed \
+ -e 's:scf-mvd-opt ::g' \
+ -e 's:scf-mvd-opt-puream ::g' \
+ -i tests/Makefile.in || die
+
+ sed \
+ -e "/LIBPATTERNS/d" \
+ -i src/{bin,util,samples}/MakeVars.in || die
+ eautoreconf
+}
+
+src_configure() {
+ # This variable gets set sometimes to /usr/lib/src and breaks stuff
+ unset CLIBS
+
+ local myeconfargs=(
+ --with-opt="${CXXFLAGS}"
+ --datadir="${EPREFIX}"/usr/share/${PN}
+ --with-blas="$($(tc-getPKG_CONFIG) blas --libs)"
+ --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile SCRATCH="${WORKDIR}/libint" DODEPEND="no"
+}
+
+src_test() {
+ emake EXECDIR="${S}"/bin TESTFLAGS="" -j1 tests
+}
+
+src_install() {
+ autotools-utils_src_install DODEPEND="no"
+ if ! use static-libs; then
+ rm -f "${ED}"/usr/$(get_libdir)/*.a || die
+ fi
+}
diff --git a/sci-chemistry/pymol-apbs-plugin/Manifest b/sci-chemistry/pymol-apbs-plugin/Manifest
new file mode 100644
index 000000000000..b2d73f85090c
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/Manifest
@@ -0,0 +1,4 @@
+DIST pymol-apbs-plugin-0_p15.py 104351 SHA256 c5a259ddc1931f1ec4efe0ffc3ae9e9ac4a84a28c83a4f93a06ebb7c1bef0c1d
+DIST pymol-apbs-plugin-0_p18.py 108766 SHA256 ec09c5a0903ac965cc29fcf0a3c1999bd939f9791d037915596092698855d12c
+DIST pymol-apbs-plugin-2.1_p24.py 113049 SHA256 d51bb1bbbf641777ee36713c0c47696d7906179e42cac8cdd0e8e156ef081c9f SHA512 49141ea7e4a3a3430d342fb4fbb497d522ce6485c6d9e3527414519574eab7b8218fe240f26920013676528c40059a46341d58153bfe9d05bf747ead926b2cfd WHIRLPOOL 17a4f9ed9670b9a7f82395a9cf1ad465635f840b7389c10ad8c8eae3262c3696383bbacadf5aee9fed817eff7370008cc85a1666896fed56dffb0163e4c3d7e1
+DIST pymol-apbs-plugin-2.1_p26.py 113086 SHA256 552242b4f5b47f298eeb0616e0d51924b4a7649dc8a16e4809e923dbcb97738d SHA512 3561d077875a1880d6badccf835db3d17e0c45416accd6127cbef7c550711908b47ccb392563e3d29ecb7d6527c098584eeabb6490d1033720ed7efe751d0fb0 WHIRLPOOL dccd32b0193e74e505d69922b441323fb24b0ba30aa85f4d69b94663ab406a57b772985ca2c56146e2c4b929f73b321095c3ae2caf95f297f14d8b31671f475e
diff --git a/sci-chemistry/pymol-apbs-plugin/files/pymol-apbs-plugin-2.1_p26-tcltk8.6.patch b/sci-chemistry/pymol-apbs-plugin/files/pymol-apbs-plugin-2.1_p26-tcltk8.6.patch
new file mode 100644
index 000000000000..c3675cf4c0d0
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/files/pymol-apbs-plugin-2.1_p26-tcltk8.6.patch
@@ -0,0 +1,176 @@
+--- pymol-apbs-plugin-2.1_p26.py.orig 2013-08-16 20:29:27.000000000 -0400
++++ pymol-apbs-plugin-2.1_p26.py 2013-08-16 20:31:35.000000000 -0400
+@@ -560,7 +560,8 @@
+ # Set up the Main page
+ page = self.notebook.add('Main')
+ group = Pmw.Group(page,tag_text='Main options')
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+ self.selection = Pmw.EntryField(group.interior(),
+ labelpos='w',
+ label_text='Selection to use: ',
+@@ -606,7 +607,8 @@
+ page = self.notebook.add('Configuration')
+
+ group = Pmw.Group(page,tag_text='Dielectric Constants')
+- group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+ group.grid(column=0, row=0)
+ self.interior_dielectric = Pmw.EntryField(group.interior(),labelpos='w',
+ label_text = 'Protein Dielectric:',
+@@ -625,7 +627,8 @@
+ #entry.pack(side='left',fill='both',expand=1,padx=4) # side-by-side
+ entry.pack(fill='x',expand=1,padx=4,pady=1) # vertical
+ group = Pmw.Group(page,tag_text='Other')
+- group.pack(fill='both',expand=1, padx=4, pady=5)
++ #group.pack(fill='both',expand=1, padx=4, pady=5)
++ group.grid(padx=4, pady=5, sticky=(N, S, E, W))
+ group.grid(column=1, row=1,columnspan=4)
+ self.max_mem_allowed = Pmw.EntryField(group.interior(),labelpos='w',
+ label_text = 'Maximum Memory Allowed (MB):',
+@@ -683,7 +686,8 @@
+
+
+ group = Pmw.Group(page,tag_text='Ions')
+- group.pack(fill='both',expand=1, padx=4, pady=5)
++ #group.pack(fill='both',expand=1, padx=4, pady=5)
++ group.grid(padx=4, pady=5, sticky=(N, S, E, W))
+ group.grid(column=0, row=1, )
+ self.ion_plus_one_conc = Pmw.EntryField(group.interior(),
+ labelpos='w',
+@@ -742,7 +746,8 @@
+ entry.pack(fill='x',expand=1,padx=4)
+
+ group = Pmw.Group(page,tag_text = 'Coarse Mesh Length')
+- group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+ group.grid(column = 1, row = 0)
+ for coord in 'x y z'.split():
+ setattr(self,'grid_coarse_%s'%coord,Pmw.EntryField(group.interior(),
+@@ -757,7 +762,8 @@
+
+
+ group = Pmw.Group(page,tag_text = 'Fine Mesh Length')
+- group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+ group.grid(column = 2, row = 0)
+ for coord in 'x y z'.split():
+ setattr(self,'grid_fine_%s'%coord,Pmw.EntryField(group.interior(),
+@@ -772,7 +778,8 @@
+
+
+ group = Pmw.Group(page,tag_text = 'Grid Center')
+- group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+ group.grid(column = 3, row = 0)
+ for coord in 'x y z'.split():
+ setattr(self,'grid_center_%s'%coord,Pmw.EntryField(group.interior(),
+@@ -786,7 +793,8 @@
+ getattr(self,'grid_center_%s'%coord).pack(fill='x', expand=1, padx=4, pady=1)
+
+ group = Pmw.Group(page,tag_text = 'Grid Points')
+- group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
++ group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+ group.grid(column = 4, row = 0)
+ for coord in 'x y z'.split():
+ setattr(self,'grid_points_%s'%coord,Pmw.EntryField(group.interior(),
+@@ -804,7 +812,8 @@
+ page.grid_columnconfigure(5,weight=1)
+ page = self.notebook.add('Program Locations')
+ group = Pmw.Group(page,tag_text='Locations')
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+ def quickFileValidation(s):
+ if s == '': return Pmw.PARTIAL
+ elif os.path.isfile(s): return Pmw.OK
+@@ -867,7 +876,8 @@
+
+ page = self.notebook.add('Temp File Locations')
+ group = Pmw.Group(page,tag_text='Locations')
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+ self.pymol_generated_pqr_filename = Pmw.EntryField(group.interior(),
+ labelpos = 'w',
+ label_pyclass = FileDialogButtonClassFactory.get(self.setPymolGeneratedPqrFilename),
+@@ -915,17 +925,20 @@
+ page = self.notebook.add('Visualization (1)')
+ group = VisualizationGroup(page,tag_text='Visualization',visgroup_num=1)
+ self.visualization_group_1 = group
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+
+ page = self.notebook.add('Visualization (2)')
+ group = VisualizationGroup(page,tag_text='Visualization',visgroup_num=2)
+ self.visualization_group_2 = group
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+
+ # Create a couple of other empty pages
+ page = self.notebook.add('About')
+ group = Pmw.Group(page, tag_text='About PyMOL APBS Tools')
+- group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
++ group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
+ text = """This plugin integrates PyMOL (http://PyMOL.org/) with APBS (http://www.poissonboltzmann.org/apbs/).
+
+ Documentation may be found at
+@@ -2158,7 +2171,8 @@
+ self.update_buttonbox = Pmw.ButtonBox(self.mm_group.interior(), padx=0)
+ self.update_buttonbox.pack(side=LEFT)
+ self.update_buttonbox.add('Update',command=self.refresh)
+- self.mm_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
++ #self.mm_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
++ self.mm_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+
+ self.ms_group = Pmw.Group(self.interior(),tag_text='Molecular Surface')
+ self.ms_buttonbox = Pmw.ButtonBox(self.ms_group.interior(), padx=0)
+@@ -2209,7 +2223,8 @@
+ bars = (self.mol_surf_low,self.mol_surf_middle,self.mol_surf_high)
+ Pmw.alignlabels(bars)
+ for bar in bars: bar.pack(side=LEFT)
+- self.ms_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ #self.ms_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ self.ms_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+
+ self.fl_group = Pmw.Group(self.interior(),tag_text='Field Lines')
+ self.fl_buttonbox = Pmw.ButtonBox(self.fl_group.interior(), padx=0)
+@@ -2224,7 +2239,8 @@
+ text = """Follows same coloring as surface.""",
+ )
+ label.pack()
+- self.fl_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
++ #self.fl_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
++ self.fl_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+
+ self.pi_group = Pmw.Group(self.interior(),tag_text='Positive Isosurface')
+ self.pi_buttonbox = Pmw.ButtonBox(self.pi_group.interior(), padx=0)
+@@ -2243,7 +2259,8 @@
+ entryfield_validate = {'validator' : 'real', 'min':0}
+ )
+ self.pos_surf_val.pack(side=LEFT)
+- self.pi_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ #self.pi_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ self.pi_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+
+ self.ni_group = Pmw.Group(self.interior(),tag_text='Negative Isosurface')
+ self.ni_buttonbox = Pmw.ButtonBox(self.ni_group.interior(), padx=0)
+@@ -2262,7 +2279,8 @@
+ entryfield_validate = {'validator' : 'real', 'max':0}
+ )
+ self.neg_surf_val.pack(side=LEFT)
+- self.ni_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ #self.ni_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
++ self.ni_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
+
+
+
diff --git a/sci-chemistry/pymol-apbs-plugin/metadata.xml b/sci-chemistry/pymol-apbs-plugin/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p15.ebuild b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p15.ebuild
new file mode 100644
index 000000000000..8609778501ce
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p15.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit python
+
+MY_PV="${PV##*_p}"
+
+DESCRIPTION="APBS plugin for pymol"
+HOMEPAGE="http://sourceforge.net/projects/pymolapbsplugin/"
+SRC_URI="http://pymolapbsplugin.svn.sourceforge.net/viewvc/pymolapbsplugin/trunk/src/apbsplugin.py?revision=${MY_PV} -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="~amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ !<sci-chemistry/pymol-1.2.2-r1"
+DEPEND="${RDEPEND}"
+RESTRICT_PYTHON_ABIS="3.*"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${P}.py "${S}"/
+ python_copy_sources
+}
+
+src_install() {
+ installation() {
+ sed \
+ -e "s:^APBS_BINARY_LOCATION.*:APBS_BINARY_LOCATION = \"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "s:^APBS_PSIZE_LOCATION.*:APBS_PSIZE_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "s:^APBS_PDB2PQR_LOCATION.*:APBS_PDB2PQR_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/\":g" \
+ -e "s:^TEMPORARY_FILE_DIR.*:TEMPORARY_FILE_DIR = \"./\":g" \
+ -i ${P}.py
+
+ insinto $(python_get_sitedir)/pmg_tk/startup/
+ newins ${P}.py apbs_tools.py || die
+ }
+ python_execute_function -s installation
+}
+
+pkg_postinst() {
+ python_mod_optimize pmg_tk/startup/apbs_tools.py
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup/apbs_tools.py
+}
diff --git a/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p18.ebuild b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p18.ebuild
new file mode 100644
index 000000000000..11596fe54cbf
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-0_p18.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit python
+
+MY_PV="${PV##*_p}"
+
+DESCRIPTION="APBS plugin for pymol"
+HOMEPAGE="http://sourceforge.net/projects/pymolapbsplugin/"
+SRC_URI="http://pymolapbsplugin.svn.sourceforge.net/viewvc/pymolapbsplugin/trunk/src/apbsplugin.py?revision=${MY_PV} -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ !<sci-chemistry/pymol-1.2.2-r1"
+DEPEND="${RDEPEND}"
+RESTRICT_PYTHON_ABIS="3.*"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${P}.py "${S}"/
+ python_copy_sources
+}
+
+src_install() {
+ installation() {
+ sed \
+ -e "s:^APBS_BINARY_LOCATION.*:APBS_BINARY_LOCATION = \"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "s:^APBS_PSIZE_LOCATION.*:APBS_PSIZE_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "s:^APBS_PDB2PQR_LOCATION.*:APBS_PDB2PQR_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/\":g" \
+ -e "s:^TEMPORARY_FILE_DIR.*:TEMPORARY_FILE_DIR = \"./\":g" \
+ -i ${P}.py
+
+ insinto $(python_get_sitedir)/pmg_tk/startup/
+ newins ${P}.py apbs_tools.py || die
+ }
+ python_execute_function -s installation
+}
+
+pkg_postinst() {
+ python_mod_optimize pmg_tk/startup/apbs_tools.py
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup/apbs_tools.py
+}
diff --git a/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p24.ebuild b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p24.ebuild
new file mode 100644
index 000000000000..627780c1ff39
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p24.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit python
+
+MY_PV="${PV##*_p}"
+
+DESCRIPTION="APBS plugin for pymol"
+HOMEPAGE="http://sourceforge.net/projects/pymolapbsplugin/"
+SRC_URI="http://pymolapbsplugin.svn.sourceforge.net/viewvc/pymolapbsplugin/trunk/src/apbsplugin.py?revision=${MY_PV} -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+LICENSE="pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ !<sci-chemistry/pymol-1.2.2-r1"
+DEPEND="${RDEPEND}"
+RESTRICT_PYTHON_ABIS="3.*"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${P}.py "${S}"/
+ python_copy_sources
+}
+
+src_install() {
+ installation() {
+ sed \
+ -e "s:^APBS_BINARY_LOCATION.*:APBS_BINARY_LOCATION = \"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "s:^APBS_PSIZE_LOCATION.*:APBS_PSIZE_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "s:^APBS_PDB2PQR_LOCATION.*:APBS_PDB2PQR_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/\":g" \
+ -e "s:^TEMPORARY_FILE_DIR.*:TEMPORARY_FILE_DIR = \"./\":g" \
+ -i ${P}.py
+
+ insinto $(python_get_sitedir)/pmg_tk/startup/
+ newins ${P}.py apbs_tools.py || die
+ }
+ python_execute_function -s installation
+}
+
+pkg_postinst() {
+ python_mod_optimize pmg_tk/startup/apbs_tools.py
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup/apbs_tools.py
+}
diff --git a/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26-r1.ebuild b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26-r1.ebuild
new file mode 100644
index 000000000000..819687b121bc
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1
+
+MY_PV="${PV##*_p}"
+
+DESCRIPTION="APBS plugin for pymol"
+HOMEPAGE="http://sourceforge.net/projects/pymolapbsplugin/"
+SRC_URI="http://sourceforge.net/p/pymolapbsplugin/code/${MY_PV}/tree/trunk/src/apbsplugin.py?format=raw -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+LICENSE="pymol"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ !<sci-chemistry/pymol-1.2.2-r1"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${P}.py "${S}"/
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-tcltk8.6.patch
+ python_copy_sources
+}
+
+src_install() {
+ installation() {
+ cd "${BUILD_DIR}" || die
+ sed \
+ -e "s:^APBS_BINARY_LOCATION.*:APBS_BINARY_LOCATION = \"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "s:^APBS_PSIZE_LOCATION.*:APBS_PSIZE_LOCATION = \"$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "s:^APBS_PDB2PQR_LOCATION.*:APBS_PDB2PQR_LOCATION = \"$(python_get_sitedir)/pdb2pqr/\":g" \
+ -e "s:^TEMPORARY_FILE_DIR.*:TEMPORARY_FILE_DIR = \"./\":g" \
+ ${P}.py > apbs_tools.py || die
+
+ python_moduleinto pmg_tk/startup
+ python_domodule apbs_tools.py
+ python_optimize
+ }
+ python_parallel_foreach_impl installation
+}
diff --git a/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26.ebuild b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26.ebuild
new file mode 100644
index 000000000000..5f4c1affc3de
--- /dev/null
+++ b/sci-chemistry/pymol-apbs-plugin/pymol-apbs-plugin-2.1_p26.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1
+
+MY_PV="${PV##*_p}"
+
+DESCRIPTION="APBS plugin for pymol"
+HOMEPAGE="http://sourceforge.net/projects/pymolapbsplugin/"
+SRC_URI="http://sourceforge.net/p/pymolapbsplugin/code/${MY_PV}/tree/trunk/src/apbsplugin.py?format=raw -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+LICENSE="pymol"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ !<sci-chemistry/pymol-1.2.2-r1"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${P}.py "${S}"/
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-tcltk8.6.patch
+ python_copy_sources
+}
+
+src_install() {
+ installation() {
+ cd "${BUILD_DIR}" || die
+ sed \
+ -e "s:^APBS_BINARY_LOCATION.*:APBS_BINARY_LOCATION = \"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "s:^APBS_PSIZE_LOCATION.*:APBS_PSIZE_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "s:^APBS_PDB2PQR_LOCATION.*:APBS_PDB2PQR_LOCATION = \"${EPREFIX}/$(python_get_sitedir)/pdb2pqr/\":g" \
+ -e "s:^TEMPORARY_FILE_DIR.*:TEMPORARY_FILE_DIR = \"./\":g" \
+ ${P}.py > apbs_tools.py
+
+ python_moduleinto pmg_tk/startup
+ python_domodule apbs_tools.py || die
+ python_optimize
+ }
+ python_parallel_foreach_impl installation
+}
diff --git a/sci-chemistry/pymol-plugins-bni-tools/Manifest b/sci-chemistry/pymol-plugins-bni-tools/Manifest
new file mode 100644
index 000000000000..532cf761f73b
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-bni-tools/Manifest
@@ -0,0 +1,2 @@
+DIST bni-tools-0.251.zip 32596 SHA256 79f77ecb5797de49249c571eda958a97647f34f456bcda952e4b63ffd0c412d2 SHA512 0d28433679fff1d4473469078ef3b9091f4ed13ccf414d4c54afadcde2f120768f26c0aaee378f04fd9cc71159f21ad7f9281a163a365106dadc3f641b743b76 WHIRLPOOL 4f869b2a357b6c1be6077f478b7356e4bba14ae7a4ef7c17357f6729888439d4c3b09cb27271585258024f39f2fe2437016dd7bec3301e849de453add25330d9
+DIST bni-tools-027.zip 33753 SHA256 9ddb9785146b12c5c2ff03d34262fec8ff04bfaa9c56ec4665bac5e33879cd7c SHA512 9c0ef1ca5bbb3040192ab2668f354f947e93d42c91a0cfdde5d05be273e6ba9f29ec3c6ee86367f18d87316282b4e0141183b8d6259bd36d44010b7bbb7666e5 WHIRLPOOL 7e14a2ef86009237f53e28f6ac95b56687dd7275e8bd8a856c4d408a6c57cffb7131cb9a505d01da7b2f58bf20bae9b400e478d994bb04f9e799ecf09a60edd3
diff --git a/sci-chemistry/pymol-plugins-bni-tools/metadata.xml b/sci-chemistry/pymol-plugins-bni-tools/metadata.xml
new file mode 100644
index 000000000000..c4982f1db5fb
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-bni-tools/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>jlec@gentoo.org</email>
+ <name>Justin Lecher (jlec)</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">bni-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.25.1.ebuild b/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.25.1.ebuild
new file mode 100644
index 000000000000..640cf969c61e
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.25.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit python versionator
+
+MY_PN="${PN#pymol-plugins-}"
+MY_P="${MY_PN}-$(delete_version_separator 2)"
+
+DESCRIPTION="Gives Pymol additional functionalities and presets to the PyMOL GUI"
+HOMEPAGE="http://bni-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.zip"
+
+LICENSE="CNRI"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sci-chemistry/pymol"
+DEPEND="app-arch/unzip"
+RESTRICT_PYTHON_ABIS="2.4 3.*"
+
+src_install(){
+ installation() {
+ insinto $(python_get_sitedir)/pmg_tk/startup/
+ doins bni-tools.py || die "Failed to install ${P}"
+ }
+ python_execute_function installation
+ dodoc readme.txt || die "No dodoc"
+}
+
+pkg_postinst(){
+ python_mod_optimize pmg_tk/startup
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup
+}
diff --git a/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.27.ebuild b/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.27.ebuild
new file mode 100644
index 000000000000..8ade4b32c540
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-bni-tools/pymol-plugins-bni-tools-0.27.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1 versionator
+
+MY_PN="${PN#pymol-plugins-}"
+MY_P="${MY_PN}-$(delete_version_separator 1)"
+MY_P_DOT="${MY_PN}-${PV}"
+
+DESCRIPTION="Gives Pymol additional functionalities and presets to the PyMOL GUI"
+HOMEPAGE="http://bni-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_PN}/${MY_P_DOT}/${MY_P}.zip"
+
+LICENSE="CNRI"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+src_install(){
+ python_moduleinto pmg_tk/startup
+ python_parallel_foreach_impl python_domodule bni-tools.py
+ python_parallel_foreach_impl python_optimize
+ dodoc readme.txt
+ dohtml ShortCommandDescription.html
+}
diff --git a/sci-chemistry/pymol-plugins-caver/Manifest b/sci-chemistry/pymol-plugins-caver/Manifest
new file mode 100644
index 000000000000..ecfe07a54c4b
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-caver/Manifest
@@ -0,0 +1 @@
+DIST Caver2_1_2_pymol_plugin.zip 5698331 SHA256 1dcc61ba13247c05710c4cd68491d0c867ce1d0c11c824be85a516250b2874e3 SHA512 9d28e059bb20f30cf6a0d25ed2eb080dcf9dbb753e9d4578d95e293b31c5cf5fe23d5177dccdb79c192ab3e65bb484b6eb22b26c267637b125404f871e01a52c WHIRLPOOL 33e6893d2114b5ce197fc098d09dfc67ce88f38741e30f1fa574873836c636b5e0c180301849fd98f1f93de5ce51554d2245d0bd615b938d39a802e91e68ebb9
diff --git a/sci-chemistry/pymol-plugins-caver/metadata.xml b/sci-chemistry/pymol-plugins-caver/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-caver/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-caver/pymol-plugins-caver-2.1.2.ebuild b/sci-chemistry/pymol-plugins-caver/pymol-plugins-caver-2.1.2.ebuild
new file mode 100644
index 000000000000..a07aef903771
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-caver/pymol-plugins-caver-2.1.2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit multilib python-r1 eutils versionator java-utils-2
+
+MY_PV="$(replace_all_version_separators _)"
+MY_P="Caver${MY_PV}_pymol_plugin"
+
+DESCRIPTION="Calculation of pathways from buried cavities to outside solvent in protein structures"
+HOMEPAGE="http://loschmidt.chemi.muni.cz/caver/"
+SRC_URI="${MY_P}.zip"
+
+LICENSE="CAVER"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=virtual/jre-1.6
+ sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND="app-arch/unzip"
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${MY_P}"/linux_mac
+
+pkg_nofetch() {
+ elog "Download ${A}"
+ elog "from ${HOMEPAGE}. This requires registration."
+ elog "Place tarballs in ${DISTDIR}."
+}
+
+src_install() {
+ java-pkg_dojar Caver${MY_PV}/*.jar
+
+ java-pkg_jarinto /usr/share/${PN}/lib/lib/
+ java-pkg_dojar Caver${MY_PV}/lib/*.jar
+
+ installation() {
+ sed \
+ -e "s:directory/where/jar/with/plugin/is/located:${EPREFIX}/usr/share/${PN}/lib/:g" \
+ -i Caver${MY_PV}.py || die
+
+ python_moduleinto pmg_tk/startup/
+ python_domodule Caver${MY_PV}.py
+ python_optimize
+ }
+ python_foreach_impl installation
+}
diff --git a/sci-chemistry/pymol-plugins-dssp/Manifest b/sci-chemistry/pymol-plugins-dssp/Manifest
new file mode 100644
index 000000000000..026f06f2be36
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dssp/Manifest
@@ -0,0 +1 @@
+DIST pymol-plugins-dssp-110430.py.xz 6836 SHA256 8be8da803f5b3908b5918c8fd355bd7e37785d2eada3a92d6de15b362b9e3868 SHA512 521e0a32ca6d2c8c21c690815b0654bb44303bd7fb9a1eb76227030b2ad7311fadb0d748e49b8bbc16cd5e69acba375b5353de7bffef1ff69686e62021fe64f4 WHIRLPOOL bfe0edc2307b3879668095dbe8a9bb242a58c5f6e449f1a08d3a655e9383c7b5a273d7cae65d3067f8f06a0a9d251565cd7f047d741349876bbfdfd366ffe2a5
diff --git a/sci-chemistry/pymol-plugins-dssp/metadata.xml b/sci-chemistry/pymol-plugins-dssp/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dssp/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430-r1.ebuild b/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430-r1.ebuild
new file mode 100644
index 000000000000..bc129c005d87
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1
+
+DESCRIPTION="DSSP Plugin for PyMOL"
+HOMEPAGE="http://www.biotec.tu-dresden.de/~hongboz/dssp_pymol/dssp_pymol.html"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.py.xz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/dssp
+ sci-biology/stride
+ sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND=""
+
+S="${WORKDIR}"
+
+src_prepare() {
+ sed \
+ -e "s:GENTOO_DSSP:${EPREFIX}/usr/bin/dssp:g" \
+ -e "s:GENTOO_STRIDE:${EPREFIX}/usr/bin/stride:g" \
+ -i ${P}.py || die
+}
+
+src_install() {
+ python_moduleinto pmg_tk/startup
+ python_parallel_foreach_impl python_domodule ${P}.py
+ python_parallel_foreach_impl python_optimize
+}
diff --git a/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430.ebuild b/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430.ebuild
new file mode 100644
index 000000000000..4bdb53a1019e
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dssp/pymol-plugins-dssp-110430.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython"
+
+inherit python
+
+DESCRIPTION="DSSP Plugin for PyMOL"
+HOMEPAGE="http://www.biotec.tu-dresden.de/~hongboz/dssp_pymol/dssp_pymol.html"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.py.xz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/dssp
+ sci-biology/stride
+ sci-chemistry/pymol"
+DEPEND=""
+
+src_prepare() {
+ sed \
+ -e "s:GENTOO_DSSP:${EPREFIX}/usr/bin/dssp:g" \
+ -e "s:GENTOO_STRIDE:${EPREFIX}/usr/bin/stride:g" \
+ -i ${P}.py || die
+}
+
+src_install() {
+ installation() {
+ insinto $(python_get_sitedir)/pmg_tk/startup
+ doins ${P}.py
+ }
+ python_execute_function installation
+}
+
+pkg_postinst() {
+ python_mod_optimize pmg_tk/startup/${P}.py
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup/${P}.py
+}
diff --git a/sci-chemistry/pymol-plugins-dynamics/Manifest b/sci-chemistry/pymol-plugins-dynamics/Manifest
new file mode 100644
index 000000000000..a607e37c50b4
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dynamics/Manifest
@@ -0,0 +1 @@
+DIST pymol-plugins-dynamics-1.2.0.tar.gz 725163 SHA256 edf9bddbbce41ee5319bfd0b28d6e0b0eba56e8b2d8a300d510be8ff5894704f SHA512 7e8d62ea58cb88348136fccd132d9a1faaa3474c0a0f821e729ced777620e2083b1b0606d79fc75802755c96c5eb0b90e08b00e5c865ecbaaee2b837f56987de WHIRLPOOL 07061d3b0840fef0025be55b90fca013afc1ea58308d6ee11a8b74321de4f1c24760b1cf141b0a86678c5cf652c8890cdf2c4e0da60403c8454e04b003e20aaa
diff --git a/sci-chemistry/pymol-plugins-dynamics/metadata.xml b/sci-chemistry/pymol-plugins-dynamics/metadata.xml
new file mode 100644
index 000000000000..78402e14de8d
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dynamics/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">tomaszmakarewicz/Dynamics</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-dynamics/pymol-plugins-dynamics-1.2.0.ebuild b/sci-chemistry/pymol-plugins-dynamics/pymol-plugins-dynamics-1.2.0.ebuild
new file mode 100644
index 000000000000..3959b0bedcac
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-dynamics/pymol-plugins-dynamics-1.2.0.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1
+
+MY_PN="Dynamics"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Molecular dynamics in Pymol"
+HOMEPAGE="https://github.com/tomaszmakarewicz/Dynamics"
+SRC_URI="https://github.com/tomaszmakarewicz/Dynamics/archive/v1.2.0.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="${PYTHON_DEPS}"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${MY_P}
+
+DOCS=( manual.odt )
+
+src_prepare() {
+ sed \
+ -e "/sys.path.insert/d" \
+ -e "s:import dynamics_pymol_plugin:from pmg_tk.startup import dynamics_pymol_plugin:g" \
+ -i pydynamics* || die
+}
+
+src_install() {
+ python_moduleinto pmg_tk/startup
+ python_parallel_foreach_impl python_domodule dynamics_pymol_plugin.py
+ python_parallel_foreach_impl python_doscript pydynamics*
+}
diff --git a/sci-chemistry/pymol-plugins-emovie/Manifest b/sci-chemistry/pymol-plugins-emovie/Manifest
new file mode 100644
index 000000000000..26303adeb07b
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-emovie/Manifest
@@ -0,0 +1 @@
+DIST eMovie_package.zip 22840 RMD160 1576bbf2007f82f6d06b0a79d45ee634d1d28be5 SHA1 4a3ed376cfe612f515c9d0390d5c4b0dead8de72 SHA256 a899d08f43902f803a797ddbd1052c687db03add53b2f815c91ae83223cc7f82
diff --git a/sci-chemistry/pymol-plugins-emovie/files/1.0.4-indent.patch b/sci-chemistry/pymol-plugins-emovie/files/1.0.4-indent.patch
new file mode 100644
index 000000000000..a9a77e5055dd
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-emovie/files/1.0.4-indent.patch
@@ -0,0 +1,22 @@
+diff --git a/eMovie.py b/eMovie.py
+index a865732..8b5b068 100644
+--- a/eMovie.py
++++ b/eMovie.py
+@@ -931,7 +931,7 @@ class Story(tkSimpleDialog.Dialog):
+
+ if self.parent is not None:
+ self.geometry("+%d+%d" % (parent.winfo_rootx()+50,parent.winfo_rooty()+50))
+- self.initial_focus.focus_set()
++ self.initial_focus.focus_set()
+
+ self.wait_window(self)
+
+@@ -2041,7 +2041,7 @@ class AddMorph(tkSimpleDialog.Dialog):
+
+ if self.parent is not None:
+ self.geometry("+%d+%d" % (parent.winfo_rootx()+50,parent.winfo_rooty()+50))
+- self.initial_focus.focus_set()
++ self.initial_focus.focus_set()
+
+ self.wait_window(self)
+
diff --git a/sci-chemistry/pymol-plugins-emovie/metadata.xml b/sci-chemistry/pymol-plugins-emovie/metadata.xml
new file mode 100644
index 000000000000..18330bb401f1
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-emovie/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-chemistry</herd>
+<maintainer>
+ <email>jlec@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-emovie/pymol-plugins-emovie-1.0.4.ebuild b/sci-chemistry/pymol-plugins-emovie/pymol-plugins-emovie-1.0.4.ebuild
new file mode 100644
index 000000000000..38a48fd485fe
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-emovie/pymol-plugins-emovie-1.0.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+SUPPORT_PYTHON_ABIS="1"
+
+inherit eutils python
+
+DESCRIPTION="eMovie is a plug-in tool for the molecular visualization program PyMOL"
+SRC_URI="http://www.weizmann.ac.il/ISPC/eMovie_package.zip"
+HOMEPAGE="http://www.weizmann.ac.il/ISPC/eMovie.html"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~amd64 ~x86-linux ~amd64-linux"
+IUSE=""
+
+RDEPEND=">sci-chemistry/pymol-0.99"
+DEPEND="app-arch/unzip"
+#RESTRICT_PYTHON_ABIS="3.*"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-indent.patch
+
+ mkdir ${P}
+ mv e* ${P}/
+
+ python_copy_sources
+
+ conversion() {
+ [[ "${PYTHON_ABI}" == 2.* ]] && return
+
+ 2to3-${PYTHON_ABI} -w eMovie.py > /dev/null
+ }
+ python_execute_function --action-message 'Applying patches for Python ${PYTHON_ABI}' --failure-message 'Applying patches for Python ${PYTHON_ABI} failed' -s conversion
+}
+
+src_install(){
+ installation() {
+ insinto $(python_get_sitedir)/pmg_tk/startup/
+ doins eMovie.py || die
+ }
+ python_execute_function -s installation
+}
+
+pkg_postinst(){
+ python_mod_optimize pmg_tk/startup
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup
+}
diff --git a/sci-chemistry/pymol-plugins-msms/Manifest b/sci-chemistry/pymol-plugins-msms/Manifest
new file mode 100644
index 000000000000..d4d6fb620908
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-msms/Manifest
@@ -0,0 +1 @@
+DIST pymol-plugins-msms-100415.py 62320 SHA256 1452acdcf8b13f5af22da563d44d51aca9f8fdd108dd7a0548ec41941cb463a5 SHA512 924d89836f92d0be52d7534cbe6dc9338dac1c2263a51900ab62dbe96e4f54f565dbaa6bdf51236d8ea8e9042aa09283a117f5285561b252177a5a32f3876489 WHIRLPOOL c5889b3543ac554083b76c38bb53fad1f001bd46f6686b0cdc36c1a7e576de3dc9a9bba0b459e0d928e30aec21ab09b98a0a8eb128fa64fc5b4228ca9ad7c0e4
diff --git a/sci-chemistry/pymol-plugins-msms/files/100415-msms.patch b/sci-chemistry/pymol-plugins-msms/files/100415-msms.patch
new file mode 100644
index 000000000000..0d26fb31c5f1
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-msms/files/100415-msms.patch
@@ -0,0 +1,33 @@
+ pymol-plugins-msms-100415.py | 18 ++++++++++--------
+ 1 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/pymol-plugins-msms-100415.py b/pymol-plugins-msms-100415.py
+index 725934d..7ea00bf 100644
+--- a/pymol-plugins-msms-100415.py
++++ b/pymol-plugins-msms-100415.py
+@@ -99,15 +99,17 @@ class MSMSPlugin:
+ self.cleanup_saved_pymol_sel.set(True) # by default, clean up
+
+ self.pdb_fn.set('')
+- if 'MSMS_BIN' in os.environ:
+- if VERBOSE: print 'Found MSMS_BIN in environmental variables', os.environ['MSMS_BIN']
+- self.msms_bin.set(os.environ['MSMS_BIN'])
+- else:
+- if VERBOSE: print 'MSMS_BIN not found in environmental variables.'
+- self.msms_bin.set('')
++ self.msms_bin.set('GENTOOMSMS')
++## if 'MSMS_BIN' in os.environ:
++## if VERBOSE: print 'Found MSMS_BIN in environmental variables', os.environ['MSMS_BIN']
++## self.msms_bin.set(os.environ['MSMS_BIN'])
++## else:
++## if VERBOSE: print 'MSMS_BIN not found in environmental variables.'
++## self.msms_bin.set('')
+ ## self.pdb2xyzr_bin.set('')
+- if 'PDB2XYZRN' in os.environ: self.pdb2xyzrn_bin.set(os.environ['PDB2XYZRN'])
+- else: self.pdb2xyzrn_bin.set('')
++ self.pdb2xyzrn_bin.set('GENTOOXYZRN')
++## if 'PDB2XYZRN' in os.environ: self.pdb2xyzrn_bin.set(os.environ['PDB2XYZRN'])
++## else: self.pdb2xyzrn_bin.set('')
+ self.tmp_dir.set('/tmp')
+ self.cleanup_msms_output = Tkinter.BooleanVar()
+ self.cleanup_msms_output.set(True) # by default, clean up msms output
diff --git a/sci-chemistry/pymol-plugins-msms/metadata.xml b/sci-chemistry/pymol-plugins-msms/metadata.xml
new file mode 100644
index 000000000000..c6f92c968349
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-msms/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+MSMS is an excellent tool for computing protein solvent excluded surface (SES).
+MSMS Plugin for PyMOL provides a graphical user interface for running MSMS and
+displaying its results in PyMOL.
+
+1. Citation for this plugin:
+ Hongbo Zhu. MSMS plugin for PyMOL, 2010, Biotechnology Center (BIOTEC), TU Dresden.
+2. Citation for PyMOL can be found at: http://pymol.sourceforge.net/faq.html#CITE
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415-r1.ebuild b/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415-r1.ebuild
new file mode 100644
index 000000000000..d90a27f98ca8
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1
+
+DESCRIPTION="GUI for MSMS and displaying its results in PyMOL"
+HOMEPAGE="http://www.biotec.tu-dresden.de/~hongboz/msms_pymol/msms_pymol.html"
+SRC_URI="http://www.biotec.tu-dresden.de/~hongboz/msms_pymol/pymol_script/msms_pymol.py -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/msms-bin
+ sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp "${DISTDIR}"/${A} "${S}/" || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-msms.patch
+ sed \
+ -e "s:GENTOOMSMS:${EPREFIX}/opt/bin/msms:g" \
+ -e "s:GENTOOXYZRN:${EPREFIX}/usr/bin/pdb_to_xyzrn:g" \
+ -i ${A} || die
+}
+
+src_install() {
+ python_moduleinto pmg_tk/startup
+ python_parallel_foreach_impl python_domodule ${P}.py
+ python_parallel_foreach_impl python_optimize
+}
diff --git a/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415.ebuild b/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415.ebuild
new file mode 100644
index 000000000000..e226003f8560
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-msms/pymol-plugins-msms-100415.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython"
+
+inherit eutils python
+
+DESCRIPTION="GUI for MSMS and displaying its results in PyMOL"
+HOMEPAGE="http://www.biotec.tu-dresden.de/~hongboz/msms_pymol/msms_pymol.html"
+SRC_URI="http://www.biotec.tu-dresden.de/~hongboz/msms_pymol/pymol_script/msms_pymol.py -> ${P}.py"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD pymol"
+IUSE=""
+
+RDEPEND="
+ sci-chemistry/msms-bin
+ sci-chemistry/pymol"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ mkdir "${S}"
+ cp "${DISTDIR}"/${A} "${S}/"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-msms.patch
+ sed \
+ -e "s:GENTOOMSMS:${EPREFIX}/opt/bin/msms:g" \
+ -e "s:GENTOOXYZRN:${EPREFIX}/usr/bin/pdb_to_xyzrn:g" \
+ -i ${A} || die
+}
+
+src_install() {
+ installation() {
+ insinto $(python_get_sitedir)/pmg_tk/startup
+ doins ${P}.py
+ }
+ python_execute_function installation
+}
+
+pkg_postinst() {
+ python_mod_optimize pmg_tk/startup/${P}.py
+}
+
+pkg_postrm() {
+ python_mod_cleanup pmg_tk/startup/${P}.py
+}
diff --git a/sci-chemistry/pymol-plugins-promol/Manifest b/sci-chemistry/pymol-plugins-promol/Manifest
new file mode 100644
index 000000000000..30b2014c9f2f
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-promol/Manifest
@@ -0,0 +1 @@
+DIST pymol-plugins-promol-3.0.2.zip 2219295 SHA256 4281131ab5fc5568c1e3984aec4a7022b515334c66adfbc2682df5f0e6a4c2d6 SHA512 e40e9c08e2cb1b223390d751bb1f32069924f1c23aa2b4bdafb6689254e6aa673d4412aca587792f660869f97a389db8a9183033d8b2394c998d0f911104d8d7 WHIRLPOOL 83a3122aaa60b3d81ca8f19dcc4c8bce32190861893c712e517d48053d65009ff001b7bb1bb89b7bbd2504f1cea38999655ddd164defcba0231e805a5c590728
diff --git a/sci-chemistry/pymol-plugins-promol/metadata.xml b/sci-chemistry/pymol-plugins-promol/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-promol/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-promol/pymol-plugins-promol-3.0.2-r1.ebuild b/sci-chemistry/pymol-plugins-promol/pymol-plugins-promol-3.0.2-r1.ebuild
new file mode 100644
index 000000000000..e2d6430c01e1
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-promol/pymol-plugins-promol-3.0.2-r1.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=( python2_7 )
+
+inherit python-r1
+
+DESCRIPTION="Fast and accurate regognition of active sites"
+HOMEPAGE="http://www.rit.edu/cos/ezviz/ProMOL_dl.html"
+SRC_URI="http://www.rit.edu/cos/ezviz/ProMOL.zip -> ${P}.zip"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux"
+LICENSE="all-rights-reserved"
+IUSE=""
+
+RESTRICT="mirror bindist"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ virtual/pmw[${PYTHON_USEDEP}]
+ sci-chemistry/pymol[${PYTHON_USEDEP}]"
+DEPEND=""
+
+S="${WORKDIR}/ProMOL Folder"
+
+src_prepare() {
+ python_copy_sources
+ preparation() {
+ cd "${BUILD_DIR}" || die
+ sed \
+ -e "s:./modules/pmg_tk/startup:${EPREFIX}/$(python_get_sitedir)/pmg_tk/startup/ProMol:g" \
+ -i ProMOL_302.py || die
+ }
+ python_foreach_impl preparation
+}
+
+src_install(){
+ dodoc *doc
+ dohtml -r Thanks.html EDMHelp.htm Help
+
+ installation() {
+ cd "${BUILD_DIR}" || die
+ python_moduleinto pmg_tk/startup/ProMol
+ python_domodule PDB_List AminoPics Motifs *GIF pdb_entry_type.txt Master.txt Scripts
+ python_moduleinto pmg_tk/startup
+ python_domodule *.py
+ dosym ../../../../../../share/doc/${PF}/html/Help \
+ $(python_get_sitedir)/pmg_tk/startup/ProMol/Help
+ dosym ../../../../../../share/doc/${PF}/html/Thanks.html \
+ $(python_get_sitedir)/pmg_tk/startup/ProMol/Thanks.html
+ dosym ../../../../../../share/doc/${PF}/html/EDMHelp.htm \
+ $(python_get_sitedir)/pmg_tk/startup/ProMol/EDMHelp.htm
+ }
+ python_foreach_impl installation
+}
diff --git a/sci-chemistry/pymol-plugins-psico/Manifest b/sci-chemistry/pymol-plugins-psico/Manifest
new file mode 100644
index 000000000000..0484184b2dd1
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-psico/Manifest
@@ -0,0 +1 @@
+DIST pymol-plugins-psico-3.1.tar.gz 76136 SHA256 07bfb0cfc1ca4720180de0b462a8c210e933bfc75cec9823d8c89fa2007ce651 SHA512 b0f57049ea6fc290a5abd48e0c98d4fda3c3f947898597b80e11cb3ab9ac14038aade0a016b21a525bf0ab4cf68e3be35c64b8ec34422268058414c20a755b0e WHIRLPOOL 7f64fc7fbded6a5eeb1940725b7ab3488e9c94a1587040a8f072a5e38319a640fbcf9d71cb57d97cdd7ca83de0298a0d839221f3a850601785db869a0ce2e2ea
diff --git a/sci-chemistry/pymol-plugins-psico/metadata.xml b/sci-chemistry/pymol-plugins-psico/metadata.xml
new file mode 100644
index 000000000000..3eff7c70cfe7
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-psico/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">speleo3/pymol-psico</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol-plugins-psico/pymol-plugins-psico-3.1-r1.ebuild b/sci-chemistry/pymol-plugins-psico/pymol-plugins-psico-3.1-r1.ebuild
new file mode 100644
index 000000000000..2b4d116b04fd
--- /dev/null
+++ b/sci-chemistry/pymol-plugins-psico/pymol-plugins-psico-3.1-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 vcs-snapshot
+
+DESCRIPTION="Pymol ScrIpt COllection"
+HOMEPAGE="https://github.com/speleo3/pymol-psico/"
+SRC_URI="https://github.com/speleo3/pymol-psico/tarball/${PV} -> ${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD-2"
+IUSE="minimal"
+
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-biology/biopython[${PYTHON_USEDEP}]
+ sci-libs/mmtk[${PYTHON_USEDEP}]
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ !minimal? (
+ media-libs/qhull
+ media-video/mplayer
+ sci-biology/stride
+ sci-chemistry/ccp4-apps[${PYTHON_USEDEP}]
+ sci-chemistry/dssp
+ sci-chemistry/mm-align
+ sci-chemistry/pdbmat
+ sci-chemistry/theseus
+ sci-chemistry/tm-align
+ sci-mathematics/diagrtb
+ )"
+
+pkg_postinst() {
+ if ! use minimal; then
+ elog "For full functionality you need to get DynDom from"
+ elog "http://fizz.cmp.uea.ac.uk/dyndom/dyndomMain.do"
+ fi
+}
diff --git a/sci-chemistry/pymol/Manifest b/sci-chemistry/pymol/Manifest
new file mode 100644
index 000000000000..3e0a1ca939e5
--- /dev/null
+++ b/sci-chemistry/pymol/Manifest
@@ -0,0 +1,4 @@
+DIST pymol-1.7.0.0.png.xz 5392 SHA256 4c554a5c4f47946b6f7bae00209d5116305162534292735d30ae0794c56a8a0b SHA512 24bb1584b28688f5d5824e938f8500ca9887838adf490b4284c52f8c0da4c5ec4a56051ee80f48e4f34541ab53f9a4e00c849c382f1fd37c232fbea12d700105 WHIRLPOOL 395f978eb9ea3a8f8f39bf0694f71986ac9f8ebb307b90283c53fed85c4412d84e54af472f8646fcbd99c650039cb395a8f02b281168802c73ddb9bad175512b
+DIST pymol-1.7.0.1.tar.xz 6550492 SHA256 e8c6f6a465aec78171daf5cd981ebd1614dfa5e014e13c85a044cfbb591841c8 SHA512 a09277cd827f832c4f4e307f6117613d2ee8250643d129a5c34a30ceab2bfe8cea195c71a138fff09b6c69e9427153b917d7d3a7262d154ada5f323ec9635087 WHIRLPOOL 1803b55ade1b04de5963fd4a3bbe1354cda8759e15254c644952e25d7dcc904bc7b9fd91da75fdb8c6a96fd118a5a21bec9c8bba368744b44436747faca5cd9c
+DIST pymol-1.7.4.0.tar.xz 6528964 SHA256 5a732aeb8a02797a185f54c3bd8bb477a1a11976eb9f982f6cf79ce887ce3a4a SHA512 fa53e90413cb1e02797a30b21b4254901504edc029104567fd2d4c5ef630eb8c2eb9f5065b2b9e65f657aaa30ca8ac85c3314c6c7fbb89148d89a9a0964de3cf WHIRLPOOL 1467a9746abe60e371162e6065253fbb23453f80a4757a18936f5b6509f63657b7073ee5e118c7e4faf333371cd38c78917e1f4b0a3a684b4807972546180d69
+DIST pymol-1.7.6.0.tar.xz 6510380 SHA256 31d4924378b38b65fae5b294e0755ee15916f9e845ef2efe5e2421f463bf3b91 SHA512 ff8c37de07e0ed8dc1176224eea439109f2bd5e42b5c08316f5737a2fdcf5a1f267b625c166fa740296c20ef089873ae1ad6cb89b11111e9d3aeda0b6035d55d WHIRLPOOL 3582cc846695ca580a4bcd31db8079f32d3cb0d84b8fa1afeb0b210d7004642bf58eab42cafd552f360a5e20b546e554cf5420b7dd2e8cefa5b956a9453215e2
diff --git a/sci-chemistry/pymol/files/pymol-1.7.3.1-maeffplugin.cpp.patch b/sci-chemistry/pymol/files/pymol-1.7.3.1-maeffplugin.cpp.patch
new file mode 100644
index 000000000000..cd4650bbf4e0
--- /dev/null
+++ b/sci-chemistry/pymol/files/pymol-1.7.3.1-maeffplugin.cpp.patch
@@ -0,0 +1,11 @@
+--- contrib/uiuc/plugins/molfile_plugin/src/maeffplugin_orig.cpp 2014-02-07 19:50:50.132261610 -0800
++++ contrib/uiuc/plugins/molfile_plugin/src/maeffplugin.cpp 2014-02-07 19:52:12.527797099 -0800
+@@ -1983,7 +1983,7 @@
+ }
+ }
+ catch (std::exception &e) {
+- fprintf(stderr, e.what());
++ fprintf(stderr, "%s", e.what());
+ return MOLFILE_ERROR;
+ }
+ return MOLFILE_SUCCESS;
diff --git a/sci-chemistry/pymol/metadata.xml b/sci-chemistry/pymol/metadata.xml
new file mode 100644
index 000000000000..ace2d8e58ce8
--- /dev/null
+++ b/sci-chemistry/pymol/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>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="apbs">Install the apbs plugin</flag>
+ <flag name="web">Install Pymodule needed for web app support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/pymol/pymol-1.7.0.1.ebuild b/sci-chemistry/pymol/pymol-1.7.0.1.ebuild
new file mode 100644
index 000000000000..fbd2fd858c86
--- /dev/null
+++ b/sci-chemistry/pymol/pymol-1.7.0.1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit distutils-r1 fdo-mime versionator
+
+DESCRIPTION="A Python-extensible molecular graphics system"
+HOMEPAGE="http://www.pymol.org/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-1.7.0.0.png.xz
+ http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz
+"
+# mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2
+
+LICENSE="PSF-2.2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="apbs web"
+
+DEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyopengl[${PYTHON_USEDEP}]
+ media-libs/freeglut
+ media-libs/freetype:2
+ media-libs/glew
+ media-libs/libpng:0=
+ media-video/mpeg-tools
+ sys-libs/zlib
+ virtual/pmw[${PYTHON_USEDEP}]
+ apbs? (
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ sci-chemistry/pymol-apbs-plugin[${PYTHON_USEDEP}]
+ )
+ web? ( !dev-python/webpy[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${P}/${PN}
+
+python_prepare_all() {
+ sed \
+ -e "s:\"/usr:\"${EPREFIX}/usr:g" \
+ -e "/ext_comp_args/s:=\[.*\]$:= \[\]:g" \
+ -e "/import/s:argparse:argparseX:g" \
+ -i setup.py || die
+
+ rm ./modules/pmg_tk/startup/apbs_tools.py || die
+
+ sed \
+ -e "s:/opt/local:${EPREFIX}/usr:g" \
+ -e '/ext_comp_args/s:\[.*\]:[]:g' \
+ -i setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ python_export python2_7 EPYTHON
+
+ # These environment variables should not go in the wrapper script, or else
+ # it will be impossible to use the PyMOL libraries from Python.
+ cat >> "${T}"/20pymol <<- EOF
+ PYMOL_PATH="$(python_get_sitedir)/${PN}"
+ PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
+ PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
+ EOF
+
+ doenvd "${T}"/20pymol
+
+ newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
+ make_desktop_entry ${PN} PyMol ${PN} \
+ "Graphics;Education;Science;Chemistry;" \
+ "MimeType=chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2;chemical/seq-aa-fasta;chemical/seq-na-fasta;chemical/x-xyz;chemical/x-mdl-sdf;"
+
+ if ! use web; then
+ rm -rf "${D}/$(python_get_sitedir)/web" || die
+ fi
+
+ rm -f "${ED}"/usr/share/${PN}/LICENSE || die
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
diff --git a/sci-chemistry/pymol/pymol-1.7.4.0.ebuild b/sci-chemistry/pymol/pymol-1.7.4.0.ebuild
new file mode 100644
index 000000000000..20f49ba45a55
--- /dev/null
+++ b/sci-chemistry/pymol/pymol-1.7.4.0.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit distutils-r1 fdo-mime versionator
+
+DESCRIPTION="A Python-extensible molecular graphics system"
+HOMEPAGE="http://www.pymol.org/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-1.7.0.0.png.xz
+ http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz
+"
+# mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2
+# git archive -v --prefix=${P}/ master -o ${P}.tar.xz
+
+LICENSE="PSF-2.2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="apbs web"
+
+DEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyopengl[${PYTHON_USEDEP}]
+ media-libs/freeglut
+ media-libs/freetype:2
+ media-libs/glew
+ media-libs/libpng:0=
+ media-video/mpeg-tools
+ sys-libs/zlib
+ virtual/pmw[${PYTHON_USEDEP}]
+ apbs? (
+ sci-chemistry/apbs[${PYTHON_USEDEP}]
+ sci-chemistry/pdb2pqr[${PYTHON_USEDEP}]
+ sci-chemistry/pymol-apbs-plugin[${PYTHON_USEDEP}]
+ )
+ web? ( !dev-python/webpy[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${P}/${PN}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7.3.1-maeffplugin.cpp.patch
+ )
+
+python_prepare_all() {
+ sed \
+ -e "s:\"/usr:\"${EPREFIX}/usr:g" \
+ -e "/ext_comp_args.*+=/s:\[.*\]$:\[\]:g" \
+ -e "/import/s:argparse:argparseX:g" \
+ -i setup.py || die
+
+ rm ./modules/pmg_tk/startup/apbs_tools.py || die
+
+ sed \
+ -e "s:/opt/local:${EPREFIX}/usr:g" \
+ -e '/ext_comp_args/s:\[.*\]:[]:g' \
+ -i setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ python_export python2_7 EPYTHON
+
+ # These environment variables should not go in the wrapper script, or else
+ # it will be impossible to use the PyMOL libraries from Python.
+ cat >> "${T}"/20pymol <<- EOF
+ PYMOL_PATH="$(python_get_sitedir)/${PN}"
+ PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
+ PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
+ EOF
+
+ doenvd "${T}"/20pymol
+
+ newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
+ make_desktop_entry ${PN} PyMol ${PN} \
+ "Graphics;Education;Science;Chemistry;" \
+ "MimeType=chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2;chemical/seq-aa-fasta;chemical/seq-na-fasta;chemical/x-xyz;chemical/x-mdl-sdf;"
+
+ if ! use web; then
+ rm -rf "${D}/$(python_get_sitedir)/web" || die
+ fi
+
+ rm -f "${ED}"/usr/share/${PN}/LICENSE || die
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
diff --git a/sci-chemistry/pymol/pymol-1.7.6.0.ebuild b/sci-chemistry/pymol/pymol-1.7.6.0.ebuild
new file mode 100644
index 000000000000..d3ec32637cee
--- /dev/null
+++ b/sci-chemistry/pymol/pymol-1.7.6.0.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit distutils-r1 fdo-mime flag-o-matic versionator
+
+DESCRIPTION="A Python-extensible molecular graphics system"
+HOMEPAGE="http://www.pymol.org/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-1.7.0.0.png.xz
+ http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz
+"
+# mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2
+# git archive -v --prefix=${P}/ master -o ${P}.tar.xz
+
+LICENSE="PSF-2.2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="apbs web"
+
+DEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyopengl[${PYTHON_USEDEP}]
+ media-libs/freeglut
+ media-libs/freetype:2
+ media-libs/glew
+ media-libs/libpng:0=
+ media-video/mpeg-tools
+ sys-libs/zlib
+ virtual/pmw[${PYTHON_USEDEP}]
+ apbs? (
+ sci-chemistry/apbs[${PYTHON_USEDEP}]
+ sci-chemistry/pdb2pqr[${PYTHON_USEDEP}]
+ !sci-chemistry/pymol-apbs-plugin[${PYTHON_USEDEP}]
+ )
+ web? ( !dev-python/webpy[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${P}/${PN}
+
+python_prepare_all() {
+ sed \
+ -e "s:\"/usr:\"${EPREFIX}/usr:g" \
+ -e "/ext_comp_args.*+=/s:\[.*\]$:\[\]:g" \
+ -e "/import/s:argparse:argparseX:g" \
+ -i setup.py || die
+
+ sed \
+ -e "s:/opt/local:${EPREFIX}/usr:g" \
+ -e '/ext_comp_args/s:\[.*\]:[]:g' \
+ -i setup.py || die
+
+ append-cxxflags -std=c++0x
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
+
+ sed \
+ -e '1d' \
+ -e "/APBS_BINARY_LOCATION/s:None:\"${EPREFIX}/usr/bin/apbs\":g" \
+ -e "/APBS_PSIZE_LOCATION/s:None:\"$(python_get_sitedir)/pdb2pqr/src/\":g" \
+ -e "/APBS_PDB2PQR_LOCATION/s:None:\"$(python_get_sitedir)/pdb2pqr/\":g" \
+ -i "${D}/$(python_get_sitedir)"/pmg_tk/startup/apbs_tools.py || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ sed \
+ -e '1i#!/usr/bin/env python' \
+ "${D}/$(python_get_sitedir)"/pymol/__init__.py > "${T}"/${PN} || die
+
+ python_foreach_impl python_doscript "${T}"/${PN}
+
+ # These environment variables should not go in the wrapper script, or else
+ # it will be impossible to use the PyMOL libraries from Python.
+ cat >> "${T}"/20pymol <<- EOF
+ PYMOL_PATH="${EPREFIX}/usr/share/pymol"
+ PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
+ PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
+ EOF
+
+ doenvd "${T}"/20pymol
+
+ newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
+ make_desktop_entry ${PN} PyMol ${PN} \
+ "Graphics;Education;Science;Chemistry;" \
+ "MimeType=chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2;chemical/seq-aa-fasta;chemical/seq-na-fasta;chemical/x-xyz;chemical/x-mdl-sdf;"
+
+ if ! use web; then
+ rm -rf "${D}/$(python_get_sitedir)/web" || die
+ fi
+
+ rm -f "${ED}"/usr/share/${PN}/LICENSE || die
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
diff --git a/sci-chemistry/rasmol/Manifest b/sci-chemistry/rasmol/Manifest
new file mode 100644
index 000000000000..7a21a40c5d2b
--- /dev/null
+++ b/sci-chemistry/rasmol/Manifest
@@ -0,0 +1 @@
+DIST rasmol-2.7.5.2-13May11.tar.gz 9768769 SHA256 b975e6e69d5c6b161a81f04840945d2f220ac626245c61bcc6c56181b73a5718 SHA512 c4fd149c002a34d8ce7620a7eed37aa6020acd83fc352a4c16697eb94e6a0377c55455cb6da5fb3f492f879248a6707f677f4b35572f2295b23fc924ddf3128f WHIRLPOOL 261c5351e32a67807d2979b73fbdf83b947aa641568c08fd2f2b0e06115330541a56f7bbd8f05313c86554c321e59cfe11bf5ee613c09249b9e149411c61d5ca
diff --git a/sci-chemistry/rasmol/files/2.7.5-bundled-lib.patch b/sci-chemistry/rasmol/files/2.7.5-bundled-lib.patch
new file mode 100644
index 000000000000..10705165ad47
--- /dev/null
+++ b/sci-chemistry/rasmol/files/2.7.5-bundled-lib.patch
@@ -0,0 +1,80 @@
+diff --git a/src/Imakefile b/src/Imakefile
+index 03be00e..a0c68f9 100755
+--- a/src/Imakefile
++++ b/src/Imakefile
+@@ -176,7 +176,7 @@ XFORMSLIB_DIR = /usr/local
+ #endif
+ endif
+ XFORMSLIB_INCLUDE_DIR = $(XFORMSLIB_DIR)/include
+-XFORMSLIB_LDLIB = -lXpm -L$(XFORMSLIB_DIR)/lib -lforms
++XFORMSLIB_LDLIB = -lXpm -L$(XFORMSLIB_DIR)/lib
+ #endif
+ #endif
+ #endif
+@@ -281,17 +281,10 @@ RASMOLDIR = $(USRLIBDIR)/rasmol/
+
+ #ifndef USE_XFORMSLIB
+ DEFINES = $(GTKCFLAGS) $(GUIDEF) -DRASMOLDIR=\"$(RASMOLDIR)\" $(DEPTHDEF) $(LOCALEDEF) \
+- -D_USE_RASMOL_H_ $(GUIOPTION) -I$(CBFLIB_INCLUDE_DIR) \
+- -I$(CQRLIB_INCLUDE_DIR) \
+- -I$(CVECTOR_INCLUDE_DIR) \
+- -I$(NEARTREE_INCLUDE_DIR)
++ -D_USE_RASMOL_H_ $(GUIOPTION) -I@GENTOO_PORTAGE_EPREFIX@/usr/include -I@GENTOO_PORTAGE_EPREFIX@/usr/include/cbflib
+ #else
+ DEFINES = $(GTKCFLAGS) $(GUIDEF) -DRASMOLDIR=\"$(RASMOLDIR)\" $(DEPTHDEF) $(LOCALEDEF) \
+- -D_USE_RASMOL_H_ $(GUIOPTION) -I$(CBFLIB_INCLUDE_DIR) \
+- -I$(CQRLIB_INCLUDE_DIR) \
+- -I$(CVECTOR_INCLUDE_DIR) \
+- -I$(NEARTREE_INCLUDE_DIR) \
+- -I$(XFORMSLIB_INCLUDE_DIR)
++ -D_USE_RASMOL_H_ $(GUIOPTION) -I@GENTOO_PORTAGE_EPREFIX@/usr/include -I@GENTOO_PORTAGE_EPREFIX@/usr/include/cbflib
+ #endif
+
+
+@@ -317,11 +310,11 @@ OBJS = rasmol.o molecule.o abstree.o cmndline.o command.o transfor.o \
+ # Additional RS6000 AIX MITSHM Library
+ # LDLIBS = -lm -lXi -lXextSam $(XLIB)
+
+-LDLIBS = -lm -lXi $(XLIB) $(EXTRA_LIBRARIES) $(XFORMSLIB) $(GTKLIBS) \
+- $(CBFLIB_LDLIB) \
+- $(CQRLIB_LDLIB) \
+- $(CVECTOR_LDLIB) \
+- $(NEARTREE_LDLIB) $(XFORMSLIB_LDLIB)
++LDLIBS = -lm -lXi $(XLIB) $(EXTRA_LIBRARIES) $(GTKLIBS) \
++ -lcbf \
++ -lCQRlib \
++ -lCVector \
++ -lCNearTree -lgfortran
+
+
+ #
+@@ -425,11 +418,11 @@ $(NEARTREE_DIR):
+ $(NEARTREE_DIR)/CNearTree.c: $(NEARTREE_DIR)
+ #endif
+
+-$(OBJS): $(EXTPKGDIR) $(CBFLIB_OBJDEP) \
+- $(CQRLIB_OBJDEP) \
+- $(CVECTOR_OBJDEP) \
+- $(NEARTREE_OBJDEP) \
+- $(XFORMSLIB_OBJDEP)
++# $(OBJS): $(EXTPKGDIR) $(CBFLIB_OBJDEP) \
++# $(CQRLIB_OBJDEP) \
++# $(CVECTOR_OBJDEP) \
++# $(NEARTREE_OBJDEP) \
++# $(XFORMSLIB_OBJDEP)
+
+
+ gtkwin.c: gtkui.h
+diff --git a/src/Makefile.in b/src/Makefile.in
+index fc6d0af..bad90fc 100755
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -165,7 +165,7 @@ $(CBFLIBDIR)/lib/libcbf.a: $(CBFLIBDIR)
+
+ all: postdownload rasmol rastxt
+
+-rasmol: postdownload $(X11OBJS) $(CBFLIBDIR)/lib/libcbf.a
++rasmol: postdownload $(X11OBJS)
+ $(CC) -o rasmol $(LFLAGS) $(X11OBJS) $(X11LIBS)
+ chmod 755 rasmol
+
diff --git a/sci-chemistry/rasmol/files/rasmol-2.7.5.2-format-security.patch b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-format-security.patch
new file mode 100644
index 000000000000..22eb229d8a3d
--- /dev/null
+++ b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-format-security.patch
@@ -0,0 +1,39 @@
+diff -urp RasMol-2.7.5.2/src/command.c RasMol-2.7.5.2_sprintf/src/command.c
+--- RasMol-2.7.5.2/src/command.c 2011-05-15 01:23:49.000000000 +0700
++++ RasMol-2.7.5.2_sprintf/src/command.c 2014-02-12 18:02:24.633489549 +0700
+@@ -1286,7 +1286,7 @@ void ShowRecordCommand( void ) {
+ if (record_on[1]) WriteString("record appearance on\n");
+ else WriteString("record apperance off\n");
+ if (RecordMaxMS == 1.) {
+- sprintf(param,RecordTemplate);
++ sprintf(param, "%s", RecordTemplate);
+ } else{
+ sprintf(param,RecordTemplate,millisec<0?0:millisec);
+ }
+@@ -1381,7 +1381,7 @@ void ShowPlayCommand( void ) {
+ WriteString(param);
+ }
+ if (PlayMaxMS == 1.) {
+- sprintf(param,PlayTemplate);
++ sprintf(param, "%s", PlayTemplate);
+ } else{
+ sprintf(param,PlayTemplate,millisec<0?0:millisec);
+ }
+@@ -1469,7 +1469,7 @@ void WriteMovieFrame( void ) {
+ RecordPause = True;
+ } else {
+ if (RecordMaxMS == 1.) {
+- sprintf(param,RecordTemplate);
++ sprintf(param, "%s", RecordTemplate);
+ } else{
+ sprintf(param,RecordTemplate,millisec);
+ }
+@@ -1505,7 +1505,7 @@ static int PlayMovieFrame( void ) {
+ for (play_frame[1] = 0;play_frame[1]<=millisec; play_frame[1]++)
+ {
+ if (RecordMaxMS == 1.) {
+- sprintf(param,PlayTemplate);
++ sprintf(param, "%s", PlayTemplate);
+ } else{
+ sprintf(param,PlayTemplate,millisec-play_frame[1]);
+ }
diff --git a/sci-chemistry/rasmol/files/rasmol-2.7.5.2-glib.h.patch b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-glib.h.patch
new file mode 100644
index 000000000000..69c19dae5e8d
--- /dev/null
+++ b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-glib.h.patch
@@ -0,0 +1,31 @@
+ src/egg-macros.h | 3 ++-
+ src/eggfileformatchooser.c | 2 ++
+ 2 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/src/egg-macros.h b/src/egg-macros.h
+index 9a7caad..1a6bce0 100644
+--- a/src/egg-macros.h
++++ b/src/egg-macros.h
+@@ -9,7 +9,8 @@
+ #ifndef _EGG_MACROS_H_
+ #define _EGG_MACROS_H_
+
+-#include <glib/gmacros.h>
++#include <glib.h>
++#include <glib/gprintf.h>
+
+ G_BEGIN_DECLS
+
+diff --git a/src/eggfileformatchooser.c b/src/eggfileformatchooser.c
+index 32ce2ab..febfc2e 100644
+--- a/src/eggfileformatchooser.c
++++ b/src/eggfileformatchooser.c
+@@ -19,6 +19,8 @@
+ #include "eggfileformatchooser.h"
+ #include "egg-macros.h"
+
++#include <glib.h>
++#include <glib/gprintf.h>
+ #include <glib/gi18n.h>
+ #include <gtk/gtk.h>
+ #include <string.h>
diff --git a/sci-chemistry/rasmol/files/rasmol-2.7.5.2-longlong.patch b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-longlong.patch
new file mode 100644
index 000000000000..3cff0fa2f98f
--- /dev/null
+++ b/sci-chemistry/rasmol/files/rasmol-2.7.5.2-longlong.patch
@@ -0,0 +1,12 @@
+diff -urp rasmol-2.7.5-23Jul09/src/rasmol.h rasmol-2.7.5-23Jul09-64b/src/rasmol.h
+--- rasmol-2.7.5-23Jul09/src/rasmol.h 2009-07-20 21:08:43.000000000 +0700
++++ rasmol-2.7.5-23Jul09-64b/src/rasmol.h 2013-02-22 14:40:00.378574163 +0700
+@@ -125,6 +125,8 @@
+ #define VECTOR_FAR
+ #endif
+
++#define _LONGLONG
++
+ /*========================*/
+ /* Default User Options! */
+ /*========================*/
diff --git a/sci-chemistry/rasmol/metadata.xml b/sci-chemistry/rasmol/metadata.xml
new file mode 100644
index 000000000000..b06ec8f7a2fa
--- /dev/null
+++ b/sci-chemistry/rasmol/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">openrasmol</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/rasmol/rasmol-2.7.5.2-r2.ebuild b/sci-chemistry/rasmol/rasmol-2.7.5.2-r2.ebuild
new file mode 100644
index 000000000000..642a2641fd59
--- /dev/null
+++ b/sci-chemistry/rasmol/rasmol-2.7.5.2-r2.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 prefix toolchain-funcs
+
+MY_P="RasMol_${PV}"
+VERS="13May11"
+
+DESCRIPTION="Molecular Graphics Visualisation Tool"
+HOMEPAGE="http://www.openrasmol.org/"
+#SRC_URI="http://www.rasmol.org/software/${MY_P}.tar.gz"
+SRC_URI="mirror://sourceforge/open${PN}/RasMol/RasMol_2.7.5/${P}-${VERS}.tar.gz"
+#SRC_URI="mirror://sourceforge/open${PN}/RasMol/RasMol_2.7.5/RasMol.tar.gz"
+
+LICENSE="|| ( GPL-2 RASLIC )"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-libs/cvector
+ dev-util/gtk-builder-convert
+ >=sci-libs/cbflib-0.9.2
+ >=sci-libs/cqrlib-1.1.2
+ >=sci-libs/neartree-3.1.1
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/vte:0"
+DEPEND="${RDEPEND}
+ app-text/rman
+ x11-misc/imake
+ x11-proto/inputproto
+ x11-proto/xextproto"
+
+#S="${WORKDIR}/${PN}-2.7.5-${VERS}"
+S="${WORKDIR}/RasMol-${PV}"
+
+src_prepare() {
+ cd src || die
+
+ epatch \
+ "${FILESDIR}"/${P}-glib.h.patch \
+ "${FILESDIR}"/${P}-format-security.patch \
+ "${FILESDIR}"/${P}-longlong.patch
+
+ if use amd64 || use amd64-linux; then
+ mv rasmol.h rasmol_amd64_save.h && \
+ echo "#define _LONGLONG"|cat - rasmol_amd64_save.h > rasmol.h
+ fi
+
+ sed \
+ -e 's:-traditional::g' \
+ -i Makefile* || die
+
+ cat > Imakefile <<- EOF
+ #define PIXELDEPTH 32
+ #define GTKWIN
+ EOF
+
+ cat Imakefile_base >> Imakefile || die
+ epatch "${FILESDIR}"/2.7.5-bundled-lib.patch
+
+ eprefixify Imakefile
+
+ sed \
+ -e 's:vector.c:v_ector.c:g' \
+ -e 's:vector.o:v_ector.o:g' \
+ -e 's:vector.h:v_ector.h:g' \
+ -i *akefile* || die
+
+ sed \
+ -e 's:vector.h:v_ector.h:g' \
+ -i *.c *.h || die
+
+ mv vector.c v_ector.c || die
+ mv vector.h v_ector.h || die
+
+ xmkmf -DGTKWIN || die "xmkmf failed with ${myconf}"
+}
+
+src_compile() {
+ emake -C src clean
+ emake \
+ -C src \
+ DEPTHDEF=-DTHIRTYTWOBIT \
+ CC="$(tc-getCC)" \
+ CDEBUGFLAGS="${CFLAGS}" \
+ EXTRA_LDOPTIONS="${LDFLAGS}"
+}
+
+src_install () {
+ libdir=$(get_libdir)
+ insinto /usr/${libdir}/${PN}
+ doins doc/rasmol.hlp
+ dobin src/rasmol
+ dodoc PROJECTS {README,TODO}.txt doc/*.{ps,pdf}.gz doc/rasmol.txt.gz
+ doman doc/rasmol.1
+ insinto /usr/${libdir}/${PN}/databases
+ doins data/*
+
+ dohtml -r *html doc/*.html html_graphics
+}
diff --git a/sci-chemistry/raster3d/Manifest b/sci-chemistry/raster3d/Manifest
new file mode 100644
index 000000000000..fbf2feb05ff4
--- /dev/null
+++ b/sci-chemistry/raster3d/Manifest
@@ -0,0 +1,2 @@
+DIST Raster3D_3.0-2.tar 1743034 SHA256 a89bdfda61fae8d189820941f1b5685b40743b817128f57bc1225f983a47d984 SHA512 f8f73cc91eae521839a9db8ee1a7a9d8727ed510cb574116d89e918480700d844691a6fc3c4a28cb54312b0133cc610422e55d99716803cf3e8bb5d9d934e37f WHIRLPOOL 58fc31cc438538715b1f0ea17a28b44294d78db32e40fa16f8ab5a5781e26198227c534f06b8d25072e6c6101a4c9255fa906b9fee57b128d0e767bc0e04db83
+DIST Raster3D_3.0-3.tar 1729356 SHA256 1e7d02cf17f2d14855b8d241269948b37ed4d3ae6395914b66ff9f95c3a7fecf SHA512 bd372c4ba8d40db38e19f520883ca71ab7c5ef7a451b67150894e229b45167dfe00b77c19e118afc6abdb9ac07800cc16de5d2dc82c3ef9baa751200490e40fa WHIRLPOOL ad7c11cfd42543845420dcffbc87024c60b3058a51663076ace63b2e2fc0fec81a342f7b4e54f535e03de14fb9e76eace65259cdd2e83a6e0e83810ac8280c10
diff --git a/sci-chemistry/raster3d/files/2.9.1-as-needed.patch b/sci-chemistry/raster3d/files/2.9.1-as-needed.patch
new file mode 100644
index 000000000000..2139804c8962
--- /dev/null
+++ b/sci-chemistry/raster3d/files/2.9.1-as-needed.patch
@@ -0,0 +1,41 @@
+diff --git a/Makefile b/Makefile
+index e75ffcf..bcdd05c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -188,7 +188,7 @@ avs2ps: avs2ps.c
+ $(CC) $(CFLAGS) $(FLAGS) $(LDFLAGS) -o avs2ps avs2ps.c -lm
+
+ balls: balls.f
+- $(FC) $(FFLAGS) -o balls balls.f
++ $(FC) $(LDFLAGS) $(FFLAGS) -o balls balls.f
+
+ local.o: Makefile.incl local.c
+ $(CC) $(CFLAGS) $(FLAGS) -c local.c
+@@ -201,21 +201,18 @@ ribbon: ribbon.f ribbon1.f modsubs.f
+ ribbon.f ribbon1.f modsubs.f -o ribbon
+
+ rastep: rastep.f quadric.o suv.o
+- $(FC) $(FFLAGS) \
+- rastep.f quadric.o suv.o $(LDFLAGS) \
+- -o rastep
++ $(FC) $(FFLAGS) $(LDFLAGS) -o rastep \
++ rastep.f quadric.o suv.o
+
+ render: render.o local.o quadric.o parse.o r3dtops.o ungz.o qinp.o
+- $(FC) $(FFLAGS) \
++ $(FC) $(FFLAGS) $(LDFLAGS) -o render \
+ render.o local.o quadric.o parse.o r3dtops.o ungz.o \
+ qinp.o \
+- $(LIBS) $(LDFLAGS) \
+- -o render
++ $(LIBS)
+
+ normal3d: normal3d.o quadric.o qinp.o ungz.o parameters.incl
+- $(FC) $(FFLAGS) \
+- normal3d.o quadric.o ungz.o qinp.o $(LDFLAGS) \
+- -o normal3d
++ $(FC) $(FFLAGS) $(LDFLAGS) -o normal3d \
++ normal3d.o quadric.o ungz.o qinp.o
+
+ stereo3d:
+
diff --git a/sci-chemistry/raster3d/files/3.0.2-as-needed.patch b/sci-chemistry/raster3d/files/3.0.2-as-needed.patch
new file mode 100644
index 000000000000..9e0961952535
--- /dev/null
+++ b/sci-chemistry/raster3d/files/3.0.2-as-needed.patch
@@ -0,0 +1,50 @@
+diff --git a/Makefile b/Makefile
+index 1a1c549..4d74dd0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -58,7 +58,7 @@ linux:
+ @echo OSDEFS = -DLINUX -DNETWORKBYTEORDER >> Makefile.incl
+ @echo include Makefile.package >> Makefile.incl
+ @echo >> Makefile.incl
+- @echo qinp.o: qinp.f >> Makefile.incl
++ @echo qinp.o: qinp.f normal3d.o render.o >> Makefile.incl
+ @echo " \$$(FC) -g -O0 -Wall -Wtabs -c -o qinp.o qinp.f" >> Makefile.incl
+ @echo >> Makefile.incl
+
+@@ -214,20 +214,20 @@ ribbon: ribbon.f ribbon1.f modsubs.f
+ ribbon.f ribbon1.f modsubs.f -o ribbon
+
+ rastep: rastep.f quadric.o suv.o
+- $(FC) $(FFLAGS) \
+- rastep.f quadric.o suv.o $(LDFLAGS) \
++ $(FC) $(FFLAGS) $(LDFLAGS) \
++ rastep.f quadric.o suv.o \
+ -o rastep
+
+ render: render.o local.o quadric.o parse.o r3dtogd.o ungz.o qinp.o
+- $(FC) $(FFLAGS) \
++ $(FC) $(FFLAGS) $(LDFLAGS) \
+ render.o local.o quadric.o parse.o r3dtogd.o ungz.o \
+ qinp.o \
+- $(LIBS) $(LDFLAGS) \
+- -o render
++ -o render \
++ $(LIBS)
+
+ normal3d: normal3d.o quadric.o qinp.o ungz.o parameters.incl
+- $(FC) $(FFLAGS) \
+- normal3d.o quadric.o ungz.o qinp.o $(LDFLAGS) \
++ $(FC) $(FFLAGS) $(LDFLAGS) \
++ normal3d.o quadric.o ungz.o qinp.o \
+ -o normal3d
+
+ stereo3d:
+@@ -264,7 +264,7 @@ example1.png: render_small
+ ./render_small
+
+ render_small: render_small.o local.o quadric.o parse_small.o r3dtogd.o ungz.o qinp_small.o
+- $(FC) $(FFLAGS) $^ $(LIBS) $(LDFLAGS) -o $@
++ $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ .SUFFIXES: .incl
+ SMALL=10
diff --git a/sci-chemistry/raster3d/files/3.0.2-gentoo-prefix.patch b/sci-chemistry/raster3d/files/3.0.2-gentoo-prefix.patch
new file mode 100644
index 000000000000..19b6cac3a6fe
--- /dev/null
+++ b/sci-chemistry/raster3d/files/3.0.2-gentoo-prefix.patch
@@ -0,0 +1,24 @@
+diff --git a/Makefile.template b/Makefile.template
+index 59de553..0ed283d 100644
+--- a/Makefile.template
++++ b/Makefile.template
+@@ -8,15 +8,15 @@ include VERSION
+ #
+ # Where to install the program, data files, and manuals
+ #
+-prefix = /usr/local
++prefix = @GENTOO_PORTAGE_EPREFIX@/usr/
+ bindir = $(prefix)/bin
+ datadir = $(prefix)/share/Raster3D/materials
+ mandir = $(prefix)/man/manl
+-htmldir = $(prefix)/share/Raster3D/html
++htmldir = $(prefix)/share/doc/MYPF/html
+ examdir = $(prefix)/share/Raster3D/examples
+
+-INCDIRS = -I/usr/include -I/usr/local/include
+-LIBDIRS = -L/usr/local/lib
++INCDIRS = -I@GENTOO_PORTAGE_EPREFIX@/usr/include
++LIBDIRS = -L@GENTOO_PORTAGE_EPREFIX@/usr/MYLIB
+
+ #
+ # TIFF support (enabled by default)
diff --git a/sci-chemistry/raster3d/files/raster3d-gcc-4.1-gentoo.patch b/sci-chemistry/raster3d/files/raster3d-gcc-4.1-gentoo.patch
new file mode 100644
index 000000000000..4525f5fdc8ba
--- /dev/null
+++ b/sci-chemistry/raster3d/files/raster3d-gcc-4.1-gentoo.patch
@@ -0,0 +1,74 @@
+diff -Naur Raster3D_2.7c/normal3d.f Raster3D_2.7c.new/normal3d.f
+--- Raster3D_2.7c/normal3d.f 2003-10-20 18:50:11.000000000 -0400
++++ Raster3D_2.7c.new/normal3d.f 2007-09-08 10:23:08.000000000 -0400
+@@ -443,7 +443,8 @@
+ READ (INPUT,'(A)',ERR=101) TITLE
+ IF (TITLE(1:1).EQ.'#') GOTO 100
+ GOTO 102
+- 101 WRITE (NOISE,'(A,A)') ' >> Cannot open or read file ',TITLE(2:132)
++ 101 WRITE (NOISE,'(A,A)') ' >> Cannot open or read file ',
++ * TITLE(2:132)
+ CALL EXIT(-1)
+ 102 CONTINUE
+ ENDIF
+diff -Naur Raster3D_2.7c/parse.f Raster3D_2.7c.new/parse.f
+--- Raster3D_2.7c/parse.f 2003-10-20 18:50:11.000000000 -0400
++++ Raster3D_2.7c.new/parse.f 2007-09-08 10:23:48.000000000 -0400
+@@ -4,7 +4,8 @@
+ COMMON /OPTIONS/ FONTSCALE, GAMMA, ZOOM, NSCHEME, SHADOWFLAG, XBG,
+ & NAX, NAY, OTMODE, QUALITY, INVERT, LFLAG
+ REAL FONTSCALE, GAMMA, ZOOM
+- INTEGER NSCHEME, SHADOWFLAG, XBG
++ INTEGER NSCHEME, SHADOWFLAG
++ INTEGER*8 XBG
+ INTEGER*2 NAX, NAY, OTMODE, QUALITY
+ LOGICAL*2 INVERT, LFLAG
+ c
+diff -Naur Raster3D_2.7c/rastep.f Raster3D_2.7c.new/rastep.f
+--- Raster3D_2.7c/rastep.f 2004-02-12 12:01:31.000000000 -0500
++++ Raster3D_2.7c.new/rastep.f 2007-09-08 10:23:08.000000000 -0400
+@@ -133,7 +133,7 @@
+ c
+ c Support for validation of similarity of bonded atoms
+ logical suvflag
+- integer suvlun, suvbad
++ integer suvlun, suvbad, defcols
+ real anisov(6)
+ c
+ c Default to CPK colors and VDW radii
+diff -Naur Raster3D_2.7c/render.f Raster3D_2.7c.new/render.f
+--- Raster3D_2.7c/render.f 2003-10-20 18:50:11.000000000 -0400
++++ Raster3D_2.7c.new/render.f 2007-09-08 10:23:08.000000000 -0400
+@@ -792,9 +792,9 @@
+ * Get background colour
+ READ (INPUT,*,ERR=104) BKGND
+ if (XBG.NE.0) then
+- BKGND(3) = FLOAT(iand(XBG,'00FF'X)) / 255.
+- BKGND(2) = FLOAT(iand(XBG,'FF00'X)/256) / 255.
+- BKGND(1) = FLOAT(iand(XBG,'FF0000'X)/65536) / 255.
++ BKGND(3) = REAL(iand(XBG,'00FF'X)) / 255.
++ BKGND(2) = REAL(iand(XBG,'FF00'X)/256) / 255.
++ BKGND(1) = REAL(iand(XBG,'FF0000'X)/65536) / 255.
+ BKGND(3) = BKGND(3)**2
+ BKGND(2) = BKGND(2)**2
+ BKGND(1) = BKGND(1)**2
+@@ -3679,7 +3679,7 @@
+ FRAC = DETAIL(K+8)
+ INEXT = INDTOP + 1
+ IF (TYPE(INEXT).EQ.VERTEXRGB) INEXT = INEXT + 1
+- CALL ASSERT(TYPE(INEXT).EQ.VERTRANSP,'lost vertex transp')
++ CALL ASSERT(TYPE(INEXT).EQ.VERTRANSP,'lost vertex transp')
+ K = LIST(INEXT)
+ CLRITY = FRAC*DETAIL(K+1) + (1.-FRAC)*DETAIL(K+2)
+ ELSE IF (TYPE(INDTOP).EQ.TRIANG) THEN
+diff -Naur Raster3D_2.7c/rings3d.f Raster3D_2.7c.new/rings3d.f
+--- Raster3D_2.7c/rings3d.f 2003-10-20 18:50:11.000000000 -0400
++++ Raster3D_2.7c.new/rings3d.f 2007-09-08 10:23:08.000000000 -0400
+@@ -16,7 +16,6 @@
+ integer input, output, noise
+ parameter (input=5, output=6, noise=0)
+ integer iargc, narg
+- external iargc
+ character*64 options
+ logical bflag, pflag, sflag
+ c
diff --git a/sci-chemistry/raster3d/metadata.xml b/sci-chemistry/raster3d/metadata.xml
new file mode 100644
index 000000000000..2a6e4b56f965
--- /dev/null
+++ b/sci-chemistry/raster3d/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <upstream>
+ <changelog>http://skuld.bmsc.washington.edu/raster3d/CHANGELOG</changelog>
+ </upstream>
+ <use>
+ <flag name="gd">libgd support for PNG and JPEG output</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/raster3d/raster3d-3.0.2.ebuild b/sci-chemistry/raster3d/raster3d-3.0.2.ebuild
new file mode 100644
index 000000000000..380f207260e1
--- /dev/null
+++ b/sci-chemistry/raster3d/raster3d-3.0.2.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic multilib toolchain-funcs versionator prefix
+
+MY_PN="Raster3D"
+MY_PV=$(replace_version_separator 2 -)
+MY_P="${MY_PN}_${MY_PV}"
+
+DESCRIPTION="Generation high quality raster images of proteins or other molecules"
+HOMEPAGE="http://www.bmsc.washington.edu/raster3d/raster3d.html"
+SRC_URI="http://www.bmsc.washington.edu/${PN}/${MY_P}.tar.gz -> ${MY_P}.tar"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE="gd tiff"
+
+RDEPEND="
+ tiff? ( media-libs/tiff:0 )
+ gd? ( media-libs/gd[jpeg,png] )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-as-needed.patch \
+ "${FILESDIR}"/${PV}-gentoo-prefix.patch
+
+ sed \
+ -e "s:MYPF:${PF}:" \
+ -e "s:MYLIB:$(get_libdir):g" \
+ -i Makefile.template || \
+ die "Failed to patch makefile.template"
+
+ if ! use gd; then
+ sed \
+ -e "/GDLIBS/s:^:#:g" \
+ -e "/GDDEFS/s:^:#:g" \
+ -i Makefile.template || die
+ fi
+
+ if ! use tiff; then
+ sed \
+ -e "/TLIBS/s:^:#:g" \
+ -e "/TDEFS/s:^:#:g" \
+ -i Makefile.template || die
+ fi
+
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ append-cflags -Dgfortran
+ fi
+
+ append-fflags -ffixed-line-length-132
+
+ eprefixify Makefile.template
+ cp Makefile.template Makefile.incl || die
+}
+
+src_compile() {
+ local target
+ local i
+
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ target="linux"
+ else
+ target="linux-$(tc-getFC)"
+ fi
+
+ for i in render.o ${target} all; do
+ emake \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ CC="$(tc-getCC)"\
+ FC="$(tc-getFC)" \
+ INCDIRS="-I${EPREFIX}/usr/include" \
+ LIBDIRS="-L${EPREFIX}/usr/$(get_libdir)" \
+ ${i}
+ done
+}
+
+src_install() {
+ emake prefix="${ED}"/usr \
+ bindir="${ED}"/usr/bin \
+ datadir="${ED}"/usr/share/Raster3D/materials \
+ mandir="${ED}"/usr/share/man/man1 \
+ htmldir="${ED}"/usr/share/doc/${PF}/html \
+ examdir="${ED}"/usr/share/Raster3D/examples \
+ install
+
+ dodir /etc/env.d
+ echo -e "R3D_LIB=${EPREFIX}/usr/share/${NAME}/materials" > \
+ "${ED}"/etc/env.d/10raster3d || \
+ die "Failed to install env file."
+}
+
+pkg_postinst() {
+ elog "Add following line:"
+ elog "<delegate decode=\"r3d\" command='\"render\" < \"%i\" > \"%o\"' />"
+ elog "to ${EPREFIX}/usr/$(get_libdir)/ImageMagick-6.5.8/config/delegates.xml"
+ elog "to make imagemagick use raster3d for .r3d files"
+}
diff --git a/sci-chemistry/raster3d/raster3d-3.0.3.ebuild b/sci-chemistry/raster3d/raster3d-3.0.3.ebuild
new file mode 100644
index 000000000000..d66a807cbbf8
--- /dev/null
+++ b/sci-chemistry/raster3d/raster3d-3.0.3.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils fortran-2 flag-o-matic multilib toolchain-funcs versionator prefix
+
+MY_PN="Raster3D"
+MY_PV=$(replace_version_separator 2 -)
+MY_P="${MY_PN}_${MY_PV}"
+
+DESCRIPTION="Generation high quality raster images of proteins or other molecules"
+HOMEPAGE="http://www.bmsc.washington.edu/raster3d/raster3d.html"
+SRC_URI="http://www.bmsc.washington.edu/${PN}/${MY_P}.tar.gz -> ${MY_P}.tar"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="gd tiff"
+
+RDEPEND="
+ tiff? ( media-libs/tiff:0 )
+ gd? ( media-libs/gd[jpeg,png] )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/3.0.2-as-needed.patch \
+ "${FILESDIR}"/3.0.2-gentoo-prefix.patch
+
+ sed \
+ -e "s:MYPF:${PF}:" \
+ -e "s:MYLIB:$(get_libdir):g" \
+ -i Makefile.template || \
+ die "Failed to patch makefile.template"
+
+ if ! use gd; then
+ sed \
+ -e "/GDLIBS/s:^:#:g" \
+ -e "/GDDEFS/s:^:#:g" \
+ -i Makefile.template || die
+ fi
+
+ if ! use tiff; then
+ sed \
+ -e "/TLIBS/s:^:#:g" \
+ -e "/TDEFS/s:^:#:g" \
+ -i Makefile.template || die
+ fi
+
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ append-cflags -Dgfortran
+ fi
+
+ append-fflags -ffixed-line-length-132
+
+ eprefixify Makefile.template
+ cp Makefile.template Makefile.incl || die
+}
+
+src_compile() {
+ local target
+ local i
+
+ if [[ $(tc-getFC) =~ gfortran ]]; then
+ target="linux"
+ else
+ target="linux-$(tc-getFC)"
+ fi
+
+ for i in render.o ${target} all; do
+ emake \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ CC="$(tc-getCC)"\
+ FC="$(tc-getFC)" \
+ INCDIRS="-I${EPREFIX}/usr/include" \
+ LIBDIRS="-L${EPREFIX}/usr/$(get_libdir)" \
+ ${i}
+ done
+}
+
+src_install() {
+ emake prefix="${ED}"/usr \
+ bindir="${ED}"/usr/bin \
+ datadir="${ED}"/usr/share/Raster3D/materials \
+ mandir="${ED}"/usr/share/man/man1 \
+ htmldir="${ED}"/usr/share/doc/${PF}/html \
+ examdir="${ED}"/usr/share/Raster3D/examples \
+ install
+
+ dodir /etc/env.d
+ echo -e "R3D_LIB=${EPREFIX}/usr/share/${NAME}/materials" > \
+ "${ED}"/etc/env.d/10raster3d || \
+ die "Failed to install env file."
+}
+
+pkg_postinst() {
+ elog "Add following line:"
+ elog "<delegate decode=\"r3d\" command='\"render\" < \"%i\" > \"%o\"' />"
+ elog "to ${EPREFIX}/usr/$(get_libdir)/ImageMagick-6.5.8/config/delegates.xml"
+ elog "to make imagemagick use raster3d for .r3d files"
+}
diff --git a/sci-chemistry/reduce/Manifest b/sci-chemistry/reduce/Manifest
new file mode 100644
index 000000000000..06e2812c62a9
--- /dev/null
+++ b/sci-chemistry/reduce/Manifest
@@ -0,0 +1,3 @@
+DIST reduce.3.13.080428.src.tgz 4387407 SHA256 6290dad33e395c5a40fe3634db86fb6035ea88ce19c3f25b80fb6378507ac066
+DIST reduce.3.14.080821.src.tgz 5199731 SHA256 0c32f3e9f818b976e0996f088639a194cde63f227eff32c35e14526ec05c930a SHA512 9c8d72983b376b1f741afeb08630ad69b6888f526aac0ad72c658e96a6c2d6f17df60dfbf03a35a217be254bbb858f99bd2088aba8877e504a45270371dbad44 WHIRLPOOL aac80449eeceae8afbc5ec8d4ea53152c4f0bff7080fc36d7d74d8e0aaad8e6cb3e5750d67dcab6c7669f58a5f09910a3253db6371828257d03832f1ccbc3418
+DIST reduce.3.16.111118.src.zip 20342632 SHA256 a9f45dd31eb7022e056cdab1efbbed17fd8be7453396313904c95c839d41dbb3 SHA512 f7b4d8d91f1f57e9e96c91139fa919c570aebd07f3a440faf3df54bf5deb3a05ad998996a24b5fe9aff6280e00329c9914e338cbfe802c047c055f52ce8312a9 WHIRLPOOL 5d5e3c988e39986888eb23907e87ad180a2a441cf236c53406fc43f1cddd25e9e9051ae41d287f35bcf17f3882d720f9cee4c925cbae32139de5848c1fbcccdd
diff --git a/sci-chemistry/reduce/files/3.13.080428-CFLAGS.patch b/sci-chemistry/reduce/files/3.13.080428-CFLAGS.patch
new file mode 100644
index 000000000000..7daa5336f689
--- /dev/null
+++ b/sci-chemistry/reduce/files/3.13.080428-CFLAGS.patch
@@ -0,0 +1,22 @@
+diff --git a/reduce_src/Makefile b/reduce_src/Makefile
+index 598e367..067ace4 100644
+--- a/reduce_src/Makefile
++++ b/reduce_src/Makefile
+@@ -12,7 +12,7 @@ PROG_FLGS = -DAROMATICS_ACCEPT_HBONDS \
+ # -DDEBUGMOVABLENODE -DDEBUGDOTCOUNTS
+ # -DMINPREDEFINED -DMAXPREDEFINED\
+
+-CFLAGS = $(OPT) $(DEBUG) $(PROG_FLGS) $(DICT_LOC)\
++CXXFLAGS = $(OPT) $(DEBUG) $(PROG_FLGS) $(DICT_LOC)\
+ -I$(PDBHOME) -I$(TOOLHOME)
+ # -Wall
+
+@@ -26,7 +26,7 @@ OBJLIST = GraphToHoldScores.o reduce.o CTab.o ElementInfo.o StdResH.o ResBlk.o A
+ CXX = g++
+
+ .cpp.o:
+- $(CXX) -c $*.cpp $(CFLAGS)
++ $(CXX) -c $*.cpp $(CXXFLAGS)
+
+ OPT = -O3
+ DEBUG = $(CXXDEBUGFLAGS)
diff --git a/sci-chemistry/reduce/files/3.13.080428-LDFLAGS.patch b/sci-chemistry/reduce/files/3.13.080428-LDFLAGS.patch
new file mode 100644
index 000000000000..bcee1a9fe8f3
--- /dev/null
+++ b/sci-chemistry/reduce/files/3.13.080428-LDFLAGS.patch
@@ -0,0 +1,11 @@
+--- reduce_src/Makefile 2009-08-09 10:11:29.000000000 +0200
++++ reduce_src/Makefile.new 2009-08-09 10:13:31.000000000 +0200
+@@ -34,7 +34,7 @@
+ all: reduce
+
+ reduce: $(OBJLIST)
+- $(CXX) -o $@ $(OBJLIST) $(LFLAGS)
++ $(CXX) $(LDFLAGS) -o $@ $(OBJLIST) $(LFLAGS)
+
+ clean:
+ @rm -rf *.o *.ckp ii_files
diff --git a/sci-chemistry/reduce/files/3.14.080821-CFLAGS.patch b/sci-chemistry/reduce/files/3.14.080821-CFLAGS.patch
new file mode 100644
index 000000000000..8294c8ca385d
--- /dev/null
+++ b/sci-chemistry/reduce/files/3.14.080821-CFLAGS.patch
@@ -0,0 +1,22 @@
+diff --git a/reduce_src/Makefile b/reduce_src/Makefile
+index 598e367..067ace4 100644
+--- a/reduce_src/Makefile
++++ b/reduce_src/Makefile
+@@ -12,7 +12,7 @@ PROG_FLGS = -DAROMATICS_ACCEPT_HBONDS \
+ # -DDEBUGMOVABLENODE -DDEBUGDOTCOUNTS
+ # -DMINPREDEFINED -DMAXPREDEFINED\
+
+-CFLAGS = $(OPT) $(DEBUG) $(PROG_FLGS) $(DICT_LOC) $(DICT_LOCOLD)\
++CXXFLAGS = $(OPT) $(DEBUG) $(PROG_FLGS) $(DICT_LOC) $(DICT_LOCOLD)\
+ -I$(PDBHOME) -I$(TOOLHOME)
+ # -Wall
+
+@@ -26,7 +26,7 @@ OBJLIST = GraphToHoldScores.o reduce.o CTab.o ElementInfo.o StdResH.o ResBlk.o A
+ CXX = g++
+
+ .cpp.o:
+- $(CXX) -c $*.cpp $(CFLAGS)
++ $(CXX) -c $*.cpp $(CXXFLAGS)
+
+ OPT = -O3
+ DEBUG = $(CXXDEBUGFLAGS)
diff --git a/sci-chemistry/reduce/metadata.xml b/sci-chemistry/reduce/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/reduce/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/reduce/reduce-3.13.080428-r1.ebuild b/sci-chemistry/reduce/reduce-3.13.080428-r1.ebuild
new file mode 100644
index 000000000000..f2af6fcda84a
--- /dev/null
+++ b/sci-chemistry/reduce/reduce-3.13.080428-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}.${PV}.src"
+
+DESCRIPTION="Adds hydrogens to a Protein Data Bank (PDB) molecule structure file"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/reduce.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/reduce31/${MY_P}.tgz"
+
+LICENSE="richardson"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-LDFLAGS.patch \
+ "${FILESDIR}"/${PV}-CFLAGS.patch
+}
+
+src_compile() {
+ DICT_DIR="/usr/share/reduce"
+ DICT_FILE="reduce_het_dict.txt"
+
+ emake \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ OPT="${CXXFLAGS}" \
+ DICT_HOME="${EPREFIX}/${DICT_DIR}/${DICT_FILE}" \
+ || die "make failed"
+}
+
+src_install() {
+ dobin "${S}"/reduce_src/reduce || die
+ insinto ${DICT_DIR}
+ doins "${S}"/${DICT_FILE} "${S}"/reduce_wwPDB_het_dict.txt || die
+ dodoc README.usingReduce.txt || die
+}
+
+pkg_postinst() {
+ elog "To use the PDBv3 dictionary instead of PDBv2, set the environment"
+ elog "variable REDUCE_HET_DICT to ${EPREFIX}/usr/share/reduce/reduce_wwPDB_het_dict.txt"
+}
diff --git a/sci-chemistry/reduce/reduce-3.14.080821.ebuild b/sci-chemistry/reduce/reduce-3.14.080821.ebuild
new file mode 100644
index 000000000000..824ee735ef0f
--- /dev/null
+++ b/sci-chemistry/reduce/reduce-3.14.080821.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}.${PV}.src"
+
+DESCRIPTION="Adds hydrogens to a Protein Data Bank (PDB) molecule structure file"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/reduce.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/reduce31/${MY_P}.tgz"
+
+LICENSE="richardson"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/3.13.080428-LDFLAGS.patch \
+ "${FILESDIR}"/${PV}-CFLAGS.patch
+}
+
+src_compile() {
+ DICT_DIR="/usr/share/reduce"
+ DICT_FOLD="reduce_het_dict.txt"
+ DICT_FNEW="reduce_wwPDB_het_dict.txt"
+
+ emake clean
+ emake \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ OPT="${CXXFLAGS}" \
+ DICT_HOME="${EPREFIX}/${DICT_DIR}/${DICT_FNEW}" \
+ DICT_OLD="${EPREFIX}/${DICT_DIR}/${DICT_FOLD}"
+}
+
+src_install() {
+ dobin "${S}"/reduce_src/reduce
+ insinto ${DICT_DIR}
+ doins "${S}"/${DICT_FOLD} "${S}"/${DICT_FNEW}
+ dodoc README.usingReduce.txt
+}
diff --git a/sci-chemistry/reduce/reduce-3.16.111118.ebuild b/sci-chemistry/reduce/reduce-3.16.111118.ebuild
new file mode 100644
index 000000000000..6871341758b8
--- /dev/null
+++ b/sci-chemistry/reduce/reduce-3.16.111118.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}.${PV}.src"
+
+DESCRIPTION="Adds hydrogens to a Protein Data Bank (PDB) molecule structure file"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/reduce.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/reduce31/${MY_P}.zip"
+
+LICENSE="richardson"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}/"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/3.13.080428-LDFLAGS.patch \
+ "${FILESDIR}"/3.14.080821-CFLAGS.patch
+}
+
+src_compile() {
+ DICT_DIR="/usr/share/reduce"
+ DICT_FOLD="reduce_het_dict.txt"
+ DICT_FNEW="reduce_wwPDB_het_dict.txt"
+
+ emake clean
+ emake \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ OPT="${CXXFLAGS}" \
+ DICT_HOME="${EPREFIX}/${DICT_DIR}/${DICT_FNEW}" \
+ DICT_OLD="${EPREFIX}/${DICT_DIR}/${DICT_FOLD}"
+}
+
+src_install() {
+ dobin "${S}"/reduce_src/reduce
+ insinto ${DICT_DIR}
+ doins "${S}"/${DICT_FOLD} "${S}"/${DICT_FNEW}
+ dodoc README.usingReduce.txt
+}
diff --git a/sci-chemistry/refmac/Manifest b/sci-chemistry/refmac/Manifest
new file mode 100644
index 000000000000..ba3def103020
--- /dev/null
+++ b/sci-chemistry/refmac/Manifest
@@ -0,0 +1,2 @@
+DIST refmac_5.5.0110.tar.gz 1326832 SHA256 1353fb1042586ec8fa37d0a90f274890d0ccc02377af5216200662338dfe08ca SHA512 7e7fd1a7d2d11ef5f2e08cae61da62ecfe6978730ce4ca80f8b00be9bdad5e7d0ad493e1b8d57d64f1393f2017a87b8342e2607b08bc4018def798038a111728 WHIRLPOOL 587260eebd2df3115ba01ee03c11ab773d7316100a09af1f259f7795a139f978d94c569b8e4ab85982c2eeda628e643376231bdca5311fc8c7d2de5b65a033ac
+DIST test-framework.tar.gz 130933173 SHA256 df050a2a29da80518cb0616a0bbeb82298ea0721549348d15353bf0f66240605 SHA512 3ef8253f472c5a481f836291afb80746ad73858e130130b848851b6b5dc53ada3b78c9f853af1c46fa22f469f2ce2f3248f5f760950e118610922c0429a7da16 WHIRLPOOL 022c1b493ecd35e769b44d1e52a351b4883682ef9759626bac36e26cc61078d95de0ec2531ed706897c683c38727139fa7a13d06b64c597026817ed79612d16d
diff --git a/sci-chemistry/refmac/files/5.5-test.log.patch b/sci-chemistry/refmac/files/5.5-test.log.patch
new file mode 100644
index 000000000000..61858be357a0
--- /dev/null
+++ b/sci-chemistry/refmac/files/5.5-test.log.patch
@@ -0,0 +1,32 @@
+--- test-framework/refmac5/test_refmac5.py 2009-06-29 15:45:37.000000000 +0200
++++ test-framework/refmac5/test_refmac5.py.new 2009-06-29 15:48:05.000000000 +0200
+@@ -88,7 +88,8 @@
+ 'make hydr no',
+ 'labin IP=IMEAN SIGIP=SIGIMEAN FREE=FreeR_flag',
+ 'labout FC=FC PHIC=PHIC'],
+- working_directory = self.test_dir)
++ working_directory = self.test_dir,
++ log_file = 'test_twinned_refinement.log')
+
+ self.assertEqual(status, 0)
+
+@@ -123,7 +124,8 @@
+ 'weight auto',
+ 'ncyc 20',
+ 'labout FC=FC PHIC=PHIC'],
+- working_directory = self.test_dir)
++ working_directory = self.test_dir,
++ log_file = 'test_4_domain_tls.log')
+
+ self.assertEqual(status, 0)
+
+@@ -156,7 +158,8 @@
+ 'anomalous form SE -9.9 3.9',
+ 'anomalous wavelength 0.97966',
+ 'labout FC=FC PHIC=PHIC'],
+- working_directory = self.test_dir)
++ working_directory = self.test_dir,
++ log_file = 'test_sad_refinement.log')
+
+ self.assertEqual(status, 0)
+
diff --git a/sci-chemistry/refmac/files/5.5.0110-allow-dynamic-linking.patch b/sci-chemistry/refmac/files/5.5.0110-allow-dynamic-linking.patch
new file mode 100644
index 000000000000..1efbaa04d9e6
--- /dev/null
+++ b/sci-chemistry/refmac/files/5.5.0110-allow-dynamic-linking.patch
@@ -0,0 +1,84 @@
+diff --git a/makefile b/makefile
+index 66d4cee..5270677 100644
+--- a/makefile
++++ b/makefile
+@@ -9,7 +9,7 @@ XFFLAGS = -fno-second-underscore -static
+ XCFLAGS = -DGFORTRAN -DPROTOTYPE
+ FFLAGS = $(FOPTIM) $(XFFLAGS)
+ CFLAGS = $(COPTIM) $(XCFLAGS)
+-CPPFLAGS = $(CFLAGS)
++CPPFLAGS = $(CXXFLAGS) $(XCFLAGS)
+
+ LLIBCIF =
+ LLIBCCP = $(CLIB)/libccp4f.a $(CLIB)/libccp4c.a
+diff --git a/makefile_refmac.inc1 b/makefile_refmac.inc1
+index 371d84d..557077f 100644
+--- a/makefile_refmac.inc1
++++ b/makefile_refmac.inc1
+@@ -68,9 +68,7 @@ messy_pdb.o \
+ bridge.o \
+ i0.o \
+ i1.o \
+-chbevl.o \
+-$(LLIBCIF) \
+-$(LLIBLAPACK)
++chbevl.o
+ #$(LLIBCCP) \
+ #crt0.o \
+ #heavy.o \
+@@ -95,8 +93,7 @@ make_unix_ccp4.o \
+ emin.o \
+ libcheck_min.o \
+ mol2_file.o \
+-sdf_files.o \
+-$(LLIBCCP)
++sdf_files.o
+
+ SUBM = \
+ main_makecif.o \
+@@ -116,9 +113,7 @@ make_rst2.o \
+ make_PDB.o \
+ makecif.o \
+ make_unix_ccp4.o \
+-make_vdw.o \
+-$(LLIBCCP) \
+-$(LLIBCIF)
++make_vdw.o
+
+ SUBT = \
+ tlsgroups.o \
+@@ -142,9 +137,7 @@ make_refmac_dummy.o \
+ inout_routines.o \
+ errwrt_1.o \
+ linalgebra.o \
+-subnumrec.o \
+-$(LLIBCCP) \
+-$(LLIBCIF)
++subnumrec.o
+ #--------------------------------------------------------------------------------
+
+ ed = echo 'g/^CMDW-5.0/s// /@w@q@' | tr "@" "\012" | ed -s
+@@ -154,18 +147,19 @@ ed = echo 'g/^CMDW-5.0/s// /@w@q@' | tr "@" "\012" | ed -s
+ all: refmac libcheck makecif
+
+ refmac: $(SUBR)
+- $(FC) $(FFLAGS) $(LDFLAGF)-o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
+
+ libcheck: $(SUBL)
+- $(FC) $(FFLAGS) -o libcheck${VERSION} $(SUBL)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o libcheck${VERSION} $(SUBL) $(LLIBCCP)
+
+ makecif: $(SUBM)
+- $(FC) $(FFLAGS) -o makecif${VERSION} $(SUBM)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o makecif${VERSION} $(SUBM) $(LLIBCCP) $(LLIBCIF)
+
+ tlsgroups: $(SUBT)
+- $(FC) $(FFLAGS) -o tlsgroups${VERSION} $(SUBT)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o tlsgroups${VERSION} $(SUBT) $(LLIBCCP) $(LLIBCIF)
+
+ clean:
+ /bin/rm *.o
+
+ bridge.o: bridge.cpp llhood.h covmat.h Gauss.h tabfunc.h
++ $(CXX) $(CXXFLAGS) -c bridge.cpp
diff --git a/sci-chemistry/refmac/files/5.5.0110-gcc4.6.patch b/sci-chemistry/refmac/files/5.5.0110-gcc4.6.patch
new file mode 100644
index 000000000000..3969cc9c8586
--- /dev/null
+++ b/sci-chemistry/refmac/files/5.5.0110-gcc4.6.patch
@@ -0,0 +1,17 @@
+ hkon_secder_tch.f | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/hkon_secder_tch.f b/hkon_secder_tch.f
+index 31794b0..86d2cdf 100644
+--- a/hkon_secder_tch.f
++++ b/hkon_secder_tch.f
+@@ -3724,7 +3724,8 @@ c---External functions and subprutines
+ INTEGER NWORKSPACE
+ REAL*8 TOLER
+ REAL*8 WORKSPACE(300)
+- REAL LSTLSQ,D2DF_WEIGHT
++ REAL*8 D2DF_WEIGHT
++ REAL LSTLSQ
+ C
+ INTEGER IBIN,IBIN_S
+ INTEGER I,J,K
diff --git a/sci-chemistry/refmac/files/5.6.0110-allow-dynamic-linking.patch b/sci-chemistry/refmac/files/5.6.0110-allow-dynamic-linking.patch
new file mode 100644
index 000000000000..9998b759c664
--- /dev/null
+++ b/sci-chemistry/refmac/files/5.6.0110-allow-dynamic-linking.patch
@@ -0,0 +1,341 @@
+ makefile_refmac.inc1 | 215 ++++++++++++++++++++++++--------------------------
+ 1 files changed, 104 insertions(+), 111 deletions(-)
+
+diff --git a/makefile_refmac.inc1 b/makefile_refmac.inc1
+index 0f8bd63..e59fbfb 100644
+--- a/makefile_refmac.inc1
++++ b/makefile_refmac.inc1
+@@ -96,9 +96,7 @@ bridge.o \
+ i0.o \
+ i1.o \
+ chbevl.o \
+-make_unix_ccp4.o \
+-$(LLIBCIF) \
+-$(LLIBLAPACK)
++make_unix_ccp4.o
+
+
+ SUBL = \
+@@ -133,9 +131,7 @@ cell_symm_subrs.o \
+ iheap_sort.o \
+ linalgebra.o \
+ math_refmac.o \
+-subnumrec.o \
+-$(LLIBLAPACK) \
+-$(LLIBCCP)
++subnumrec.o
+
+ SUB_FREE = \
+ freer_twin.o \
+@@ -145,9 +141,7 @@ subnumrec.o \
+ libT.o \
+ iheap_sort.o \
+ cell_symm_subrs.o \
+-math_refmac.o \
+-$(LLIBLAPACK) \
+-$(LLIBCCP)
++math_refmac.o
+
+ SUB_HEADER = header2matr.o
+ #--------------------------------------------------------------------------------
+@@ -185,41 +179,41 @@ rharvest_mod.o: rharvest_mod.f90
+ twin77mod.o: twin77mod.f
+ $(FC) $(FFLAGS) -c twin77mod.f
+
+-gibbs_gm_sampler.o: linalgebra_f90.f90 gibbs_gm_sampler.f90
+- $(FC) $(FFLAGS) -c linalgebra_f90.f90 gibbs_gm_sampler.f90
++gibbs_gm_sampler.o: linalgebra_f90.o gibbs_gm_sampler.f90
++ $(FC) $(FFLAGS) -c gibbs_gm_sampler.f90
+
+-max_with_twins.o: restr_files.f90 max_with_twins.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 max_with_twins.f
++max_with_twins.o: restr_files.o max_with_twins.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c max_with_twins.f
+
+-merohedr_twin.o: restr_files.f90 merohedr_twin.f
+- $(FC) $(FFLAGS) -c restr_files.f90 merohedr_twin.f
++merohedr_twin.o: restr_files.o merohedr_twin.f
++ $(FC) $(FFLAGS) -c merohedr_twin.f
+
+-ls_scaling_twin_save.o: restr_files.f90 ls_scaling_twin_save.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ls_scaling_twin_save.f
++ls_scaling_twin_save.o: restr_files.o ls_scaling_twin_save.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ls_scaling_twin_save.f
+
+-ml_params_refine.o: restr_files.f90 ml_params_refine.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ml_params_refine.f
++ml_params_refine.o: restr_files.o ml_params_refine.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ml_params_refine.f
+
+-optimise_solvent_all.o: optimise_solvent_all.f90 agreem.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 agreem.f90
++optimise_solvent_all.o: optimise_solvent_all.f90 agreem.o
++ $(FC) $(FFLAGS) -c optimise_solvent_all.f90
+
+-ncs_rest.o: ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 ncs_rest.f weights.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 weights.f90 ncs_rest.f
++ncs_rest.o: ncs_rest_mod.o restr_files.o ncs_ncs_generate.o ncs_rest.f weights.o
++ $(FC) $(FFLAGS) -c ncs_rest.f
+
+-ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.f90
+- $(FC) $(FFLAGS) -c ncs_ncs_generate.f90 align_refmac.f90
++ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.o
++ $(FC) $(FFLAGS) -c ncs_ncs_generate.f90
+
+-lsq_exp2.o: ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90 lsq_exp2.f weights.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90 lsq_exp2.f weights.f90 rharvest_mod.f90
++lsq_exp2.o: ncs_rest_mod.o restr_files.o dist_routines.o ncs_simil.o ridge.o local_tls.o lsq_exp2.f weights.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c lsq_exp2.f
+
+-vdw_and_contacts.o: ncs_rest_mod.f90 vdw_and_contacts.f local_tls.f90 ridge.f90 restr_files.f90 weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ridge.f90 local_tls.f90 weights.f90 agreem.f90 vdw_and_contacts.f
++vdw_and_contacts.o: ncs_rest_mod.o vdw_and_contacts.f local_tls.o ridge.o restr_files.o weights.o agreem.o
++ $(FC) $(FFLAGS) -c vdw_and_contacts.f
+
+ dist_routines.o: dist_routines.f90
+ $(FC) $(FFLAGS) -c dist_routines.f90
+
+-ncs_simil.o: ncs_rest_mod.f90 ncs_simil.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 ncs_simil.f90
++ncs_simil.o: ncs_rest_mod.o ncs_simil.f90
++ $(FC) $(FFLAGS) -c ncs_simil.f90
+
+ ridge.o: ridge.f90
+ $(FC) $(FFLAGS) -c ridge.f90
+@@ -227,140 +221,138 @@ ridge.o: ridge.f90
+ align_refmac.o: align_refmac.f90
+ $(FC) $(FFLAGS) -c align_refmac.f90
+
+-rigid_allocate.o: restr_files.f90 rigid_allocate.f agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 agreem.f90 rigid_allocate.f
++rigid_allocate.o: restr_files.o rigid_allocate.f agreem.o
++ $(FC) $(FFLAGS) -c rigid_allocate.f
+
+-tls_allocate.o: restr_files.f90 tls_allocate.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 tls_allocate.f
++tls_allocate.o: restr_files.o tls_allocate.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c tls_allocate.f
+
+-hkon_secder_tch.o: ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 hkon_secder_tch.f local_tls.f90 ncs_simil.f90 optimise_solvent_all.f90 \
+- restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 ncs_simil.f90 local_tls.f90 \
+- hkon_secder_tch.f weights.f90 agreem.f90 rharvest_mod.f90
++hkon_secder_tch.o: ridge.o gibbs_gm_sampler.o ncs_rest_mod.o hkon_secder_tch.f local_tls.o ncs_simil.o optimise_solvent_all.o \
++ restr_files.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c hkon_secder_tch.f
+
+-oppro_allocate.o: ncs_rest_mod.f90 oppro_allocate.f filter_params.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 weights.f90 oppro_allocate.f
++oppro_allocate.o: ncs_rest_mod.o oppro_allocate.f filter_params.o optimise_solvent_all.o restr_files.o weights.o
++ $(FC) $(FFLAGS) -c oppro_allocate.f
+
+-read_extra_restraints.o: restr_files.f90 read_extra_restraints.f weights.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 read_extra_restraints.f
++read_extra_restraints.o: restr_files.o read_extra_restraints.f weights.o
++ $(FC) $(FFLAGS) -c read_extra_restraints.f
+
+-coords.o: coords.f90 atomf77mod.f
+- $(FC) $(FFLAGS) -c atomf77mod.f coords.f90
++coords.o: coords.f90 atomf77mod.o
++ $(FC) $(FFLAGS) -c coords.f90
+
+
+-ls_scaling_double.o: ls_scaling_double.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c ls_scaling_double.f weights.f90 agreem.f90
++ls_scaling_double.o: ls_scaling_double.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ls_scaling_double.f
+
+-fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.f90
+- $(FC) $(FFLAGS) -c fast_hessian_tabulation.f weights.f90
++fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.o
++ $(FC) $(FFLAGS) -c fast_hessian_tabulation.f
+
+-calc_stats_twin.o: calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
++calc_stats_twin.o: calc_stats_twin.f weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c calc_stats_twin.f
+
+-refpre_twin.o: refpre_twin.f coords.f90 automorphism.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 coords.f90 automorphism.f90 weights.f90 agreem.f90 rharvest_mod.f90 refpre_twin.f
++refpre_twin.o: refpre_twin.f coords.o automorphism.o restr_files.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refpre_twin.f
+
+
+-decide_twin_opers_0.o: restr_files.f90 decide_twin_opers_0.f
+- $(FC) $(FFLAGS) -c restr_files.f90 decide_twin_opers_0.f
++decide_twin_opers_0.o: restr_files.o decide_twin_opers_0.f
++ $(FC) $(FFLAGS) -c decide_twin_opers_0.f
+
+ automorphism.o: automorphism.f90
+ $(FC) $(FFLAGS) -c automorphism.f90
+
+-mtz_write_twin.o: mtz_write_twin.f filter_params.f90 restr_files.f90 weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 filter_params.f90 weights.f90 agreem.f90 mtz_write_twin.f
++mtz_write_twin.o: mtz_write_twin.f filter_params.o restr_files.o weights.o agreem.o
++ $(FC) $(FFLAGS) -c mtz_write_twin.f
+
+ filter_params.o: filter_params.f90
+ $(FC) $(FFLAGS) -c filter_params.f90
+
+-rcard_tor1.o: ncs_rest_mod.f90 rcard_tor1.f filter_params.f90 local_tls.f90 ridge.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90 \
+- agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 local_tls.f90 ridge.f90 weights.f90 \
+- agreem.f90 rharvest_mod.f90 ncs_constr.f90 rcard_tor1.f
++rcard_tor1.o: ncs_rest_mod.o rcard_tor1.f filter_params.o local_tls.o ridge.o optimise_solvent_all.o restr_files.o weights.o \
++ agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c rcard_tor1.f
+
+-inout_routines.o: restr_files.f90 inout_routines.f
+- $(FC) $(FFLAGS) -c restr_files.f90 inout_routines.f
++inout_routines.o: restr_files.o inout_routines.f
++ $(FC) $(FFLAGS) -c inout_routines.f
+
+-local_tls.o: local_tls.f90 linalgebra_f90.f90
+- $(FC) $(FFLAGS) -c linalgebra_f90.f90 local_tls.f90
++local_tls.o: local_tls.f90 linalgebra_f90.o
++ $(FC) $(FFLAGS) -c local_tls.f90
+
+ linalgebra_f90.o: linalgebra_f90.f90
+ $(FC) $(FFLAGS) -c linalgebra_f90.f90
+
+-make_refmac_dummy.o: restr_files.f90 ncs_rest_mod.f90 make_refmac_dummy.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 ncs_rest_mod.f90 weights.f90 agreem.f90 rharvest_mod.f90 optimise_solvent_all.f90 make_refmac_dummy.f
++make_refmac_dummy.o: restr_files.o ncs_rest_mod.o make_refmac_dummy.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c make_refmac_dummy.f
+
+-ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ml_scaling_double.f
++ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c ml_scaling_double.f
+
+-refall_twin.o: refall_twin.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 refall_twin.f
++refall_twin.o: refall_twin.f optimise_solvent_all.o restr_files.f90 weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refall_twin.f
+
+-rharvest_subr.o: ncs_rest_mod.f90 rharvest_subr.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 rharvest_subr.f
++rharvest_subr.o: ncs_rest_mod.o rharvest_subr.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c rharvest_subr.f
+
+-solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 solvent_contr_mask.f
++solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c solvent_contr_mask.f
+
+-subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 subag_scale_hessian.f
++subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.o restr_files.o weights.o agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c subag_scale_hessian.f
+
+-aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 aniso_ref_eigen.f
++aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.o
++ $(FC) $(FFLAGS) -c aniso_ref_eigen.f
+
+-subcf_scale1.o: subcf_scale1.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 subcf_scale1.f
++subcf_scale1.o: subcf_scale1.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c subcf_scale1.f
+
+-bvalue_routines.o: bvalue_routines.f90 restr_files.f90 atomf77mod.f
+- $(FC) $(FFLAGS) -c restr_files.f90 atomf77mod.f bvalue_routines.f90
++bvalue_routines.o: bvalue_routines.f90 restr_files.o atomf77mod.o
++ $(FC) $(FFLAGS) -c bvalue_routines.f90
+
+-newentry_idealise.o:: newentry_idealise.f weights.f90
+- $(FC) $(FFLAGS) -c newentry_idealise.f weights.f90
++newentry_idealise.o:: newentry_idealise.f weights.o
++ $(FC) $(FFLAGS) -c newentry_idealise.f
+
+-occupancy_only_refine.o: occupancy_only_refine.f agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c occupancy_only_refine.f agreem.f90 rharvest_mod.f90
++occupancy_only_refine.o: occupancy_only_refine.f agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c occupancy_only_refine.f
+
+-refmac_completeness.o: weights.f90 agreem.f90 rharvest_mod.f90 refmac_completeness.f90
+- $(FC) $(FFLAGS) -c weights.f90 agreem.f90 rharvest_mod.f90 refmac_completeness.f90
++refmac_completeness.o: weights.o agreem.o rharvest_mod.o refmac_completeness.f90
++ $(FC) $(FFLAGS) -c refmac_completeness.f90
+
+-refmac_xml.o: refmac_xml.f optimise_solvent_all.f90 restr_files.f90 bvalue_routines.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c bvalue_routines.f90 restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 refmac_xml.f
++refmac_xml.o: refmac_xml.f optimise_solvent_all.o restr_files.o bvalue_routines.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refmac_xml.f
+
+ hkl_pack.o: hkl_pack.f90
+ $(FC) $(FFLAGS) -c hkl_pack.f90
+
+-extra_eigen.o: extra_eigen.f agreem.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c extra_eigen.f agreem.f90 ncs_constr.f90
++extra_eigen.o: extra_eigen.f agreem.o ncs_constr.o
++ $(FC) $(FFLAGS) -c extra_eigen.f
+
+-subvag.o: subvag.f hkl_pack.f90
+- $(FC) $(FFLAGS) -c hkl_pack.f90 subvag.f
++subvag.o: subvag.f hkl_pack.o
++ $(FC) $(FFLAGS) -c subvag.f
+
+-make_PDB.o: make_PDB.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 make_PDB.f
++make_PDB.o: make_PDB.f ncs_constr.o
++ $(FC) $(FFLAGS) -c make_PDB.f
+
+-make_CIF.o: make_CIF.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 make_CIF.f
++make_CIF.o: make_CIF.f ncs_constr.o
++ $(FC) $(FFLAGS) -c make_CIF.f
+
+ refmac: $(SUBR)
+- $(FC) $(FFLAGS) -o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
+
+-mol2_file.o: mol2_file.f odb_files.f90
+- $(FC) $(FFLAGS) -c odb_files.f90 mol2_file.f
++mol2_file.o: mol2_file.f odb_files.o
++ $(FC) $(FFLAGS) -c mol2_file.f
+
+-odb_files.o: odb_files.f90 elements_module.f90 enerf77mod.f
+- $(FC) $(FFLAGS) -c elements_module.f90 enerf77mod.f odb_files.f90
++odb_files.o: odb_files.f90 elements_module.o enerf77mod.o
++ $(FC) $(FFLAGS) -c odb_files.f90
+
+ elements_module.o: elements_module.f90
+ $(FC) $(FFLAGS) -c elements_module.f90
+
+-make_lib2.o: make_lib2.f odb_files.f90
+- $(FC) $(FFLAGS) -c odb_files.f90 make_lib2.f
++make_lib2.o: make_lib2.f odb_files.o
++ $(FC) $(FFLAGS) -c make_lib2.f
+
+ pdb2libcheck.o: pdb2libcheck.f90
+ $(FC) $(FFLAGS) -c pdb2libcheck.f90
+
+-libcheck.o: libcheck.f elements_module.f90 pdb2libcheck.f90
+- $(FC) $(FFLAGS) -c elements_module.f90 pdb2libcheck.f90 libcheck.f
++libcheck.o: libcheck.f elements_module.o pdb2libcheck.o
++ $(FC) $(FFLAGS) -c libcheck.f
+
+ header2matr.o: header2matr.f90
+ $(FC) $(FFLAGS) -c header2matr.f90
+@@ -369,16 +361,17 @@ freer_twin.o: freer_twin.f90
+ $(FC) $(FFLAGS) -c freer_twin.f90
+
+ libcheck: $(SUBL)
+- $(FC) $(FFLAGS) -o libcheck${VERSION} $(SUBL)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o libcheck${VERSION} $(SUBL) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
+
+ free_twin: $(SUB_FREE)
+- $(FC) $(FFLAGS) -o FreeTwin${VERSION} $(SUB_FREE)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o FreeTwin${VERSION} $(SUB_FREE) $(LLIBCCP) $(LLIBLAPACK)
+
+
+ header2matr: $(SUB_HEADER)
+- $(FC) $(FFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
+
+ clean:
+ /bin/rm *.o *.mod
+
+ bridge.o: bridge.cpp llhood.h covmat.h Gauss.h tabfunc.h
++ $(CXX) $(CXXFLAGS) -c bridge.cpp
diff --git a/sci-chemistry/refmac/files/5.6.0116-allow-dynamic-linking.patch b/sci-chemistry/refmac/files/5.6.0116-allow-dynamic-linking.patch
new file mode 100644
index 000000000000..9998b759c664
--- /dev/null
+++ b/sci-chemistry/refmac/files/5.6.0116-allow-dynamic-linking.patch
@@ -0,0 +1,341 @@
+ makefile_refmac.inc1 | 215 ++++++++++++++++++++++++--------------------------
+ 1 files changed, 104 insertions(+), 111 deletions(-)
+
+diff --git a/makefile_refmac.inc1 b/makefile_refmac.inc1
+index 0f8bd63..e59fbfb 100644
+--- a/makefile_refmac.inc1
++++ b/makefile_refmac.inc1
+@@ -96,9 +96,7 @@ bridge.o \
+ i0.o \
+ i1.o \
+ chbevl.o \
+-make_unix_ccp4.o \
+-$(LLIBCIF) \
+-$(LLIBLAPACK)
++make_unix_ccp4.o
+
+
+ SUBL = \
+@@ -133,9 +131,7 @@ cell_symm_subrs.o \
+ iheap_sort.o \
+ linalgebra.o \
+ math_refmac.o \
+-subnumrec.o \
+-$(LLIBLAPACK) \
+-$(LLIBCCP)
++subnumrec.o
+
+ SUB_FREE = \
+ freer_twin.o \
+@@ -145,9 +141,7 @@ subnumrec.o \
+ libT.o \
+ iheap_sort.o \
+ cell_symm_subrs.o \
+-math_refmac.o \
+-$(LLIBLAPACK) \
+-$(LLIBCCP)
++math_refmac.o
+
+ SUB_HEADER = header2matr.o
+ #--------------------------------------------------------------------------------
+@@ -185,41 +179,41 @@ rharvest_mod.o: rharvest_mod.f90
+ twin77mod.o: twin77mod.f
+ $(FC) $(FFLAGS) -c twin77mod.f
+
+-gibbs_gm_sampler.o: linalgebra_f90.f90 gibbs_gm_sampler.f90
+- $(FC) $(FFLAGS) -c linalgebra_f90.f90 gibbs_gm_sampler.f90
++gibbs_gm_sampler.o: linalgebra_f90.o gibbs_gm_sampler.f90
++ $(FC) $(FFLAGS) -c gibbs_gm_sampler.f90
+
+-max_with_twins.o: restr_files.f90 max_with_twins.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 max_with_twins.f
++max_with_twins.o: restr_files.o max_with_twins.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c max_with_twins.f
+
+-merohedr_twin.o: restr_files.f90 merohedr_twin.f
+- $(FC) $(FFLAGS) -c restr_files.f90 merohedr_twin.f
++merohedr_twin.o: restr_files.o merohedr_twin.f
++ $(FC) $(FFLAGS) -c merohedr_twin.f
+
+-ls_scaling_twin_save.o: restr_files.f90 ls_scaling_twin_save.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ls_scaling_twin_save.f
++ls_scaling_twin_save.o: restr_files.o ls_scaling_twin_save.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ls_scaling_twin_save.f
+
+-ml_params_refine.o: restr_files.f90 ml_params_refine.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 ml_params_refine.f
++ml_params_refine.o: restr_files.o ml_params_refine.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ml_params_refine.f
+
+-optimise_solvent_all.o: optimise_solvent_all.f90 agreem.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 agreem.f90
++optimise_solvent_all.o: optimise_solvent_all.f90 agreem.o
++ $(FC) $(FFLAGS) -c optimise_solvent_all.f90
+
+-ncs_rest.o: ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 ncs_rest.f weights.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ncs_ncs_generate.f90 weights.f90 ncs_rest.f
++ncs_rest.o: ncs_rest_mod.o restr_files.o ncs_ncs_generate.o ncs_rest.f weights.o
++ $(FC) $(FFLAGS) -c ncs_rest.f
+
+-ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.f90
+- $(FC) $(FFLAGS) -c ncs_ncs_generate.f90 align_refmac.f90
++ncs_ncs_generate.o: ncs_ncs_generate.f90 align_refmac.o
++ $(FC) $(FFLAGS) -c ncs_ncs_generate.f90
+
+-lsq_exp2.o: ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90 lsq_exp2.f weights.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 dist_routines.f90 ncs_simil.f90 ridge.f90 local_tls.f90 lsq_exp2.f weights.f90 rharvest_mod.f90
++lsq_exp2.o: ncs_rest_mod.o restr_files.o dist_routines.o ncs_simil.o ridge.o local_tls.o lsq_exp2.f weights.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c lsq_exp2.f
+
+-vdw_and_contacts.o: ncs_rest_mod.f90 vdw_and_contacts.f local_tls.f90 ridge.f90 restr_files.f90 weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 ridge.f90 local_tls.f90 weights.f90 agreem.f90 vdw_and_contacts.f
++vdw_and_contacts.o: ncs_rest_mod.o vdw_and_contacts.f local_tls.o ridge.o restr_files.o weights.o agreem.o
++ $(FC) $(FFLAGS) -c vdw_and_contacts.f
+
+ dist_routines.o: dist_routines.f90
+ $(FC) $(FFLAGS) -c dist_routines.f90
+
+-ncs_simil.o: ncs_rest_mod.f90 ncs_simil.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 ncs_simil.f90
++ncs_simil.o: ncs_rest_mod.o ncs_simil.f90
++ $(FC) $(FFLAGS) -c ncs_simil.f90
+
+ ridge.o: ridge.f90
+ $(FC) $(FFLAGS) -c ridge.f90
+@@ -227,140 +221,138 @@ ridge.o: ridge.f90
+ align_refmac.o: align_refmac.f90
+ $(FC) $(FFLAGS) -c align_refmac.f90
+
+-rigid_allocate.o: restr_files.f90 rigid_allocate.f agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 agreem.f90 rigid_allocate.f
++rigid_allocate.o: restr_files.o rigid_allocate.f agreem.o
++ $(FC) $(FFLAGS) -c rigid_allocate.f
+
+-tls_allocate.o: restr_files.f90 tls_allocate.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 agreem.f90 tls_allocate.f
++tls_allocate.o: restr_files.o tls_allocate.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c tls_allocate.f
+
+-hkon_secder_tch.o: ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 hkon_secder_tch.f local_tls.f90 ncs_simil.f90 optimise_solvent_all.f90 \
+- restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ridge.f90 gibbs_gm_sampler.f90 ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 ncs_simil.f90 local_tls.f90 \
+- hkon_secder_tch.f weights.f90 agreem.f90 rharvest_mod.f90
++hkon_secder_tch.o: ridge.o gibbs_gm_sampler.o ncs_rest_mod.o hkon_secder_tch.f local_tls.o ncs_simil.o optimise_solvent_all.o \
++ restr_files.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c hkon_secder_tch.f
+
+-oppro_allocate.o: ncs_rest_mod.f90 oppro_allocate.f filter_params.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 weights.f90 oppro_allocate.f
++oppro_allocate.o: ncs_rest_mod.o oppro_allocate.f filter_params.o optimise_solvent_all.o restr_files.o weights.o
++ $(FC) $(FFLAGS) -c oppro_allocate.f
+
+-read_extra_restraints.o: restr_files.f90 read_extra_restraints.f weights.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 weights.f90 read_extra_restraints.f
++read_extra_restraints.o: restr_files.o read_extra_restraints.f weights.o
++ $(FC) $(FFLAGS) -c read_extra_restraints.f
+
+-coords.o: coords.f90 atomf77mod.f
+- $(FC) $(FFLAGS) -c atomf77mod.f coords.f90
++coords.o: coords.f90 atomf77mod.o
++ $(FC) $(FFLAGS) -c coords.f90
+
+
+-ls_scaling_double.o: ls_scaling_double.f weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c ls_scaling_double.f weights.f90 agreem.f90
++ls_scaling_double.o: ls_scaling_double.f weights.o agreem.o
++ $(FC) $(FFLAGS) -c ls_scaling_double.f
+
+-fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.f90
+- $(FC) $(FFLAGS) -c fast_hessian_tabulation.f weights.f90
++fast_hessian_tabulation.o: fast_hessian_tabulation.f weights.o
++ $(FC) $(FFLAGS) -c fast_hessian_tabulation.f
+
+-calc_stats_twin.o: calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c calc_stats_twin.f weights.f90 agreem.f90 rharvest_mod.f90
++calc_stats_twin.o: calc_stats_twin.f weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c calc_stats_twin.f
+
+-refpre_twin.o: refpre_twin.f coords.f90 automorphism.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 coords.f90 automorphism.f90 weights.f90 agreem.f90 rharvest_mod.f90 refpre_twin.f
++refpre_twin.o: refpre_twin.f coords.o automorphism.o restr_files.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refpre_twin.f
+
+
+-decide_twin_opers_0.o: restr_files.f90 decide_twin_opers_0.f
+- $(FC) $(FFLAGS) -c restr_files.f90 decide_twin_opers_0.f
++decide_twin_opers_0.o: restr_files.o decide_twin_opers_0.f
++ $(FC) $(FFLAGS) -c decide_twin_opers_0.f
+
+ automorphism.o: automorphism.f90
+ $(FC) $(FFLAGS) -c automorphism.f90
+
+-mtz_write_twin.o: mtz_write_twin.f filter_params.f90 restr_files.f90 weights.f90 agreem.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 filter_params.f90 weights.f90 agreem.f90 mtz_write_twin.f
++mtz_write_twin.o: mtz_write_twin.f filter_params.o restr_files.o weights.o agreem.o
++ $(FC) $(FFLAGS) -c mtz_write_twin.f
+
+ filter_params.o: filter_params.f90
+ $(FC) $(FFLAGS) -c filter_params.f90
+
+-rcard_tor1.o: ncs_rest_mod.f90 rcard_tor1.f filter_params.f90 local_tls.f90 ridge.f90 optimise_solvent_all.f90 restr_files.f90 weights.f90 \
+- agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 restr_files.f90 optimise_solvent_all.f90 filter_params.f90 local_tls.f90 ridge.f90 weights.f90 \
+- agreem.f90 rharvest_mod.f90 ncs_constr.f90 rcard_tor1.f
++rcard_tor1.o: ncs_rest_mod.o rcard_tor1.f filter_params.o local_tls.o ridge.o optimise_solvent_all.o restr_files.o weights.o \
++ agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c rcard_tor1.f
+
+-inout_routines.o: restr_files.f90 inout_routines.f
+- $(FC) $(FFLAGS) -c restr_files.f90 inout_routines.f
++inout_routines.o: restr_files.o inout_routines.f
++ $(FC) $(FFLAGS) -c inout_routines.f
+
+-local_tls.o: local_tls.f90 linalgebra_f90.f90
+- $(FC) $(FFLAGS) -c linalgebra_f90.f90 local_tls.f90
++local_tls.o: local_tls.f90 linalgebra_f90.o
++ $(FC) $(FFLAGS) -c local_tls.f90
+
+ linalgebra_f90.o: linalgebra_f90.f90
+ $(FC) $(FFLAGS) -c linalgebra_f90.f90
+
+-make_refmac_dummy.o: restr_files.f90 ncs_rest_mod.f90 make_refmac_dummy.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 ncs_rest_mod.f90 weights.f90 agreem.f90 rharvest_mod.f90 optimise_solvent_all.f90 make_refmac_dummy.f
++make_refmac_dummy.o: restr_files.o ncs_rest_mod.o make_refmac_dummy.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c make_refmac_dummy.f
+
+-ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ml_scaling_double.f
++ml_scaling_double.o: ml_scaling_double.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c ml_scaling_double.f
+
+-refall_twin.o: refall_twin.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 refall_twin.f
++refall_twin.o: refall_twin.f optimise_solvent_all.o restr_files.f90 weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refall_twin.f
+
+-rharvest_subr.o: ncs_rest_mod.f90 rharvest_subr.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c ncs_rest_mod.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 rharvest_subr.f
++rharvest_subr.o: ncs_rest_mod.o rharvest_subr.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c rharvest_subr.f
+
+-solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 solvent_contr_mask.f
++solvent_contr_mask.o: solvent_contr_mask.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c solvent_contr_mask.f
+
+-subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.f90 restr_files.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 ncs_constr.f90 subag_scale_hessian.f
++subag_scale_hessian.o: subag_scale_hessian.f optimise_solvent_all.o restr_files.o weights.o agreem.o rharvest_mod.o ncs_constr.o
++ $(FC) $(FFLAGS) -c subag_scale_hessian.f
+
+-aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 aniso_ref_eigen.f
++aniso_ref_eigen.o: aniso_ref_eigen.f ncs_constr.o
++ $(FC) $(FFLAGS) -c aniso_ref_eigen.f
+
+-subcf_scale1.o: subcf_scale1.f optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 subcf_scale1.f
++subcf_scale1.o: subcf_scale1.f optimise_solvent_all.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c subcf_scale1.f
+
+-bvalue_routines.o: bvalue_routines.f90 restr_files.f90 atomf77mod.f
+- $(FC) $(FFLAGS) -c restr_files.f90 atomf77mod.f bvalue_routines.f90
++bvalue_routines.o: bvalue_routines.f90 restr_files.o atomf77mod.o
++ $(FC) $(FFLAGS) -c bvalue_routines.f90
+
+-newentry_idealise.o:: newentry_idealise.f weights.f90
+- $(FC) $(FFLAGS) -c newentry_idealise.f weights.f90
++newentry_idealise.o:: newentry_idealise.f weights.o
++ $(FC) $(FFLAGS) -c newentry_idealise.f
+
+-occupancy_only_refine.o: occupancy_only_refine.f agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c occupancy_only_refine.f agreem.f90 rharvest_mod.f90
++occupancy_only_refine.o: occupancy_only_refine.f agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c occupancy_only_refine.f
+
+-refmac_completeness.o: weights.f90 agreem.f90 rharvest_mod.f90 refmac_completeness.f90
+- $(FC) $(FFLAGS) -c weights.f90 agreem.f90 rharvest_mod.f90 refmac_completeness.f90
++refmac_completeness.o: weights.o agreem.o rharvest_mod.o refmac_completeness.f90
++ $(FC) $(FFLAGS) -c refmac_completeness.f90
+
+-refmac_xml.o: refmac_xml.f optimise_solvent_all.f90 restr_files.f90 bvalue_routines.f90 weights.f90 agreem.f90 rharvest_mod.f90
+- $(FC) $(FFLAGS) -c bvalue_routines.f90 restr_files.f90 optimise_solvent_all.f90 weights.f90 agreem.f90 rharvest_mod.f90 refmac_xml.f
++refmac_xml.o: refmac_xml.f optimise_solvent_all.o restr_files.o bvalue_routines.o weights.o agreem.o rharvest_mod.o
++ $(FC) $(FFLAGS) -c refmac_xml.f
+
+ hkl_pack.o: hkl_pack.f90
+ $(FC) $(FFLAGS) -c hkl_pack.f90
+
+-extra_eigen.o: extra_eigen.f agreem.f90 ncs_constr.f90
+- $(FC) $(FFLAGS) -c extra_eigen.f agreem.f90 ncs_constr.f90
++extra_eigen.o: extra_eigen.f agreem.o ncs_constr.o
++ $(FC) $(FFLAGS) -c extra_eigen.f
+
+-subvag.o: subvag.f hkl_pack.f90
+- $(FC) $(FFLAGS) -c hkl_pack.f90 subvag.f
++subvag.o: subvag.f hkl_pack.o
++ $(FC) $(FFLAGS) -c subvag.f
+
+-make_PDB.o: make_PDB.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 make_PDB.f
++make_PDB.o: make_PDB.f ncs_constr.o
++ $(FC) $(FFLAGS) -c make_PDB.f
+
+-make_CIF.o: make_CIF.f ncs_constr.f90
+- $(FC) $(FFLAGS) -c ncs_constr.f90 make_CIF.f
++make_CIF.o: make_CIF.f ncs_constr.o
++ $(FC) $(FFLAGS) -c make_CIF.f
+
+ refmac: $(SUBR)
+- $(FC) $(FFLAGS) -o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o refmac${VERSION} ${SUBR} $(LLIBOTHERS) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
+
+-mol2_file.o: mol2_file.f odb_files.f90
+- $(FC) $(FFLAGS) -c odb_files.f90 mol2_file.f
++mol2_file.o: mol2_file.f odb_files.o
++ $(FC) $(FFLAGS) -c mol2_file.f
+
+-odb_files.o: odb_files.f90 elements_module.f90 enerf77mod.f
+- $(FC) $(FFLAGS) -c elements_module.f90 enerf77mod.f odb_files.f90
++odb_files.o: odb_files.f90 elements_module.o enerf77mod.o
++ $(FC) $(FFLAGS) -c odb_files.f90
+
+ elements_module.o: elements_module.f90
+ $(FC) $(FFLAGS) -c elements_module.f90
+
+-make_lib2.o: make_lib2.f odb_files.f90
+- $(FC) $(FFLAGS) -c odb_files.f90 make_lib2.f
++make_lib2.o: make_lib2.f odb_files.o
++ $(FC) $(FFLAGS) -c make_lib2.f
+
+ pdb2libcheck.o: pdb2libcheck.f90
+ $(FC) $(FFLAGS) -c pdb2libcheck.f90
+
+-libcheck.o: libcheck.f elements_module.f90 pdb2libcheck.f90
+- $(FC) $(FFLAGS) -c elements_module.f90 pdb2libcheck.f90 libcheck.f
++libcheck.o: libcheck.f elements_module.o pdb2libcheck.o
++ $(FC) $(FFLAGS) -c libcheck.f
+
+ header2matr.o: header2matr.f90
+ $(FC) $(FFLAGS) -c header2matr.f90
+@@ -369,16 +361,17 @@ freer_twin.o: freer_twin.f90
+ $(FC) $(FFLAGS) -c freer_twin.f90
+
+ libcheck: $(SUBL)
+- $(FC) $(FFLAGS) -o libcheck${VERSION} $(SUBL)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o libcheck${VERSION} $(SUBL) $(LLIBCCP) $(LLIBCIF) $(LLIBLAPACK)
+
+ free_twin: $(SUB_FREE)
+- $(FC) $(FFLAGS) -o FreeTwin${VERSION} $(SUB_FREE)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o FreeTwin${VERSION} $(SUB_FREE) $(LLIBCCP) $(LLIBLAPACK)
+
+
+ header2matr: $(SUB_HEADER)
+- $(FC) $(FFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
++ $(FC) $(FFLAGS) $(LDFLAGS) -o header2matr${VERSION} $(SUB_HEADER)
+
+ clean:
+ /bin/rm *.o *.mod
+
+ bridge.o: bridge.cpp llhood.h covmat.h Gauss.h tabfunc.h
++ $(CXX) $(CXXFLAGS) -c bridge.cpp
diff --git a/sci-chemistry/refmac/metadata.xml b/sci-chemistry/refmac/metadata.xml
new file mode 100644
index 000000000000..c0432fefe855
--- /dev/null
+++ b/sci-chemistry/refmac/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher (jlec)</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/refmac/refmac-5.5.0110-r3.ebuild b/sci-chemistry/refmac/refmac-5.5.0110-r3.ebuild
new file mode 100644
index 000000000000..eb8e87018219
--- /dev/null
+++ b/sci-chemistry/refmac/refmac-5.5.0110-r3.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 flag-o-matic toolchain-funcs versionator
+
+DESCRIPTION="Macromolecular crystallographic refinement program"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~garib/refmac"
+SRC_URI="
+ ${HOMEPAGE}/data/refmac_stable/refmac_${PV}.tar.gz
+ test? ( http://dev.gentooexperimental.org/~jlec/distfiles/test-framework.tar.gz )"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+RDEPEND="
+ sci-chemistry/makecif
+ >=sci-libs/ccp4-libs-6.1.3-r7
+ sci-libs/mmdb
+ <sci-libs/monomer-db-1
+ virtual/blas
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+FORTRAN_STANDARD="77 90"
+
+S="${WORKDIR}"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-allow-dynamic-linking.patch
+ "${FILESDIR}"/${PV}-gcc4.6.patch
+ )
+
+src_prepare() {
+ epatch ${PATCHES[@]}
+
+ use test && epatch "${FILESDIR}"/$(get_version_component_range 1-2 ${PV})-test.log.patch
+ [[ ${FC} == *gfortran* ]] && \
+ append-fflags -fno-second-underscore && \
+ append-cflags -DGFORTRAN -DPROTOTYPE && \
+ append-libs -lgfortran -lgfortranbegin -lstdc++
+ [[ ${FC} == *ifort* ]] && \
+ append-libs -lstdc++
+}
+
+src_compile() {
+ emake \
+ FC=$(tc-getFC) \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ COPTIM="${CFLAGS}" \
+ FOPTIM="${FFLAGS:- -O2}" \
+ VERSION="" \
+ XFFLAGS="" \
+ XCFLAGS="" \
+ LLIBCCP="-lccp4f -lccp4c -lccif $($(tc-getPKG_CONFIG) --libs mmdb)" \
+ LLIBLAPACK="$($(tc-getPKG_CONFIG) --libs lapack blas)" \
+ LLIBOTHERS="${LIBS}" \
+ ${PN} libcheck
+}
+
+src_test() {
+ einfo "Starting tests ..."
+ source "${EPREFIX}/etc/profile.d/40ccp4.setup.sh"
+ export PATH="${WORKDIR}/test-framework/scripts:${S}:${PATH}"
+ export CCP4_TEST="${WORKDIR}"/test-framework
+ export CCP4_SCR="${T}"
+ ln -sf refmac "${S}"/refmac5
+ sed '/^ANISOU/d' -i ${CCP4_TEST}/data/pdb/1vr7.pdb
+ ccp4-run-thorough-tests -v test_refmac5 || die
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe ${PN}
+ dosym refmac /usr/libexec/ccp4/bin/refmac5
+ dosym ../libexec/ccp4/bin/${PN} /usr/bin/${PN}
+ dosym refmac /usr/bin/refmac5
+ dodoc refmac_keywords.pdf bugs_and_features.pdf
+}
diff --git a/sci-chemistry/relax/Manifest b/sci-chemistry/relax/Manifest
new file mode 100644
index 000000000000..789564f5ef98
--- /dev/null
+++ b/sci-chemistry/relax/Manifest
@@ -0,0 +1,5 @@
+DIST relax-3.3.4.src.tar.bz2 89206485 SHA256 03ecc20353126d155c7d5c9ab45e3bb146a87243472711c937befced2db333c0 SHA512 78ae5778ef0fe84fc3a26648dd2192d529fb1e5241728f7c06a5a2cec2ce849a2c75c19a931123a17d5c210acc4f4c2401574b10a1fbbe0307d2d9867567352d WHIRLPOOL 4fcdec36e8df412091ab1a99a6b017ebc72f8e5c400429e698221f22e4ef7ae35713a6e2a05f6f1b573e5223f8eccc7cb0d2a20b1171e5bc483fd3ef1a0242bc
+DIST relax-3.3.5.src.tar.bz2 90164368 SHA256 d9e3668221dba7589ba1d12ab40df517b5b6f742ee413864cc87ab636546e2ef SHA512 c8c248abf0edb54af631c11b102b641d41a106036bbdb88d8f1563c9750d3c7d402ee150d7afd770b845d3a421e431afcf95e6222197f9dc1afec61ddcd0bf37 WHIRLPOOL d9070bed833ef063c22fec5e55b1968c65b672ee100247b1af9a25d3149eb57475aeb94a4f125fc3cd278d97ac248e7826b083c840b47f9db83bae7e1aaae710
+DIST relax-3.3.6.src.tar.bz2 90005292 SHA256 2b1994626a910036c63d67c609c49b3bde8c754b60763de62c2ac8f6c3f589c3 SHA512 cda773a4af259d25550e4e4dbd8500594afd9df051ba06130355058347f308b804726acafaa76957e062c78d1d8fb26f843b3ac97d5aecd534b53c1a5155cafb WHIRLPOOL 0bf0f51664a132653fbd981ee6776cb16dd6371504df2167658027325d632cda8a6f4a21d4a530c46dc75c93b3ffb87f5189d4986acadb344154cd7420361e0b
+DIST relax-3.3.7.src.tar.bz2 90268061 SHA256 a32508bd55fa124f6472e08d89ec0fa9f3837efcceb2be681404eb998457381f SHA512 3724a51ef9177f9bd78b3c92add7b88d559f21f5166eaf62b865586c061d17ce0a1af61a794db324d0f792eece04d8f1d037f9e982c858768da1d3fc208e9270 WHIRLPOOL e4446c7ccbe1e8f3caa450a3d747fb8dfcc33d9d336386572b72481544101199150e7938b0e5319a70ef3a5a7f4ad53c143d4a6c01cc7553f435fbc0d00fe952
+DIST relax-3.3.8.src.tar.bz2 90271667 SHA256 176d4e9f0f1c6cf6e6c93b12070a50ff31e10c8dbe2c05cfc2b253e51425b12d SHA512 ddc9df4a8da4ec563403003ae5bc9ecdf5f3bb7341e2306c405fcf7953ab67cab93e9f64139465b05acfa2c842da1624d941b481ef77c20804cabe7c9df811f9 WHIRLPOOL 1a7f77fc9cd712b7ca459a1943dffde4e154fa2d5e06b77ec42568b012c4319dd43eb0b85cdfd6116b9ba2584e5bd58e1b0d8ea8524d462ab4e18e33d4fa315e
diff --git a/sci-chemistry/relax/metadata.xml b/sci-chemistry/relax/metadata.xml
new file mode 100644
index 000000000000..617e574f7c34
--- /dev/null
+++ b/sci-chemistry/relax/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+The program relax is a software package designed for the study of molecular
+dynamics through the analysis of experimental NMR data. Organic molecules,
+proteins, RNA, DNA, sugars, and other biomolecules are all supported. It
+was originally written for the model-free analysis of protein dynamics,
+though its scope has been significantly expanded.
+
+relax is a community driven project created by NMR spectroscopists for
+NMR spectroscopists. It supports a diverse range of analyses:
+
+Model-free analysis - the Lipari and Szabo model-free analysis of NMR
+ relaxation data.
+R1 and R2 - the exponential curve fitting for the calculation of the
+ Rx NMR relaxation rates.
+NOE - the calculation of the steady-state NOE NMR relaxation data.
+Consistency testing of multiple field NMR relaxation data.
+RSDM - Reduced Spectral Density Mapping.
+Frame order and N-state model - study of domain motions via the N-state
+ model and frame order dynamics theories using anisotropic
+ NMR parameters such as RDCs and PCSs.
+Stereochemistry investigations.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/relax/relax-3.3.4.ebuild b/sci-chemistry/relax/relax-3.3.4.ebuild
new file mode 100644
index 000000000000..e394217054c8
--- /dev/null
+++ b/sci-chemistry/relax/relax-3.3.4.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="2.9"
+
+inherit eutils multiprocessing python-single-r1 scons-utils toolchain-funcs wxwidgets virtualx
+
+DESCRIPTION="Molecular dynamics by NMR data analysis"
+HOMEPAGE="http://www.nmr-relax.com/"
+SRC_URI="http://download.gna.org/relax/${P}.src.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-python/Numdifftools[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/wxpython:${WX_GTK_VER}[${PYTHON_USEDEP}]
+ sci-chemistry/molmol
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ sci-chemistry/vmd
+ >=sci-libs/bmrblib-1.0.3[${PYTHON_USEDEP}]
+ >=sci-libs/minfx-1.0.11[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-visualization/grace
+ sci-visualization/opendx
+ x11-libs/wxGTK:${WX_GTK_VER}[X]"
+DEPEND="${RDEPEND}
+ media-gfx/pngcrush"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rm -rf minfx bmrblib extern/numdifftools || die
+ tc-export CC
+}
+
+src_compile() {
+ escons
+}
+
+src_test() {
+ VIRTUALX_COMMAND="${EPYTHON} ./${PN}.py -x --traceback"
+ virtualmake
+}
+
+src_install() {
+ dodoc README docs/{CHANGES,COMMITTERS,JOBS,relax.pdf}
+
+ python_moduleinto ${PN}
+ python_domodule *
+
+ rm ${PN} README || die
+
+ make_wrapper ${PN}-nmr "${EPYTHON} $(python_get_sitedir)/${PN}/${PN}.py $@"
+}
diff --git a/sci-chemistry/relax/relax-3.3.5.ebuild b/sci-chemistry/relax/relax-3.3.5.ebuild
new file mode 100644
index 000000000000..154bc9af2c0b
--- /dev/null
+++ b/sci-chemistry/relax/relax-3.3.5.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="2.9"
+
+inherit eutils multiprocessing python-single-r1 scons-utils toolchain-funcs wxwidgets virtualx
+
+DESCRIPTION="Molecular dynamics by NMR data analysis"
+HOMEPAGE="http://www.nmr-relax.com/"
+SRC_URI="http://download.gna.org/relax/${P}.src.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-python/Numdifftools[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/wxpython:${WX_GTK_VER}[${PYTHON_USEDEP}]
+ sci-chemistry/molmol
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ sci-chemistry/vmd
+ >=sci-libs/bmrblib-1.0.3[${PYTHON_USEDEP}]
+ >=sci-libs/minfx-1.0.11[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-visualization/grace
+ sci-visualization/opendx
+ x11-libs/wxGTK:${WX_GTK_VER}[X]"
+DEPEND="${RDEPEND}
+ media-gfx/pngcrush"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rm -rf minfx bmrblib extern/numdifftools || die
+ tc-export CC
+}
+
+src_compile() {
+ escons
+}
+
+src_test() {
+ VIRTUALX_COMMAND="${EPYTHON} ./${PN}.py -x --traceback"
+ virtualmake
+}
+
+src_install() {
+ dodoc README docs/{CHANGES,COMMITTERS,JOBS,relax.pdf}
+
+ python_moduleinto ${PN}
+ python_domodule *
+
+ rm ${PN} README || die
+
+ make_wrapper ${PN}-nmr "${EPYTHON} $(python_get_sitedir)/${PN}/${PN}.py $@"
+}
diff --git a/sci-chemistry/relax/relax-3.3.6.ebuild b/sci-chemistry/relax/relax-3.3.6.ebuild
new file mode 100644
index 000000000000..b8a571cbdc2a
--- /dev/null
+++ b/sci-chemistry/relax/relax-3.3.6.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="2.9"
+
+inherit eutils multiprocessing python-single-r1 scons-utils toolchain-funcs wxwidgets virtualx
+
+DESCRIPTION="Molecular dynamics by NMR data analysis"
+HOMEPAGE="http://www.nmr-relax.com/"
+SRC_URI="http://download.gna.org/relax/${P}.src.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-python/Numdifftools[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/wxpython:${WX_GTK_VER}[${PYTHON_USEDEP}]
+ sci-chemistry/molmol
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ sci-chemistry/vmd
+ >=sci-libs/bmrblib-1.0.3[${PYTHON_USEDEP}]
+ >=sci-libs/minfx-1.0.11[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-visualization/grace
+ sci-visualization/opendx
+ x11-libs/wxGTK:${WX_GTK_VER}[X]"
+DEPEND="${RDEPEND}
+ media-gfx/pngcrush
+ test? (
+ ${RDEPEND}
+ )
+ "
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rm -rf minfx bmrblib extern/numdifftools || die
+ tc-export CC
+}
+
+src_compile() {
+ escons
+}
+
+src_test() {
+ VIRTUALX_COMMAND="${EPYTHON} ./${PN}.py -x --traceback"
+ virtualmake
+}
+
+src_install() {
+ dodoc README docs/{CHANGES,COMMITTERS,JOBS,relax.pdf}
+
+ python_moduleinto ${PN}
+ python_domodule *
+
+ rm ${PN} README || die
+
+ make_wrapper ${PN}-nmr "${EPYTHON} $(python_get_sitedir)/${PN}/${PN}.py $@"
+}
diff --git a/sci-chemistry/relax/relax-3.3.7.ebuild b/sci-chemistry/relax/relax-3.3.7.ebuild
new file mode 100644
index 000000000000..b8a571cbdc2a
--- /dev/null
+++ b/sci-chemistry/relax/relax-3.3.7.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="2.9"
+
+inherit eutils multiprocessing python-single-r1 scons-utils toolchain-funcs wxwidgets virtualx
+
+DESCRIPTION="Molecular dynamics by NMR data analysis"
+HOMEPAGE="http://www.nmr-relax.com/"
+SRC_URI="http://download.gna.org/relax/${P}.src.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-python/Numdifftools[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/wxpython:${WX_GTK_VER}[${PYTHON_USEDEP}]
+ sci-chemistry/molmol
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ sci-chemistry/vmd
+ >=sci-libs/bmrblib-1.0.3[${PYTHON_USEDEP}]
+ >=sci-libs/minfx-1.0.11[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-visualization/grace
+ sci-visualization/opendx
+ x11-libs/wxGTK:${WX_GTK_VER}[X]"
+DEPEND="${RDEPEND}
+ media-gfx/pngcrush
+ test? (
+ ${RDEPEND}
+ )
+ "
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rm -rf minfx bmrblib extern/numdifftools || die
+ tc-export CC
+}
+
+src_compile() {
+ escons
+}
+
+src_test() {
+ VIRTUALX_COMMAND="${EPYTHON} ./${PN}.py -x --traceback"
+ virtualmake
+}
+
+src_install() {
+ dodoc README docs/{CHANGES,COMMITTERS,JOBS,relax.pdf}
+
+ python_moduleinto ${PN}
+ python_domodule *
+
+ rm ${PN} README || die
+
+ make_wrapper ${PN}-nmr "${EPYTHON} $(python_get_sitedir)/${PN}/${PN}.py $@"
+}
diff --git a/sci-chemistry/relax/relax-3.3.8.ebuild b/sci-chemistry/relax/relax-3.3.8.ebuild
new file mode 100644
index 000000000000..5ffdf922756d
--- /dev/null
+++ b/sci-chemistry/relax/relax-3.3.8.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+WX_GTK_VER="2.9"
+
+inherit eutils multiprocessing python-single-r1 scons-utils toolchain-funcs wxwidgets virtualx
+
+DESCRIPTION="Molecular dynamics by NMR data analysis"
+HOMEPAGE="http://www.nmr-relax.com/"
+SRC_URI="http://download.gna.org/relax/${P}.src.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-python/Numdifftools[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/wxpython:${WX_GTK_VER}[${PYTHON_USEDEP}]
+ sci-chemistry/molmol
+ sci-chemistry/pymol[${PYTHON_USEDEP}]
+ sci-chemistry/vmd
+ >=sci-libs/bmrblib-1.0.3[${PYTHON_USEDEP}]
+ >=sci-libs/minfx-1.0.11[${PYTHON_USEDEP}]
+ sci-libs/scipy[${PYTHON_USEDEP}]
+ sci-visualization/grace
+ sci-visualization/opendx
+ x11-libs/wxGTK:${WX_GTK_VER}[X]"
+DEPEND="${RDEPEND}
+ media-gfx/pngcrush
+ test? ( ${RDEPEND} )
+ "
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rm -rf minfx bmrblib extern/numdifftools || die
+ tc-export CC
+}
+
+src_compile() {
+ escons
+}
+
+src_test() {
+ VIRTUALX_COMMAND="${EPYTHON} ./${PN}.py -x --traceback"
+ virtualmake
+}
+
+src_install() {
+ dodoc README docs/{CHANGES,COMMITTERS,JOBS,relax.pdf}
+
+ python_moduleinto ${PN}
+ python_domodule *
+
+ rm ${PN} README || die
+
+ make_wrapper ${PN}-nmr "${EPYTHON} $(python_get_sitedir)/${PN}/${PN}.py $@"
+}
diff --git a/sci-chemistry/scala/Manifest b/sci-chemistry/scala/Manifest
new file mode 100644
index 000000000000..e03416a28733
--- /dev/null
+++ b/sci-chemistry/scala/Manifest
@@ -0,0 +1 @@
+DIST scala-3.3.20.tar.gz 368628 SHA256 0efb108923a4d21fdc75d7ee92567e4bac4ae409f8798fbabd8142b5b026e976 SHA512 9f9812527013d87c80101333baf7ee646f6b3c665cdb477bb4e633c0a1fa57b31b6327913cf712e961c4484a9d9edf1aab5f3cfc66e6834aca1e970a4e0ca898 WHIRLPOOL 7d6082872a9f2f992186a2626dbf7ccd9f827b1322d1399b41ebc1b07267a46cfed5f7ea085403415c01eba4fc44e9d51983080537db04b227469d6871f8f1f9
diff --git a/sci-chemistry/scala/files/3.3.18-gcc4.6.patch b/sci-chemistry/scala/files/3.3.18-gcc4.6.patch
new file mode 100644
index 000000000000..0bb3d40d479a
--- /dev/null
+++ b/sci-chemistry/scala/files/3.3.18-gcc4.6.patch
@@ -0,0 +1,17 @@
+ scala.f | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/scala.f b/scala.f
+index d7e1cbe..8ed6fd2 100644
+--- a/scala.f
++++ b/scala.f
+@@ -3955,7 +3955,8 @@ c line buffer
+ character*40 key, value
+ character*200 realfilename
+
+- integer intfp, i2swap, lenstr
++ integer intfp, lenstr
++ integer*2 i2swap
+ external intfp, i2swap, lenstr
+ logical litend
+ external litend
diff --git a/sci-chemistry/scala/files/Makefile.am b/sci-chemistry/scala/files/Makefile.am
new file mode 100644
index 000000000000..49fd61180ef0
--- /dev/null
+++ b/sci-chemistry/scala/files/Makefile.am
@@ -0,0 +1,7 @@
+
+LIBS = -lccp4f $(LAPACK_LIBS)
+
+bin_PROGRAMS = scala
+
+scala_SOURCES = scala.f
+
diff --git a/sci-chemistry/scala/files/configure.ac b/sci-chemistry/scala/files/configure.ac
new file mode 100644
index 000000000000..35c4c7fdd194
--- /dev/null
+++ b/sci-chemistry/scala/files/configure.ac
@@ -0,0 +1,14 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT(scala, https://bugs.gentoo.org/)
+AC_CONFIG_SRCDIR([scala.f])
+AM_INIT_AUTOMAKE([foreign])
+
+PKG_CHECK_MODULES([LAPACK],[lapack])
+
+# Checks for programs.
+AC_PROG_FC
+AC_PROG_F77
+AC_OUTPUT([Makefile])
diff --git a/sci-chemistry/scala/metadata.xml b/sci-chemistry/scala/metadata.xml
new file mode 100644
index 000000000000..2c9359ab3513
--- /dev/null
+++ b/sci-chemistry/scala/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+This program scales together multiple observations of reflections from
+Xray difraction experiments, and merges multiple observations into an
+average intensity.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/scala/scala-3.3.20.ebuild b/sci-chemistry/scala/scala-3.3.20.ebuild
new file mode 100644
index 000000000000..3555cc29a9d1
--- /dev/null
+++ b/sci-chemistry/scala/scala-3.3.20.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools fortran-2
+
+DESCRIPTION="Scale together multiple observations of reflections"
+HOMEPAGE="http://www.ccp4.ac.uk/dist/html/scala.html"
+SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/pre/${P}.tar.gz"
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ !<sci-chemistry/ccp4-6.1.2
+ !dev-lang/scala-bin
+ !dev-lang/scala
+ sci-libs/ccp4-libs
+ virtual/lapack"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ cp "${FILESDIR}"/{configure.ac,Makefile.am} "${S}"
+ eautoreconf
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe ${PN}
+ dosym ../libexec/ccp4/bin/${PN} /usr/bin/${PN}
+ dodoc ${PN}.doc
+ dohtml ${PN}.html
+}
diff --git a/sci-chemistry/sfcheck/Manifest b/sci-chemistry/sfcheck/Manifest
new file mode 100644
index 000000000000..77615cec106b
--- /dev/null
+++ b/sci-chemistry/sfcheck/Manifest
@@ -0,0 +1 @@
+DIST sfcheck-7.03.18.tar.gz 535707 SHA256 def9ceec86fc50f35b9a729e6f84b45a83560e2c6c20a5105647182e10313148 SHA512 256aa1690e0f5ca6aca0483a7d00c1deeb7b77701d950771a134532a658f7c3189bc6abec620ea6da2af200fc879ac9ff07ef7f4ba8614b6cd4e8455a11bed93 WHIRLPOOL 7b9f99f1a8387c5bc63bdab2078d3fcfab4146046429c56503760ca12a1898e944b5aa3c42b358d303206487e5d493bdcb77fe1795490779e7bd79b8b66a2d7a
diff --git a/sci-chemistry/sfcheck/files/7.03.17-ldflags.patch b/sci-chemistry/sfcheck/files/7.03.17-ldflags.patch
new file mode 100644
index 000000000000..4163cb52ac1e
--- /dev/null
+++ b/sci-chemistry/sfcheck/files/7.03.17-ldflags.patch
@@ -0,0 +1,12 @@
+diff --git a/src/makefile b/src/makefile
+index ab43d7d..37e469f 100755
+--- a/src/makefile
++++ b/src/makefile
+@@ -60,6 +60,6 @@ main_sfcheck_ccp4.o: main_sfcheck_ccp4.f sfch_version.fh
+ $(MR_FORT) -c main_sfcheck_ccp4.f
+
+ sfcheck: $(OBJS)
+- $(MR_FORT) -o $(BIN)/sfcheck $(OBJSL) $(MR_LIBRARY)
++ $(MR_FORT) $(LDFLAGS) -o $(BIN)/sfcheck $(OBJSL) $(MR_LIBRARY)
+
+ # ----------------------------------------
diff --git a/sci-chemistry/sfcheck/metadata.xml b/sci-chemistry/sfcheck/metadata.xml
new file mode 100644
index 000000000000..9ac9ffdb3a41
--- /dev/null
+++ b/sci-chemistry/sfcheck/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/sfcheck/sfcheck-7.03.18-r1.ebuild b/sci-chemistry/sfcheck/sfcheck-7.03.18-r1.ebuild
new file mode 100644
index 000000000000..e18673d0923e
--- /dev/null
+++ b/sci-chemistry/sfcheck/sfcheck-7.03.18-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils fortran-2 toolchain-funcs
+
+DESCRIPTION="Program for assessing the agreement between the atomic model and X-ray data or EM map"
+HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/sfcheck.html"
+#SRC_URI="http://www.ysbl.york.ac.uk/~alexei/downloads/sfcheck.tar.gz"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="ccp4"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sci-libs/ccp4-libs"
+DEPEND="${RDEPEND}
+ !<sci-chmistry/ccp4-apps-6.1.3"
+
+S="${WORKDIR}"/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/7.03.17-ldflags.patch
+
+ emake -C src clean
+}
+
+src_compile() {
+ MR_FORT="$(tc-getFC) ${FFLAGS}" \
+ MR_LIBRARY="-lccp4f" \
+ emake -C src all
+}
+
+src_install() {
+ exeinto /usr/libexec/ccp4/bin/
+ doexe bin/${PN}
+ dosym ../libexec/ccp4/bin/${PN} /usr/bin/${PN}
+ dodoc readme ${PN}.com.gz doc/${PN}*
+}
diff --git a/sci-chemistry/shelx/Manifest b/sci-chemistry/shelx/Manifest
new file mode 100644
index 000000000000..47f9ac8dd7ad
--- /dev/null
+++ b/sci-chemistry/shelx/Manifest
@@ -0,0 +1,18 @@
+DIST anode_amd64.bz2 8758937 SHA256 01568fd23b0abe280de7a286b9885182f10f06829f139e46bac75846276f60c7 SHA512 6d9f0e506531e14956a95ed23c4c5ccfabaf79b92feba237923db2731e9f3861163f6039e556a6976d910075558fae120088c4805f09880ff33955eff86cc2e1 WHIRLPOOL af181735822c8d04187f98d06f3be2d563cb3e81571fb81139e384a38b54ca7cc83d10a10564456fffb6eead5ab52833f9002882632634fd5a2f8f450d99ca8c
+DIST anode_x86.bz2 4310241 SHA256 520f96803bb0ae7d2e7411187968bb38edadad42f06c22af4f89ee2fd4c95886 SHA512 344e25564d4e0d94764c536625c9be3f4a4b8be74153f17f07254f798e9ebbfe416d069a082906187ba0ec7ab958adf8c7c1ec0afab7a6b146fe02a0b5b88505 WHIRLPOOL 3f349040d1ac9af4323cb091e1b2eb37aff6fe5a1202e65adc9119d1ed141406b5a6792852050061e06253411cb409aebc07c3eb50a26bfa5064ed897ba8da9f
+DIST ciftab_amd64.bz2 1409694 SHA256 47c4b4349b2534e5d98d499fb92322bfc0ded5c893a7f6c58c58dbcfb84d1b86 SHA512 7f2439cf5d7afefaf9df0a2e0ab970076ea3f65d1e394aa0a81340e4cae0cbcbd25169a5e490c8269cfdc92fe9d1240d9d0a2949322b48c339f7556173e83428 WHIRLPOOL 68dc54ee8c1f8ab5b84f0857fd1e21afd6e5417c949bcae74e9b76e3e13aeae0318c200f5716f02759a8a9b45089d6810d6bba658f43e7f300a28c7f010c224f
+DIST ciftab_x86.bz2 510941 SHA256 d27dd5b21e85f77508f01da71c7f8e2cdadc75169eed362324a697938c02e992 SHA512 185628c888e74e7f7ae69eccb3195d841eab83616449c3358dd3fb49605f6bb9e86e97959cf6d20b424037746b67332ad98b9a41ca2a7fae7e3cbe503bf71127 WHIRLPOOL c121e9350b8bbfcb8cf87c4404e9485b678603943702eebfd07627441c47af95a00d457a49440c8fd65ac8fe625e09e35bd1ce8ead6c12af900dc5fbc56188a7
+DIST shelxc_amd64.bz2 1512555 SHA256 e4da94ecc95a8636b28e50254497a7e519313628106f4fe92869e238f659019f SHA512 11b382c6a8440052ffaf136f5c4695d7f6d10e184334810d0f9b7ff25a782c424ae3509a0bbacabddb152b56e6fdfea7266f9c395d0a39994a8c02bd650625ca WHIRLPOOL f6a7f92278741f19e4a19d4a278588770d50d1d9eac30ba96a285ba10add72613532b1cd5f3ffa28e270e654f252e4cf12939abb1458c70d166569e1dd36fbd4
+DIST shelxc_x86.bz2 614564 SHA256 0e8a4fd16a73f28b77e53225d3d6f1038aae1971dca5910043fa04a5818c6e61 SHA512 5be05948e5b79a44e4ead25deba9b1b08857a4636e4c2f8cdc832f6bb2c2407122adff393035f91ce24b48b025191582b919771052f56ebd7a06aaf66dc82115 WHIRLPOOL 6292394d47017524ecd8d3b809ff87793f718e8e3303e6b221c6b27ae4c7da562cff9945d23dd4112509f34f7c3e83cd4d73728c6ee26ffb7efc7b85a3f19aa0
+DIST shelxd_amd64.bz2 8773698 SHA256 fa7c103c0156ad060e7b66b6f39de8982d660a715a07584d2c1a1853d171d3c0 SHA512 6cb881a937e461edf9c9e7736bfab164e6dc16c4df4291b8dce69b3abf98ce27fadb8079cc5142d2b77eb94ac42c0bb375f3ac21b45f590d535839cc7f8cd762 WHIRLPOOL c4b3b8b7f9d78e15153b4f3678ef8766cdc97cc3c03686b528a40b98d45233612c0104aaa3ec491cd20e787d834965056b10bfa3fc247fc1a4aaee4c0739162d
+DIST shelxd_x86.bz2 4406371 SHA256 0b0da50c0907f97e93b46bbd01e63737c007b1b93aa3a79d471621d39557e74f SHA512 68d11983f98984bfaca089b839d38cc9607857d2bb6d2cff306d9efa2f34ea8d741220eb01a99d2ecdd832dde1794b4bb228ceae3fc0e87e3210dfa491e6a402 WHIRLPOOL 6cb3343aa878a5703a65b93f6dd1255ebc668afad92117441a785a91dd39d1736a10411655b08da7ff714bed7ed423e30555b8436c9a7df9f49f8ea3351f651e
+DIST shelxe_amd64.bz2 8302570 SHA256 fac87ba983a454cb32f76076318dabbf6ae2f98415cf2428a0154765b3401915 SHA512 cbafde59ba1d9943f74e8c66cc012168f1f8062e978d2f9103adb4d130c9a024e3e8b170af5b5207168f23db4742b4a99ce3b550e897c59e1dfd3631d7d6c6ab WHIRLPOOL 0007c53e4a9bb8e546b625a2565a9e5d01d60b35c8565e34ab753033c16f1c1b61cdfbe2129ff4981cb595cf637f08342b0d77c22ea8836e08df6b671ac6d2e4
+DIST shelxe_x86.bz2 4177233 SHA256 b2bff78b9b51b72e545d23ce76f6b93e016c2cd583aee9d7236b99fd1722d280 SHA512 67d56beef36918ec6b5d86109d2e61a0dc5a34ed73174ba5cdf96e0db8d8d41cdf20bffdee138f6f177e30a9df32aa1494c18221139538e5c778d61d5f558c51 WHIRLPOOL d8e4be4f7b7a313f5586c23a3d5c94dc2b177b36b47025219c5d54985fd41d7ffb902db4d2a1060ae0ce0448d59032782309029096449af76b5df6253db52e81
+DIST shelxl_amd64.bz2 2985452 SHA256 7e7bf32d5dcfa0e8bb0390add8dcc1d0e722012188dd3d124f255ed9e9c13208 SHA512 0c5b5e4bf6041399221a2f321a3e8f3def952a6eb9af26652a8af04c4bedf5cb98aa529c11e84da20c061028701a49af960135ac697ae157609ca8ae8acde219 WHIRLPOOL a5f7a2e118d5582cafa76c1abea86b614e48e1e8ed217e1280b770124eb16f247ef668112031b5a7660af098b51be94b2f53d0fb506dc090e1615ec7204ce712
+DIST shelxl_x86.bz2 1610822 SHA256 b7a28fb6318cb16948c06e7aed8ee7a7c6a5d3a8863c57f657fbbd2007b25955 SHA512 deaeed15676f294088ce07dc3760e2eecca503f87a537e3e9598d1de6102e82f25b2bd46c080e5140a35046847c345845a88adf159197be640ba52b1a790cfec WHIRLPOOL 5998b3909232016e4cfb99a112090e07a926e36442d47e6c7aa09d50d830eeeb21d2732cd962d01672b76b120cca51df400532805e971ee6b2a6c9d13692582d
+DIST shelxs_amd64.bz2 1606403 SHA256 9b180574ee2b828123f622d42e307778d8d4a1f4c32d5741ba065ad2b7751e60 SHA512 3d26e8bc10f0004ee52a564be567db0cdf41f7d05d457e66c12e117bb82550066bf7333830f8dcd56ea987de677f365db25a51f4c22efda9c911fda03d49086e WHIRLPOOL 7e02ede8528e752f1a01d3109064914d42d6c83e4d8c0e901e13e9e1345160d087f35568d1f7ff7f61f54fdbf838a6e8b2d8ab9482df27fd561cc7f4dad610d7
+DIST shelxs_x86.bz2 746352 SHA256 3eea6b363f7e2ff90965a01b65f3aa5d4ac5642a1528a7824c3ea8398c272d2b SHA512 9ecf1e8da8df2280a1982c210dea5418004492047fdd3ab004eade39d247199f3c757d00a56d179eadc7a1ce434c8019c39af865b641ae3c370a8461a950140c WHIRLPOOL 5120481aefcaa3871e61dc2f9230095506386de83741e3e5fc7cdf29f2835509ae369276b55252b981907a76b59f3829e0c4ab1738605e5c6f72ff58401157d2
+DIST shelxt_amd64.bz2 8862210 SHA256 519c695b8f6c0425f2635dc021be8138ef029761a43d64133a5d736cccc031b8 SHA512 49cb7b5e9f3a1cab153dd04ce4ab424f3331790df2e4acf0584263edcd28e20f6225a6f48161469e1569ae0d6eeed5389db0c9a66d7853ea34b798364a346e27 WHIRLPOOL 11a821502863cddedb14377f8881b7a7931970f8ce9da668106a5dee6e7113fa6f41f69c9381e7ea4c93aa21a6c3498ba4c836df9289db7295c54e6267faa92c
+DIST shelxt_x86.bz2 4441488 SHA256 ca64d86718d306d8d5269f0d7ca92fc2921f1a199afa1bc181b5f6cc339a012c SHA512 83027d24d58863030a284e5e573df27db760ce61f7c8d7da5741471bd814256ae5ade1316aa3e262a54c4c4fb6ad231dacfcef043c3279d381d2969e0b73dd14 WHIRLPOOL ec91f0e6d192507854cbcc2baa751c17185df70f2220eab8f487a1db082bc055aefe2b5f437e144fbbf60c01f1d735057c07ff2f71ab77c88c13a1a19ffe7a65
+DIST shredcif_amd64.bz2 1371002 SHA256 eddf6237b70114bab99845c228d5ba6240a2a9e019bf59678f2222e2ddc52cfe SHA512 5846f7a14936ae4c710ead752a83dd8d73bbcd6037c38f2c566156f87678a84c1db3fd5d0a6e3c6dfb04a2ed7c96c8497c36faaf2bf2ca99ace74f98152ba3be WHIRLPOOL 11b82847cd4f3529c7708de7d0ae7da4e741a58da58ac01954e7136ca2f02c599a81485c70ff36916cdce97e86ab67efe61ec544231db9d7ad903edfd68e232b
+DIST shredcif_x86.bz2 461442 SHA256 aa06e0b3f2b7face7f486029d4c83e9fd591c46b2a41db6ce8e3014f6a713d78 SHA512 8097b6285d3e9269989663e52a4d903b279f9cdd0a5650c91d605dd324c62361de619c0873968a3178d3c125f59a9b448465a09542e2582779fbb8cca1f9ebf7 WHIRLPOOL 37f9410d1fcf2881b3e83b752d5170859ebab2063da8124715d5f627a83b9ef2ba4694a2a77a213e8c1b92d474304a7aea83b1f03111fd2abbb3fcd13d054052
diff --git a/sci-chemistry/shelx/files/20060317-autotool.patch b/sci-chemistry/shelx/files/20060317-autotool.patch
new file mode 100644
index 000000000000..b90fb0a921c1
--- /dev/null
+++ b/sci-chemistry/shelx/files/20060317-autotool.patch
@@ -0,0 +1,47 @@
+diff -urN unix.orig/configure.ac unix/configure.ac
+--- unix.orig/configure.ac 1969-12-31 16:00:00.000000000 -0800
++++ unix/configure.ac 2006-06-04 22:31:49.000000000 -0700
+@@ -0,0 +1,12 @@
++# -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.59)
++AC_INIT(shelx, 20060317, https://bugs.gentoo.org/)
++AC_CONFIG_SRCDIR([ciftab.f])
++AM_INIT_AUTOMAKE([foreign])
++
++# Checks for programs.
++AC_PROG_FC
++AC_PROG_F77
++AC_OUTPUT([Makefile])
+diff -urN unix.orig/Makefile.am unix/Makefile.am
+--- unix.orig/Makefile.am 1969-12-31 16:00:00.000000000 -0800
++++ unix/Makefile.am 2006-06-04 23:06:39.000000000 -0700
+@@ -0,0 +1,27 @@
++bin_PROGRAMS = \
++ ciftab \
++ shelxa \
++ shelxc \
++ shelxd \
++ shelxe \
++ shelxh \
++ shelxl \
++ shelxpro \
++ shelxs \
++ shelxwat
++
++dist_pkgdata_DATA = \
++ ciftab.def \
++ ciftab.rta \
++ ciftab.rtm
++
++ciftab_SOURCES = ciftab.f
++shelxa_SOURCES = shelxa.f
++shelxc_SOURCES = shelxc.f
++shelxd_SOURCES = shelxd.f
++shelxe_SOURCES = shelxe.f
++shelxh_SOURCES = shelxh.f shelxlv.f
++shelxl_SOURCES = shelxl.f shelxlv.f
++shelxpro_SOURCES = shelxpro.f
++shelxs_SOURCES = shelxs.f shelxsv.f
++shelxwat_SOURCES = shelxwat.f
diff --git a/sci-chemistry/shelx/files/20060317-gfortran.patch b/sci-chemistry/shelx/files/20060317-gfortran.patch
new file mode 100644
index 000000000000..d414a8e45c31
--- /dev/null
+++ b/sci-chemistry/shelx/files/20060317-gfortran.patch
@@ -0,0 +1,20 @@
+--- unix.orig/ciftab.f 2006-10-12 11:44:46.000000000 -0700
++++ unix/ciftab.f 2006-10-12 11:38:22.000000000 -0700
+@@ -377,7 +377,7 @@
+ C systems. It enables a 'read-only' file to be opened for reading.
+ C
+ OPEN(LR,FILE=CIFDIR(1:K)//'ciftab.'//IS(1:L),STATUS='OLD',
+- +READONLY,ERR=5)
++ +ERR=5)
+ GOTO 6
+ 4 WRITE(*,'(/A)')' ** Cannot open file **'
+ GOTO 108
+@@ -1332,7 +1332,7 @@
+ 6 FORMAT(3X,4('h k l Fo Fc s',5X),'h k l Fo Fc s',
+ +A1/A1)
+ 7 FORMAT(4(I4,2I3,2I5,I4,2X),I4,2I3,2I5,I4)
+- 8 FORMAT($,1X,A)
++ 8 FORMAT(1X,A,$)
+ C
+ WRITE(LO,1)' '//ESC//AMP//'l0o5c1x'//ESC//'(0u'//
+ +ESC//'(s0p16.66h8.5v0s0b0T'//CR
diff --git a/sci-chemistry/shelx/metadata.xml b/sci-chemistry/shelx/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/shelx/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/shelx/shelx-20141228.ebuild b/sci-chemistry/shelx/shelx-20141228.ebuild
new file mode 100644
index 000000000000..dfd2eac4f5f3
--- /dev/null
+++ b/sci-chemistry/shelx/shelx-20141228.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Programs for crystal structure determination from single-crystal diffraction data"
+HOMEPAGE="http://shelx.uni-ac.gwdg.de/SHELX/"
+SRC_URI="
+ amd64? (
+ anode_amd64.bz2
+ ciftab_amd64.bz2
+ shelxc_amd64.bz2
+ shelxd_amd64.bz2
+ shelxe_amd64.bz2
+ shelxl_amd64.bz2
+ shelxs_amd64.bz2
+ shelxt_amd64.bz2
+ shredcif_amd64.bz2
+ )
+ x86? (
+ anode_x86.bz2
+ ciftab_x86.bz2
+ shelxc_x86.bz2
+ shelxd_x86.bz2
+ shelxe_x86.bz2
+ shelxl_x86.bz2
+ shelxs_x86.bz2
+ shelxt_x86.bz2
+ shredcif_x86.bz2
+ )
+"
+
+SLOT="0"
+LICENSE="free-noncomm"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+S="${WORKDIR}"
+
+RESTRICT="fetch"
+
+QA_PREBUILT="opt/bin/*"
+
+pkg_nofetch() {
+ elog "Go to ${HOMEPAGE}"
+ elog "Fill out the application form, and send it in."
+ elog "Download ${A} and rename them to"
+ use amd64 && elog "*_amd64.bz2"
+ use x86 && elog "*_x86.bz2"
+ elog "and place renamed tarballs in ${DISTDIR}."
+}
+
+src_install() {
+ local i
+ into /opt
+ for i in *; do
+ newbin ${i} ${i/_*/}
+ done
+}
diff --git a/sci-chemistry/solve-resolve-bin/Manifest b/sci-chemistry/solve-resolve-bin/Manifest
new file mode 100644
index 000000000000..0d3b66530d29
--- /dev/null
+++ b/sci-chemistry/solve-resolve-bin/Manifest
@@ -0,0 +1,2 @@
+DIST solve-2.13-linux-64.tar.gz 74444830 SHA256 e03250bb550686fc6e5f59d4e885b83b88cd342dfb4975eb31ddf95d9515650e SHA512 8f20715c3fb73940f03ba8a4bb3528f89ba01520cacead001796609bc15259ab7ab7f2d4960ea97efc43029863bc31e630c9e93f528a233652928220dafe0b4d WHIRLPOOL 125efe76024148656f3bb357ad1bc78d17f51eb8268c83241f4da9a94356170d0259fe48fadf6bf1ffe4b10b57bb27ed79199063dc95d0eef8d9e22de653c84a
+DIST solve-2.13-linux.tar.gz 71902534 SHA256 975466fe92d8f6256de20ea0b5101876f3e5a7e3093199946c9f4824236c79d3
diff --git a/sci-chemistry/solve-resolve-bin/metadata.xml b/sci-chemistry/solve-resolve-bin/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/solve-resolve-bin/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/solve-resolve-bin/solve-resolve-bin-2.13.ebuild b/sci-chemistry/solve-resolve-bin/solve-resolve-bin-2.13.ebuild
new file mode 100644
index 000000000000..6deae178afdd
--- /dev/null
+++ b/sci-chemistry/solve-resolve-bin/solve-resolve-bin-2.13.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
+
+DESCRIPTION="Automated crystallographic structure solution for MIR, SAD, and MAD"
+HOMEPAGE="http://www.solve.lanl.gov/index.html"
+SRC_URI="
+ x86? ( https://solve.lanl.gov/pub/solve/${PV}/solve-${PV}-linux.tar.gz )
+ amd64? ( https://solve.lanl.gov/pub/solve/${PV}/solve-${PV}-linux-64.tar.gz )"
+
+SLOT="0"
+LICENSE="solve"
+KEYWORDS="-* x86 amd64"
+IUSE="examples"
+
+RDEPEND="sci-libs/ccp4-libs"
+DEPEND=""
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/solve-${PV}
+
+QA_PREBUILT="opt/solve-resolve/bin/*"
+
+src_install(){
+ local IN_PATH="/opt/solve-resolve/"
+
+ exeinto ${IN_PATH}bin/
+ doexe bin/*
+
+ insinto ${IN_PATH}lib/
+ doins -r lib/{*sym,sym*,hist*,*dat,segments,patterns}
+
+ docinto html
+ dodoc -r lib/html/*
+
+ sed \
+ -e 's:/usr/local/lib/solve/:${EPREFIX}/opt/solve-resolve/lib/:' \
+ -i lib/examples_solve/p9/solve* || die
+ if use examples; then
+ sed \
+ -e 's:/usr/local/lib/resolve/:${EPREFIX}/opt/solve-resolve/lib/:' \
+ -i lib/examples_resolve/{resolve.csh,prime_and_switch.csh} || die
+ insinto /usr/share/${PF}/
+ doins -r lib/examples_*solve
+ fi
+
+ cat >> "${T}"/20solve-resolve <<- EOF
+ CCP4_OPEN="UNKNOWN"
+ SYMOP="${EPREFIX}/usr/share/ccp4/data/symop.lib"
+ SYMINFO="${EPREFIX}/usr/share/ccp4/data/syminfo.lib"
+ SOLVEDIR="${EPREFIX}/${IN_PATH}lib/"
+ PATH="${EPREFIX}/${IN_PATH}bin"
+ EOF
+
+ doenvd "${T}"/20solve-resolve
+}
+
+pkg_postinst(){
+ einfo "Get a valid license key from"
+ einfo "http://solve.lanl.gov/license.html"
+ einfo "and place it in"
+ einfo "${EPREFIX}${IN_PATH}lib/"
+}
diff --git a/sci-chemistry/sparky/Manifest b/sci-chemistry/sparky/Manifest
new file mode 100644
index 000000000000..1e8514f6cde8
--- /dev/null
+++ b/sci-chemistry/sparky/Manifest
@@ -0,0 +1 @@
+DIST sparky-source-3.115.tar.gz 4103686 SHA256 c187546aaec3d6489c533c3a778e1fe6fa634a931dcaf245c1e13f5720a002b6 SHA512 33b0fd368f15bf4d091d7152a189f57279aea54fb89a12f15314f2a1414b073f7bd282afedeb72e79192195b0b6ac212ca74da3def513592af5400c118ac8e89 WHIRLPOOL 8557a525eab51150da437f78cb8e404adad4f41ed0884498601887e832f78bb316e4847cc3b3a7147ec66bcddd4e06064323bb2ce76452b37d504a809feee7ff
diff --git a/sci-chemistry/sparky/files/3.115-fpic.patch b/sci-chemistry/sparky/files/3.115-fpic.patch
new file mode 100644
index 000000000000..37725aa029e2
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-fpic.patch
@@ -0,0 +1,42 @@
+diff --git a/c++/Makefile b/c++/Makefile
+index 421ff77..7442ed3 100644
+--- a/c++/Makefile
++++ b/c++/Makefile
+@@ -158,7 +158,7 @@ winsystem-$(PLATFORM).o: winsystem-$(PLATFORM).cc
+ $(CXX) $(CXXFLAGS) $(TKFLAGS) -c $(SPARKY_SRC)/winsystem-$(PLATFORM).cc
+
+ python.o: python.cc
+- $(CXX) $(CXXFLAGS) $(PYFLAGS) $(TKFLAGS) -c $(SPARKY_SRC)/python.cc
++ $(CXX) $(CXXFLAGS) -fPIC $(PYFLAGS) $(TKFLAGS) -c $(SPARKY_SRC)/python.cc
+
+ _tkinter.so: _tkinter.o
+ $(CXX) $(LDSHARED) $(LDFLAGS) -o $@ _tkinter.o $(TKLIBS)
+diff --git a/c++/Makefile b/c++/Makefile
+index 353122d..84b0c24 100644
+--- a/c++/Makefile
++++ b/c++/Makefile
+@@ -168,7 +168,7 @@ _tkinter.o: _tkinter.c
+
+ Makefile.dep: force
+ cd $(SPARKY_SRC) ; \
+- $(CXX) $(DEPEND) $(CXXFLAGS) $(TKFLAGS) $(PYFLAGS) \
++ $(CXX) $(DEPEND) $(CXXFLAGS) -fPIC $(TKFLAGS) $(PYFLAGS) \
+ $(SPARKY_OBJS:.o=.cc) $(OTHER_OBJS:.o=.cc) > $@
+
+ TAGS: force
+diff --git a/c++/Makefile b/c++/Makefile
+index 84b0c24..933f347 100644
+--- a/c++/Makefile
++++ b/c++/Makefile
+@@ -30,9 +30,9 @@ TCL_LIBNAME = tcl$(TCLTK_VERSION)
+ PLATFORM = unix
+
+ CXX = g++
+-CXXFLAGS =
++CXXFLAGS += -fPIC
+ CC = gcc
+-CFLAGS =
++CFLAGS += -fPIC
+ PYFLAGS = -I$(PYTHON_INC) -I$(PYTHON_LIB)/config
+ TKFLAGS = -I$(TK_PREFIX)/include
+ TKLIBS = -L$(TK_PREFIX)/lib -l$(TK_LIBNAME) -l$(TCL_LIBNAME) -lX11
diff --git a/sci-chemistry/sparky/files/3.115-ldflags.patch b/sci-chemistry/sparky/files/3.115-ldflags.patch
new file mode 100644
index 000000000000..bd4020387682
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-ldflags.patch
@@ -0,0 +1,61 @@
+diff --git a/c++/Makefile b/c++/Makefile
+index aeb4daa..5cab356 100644
+--- a/c++/Makefile
++++ b/c++/Makefile
+@@ -131,28 +131,28 @@ $(SPARKY_INSTALL)/python/sparky $(SPARKY_INSTALL)/python/lib-tk:
+ chmod 755 $@
+
+ sparky-no-python$(EXE_SUFFIX): main.o $(SPARKY_OBJS)
+- $(CXX) -o $@ main.o $(SPARKY_OBJS) $(LDFLAGS) $(LDLIBS)
++ $(CXX) $(LDFLAGS) -o $@ main.o $(SPARKY_OBJS) $(LDLIBS)
+
+ ucsfdata$(EXE_SUFFIX): ucsfdata.o $(NMR_OBJS)
+- $(CXX) -o $@ ucsfdata.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ ucsfdata.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ pipe2ucsf$(EXE_SUFFIX): pipe2ucsf.o $(NMR_OBJS)
+- $(CXX) -o $@ pipe2ucsf.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ pipe2ucsf.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ vnmr2ucsf$(EXE_SUFFIX): vnmr2ucsf.o $(NMR_OBJS)
+- $(CXX) -o $@ vnmr2ucsf.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ vnmr2ucsf.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ bruk2ucsf$(EXE_SUFFIX): bruk2ucsf.o $(NMR_OBJS)
+- $(CXX) -o $@ bruk2ucsf.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ bruk2ucsf.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ peaks2ucsf$(EXE_SUFFIX): peaks2ucsf.o $(NMR_OBJS)
+- $(CXX) -o $@ peaks2ucsf.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ peaks2ucsf.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ matrix2ucsf$(EXE_SUFFIX): matrix2ucsf.o $(NMR_OBJS)
+- $(CXX) -o $@ matrix2ucsf.o $(NMR_OBJS) $(LDFLAGS) $(SYSLIBS) $(EXTRALIBS)
++ $(CXX) $(LDFLAGS) -o $@ matrix2ucsf.o $(NMR_OBJS) $(SYSLIBS) $(EXTRALIBS)
+
+ spy.so: python.o $(SPARKY_OBJS)
+- $(CXX) $(LDSHARED) -o $@ python.o $(SPARKY_OBJS) $(LDFLAGS) $(LDLIBS)
++ $(CXX) $(LDSHARED) $(LDFLAGS) -o $@ python.o $(SPARKY_OBJS) $(LDLIBS)
+
+ winsystem-$(PLATFORM).o: winsystem-$(PLATFORM).cc
+ $(CXX) $(CXXFLAGS) $(TKFLAGS) -c $(SPARKY_SRC)/winsystem-$(PLATFORM).cc
+@@ -161,7 +161,7 @@ python.o: python.cc
+ $(CXX) $(CXXFLAGS) $(PYFLAGS) $(TKFLAGS) -c $(SPARKY_SRC)/python.cc
+
+ _tkinter.so: _tkinter.o
+- $(CXX) $(LDSHARED) -o $@ _tkinter.o $(LDFLAGS) $(TKLIBS)
++ $(CXX) $(LDSHARED) $(LDFLAGS) -o $@ _tkinter.o $(TKLIBS)
+
+ _tkinter.o: _tkinter.c
+ $(CC) $(CFLAGS) $(TKFLAGS) $(PYFLAGS) -c $(SPARKY_SRC)/_tkinter.c
+@@ -188,8 +188,8 @@ PYLDFLAGS = -L$(PYTHON_LIB)/config -lpython$(PYTHON_VERSION)
+ PYIFLAGS = -I$(PYTHON_INC)
+
+ debug-sparky: main-debug.o python.o _tkinter.o $(SPARKY_OBJS)
+- $(CXX) -o $@ main-debug.o python.o _tkinter.o $(SPARKY_OBJS) \
+- $(LDFLAGS) $(PYLDFLAGS) $(LDLIBS)
++ $(CXX) $(LDFLAGS) -o $@ main-debug.o python.o _tkinter.o $(SPARKY_OBJS) \
++ $(PYLDFLAGS) $(LDLIBS)
+
+ main-debug.o: main-debug.cc
+ $(CXX) $(CXXFLAGS) $(PYIFLAGS) -c $(SPARKY_SRC)/main-debug.cc
diff --git a/sci-chemistry/sparky/files/3.115-makefile.patch b/sci-chemistry/sparky/files/3.115-makefile.patch
new file mode 100644
index 000000000000..7c810dcbd8ae
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-makefile.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile b/Makefile
+index bb27034..30979bd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,6 +48,12 @@ TKINTER_PYMOD = _tkinter$(PYMOD_SUFFIX)
+ all nopython $(SPY_PYMOD) $(TKINTER_PYMOD) $(EXECUTABLES) debug-sparky clean: force
+ cd $(SPARKY_OBJ) && $(MAKE) -f $(SPARKY_SRC)/Makefile -e $@
+
++libraries:
++ cd $(SPARKY_OBJ) && $(MAKE) -f $(SPARKY_SRC)/Makefile -e $(SPY_PYMOD) $(TKINTER_PYMOD)
++
++binaries:
++ cd $(SPARKY_OBJ) && $(MAKE) -f $(SPARKY_SRC)/Makefile -e $(EXECUTABLES) debug-sparky
++
+ Makefile.dep TAGS: force
+ cd $(SPARKY_SRC) && $(MAKE) -f Makefile -e $@
+
diff --git a/sci-chemistry/sparky/files/3.115-paths.patch b/sci-chemistry/sparky/files/3.115-paths.patch
new file mode 100644
index 000000000000..20d9a801ecd6
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/c++/paths.h b/c++/paths.h
+index 2a21366..38aff52 100644
+--- a/c++/paths.h
++++ b/c++/paths.h
+@@ -19,7 +19,7 @@
+ // Installation subdirectories and files
+ //
+ #define SPARKY_MANUAL "manual"
+-#define SPARKY_LIB "lib"
++#define SPARKY_LIB "."
+ #define SPARKY_PRINT "print-prolog.ps" // under lib directory
+ #define SPARKY_RESOURCE "Sparky" // under lib directory
+ #define SPARKY_SAMPLE_DATA "example"
diff --git a/sci-chemistry/sparky/files/3.115-wrapper-r1.patch b/sci-chemistry/sparky/files/3.115-wrapper-r1.patch
new file mode 100644
index 000000000000..d83b5b8510cc
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-wrapper-r1.patch
@@ -0,0 +1,41 @@
+diff --git a/bin/sparky b/bin/sparky
+index 8b51212..270723a 100644
+--- a/bin/sparky
++++ b/bin/sparky
+@@ -4,18 +4,6 @@
+ #
+
+ # -----------------------------------------------------------------------------
+-# Figure out Sparky installation directory from $0.
+-#
+-set sparky_exe = "$0"
+-while (-l "$sparky_exe")
+- set ls_sparky_exe = `ls -l "$sparky_exe"`
+- set sparky_exe = `echo "$ls_sparky_exe" | sed 's/.* -> //'`
+-end
+-set sparky_bin = `dirname "$sparky_exe"`
+-set sparky_bin = `cd "$sparky_bin"; pwd`
+-set sparky_inst = `dirname "$sparky_bin"`
+-
+-# -----------------------------------------------------------------------------
+ # Sparky uses the SPARKY_INSTALL environment variable to find its
+ # application resource file and print prolog file.
+ #
+@@ -25,7 +13,7 @@ setenv SPARKY_INSTALL "$sparky_inst"
+ # If Python is available start Sparky as a Python extension.
+ # Otherwise the standalone version of Sparky is started.
+ #
+-set PYTHON = "$SPARKY_INSTALL/python2.5/bin/python2.5"
++set PYTHON = GENTOO_PYTHON
+ if (! -e "$PYTHON") then
+ set PYTHON = python2.5
+ endif
+@@ -79,7 +67,7 @@ if ($status == 0) then
+ # ---------------------------------------------------------------------------
+ # Add the Sparky package and Tkinter to the Python path
+ #
+- set SPARKY_PYTHONPATH = "$SPARKY_INSTALL/python:$SPARKY_INSTALL/python/lib-tk"
++ set SPARKY_PYTHONPATH = "$SPARKY_INSTALL/python:$SPARKY_INSTALL/python/sparky"
+ if ($?PYTHONPATH) then
+ setenv PYTHONPATH "${SPARKY_PYTHONPATH}:$PYTHONPATH"
+ else
diff --git a/sci-chemistry/sparky/files/3.115-wrapper.patch b/sci-chemistry/sparky/files/3.115-wrapper.patch
new file mode 100644
index 000000000000..9498c0bec837
--- /dev/null
+++ b/sci-chemistry/sparky/files/3.115-wrapper.patch
@@ -0,0 +1,41 @@
+diff --git a/bin/sparky b/bin/sparky
+index 8b51212..270723a 100644
+--- a/bin/sparky
++++ b/bin/sparky
+@@ -4,18 +4,6 @@
+ #
+
+ # -----------------------------------------------------------------------------
+-# Figure out Sparky installation directory from $0.
+-#
+-set sparky_exe = "$0"
+-while (-l "$sparky_exe")
+- set ls_sparky_exe = `ls -l "$sparky_exe"`
+- set sparky_exe = `echo "$ls_sparky_exe" | sed 's/.* -> //'`
+-end
+-set sparky_bin = `dirname "$sparky_exe"`
+-set sparky_bin = `cd "$sparky_bin"; pwd`
+-set sparky_inst = `dirname "$sparky_bin"`
+-
+-# -----------------------------------------------------------------------------
+ # Sparky uses the SPARKY_INSTALL environment variable to find its
+ # application resource file and print prolog file.
+ #
+@@ -25,7 +13,7 @@ setenv SPARKY_INSTALL "$sparky_inst"
+ # If Python is available start Sparky as a Python extension.
+ # Otherwise the standalone version of Sparky is started.
+ #
+-set PYTHON = "$SPARKY_INSTALL/python2.5/bin/python2.5"
++set PYTHON = "@GENTOO_PORTAGE_EPREFIX@/usr/bin/python"
+ if (! -e "$PYTHON") then
+ set PYTHON = python2.5
+ endif
+@@ -79,7 +67,7 @@ if ($status == 0) then
+ # ---------------------------------------------------------------------------
+ # Add the Sparky package and Tkinter to the Python path
+ #
+- set SPARKY_PYTHONPATH = "$SPARKY_INSTALL/python:$SPARKY_INSTALL/python/lib-tk"
++ set SPARKY_PYTHONPATH = "$SPARKY_INSTALL/python:$SPARKY_INSTALL/python/sparky"
+ if ($?PYTHONPATH) then
+ setenv PYTHONPATH "${SPARKY_PYTHONPATH}:$PYTHONPATH"
+ else
diff --git a/sci-chemistry/sparky/files/fix-install.patch b/sci-chemistry/sparky/files/fix-install.patch
new file mode 100644
index 000000000000..4eefaa891f99
--- /dev/null
+++ b/sci-chemistry/sparky/files/fix-install.patch
@@ -0,0 +1,259 @@
+diff -ur -x make-sparky sparky.orig/bin/sparky sparky/bin/sparky
+--- sparky.orig/bin/sparky 2004-03-05 11:32:10.000000000 -0800
++++ sparky/bin/sparky 2005-12-17 17:36:51.000000000 -0800
+@@ -4,22 +4,10 @@
+ #
+
+ # -----------------------------------------------------------------------------
+-# Figure out Sparky installation directory from $0.
+-#
+-set sparky_exe = $0
+-while (-l $sparky_exe)
+- set ls_sparky_exe = `ls -l "$sparky_exe"`
+- set sparky_exe = `echo "$ls_sparky_exe" | sed 's/.* -> //'`
+-end
+-set sparky_bin = `dirname "$sparky_exe"`
+-set sparky_bin = `cd "$sparky_bin"; pwd`
+-set sparky_inst = `dirname "$sparky_bin"`
+-
+-# -----------------------------------------------------------------------------
+ # Sparky uses the SPARKY_INSTALL environment variable to find its
+ # application resource file and print prolog file.
+ #
+-setenv SPARKY_INSTALL $sparky_inst
++setenv SPARKY_INSTALL @GENTOO_PORTAGE_EPREFIX@/usr/lib/sparky
+
+ # -----------------------------------------------------------------------------
+ # If Python is available start Sparky as a Python extension.
+diff -ur -x make-sparky sparky.orig/c++/Makefile sparky/c++/Makefile
+--- sparky.orig/c++/Makefile 2004-02-03 15:56:24.000000000 -0800
++++ sparky/c++/Makefile 2005-12-18 10:49:08.000000000 -0800
+@@ -22,6 +22,7 @@
+ PYTHON_PREFIX = /usr/local
+ PYTHON_LIB = $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
+ PYTHON_INC = $(PYTHON_PREFIX)/include/python$(PYTHON_VERSION)
++PYDIR = $(SPARKY_INSTALL)/lib/python$(PYTHON_VERSION)/site-packages
+ TCLTK_VERSION = 8.4
+ TCLTK_VER_WIN32 = 84
+ TK_PREFIX = /usr/local
+@@ -113,21 +114,20 @@
+
+ nopython: $(EXECUTABLES)
+
+-install-python: $(SPY_PYMOD) $(TKINTER_PYMOD) $(SPARKY_INSTALL)/python \
+- $(SPARKY_INSTALL)/python/sparky $(SPARKY_INSTALL)/python/lib-tk
+- $(INSTALL) $(SPY_PYMOD) $(SPARKY_INSTALL)/python/sparky
+- chmod 755 $(SPARKY_INSTALL)/python/sparky/$(SPY_PYMOD)
+- $(INSTALL) $(TKINTER_PYMOD) $(SPARKY_INSTALL)/python/lib-tk
+- chmod 755 $(SPARKY_INSTALL)/python/lib-tk/$(TKINTER_PYMOD)
++install-python: $(SPY_PYMOD) $(TKINTER_PYMOD) $(PYDIR) \
++ $(PYDIR)/sparky $(PYDIR)/lib-tk
++ $(INSTALL) $(SPY_PYMOD) $(PYDIR)/sparky
++ chmod 755 $(PYDIR)/sparky/$(SPY_PYMOD)
++ $(INSTALL) $(TKINTER_PYMOD) $(PYDIR)/lib-tk
++ chmod 755 $(PYDIR)/lib-tk/$(TKINTER_PYMOD)
+
+ install-nopython: $(EXECUTABLES) $(SPARKY_INSTALL)/bin
+ $(INSTALL) $(EXECUTABLES) $(SPARKY_INSTALL)/bin
+ cd $(SPARKY_INSTALL)/bin ; \
+ chmod 755 $(EXECUTABLES)
+
+-$(SPARKY_INSTALL)/bin $(SPARKY_INSTALL)/python \
+-$(SPARKY_INSTALL)/python/sparky $(SPARKY_INSTALL)/python/lib-tk:
+- mkdir $@
++$(SPARKY_INSTALL)/bin $(PYDIR) $(PYDIR)/sparky $(PYDIR)/lib-tk:
++ mkdir -p $@
+ chmod 755 $@
+
+ sparky-no-python$(EXE_SUFFIX): main.o $(SPARKY_OBJS)
+diff -ur -x make-sparky sparky.orig/c++/paths.h sparky/c++/paths.h
+--- sparky.orig/c++/paths.h 2002-01-17 19:15:06.000000000 -0800
++++ sparky/c++/paths.h 2005-12-17 20:57:15.000000000 -0800
+@@ -19,7 +19,7 @@
+ // Installation subdirectories and files
+ //
+ #define SPARKY_MANUAL "manual"
+-#define SPARKY_LIB "lib"
++#define SPARKY_LIB ""
+ #define SPARKY_PRINT "print-prolog.ps" // under lib directory
+ #define SPARKY_RESOURCE "Sparky" // under lib directory
+ #define SPARKY_SAMPLE_DATA "example"
+diff -ur -x make-sparky sparky.orig/c++/system-unix.cc sparky/c++/system-unix.cc
+--- sparky.orig/c++/system-unix.cc 2004-02-26 10:57:54.000000000 -0800
++++ sparky/c++/system-unix.cc 2005-12-17 20:56:58.000000000 -0800
+@@ -95,7 +95,7 @@
+ //
+ Stringy default_sparky_install_path()
+ {
+- return file_path(file_path(file_path("", "usr"), "local"), "sparky");
++ return file_path(file_path(file_path("", "usr"), "lib"), "sparky");
+ }
+
+ // ----------------------------------------------------------------------------
+diff -ur -x make-sparky sparky.orig/lib/Makefile sparky/lib/Makefile
+--- sparky.orig/lib/Makefile 2004-02-18 10:53:29.000000000 -0800
++++ sparky/lib/Makefile 2005-12-17 16:03:21.000000000 -0800
+@@ -18,9 +18,9 @@
+ TCL_SHLIB = lib$(TCL_VERSION)$(TCLTK_SHLIB_SUFFIX)
+ TK_SHLIB = lib$(TK_VERSION)$(TCLTK_SHLIB_SUFFIX)
+
+-install: $(SPARKY_INSTALL)/lib install-tcl-tk
+- $(INSTALL) Sparky print-prolog.ps $(SPARKY_INSTALL)/lib
+- cd $(SPARKY_INSTALL)/lib ; \
++install: $(SPARKY_INSTALL)/lib
++ $(INSTALL) Sparky print-prolog.ps $(SPARKY_INSTALL)/lib/sparky
++ cd $(SPARKY_INSTALL)/lib/sparky ; \
+ chmod 644 Sparky print-prolog.ps
+
+ install-tcl-tk: $(SPARKY_INSTALL)/lib
+diff -ur -x make-sparky sparky.orig/Makefile sparky/Makefile
+--- sparky.orig/Makefile 2004-02-18 10:40:04.000000000 -0800
++++ sparky/Makefile 2005-12-17 19:40:48.000000000 -0800
+@@ -40,18 +40,22 @@
+
+ PYTHON_VERSION = 2.3
+ PYTHON_DIR =
++PYDIR = $(SPARKY_INSTALL)/lib/python$(PYTHON_VERSION)/site-packages
+
+ PYMOD_SUFFIX = .so
+ SPY_PYMOD = spy$(PYMOD_SUFFIX)
+ TKINTER_PYMOD = _tkinter$(PYMOD_SUFFIX)
+
++PYDIR = $(SPARKY_INSTALL)/lib/sparky/python
++DOCDIR = $(SPARKY_INSTALL)/share/doc/sparky
++
+ all nopython $(SPY_PYMOD) $(TKINTER_PYMOD) $(EXECUTABLES) debug-sparky clean: force
+ cd $(SPARKY_OBJ) && $(MAKE) -f $(SPARKY_SRC)/Makefile -e $@
+
+ Makefile.dep TAGS: force
+ cd $(SPARKY_SRC) && $(MAKE) -f Makefile -e $@
+
+-install: install-nopython $(SPARKY_INSTALL) install-python
++install: install-nopython $(SPARKY_INSTALL)
+ cd $(SPARKY_OBJ) && \
+ $(MAKE) -f $(SPARKY_SRC)/Makefile -e install-python
+ cd $(SPARKY)/python && $(MAKE) -f Makefile -e install
+@@ -67,7 +71,8 @@
+ chmod 755 sparky$(SCRIPT_SUFFIX)
+
+ install-example: $(SPARKY_INSTALL)
+- cd $(SPARKY) ; $(INSTALLDIR) example $(SPARKY_INSTALL)
++ mkdir -p $(DOCDIR)/example
++ cd $(SPARKY) ; $(INSTALLDIR) example $(DOCDIR)
+
+ install-lib: $(SPARKY_INSTALL)
+ cd $(SPARKY)/lib && $(MAKE) -f Makefile -e install
+@@ -76,21 +81,14 @@
+ cd $(SPARKY)/manual && $(MAKE) -f Makefile -e install
+
+ install-misc: $(SPARKY_INSTALL)
+- cd $(SPARKY) ; $(INSTALL) LICENSE README $(SPARKY_INSTALL)
+- cd $(SPARKY_INSTALL) ; chmod 644 LICENSE README
+-
+-install-python: $(SPARKY_INSTALL) $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
+-ifdef PYTHON_DIR
+- $(INSTALLDIR) $(PYTHON_DIR)/* $(SPARKY_INSTALL)/python$(PYTHON_VERSION)
+-else
+- echo "Not packaging Python with Sparky."
+-endif
++ cd $(SPARKY) ; $(INSTALL) LICENSE README $(DOCDIR)
++ cd $(DOCDIR) ; chmod 644 LICENSE README
+
+ install-mac:
+ cd $(SPARKY)/mac && $(MAKE) -f Makefile -e install
+
+-$(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin $(SPARKY_INSTALL)/python$(PYTHON_VERSION):
+- mkdir $@
++$(SPARKY_INSTALL) $(SPARKY_INSTALL)/bin $(PYDIR):
++ mkdir -p $@
+ chmod 755 $@
+
+ force:
+diff -ur -x make-sparky sparky.orig/manual/Makefile sparky/manual/Makefile
+--- sparky.orig/manual/Makefile 2004-03-08 15:40:06.000000000 -0800
++++ sparky/manual/Makefile 2005-12-17 19:37:45.000000000 -0800
+@@ -13,6 +13,8 @@
+
+ SPARKY_INSTALL = /usr/local/sparky
+ MANUAL_WWW = /usr/local/html/cgl/sparky/manual
++DOCDIR = $(SPARKY_INSTALL)/share/doc/sparky
++MANUAL_LOC = $(DOCDIR)/manual
+
+ MANUAL_SECTIONS = overview.html intro.html views.html peaks.html \
+ extensions.html autoassign.html misc.html \
+@@ -45,17 +47,17 @@
+
+ all: $(MANUAL_FILES)
+
+-install: $(MANUAL_FILES) $(SPARKY_INSTALL)/manual \
+- $(SPARKY_INSTALL)/manual/images
+- $(INSTALL) $(MANUAL_FILES) $(SPARKY_INSTALL)/manual
+- cd $(SPARKY_INSTALL)/manual ; \
++install: $(MANUAL_FILES) $(MANUAL_LOC) \
++ $(MANUAL_LOC)/images
++ $(INSTALL) $(MANUAL_FILES) $(MANUAL_LOC)
++ cd $(MANUAL_LOC) ; \
+ chmod 644 $(MANUAL_FILES)
+ cd images ; \
+- $(INSTALL) $(IMAGE_FILES) $(SPARKY_INSTALL)/manual/images
+- cd $(SPARKY_INSTALL)/manual/images ; \
++ $(INSTALL) $(IMAGE_FILES) $(MANUAL_LOC)/images
++ cd $(MANUAL_LOC)/images ; \
+ chmod 644 $(IMAGE_FILES)
+
+-$(SPARKY_INSTALL)/manual $(SPARKY_INSTALL)/manual/images:
++$(MANUAL_LOC) $(MANUAL_LOC)/images:
+ mkdir $@
+ chmod 755 $@
+
+Only in sparky/manual: manual-postscript.gz
+diff -ur -x make-sparky sparky.orig/python/Makefile sparky/python/Makefile
+--- sparky.orig/python/Makefile 2004-02-18 10:51:06.000000000 -0800
++++ sparky/python/Makefile 2005-12-17 19:43:06.000000000 -0800
+@@ -9,6 +9,8 @@
+ PYTHON_VERSION = 2.3
+ PYTHON = $(PYTHON_PREFIX)/bin/python$(PYTHON_VERSION)
+ PYTHON_LIB = $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)
++PYDIR = $(SPARKY_INSTALL)/lib/python$(PYTHON_VERSION)/site-packages
++DOCDIR = $(SPARKY_INSTALL)/share/doc/sparky
+
+ PYTHON_CODE = __init__.py align.py assigngraph.py atomnames.py \
+ atoms.py autoassign.py axes.py \
+@@ -27,18 +29,13 @@
+ sputil.py start_in_chimera.py strips.py subprocess.py \
+ tkutil.py volumeerror.py xeasy.py xplor.py
+
+-install: $(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
+- $(SPARKY_INSTALL)/python/lib-tk
+- $(INSTALL) README $(SPARKY_INSTALL)/python
+- $(INSTALL) $(PYTHON_CODE) $(SPARKY_INSTALL)/python/sparky
+- $(INSTALL) lib-tk/*.py $(SPARKY_INSTALL)/python/lib-tk
+- chmod 644 $(SPARKY_INSTALL)/python/README
+- cd $(SPARKY_INSTALL)/python/sparky ; chmod 644 $(PYTHON_CODE)
+- chmod 644 $(SPARKY_INSTALL)/python/lib-tk/*.py
+- $(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/sparky
+- $(PYTHON) $(PYTHON_LIB)/compileall.py $(SPARKY_INSTALL)/python/lib-tk
++install: $(PYDIR) $(PYDIR)/sparky $(DOCDIR)/python
++ $(INSTALL) README $(DOCDIR)/python
++ $(INSTALL) $(PYTHON_CODE) $(PYDIR)/sparky
++ chmod 644 $(DOCDIR)/python/README
++ cd $(PYDIR)/sparky ; chmod 644 $(PYTHON_CODE)
+
+-$(SPARKY_INSTALL)/python $(SPARKY_INSTALL)/python/sparky \
+- $(SPARKY_INSTALL)/python/lib-tk:
++$(PYDIR) $(PYDIR)/sparky \
++ $(PYDIR)/lib-tk $(DOCDIR)/python:
+ mkdir $@
+ chmod 755 $@
+diff -ur -x make-sparky sparky.orig/python/spingraph.py sparky/python/spingraph.py
+--- sparky.orig/python/spingraph.py 2001-12-17 10:51:10.000000000 -0800
++++ sparky/python/spingraph.py 2005-12-17 22:09:17.000000000 -0800
+@@ -831,7 +831,7 @@
+ 'by creating a file specifying atom positions, colors,\n' +
+ 'sizes, and text label positions. Sparky provides a\n' +
+ 'default layout file\n' +
+- '\n\t/usr/local/sparky/python/spinlayout.py\n\n' +
++ '\n\t/usr/lib/python*/site-packages/sparky/python/spinlayout.py\n\n' +
+ 'You override this file by making your own copy\n' +
+ '\n\t~/Sparky/Python/spinlayout.py\n\n' +
+ 'You can create the desired template on the screen\n'
diff --git a/sci-chemistry/sparky/metadata.xml b/sci-chemistry/sparky/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/sparky/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/sparky/sparky-3.115-r1.ebuild b/sci-chemistry/sparky/sparky-3.115-r1.ebuild
new file mode 100644
index 000000000000..b28e5351dc5b
--- /dev/null
+++ b/sci-chemistry/sparky/sparky-3.115-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit eutils flag-o-matic multilib prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="Graphical NMR assignment and integration program for proteins, nucleic acids, and other polymers"
+HOMEPAGE="http://www.cgl.ucsf.edu/home/sparky/"
+SRC_URI="http://www.cgl.ucsf.edu/home/sparky/distrib-${PV}/${PN}-source-${PV}.tar.gz"
+
+LICENSE="sparky"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="
+ app-shells/tcsh
+ dev-lang/tcl:0=
+ dev-lang/tk:0="
+DEPEND="${RDEPEND}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${PN}"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-ldflags.patch
+ "${FILESDIR}"/${PV}-wrapper-r1.patch
+ "${FILESDIR}"/${PV}-paths.patch
+ "${FILESDIR}"/${PV}-makefile.patch
+ )
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ TKVER=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
+ PYVER=${EPYTHON#python}
+}
+
+src_prepare() {
+ epatch ${PATCHES[@]}
+
+ sed -i \
+ -e "s:^\(set PYTHON =\).*:\1 ${EPREFIX}/usr/bin/${EPYTHON}:g" \
+ -e "s:^\(setenv SPARKY_INSTALL[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir)/${PN}:g" \
+ -e "s:tcl8.4:tcl${TKVER}:g" \
+ -e "s:tk8.4:tk${TKVER}:g" \
+ -e "s:^\(setenv TCLTK_LIB[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir):g" \
+ "${S}"/bin/sparky || die
+ eprefixify "${S}"/bin/sparky
+}
+
+src_compile() {
+ emake \
+ SPARKY="${S}" \
+ PYTHON_VERSION="${PYVER}" \
+ PYTHON_PREFIX="${EPREFIX}/usr" \
+ PYTHON_LIB="${EPREFIX}/usr/$(get_libdir)" \
+ PYTHON_INC="${EPREFIX}/usr/include/${EPYTHON}" \
+ TK_PREFIX="${EPREFIX}/usr" \
+ TCLTK_VERSION="${TKVER}" \
+ TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk -ltcl -lX11" \
+ CXX="$(tc-getCXX)" \
+ CC="$(tc-getCC)" \
+ LDSHARED="-shared" \
+ binaries
+
+ rm c++/*.o || die
+
+ emake \
+ SPARKY="${S}" \
+ PYTHON_VERSION="${PYVER}" \
+ PYTHON_PREFIX="${EPREFIX}/usr" \
+ PYTHON_LIB="${EPREFIX}/usr/$(get_libdir)" \
+ PYTHON_INC="${EPREFIX}/usr/include/${EPYTHON}" \
+ TK_PREFIX="${EPREFIX}/usr" \
+ TCLTK_VERSION="${TKVER}" \
+ TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk -ltcl -lX11" \
+ CXX="$(tc-getCXX)" \
+ CC="$(tc-getCC)" \
+ CXXFLAGS="${CXXFLAGS} -fPIC" \
+ CFLAGS="${CFLAGS} -fPIC" \
+ LDSHARED="-shared -fPIC" \
+ libraries
+}
+
+src_install() {
+ # The symlinks are needed to avoid hacking the complete code to fix the locations
+
+ dobin c++/{{bruk,matrix,peaks,pipe,vnmr}2ucsf,ucsfdata,sparky-no-python} bin/${PN}
+
+ insinto /usr/share/${PN}/
+ doins lib/{print-prolog.ps,Sparky}
+ dosym ../../share/${PN}/print-prolog.ps /usr/$(get_libdir)/${PN}/print-prolog.ps
+ dosym ../../share/${PN}/Sparky /usr/$(get_libdir)/${PN}/Sparky
+
+ dohtml -r manual/*
+ dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/manual
+
+ python_moduleinto ${PN}
+ python_domodule python/*.py c++/{spy.so,_tkinter.so}
+
+ python_optimize
+
+ dosym ../${EPYTHON}/site-packages /usr/$(get_libdir)/${PN}/python
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/
+ doins -r example || die
+ dosym ../../share/doc/${PF}/example /usr/$(get_libdir)/${PN}/example
+ fi
+
+ dodoc README
+ newdoc python/README README.python
+}
diff --git a/sci-chemistry/suitename/Manifest b/sci-chemistry/suitename/Manifest
new file mode 100644
index 000000000000..eac0c677a2bb
--- /dev/null
+++ b/sci-chemistry/suitename/Manifest
@@ -0,0 +1 @@
+DIST suitename.0.3.070628.src.tgz 29914 SHA256 5c2a709aa2d815b259475344aa2b982c157868eb9a7e5d6407b8f525f7e28c4c
diff --git a/sci-chemistry/suitename/metadata.xml b/sci-chemistry/suitename/metadata.xml
new file mode 100644
index 000000000000..06ac91e5fb9e
--- /dev/null
+++ b/sci-chemistry/suitename/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Suitename is a new C program that supports the ROC RNA Ontology Consortium
+consensus RNA backbone nomenclature and conformer-list development (see our RNA
+backbone rotamer section.
+From dihedral-angle input for a specific RNA structure (usually from Dangle),
+Suitename categorizes the RNA backbone geometry of each suite (the
+sugar-to-sugar version of a residue) either as an outlier ("!!") or as belonging
+to one of the 53 defined conformer bins. The output is either a
+one-line-per-suite report, or a linear conformer string (as shown below the
+image here) in one of several variant formats. Suitename is built into
+MolProbity, producing entries in the multi-criterion chart for an RNA model and
+also a suitestring file. The Suitename code is made available here for bulk or
+individual command-line use.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/suitename/suitename-0.3.070628.ebuild b/sci-chemistry/suitename/suitename-0.3.070628.ebuild
new file mode 100644
index 000000000000..fb11e075c8d6
--- /dev/null
+++ b/sci-chemistry/suitename/suitename-0.3.070628.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs
+
+MY_P="${PN}.${PV}"
+
+DESCRIPTION="The ROC RNA Ontology Consortium consensus RNA backbone nomenclature and conformer-list development"
+HOMEPAGE="http://kinemage.biochem.duke.edu/software/suitename.php"
+SRC_URI="http://kinemage.biochem.duke.edu/downloads/software/${PN}/${MY_P}.src.tgz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="richardson"
+IUSE=""
+
+S="${WORKDIR}"/${MY_P}
+
+src_prepare() {
+ tc-export CC
+ cp Makefile.linux Makefile || die
+ sed \
+ -e 's:cc:${CC}:g' \
+ -e "s:-o:${LDFLAGS} -o:g" \
+ -i Makefile || die
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dobin ${PN}
+}
diff --git a/sci-chemistry/surf/Manifest b/sci-chemistry/surf/Manifest
new file mode 100644
index 000000000000..7e50ca58e561
--- /dev/null
+++ b/sci-chemistry/surf/Manifest
@@ -0,0 +1 @@
+DIST surf-1.0.tar.Z 74347 SHA256 6d032e4b749e5e1971b5d97b0fcf552029068a87bcaebd6ce92db27179f7cb0a
diff --git a/sci-chemistry/surf/metadata.xml b/sci-chemistry/surf/metadata.xml
new file mode 100644
index 000000000000..9ac9ffdb3a41
--- /dev/null
+++ b/sci-chemistry/surf/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/surf/surf-1.0.ebuild b/sci-chemistry/surf/surf-1.0.ebuild
new file mode 100644
index 000000000000..eadfa758a755
--- /dev/null
+++ b/sci-chemistry/surf/surf-1.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Solvent accesible Surface calculator"
+HOMEPAGE="http://www.ks.uiuc.edu/"
+SRC_URI="http://www.ks.uiuc.edu/Research/vmd/extsrcs/surf.tar.Z -> ${P}.tar.Z"
+
+LICENSE="SURF"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE=""
+
+DEPEND="
+ !www-client/surf
+ sys-apps/ed
+ x11-misc/makedepend"
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ sed \
+ -e 's:$(CC) $(CFLAGS) $(OBJS):$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS):g' \
+ -i Makefile || die
+}
+
+src_compile() {
+ emake depend \
+ && emake \
+ CC="$(tc-getCC)" \
+ OPT_CFLAGS="${CFLAGS} \$(INCLUDE)" \
+ CFLAGS="${CFLAGS} \$(INCLUDE)" \
+ || die
+}
+
+src_install() {
+ dobin ${PN} || die
+ dodoc README || die
+}
diff --git a/sci-chemistry/theseus/Manifest b/sci-chemistry/theseus/Manifest
new file mode 100644
index 000000000000..9708bc4e5cf6
--- /dev/null
+++ b/sci-chemistry/theseus/Manifest
@@ -0,0 +1,3 @@
+DIST theseus_2.0.6.tar.gz 1257560 SHA256 f63f4d5fd9ce9d30048312e31807a1a413b433e2bbcfd0cefb3703f455551c23 SHA512 70604c468eb841b92e77a3e91cd57120b96c171512fb1cc31a407b7c4816150dfa31ec123fb9568a842e623f3252c60df0dc53d40fa2a4aece6e3c77039f4696 WHIRLPOOL 01c73e5bec0f4e9a98cd926a15f3213f30d20db10a500e88cfa54e31b92324d3fb741899c30c5c45e8d5a2d31eb68e742113b29a077f70430cf7acda9c02bc54
+DIST theseus_3.0.0.tar.gz 1213574 SHA256 4e474efabf1cfc9a48e96e86ac9e5b0f8035b57677017542e66478759bdc7866 SHA512 251e6273624126406609691e1205d9693c18dcbc8c81e10c77101ac4a1b6bdffcb56a47fd5fdc7ed6ed4fa107c2ed26b03a1780f951f9cc69a25c0722996e7b2 WHIRLPOOL 5a15c0f5270411114ebbca4fc9cad1e4db0449d1e6d8d1693f1e58d6a54f61b401cc6a2df2539d2ca34dd4dc52a09e1c45c0af8b80eb5c8916d8f168bf536ad3
+DIST theseus_3.3.0.tar.gz 22548124 SHA256 3cfd4f906717f9cb8e77f689fc97059b32df355c0696077034ea99a485e3f2fe SHA512 1fba3e8019a40214defdae13d4721d170ee698337d8efd4e872af22f8ab3cb1fdd52fa9f19a858ee51bc98150692af0c6016033feb0d76f29acaf7fffbb430e2 WHIRLPOOL c1baf4daea1e2a0c78b73d8d91ff735aa9bb82bd6edf533aab0f9d20a9e82b7f61fdf8c4b09c92b58447f686e954b6eaf7f02d7c9e5304c8d52b4c09b6d323af
diff --git a/sci-chemistry/theseus/metadata.xml b/sci-chemistry/theseus/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/theseus/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/theseus/theseus-2.0.6.ebuild b/sci-chemistry/theseus/theseus-2.0.6.ebuild
new file mode 100644
index 000000000000..56d58ae9fb9e
--- /dev/null
+++ b/sci-chemistry/theseus/theseus-2.0.6.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Maximum likelihood superpositioning and analysis of macromolecular structures"
+HOMEPAGE="http://www.theseus3d.org/"
+SRC_URI="http://www.theseus3d.org/src/${PN}_${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="
+ sci-libs/gsl
+ || (
+ sci-biology/muscle
+ sci-biology/probcons
+ sci-biology/mafft
+ sci-biology/t-coffee
+ sci-biology/kalign
+ sci-biology/clustalw:2
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/${PN}_src/
+
+src_prepare() {
+ cat >> make.inc <<- EOF
+ ARCH = $(tc-getAR)
+ ARCHFLAGS = -rvs
+ RANLIB = $(tc-getRANLIB)
+ LOCALLIBDIR = "${EPREFIX}/usr/$(get_libdir)
+ SYSLIBS = $(pkg-config --libs gsl) -lpthread
+ LIBS = -ldistfit -lmsa -ldssplite -ldltmath -lDLTutils -ltheseus
+ LIBDIR = -L./lib
+ INSTALLDIR = "${ED}"/usr/bin
+ OPT =
+ WARN =
+ CFLAGS = ${CFLAGS} \$(WARN)
+ CC = $(tc-getCC)
+ EOF
+
+ sed \
+ -e 's|theseus:|theseus: libs|g' \
+ -e '/-o theseus/s:$(CC):$(CC) ${LDFLAGS}:g' \
+ -i Makefile || die
+
+ sed \
+ -e 's:/usr/bin/sed:sed:g' \
+ -e "s:/usr/local/bin/:/usr/bin/:g" \
+ -e "s:/usr/bin/:${EPREFIX}/usr/bin/:g" \
+ -i theseus_align || die
+}
+
+src_install() {
+ dobin theseus theseus_align
+ dodoc theseus_man.pdf README AUTHORS
+ use examples && insinto /usr/share/${PN} && doins -r examples
+}
diff --git a/sci-chemistry/theseus/theseus-3.0.0.ebuild b/sci-chemistry/theseus/theseus-3.0.0.ebuild
new file mode 100644
index 000000000000..ed80be95d26b
--- /dev/null
+++ b/sci-chemistry/theseus/theseus-3.0.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Maximum likelihood superpositioning and analysis of macromolecular structures"
+HOMEPAGE="http://www.theseus3d.org/"
+SRC_URI="http://www.theseus3d.org/src/${PN}_${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="
+ sci-libs/gsl
+ || (
+ sci-biology/muscle
+ sci-biology/probcons
+ sci-biology/mafft
+ sci-biology/t-coffee
+ sci-biology/kalign
+ sci-biology/clustalw:2
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/${PN}_src/
+
+src_prepare() {
+ cat >> make.inc <<- EOF
+ ARCH = $(tc-getAR)
+ ARCHFLAGS = -rvs
+ RANLIB = $(tc-getRANLIB)
+ LOCALLIBDIR = "${EPREFIX}/usr/$(get_libdir)
+ SYSLIBS = $(pkg-config --libs gsl) -lpthread
+ LIBS = -ldistfit -lmsa -ldssplite -ldltmath -lDLTutils -ltheseus
+ LIBDIR = -L./lib
+ INSTALLDIR = "${ED}"/usr/bin
+ OPT =
+ WARN =
+ CFLAGS = ${CFLAGS} -std=c11 \$(WARN)
+ CC = $(tc-getCC)
+ EOF
+
+ sed \
+ -e 's|theseus:|theseus: libs|g' \
+ -e '/-o theseus/s:$(CC):$(CC) ${LDFLAGS}:g' \
+ -i Makefile || die
+
+ sed \
+ -e 's:/usr/bin/sed:sed:g' \
+ -e "s:/usr/local/bin/:/usr/bin/:g" \
+ -e "s:/usr/bin/:${EPREFIX}/usr/bin/:g" \
+ -i theseus_align || die
+}
+
+src_compile () {
+ emake ltheseus
+ default
+}
+
+src_install() {
+ dobin theseus theseus_align
+ dodoc theseus_man.pdf README AUTHORS
+ use examples && insinto /usr/share/${PN} && doins -r examples
+}
diff --git a/sci-chemistry/theseus/theseus-3.3.0.ebuild b/sci-chemistry/theseus/theseus-3.3.0.ebuild
new file mode 100644
index 000000000000..ed80be95d26b
--- /dev/null
+++ b/sci-chemistry/theseus/theseus-3.3.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Maximum likelihood superpositioning and analysis of macromolecular structures"
+HOMEPAGE="http://www.theseus3d.org/"
+SRC_URI="http://www.theseus3d.org/src/${PN}_${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="
+ sci-libs/gsl
+ || (
+ sci-biology/muscle
+ sci-biology/probcons
+ sci-biology/mafft
+ sci-biology/t-coffee
+ sci-biology/kalign
+ sci-biology/clustalw:2
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}"/${PN}_src/
+
+src_prepare() {
+ cat >> make.inc <<- EOF
+ ARCH = $(tc-getAR)
+ ARCHFLAGS = -rvs
+ RANLIB = $(tc-getRANLIB)
+ LOCALLIBDIR = "${EPREFIX}/usr/$(get_libdir)
+ SYSLIBS = $(pkg-config --libs gsl) -lpthread
+ LIBS = -ldistfit -lmsa -ldssplite -ldltmath -lDLTutils -ltheseus
+ LIBDIR = -L./lib
+ INSTALLDIR = "${ED}"/usr/bin
+ OPT =
+ WARN =
+ CFLAGS = ${CFLAGS} -std=c11 \$(WARN)
+ CC = $(tc-getCC)
+ EOF
+
+ sed \
+ -e 's|theseus:|theseus: libs|g' \
+ -e '/-o theseus/s:$(CC):$(CC) ${LDFLAGS}:g' \
+ -i Makefile || die
+
+ sed \
+ -e 's:/usr/bin/sed:sed:g' \
+ -e "s:/usr/local/bin/:/usr/bin/:g" \
+ -e "s:/usr/bin/:${EPREFIX}/usr/bin/:g" \
+ -i theseus_align || die
+}
+
+src_compile () {
+ emake ltheseus
+ default
+}
+
+src_install() {
+ dobin theseus theseus_align
+ dodoc theseus_man.pdf README AUTHORS
+ use examples && insinto /usr/share/${PN} && doins -r examples
+}
diff --git a/sci-chemistry/threeV/Manifest b/sci-chemistry/threeV/Manifest
new file mode 100644
index 000000000000..87b89d3f552f
--- /dev/null
+++ b/sci-chemistry/threeV/Manifest
@@ -0,0 +1 @@
+DIST 3v-1.2.tgz 599194 RMD160 133d770fd2c7c353b05db74594998954be92e9a0 SHA1 86895fb5c33360db2c30cec258dacbc01f39638a SHA256 ae11ce61e6b7cac6aa07d91914b59507a04a1dbfbe624ed8356154cbabc6e8af
diff --git a/sci-chemistry/threeV/files/1.2-gentoo.patch b/sci-chemistry/threeV/files/1.2-gentoo.patch
new file mode 100644
index 000000000000..0827551599ba
--- /dev/null
+++ b/sci-chemistry/threeV/files/1.2-gentoo.patch
@@ -0,0 +1,107 @@
+diff --git a/src/Makefile b/src/Makefile
+index a58462c..616f51a 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,7 +1,7 @@
+-CC = g++
+-EXT=$(shell ./cpuflags.pl --opt )
+-FLAGS = -Wall $(EXT)
+-#FLAGS = -O3 -Wall -ffast-math
++CXX ?= g++
++#EXT=$(shell ./cpuCXXFLAGS.pl --opt )
++#CXXFLAGS = -Wall $(EXT)
++#CXXFLAGS = -O3 -Wall -ffast-math
+ OBJS = utils-main.o utils-output.o utils-mrc.o
+
+ all: cav chan fsv sol tun vdw vol
+@@ -17,54 +17,65 @@ volume: vol
+ objects: utils-main.o utils-output.o utils-mrc.o
+
+ cav: objects cavities.cpp
+- $(CC) $(FLAGS) -o Cavities.exe $(OBJS) cavities.cpp
+- chmod 777 Cavities.exe
+- mv Cavities.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o cavities.o cavities.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o Cavities $(OBJS) cavities.o
++ chmod 755 Cavities
++ mv Cavities ../bin
+
+ chan: objects channel.cpp
+- $(CC) $(FLAGS) -o Channel.exe $(OBJS) channel.cpp
+- chmod 777 Channel.exe
+- mv Channel.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o channel.o channel.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o Channel $(OBJS) channel.o
++ chmod 755 Channel
++ mv Channel ../bin
+
+ fsv: objects fsv_calc.cpp
+- $(CC) $(FLAGS) -o FsvCalc.exe $(OBJS) fsv_calc.cpp
+- chmod 777 FsvCalc.exe
+- mv FsvCalc.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o fsv_calc.o fsv_calc.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o FsvCalc $(OBJS) fsv_calc.o
++ chmod 755 FsvCalc
++ mv FsvCalc ../bin
+
+ sol: objects solvent.cpp
+- $(CC) $(FLAGS) -o Solvent.exe $(OBJS) solvent.cpp
+- chmod 777 Solvent.exe
+- mv Solvent.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o solvent.o solvent.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o Solvent $(OBJS) solvent.o
++ chmod 755 Solvent
++ mv Solvent ../bin
+
+ tun: objects tunnel.cpp
+- $(CC) $(FLAGS) -o Tunnel.exe $(OBJS) tunnel.cpp
+- chmod 777 Tunnel.exe
+- mv Tunnel.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o tunnel.o tunnel.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o Tunnel $(OBJS) tunnel.o
++ chmod 755 Tunnel
++ mv Tunnel ../bin
+
+ vdw: objects vdw.cpp
+- $(CC) $(FLAGS) -o VDW.exe $(OBJS) vdw.cpp
+- chmod 777 VDW.exe
+- mv VDW.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o vdw.o vdw.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o VDW $(OBJS) vdw.o
++ chmod 755 VDW
++ mv VDW ../bin
+
+ vol: objects volume.cpp
+- $(CC) $(FLAGS) -o Volume.exe $(OBJS) volume.cpp
+- chmod 777 Volume.exe
+- mv Volume.exe ../bin
++ $(CXX) $(CXXFLAGS) -c -o volume.o volume.cpp
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o Volume $(OBJS) volume.o
++ chmod 755 Volume
++ mv Volume ../bin
+
+ utils-main.o: utils-main.cpp
+- $(CC) $(FLAGS) -c -o utils-main.o utils-main.cpp
++ $(CXX) $(CXXFLAGS) -c -o utils-main.o utils-main.cpp
+
+ utils-output.o: utils-main.o utils-output.cpp
+- $(CC) $(FLAGS) -c -o utils-output.o utils-output.cpp
++ $(CXX) $(CXXFLAGS) -c -o utils-output.o utils-output.cpp
+
+ utils-mrc.o: utils-mrc.cpp
+- $(CC) $(FLAGS) -c -o utils-mrc.o utils-mrc.cpp
++ $(CXX) $(CXXFLAGS) -c -o utils-mrc.o utils-mrc.cpp
++
++install:
++ install -d $(DESTDIR)/usr/bin
++ install ../bin/* $(DESTDIR)/usr/bin/
+
+ clean:
+ rm -fv *.o *~
+
+ distclean:
+- rm -fv *.o ../bin/*.exe *~
++ rm -fv *.o ../bin/* *~
+
+ none:
+ echo "Please type make xxx, where xxx = cav, cha, fsv, sol, tun, vdw, or vol"
diff --git a/sci-chemistry/threeV/metadata.xml b/sci-chemistry/threeV/metadata.xml
new file mode 100644
index 000000000000..043cc7527474
--- /dev/null
+++ b/sci-chemistry/threeV/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-chemistry</herd>
+<maintainer>
+ <email>jlec@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/threeV/threeV-1.2.ebuild b/sci-chemistry/threeV/threeV-1.2.ebuild
new file mode 100644
index 000000000000..7aaa18bba004
--- /dev/null
+++ b/sci-chemistry/threeV/threeV-1.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="3V: Voss Volume Voxelator"
+HOMEPAGE="http://geometry.molmovdb.org/3v/"
+SRC_URI="http://geometry.molmovdb.org/3v/3v-${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+PDEPEND="sci-chemistry/msms-bin"
+# sci-chemistry/usf-rave"
+
+S="${WORKDIR}/3v-${PV}/src"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ tc-export CXX
+ emake distclean || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+
+ cd ..
+ dodoc AUTHORS ChangeLog QUICKSTART README TODO VERSION || die
+}
diff --git a/sci-chemistry/tinker/Manifest b/sci-chemistry/tinker/Manifest
new file mode 100644
index 000000000000..1628482e5af4
--- /dev/null
+++ b/sci-chemistry/tinker/Manifest
@@ -0,0 +1 @@
+DIST tinker-7.1.2.tar.gz 28468683 SHA256 fdee18915cff9044fd083bb2271083c221db6d05de2cb98fc111b136e23e6899 SHA512 4524259754b0f11d7e2e8997ebd85eae7d28f8dbb1edb2d9818aa0a96640de0049aa4937236694f1a11743dee187d612f775b233a73cc96c2708d620457a7dc2 WHIRLPOOL f3e29eaf67d25ae6d4f3c4e3546798e66bd626929fddd45b9d1ff9f2143cd57dcc5079226f3ceaa142f4c6a168c4a150a51be1336a5ca13384338795ef3a6d46
diff --git a/sci-chemistry/tinker/files/5.1.09-Makefile.patch b/sci-chemistry/tinker/files/5.1.09-Makefile.patch
new file mode 100644
index 000000000000..68a095add706
--- /dev/null
+++ b/sci-chemistry/tinker/files/5.1.09-Makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/make/Makefile b/make/Makefile
+index 221ab45..7634474 100644
+--- a/make/Makefile
++++ b/make/Makefile
+@@ -607,7 +607,7 @@ clean:
+ listing:
+ cat *.i *.f > tinker.txt
+
+-rename:
++rename: ${EXEFILES}
+ mv alchemy.x $(BINDIR)/alchemy
+ mv analyze.x $(BINDIR)/analyze
+ mv anneal.x $(BINDIR)/anneal
diff --git a/sci-chemistry/tinker/files/6-openmp.patch b/sci-chemistry/tinker/files/6-openmp.patch
new file mode 100644
index 000000000000..3666fbd0bfc4
--- /dev/null
+++ b/sci-chemistry/tinker/files/6-openmp.patch
@@ -0,0 +1,15 @@
+diff --git a/source/initial.f b/source/initial.f
+index 835f228..4099c74 100644
+--- a/source/initial.f
++++ b/source/initial.f
+@@ -73,8 +73,8 @@ c
+ c
+ c Intel compiler extensions to OpenMP standard
+ c
+-!$ call kmp_set_stacksize (2**30)
+-!$ call kmp_set_blocktime (0)
++! call kmp_set_stacksize (2**30)
++! call kmp_set_blocktime (0)
+ c
+ c values of machine precision constants
+ c
diff --git a/sci-chemistry/tinker/files/7.1.2-openmp.patch b/sci-chemistry/tinker/files/7.1.2-openmp.patch
new file mode 100644
index 000000000000..f3e8e2932b4a
--- /dev/null
+++ b/sci-chemistry/tinker/files/7.1.2-openmp.patch
@@ -0,0 +1,15 @@
+diff --git a/source/initial.f b/source/initial.f
+index 835f228..4099c74 100644
+--- a/source/initial.f
++++ b/source/initial.f
+@@ -73,8 +73,8 @@ c
+ c
+ c Intel compiler extensions to OpenMP standard
+ c
+-!$ call kmp_set_stacksize_s (2**28)
+-!$ call kmp_set_blocktime (0)
++! call kmp_set_stacksize_s (2**28)
++! call kmp_set_blocktime (0)
+ c
+ c values of machine precision constants
+ c
diff --git a/sci-chemistry/tinker/files/tinker-7.1.2-build.patch b/sci-chemistry/tinker/files/tinker-7.1.2-build.patch
new file mode 100644
index 000000000000..d6ef484b19a4
--- /dev/null
+++ b/sci-chemistry/tinker/files/tinker-7.1.2-build.patch
@@ -0,0 +1,17 @@
+ make/Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/make/Makefile b/make/Makefile
+index 61d5037..9be384a 100644
+--- a/make/Makefile
++++ b/make/Makefile
+@@ -719,8 +719,7 @@ EXEFILES = alchemy.x \
+ %.x: %.o libtinker.a
+ ${F77} ${LINKFLAGS} -o $@ $^ ${LIBS}; strip $@
+
+-all:
+- ${EXEFILES}
++all: ${EXEFILES}
+
+ install:
+ rename
diff --git a/sci-chemistry/tinker/metadata.xml b/sci-chemistry/tinker/metadata.xml
new file mode 100644
index 000000000000..e42d0af60f42
--- /dev/null
+++ b/sci-chemistry/tinker/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/tinker/tinker-7.1.2.ebuild b/sci-chemistry/tinker/tinker-7.1.2.ebuild
new file mode 100644
index 000000000000..e81b4a6b6a1d
--- /dev/null
+++ b/sci-chemistry/tinker/tinker-7.1.2.ebuild
@@ -0,0 +1,104 @@
+# 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 java-pkg-opt-2 toolchain-funcs
+
+DESCRIPTION="Molecular modeling package that includes force fields, such as AMBER and CHARMM"
+HOMEPAGE="http://dasher.wustl.edu/tinker/"
+SRC_URI="http://dasher.wustl.edu/${PN}/downloads/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Tinker"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+DEPEND="
+ >=virtual/jdk-1.6"
+RDEPEND="
+ >=sci-libs/fftw-3.2.2-r1[fortran,threads]
+ dev-libs/maloc
+ !dev-util/diffuse
+ >=virtual/jre-1.6"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}"/${PN}/source
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ java-pkg-opt-2_pkg_setup
+ tc-has-openmp || die "Please use an openmp capable compiler like gcc[openmp]"
+}
+
+src_prepare() {
+ sed 's:strip:true:g' -i ../make/Makefile
+ [[ $(tc-getFC) =~ "ifort" ]] || epatch "${FILESDIR}"/${PV}-openmp.patch
+ cd .. && epatch "${FILESDIR}"/${P}-build.patch
+}
+
+src_compile() {
+ local javalib=
+ for i in $(java-config -g LDPATH | sed 's|:| |g'); do
+ [[ -f ${i}/libjvm.so ]] && javalib=${i}
+ done
+
+ # use dummy routines in pmpb.f instead of apbs calls
+ rm pmpb.c || die
+
+ if [[ $(tc-getFC) =~ "gfortran" ]]; then
+ append-flags -fopenmp
+ _omplib="-lgomp"
+ else
+ append-flags -openmp
+ _omplib="-liomp5"
+ fi
+
+ _fftwlib="$($(tc-getPKG_CONFIG) --libs fftw3 fftw3_threads)"
+
+ emake \
+ -f ../make/Makefile \
+ F77="$(tc-getFC)" \
+ CC="$(tc-getCC) -c" \
+ F77FLAGS=-c \
+ OPTFLAGS="${FFLAGS}" \
+ LINKFLAGS="${LDFLAGS} -Wl,-rpath ${javalib}" \
+ INCLUDEDIR="$(java-pkg_get-jni-cflags) -I${EPREFIX}/usr/include" \
+ LIBS="-lmaloc -L${javalib} -ljvm ${_omplib} ${_fftwlib}" \
+ all
+
+ mkdir "${S}"/../bin || die
+
+ emake \
+ -f ../make/Makefile \
+ BINDIR="${S}"/../bin \
+ rename
+}
+
+src_test() {
+ cd "${WORKDIR}"/${PN}/test/
+ for test in *.run; do
+ einfo "Testing ${test} ..."
+ bash ${test} || die
+ done
+}
+
+src_install() {
+ dobin "${WORKDIR}"/${PN}/perl/mdavg "${WORKDIR}"/${PN}/bin/*
+
+ insinto /usr/share/${PN}/
+ doins -r "${WORKDIR}"/${PN}/params
+
+ dodoc \
+ "${WORKDIR}"/${PN}/doc/{*.txt,*.pdf,0README}
+
+ if use examples; then
+ insinto /usr/share/${P}
+ doins -r "${WORKDIR}"/${PN}/example
+
+ doins -r "${WORKDIR}"/${PN}/test
+ fi
+
+}
diff --git a/sci-chemistry/tm-align/Manifest b/sci-chemistry/tm-align/Manifest
new file mode 100644
index 000000000000..d9e8dc8632b3
--- /dev/null
+++ b/sci-chemistry/tm-align/Manifest
@@ -0,0 +1 @@
+DIST TMtools20140601.tar.gz 934391 SHA256 5032f7ab1824c8b2191b4a3667e1405feb6ccf7c900f57632aa506fff8ec1bf5 SHA512 99b90425ff051c836e19225601ddfb1576bec9c8f233aafeba96075f924a3c0892b5b1cfef36254ff5ef468a6dbf64f7fcc9a3ce24a0d869b3c1eb87c0149765 WHIRLPOOL 5ba7d9cb71e3055dff62851c68e127314b9ca70c4bbc39aeba35e5a4b02dc0cffeacb52c6369c90875d8062603c830acf604cfc339bdecfeb3dd6c10015e20de
diff --git a/sci-chemistry/tm-align/files/CMakeLists.txt b/sci-chemistry/tm-align/files/CMakeLists.txt
new file mode 100644
index 000000000000..506ef136309e
--- /dev/null
+++ b/sci-chemistry/tm-align/files/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required (VERSION 2.6)
+project (TMTools Fortran)
+add_executable(TMalign TMalign.f)
+add_executable(TMscore TMscore.f)
+
+install (TARGETS TMalign TMscore DESTINATION bin)
diff --git a/sci-chemistry/tm-align/metadata.xml b/sci-chemistry/tm-align/metadata.xml
new file mode 100644
index 000000000000..1e724495b8e2
--- /dev/null
+++ b/sci-chemistry/tm-align/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+TM-align is a computer algorithm for protein structure alignment using dynamic
+programming and TM-score rotation matrix. An optimal alignment between two
+proteins, as well as the TM-score, will be reported for each comparison. The
+value of TM-score lies in (0,1]. In general, a comparison of TM-score smaller
+0.2 indicates that there is no similarity between two structures; a TM-score
+greater 0.5 means the structures share the same fold.
+
+What is the difference between TM-score and TM-align? The TM-score program
+is to compare two models based on their given and known residue equivalency.
+It is usually NOT applied to compare two proteins of different sequences. The
+TM-align is a structural alignment program for comparing two proteins whose
+sequences can be different. The TM-align will first find the best equivalent
+residues of two proteins based on the structure similarity and then output a
+TM-score. The TM-score values in both programs have the same definition.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/tm-align/tm-align-20140601.ebuild b/sci-chemistry/tm-align/tm-align-20140601.ebuild
new file mode 100644
index 000000000000..e7718e305db1
--- /dev/null
+++ b/sci-chemistry/tm-align/tm-align-20140601.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils flag-o-matic fortran-2
+
+DESCRIPTION="Quick & Accurate Structural Alignment"
+HOMEPAGE="http://zhanglab.ccmb.med.umich.edu/TM-align/"
+SRC_URI="http://zhanglab.ccmb.med.umich.edu/TM-align/TMtools${PV}.tar.gz"
+
+LICENSE="tm-align"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="static custom-cflags"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ cp "${FILESDIR}"/CMakeLists.txt . || die
+ use static && append-fflags -static && append-ldflags -static
+ # recommended by upstream
+ use custom-cflags || replace-flags -O* -O3 && append-fflags -ffast-math
+}
diff --git a/sci-chemistry/viewmol/Manifest b/sci-chemistry/viewmol/Manifest
new file mode 100644
index 000000000000..42b77e70d864
--- /dev/null
+++ b/sci-chemistry/viewmol/Manifest
@@ -0,0 +1 @@
+DIST viewmol-2.4.1.src.tgz 2229379 SHA256 dfed3eed6441d89c4bf2be1c13cbe263341c8880edf1742d446fc0f8f4a99e19
diff --git a/sci-chemistry/viewmol/files/2.4.1-change-default-path-to-usr.patch b/sci-chemistry/viewmol/files/2.4.1-change-default-path-to-usr.patch
new file mode 100644
index 000000000000..e5e22ffee893
--- /dev/null
+++ b/sci-chemistry/viewmol/files/2.4.1-change-default-path-to-usr.patch
@@ -0,0 +1,11 @@
+--- viewmol-2.4.1.orig/source/getrc.c 2004-10-20 05:54:35.000000000 -0700
++++ viewmol-2.4.1/source/getrc.c 2005-12-02 11:38:32.000000000 -0800
+@@ -87,7 +87,7 @@
+
+ static char viewmolpath[MAXLENLINE];
+
+-#define DEFAULTPATH "/usr/local/lib/viewmol"
++#define DEFAULTPATH "/usr/lib/viewmol"
+
+ int getrc(void)
+ {
diff --git a/sci-chemistry/viewmol/files/2.4.1-change-default-paths.patch b/sci-chemistry/viewmol/files/2.4.1-change-default-paths.patch
new file mode 100644
index 000000000000..16a3d7ef7e38
--- /dev/null
+++ b/sci-chemistry/viewmol/files/2.4.1-change-default-paths.patch
@@ -0,0 +1,68 @@
+diff --git a/source/getrc.c b/source/getrc.c
+index a39b436..c130096 100644
+--- a/source/getrc.c
++++ b/source/getrc.c
+@@ -87,7 +87,7 @@ extern XtAppContext app;
+
+ static char viewmolpath[MAXLENLINE];
+
+-#define DEFAULTPATH "/usr/local/lib/viewmol"
++#define DEFAULTPATH "@GENTOO_PORTAGE_EPREFIX@/usr/GENTOOLIBDIR/viewmol"
+
+ int getrc(void)
+ {
+diff --git a/source/install b/source/install
+index 580865b..f136af3 100755
+--- a/source/install
++++ b/source/install
+@@ -54,24 +54,27 @@ fi
+ cp $dirorig/viewmol $ROOT/bin
+ chmod 711 $ROOT/bin/viewmol
+
+-# install other files needed in $ROOT/lib/viewmol
+-if [ ! -d $ROOT/lib/viewmol/$dir ]
++# install other files needed in $ROOT/GENTOOLIBDIR/viewmol
++if [ ! -d $ROOT/GENTOOLIBDIR/viewmol/$dir ]
+ then
+- mkdir -p $ROOT/lib/viewmol/$dir
+- chmod 755 $ROOT/lib/viewmol/$dir
++ mkdir -p $ROOT/GENTOOLIBDIR/viewmol/$dir
++ chmod 755 $ROOT/GENTOOLIBDIR/viewmol/$dir
+ fi
+ cd $dirorig
+-cp tm bio readgamess readgauss readmopac readpdb $ROOT/lib/viewmol/$dir
+-chmod 711 $ROOT/lib/viewmol/$dir/*
++cp tm bio readgamess readgauss readmopac readpdb $ROOT/GENTOOLIBDIR/viewmol/$dir
++chmod 711 $ROOT/GENTOOLIBDIR/viewmol/$dir/*
+ cd ../..
+-cp readdmol readdmol.awk readgulp readpqs writecar writegauss.py writemol writetm $ROOT/lib/viewmol
+-chmod 755 $ROOT/lib/viewmol/*
+-cp -r doc examples locale scripts tests $ROOT/lib/viewmol
+-find $ROOT/lib/viewmol -type f -exec chmod a+r {} \;
+-find $ROOT/lib/viewmol -type d -exec chmod a+rx {} \;
+-sed 's/\/source//g' viewmolrc > $ROOT/lib/viewmol/viewmolrc
+-chmod -R 644 $ROOT/lib/viewmol/viewmolrc
+-if [ -d /usr/X11R6/lib/X11/app-defaults ]
++cp readdmol readdmol.awk readgulp readpqs writecar writegauss.py writemol writetm $ROOT/GENTOOLIBDIR/viewmol
++chmod 755 $ROOT/GENTOOLIBDIR/viewmol/*
++mkdir -p $ROOT/usr/share/viewmol $ROOT/usr/share/doc/GENTOODOCDIR/ $ROOT/GENTOOLIBDIR/viewmol/
++cp -r examples scripts tests $ROOT/usr/share/viewmol
++cp -r locale $ROOT/GENTOOLIBDIR/viewmol/
++cp -r doc/* examples scripts tests $ROOT/usr/share/doc/GENTOODOCDIR/
++find $ROOT/GENTOOLIBDIR/viewmol -type f -exec chmod a+r {} \;
++find $ROOT/GENTOOLIBDIR/viewmol -type d -exec chmod a+rx {} \;
++sed 's/\/source//g' viewmolrc > $ROOT/GENTOOLIBDIR/viewmol/viewmolrc
++chmod -R 644 $ROOT/GENTOOLIBDIR/viewmol/viewmolrc
++if [ -d $ROOT/X11R6/GENTOOLIBDIR/X11/app-defaults ]
+ then
+ locale=`echo $LANG | cut -c1-2`
+ if [ "$locale" = "en" ]
+@@ -82,6 +85,6 @@ then
+ # The C locale is defined by default for rpm builds, overwrite it
+ locale="en_US"
+ fi
+- cp locale/${locale}/Viewmol /usr/X11R6/lib/X11/app-defaults
+- chmod a+r /usr/X11R6/lib/X11/app-defaults/Viewmol
++ cp locale/${locale}/Viewmol ${ROOT}/X11R6/GENTOOLIBDIR/X11/app-defaults
++ chmod a+r ${ROOT}/X11R6/GENTOOLIBDIR/X11/app-defaults/Viewmol
+ fi
diff --git a/sci-chemistry/viewmol/files/2.4.1-look-for-python-in-right-place.patch b/sci-chemistry/viewmol/files/2.4.1-look-for-python-in-right-place.patch
new file mode 100644
index 000000000000..4f981a0fd1cb
--- /dev/null
+++ b/sci-chemistry/viewmol/files/2.4.1-look-for-python-in-right-place.patch
@@ -0,0 +1,20 @@
+--- viewmol-2.4.1.orig/source/getmachine 2004-08-29 08:04:09.000000000 -0700
++++ viewmol-2.4.1/source/getmachine 2005-12-02 11:19:36.000000000 -0800
+@@ -156,7 +158,7 @@
+ echo "PNGINCLUDE = $pnginclude" >> .config.$os
+
+ # Python
+- list=`find /usr -name Python.h -print 2> /dev/null`
++ list=`find /usr/include -name Python.h -print 2> /dev/null`
+ version=`(for i in $list
+ do
+ dir=\`dirname $i\`
+@@ -179,7 +181,7 @@
+ echo "PYTHONINCLUDE = $pythoninclude" >> .config.$os
+ if [ "$version" != "" ]
+ then
+- pythonlib=`dirname \`find /usr -name "lib${version}*.a" -print 2> /dev/null | grep "$version/"\``
++ pythonlib=`dirname \`find /usr/lib -name "lib${version}*.a" -print 2> /dev/null | grep "$version/"\``
+ else
+ givehint
+ echo -n "Please enter the name of the directory where the Python library can be found: "
diff --git a/sci-chemistry/viewmol/files/2.4.1-remove-icc-check.patch b/sci-chemistry/viewmol/files/2.4.1-remove-icc-check.patch
new file mode 100644
index 000000000000..c328e9cc79ab
--- /dev/null
+++ b/sci-chemistry/viewmol/files/2.4.1-remove-icc-check.patch
@@ -0,0 +1,23 @@
+diff -urN viewmol-2.4.1.orig/source/getmachine viewmol-2.4.1/source/getmachine
+--- viewmol-2.4.1.orig/source/getmachine 2004-08-29 08:04:09.000000000 -0700
++++ viewmol-2.4.1/source/getmachine 2005-12-02 09:30:49.000000000 -0800
+@@ -269,19 +269,11 @@
+ makedir
+ cat ../.config.$os > makefile
+ use_icc=`type icc 2> /dev/null`
+- if [ "$use_icc" = "" ]
+- then
+ findProcessor
+ echo 'COMPILER=gcc' >> makefile
+ echo "OPT=-O6 -mcpu=$processor -fomit-frame-pointer -ffast-math -malign-double" >> makefile
+ echo 'CFLAGS=-Wall -I/usr/X11R6/include -DLINUX -Wno-strict-aliasing' >> makefile
+ echo "LDFLAGS=$LINKFORSHARED" >> makefile
+- else
+- echo 'COMPILER=icc' >> makefile
+- echo 'OPT=-O2 -ipo' >> makefile
+- echo 'CFLAGS=-I/opt/intel/compiler50/ia32/include -I/usr/X11R6/include -DLINUX' >> makefile
+- echo "LDFLAGS=$LINKFORSHARED -ipo" >> makefile
+- fi
+ echo 'SCANDIR=' >> makefile
+ echo 'INCLUDE=$(TIFFINCLUDE) -I$(PNGINCLUDE) -I$(PYTHONINCLUDE)' >> makefile
+ echo 'LIBRARY=$(LIBTIFF) $(LIBPNG) -L$(LIBPYTHON)' >> makefile
diff --git a/sci-chemistry/viewmol/files/2.4.1-use-root-for-app-defaults.patch b/sci-chemistry/viewmol/files/2.4.1-use-root-for-app-defaults.patch
new file mode 100644
index 000000000000..c04da305c144
--- /dev/null
+++ b/sci-chemistry/viewmol/files/2.4.1-use-root-for-app-defaults.patch
@@ -0,0 +1,20 @@
+--- viewmol-2.4.1.orig/source/install 2004-10-09 08:38:31.000000000 -0700
++++ viewmol-2.4.1/source/install 2005-12-02 11:34:35.000000000 -0800
+@@ -71,7 +71,7 @@
+ find $ROOT/lib/viewmol -type d -exec chmod a+rx {} \;
+ sed 's/\/source//g' viewmolrc > $ROOT/lib/viewmol/viewmolrc
+ chmod -R 644 $ROOT/lib/viewmol/viewmolrc
+-if [ -d /usr/X11R6/lib/X11/app-defaults ]
++if [ -d $ROOT/X11R6/lib/X11/app-defaults ]
+ then
+ locale=`echo $LANG | cut -c1-2`
+ if [ "$locale" = "en" ]
+@@ -82,6 +82,6 @@
+ # The C locale is defined by default for rpm builds, overwrite it
+ locale="en_US"
+ fi
+- cp locale/${locale}/Viewmol /usr/X11R6/lib/X11/app-defaults
+- chmod a+r /usr/X11R6/lib/X11/app-defaults/Viewmol
++ cp locale/${locale}/Viewmol $ROOT/X11R6/lib/X11/app-defaults
++ chmod a+r $ROOT/X11R6/lib/X11/app-defaults/Viewmol
+ fi
diff --git a/sci-chemistry/viewmol/metadata.xml b/sci-chemistry/viewmol/metadata.xml
new file mode 100644
index 000000000000..c23d7012cd04
--- /dev/null
+++ b/sci-chemistry/viewmol/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-chemistry</herd>
+ <upstream>
+ <remote-id type="sourceforge">viewmol</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/viewmol/viewmol-2.4.1-r2.ebuild b/sci-chemistry/viewmol/viewmol-2.4.1-r2.ebuild
new file mode 100644
index 000000000000..33fcaab73c3a
--- /dev/null
+++ b/sci-chemistry/viewmol/viewmol-2.4.1-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+PYTHON_USE_WITH="tk"
+
+inherit eutils multilib prefix python toolchain-funcs
+
+DESCRIPTION="Open-source graphical front end for computational chemistry programs"
+HOMEPAGE="http://viewmol.sourceforge.net/"
+SRC_URI="mirror://sourceforge/viewmol/${P}.src.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libpng
+ media-libs/tiff
+ virtual/glu
+ virtual/opengl
+ x11-libs/libX11
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXt
+ >=x11-libs/motif-2.3:0"
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xproto"
+
+S="${WORKDIR}/${P}/source"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-remove-icc-check.patch \
+ "${FILESDIR}"/${PV}-change-default-paths.patch
+
+ eprefixify getrc.c
+ sed "s:GENTOOLIBDIR:$(get_libdir):g" \
+ -i install getrc.c || die
+ sed "s:GENTOODOCDIR:${PF}:g" -i install || die
+
+ LINKFORSHARED=$($(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')")
+
+ mkdir $(uname -s) && cd $(uname -s)
+
+ cat >> .config.$(uname -s) <<- EOF
+ LIBTIFF = -L"${EPREFIX}/usr/$(get_libdir)"
+ TIFFINCLUDE = "${EPREFIX}/usr/include"
+ LIBPNG = -L"${EPREFIX}/usr/$(get_libdir)"
+ PNGINCLUDE = "${EPREFIX}/usr/include"
+ PYTHONVERSION = $(PYTHON)
+ PYTHONINCLUDE = "${EPREFIX}/$(python_get_includedir)"
+ PYTHONLIB = "${EPREFIX}/usr/$(get_libdir)"
+ COMPILER = $(tc-getCC)
+ CFLAGS = ${CFLAGS} -DLINUX
+ LDFLAGS = ${LDFLAGS} ${LINKFORSHARED}
+ SCANDIR=
+ INCLUDE=\$(TIFFINCLUDE) -I\$(PNGINCLUDE) -I\$(PYTHONINCLUDE)
+ LIBRARY=\$(LIBTIFF) \$(LIBPNG) -L\$(LIBPYTHON)
+ LIBS=-L"${EPREFIX}/usr/$(get_libdir)" $(python_get_library -l) -ltiff -lpng -lz -lGLU -lGL -L"${EPREFIX}/usr/X11R6/lib" -lXm -lXmu -lXp -lXi -lXext -lXt -lX11 -lpthread -lutil -ldl -lm
+ EOF
+
+ cp .config.$(uname -s) makefile
+ cat ../Makefile >> makefile
+}
+
+src_compile() {
+ pushd $(uname -s)
+ emake viewmol_ tm_ bio_ readgamess_ readgauss_ readmopac_ readpdb_ || die
+ popd
+ "${EPREFIX}"/bin/bash makeTranslations || die
+}
+
+src_install() {
+ ./install "${ED}"/usr || die
+ mv "${ED}"/usr/{usr/share,} || die
+ rm -rf "${ED}"/usr/usr
+}
diff --git a/sci-chemistry/vmd/Manifest b/sci-chemistry/vmd/Manifest
new file mode 100644
index 000000000000..8f003565998f
--- /dev/null
+++ b/sci-chemistry/vmd/Manifest
@@ -0,0 +1,2 @@
+DIST vmd-1.9.2-gentoo-patches.tar.xz 14896 SHA256 91508b384cb0a8aab8d8cfc31c1e7e0bc4225dbd7cdb36fbaefcfe8baca9442c SHA512 0516b9e57b256ce822a64df420ebf3ab7391722757caeaa7e615526242043e9375fee8f4ee86fb4eb8de7a50d5cfc8f8d973ace5fa082e6f9010eb692cd6ee51 WHIRLPOOL 3f87d24ad0ca7eb60e0ae3d561da7c61e0caa9fe8bb71cd3a06731228926d4c16ee03699d80adf02e2c9b263f96ea8d5b096e64e3e94b0208b1cb618c8a8a7ca
+DIST vmd-1.9.2.src.tar.gz 34903084 SHA256 870ee1e483ad23eb7f3bb6ac816cb7be5df893879dddc0bda8423a011993ccdb SHA512 b232b743d4ea97dcf76e3005e1c8716d7138602edc078c4846026ab67759c8559af956182cb1acf3c85890db10b6f658ac9c269d432f2595612cf376d6d505ef WHIRLPOOL e2489b4bd8f28359ee959d6ebec3a9e775fbaf7a25baa1324c99dd04c7768e002924c671c11830ec6e9589ecc9de4864f2bcf3dfaf9eb36f5a1d03d5e5841f17
diff --git a/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch b/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch
new file mode 100644
index 000000000000..ce842448decf
--- /dev/null
+++ b/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch
@@ -0,0 +1,28 @@
+ vmd-1.9.1/src/CUDAMarchingCubes.cu | 1 +
+ vmd-1.9.1/src/CUDAQuickSurf.cu | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/vmd-1.9.1/src/CUDAMarchingCubes.cu b/vmd-1.9.1/src/CUDAMarchingCubes.cu
+index 5bfe7bf..36faaf0 100755
+--- a/vmd-1.9.1/src/CUDAMarchingCubes.cu
++++ b/vmd-1.9.1/src/CUDAMarchingCubes.cu
+@@ -45,6 +45,7 @@
+ #include "CUDAMarchingCubes.h"
+ #include <thrust/scan.h>
+ #include <thrust/functional.h>
++#include <thrust/device_ptr.h>
+
+ // The number of threads to use for triangle generation
+ // (limited by shared memory size)
+diff --git a/vmd-1.9.1/src/CUDAQuickSurf.cu b/vmd-1.9.1/src/CUDAQuickSurf.cu
+index a21ebde..56a42c8 100755
+--- a/vmd-1.9.1/src/CUDAQuickSurf.cu
++++ b/vmd-1.9.1/src/CUDAQuickSurf.cu
+@@ -22,6 +22,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <cuda.h>
++#include <thrust/device_ptr.h>
+
+ #if CUDART_VERSION < 4000
+ #error The VMD QuickSurf feature requires CUDA 4.0 or later
diff --git a/sci-chemistry/vmd/files/vmd-1.9.1-tcl8.6.patch b/sci-chemistry/vmd/files/vmd-1.9.1-tcl8.6.patch
new file mode 100644
index 000000000000..0c3e45dd39c3
--- /dev/null
+++ b/sci-chemistry/vmd/files/vmd-1.9.1-tcl8.6.patch
@@ -0,0 +1,25 @@
+ plugins/molfile_plugin/src/webpdbplugin.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/molfile_plugin/src/webpdbplugin.c b/plugins/molfile_plugin/src/webpdbplugin.c
+index 80b3bb9..78597f5 100644
+--- a/plugins/molfile_plugin/src/webpdbplugin.c
++++ b/plugins/molfile_plugin/src/webpdbplugin.c
+@@ -202,7 +202,7 @@ static void *open_file_read(const char *filename, const char *filetype,
+ sprintf(url, "http://www.rcsb.org/pdb/downloadFile.do?fileFormat=pdb&compression=NO&structureId=%s",filename);
+ sprintf(cmd, "set token [::http::geturl \"%s\"]", url);
+ if (Tcl_Eval(interp, cmd) != TCL_OK) {
+- fprintf(stderr, "Error loading PDB: %s\n",interp->result);
++ fprintf(stderr, "Error loading PDB: %s\n",Tcl_GetStringResult(interp));
+ Tcl_DeleteInterp(interp);
+ return NULL;
+ }
+@@ -211,7 +211,7 @@ static void *open_file_read(const char *filename, const char *filetype,
+
+ result = Tcl_GetVar2(interp, (char *)"state", "body", TCL_GLOBAL_ONLY);
+ if (!result) {
+- fprintf(stderr, "Error loading PDB: %s\n", interp->result);
++ fprintf(stderr, "Error loading PDB: %s\n", Tcl_GetStringResult(interp));
+ Tcl_DeleteInterp(interp);
+ return NULL;
+ }
diff --git a/sci-chemistry/vmd/files/vmd-1.9.2-format-security.patch b/sci-chemistry/vmd/files/vmd-1.9.2-format-security.patch
new file mode 100644
index 000000000000..3f9ea5c8c2ef
--- /dev/null
+++ b/sci-chemistry/vmd/files/vmd-1.9.2-format-security.patch
@@ -0,0 +1,16 @@
+ plugins/molfile_plugin/src/maeffplugin.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/molfile_plugin/src/maeffplugin.cxx b/plugins/molfile_plugin/src/maeffplugin.cxx
+index cfe1223..41d92bb 100644
+--- a/plugins/molfile_plugin/src/maeffplugin.cxx
++++ b/plugins/molfile_plugin/src/maeffplugin.cxx
+@@ -1979,7 +1979,7 @@ namespace {
+ }
+ }
+ catch (std::exception &e) {
+- fprintf(stderr, e.what());
++ fprintf(stderr, "%s", e.what());
+ return MOLFILE_ERROR;
+ }
+ return MOLFILE_SUCCESS;
diff --git a/sci-chemistry/vmd/metadata.xml b/sci-chemistry/vmd/metadata.xml
new file mode 100644
index 000000000000..4b17d8d6b913
--- /dev/null
+++ b/sci-chemistry/vmd/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>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+ <herd>sci-chemistry</herd>
+ <use>
+ <flag name="cuda">Use nvidia cuda toolkit for speeding up computations</flag>
+ <flag name="gromacs">Add support for TNG file format</flag>
+ <flag name="msms">Add support for MSMS SAS calcualtion tool</flag>
+ <flag name="povray">Add support for povray raytracer for HQ images</flag>
+ <flag name="tachyon">Add support for tachyon raytracer for HQ images</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/vmd/vmd-1.9.2.ebuild b/sci-chemistry/vmd/vmd-1.9.2.ebuild
new file mode 100644
index 000000000000..78e084df58ea
--- /dev/null
+++ b/sci-chemistry/vmd/vmd-1.9.2.ebuild
@@ -0,0 +1,250 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cuda eutils flag-o-matic multilib prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="Visual Molecular Dynamics"
+HOMEPAGE="http://www.ks.uiuc.edu/Research/vmd/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/${P}-gentoo-patches.tar.xz
+ ${P}.src.tar.gz"
+
+SLOT="0"
+LICENSE="vmd"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cuda gromacs msms povray sqlite tachyon xinerama"
+
+RESTRICT="fetch"
+
+# currently, tk-8.5* with USE=truetype breaks some
+# tk apps such as Sequence Viewer or Timeline.
+CDEPEND="
+ >=dev-lang/tk-8.6.1
+ dev-lang/perl
+ dev-libs/expat
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-libs/netcdf
+ virtual/opengl
+ >=x11-libs/fltk-1.1.10-r2:1
+ x11-libs/libXft
+ x11-libs/libXi
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1:= )
+ gromacs? ( >=sci-chemistry/gromacs-5.0.4-r1[tng] )
+ sqlite? ( dev-db/sqlite:3= )
+ tachyon? ( >=media-gfx/tachyon-0.99_beta6 )
+ xinerama? ( x11-libs/libXinerama )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ dev-lang/swig"
+RDEPEND="${CDEPEND}
+ sci-biology/stride
+ sci-chemistry/surf
+ x11-terms/xterm
+ msms? ( sci-chemistry/msms-bin )
+ povray? ( media-gfx/povray )
+ "
+
+VMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD"
+# Binary only plugin!!
+QA_PREBUILT="usr/lib*/vmd/plugins/LINUX/tcl/intersurf1.1/bin/intersurf.so"
+QA_FLAGS_IGNORED_amd64=" usr/lib64/vmd/plugins/LINUX/tcl/volutil1.3/volutil"
+QA_FLAGS_IGNORED_x86=" usr/lib/vmd/plugins/LINUX/tcl/volutil1.3/volutil"
+
+pkg_nofetch() {
+ elog "Please download ${P}.src.tar.gz from"
+ elog "${VMD_DOWNLOAD}"
+ elog "after agreeing to the license and get"
+ elog "http://dev.gentoo.org/~jlec/distfiles/${P}-gentoo-patches.tar.xz"
+ elog "Place both in ${DISTDIR}"
+}
+
+src_prepare() {
+ use cuda && cuda_sanitize
+
+ epatch "${FILESDIR}"/${PN}-1.9.1-cuda-device_ptr.patch
+
+ cd "${WORKDIR}"/plugins || die
+
+ epatch \
+ "${WORKDIR}"/${P}-gentoo-plugins.patch \
+ "${FILESDIR}"/${P}-format-security.patch
+
+ [[ ${SILENT} == yes ]] || sed '/^.SILENT/d' -i $(find -name Makefile)
+
+ sed \
+ -e "s:CC = gcc:CC = $(tc-getCC):" \
+ -e "s:CXX = g++:CXX = $(tc-getCXX):" \
+ -e "s:COPTO =.*\":COPTO = -fPIC -o \":" \
+ -e "s:LOPTO = .*\":LOPTO = ${LDFLAGS} -fPIC -o \":" \
+ -e "s:CCFLAGS =.*\":CCFLAGS = ${CFLAGS}\":" \
+ -e "s:CXXFLAGS =.*\":CXXFLAGS = ${CXXFLAGS}\":" \
+ -e "s:SHLD = gcc:SHLD = $(tc-getCC) -shared:" \
+ -e "s:SHXXLD = g++:SHXXLD = $(tc-getCXX) -shared:" \
+ -e "s:-ltcl8.5:-ltcl:" \
+ -i Make-arch || die "Failed to set up plugins Makefile"
+
+ sed \
+ -e '/^AR /s:=:?=:g' \
+ -e '/^RANLIB /s:=:?=:g' \
+ -i ../plugins/*/Makefile || die
+
+ tc-export AR RANLIB
+
+ sed \
+ -e "s:\$(CXXFLAGS)::g" \
+ -i hesstrans/Makefile || die
+
+ # prepare vmd itself
+ cd "${S}" || die
+
+ epatch "${WORKDIR}"/${P}-gentoo-base.patch
+
+ # PREFIX
+ sed \
+ -e "s:/usr/include/:${EPREFIX}/usr/include:g" \
+ -i configure || die
+
+ sed \
+ -e "s:gentoo-bindir:${ED}/usr/bin:g" \
+ -e "s:gentoo-libdir:${ED}/usr/$(get_libdir):g" \
+ -e "s:gentoo-opengl-include:${EPREFIX}/usr/include/GL:g" \
+ -e "s:gentoo-opengl-libs:${EPREFIX}/usr/$(get_libdir):g" \
+ -e "s:gentoo-gcc:$(tc-getCC):g" \
+ -e "s:gentoo-g++:$(tc-getCXX):g" \
+ -e "s:gentoo-nvcc:${EPREFIX}/opt/cuda/bin/nvcc:g" \
+ -e "s:gentoo-cflags:${CFLAGS}:g" \
+ -e "s:gentoo-cxxflags:${CXXFLAGS}:g" \
+ -e "s:gentoo-nvflags::g" \
+ -e "s:gentoo-ldflags:${LDFLAGS}:g" \
+ -e "s:gentoo-plugindir:${WORKDIR}/plugins:g" \
+ -e "s:gentoo-fltk-include:$(fltk-config --includedir):g" \
+ -e "s:gentoo-fltk-libs:$(dirname $(fltk-config --libs)) -Wl,-rpath,$(dirname $(fltk-config --libs)):g" \
+ -e "s:gentoo-netcdf-include:${EPREFIX}/usr/include:g" \
+ -e "s:gentoo-netcdf-libs:${EPREFIX}/usr/$(get_libdir):g" \
+ -i configure || die
+
+ if use cuda; then
+ sed \
+ -e "s:gentoo-cuda-lib:${EPREFIX}/opt/cuda/$(get_libdir):g" \
+ -e "/NVCCFLAGS/s:=:= ${NVCCFLAGS}:g" \
+ -i configure src/Makefile || die
+ sed \
+ -e '/compute_/d' \
+ -i configure || die
+ sed \
+ -e 's:-gencode .*code=sm_..::' \
+ -i src/Makefile || die
+ fi
+
+ sed \
+ -e "s:LINUXPPC:LINUX:g" \
+ -e "s:LINUXALPHA:LINUX:g" \
+ -e "s:LINUXAMD64:LINUX:g" \
+ -e "s:gentoo-stride:${EPREFIX}/usr/bin/stride:g" \
+ -e "s:gentoo-surf:${EPREFIX}/usr/bin/surf:g" \
+ -e "s:gentoo-tachyon:${EPREFIX}/usr/bin/tachyon:g" \
+ -i "${S}"/bin/vmd.sh || die "failed setting up vmd wrapper script"
+
+ EMAKEOPTS=(
+ TCLINC="-I${EPREFIX}/usr/include"
+ TCLLIB="-L${EPREFIX}/usr/$(get_libdir)"
+ TCLLDFLAGS="-shared"
+ NETCDFLIB="$($(tc-getPKG_CONFIG) --libs-only-L netcdf) ${EPREFIX}/usr/$(get_libdir)/libnetcdf.so"
+ NETCDFINC="$($(tc-getPKG_CONFIG) --cflags-only-I netcdf) ${EPREFIX}/usr/include"
+ NETCDFLDFLAGS="$($(tc-getPKG_CONFIG) --libs netcdf)"
+ NETCDFDYNAMIC=1
+ EXPATINC="-I${EPREFIX}/usr/include"
+ EXPATLIB="$($(tc-getPKG_CONFIG) --libs expat)"
+ EXPATLDFLAGS="-shared"
+ EXPATDYNAMIC=1
+ )
+ if use gromacs; then
+ EMAKEOPTS+=(
+ TNGLIB="$($(tc-getPKG_CONFIG) --libs libgromacs)"
+ TNGINC="-I${EPREFIX}/usr/include"
+ TNGLDFLAGS="-shared"
+ TNGDYNAMIC=1
+ )
+ fi
+ if use sqlite; then
+ EMAKEOPTS+=(
+ SQLITELIB="$($(tc-getPKG_CONFIG) --libs sqlite3)"
+ SQLITEINC="-I${EPREFIX}/usr/include"
+ SQLITELDFLAGS="-shared"
+ SQLITEDYNAMIC=1
+ )
+ fi
+}
+
+src_configure() {
+ local myconf="OPENGL OPENGLPBUFFER COLVARS FLTK TK TCL PTHREADS PYTHON IMD NETCDF NUMPY NOSILENT XINPUT"
+ rm -f configure.options && echo $myconf >> configure.options
+
+ use cuda && myconf+=" CUDA"
+# use mpi && myconf+=" MPI"
+ use tachyon && myconf+=" LIBTACHYON" && append-cflags -I"${EPREFIX}/usr/include/tachyon"
+ use xinerama && myconf+=" XINERAMA"
+
+ export \
+ PYTHON_INCLUDE_DIR="$(python_get_includedir)" \
+ PYTHON_LIBRARY_DIR="$(python_get_library_path)" \
+ PYTHON_LIBRARY="$(python_get_LIBS)" \
+ NUMPY_INCLUDE_DIR="$(python_get_sitedir)/numpy/core/include" \
+ NUMPY_LIBRARY_DIR="$(python_get_sitedir)/numpy/core/include"
+
+ perl ./configure LINUX \
+ ${myconf} || die
+}
+
+src_compile() {
+ # build plugins
+ cd "${WORKDIR}"/plugins || die
+
+ emake \
+ ${EMAKEOPTS[@]} \
+ LINUX
+
+ # build vmd
+ cd "${S}"/src || die
+ emake
+}
+
+src_install() {
+ # install plugins
+ cd "${WORKDIR}"/plugins || die
+ emake \
+ PLUGINDIR="${ED}/usr/$(get_libdir)/${PN}/plugins" \
+ distrib
+
+ # install vmd
+ cd "${S}"/src || die
+ emake install
+
+ # install docs
+ cd "${S}" || die
+ dodoc Announcement README doc/ig.pdf doc/ug.pdf
+
+ # remove some of the things we don't want and need in
+ # /usr/lib
+ cd "${ED}"/usr/$(get_libdir)/vmd || die
+ rm -fr doc README Announcement LICENSE || \
+ die "failed to clean up /usr/lib/vmd directory"
+
+ # adjust path in vmd wrapper
+ sed \
+ -e "s:${ED}::" -i "${ED}"/usr/bin/${PN} \
+ -e "/^defaultvmddir/s:^.*$:defaultvmddir=\"${EPREFIX}/usr/$(get_libdir)/${PN}\":g" \
+ || die "failed to set up vmd wrapper script"
+
+ # install icon and generate desktop entry
+ insinto /usr/share/pixmaps
+ doins "${WORKDIR}"/vmd.png
+ eprefixify "${WORKDIR}"/vmd.desktop
+ sed -i '/^Path/d' "${WORKDIR}"/vmd.desktop || die
+ domenu "${WORKDIR}"/vmd.desktop
+}
diff --git a/sci-chemistry/votca-csg/Manifest b/sci-chemistry/votca-csg/Manifest
new file mode 100644
index 000000000000..703d4fb187ad
--- /dev/null
+++ b/sci-chemistry/votca-csg/Manifest
@@ -0,0 +1,6 @@
+DIST votca-csg-1.2.2.tar.gz 188405 SHA256 9974c30b8c3f2b9bbdfa56ca12e981cfd015fa7c557eec30cd11ee11cb167775
+DIST votca-csg-1.2.4.tar.gz 188345 SHA256 375b428c90247a3877f71c2d96200969bcaf2b081b8c7332ac770720df43646a SHA512 da814154be6700b56509d899ea16a2f974fd951792c78f2f8717b39b0165fe19121fefb2ef9531c63a8d4558d15776058d24b13e0e7ad0abb9d7b11fac0f5d1a WHIRLPOOL 64a86b09ae00435c68bf09e960c1d1738648811fe2a9ffb18f5529d30d6f94ebf1fc218b14e1ee0bfc911e5ca1e92c25404be045cf28e16ced98fd7ee4421418
+DIST votca-csg-manual-1.2.2.pdf 1009336 SHA256 c9760e3d46afbcd8e2bb44937a9680f68d53e86a36bba1513b4612c4c588d8b5
+DIST votca-csg-manual-1.2.4.pdf 1029132 SHA256 78a68955c96700d432249f712e0601376d5d61fef607860fe32d0ce0dcb70cff SHA512 66b7cf869b2b06d4133b341934fd013717b17c90426f4cdf637ef3bb6119e9f6b67cbde56b7f6b6c777dba9fb311df42dd34d8fe23331f1656439acb541d81bf WHIRLPOOL 629e0e6a8900bb7e4a96b7e1020f86ccacd5a7e7258a493d565c94986a0907371a37d45bf499517a74ad29cf2b606965746e0d90b6be91777f2b0a85f2781732
+DIST votca-csg-tutorials-1.2.2.tar.gz 3576523 SHA256 456a8317fff5770a5ebd6452673eefeaa455534b87a800cfbd4672248670f9bd
+DIST votca-csg-tutorials-1.2.4.tar.gz 3721034 SHA256 94b10f23f6e49c1279cdeea87dfee9c19b44373c74212340acebc06eb11e0245 SHA512 8d78a6ff02aedf97c2b640714fd7acfb7c4b0d03ec0141fa89f0ba041e1d2ec07477653d92effd4c96a6497271ad58f5c3397e1fc183c1c856285f6f8b5ceaf5 WHIRLPOOL ea0df816d2f26f12271250137b51f42ecc4a16eea622d37833d4dcc299732c413ee9f71a67767957b13ce8b44a96e9b1389bbbbdb66015c4b5c6d577d4483cf1
diff --git a/sci-chemistry/votca-csg/metadata.xml b/sci-chemistry/votca-csg/metadata.xml
new file mode 100644
index 000000000000..a7bc0762f8d6
--- /dev/null
+++ b/sci-chemistry/votca-csg/metadata.xml
@@ -0,0 +1,17 @@
+<?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='gromacs'>Add support for gromacs file formats through <pkg>sci-chemistry/gromacs</pkg></flag>
+ <flag name='system-boost'>Use system boost (<pkg>dev-libs/boost</pkg>) instead of bundled one</flag>
+ <flag name='extras'>Pull in extra applications from <pkg>sci-chemistry/votca-csg-apps</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">votca</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/votca-csg/votca-csg-1.2.2.ebuild b/sci-chemistry/votca-csg/votca-csg-1.2.2.ebuild
new file mode 100644
index 000000000000..dc44ee04e33f
--- /dev/null
+++ b/sci-chemistry/votca-csg/votca-csg-1.2.2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit bash-completion-r1 cmake-utils multilib
+
+IUSE="doc examples extras +gromacs +system-boost"
+PDEPEND="extras? ( =sci-chemistry/votca-csgapps-${PV} )"
+if [ "${PV}" != "9999" ]; then
+ SRC_URI="http://votca.googlecode.com/files/${PF}.tar.gz
+ doc? ( http://votca.googlecode.com/files/${PN}-manual-${PV}.pdf )
+ examples? ( http://votca.googlecode.com/files/${PN}-tutorials-${PV}.tar.gz )"
+ RESTRICT="primaryuri"
+else
+ SRC_URI=""
+ inherit mercurial
+ EHG_REPO_URI="https://csg.votca.googlecode.com/hg"
+ PDEPEND="${PDEPEND} doc? ( =app-doc/${PN}-manual-${PV} )
+ examples? ( =sci-chemistry/${PN}-tutorials-${PV} )"
+fi
+
+DESCRIPTION="Votca coarse-graining engine"
+HOMEPAGE="http://www.votca.org"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-macos"
+
+RDEPEND="=sci-libs/votca-tools-${PV}[system-boost=]
+ gromacs? ( sci-chemistry/gromacs )
+ dev-lang/perl
+ app-shells/bash"
+
+DEPEND="${RDEPEND}
+ doc? ( || ( <app-doc/doxygen-1.7.6.1[-nodot] >=app-doc/doxygen-1.7.6.1[dot] ) )
+ >=app-text/txt2tags-2.5
+ virtual/pkgconfig"
+
+src_configure() {
+ local extra="-DWITH_GMX_DEVEL=OFF"
+
+ use gromacs && has_version =sci-chemistry/gromacs-9999 && \
+ extra="-DWITH_GMX_DEVEL=ON"
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ mycmakeargs=(
+ $(cmake-utils_use system-boost EXTERNAL_BOOST)
+ $(cmake-utils_use_with gromacs GMX)
+ ${extra}
+ -DWITH_RC_FILES=OFF
+ -DLIB=$(get_libdir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ DOCS=(README NOTICE ${CMAKE_BUILD_DIR}/CHANGELOG)
+ newbashcomp scripts/csg-completion.bash ${PN}
+ cmake-utils_src_install
+ if use doc; then
+ if [ -n "${PV##*9999}" ]; then
+ dodoc "${DISTDIR}/${PN}-manual-${PV}.pdf"
+ fi
+ cd "${CMAKE_BUILD_DIR}" || die
+ cd share/doc || die
+ doxygen || die
+ dohtml -r html/*
+ fi
+ if use examples && [ -n "${PV##*9999}" ]; then
+ insinto "/usr/share/doc/${PF}/tutorials"
+ docompress -x "/usr/share/doc/${PF}/tutorials"
+ doins -r "${WORKDIR}/${PN}-tutorials-${PV}"/*
+ fi
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "VOTCA, J. Chem. Theory Comput. 5, 3211 (2009). "
+ einfo "http://dx.doi.org/10.1021/ct900369w"
+ einfo
+}
diff --git a/sci-chemistry/votca-csg/votca-csg-1.2.4-r1.ebuild b/sci-chemistry/votca-csg/votca-csg-1.2.4-r1.ebuild
new file mode 100644
index 000000000000..fc2e6d6fe639
--- /dev/null
+++ b/sci-chemistry/votca-csg/votca-csg-1.2.4-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 cmake-utils multilib
+
+IUSE="doc examples extras +gromacs"
+PDEPEND="extras? ( =sci-chemistry/votca-csgapps-${PV} )"
+if [ "${PV}" != "9999" ]; then
+ SRC_URI="http://downloads.votca.googlecode.com/hg/${P}.tar.gz
+ doc? ( http://downloads.votca.googlecode.com/hg/${PN}-manual-${PV}.pdf )
+ examples? ( http://downloads.votca.googlecode.com/hg/${PN}-tutorials-${PV}.tar.gz )"
+else
+ SRC_URI=""
+ inherit mercurial
+ EHG_REPO_URI="https://csg.votca.googlecode.com/hg"
+ PDEPEND="${PDEPEND} doc? ( =app-doc/${PN}-manual-${PV} )
+ examples? ( =sci-chemistry/${PN}-tutorials-${PV} )"
+fi
+
+DESCRIPTION="Votca coarse-graining engine"
+HOMEPAGE="http://www.votca.org"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-macos"
+
+#perl is only used for scripts
+RDEPEND="~sci-libs/votca-tools-${PV}
+ gromacs? ( sci-chemistry/gromacs:= )
+ dev-lang/perl
+ app-shells/bash"
+
+DEPEND="${RDEPEND}
+ doc? ( || ( <app-doc/doxygen-1.7.6.1[-nodot] >=app-doc/doxygen-1.7.6.1[dot] ) )
+ >=app-text/txt2tags-2.5
+ virtual/pkgconfig"
+
+DOCS=(README NOTICE ChangeLog)
+
+src_configure() {
+ local GMX_DEV="OFF" GMX_DOUBLE="OFF" extra
+
+ if use gromacs; then
+ has_version ">=sci-chemistry/gromacs-5" && GMX_DEV="ON"
+ has_version sci-chemistry/gromacs[double-precision] && GMX_DOUBLE="ON"
+ fi
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ mycmakeargs=(
+ $(cmake-utils_use_with gromacs GMX)
+ -DWITH_GMX_DEVEL="${GMX_DEV}"
+ -DGMX_DOUBLE="${GMX_DOUBLE}"
+ ${extra}
+ -DWITH_RC_FILES=OFF
+ -DEXTERNAL_BOOST=ON
+ -DLIB=$(get_libdir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newbashcomp scripts/csg-completion.bash csg_call
+ for i in "${ED}"/usr/bin/csg_*; do
+ [[ ${i} = *csg_call ]] && continue
+ bashcomp_alias csg_call "${i##*/}"
+ done
+ if use doc; then
+ if [ -n "${PV##*9999}" ]; then
+ dodoc "${DISTDIR}/${PN}-manual-${PV}.pdf"
+ fi
+ cd "${CMAKE_BUILD_DIR}" || die
+ cd share/doc || die
+ doxygen || die
+ dohtml -r html/*
+ fi
+ if use examples && [ -n "${PV##*9999}" ]; then
+ insinto "/usr/share/doc/${PF}/tutorials"
+ docompress -x "/usr/share/doc/${PF}/tutorials"
+ doins -r "${WORKDIR}/${PN}-tutorials-${PV}"/*
+ fi
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite:"
+ einfo "VOTCA, J. Chem. Theory Comput. 5, 3211 (2009). "
+ einfo "http://dx.doi.org/10.1021/ct900369w"
+ einfo
+}
diff --git a/sci-chemistry/votca-csgapps/Manifest b/sci-chemistry/votca-csgapps/Manifest
new file mode 100644
index 000000000000..86c4abee696e
--- /dev/null
+++ b/sci-chemistry/votca-csgapps/Manifest
@@ -0,0 +1,2 @@
+DIST votca-csgapps-1.2.2.tar.gz 8196 SHA256 09f0669627360dc0a0837899d980d877d8a58231b76919a6273c31fe0f7c341b
+DIST votca-csgapps-1.2.4.tar.gz 10231 SHA256 f0b0e5ad059bd93df514656b6ba65943a7cb35fcf344f75ca4d2ef4e713f4708 SHA512 e52b1e5b8cd552a6a73e16e0a657c16611bc80de9e12ab4e696aa3c30f31c6f52311320862b71d4d082b3f6c0a816001f4c2fd78915ada3a440235feb3ded3ef WHIRLPOOL 43284ddd65f98727374f5eaa2e1a5c9742cc26bed3b68534084623a3afec09a03f982d07615ca0fcd532302b09c90611a7f6859aa89bc009e81e732b85fcb35c
diff --git a/sci-chemistry/votca-csgapps/files/votca-csgapps-1.2.2-dso.patch b/sci-chemistry/votca-csgapps/files/votca-csgapps-1.2.2-dso.patch
new file mode 100644
index 000000000000..eeec55d4e8e6
--- /dev/null
+++ b/sci-chemistry/votca-csgapps/files/votca-csgapps-1.2.2-dso.patch
@@ -0,0 +1,266 @@
+# HG changeset patch
+# User Christoph Junghans <junghans@votca.org>
+# Date 1326307444 25200
+# Branch stable
+# Node ID 475999c2cd0d19f739e83c88b2df823c32730bc1
+# Parent 7e8f291a6d79da1ebbc512c370b8620714be0cb6
+cmake: make it DSO conform
+
+diff -r 7e8f291a6d79 -r 475999c2cd0d CMakeLists.txt
+--- a/CMakeLists.txt Tue Jan 10 20:16:55 2012 -0700
++++ b/CMakeLists.txt Wed Jan 11 11:44:04 2012 -0700
+@@ -4,9 +4,42 @@
+
+ project(csgapps)
+
+-file(GLOB_RECURSE DIRS */CMakeLists.txt)
++set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
++
++if(NOT CMAKE_BUILD_TYPE)
++ #Release comes with -O3 by default
++ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
++endif(NOT CMAKE_BUILD_TYPE)
++
++enable_language(CXX)
++include(CheckCXXCompilerFlag)
++
++option(EXTERNAL_BOOST "Use external boost" ON)
++if (EXTERNAL_BOOST)
++ find_package(Boost 1.39.0 COMPONENTS program_options )
++ if(NOT Boost_FOUND)
++ message(FATAL_ERROR "Boost not found, make sure you have also installed boost and it's dev package or use our internal replacement, if you have built tools with -DEXTERNAL_BOOST=OFF and set it here as well")
++ endif(NOT Boost_FOUND)
++ include_directories(${Boost_INCLUDE_DIRS})
++ set (BOOST_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY})
++else(EXTERNAL_BOOST)
++ find_package(VOTCA_BOOST REQUIRED)
++ include_directories(${VOTCA_BOOST_INCLUDE_DIRS})
++ set (BOOST_LIBRARIES ${VOTCA_BOOST_LIBRARIES})
++endif(EXTERNAL_BOOST)
++
++find_package(VOTCA_TOOLS REQUIRED)
++include_directories(${VOTCA_TOOLS_INCLUDE_DIRS})
++find_package(VOTCA_CSG REQUIRED)
++include_directories(${VOTCA_CSG_INCLUDE_DIRS})
++
++file(GLOB_RECURSE DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} */CMakeLists.txt)
+ foreach(DIR ${DIRS})
+- string(REGEX MATCH ^.*/ DIR ${DIR})
+- add_subdirectory(${DIR})
+- unset(NAME CACHE)
++ string(REGEX MATCH ^[^/]* DIR ${DIR})
++ file(GLOB SRC ${DIR}/*.cc)
++ add_executable(${DIR} ${SRC})
++ target_link_libraries(${DIR} ${VOTCA_CSG_LIBRARIES} ${VOTCA_TOOLS_LIBRARIES} ${BOOST_LIBRARIES})
++ install(TARGETS ${DIR} RUNTIME DESTINATION bin)
++ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${DIR})
++ set_target_properties(${DIR} PROPERTIES OUTPUT_NAME ${DIR}/csg_${DIR})
+ endforeach(DIR)
+diff -r 7e8f291a6d79 -r 475999c2cd0d CMakeModules/FindSQLITE3.cmake
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/CMakeModules/FindSQLITE3.cmake Wed Jan 11 11:44:04 2012 -0700
+@@ -0,0 +1,36 @@
++# - Find libgmx
++# Find the native libgmx headers and libraries.
++#
++# SQLITE3_INCLUDE_DIRS - where to find sqlite3.h, etc
++# SQLITE3_LIBRARIES - List of libraries when using sqlite3.
++# SQLITE3_FOUND - True if sqlite3 found.
++#
++# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++
++find_package(PkgConfig)
++
++pkg_check_modules(PC_SQLITE3 sqlite3)
++
++find_path(SQLITE3_INCLUDE_DIR sqlite3.h HINTS ${PC_SQLITE3_INCLUDE_DIRS})
++find_library(SQLITE3_LIBRARY NAMES sqlite3 HINTS ${PC_SQLITE3_LIBRARY_DIRS} )
++
++set(SQLITE3_LIBRARIES "${SQLITE3_LIBRARY}" )
++set(SQLITE3_INCLUDE_DIRS "${SQLITE3_INCLUDE_DIR}" )
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR )
++
++mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY )
+diff -r 7e8f291a6d79 -r 475999c2cd0d CMakeModules/FindVOTCA_BOOST.cmake
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/CMakeModules/FindVOTCA_BOOST.cmake Wed Jan 11 11:44:04 2012 -0700
+@@ -0,0 +1,37 @@
++# - Find libvotca_boost
++# Find the native libvotca_boost headers and libraries.
++#
++# VOTCA_BOOST_INCLUDE_DIRS - where to find headers etc.
++# VOTCA_BOOST_LIBRARIES - List of libraries when using expat.
++# VOTCA_BOOST_FOUND - True if expat found.
++#
++# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++
++find_package(PkgConfig)
++
++pkg_check_modules(PC_VOTCA_BOOST libvotca_boost)
++find_path(VOTCA_BOOST_INCLUDE_DIR boost/algorithm/string/trim.hpp HINTS ${PC_VOTCA_BOOST_INCLUDE_DIRS} )
++find_library(VOTCA_BOOST_LIBRARY NAMES votca_boost HINTS ${PC_VOTCA_BOOST_LIBRARY_DIRS} )
++
++set(VOTCA_BOOST_LIBRARIES "${VOTCA_BOOST_LIBRARY}" )
++set(VOTCA_BOOST_INCLUDE_DIRS "${VOTCA_BOOST_INCLUDE_DIR}" )
++
++include(FindPackageHandleStandardArgs)
++# handle the QUIETLY and REQUIRED arguments and set VOTCA_BOOST_FOUND to TRUE
++# if all listed variables are TRUE
++find_package_handle_standard_args(VOTCA_BOOST DEFAULT_MSG VOTCA_BOOST_LIBRARY VOTCA_BOOST_INCLUDE_DIR)
++
++mark_as_advanced(VOTCA_BOOST_INCLUDE_DIR VOTCA_BOOST_LIBRARY )
+diff -r 7e8f291a6d79 -r 475999c2cd0d CMakeModules/FindVOTCA_CSG.cmake
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/CMakeModules/FindVOTCA_CSG.cmake Wed Jan 11 11:44:04 2012 -0700
+@@ -0,0 +1,51 @@
++# - Find libvotca_csg
++# Find the native libvotca_csg headers and libraries.
++#
++# VOTCA_CSG_INCLUDE_DIRS - where to find votca/csg/version.h, etc.
++# VOTCA_CSG_LIBRARIES - List of libraries when using expat.
++# VOTCA_CSG_FOUND - True if expat found.
++# VOTCA_CSG_HAS_SQLITE3 - True if votca csg was build with sqlite3 support
++#
++# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++
++find_package(PkgConfig)
++
++pkg_check_modules(PC_VOTCA_CSG libvotca_csg)
++find_path(VOTCA_CSG_INCLUDE_DIR votca/csg/version.h HINTS ${PC_VOTCA_CSG_INCLUDE_DIRS})
++
++find_library(VOTCA_CSG_LIBRARY NAMES votca_csg HINTS ${PC_VOTCA_CSG_LIBRARY_DIRS} )
++
++if("${VOTCA_CSG_LIBRARY}" MATCHES "libvotca_csg[^;]*\\.a")
++ if(PC_VOTCA_CSG_LIBRARIES)
++ list(REMOVE_ITEM PC_VOTCA_CSG_LIBRARIES votca_csg)
++ foreach (LIB ${PC_VOTCA_CSG_LIBRARIES})
++ find_library(VOTCA_CSG_${LIB} NAMES ${LIB} HINTS ${PC_VOTCA_CSG_LIBRARY_DIRS} )
++ list(APPEND VT_DEP_LIBRARIES ${VOTCA_CSG_${LIB}})
++ unset(VOTCA_CSG_${LIB} CACHE)
++ endforeach(LIB)
++ endif(PC_VOTCA_CSG_LIBRARIES)
++ set(VOTCA_CSG_DEP_LIBRARIES "${VT_DEP_LIBRARIES}" CACHE FILEPATH "votca csg depency libs (only needed for static (.a) libvotca_csg")
++endif("${VOTCA_CSG_LIBRARY}" MATCHES "libvotca_csg[^;]*\\.a")
++
++set(VOTCA_CSG_LIBRARIES "${VOTCA_CSG_LIBRARY};${VOTCA_CSG_DEP_LIBRARIES}" )
++set(VOTCA_CSG_INCLUDE_DIRS "${VOTCA_CSG_INCLUDE_DIR}" )
++
++include(FindPackageHandleStandardArgs)
++# handle the QUIETLY and REQUIRED arguments and set VOTCA_CSG_FOUND to TRUE
++# if all listed variables are TRUE
++find_package_handle_standard_args(VOTCA_CSG DEFAULT_MSG VOTCA_CSG_LIBRARY VOTCA_CSG_INCLUDE_DIR )
++
++mark_as_advanced(VOTCA_CSG_INCLUDE_DIR VOTCA_CSG_LIBRARY )
+diff -r 7e8f291a6d79 -r 475999c2cd0d CMakeModules/FindVOTCA_TOOLS.cmake
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/CMakeModules/FindVOTCA_TOOLS.cmake Wed Jan 11 11:44:04 2012 -0700
+@@ -0,0 +1,68 @@
++# - Find libvotca_tools
++# Find the native libvotca_tools headers and libraries.
++#
++# VOTCA_TOOLS_INCLUDE_DIRS - where to find votca/tools/version.h, etc.
++# VOTCA_TOOLS_LIBRARIES - List of libraries when using expat.
++# VOTCA_TOOLS_FOUND - True if expat found.
++# VOTCA_TOOLS_HAS_SQLITE3 - True if votca tools was build with sqlite3 support
++#
++# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++
++find_package(PkgConfig)
++
++pkg_check_modules(PC_VOTCA_TOOLS libvotca_tools)
++find_path(VOTCA_TOOLS_INCLUDE_DIR votca/tools/version.h HINTS ${PC_VOTCA_TOOLS_INCLUDE_DIRS})
++
++find_path(VOTCA_TOOLS_HAS_SQLITE3 votca/tools/database.h HINTS ${PC_VOTCA_TOOLS_INCLUDE_DIRS})
++if (VOTCA_TOOLS_HAS_SQLITE3)
++ #due to include <sqlite3.h> in database.h
++ find_package(SQLITE3 REQUIRED)
++ set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR}" )
++else(VOTCA_TOOLS_HAS_SQLITE3)
++ set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )
++endif (VOTCA_TOOLS_HAS_SQLITE3)
++
++
++find_library(VOTCA_TOOLS_LIBRARY NAMES votca_tools HINTS ${PC_VOTCA_TOOLS_LIBRARY_DIRS} )
++
++if("${VOTCA_TOOLS_LIBRARY}" MATCHES "libvotca_tools[^;]*\\.a")
++ if(PC_VOTCA_TOOLS_LIBRARIES)
++ list(REMOVE_ITEM PC_VOTCA_TOOLS_LIBRARIES votca_tools)
++ foreach (LIB ${PC_VOTCA_TOOLS_LIBRARIES})
++ find_library(VOTCA_TOOLS_${LIB} NAMES ${LIB} HINTS ${PC_VOTCA_TOOLS_LIBRARY_DIRS} )
++ list(APPEND VT_DEP_LIBRARIES ${VOTCA_TOOLS_${LIB}})
++ unset(VOTCA_TOOLS_${LIB} CACHE)
++ endforeach(LIB)
++ endif(PC_VOTCA_TOOLS_LIBRARIES)
++ set(VOTCA_TOOLS_DEP_LIBRARIES "${VT_DEP_LIBRARIES}" CACHE FILEPATH "votca tools depency libs (only needed for static (.a) libvotca_tools")
++endif("${VOTCA_TOOLS_LIBRARY}" MATCHES "libvotca_tools[^;]*\\.a")
++
++set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" )
++
++include(FindPackageHandleStandardArgs)
++# handle the QUIETLY and REQUIRED arguments and set VOTCA_TOOLS_FOUND to TRUE
++# if all listed variables are TRUE
++find_package_handle_standard_args(VOTCA_TOOLS DEFAULT_MSG VOTCA_TOOLS_LIBRARY VOTCA_TOOLS_INCLUDE_DIR )
++
++if (VOTCA_TOOLS_FOUND)
++ include(CheckLibraryExists)
++ check_library_exists("${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" VotcaToolsFromC "" FOUND_VOTCA_TOOLS_VERSION)
++ if(NOT FOUND_VOTCA_TOOLS_VERSION)
++ message(FATAL_ERROR "Could not find VotcaToolsFromC in ${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set VOTCA_TOOLS_LIBRARY and VOTCA_TOOLS_DEP_LIBRARIES by hand, which set votca_tools lib it's depencies (i.e. -DVOTCA_TOOLS_LIBRARY='/path/to/libvotca_tools.so" -VOTCA_TOOLS_DEP_LIBRARIES="/path/to/libgsl.so;/path/to/libm.so') !")
++ endif(NOT FOUND_VOTCA_TOOLS_VERSION)
++endif (VOTCA_TOOLS_FOUND)
++
++mark_as_advanced(VOTCA_TOOLS_INCLUDE_DIR VOTCA_TOOLS_LIBRARY )
diff --git a/sci-chemistry/votca-csgapps/metadata.xml b/sci-chemistry/votca-csgapps/metadata.xml
new file mode 100644
index 000000000000..40959c87ed5b
--- /dev/null
+++ b/sci-chemistry/votca-csgapps/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>
+ <upstream>
+ <remote-id type="google-code">votca</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-chemistry/votca-csgapps/votca-csgapps-1.2.2.ebuild b/sci-chemistry/votca-csgapps/votca-csgapps-1.2.2.ebuild
new file mode 100644
index 000000000000..0023ec511603
--- /dev/null
+++ b/sci-chemistry/votca-csgapps/votca-csgapps-1.2.2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+if [ "${PV}" != "9999" ]; then
+ SRC_URI="http://votca.googlecode.com/files/${PF}.tar.gz"
+ RESTRICT="primaryuri"
+else
+ inherit mercurial
+ EHG_REPO_URI="https://csgapps.votca.googlecode.com/hg"
+fi
+
+DESCRIPTION="Extra applications for votca-csg"
+HOMEPAGE="http://www.votca.org"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-macos"
+IUSE=""
+
+RDEPEND="=sci-chemistry/${PN%apps}-${PV}"
+
+DEPEND="${RDEPEND}"
+
+DOCS=( README )
+
+PATCHES=( "${FILESDIR}/${P}-dso.patch" )
diff --git a/sci-chemistry/votca-csgapps/votca-csgapps-1.2.4.ebuild b/sci-chemistry/votca-csgapps/votca-csgapps-1.2.4.ebuild
new file mode 100644
index 000000000000..1f209d21f52f
--- /dev/null
+++ b/sci-chemistry/votca-csgapps/votca-csgapps-1.2.4.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+if [ "${PV}" != "9999" ]; then
+ SRC_URI="http://downloads.votca.googlecode.com/hg/${PF}.tar.gz"
+else
+ inherit mercurial
+ EHG_REPO_URI="https://csgapps.votca.googlecode.com/hg"
+fi
+
+DESCRIPTION="Extra applications for votca-csg"
+HOMEPAGE="http://www.votca.org"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-macos"
+IUSE=""
+
+RDEPEND="~sci-chemistry/${PN%apps}-${PV}"
+
+DEPEND="${RDEPEND}"
+
+DOCS=( README )
diff --git a/sci-chemistry/wxmacmolplt/Manifest b/sci-chemistry/wxmacmolplt/Manifest
new file mode 100644
index 000000000000..0f1042d51294
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/Manifest
@@ -0,0 +1,2 @@
+DIST wxmacmolplt-7.4.2.tar.gz 1860528 SHA256 0e17295c8082af353311d3d13600bdda20d337d82f5ff8da1be8c2223bb54f76
+DIST wxmacmolplt-7.5.tar.gz 1965376 SHA256 df74762d106e4b44bba8ced84d2df78848052fea543937c51297479fa98fc787 SHA512 a1064d5068136b2a91328c7f912ff57d4741081d6d61437e7b4567fbf732917485b391493d637b8892bdad50b539363cfa9c778bb35407a9c0a2bfed20e42bc0 WHIRLPOOL 9cda289232f7323819b7426dc17532396e633514e292e11f71404f380f174c1439b788bffff594f8d9a72cc0ddca48d799a173ff14a9b783edb8bc64f0b4e04c
diff --git a/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.4.2-glew.patch b/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.4.2-glew.patch
new file mode 100644
index 000000000000..08986db5bff2
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.4.2-glew.patch
@@ -0,0 +1,12 @@
+diff -urN wxmacmolplt-7.4.2.orig/configure.ac wxmacmolplt-7.4.2/configure.ac
+--- wxmacmolplt-7.4.2.orig/configure.ac 2010-12-05 02:48:29.000000000 +0300
++++ wxmacmolplt-7.4.2/configure.ac 2010-12-06 19:30:24.000000000 +0300
+@@ -20,7 +20,7 @@
+ ;;
+ *)
+ HOST=LINUX
+- LIBGL="-lGL -lGLU"
++ LIBGL=`pkg-config --libs glu glew`
+ ;;
+ esac
+ AM_CONDITIONAL(HOST_IS_MSW, [test "x$HOST" == xMSW])
diff --git a/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.5-glew.patch b/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.5-glew.patch
new file mode 100644
index 000000000000..08986db5bff2
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/files/wxmacmolplt-7.5-glew.patch
@@ -0,0 +1,12 @@
+diff -urN wxmacmolplt-7.4.2.orig/configure.ac wxmacmolplt-7.4.2/configure.ac
+--- wxmacmolplt-7.4.2.orig/configure.ac 2010-12-05 02:48:29.000000000 +0300
++++ wxmacmolplt-7.4.2/configure.ac 2010-12-06 19:30:24.000000000 +0300
+@@ -20,7 +20,7 @@
+ ;;
+ *)
+ HOST=LINUX
+- LIBGL="-lGL -lGLU"
++ LIBGL=`pkg-config --libs glu glew`
+ ;;
+ esac
+ AM_CONDITIONAL(HOST_IS_MSW, [test "x$HOST" == xMSW])
diff --git a/sci-chemistry/wxmacmolplt/metadata.xml b/sci-chemistry/wxmacmolplt/metadata.xml
new file mode 100644
index 000000000000..cd9831eb3c5f
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <longdescription>
+wxMacMolPlt is a program for plotting 3D molecular structures and normal modes (vibrations), various orbitals and electron density maps. It reads a variety of file formats including any GAMESS input, log or IRC file directly to create animations. It has a simple GAMESS input (.inp) builder and a primitive molecule builder.
+</longdescription>
+ <use>
+ <flag name="flash">Add support for flash movie generation using <pkg>media-libs/ming</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/wxmacmolplt/wxmacmolplt-7.4.2.ebuild b/sci-chemistry/wxmacmolplt/wxmacmolplt-7.4.2.ebuild
new file mode 100644
index 000000000000..c53a1940546f
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/wxmacmolplt-7.4.2.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER=2.8
+
+inherit autotools eutils wxwidgets
+
+DESCRIPTION="Chemical 3D graphics program with GAMESS input builder"
+HOMEPAGE="http://www.scl.ameslab.gov/MacMolPlt/"
+SRC_URI="http://www.scl.ameslab.gov/MacMolPlt/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE="flash"
+
+RDEPEND="
+ >=media-libs/glew-1.5.3
+ media-libs/mesa
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ flash? ( media-libs/ming )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-glew.patch
+ sed \
+ -e "/^dist_doc_DATA/d" \
+ -i Makefile.am || die "Failed to disable installation of LICENSE file"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-glew \
+ $(use_with flash ming)
+}
+
+src_install() {
+ default
+ doicon resources/${PN}.png
+ make_desktop_entry ${PN} wxMacMolPlt ${PN} "Science;Education"
+}
diff --git a/sci-chemistry/wxmacmolplt/wxmacmolplt-7.5.ebuild b/sci-chemistry/wxmacmolplt/wxmacmolplt-7.5.ebuild
new file mode 100644
index 000000000000..a578ee31c9b5
--- /dev/null
+++ b/sci-chemistry/wxmacmolplt/wxmacmolplt-7.5.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER=2.9
+
+inherit autotools eutils wxwidgets
+
+DESCRIPTION="Chemical 3D graphics program with GAMESS input builder"
+HOMEPAGE="http://www.scl.ameslab.gov/MacMolPlt/"
+SRC_URI="http://wxmacmolplt.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE="flash"
+
+RDEPEND="
+ media-libs/glew
+ media-libs/mesa
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ flash? ( media-libs/ming )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-glew.patch
+ sed \
+ -e "/^dist_doc_DATA/d" \
+ -i Makefile.am || die "Failed to disable installation of LICENSE file"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-glew \
+ $(use_with flash ming)
+}
+
+src_install() {
+ default
+ doicon resources/${PN}.png
+ make_desktop_entry ${PN} wxMacMolPlt ${PN} "Science;DataVisualization;"
+}
diff --git a/sci-chemistry/xds-bin/Manifest b/sci-chemistry/xds-bin/Manifest
new file mode 100644
index 000000000000..60095d8dd80b
--- /dev/null
+++ b/sci-chemistry/xds-bin/Manifest
@@ -0,0 +1,3 @@
+DIST XDS-IA32_Linux_x86-20150301.tar.gz 7926947 SHA256 a88c83612f51ee4ee2c8c350a4a043ed63d4de81abbe38b66a5c7ce0729de7ec SHA512 d5ca9e2c48785e6f5409985a24df34361f913800f6a98b4fbc5cc5a16b58126e4577a7da45dc134cd12c44a0f96482e4cfb2ad2e7971ed7b70c1d062bf9ad436 WHIRLPOOL 73dec5eb595ffb1a7c4b30a9546bb82120d212ce73e7d9c004475fbdbe39bcabb7d3e6010ae492100a5fefd8b5abbc6303101091f0feff62e082bb7a0e7c5ce1
+DIST XDS-INTEL64_Linux_x86_64-20150301.tar.gz 9332728 SHA256 6b416b5c91829a2bbe3b9ed7b991edb38db7de7aad7a3ac00611ba12fc32f55a SHA512 361deea644e4f960ce73a0d42d6a3455e5895c288708cb007dd5e392828ab7f031da11c370f7b289a342b9f544e96b77bebde0e383d7b4e6a4ef6a33c930e0ed WHIRLPOOL e52ba19f48feff54af3634b50c8834352f32261bdd2216d6fd77ce9cc34ca49464f63b4685a2516b3eca4e27174c2d2be8406e00ec8fc935b04ce1dc643a7b29
+DIST XDS_html_doc-20150301.tar.gz 112862 SHA256 5ed1076bfc5086c6fb393ff8b19fcb4b4ff538977f74e2aea55b7f7b647fd37b SHA512 3492538de050e1e172a3e49b19a3616b496cd96ae78e726ab82567ebe3a5ecb91e0ea9f88d1fba9678d84ba54067494e1277b8be1a9fead57f8e0c85691d7d70 WHIRLPOOL 57bd75351cc64a7a24b7e78d3162842187d35ee33bce629d515b17306b49186dfda7ef06f9c53417c7b422db3b4636533cb0c753c358c8123903db61db33389d
diff --git a/sci-chemistry/xds-bin/metadata.xml b/sci-chemistry/xds-bin/metadata.xml
new file mode 100644
index 000000000000..51fdedab1b38
--- /dev/null
+++ b/sci-chemistry/xds-bin/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/xds-bin/xds-bin-20150301.ebuild b/sci-chemistry/xds-bin/xds-bin-20150301.ebuild
new file mode 100644
index 000000000000..3ddc187ce4d8
--- /dev/null
+++ b/sci-chemistry/xds-bin/xds-bin-20150301.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="X-ray Detector Software for processing single-crystal monochromatic diffraction data"
+HOMEPAGE="http://xds.mpimf-heidelberg.mpg.de/"
+SRC_URI="
+ x86? ( ftp://ftp.mpimf-heidelberg.mpg.de/pub/kabsch/XDS-IA32_Linux_x86.tar.gz -> XDS-IA32_Linux_x86-${PV}.tar.gz )
+ amd64? ( ftp://ftp.mpimf-heidelberg.mpg.de/pub/kabsch/XDS-INTEL64_Linux_x86_64.tar.gz -> XDS-INTEL64_Linux_x86_64-${PV}.tar.gz )
+ ftp://ftp.mpimf-heidelberg.mpg.de/pub/kabsch/XDS_html_doc.tar.gz -> XDS_html_doc-${PV}.tar.gz"
+
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="smp X"
+
+RDEPEND="X? ( sci-visualization/xds-viewer )"
+DEPEND=""
+
+QA_PREBUILT="opt/xds-bin/*"
+
+src_unpack() {
+ unpack ${A}
+ mv XDS-* "${S}"
+}
+
+src_install() {
+ local suffix bin
+ exeinto /opt/${PN}
+ doexe *
+
+ use smp && suffix="_par"
+
+ for bin in xds mintegrate mcolspot xscale; do
+ dosym ../${PN}/${bin}${suffix} /opt/bin/${bin}
+ done
+
+ for bin in 2cbf cellparm forkcolspot forkintegrate merge2cbf pixlab xdsconv; do
+ dosym ../${PN}/${bin} /opt/bin/${bin}
+ done
+
+ dohtml -r "${WORKDIR}"/XDS_html_doc/*
+ insinto /usr/share/${PN}/INPUT_templates
+ doins "${WORKDIR}"/XDS_html_doc/html_doc/INPUT_templates/*
+}
+
+pkg_postinst() {
+ elog "This package will expire on March 31, 2016"
+}
diff --git a/sci-chemistry/xdsgui/Manifest b/sci-chemistry/xdsgui/Manifest
new file mode 100644
index 000000000000..1156cfea39a4
--- /dev/null
+++ b/sci-chemistry/xdsgui/Manifest
@@ -0,0 +1,2 @@
+DIST xdsgui-0_p130530.32 10372936 SHA256 f9af76a1e4ef96ac5930a0f51f0052ecf02b0a2496ce832403c31b216a033ebd SHA512 f9ef5d914afb8e6a64f936508fee2e84f4e579898726774dc995e920e5a953341c48022e8078eb60f9a2a288190765949da03f394f221a48916d12dc26a898b1 WHIRLPOOL d7792edfcd273c37569c303e6c4f5acf9d832d4bc4f67048a063a25894e375f1dc1b612f879edc14e3c7fdc6ddda84f25990cb8a3d3fbea35f1784835a3febc5
+DIST xdsgui-0_p130530.64 12220790 SHA256 333de2bc7dd88051a43a912dc6e0903bdc17d0d32c16f8c175fa9ec27289f76a SHA512 bd54ddacf44a9156306354249c5b1b61deb9b1f9ebdad879b98d01354ccb51ab60c183e3c58c2be2bb1a42b55b96cea470ee70538110f0fc1b9e3b46ffce3d40 WHIRLPOOL 1002646b1e22cfad35f81287602c496d8d5c323cf9285604ceb9f3717e2a2b1416e9d1f9ef730e0284d972e4f090752a0d41b9bfcefa403a8d746bbc84b3feb2
diff --git a/sci-chemistry/xdsgui/metadata.xml b/sci-chemistry/xdsgui/metadata.xml
new file mode 100644
index 000000000000..f80752c40789
--- /dev/null
+++ b/sci-chemistry/xdsgui/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+XDSgui is a GUI (graphical user interface) for XDS that is supposed to help both
+novice and experienced users. It graphically displays the ASCII and cbf files
+that XDS writes, and can run useful shell commands with a simple mouse click.
+The design goal of the program is to enable XDS data processing without the
+commandline, and to supply additional graphical information.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/xdsgui/xdsgui-0_p130530.ebuild b/sci-chemistry/xdsgui/xdsgui-0_p130530.ebuild
new file mode 100644
index 000000000000..0922da53b023
--- /dev/null
+++ b/sci-chemistry/xdsgui/xdsgui-0_p130530.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GUI for XDS that is supposed to help both novice and experienced users"
+HOMEPAGE="http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/XdsGUI"
+SRC_URI="
+ amd64? ( ftp://turn5.biologie.uni-konstanz.de/pub/xdsGUI.rhel6.64 -> ${P}.64 )
+ x86? ( ftp://turn5.biologie.uni-konstanz.de/pub/xdsGUI.rhel6.32 -> ${P}.32 )"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-util/xxdiff
+ sci-chemistry/xds-bin
+ sci-chemistry/xdsstat-bin
+ sci-visualization/xds-viewer"
+DEPEND=""
+
+S="${WORKDIR}"
+
+QA_PREBUILT="opt/bin/*"
+
+src_unpack() {
+ if use amd64; then
+ cp -rf "${DISTDIR}"/${P}.64 ${PN} || die
+ elif use x86; then
+ cp -rf "${DISTDIR}"/${P}.32 ${PN} || die
+ fi
+}
+
+src_install() {
+ exeinto /opt/bin
+ doexe ${PN}
+}
diff --git a/sci-chemistry/xdsi/Manifest b/sci-chemistry/xdsi/Manifest
new file mode 100644
index 000000000000..e33598d79364
--- /dev/null
+++ b/sci-chemistry/xdsi/Manifest
@@ -0,0 +1 @@
+DIST xdsi_0.92.tar.gz 886028 SHA256 416403f167d26b56965283b407783ea80927ace533df76e330b51ca37c9bb9e4
diff --git a/sci-chemistry/xdsi/files/0.92-gentoo.patch b/sci-chemistry/xdsi/files/0.92-gentoo.patch
new file mode 100644
index 000000000000..f4a37ff1838d
--- /dev/null
+++ b/sci-chemistry/xdsi/files/0.92-gentoo.patch
@@ -0,0 +1,27 @@
+ xdsi | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/xdsi b/xdsi
+index cbedee8..1037913 100755
+--- a/xdsi
++++ b/xdsi
+@@ -20,8 +20,8 @@
+ ####################################################################
+ # These are the only two things you should change#
+
+-set Templates "/mydir/templates"
+-set initial "/mydir/SLS-2009"
++set Templates "GENTOOTEMPLATE"
++set initial "./"
+
+
+ ####################################################################
+@@ -121,7 +121,7 @@ your system administrator."
+ }
+
+
+-CheckExecutables "kpdf gnuplot xds_par xdsstat xds-viewer-0.6 convert pointless ipmosflm VIEW"
++CheckExecutables "kpdf gnuplot xds_par xds-viewer convert pointless ipmosflm"
+
+ #wm resizable . 0 0
+
diff --git a/sci-chemistry/xdsi/metadata.xml b/sci-chemistry/xdsi/metadata.xml
new file mode 100644
index 000000000000..431fb2be13b4
--- /dev/null
+++ b/sci-chemistry/xdsi/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+XDSi offers you the possibility to process all your datasets in a given directory with minimum effort.
+* You just have to provide it with a resultdirectory and the directory where your frames are stored.
+* All datasets consisting of more than 100 frames within the given directory and all its subdirectories will be processed.
+* For each dataset a space group assignment is done using POINTLESS of the CCP4 software package
+* Plots of the most informative statistics of INTEGRATE.LP, CORRECT.LP and XDSSTAT.LP are generated for each dataset
+* A plot comparing Rmeas, I/sig and Completeness of all the processed datasets is generated
+* You can also generate plots for datasets that have been processed using XDS without XDSi
+</longdescription>
+</pkgmetadata>
diff --git a/sci-chemistry/xdsi/xdsi-0.92-r1.ebuild b/sci-chemistry/xdsi/xdsi-0.92-r1.ebuild
new file mode 100644
index 000000000000..6a6c9bb7ec8b
--- /dev/null
+++ b/sci-chemistry/xdsi/xdsi-0.92-r1.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 eutils
+
+DESCRIPTION="A crude interface for running the XDS"
+HOMEPAGE="http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/Xdsi"
+SRC_URI="ftp://turn5.biologie.uni-konstanz.de/pub/${PN}_${PV}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ app-text/mupdf
+ dev-lang/tk
+ || ( media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick] )
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ sci-chemistry/xds-bin[smp]
+ sci-visualization/gnuplot
+ sci-visualization/xds-viewer"
+# Need to clarified for licensing
+# sci-chemistry/xdsstat-bin
+DEPEND=""
+
+RESTRICT="mirror bindist"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ sed \
+ -e "s:GENTOOTEMPLATE:${EPREFIX}/usr/share/${PN}/templates:g" \
+ -e "s:kpdf:mupdf:g" \
+ -e "s:xds-viewer-0.6:xds-viewer:g" \
+ -i ${PN} || die
+}
+
+src_install() {
+ dobin ${PN}
+ insinto /usr/share/${PN}/templates
+ doins templates/{*.INP,bohr*,fortran,pauli,info.png,*.pck,tablesf_xdsi}
+ dodoc templates/*.pdf
+}
+
+pkg_postinst() {
+ elog "Documentation can be found here:"
+ elog "ftp://turn14.biologie.uni-konstanz.de/pub/xdsi/xdsi_doc_print.pdf"
+}
diff --git a/sci-chemistry/xdsstat-bin/Manifest b/sci-chemistry/xdsstat-bin/Manifest
new file mode 100644
index 000000000000..4ce0a18a1d13
--- /dev/null
+++ b/sci-chemistry/xdsstat-bin/Manifest
@@ -0,0 +1,2 @@
+DIST xdsstat-linux32.bz2 235255 SHA256 366b9565a172b9ab756e1669a353003c74b9e0341bba5b1822fef775a35e1290 SHA512 233c25b60501f794887a09960e2e8377c0443bce661c769624d8afcde288b58968b3406cc7e1bb02f0de010f4e6555ef0641fd5ebcfdd5f6396ec21a22c32985 WHIRLPOOL a304fd23eaf3d8292f3bc414e6bc1c1b5895590b4235e637d357a4a462c91939195fd99764b4233775f1dd6d65601391d4c6328fe578734dae498e6f382e96f7
+DIST xdsstat-linux64.bz2 256555 SHA256 45408d09cb13ec664e863863ec66a1cece204308e074f29f54f922d804f042f9 SHA512 d5b3043bec30a17f6960308d642a3721f7a73bc851a71ec28a813b5a98f2de4f215d3603e8da4a9bcb949cfa15030c3eac108bc5549ebdef6737885e60dbd626 WHIRLPOOL 5d81ba5998e6c527978f10e0aa2ded7c8ada53beb6340ba592d74b34a64a81e17c0184d101dc7698d4771458d0e27559fb857fd329be8eb95a4f75136f549790
diff --git a/sci-chemistry/xdsstat-bin/metadata.xml b/sci-chemistry/xdsstat-bin/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/xdsstat-bin/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/xdsstat-bin/xdsstat-bin-140225.ebuild b/sci-chemistry/xdsstat-bin/xdsstat-bin-140225.ebuild
new file mode 100644
index 000000000000..7bed425330c3
--- /dev/null
+++ b/sci-chemistry/xdsstat-bin/xdsstat-bin-140225.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_PN="${PN/-bin}"
+
+DESCRIPTION="Prints various statistics (that are not available from XDS itself)"
+HOMEPAGE="http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/XDSSTAT"
+SRC_URI="
+ amd64? ( ftp://turn5.biologie.uni-konstanz.de/pub/${MY_PN}-linux64.bz2 )
+ x86? ( ftp://turn5.biologie.uni-konstanz.de/pub/${MY_PN}-linux32.bz2 )
+"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sci-chemistry/xds-bin"
+DEPEND=""
+
+RESTRICT="mirror"
+
+QA_PREBUILT="opt/bin/*"
+
+S="${WORKDIR}"
+
+src_install() {
+ exeinto /opt/bin
+ newexe ${MY_PN}* ${MY_PN}
+}
diff --git a/sci-chemistry/xia2/Manifest b/sci-chemistry/xia2/Manifest
new file mode 100644
index 000000000000..e7fa594c3ec9
--- /dev/null
+++ b/sci-chemistry/xia2/Manifest
@@ -0,0 +1,6 @@
+DIST xia2-0.3.1.0.tar.bz2 3389906 SHA256 32f1866bc17b093cbf157ec7bc217e47d059957104b20c88ed1b5c3706fc7e28
+DIST xia2-0.3.1.6.tar.bz2 3464982 SHA256 fde814a763e6666a1618d01569c19d574f1bf71d754dc3960beeb13c35dd201f
+DIST xia2-0.3.1.7.tar.bz2 3650285 SHA256 54beb26396c4b6ecb343544c777c2505238385f2127482d035d2c47b24a7fcf1
+DIST xia2-0.3.3.1.tar.bz2 3074989 SHA256 f1bf94cd9305f768fea1b541ac53d66917126e92620263a96f9c23923ec829c4
+DIST xia2-0.3.3.3.tar.bz2 2919316 SHA256 3cf09fcf9d2c0ea6d6cb8cf66a3c5af752b4345af6a882e2d398424cf3b4b0d3
+DIST xia2-0.3.4.0.tar.bz2 21404771 SHA256 20afe3d24c35446ef8c8944974d684229f053d3916e96e46766d8eefa4c5fabf
diff --git a/sci-chemistry/xia2/files/0.3.1.0-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.1.0-fix-syntax.patch
new file mode 100644
index 000000000000..9d92af7e33ce
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.1.0-fix-syntax.patch
@@ -0,0 +1,61 @@
+diff --git a/xia2-0.3.1.0/Applications/xia2find.py b/xia2-0.3.1.0/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.1.0/Applications/xia2find.py
++++ b/xia2-0.3.1.0/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2-0.3.1.0/Experts/DRStrategyExpert.py b/xia2-0.3.1.0/Experts/DRStrategyExpert.py
+index 28b1dc3..dba3ef7 100644
+--- a/xia2-0.3.1.0/Experts/DRStrategyExpert.py
++++ b/xia2-0.3.1.0/Experts/DRStrategyExpert.py
+@@ -48,24 +48,24 @@ strategy_dict = {
+ 'default':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'default':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'}
++ 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'},
+ 'depends-on':['labelit.screen', 'mosflm', 'scala', 'reindex',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'}
++ 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'},
+ 'depends-on':['xds', 'xscale']}
+ }
+diff --git a/xia2core-0.3.1.0/Python/Examples/CCP4/Cad.py b/xia2core-0.3.1.0/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.1.0/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.1.0/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/files/0.3.1.6-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.1.6-fix-syntax.patch
new file mode 100644
index 000000000000..7770a53c4451
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.1.6-fix-syntax.patch
@@ -0,0 +1,61 @@
+diff --git a/xia2-0.3.1.6/Applications/xia2find.py b/xia2-0.3.1.6/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.1.6/Applications/xia2find.py
++++ b/xia2-0.3.1.6/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2-0.3.1.6/Experts/DRStrategyExpert.py b/xia2-0.3.1.6/Experts/DRStrategyExpert.py
+index 28b1dc3..dba3ef7 100644
+--- a/xia2-0.3.1.6/Experts/DRStrategyExpert.py
++++ b/xia2-0.3.1.6/Experts/DRStrategyExpert.py
+@@ -48,24 +48,24 @@ strategy_dict = {
+ 'default':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'default':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'}
++ 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'},
+ 'depends-on':['labelit.screen', 'mosflm', 'scala', 'reindex',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'}
++ 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'},
+ 'depends-on':['xds', 'xscale']}
+ }
+diff --git a/xia2core-0.3.1.6/Python/Examples/CCP4/Cad.py b/xia2core-0.3.1.6/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.1.6/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.1.6/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/files/0.3.1.7-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.1.7-fix-syntax.patch
new file mode 100644
index 000000000000..ec8ada48aad1
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.1.7-fix-syntax.patch
@@ -0,0 +1,61 @@
+diff --git a/xia2-0.3.1.7/Applications/xia2find.py b/xia2-0.3.1.7/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.1.7/Applications/xia2find.py
++++ b/xia2-0.3.1.7/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2-0.3.1.7/Experts/DRStrategyExpert.py b/xia2-0.3.1.7/Experts/DRStrategyExpert.py
+index 28b1dc3..dba3ef7 100644
+--- a/xia2-0.3.1.7/Experts/DRStrategyExpert.py
++++ b/xia2-0.3.1.7/Experts/DRStrategyExpert.py
+@@ -48,24 +48,24 @@ strategy_dict = {
+ 'default':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'default':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'}
++ 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'},
+ 'depends-on':['labelit.screen', 'mosflm', 'scala', 'reindex',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'}
++ 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'},
+ 'depends-on':['xds', 'xscale']}
+ }
+diff --git a/xia2core-0.3.1.7/Python/Examples/CCP4/Cad.py b/xia2core-0.3.1.7/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.1.7/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.1.7/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/files/0.3.3.1-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.3.1-fix-syntax.patch
new file mode 100644
index 000000000000..36cf6bb60d1d
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.3.1-fix-syntax.patch
@@ -0,0 +1,61 @@
+diff --git a/xia2-0.3.3.0/Applications/xia2find.py b/xia2-0.3.3.0/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.3.1/Applications/xia2find.py
++++ b/xia2-0.3.3.1/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2-0.3.3.0/Experts/DRStrategyExpert.py b/xia2-0.3.3.0/Experts/DRStrategyExpert.py
+index 28b1dc3..dba3ef7 100644
+--- a/xia2-0.3.3.1/Experts/DRStrategyExpert.py
++++ b/xia2-0.3.3.1/Experts/DRStrategyExpert.py
+@@ -48,24 +48,24 @@ strategy_dict = {
+ 'default':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'default':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'}
++ 'indexer':'labelit', 'integrater':'mosflm', 'scaler':'mosflm'},
+ 'depends-on':['labelit.screen', 'mosflm', 'scala', 'reindex',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':1,
+ 'pipeline':{
+- 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'}
++ 'indexer':'labelit', 'integrater':'xds', 'scaler':'xds-hybrid'},
+ 'depends-on':['labelit.screen', 'xds', 'xscale', 'scala', 'combat',
+ 'pointless-1.1.0.4']},
+ 'mosaic':{
+ 'score':2,
+ 'pipeline':{
+- 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'}
++ 'indexer':'xds', 'integrater':'xds', 'scaler':'xds'},
+ 'depends-on':['xds', 'xscale']}
+ }
+diff --git a/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py b/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.3.1/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.3.1/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/files/0.3.3.3-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.3.3-fix-syntax.patch
new file mode 100644
index 000000000000..53cacbb5c681
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.3.3-fix-syntax.patch
@@ -0,0 +1,28 @@
+diff --git a/xia2-0.3.3.0/Applications/xia2find.py b/xia2-0.3.3.0/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.3.3/Applications/xia2find.py
++++ b/xia2-0.3.3.3/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py b/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.3.3/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.3.3/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/files/0.3.4.0-fix-syntax.patch b/sci-chemistry/xia2/files/0.3.4.0-fix-syntax.patch
new file mode 100644
index 000000000000..9ba4c94495ea
--- /dev/null
+++ b/sci-chemistry/xia2/files/0.3.4.0-fix-syntax.patch
@@ -0,0 +1,28 @@
+diff --git a/xia2-0.3.3.0/Applications/xia2find.py b/xia2-0.3.3.0/Applications/xia2find.py
+index 1a3b0e2..e0b8a1e 100755
+--- a/xia2-0.3.4.0/Applications/xia2find.py
++++ b/xia2-0.3.4.0/Applications/xia2find.py
+@@ -38,7 +38,7 @@ from Schema.Sweep import SweepFactory
+ from Experts.FindImages import image2template_directory
+
+ known_image_extensions = ['img', 'mccd', 'mar2300', 'mar1200', 'mar3450',
+- 'osc', 'cbf', 'mar2000']]
++ 'osc', 'cbf', 'mar2000']
+ known_sweeps = { }
+
+ def is_image_name(file):
+diff --git a/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py b/xia2core-0.3.3.0/Python/Examples/CCP4/Cad.py
+index 88f9218..5fb6f2a 100644
+--- a/xia2core-0.3.4.0/Python/Examples/CCP4/Cad.py
++++ b/xia2core-0.3.4.0/Python/Examples/CCP4/Cad.py
+@@ -49,8 +49,8 @@ def Cad(DriverType = None):
+ self.add_command_line(hklin)
+
+ self.set_task('Rewriting reflections %s => %s' %
+- ` (os.path.split(hklin)[-1],
+- ` os.path.split(self.getHklout())[-1]))
++ (os.path.split(hklin)[-1],
++ os.path.split(self.getHklout())[-1]))
+
+ self.start()
+
diff --git a/sci-chemistry/xia2/metadata.xml b/sci-chemistry/xia2/metadata.xml
new file mode 100644
index 000000000000..9ac9ffdb3a41
--- /dev/null
+++ b/sci-chemistry/xia2/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-chemistry</herd>
+</pkgmetadata>
diff --git a/sci-chemistry/xia2/xia2-0.3.1.0.ebuild b/sci-chemistry/xia2/xia2-0.3.1.0.ebuild
new file mode 100644
index 000000000000..33b3d841acfa
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.1.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ find . -name '*.bat' | xargs rm || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}"/usr/share/ccp4/XIAROOT
+ XIA2CORE_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2core-${PV}
+ XIA2_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}
+ PATH="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xia2/xia2-0.3.1.6.ebuild b/sci-chemistry/xia2/xia2-0.3.1.6.ebuild
new file mode 100644
index 000000000000..537735e1351f
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.1.6.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ find . -name '*.bat' -delete || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+ python_convert_shebangs -r $(python_get_version) .
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}"/usr/share/ccp4/XIAROOT
+ XIA2CORE_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2core-${PV}
+ XIA2_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}
+ PATH="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xia2/xia2-0.3.1.7.ebuild b/sci-chemistry/xia2/xia2-0.3.1.7.ebuild
new file mode 100644
index 000000000000..16fbf797d1b4
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.1.7.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ find . -name '*.bat' -delete || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+ python_convert_shebangs -r $(python_get_version) .
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}"/usr/share/ccp4/XIAROOT
+ XIA2CORE_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2core-${PV}
+ XIA2_ROOT="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}
+ PATH="${EPREFIX}"/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xia2/xia2-0.3.3.1.ebuild b/sci-chemistry/xia2/xia2-0.3.3.1.ebuild
new file mode 100644
index 000000000000..26fb7d0d4c83
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.3.1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ find . -name '*.bat' -delete || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+ python_convert_shebangs -r $(python_get_version) .
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}/usr/share/ccp4/XIAROOT"
+ XIA2CORE_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2core-${PV}"
+ XIA2_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}"
+ PATH="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications"
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+ echo ""
+ elog "In order to use the package, you need to"
+ elog "\t source ${EPREFIX}/etc/profile"
+ echo ""
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xia2/xia2-0.3.3.3.ebuild b/sci-chemistry/xia2/xia2-0.3.3.3.ebuild
new file mode 100644
index 000000000000..60778aa75fb9
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.3.3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ find . -name '*.bat' -delete || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+ python_convert_shebangs -r $(python_get_version) .
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}/usr/share/ccp4/XIAROOT"
+ XIA2CORE_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2core-${PV}"
+ XIA2_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}"
+ PATH="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications"
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+ echo ""
+ elog "In order to use the package, you need to"
+ elog "\t source ${EPREFIX}/etc/profile"
+ echo ""
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xia2/xia2-0.3.4.0.ebuild b/sci-chemistry/xia2/xia2-0.3.4.0.ebuild
new file mode 100644
index 000000000000..1d27abd355dc
--- /dev/null
+++ b/sci-chemistry/xia2/xia2-0.3.4.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+
+inherit eutils python
+
+DESCRIPTION="An automated data reduction system for crystallography"
+HOMEPAGE="http://www.ccp4.ac.uk/xia/"
+SRC_URI="http://www.ccp4.ac.uk/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=sci-chemistry/ccp4-apps-6.1.2
+ sci-chemistry/mosflm
+ sci-chemistry/pointless
+ >=sci-libs/ccp4-libs-6.1.2
+ sci-libs/cctbx"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ find . -name '*.bat' -delete || die
+
+ epatch "${FILESDIR}"/${PV}-fix-syntax.patch
+ python_convert_shebangs -r $(python_get_version) .
+}
+
+src_install() {
+ rm -rf ${P}/binaries ${PN}core-${PV}/Test || die
+
+ insinto /usr/share/ccp4/XIAROOT/
+ doins -r * || die
+
+ # Set programs executable
+# fperms cannot handle wildcards
+ chmod 755 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/* || die
+ chmod 644 "${ED}"/usr/share/ccp4/XIAROOT/${P}/Applications/*.py || die
+
+ cat >> "${T}"/23XIA <<- EOF
+ XIA2_HOME="${EPREFIX}/usr/share/ccp4/XIAROOT"
+ XIA2CORE_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2core-${PV}"
+ XIA2_ROOT="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}"
+ PATH="${EPREFIX}/usr/share/ccp4/XIAROOT/xia2-${PV}/Applications"
+ EOF
+
+ doenvd "${T}"/23XIA
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/ccp4/XIAROOT
+ echo ""
+ elog "In order to use the package, you need to"
+ elog "\t source ${EPREFIX}/etc/profile"
+ echo ""
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/ccp4/XIAROOT
+}
diff --git a/sci-chemistry/xyza2pipe/Manifest b/sci-chemistry/xyza2pipe/Manifest
new file mode 100644
index 000000000000..e724f9fb0d3c
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/Manifest
@@ -0,0 +1,2 @@
+DIST xyza2pipe-20101129.tgz 67301 SHA256 3ef853ee6df8eac521a6670d12278b4b5854919aba5d6519d65c73dadc776695 SHA512 19744d88be04afc8049b38179e96aab9ecd72daf8c6aa99cb21ab6a63d1da440f301bba274cff6ae3f9f4c2eec311294e1fe212bec63c81b22349c698609c1c3 WHIRLPOOL dfacea33e37d09d09d073bdab5e363f403ad1aaa81e9a0311769de57e7b06d12b5edce7362a6bd9bd3c667f089b8138ab699e75a8c8093df81b4fa1de270c72f
+DIST xyza2pipe-20121001.tgz 61002 SHA256 c2e2d83dc6f0424afe519aa0ba83922f1c6d1b90933edf5d62722ac56af3b1de SHA512 b64abf46a8d7f3530eecaeec3bc8b143600c6823174a22727868087c2f7f17af0b538a0521e3a29806dc608b003948a1e31296ab395bc3c0089c5dc7a391d855 WHIRLPOOL fec47032811c81709d996712b938ed315e67435d72ae91c1ce2a01546c62eae4868d7e430585cd4f1830e158a8a994e23af02e6f23a897d44f98a81b2889baac
diff --git a/sci-chemistry/xyza2pipe/files/20101129-gentoo.patch b/sci-chemistry/xyza2pipe/files/20101129-gentoo.patch
new file mode 100644
index 000000000000..11586ee4f81c
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/files/20101129-gentoo.patch
@@ -0,0 +1,152 @@
+diff --git a/Makefile b/Makefile
+index 7e00197..b078f06 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,10 +4,11 @@
+ # Last modified: Jun/30/2010
+ #
+
+-CFLAGS = -O3 -lm
++CFLAGS ?= -O3
++LIBS =-lm
+
+ TARGETS = xyza2pipe ucsf2pipe nv2pipe xeasy2pipe azara2pipe vnmr2pipe xwnmr2pipe\
+- pipe2xyza pipe2ucsf pipe2nv pipe2xeasy pipe2azara\
++ pipe2xyza pipe2ucsf-olivia pipe2nv pipe2xeasy pipe2azara-olivia \
+ pipe2proj add2pipe adducsf2pipe addnv2pipe addxeasy2pipe addazara2pipe addvnmr2pipe addxwnmr2pipe
+
+ OBJECTS_C = checklabel.o checkxyza.o cnvhdr.o\
+@@ -60,86 +61,90 @@ clean:
+ rm -f $(TARGETS) addxyza2pipe
+
+ .o:
+- $(CC) $< -c -o $@ $(CFLAGS)
++ $(CC) $(CFLAGS) $< -c -o $@
+
+ xyza2pipe: $(OBJECTS_C) $(OBJECTS_XP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ pipe2xyza: $(OBJECTS_C) $(OBJECTS_PX)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ ucsf2pipe: $(OBJECTS_C) $(OBJECTS_UP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+-pipe2ucsf: $(OBJECTS_C) $(OBJECTS_PU)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++pipe2ucsf-olivia: $(OBJECTS_C) $(OBJECTS_PU)
++ $(CC) $(CFLAGS) $(LDFLAGS) pipe2ucsf.c $^ -o $@ \
++ $(LIBS)
+
+ nv2pipe: $(OBJECTS_C) $(OBJECTS_NP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ pipe2nv: $(OBJECTS_C) $(OBJECTS_PN)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ xeasy2pipe: $(OBJECTS_C) $(OBJECTS_EP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ pipe2xeasy: $(OBJECTS_C) $(OBJECTS_PE)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ azara2pipe: $(OBJECTS_C) $(OBJECTS_AP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+-pipe2azara: $(OBJECTS_C) $(OBJECTS_PA)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++pipe2azara-olivia: $(OBJECTS_C) $(OBJECTS_PA)
++ $(CC) $(CFLAGS) $(LDFLAGS) pipe2azara.c $^ -o $@ \
++ $(LIBS)
+
+ vnmr2pipe: $(OBJECTS_C) $(OBJECTS_VP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ xwnmr2pipe: $(OBJECTS_C) $(OBJECTS_BP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ pipe2proj: $(OBJECTS_C) $(OBJECTS_PJ)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ add2pipe: $(OBJECTS_C) $(OBJECTS_DXP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+ rm -f addxyza2pipe
+ ln -s add2pipe addxyza2pipe
+
+ adducsf2pipe: $(OBJECTS_C) $(OBJECTS_DUP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ addnv2pipe: $(OBJECTS_C) $(OBJECTS_DNP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ addxeasy2pipe: $(OBJECTS_C) $(OBJECTS_DEP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ addazara2pipe: $(OBJECTS_C) $(OBJECTS_DAP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ addvnmr2pipe: $(OBJECTS_C) $(OBJECTS_DVP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
+
+ addxwnmr2pipe: $(OBJECTS_C) $(OBJECTS_DBP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(LIBS)
++
++install: $(TARGETS)
++ install -d $(DESTDIR)/usr/bin
++ install $(TARGETS) $(DESTDIR)/usr/bin/
diff --git a/sci-chemistry/xyza2pipe/files/xyza2pipe-20121001-gentoo.patch b/sci-chemistry/xyza2pipe/files/xyza2pipe-20121001-gentoo.patch
new file mode 100644
index 000000000000..ec4220dd0695
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/files/xyza2pipe-20121001-gentoo.patch
@@ -0,0 +1,168 @@
+ Makefile | 106 +++++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 63 insertions(+), 43 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 15d4bd3..e738ec2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,7 +4,7 @@
+ # Last modified: Feb/22/2012
+ #
+
+-CFLAGS = -O3
++CFLAGS ?= -O3
+ MFLAGS = -lm
+
+ TARGETS = xyza2pipe ucsf2pipe nv2pipe xeasy2pipe azara2pipe vnmr2pipe xwnmr2pipe\
+@@ -62,89 +62,109 @@ clean:
+ rm -f $(TARGETS) addxyza2pipe
+
+ $(OBJECTS_MATH):
+- $(CC) $*.c -c -o $@ $(CFLAGS) -D__XYZA2PIPE__
++ $(CC) $(CPPFLAGS) -D__XYZA2PIPE__ $(CFLAGS) $*.c -c -o $@
+
+ .o:
+- $(CC) $< -c -o $@ $(CFLAGS)
++ $(CC) $(CPPFLAGS) $(CFLAGS) $< -c -o $@
+
+ xyza2pipe: $(OBJECTS_C) $(OBJECTS_XP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2xyza: $(OBJECTS_C) $(OBJECTS_PX)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ ucsf2pipe: $(OBJECTS_C) $(OBJECTS_UP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2ucsf: $(OBJECTS_C) $(OBJECTS_PU)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ nv2pipe: $(OBJECTS_C) $(OBJECTS_NP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2nv: $(OBJECTS_C) $(OBJECTS_PN)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ xeasy2pipe: $(OBJECTS_C) $(OBJECTS_EP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2xeasy: $(OBJECTS_C) $(OBJECTS_PE)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ azara2pipe: $(OBJECTS_C) $(OBJECTS_AP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2azara: $(OBJECTS_C) $(OBJECTS_PA)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ vnmr2pipe: $(OBJECTS_C) $(OBJECTS_VP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ xwnmr2pipe: $(OBJECTS_C) $(OBJECTS_BP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ pipe2proj: $(OBJECTS_C) $(OBJECTS_PJ)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ add2pipe: $(OBJECTS_C) $(OBJECTS_DXP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+ rm -f addxyza2pipe
+ ln -s add2pipe addxyza2pipe
+
+ adducsf2pipe: $(OBJECTS_C) $(OBJECTS_DUP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ addnv2pipe: $(OBJECTS_C) $(OBJECTS_DNP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ addxeasy2pipe: $(OBJECTS_C) $(OBJECTS_DEP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ addazara2pipe: $(OBJECTS_C) $(OBJECTS_DAP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ addvnmr2pipe: $(OBJECTS_C) $(OBJECTS_DVP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
+
+ addxwnmr2pipe: $(OBJECTS_C) $(OBJECTS_DBP)
+- $(CC) $@.c $^ -o $@ \
+- $(CFLAGS) $(MFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $@.c $^ -o $@ \
++ $(MFLAGS)
++ mv -v $@ bin/
diff --git a/sci-chemistry/xyza2pipe/metadata.xml b/sci-chemistry/xyza2pipe/metadata.xml
new file mode 100644
index 000000000000..ae9ec7c5f6a4
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/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-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-chemistry/xyza2pipe/xyza2pipe-20101129.ebuild b/sci-chemistry/xyza2pipe/xyza2pipe-20101129.ebuild
new file mode 100644
index 000000000000..51428079a77e
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/xyza2pipe-20101129.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Cross conversion environment of NMR spectra"
+HOMEPAGE="http://fermi.pharm.hokudai.ac.jp/olivia/api/index.php/Xyza2pipe_src"
+SRC_URI="mirror://gentoo/${P}.tgz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="olivia"
+IUSE=""
+
+S="${WORKDIR}"/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ tc-export CC
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README FEEDBACK || die
+}
diff --git a/sci-chemistry/xyza2pipe/xyza2pipe-20121001.ebuild b/sci-chemistry/xyza2pipe/xyza2pipe-20121001.ebuild
new file mode 100644
index 000000000000..6e7af4ff9b2b
--- /dev/null
+++ b/sci-chemistry/xyza2pipe/xyza2pipe-20121001.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Cross conversion environment of NMR spectra"
+HOMEPAGE="http://fermi.pharm.hokudai.ac.jp/olivia/api/index.php/Xyza2pipe_src"
+SRC_URI="http://fermi.pharm.hokudai.ac.jp/olivia/documents/xyza2pipe.tgz -> ${P}.tgz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="olivia"
+IUSE=""
+
+S="${WORKDIR}"/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ tc-export CC
+ mkdir bin
+}
+
+src_install() {
+ local i
+ dodoc README FEEDBACK
+ cd bin || die
+ for i in *; do
+ newbin ${i}{,-olivia}
+ done
+}