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-mathematics
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-mathematics')
-rw-r--r--sci-mathematics/4ti2/4ti2-1.6.2.ebuild38
-rw-r--r--sci-mathematics/4ti2/4ti2-1.6.5.ebuild38
-rw-r--r--sci-mathematics/4ti2/4ti2-1.6.6.ebuild38
-rw-r--r--sci-mathematics/4ti2/Manifest3
-rw-r--r--sci-mathematics/4ti2/files/4ti2-1.3.2-gold.patch17
-rw-r--r--sci-mathematics/4ti2/metadata.xml13
-rw-r--r--sci-mathematics/Macaulay2/Macaulay2-1.7_pre.ebuild154
-rw-r--r--sci-mathematics/Macaulay2/Manifest4
-rw-r--r--sci-mathematics/Macaulay2/files/1.6-lapack.patch50
-rw-r--r--sci-mathematics/Macaulay2/files/1.6-paths-of-external-programs.patch73
-rw-r--r--sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el11
-rw-r--r--sci-mathematics/Macaulay2/metadata.xml16
-rw-r--r--sci-mathematics/agda-executable/Manifest1
-rw-r--r--sci-mathematics/agda-executable/agda-executable-2.3.0.1-r1.ebuild36
-rw-r--r--sci-mathematics/agda-executable/agda-executable-2.3.0.1-r2.ebuild35
-rw-r--r--sci-mathematics/agda-executable/metadata.xml13
-rw-r--r--sci-mathematics/agda-lib-ffi/Manifest2
-rw-r--r--sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2-r2.ebuild31
-rw-r--r--sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2.ebuild34
-rw-r--r--sci-mathematics/agda-lib-ffi/metadata.xml14
-rw-r--r--sci-mathematics/agda-stdlib/Manifest3
-rw-r--r--sci-mathematics/agda-stdlib/agda-stdlib-0.8.ebuild67
-rw-r--r--sci-mathematics/agda-stdlib/agda-stdlib-0.9.ebuild67
-rw-r--r--sci-mathematics/agda-stdlib/agda-stdlib-2.4.2.3.ebuild66
-rw-r--r--sci-mathematics/agda-stdlib/files/50agda-stdlib-gentoo.el1
-rw-r--r--sci-mathematics/agda-stdlib/metadata.xml15
-rw-r--r--sci-mathematics/agda/Manifest3
-rw-r--r--sci-mathematics/agda/agda-2.4.0.1.ebuild124
-rw-r--r--sci-mathematics/agda/agda-2.4.2.2-r1.ebuild128
-rw-r--r--sci-mathematics/agda/agda-2.4.2.3-r1.ebuild116
-rw-r--r--sci-mathematics/agda/files/50agda2-gentoo.el10
-rw-r--r--sci-mathematics/agda/files/agda-make_install.patch14
-rw-r--r--sci-mathematics/agda/metadata.xml17
-rw-r--r--sci-mathematics/axiom/Manifest1
-rw-r--r--sci-mathematics/axiom/axiom-200805.ebuild97
-rw-r--r--sci-mathematics/axiom/files/axiom-200711-gcl-configure.patch11
-rw-r--r--sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.Makefile.patch10
-rw-r--r--sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.patch.input168
-rw-r--r--sci-mathematics/axiom/metadata.xml5
-rw-r--r--sci-mathematics/bertini/Manifest1
-rw-r--r--sci-mathematics/bertini/bertini-1.4.ebuild58
-rw-r--r--sci-mathematics/bertini/metadata.xml25
-rw-r--r--sci-mathematics/cado-nfs/Manifest4
-rw-r--r--sci-mathematics/cado-nfs/cado-nfs-1.1.ebuild31
-rw-r--r--sci-mathematics/cado-nfs/cado-nfs-2.0.ebuild38
-rw-r--r--sci-mathematics/cado-nfs/cado-nfs-2.1.1.ebuild41
-rw-r--r--sci-mathematics/cado-nfs/cado-nfs-2.1.ebuild41
-rw-r--r--sci-mathematics/cado-nfs/metadata.xml8
-rw-r--r--sci-mathematics/calc/Manifest5
-rw-r--r--sci-mathematics/calc/calc-2.12.1.5.ebuild40
-rw-r--r--sci-mathematics/calc/calc-2.12.2.2.ebuild52
-rw-r--r--sci-mathematics/calc/calc-2.12.4.13.ebuild57
-rw-r--r--sci-mathematics/calc/calc-2.12.4.3.ebuild53
-rw-r--r--sci-mathematics/calc/calc-2.12.4.4.ebuild57
-rw-r--r--sci-mathematics/calc/files/2.12.4.0-ldflags.patch101
-rw-r--r--sci-mathematics/calc/files/calc-2.12.2.2-libdir-fix.patch12
-rw-r--r--sci-mathematics/calc/files/calc-2.12.4.0-prefix.patch96
-rw-r--r--sci-mathematics/calc/files/calc-2.12.4.13-prefix.patch87
-rw-r--r--sci-mathematics/calc/metadata.xml12
-rw-r--r--sci-mathematics/cgal/Manifest4
-rw-r--r--sci-mathematics/cgal/cgal-4.3-r1.ebuild76
-rw-r--r--sci-mathematics/cgal/cgal-4.3.ebuild74
-rw-r--r--sci-mathematics/cgal/cgal-4.6.1.ebuild74
-rw-r--r--sci-mathematics/cgal/files/cgal-4.3-cmake-3.3.patch24
-rw-r--r--sci-mathematics/cgal/metadata.xml21
-rw-r--r--sci-mathematics/coq/Manifest6
-rw-r--r--sci-mathematics/coq/coq-8.3_p1.ebuild81
-rw-r--r--sci-mathematics/coq/coq-8.4_p1.ebuild81
-rw-r--r--sci-mathematics/coq/coq-8.4_p2.ebuild78
-rw-r--r--sci-mathematics/coq/coq-8.4_p3.ebuild90
-rw-r--r--sci-mathematics/coq/coq-8.4_p5.ebuild103
-rw-r--r--sci-mathematics/coq/coq-8.4_p6.ebuild103
-rw-r--r--sci-mathematics/coq/files/coq-8.4_p1-camlp4.patch17
-rw-r--r--sci-mathematics/coq/files/coq-8.4_p5-do-not-install-revision.patch19
-rw-r--r--sci-mathematics/coq/files/coq-8.4_p5-hevea.patch11
-rw-r--r--sci-mathematics/coq/files/coq-8.4_p5-no-clean-before-test.patch12
-rw-r--r--sci-mathematics/coq/files/coqide.desktop9
-rw-r--r--sci-mathematics/coq/metadata.xml22
-rw-r--r--sci-mathematics/cvc3/Manifest1
-rw-r--r--sci-mathematics/cvc3/cvc3-2.4.1.ebuild157
-rw-r--r--sci-mathematics/cvc3/files/50cvc3-gentoo.el3
-rw-r--r--sci-mathematics/cvc3/metadata.xml42
-rw-r--r--sci-mathematics/dataplot/Manifest2
-rw-r--r--sci-mathematics/dataplot/dataplot-20090821.ebuild81
-rw-r--r--sci-mathematics/dataplot/files/90dataplot3
-rw-r--r--sci-mathematics/dataplot/files/Makefile.am.2009082146
-rw-r--r--sci-mathematics/dataplot/files/configure.ac.2009082176
-rw-r--r--sci-mathematics/dataplot/files/dataplot-20090821-opengl.patch47
-rw-r--r--sci-mathematics/dataplot/metadata.xml13
-rw-r--r--sci-mathematics/diagrtb/Manifest1
-rw-r--r--sci-mathematics/diagrtb/diagrtb-2.64.ebuild30
-rw-r--r--sci-mathematics/diagrtb/files/CMakeLists.txt13
-rw-r--r--sci-mathematics/diagrtb/metadata.xml27
-rw-r--r--sci-mathematics/drgeo/Manifest2
-rw-r--r--sci-mathematics/drgeo/drgeo-1.1.0.ebuild56
-rw-r--r--sci-mathematics/drgeo/files/drgeo-1.1.0-gcc45.patch61
-rw-r--r--sci-mathematics/drgeo/metadata.xml16
-rw-r--r--sci-mathematics/e/Manifest3
-rw-r--r--sci-mathematics/e/e-1.5.ebuild128
-rw-r--r--sci-mathematics/e/e-1.6.ebuild128
-rw-r--r--sci-mathematics/e/e-1.8.ebuild119
-rw-r--r--sci-mathematics/e/metadata.xml32
-rw-r--r--sci-mathematics/ent/Manifest1
-rw-r--r--sci-mathematics/ent/ent-101202.ebuild29
-rw-r--r--sci-mathematics/ent/files/101202-gentoo.patch20
-rw-r--r--sci-mathematics/ent/metadata.xml8
-rw-r--r--sci-mathematics/euler/Manifest1
-rw-r--r--sci-mathematics/euler/euler-1.61.0.ebuild43
-rw-r--r--sci-mathematics/euler/files/command-gcc4-gentoo.patch12
-rw-r--r--sci-mathematics/euler/files/configure-gentoo.patch37
-rw-r--r--sci-mathematics/euler/files/euler-fortify.patch36
-rw-r--r--sci-mathematics/euler/files/euler-glibc-2.4-gentoo.patch13
-rw-r--r--sci-mathematics/euler/files/euler-xdg.patch23
-rw-r--r--sci-mathematics/euler/metadata.xml8
-rw-r--r--sci-mathematics/factmsieve/Manifest1
-rw-r--r--sci-mathematics/factmsieve/factmsieve-76.ebuild36
-rw-r--r--sci-mathematics/factmsieve/files/factmsieve-76.patch52
-rw-r--r--sci-mathematics/factmsieve/metadata.xml8
-rw-r--r--sci-mathematics/fann/Manifest2
-rw-r--r--sci-mathematics/fann/fann-2.1.0_beta-r1.ebuild99
-rw-r--r--sci-mathematics/fann/fann-2.2.0.ebuild41
-rw-r--r--sci-mathematics/fann/files/fann-2.0.0-benchmark.patch49
-rw-r--r--sci-mathematics/fann/files/fann-2.0.0-shared-libs-gentoo.patch23
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-asneeded.patch8
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-benchmark.patch80
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-examples.patch23
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-python.patch20
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-pythonlink.patch30
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-sizecheck.patch25
-rw-r--r--sci-mathematics/fann/files/fann-2.1.0_beta-valist.patch65
-rw-r--r--sci-mathematics/fann/files/fann-2.2.0-examples.patch23
-rw-r--r--sci-mathematics/fann/metadata.xml16
-rw-r--r--sci-mathematics/flint/Manifest4
-rw-r--r--sci-mathematics/flint/files/flint-2.4.3-cflags-ldflags.patch33
-rw-r--r--sci-mathematics/flint/files/flint-2.4.3-libdir.patch44
-rw-r--r--sci-mathematics/flint/files/flint-2.4.3-whitespaces.patch54
-rw-r--r--sci-mathematics/flint/files/flint-2.4.4-test.patch19
-rw-r--r--sci-mathematics/flint/files/flint-2.4.5-gmp6-compat.patch115
-rw-r--r--sci-mathematics/flint/files/flint-2.4.5-ntl62.patch13
-rw-r--r--sci-mathematics/flint/flint-2.3.ebuild33
-rw-r--r--sci-mathematics/flint/flint-2.4.3.ebuild62
-rw-r--r--sci-mathematics/flint/flint-2.4.4-r1.ebuild67
-rw-r--r--sci-mathematics/flint/flint-2.4.5.ebuild69
-rw-r--r--sci-mathematics/flint/metadata.xml16
-rw-r--r--sci-mathematics/form/Manifest1
-rw-r--r--sci-mathematics/form/form-4.1.ebuild82
-rw-r--r--sci-mathematics/form/metadata.xml12
-rw-r--r--sci-mathematics/freemat/Manifest1
-rw-r--r--sci-mathematics/freemat/files/freemat-4.0-gcc45.patch208
-rw-r--r--sci-mathematics/freemat/files/freemat-4.0-no_implicit_GLU.patch14
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-fixes.patch21
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-have_fftw.patch78
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-local_libffi.patch13
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-portaudio.patch10
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-python3.patch24
-rw-r--r--sci-mathematics/freemat/files/freemat-4.1-use_llvm.patch29
-rw-r--r--sci-mathematics/freemat/files/freemat-4.2-use_llvm.patch45
-rw-r--r--sci-mathematics/freemat/freemat-4.2.ebuild84
-rw-r--r--sci-mathematics/freemat/metadata.xml20
-rw-r--r--sci-mathematics/fricas/Manifest2
-rw-r--r--sci-mathematics/fricas/files/64fricas-gentoo.el2
-rw-r--r--sci-mathematics/fricas/fricas-1.2.5.ebuild90
-rw-r--r--sci-mathematics/fricas/fricas-1.2.6.ebuild90
-rw-r--r--sci-mathematics/fricas/metadata.xml29
-rw-r--r--sci-mathematics/frobby/Manifest1
-rw-r--r--sci-mathematics/frobby/files/frobby-cflags-no-strip-soname.patch47
-rw-r--r--sci-mathematics/frobby/files/frobby-gcc-4.7.patch32
-rw-r--r--sci-mathematics/frobby/files/frobby-gmp-5.1.patch12
-rw-r--r--sci-mathematics/frobby/frobby-0.9.0-r1.ebuild55
-rw-r--r--sci-mathematics/frobby/metadata.xml12
-rw-r--r--sci-mathematics/genius/Manifest3
-rw-r--r--sci-mathematics/genius/files/genius-1.0.17-gcc4.8.patch28
-rw-r--r--sci-mathematics/genius/files/genius-make.patch73
-rw-r--r--sci-mathematics/genius/genius-1.0.17.ebuild58
-rw-r--r--sci-mathematics/genius/genius-1.0.19.ebuild56
-rw-r--r--sci-mathematics/genius/metadata.xml19
-rw-r--r--sci-mathematics/geogebra/Manifest1
-rw-r--r--sci-mathematics/geogebra/files/geogebra-fix-install.sh.patch78
-rw-r--r--sci-mathematics/geogebra/geogebra-4.1.120.0.ebuild28
-rw-r--r--sci-mathematics/geogebra/metadata.xml13
-rw-r--r--sci-mathematics/geomview/Manifest2
-rw-r--r--sci-mathematics/geomview/files/50geomview-gentoo.el7
-rw-r--r--sci-mathematics/geomview/files/gvcl-mode.el172
-rw-r--r--sci-mathematics/geomview/geomview-1.9.5.ebuild69
-rw-r--r--sci-mathematics/geomview/metadata.xml12
-rw-r--r--sci-mathematics/gfan/Manifest1
-rw-r--r--sci-mathematics/gfan/files/gfan-0.5-double-declare-fix.patch12
-rw-r--r--sci-mathematics/gfan/gfan-0.5.ebuild34
-rw-r--r--sci-mathematics/gfan/metadata.xml12
-rw-r--r--sci-mathematics/ggnfs/Manifest4
-rw-r--r--sci-mathematics/ggnfs/files/ggnfs-0.77.1-gentoo.patch158
-rw-r--r--sci-mathematics/ggnfs/ggnfs-0.77.1-r2.ebuild67
-rw-r--r--sci-mathematics/ggnfs/metadata.xml11
-rw-r--r--sci-mathematics/gimps/Manifest6
-rw-r--r--sci-mathematics/gimps/files/gimps-25.6-conf.d12
-rw-r--r--sci-mathematics/gimps/files/gimps-26.6-r1-init.d37
-rw-r--r--sci-mathematics/gimps/files/gimps.service14
-rw-r--r--sci-mathematics/gimps/files/gimps.tmpfiles1
-rw-r--r--sci-mathematics/gimps/gimps-27.9-r2.ebuild66
-rw-r--r--sci-mathematics/gimps/gimps-28.5.ebuild66
-rw-r--r--sci-mathematics/gimps/gimps-28.6.ebuild66
-rw-r--r--sci-mathematics/gimps/metadata.xml9
-rw-r--r--sci-mathematics/ginac/Manifest3
-rw-r--r--sci-mathematics/ginac/files/ginac-1.5.1-pkgconfig.patch9
-rw-r--r--sci-mathematics/ginac/ginac-1.5.8.ebuild59
-rw-r--r--sci-mathematics/ginac/ginac-1.6.1.ebuild62
-rw-r--r--sci-mathematics/ginac/ginac-1.6.2.ebuild60
-rw-r--r--sci-mathematics/ginac/metadata.xml13
-rw-r--r--sci-mathematics/glpk/Manifest4
-rw-r--r--sci-mathematics/glpk/files/glpk-4.52.1-mariadb-5.5.patch11
-rw-r--r--sci-mathematics/glpk/files/glpk-4.53-debundle-system-libs.patch87
-rw-r--r--sci-mathematics/glpk/files/glpk-4.54-debundle-system-libs.patch86
-rw-r--r--sci-mathematics/glpk/glpk-4.45.ebuild64
-rw-r--r--sci-mathematics/glpk/glpk-4.48.ebuild53
-rw-r--r--sci-mathematics/glpk/glpk-4.54.ebuild59
-rw-r--r--sci-mathematics/glpk/glpk-4.55.ebuild59
-rw-r--r--sci-mathematics/glpk/metadata.xml14
-rw-r--r--sci-mathematics/gmm/Manifest1
-rw-r--r--sci-mathematics/gmm/gmm-4.2.ebuild16
-rw-r--r--sci-mathematics/gmm/metadata.xml17
-rw-r--r--sci-mathematics/gmp-ecm/Manifest2
-rw-r--r--sci-mathematics/gmp-ecm/gmp-ecm-6.4.3-r5.ebuild56
-rw-r--r--sci-mathematics/gmp-ecm/gmp-ecm-6.4.4-r1.ebuild65
-rw-r--r--sci-mathematics/gmp-ecm/gmp-ecm-9999.ebuild53
-rw-r--r--sci-mathematics/gmp-ecm/metadata.xml12
-rw-r--r--sci-mathematics/gretl/Manifest2
-rw-r--r--sci-mathematics/gretl/files/50gretl-gentoo.el16
-rw-r--r--sci-mathematics/gretl/files/gretl-1.9.14-readline.patch10
-rw-r--r--sci-mathematics/gretl/gretl-1.9.14.ebuild112
-rw-r--r--sci-mathematics/gretl/gretl-1.9.90.ebuild112
-rw-r--r--sci-mathematics/gretl/metadata.xml23
-rw-r--r--sci-mathematics/gsl-shell/Manifest1
-rw-r--r--sci-mathematics/gsl-shell/files/gsl-shell-2.2.0-pkg-config.patch33
-rw-r--r--sci-mathematics/gsl-shell/files/gsl-shell-font.patch10
-rw-r--r--sci-mathematics/gsl-shell/files/gsl-shell-nogui.patch25
-rw-r--r--sci-mathematics/gsl-shell/files/gsl-shell-strip.patch8
-rw-r--r--sci-mathematics/gsl-shell/files/gsl-shell-usr.patch8
-rw-r--r--sci-mathematics/gsl-shell/gsl-shell-2.2.0.ebuild64
-rw-r--r--sci-mathematics/gsl-shell/metadata.xml21
-rw-r--r--sci-mathematics/gwnum/Manifest1
-rw-r--r--sci-mathematics/gwnum/gwnum-277.ebuild34
-rw-r--r--sci-mathematics/gwnum/metadata.xml8
-rw-r--r--sci-mathematics/isabelle/Manifest11
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2011.1-gentoo-settings.patch39
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2011.1-graphbrowser.patch11
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2011.1-libsha1.patch11
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2011.1-proofgeneral-gentoo-path.patch39
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2011.1-reverse-line-editor-order.patch12
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-gentoo-settings.patch62
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-graphbrowser.patch11
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-libsha1.patch11
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-redundant-equations-in-function-definitions-error.patch35
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-reverse-line-editor-order.patch12
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2012-signal-handling.patch8
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2013-HOL-Predicate_Compile_Examples.patch82
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2013-classpath.patch149
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2013-gentoo-settings.patch19
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2013.2-HOL-Predicate_Compile_Examples.patch89
-rw-r--r--sci-mathematics/isabelle/files/isabelle-2013.2-classpath.patch135
-rw-r--r--sci-mathematics/isabelle/isabelle-2011.1-r2.ebuild254
-rw-r--r--sci-mathematics/isabelle/isabelle-2011.1.ebuild142
-rw-r--r--sci-mathematics/isabelle/isabelle-2012-r1.ebuild320
-rw-r--r--sci-mathematics/isabelle/isabelle-2013-r2.ebuild353
-rw-r--r--sci-mathematics/isabelle/isabelle-2013.2-r1.ebuild375
-rw-r--r--sci-mathematics/isabelle/metadata.xml43
-rw-r--r--sci-mathematics/jags/Manifest1
-rw-r--r--sci-mathematics/jags/jags-3.4.0.ebuild47
-rw-r--r--sci-mathematics/jags/metadata.xml18
-rw-r--r--sci-mathematics/kodkod/Manifest2
-rw-r--r--sci-mathematics/kodkod/files/kodkod-1.5.2-changes-in-most-specific-varargs-method-selection.patch28
-rw-r--r--sci-mathematics/kodkod/kodkod-1.5.2.ebuild142
-rw-r--r--sci-mathematics/kodkod/metadata.xml18
-rw-r--r--sci-mathematics/kodkodi/Manifest1
-rw-r--r--sci-mathematics/kodkodi/kodkodi-1.5.2.ebuild107
-rw-r--r--sci-mathematics/kodkodi/metadata.xml16
-rw-r--r--sci-mathematics/lpsolve/Manifest1
-rw-r--r--sci-mathematics/lpsolve/lpsolve-5.5.2.0.ebuild29
-rw-r--r--sci-mathematics/lpsolve/metadata.xml6
-rw-r--r--sci-mathematics/lybniz/Manifest1
-rw-r--r--sci-mathematics/lybniz/lybniz-1.3.2.ebuild31
-rw-r--r--sci-mathematics/lybniz/metadata.xml12
-rw-r--r--sci-mathematics/mathomatic/Manifest3
-rw-r--r--sci-mathematics/mathomatic/mathomatic-15.8.5.ebuild42
-rw-r--r--sci-mathematics/mathomatic/mathomatic-16.0.1.ebuild42
-rw-r--r--sci-mathematics/mathomatic/mathomatic-16.0.5.ebuild42
-rw-r--r--sci-mathematics/mathomatic/metadata.xml11
-rw-r--r--sci-mathematics/maxima/Manifest3
-rw-r--r--sci-mathematics/maxima/files/50maxima-gentoo.el12
-rw-r--r--sci-mathematics/maxima/files/clisp-0.patch19
-rw-r--r--sci-mathematics/maxima/files/clozurecl-0.patch27
-rw-r--r--sci-mathematics/maxima/files/clozurecl-1.patch28
-rw-r--r--sci-mathematics/maxima/files/cmucl-0.patch27
-rw-r--r--sci-mathematics/maxima/files/ecls-0.patch27
-rw-r--r--sci-mathematics/maxima/files/ecls-1.patch37
-rw-r--r--sci-mathematics/maxima/files/imaxima-0.patch5
-rw-r--r--sci-mathematics/maxima/files/maxima-5.26.0-ecls-12.2.1.patch8
-rw-r--r--sci-mathematics/maxima/files/maxima-5.26.0-wish.patch28
-rw-r--r--sci-mathematics/maxima/files/maxima-5.26.0.patch37
-rw-r--r--sci-mathematics/maxima/files/maxima-5.27.0-inhibit-sys_usr-inits.patch24
-rw-r--r--sci-mathematics/maxima/files/maxima-5.27.0-wish.patch28
-rw-r--r--sci-mathematics/maxima/files/maxima-5.27.0.patch37
-rw-r--r--sci-mathematics/maxima/files/maxima-5.28.0-sbcl.patch8
-rw-r--r--sci-mathematics/maxima/files/maxima-5.28.0-wish.patch28
-rw-r--r--sci-mathematics/maxima/files/maxima-5.28.0.patch51
-rw-r--r--sci-mathematics/maxima/files/maxima-5.29.1-sbcl.patch8
-rw-r--r--sci-mathematics/maxima/files/maxima-5.29.1-wish.patch28
-rw-r--r--sci-mathematics/maxima/files/maxima-5.29.1.patch51
-rw-r--r--sci-mathematics/maxima/files/maxima-ccl.patch8
-rw-r--r--sci-mathematics/maxima/files/maxima-ecl-ldflags.patch27
-rw-r--r--sci-mathematics/maxima/files/maxima-imaxima.patch5
-rw-r--r--sci-mathematics/maxima/files/maxima-no-init-files.patch31
-rw-r--r--sci-mathematics/maxima/files/maxima-rmaxima.patch25
-rw-r--r--sci-mathematics/maxima/files/maxima-xdg-utils.patch35
-rw-r--r--sci-mathematics/maxima/files/rmaxima-0.patch25
-rw-r--r--sci-mathematics/maxima/files/sbcl-0.patch26
-rw-r--r--sci-mathematics/maxima/files/wish-0.patch28
-rw-r--r--sci-mathematics/maxima/files/wish-1.patch28
-rw-r--r--sci-mathematics/maxima/files/xdg-utils-0.patch35
-rw-r--r--sci-mathematics/maxima/maxima-5.18.1.ebuild175
-rw-r--r--sci-mathematics/maxima/maxima-5.34.1.ebuild190
-rw-r--r--sci-mathematics/maxima/maxima-5.36.1.ebuild190
-rw-r--r--sci-mathematics/maxima/metadata.xml32
-rw-r--r--sci-mathematics/metadata.xml37
-rw-r--r--sci-mathematics/minisat/Manifest3
-rw-r--r--sci-mathematics/minisat/files/minisat-2.2.0-header_fix.patch160
-rw-r--r--sci-mathematics/minisat/metadata.xml9
-rw-r--r--sci-mathematics/minisat/minisat-2.1.0.ebuild96
-rw-r--r--sci-mathematics/minisat/minisat-2.2.0-r3.ebuild93
-rw-r--r--sci-mathematics/mlpy/Manifest1
-rw-r--r--sci-mathematics/mlpy/metadata.xml18
-rw-r--r--sci-mathematics/mlpy/mlpy-3.5.0.ebuild35
-rw-r--r--sci-mathematics/msieve/Manifest1
-rw-r--r--sci-mathematics/msieve/files/fix-version.patch15
-rw-r--r--sci-mathematics/msieve/files/fix-version2.patch14
-rw-r--r--sci-mathematics/msieve/files/msieve-1.51-reduce-printf.patch44
-rw-r--r--sci-mathematics/msieve/files/reduce-printf.patch62
-rw-r--r--sci-mathematics/msieve/files/reduce-printf2.patch52
-rw-r--r--sci-mathematics/msieve/files/reduce-printf3.patch31
-rw-r--r--sci-mathematics/msieve/metadata.xml11
-rw-r--r--sci-mathematics/msieve/msieve-1.51.ebuild56
-rw-r--r--sci-mathematics/msieve/msieve-9999.ebuild55
-rw-r--r--sci-mathematics/nauty/Manifest1
-rw-r--r--sci-mathematics/nauty/metadata.xml15
-rw-r--r--sci-mathematics/nauty/nauty-2.5.9.ebuild42
-rw-r--r--sci-mathematics/nestedsums/Manifest1
-rw-r--r--sci-mathematics/nestedsums/metadata.xml12
-rw-r--r--sci-mathematics/nestedsums/nestedsums-1.4.12-r1.ebuild32
-rw-r--r--sci-mathematics/normaliz/Manifest1
-rw-r--r--sci-mathematics/normaliz/files/normaliz-2.12.1-respect-flags.patch47
-rw-r--r--sci-mathematics/normaliz/files/normaliz-2.12.2-gcc49.patch11
-rw-r--r--sci-mathematics/normaliz/metadata.xml17
-rw-r--r--sci-mathematics/normaliz/normaliz-2.12.2.ebuild64
-rw-r--r--sci-mathematics/num-utils/Manifest3
-rw-r--r--sci-mathematics/num-utils/metadata.xml5
-rw-r--r--sci-mathematics/num-utils/num-utils-0.3.ebuild26
-rw-r--r--sci-mathematics/num-utils/num-utils-0.5-r1.ebuild48
-rw-r--r--sci-mathematics/nusmv/Manifest6
-rw-r--r--sci-mathematics/nusmv/files/MiniSat_v1.14-optimizedlib.patch44
-rw-r--r--sci-mathematics/nusmv/files/MiniSat_v1.14_gcc41.patch92
-rw-r--r--sci-mathematics/nusmv/files/cudd-no-pentium4.patch11
-rw-r--r--sci-mathematics/nusmv/metadata.xml11
-rw-r--r--sci-mathematics/nusmv/nusmv-2.3.1.ebuild121
-rw-r--r--sci-mathematics/nusmv/nusmv-2.5.0.ebuild133
-rw-r--r--sci-mathematics/nusmv/nusmv-2.5.2.ebuild132
-rw-r--r--sci-mathematics/nusmv/nusmv-2.5.3.ebuild132
-rw-r--r--sci-mathematics/nusmv/nusmv-2.5.4.ebuild135
-rw-r--r--sci-mathematics/octave-epstk/Manifest4
-rw-r--r--sci-mathematics/octave-epstk/metadata.xml11
-rw-r--r--sci-mathematics/octave-epstk/octave-epstk-2.3.ebuild40
-rw-r--r--sci-mathematics/octave-epstk/octave-epstk-2.4.ebuild40
-rw-r--r--sci-mathematics/octave/Manifest4
-rw-r--r--sci-mathematics/octave/files/octave-3.4.3-pkgbuilddir.patch44
-rw-r--r--sci-mathematics/octave/files/octave-3.4.3-texi.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.6.3-legendtext.patch13
-rw-r--r--sci-mathematics/octave/files/octave-3.6.4-gcc-4.8.patch34
-rw-r--r--sci-mathematics/octave/files/octave-3.6.4-texinfo.patch378
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-fix-compile.patch11
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-imagemagick-configure.patch16
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-llvm-3.4.patch63
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-llvm-configure.patch12
-rw-r--r--sci-mathematics/octave/files/octave-3.8.0-pkgbuilddir.patch40
-rw-r--r--sci-mathematics/octave/files/octave-3.8.1-imagemagick.patch138
-rw-r--r--sci-mathematics/octave/files/octave-3.8.1-pkgbuilddir.patch41
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch16
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch139
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-llvm-3.5-gnulib-hg.patch19
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch130
-rw-r--r--sci-mathematics/octave/metadata.xml20
-rw-r--r--sci-mathematics/octave/octave-3.6.4-r1.ebuild134
-rw-r--r--sci-mathematics/octave/octave-3.6.4.ebuild132
-rw-r--r--sci-mathematics/octave/octave-3.8.1-r1.ebuild163
-rw-r--r--sci-mathematics/octave/octave-3.8.1.ebuild202
-rw-r--r--sci-mathematics/octave/octave-3.8.2.ebuild163
-rw-r--r--sci-mathematics/octave/octave-4.0.0.ebuild169
-rw-r--r--sci-mathematics/otter/Manifest1
-rw-r--r--sci-mathematics/otter/files/otter-3.3-build.patch114
-rw-r--r--sci-mathematics/otter/files/otter-3.3-gold.patch16
-rw-r--r--sci-mathematics/otter/metadata.xml5
-rw-r--r--sci-mathematics/otter/otter-3.3-r1.ebuild35
-rw-r--r--sci-mathematics/otter/otter-3.3-r2.ebuild44
-rw-r--r--sci-mathematics/p9m4/Manifest2
-rw-r--r--sci-mathematics/p9m4/files/p9m4-v05-package.patch67
-rw-r--r--sci-mathematics/p9m4/files/p9m4-v05-python2.6.patch44
-rw-r--r--sci-mathematics/p9m4/files/p9m4-v05-use-inst-paths.patch42
-rw-r--r--sci-mathematics/p9m4/metadata.xml14
-rw-r--r--sci-mathematics/p9m4/p9m4-05-r1.ebuild109
-rw-r--r--sci-mathematics/pari-data/Manifest5
-rw-r--r--sci-mathematics/pari-data/metadata.xml15
-rw-r--r--sci-mathematics/pari-data/pari-data-20120726.ebuild26
-rw-r--r--sci-mathematics/pari/Manifest12
-rw-r--r--sci-mathematics/pari/files/50pari-gentoo.el10
-rw-r--r--sci-mathematics/pari/files/pari-2.3.2-ppc-powerpc-arch-fix.patch11
-rw-r--r--sci-mathematics/pari/files/pari-2.3.2-strip.patch11
-rw-r--r--sci-mathematics/pari/files/pari-2.3.5-doc-make.patch46
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-doc-make.patch82
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-macos.patch21
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-mp.c.patch23
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-1302.patch33
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-1304.patch39
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-gcc47.patch18
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-no-automagic.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.5.4-polred.patch754
-rw-r--r--sci-mathematics/pari/files/pari-2.5.4-slow_determinant.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-doc-make.patch89
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-no-automagic.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-slow-discriminant.patch54
-rw-r--r--sci-mathematics/pari/metadata.xml25
-rw-r--r--sci-mathematics/pari/pari-2.3.5.ebuild138
-rw-r--r--sci-mathematics/pari/pari-2.5.0-r3.ebuild135
-rw-r--r--sci-mathematics/pari/pari-2.5.1-r1.ebuild137
-rw-r--r--sci-mathematics/pari/pari-2.5.1.ebuild137
-rw-r--r--sci-mathematics/pari/pari-2.5.2.ebuild133
-rw-r--r--sci-mathematics/pari/pari-2.5.3.ebuild133
-rw-r--r--sci-mathematics/pari/pari-2.5.4.ebuild141
-rw-r--r--sci-mathematics/pari/pari-2.7.0.ebuild133
-rw-r--r--sci-mathematics/pari/pari-2.7.1.ebuild133
-rw-r--r--sci-mathematics/polymake/Manifest3
-rw-r--r--sci-mathematics/polymake/files/polymake_gcc49.patch68
-rw-r--r--sci-mathematics/polymake/metadata.xml25
-rw-r--r--sci-mathematics/polymake/polymake-2.13.ebuild64
-rw-r--r--sci-mathematics/polymake/polymake-2.14-r1.ebuild90
-rw-r--r--sci-mathematics/polymake/polymake-2.14.ebuild59
-rw-r--r--sci-mathematics/prng/Manifest1
-rw-r--r--sci-mathematics/prng/files/prng-3.0.2-shared.patch52
-rw-r--r--sci-mathematics/prng/metadata.xml13
-rw-r--r--sci-mathematics/prng/prng-3.0.2.ebuild30
-rw-r--r--sci-mathematics/prover9/Manifest2
-rw-r--r--sci-mathematics/prover9/files/LADR-2009-11A-manpages.patch466
-rw-r--r--sci-mathematics/prover9/metadata.xml15
-rw-r--r--sci-mathematics/prover9/prover9-2009.11a.ebuild120
-rw-r--r--sci-mathematics/pspp/Manifest2
-rw-r--r--sci-mathematics/pspp/files/50pspp-gentoo.el6
-rw-r--r--sci-mathematics/pspp/files/pspp-0.8.0-gettext.patch10
-rw-r--r--sci-mathematics/pspp/files/pspp-0.8.1-oos.patch28
-rw-r--r--sci-mathematics/pspp/files/pspp-0.8.1-underlinking.patch29
-rw-r--r--sci-mathematics/pspp/metadata.xml13
-rw-r--r--sci-mathematics/pspp/pspp-0.8.1-r1.ebuild91
-rw-r--r--sci-mathematics/pspp/pspp-0.8.3.ebuild90
-rw-r--r--sci-mathematics/pymc/Manifest1
-rw-r--r--sci-mathematics/pymc/metadata.xml15
-rw-r--r--sci-mathematics/pymc/pymc-2.2.ebuild24
-rw-r--r--sci-mathematics/pymc/pymc-9999.ebuild24
-rw-r--r--sci-mathematics/qtoctave/Manifest1
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-build-out-of-source.patch20
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-build-widgetserver.patch98
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-desktop-file.patch8
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-doc-path.patch64
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-filedialog-filters.patch37
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-initial_position.patch61
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-no-native-menubars.patch35
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-qtinfo-octave3.4.patch15
-rw-r--r--sci-mathematics/qtoctave/files/qtoctave-0.10.1-use_octave_htmldoc.patch34
-rw-r--r--sci-mathematics/qtoctave/metadata.xml13
-rw-r--r--sci-mathematics/qtoctave/qtoctave-0.10.1-r1.ebuild48
-rw-r--r--sci-mathematics/reduce/Manifest1
-rw-r--r--sci-mathematics/reduce/files/64reduce-gentoo.el4
-rwxr-xr-xsci-mathematics/reduce/files/csl2
-rwxr-xr-xsci-mathematics/reduce/files/redcsl2
-rw-r--r--sci-mathematics/reduce/metadata.xml16
-rw-r--r--sci-mathematics/reduce/reduce-20110414-r1.ebuild95
-rw-r--r--sci-mathematics/relational/Manifest1
-rw-r--r--sci-mathematics/relational/metadata.xml8
-rw-r--r--sci-mathematics/relational/relational-0.11.ebuild51
-rw-r--r--sci-mathematics/rkward/Manifest1
-rw-r--r--sci-mathematics/rkward/metadata.xml13
-rw-r--r--sci-mathematics/rkward/rkward-0.6.1.ebuild37
-rw-r--r--sci-mathematics/rngstreams/Manifest1
-rw-r--r--sci-mathematics/rngstreams/metadata.xml12
-rw-r--r--sci-mathematics/rngstreams/rngstreams-1.0.1.ebuild25
-rw-r--r--sci-mathematics/rstudio/Manifest20
-rw-r--r--sci-mathematics/rstudio/files/rsession.conf26
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-linker_flags.patch18
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-paths.patch110
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-prefs.patch24
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.336-boost-1.53.patch64
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.336-linker_flags.patch18
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.336-paths.patch112
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.336-prefs.patch24
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.551-boost-1.53.patch64
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.551-linker_flags.patch18
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.551-paths.patch112
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.551-prefs.patch24
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.1091-boost-1.57.patch60
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.1091-pandoc.patch26
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.490-linker_flags.patch18
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.490-paths.patch120
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.490-prefs.patch24
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.932-pandoc.patch25
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.98.932-paths.patch140
-rw-r--r--sci-mathematics/rstudio/files/rstudio-server.conf35
-rw-r--r--sci-mathematics/rstudio/files/rstudio-server.initd15
-rw-r--r--sci-mathematics/rstudio/metadata.xml18
-rw-r--r--sci-mathematics/rstudio/rstudio-0.97.336.ebuild141
-rw-r--r--sci-mathematics/rstudio/rstudio-0.97.551.ebuild141
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.1028.ebuild162
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.1091.ebuild196
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.490-r1.ebuild127
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.490.ebuild140
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.932.ebuild172
-rw-r--r--sci-mathematics/rstudio/rstudio-0.98.953.ebuild173
-rw-r--r--sci-mathematics/rw/Manifest1
-rw-r--r--sci-mathematics/rw/metadata.xml28
-rw-r--r--sci-mathematics/rw/rw-0.7.ebuild41
-rw-r--r--sci-mathematics/sha1-polyml/Manifest1
-rw-r--r--sci-mathematics/sha1-polyml/metadata.xml14
-rw-r--r--sci-mathematics/sha1-polyml/sha1-polyml-5.5.0.ebuild79
-rw-r--r--sci-mathematics/singular/Manifest4
-rw-r--r--sci-mathematics/singular/files/60singular-gentoo.el10
-rw-r--r--sci-mathematics/singular/files/singular-3.0.4.4-nostrip.patch12
-rw-r--r--sci-mathematics/singular/files/singular-3.1.0-emacs-22.patch13
-rw-r--r--sci-mathematics/singular/files/singular-3.1.0-gentoo.patch81
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.2-python.patch45
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-Minor.h.patch10
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-install_name.patch23
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-os_x_ppc.patch14
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3.make_parallel.2.patch45
-rw-r--r--sci-mathematics/singular/files/singular-3.1.6-factory_template_instantiation.patch26
-rw-r--r--sci-mathematics/singular/files/singular-3.1.6-ntl6compat.patch44
-rw-r--r--sci-mathematics/singular/files/singular-4.0.0-fix-omalloc-ar-detection.patch12
-rw-r--r--sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch38
-rw-r--r--sci-mathematics/singular/metadata.xml12
-rw-r--r--sci-mathematics/singular/singular-3.1.6.ebuild176
-rw-r--r--sci-mathematics/singular/singular-4.0.2.ebuild145
-rw-r--r--sci-mathematics/snns/Manifest8
-rw-r--r--sci-mathematics/snns/files/4.2-fPIC-python.patch12
-rw-r--r--sci-mathematics/snns/files/4.2-ldflags.patch42
-rw-r--r--sci-mathematics/snns/files/4.3-bison-version.patch11
-rw-r--r--sci-mathematics/snns/files/4.3-snns-netperf.patch164
-rw-r--r--sci-mathematics/snns/files/4.3-unstrip.patch11
-rw-r--r--sci-mathematics/snns/metadata.xml9
-rw-r--r--sci-mathematics/snns/snns-4.2-r8.ebuild134
-rw-r--r--sci-mathematics/snns/snns-4.2-r9.ebuild123
-rw-r--r--sci-mathematics/snns/snns-4.3-r2.ebuild124
-rw-r--r--sci-mathematics/spass/Manifest1
-rw-r--r--sci-mathematics/spass/metadata.xml15
-rw-r--r--sci-mathematics/spass/spass-3.7.ebuild81
-rw-r--r--sci-mathematics/spin/Manifest3
-rw-r--r--sci-mathematics/spin/files/spin-6.0.1-makefile.patch21
-rw-r--r--sci-mathematics/spin/files/spin-6.2.1-makefile.patch21
-rw-r--r--sci-mathematics/spin/files/spin-6.2.5-makefile.patch21
-rw-r--r--sci-mathematics/spin/metadata.xml8
-rw-r--r--sci-mathematics/spin/spin-6.2.1.ebuild43
-rw-r--r--sci-mathematics/spin/spin-6.2.3.ebuild48
-rw-r--r--sci-mathematics/spin/spin-6.2.5.ebuild48
-rw-r--r--sci-mathematics/topcom/Manifest2
-rw-r--r--sci-mathematics/topcom/files/topcom-0.17.4-buildsystem.patch105
-rw-r--r--sci-mathematics/topcom/files/topcom-0.17.4-no-internal-libs.patch77
-rw-r--r--sci-mathematics/topcom/metadata.xml12
-rw-r--r--sci-mathematics/topcom/topcom-0.17.4-r1.ebuild60
-rw-r--r--sci-mathematics/twelf/Manifest1
-rw-r--r--sci-mathematics/twelf/files/50twelf-gentoo.el4
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-Makefile.patch43
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-doc-guide-Makefile.patch13
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-doc-guide-twelf-dot-texi.patch14
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-emacs-twelf-init.patch22
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-emacs-twelf.patch11
-rw-r--r--sci-mathematics/twelf/files/twelf-1.7.1-mlton-mlb.patch409
-rw-r--r--sci-mathematics/twelf/metadata.xml13
-rw-r--r--sci-mathematics/twelf/twelf-1.7.1.ebuild111
-rw-r--r--sci-mathematics/unuran/Manifest1
-rw-r--r--sci-mathematics/unuran/files/unuran-1.8.0-nogsl.patch48
-rw-r--r--sci-mathematics/unuran/metadata.xml16
-rw-r--r--sci-mathematics/unuran/unuran-1.8.1.ebuild45
-rw-r--r--sci-mathematics/wxmaxima/Manifest2
-rw-r--r--sci-mathematics/wxmaxima/metadata.xml15
-rw-r--r--sci-mathematics/wxmaxima/wxmaxima-13.04.2.ebuild80
-rw-r--r--sci-mathematics/wxmaxima/wxmaxima-15.04.0-r1.ebuild77
-rw-r--r--sci-mathematics/xmds/Manifest3
-rw-r--r--sci-mathematics/xmds/files/xmds-1.6.5-gcc43.patch108
-rw-r--r--sci-mathematics/xmds/metadata.xml18
-rw-r--r--sci-mathematics/xmds/xmds-1.6.5.ebuild58
-rw-r--r--sci-mathematics/xmds/xmds-1.6.6.ebuild51
-rw-r--r--sci-mathematics/yacas/Manifest3
-rw-r--r--sci-mathematics/yacas/files/yacas-1.3.4-java-version.patch29
-rw-r--r--sci-mathematics/yacas/metadata.xml16
-rw-r--r--sci-mathematics/yacas/yacas-1.3.2.ebuild46
-rw-r--r--sci-mathematics/yacas/yacas-1.3.3.ebuild46
-rw-r--r--sci-mathematics/yacas/yacas-1.3.4.ebuild55
-rw-r--r--sci-mathematics/yafu/Manifest1
-rw-r--r--sci-mathematics/yafu/files/fix-Makefile.patch11
-rw-r--r--sci-mathematics/yafu/metadata.xml11
-rw-r--r--sci-mathematics/yafu/yafu-1.34.3.ebuild56
-rw-r--r--sci-mathematics/yafu/yafu-9999.ebuild56
604 files changed, 28884 insertions, 0 deletions
diff --git a/sci-mathematics/4ti2/4ti2-1.6.2.ebuild b/sci-mathematics/4ti2/4ti2-1.6.2.ebuild
new file mode 100644
index 00000000000..ff139bab6de
--- /dev/null
+++ b/sci-mathematics/4ti2/4ti2-1.6.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+# The swig subdir is not used, so we can skip running autotools in it. #518000
+AT_NO_RECURSIVE=1
+
+inherit autotools-utils
+
+DESCRIPTION="Software package for algebraic, geometric and combinatorial problems"
+HOMEPAGE="http://www.4ti2.de/"
+SRC_URI="http://4ti2.de/version_${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~x86-macos"
+IUSE="static-libs"
+
+DEPEND="
+ sci-mathematics/glpk:0[gmp]
+ dev-libs/gmp[cxx]"
+RDEPEND="${DEPEND}"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.2-gold.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:^CXX.*$:CXX=$(tc-getCXX):g" \
+ -i m4/glpk-check.m4 || die
+ autotools-utils_src_prepare
+}
diff --git a/sci-mathematics/4ti2/4ti2-1.6.5.ebuild b/sci-mathematics/4ti2/4ti2-1.6.5.ebuild
new file mode 100644
index 00000000000..dff289ba2ed
--- /dev/null
+++ b/sci-mathematics/4ti2/4ti2-1.6.5.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+# The swig subdir is not used, so we can skip running autotools in it. #518000
+AT_NO_RECURSIVE=1
+
+inherit autotools-utils
+
+DESCRIPTION="Software package for algebraic, geometric and combinatorial problems"
+HOMEPAGE="http://www.4ti2.de/"
+SRC_URI="http://4ti2.de/version_${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x86-macos"
+IUSE="static-libs"
+
+DEPEND="
+ sci-mathematics/glpk:0[gmp]
+ dev-libs/gmp[cxx]"
+RDEPEND="${DEPEND}"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.2-gold.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:^CXX.*$:CXX=$(tc-getCXX):g" \
+ -i m4/glpk-check.m4 || die
+ autotools-utils_src_prepare
+}
diff --git a/sci-mathematics/4ti2/4ti2-1.6.6.ebuild b/sci-mathematics/4ti2/4ti2-1.6.6.ebuild
new file mode 100644
index 00000000000..ff6ee4ba63e
--- /dev/null
+++ b/sci-mathematics/4ti2/4ti2-1.6.6.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+# The swig subdir is not used, so we can skip running autotools in it. #518000
+AT_NO_RECURSIVE=1
+
+inherit autotools-utils
+
+DESCRIPTION="Software package for algebraic, geometric and combinatorial problems"
+HOMEPAGE="http://www.4ti2.de/"
+SRC_URI="http://4ti2.de/version_${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~x86 ~x86-macos"
+IUSE="static-libs"
+
+DEPEND="
+ sci-mathematics/glpk:0[gmp]
+ dev-libs/gmp[cxx]"
+RDEPEND="${DEPEND}"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.2-gold.patch
+ )
+
+src_prepare() {
+ sed \
+ -e "s:^CXX.*$:CXX=$(tc-getCXX):g" \
+ -i m4/glpk-check.m4 || die
+ autotools-utils_src_prepare
+}
diff --git a/sci-mathematics/4ti2/Manifest b/sci-mathematics/4ti2/Manifest
new file mode 100644
index 00000000000..eda26f1f47d
--- /dev/null
+++ b/sci-mathematics/4ti2/Manifest
@@ -0,0 +1,3 @@
+DIST 4ti2-1.6.2.tar.gz 5531651 SHA256 e1b39c5c051904e41deefce5419b16d723b1f403c616ddd6e3610e260d4b5711 SHA512 ff68f767b8677ce0ce94cca39fa3ef87835d77a951f0ec6ae28ab171bf09ae25c551d88c2cdf5bf3115b33bd32366b063533a1c22576130a00f542f9370bcd7b WHIRLPOOL f125cee526f8d2693b01978fd39cc36c900e7611ac0b8026f33c68ec8ccb0bb29cdffdf5c11adc6a5f7041389d34e6cacff173437c4be725c9b390a25e24e397
+DIST 4ti2-1.6.5.tar.gz 5640117 SHA256 079abe725fb1cc811184eca1d079a51f701a20c02c894422be59cd923c2cd21b SHA512 90dc105d99659e3c2213b484b6d21e877d7484ca0ad0373ece066df26de7c0e0cce614faaae9f7b678d03fa54f987fe95ab6d3f958477b1294a2dc00733a3a08 WHIRLPOOL b72d84e4e9557f85cadd3d93305b19162e85321bbc8dc974febe5f01e4a218c61d5e831de0ae8fc294e0f21c2469c663e53dde41f2e943db9df6011b758c1ccf
+DIST 4ti2-1.6.6.tar.gz 5640126 SHA256 2ae9f7dd6a387fd6f0454b4bc2d02cf389f504230cc9f782c35bb5ea4a8df10a SHA512 89f36aaf3d8f41bb31b37b44a013ea966d9664880473ad0d6d1825ffb00afec1eff3139c09ac6b684f0679e2ae0d201a84396bb721aa1f63dc1deca592392c41 WHIRLPOOL c5255ffe43eb65ec7d19f8cf24de3ab69e5f2466a91009a336a367cfab768d882781a91ab82d3077600edc08c6fb3f6f3686536e8e5bcbc6a1ca16f1feaa0ef0
diff --git a/sci-mathematics/4ti2/files/4ti2-1.3.2-gold.patch b/sci-mathematics/4ti2/files/4ti2-1.3.2-gold.patch
new file mode 100644
index 00000000000..bb1e8c4aad3
--- /dev/null
+++ b/sci-mathematics/4ti2/files/4ti2-1.3.2-gold.patch
@@ -0,0 +1,17 @@
+ m4/glpk-check.m4 | 2 +-
+ src/groebner/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/groebner/Makefile.am b/src/groebner/Makefile.am
+index 992c4ae..ba2f463 100644
+--- a/src/groebner/Makefile.am
++++ b/src/groebner/Makefile.am
+@@ -269,7 +269,7 @@ lib4ti2int64_la_SOURCES = $(lib4ti2sources)
+ # Arbitrary precision flags.
+ # 4ti2 uses GMP (GLPL), an arbitrary precision arithmetic library.
+ if HAVE_GMP_WITH_CXX
+-4ti2gmp_LDADD = lib4ti2gmp.la
++4ti2gmp_LDADD = lib4ti2gmp.la -lgmp
+ 4ti2gmp_CPPFLAGS = -D_4ti2_GMP_ $(GMP_CFLAGS)
+ 4ti2gmp_SOURCES = $(4ti2sources)
+ lib4ti2gmp_la_CPPFLAGS = -D_4ti2_GMP_
diff --git a/sci-mathematics/4ti2/metadata.xml b/sci-mathematics/4ti2/metadata.xml
new file mode 100644
index 00000000000..2b81252f2c5
--- /dev/null
+++ b/sci-mathematics/4ti2/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+ </maintainer>
+ <herd>sci-mathematics</herd>
+ <longdescription lang="en">
+4ti2 is a software package for algebraic, geometric and combinatorial problems
+on linear spaces and for toric ideals too.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/Macaulay2/Macaulay2-1.7_pre.ebuild b/sci-mathematics/Macaulay2/Macaulay2-1.7_pre.ebuild
new file mode 100644
index 00000000000..b7bd82d811d
--- /dev/null
+++ b/sci-mathematics/Macaulay2/Macaulay2-1.7_pre.ebuild
@@ -0,0 +1,154 @@
+# 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 elisp-common eutils flag-o-matic python-single-r1 toolchain-funcs
+
+FACTORY="factory-4.0.0+m4"
+FACTORY_GFTABLES="factory.4.0.1-gftables"
+
+DESCRIPTION="Research tool for commutative algebra and algebraic geometry"
+HOMEPAGE="http://www.math.uiuc.edu/Macaulay2/"
+BASE_URI="http://www.math.uiuc.edu/Macaulay2/Downloads/OtherSourceCode/trunk"
+SRC_URI="
+ http://dev.gentoo.org/~tomka/files/${P}.tar.bz2
+ ${BASE_URI}/${FACTORY}.tar.gz
+ ${BASE_URI}/${FACTORY_GFTABLES}.tar.gz
+ ${BASE_URI}/gtest-1.7.0.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+IUSE="debug emacs +optimization"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="${PYTHON_DEPS}
+ sys-process/time
+ virtual/pkgconfig"
+
+RDEPEND="${PYTHON_DEPS}
+ sys-libs/gdbm
+ <dev-libs/ntl-7
+ sci-mathematics/pari[gmp]
+ >=sys-libs/readline-6.1
+ dev-libs/libxml2:2
+ sci-mathematics/flint[gc]
+ sci-mathematics/frobby
+ sci-mathematics/4ti2
+ sci-mathematics/nauty
+ >=sci-mathematics/normaliz-2.8
+ sci-mathematics/gfan
+ sci-libs/mpir[cxx]
+ dev-libs/mpfr
+ sci-libs/cdd+
+ sci-libs/cddlib
+ sci-libs/lrslib[gmp]
+ virtual/blas
+ virtual/lapack
+ dev-util/ctags
+ sys-libs/ncurses
+ >=dev-libs/boehm-gc-7.4[threads]
+ dev-libs/libatomic_ops
+ emacs? ( virtual/emacs )"
+
+SITEFILE=70Macaulay2-gentoo.el
+
+S="${WORKDIR}/M2/"
+
+pkg_setup () {
+ tc-export CC CPP CXX PKG_CONFIG
+ append-cppflags "-I/usr/include/frobby"
+ # gtest needs python:2
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Patching .m2 files to look for external programs in
+ # /usr/bin
+ epatch "${FILESDIR}"/1.6-paths-of-external-programs.patch
+
+ # Shortcircuit lapack tests
+ epatch "${FILESDIR}"/1.6-lapack.patch
+
+ # Factory is a statically linked library which (in this flavor) are not used by any
+ # other program. We build it internally and don't install it.
+ cp "${DISTDIR}/${FACTORY}.tar.gz" "${S}/BUILD/tarfiles/" \
+ || die "copy failed"
+ cp "${DISTDIR}/${FACTORY_GFTABLES}.tar.gz" "${S}/BUILD/tarfiles/" \
+ || die "copy failed"
+ # Macaulay2 developers want that gtest is built internally because
+ # the documentation says it may fail if build with options not the
+ # same as the tested program.
+ cp "${DISTDIR}/gtest-1.7.0.tar.gz" "${S}/BUILD/tarfiles/" \
+ || die "copy failed"
+
+ eautoreconf
+}
+
+src_configure (){
+ # Recommended in bug #268064 Possibly unecessary
+ # but should not hurt anybody.
+ if ! use emacs; then
+ tags="ctags"
+ fi
+
+ # configure instead of econf to enable install with --prefix
+ ./configure LIBS="$($(tc-getPKG_CONFIG) --libs lapack)" \
+ --prefix="${D}/usr" \
+ --disable-encap \
+ --disable-strip \
+ --with-issue=Gentoo \
+ $(use_enable optimization optimize) \
+ $(use_enable debug) \
+ --enable-build-libraries="factory" \
+ --with-unbuilt-programs="4ti2 gfan normaliz nauty cddplus lrslib" \
+ || die "failed to configure Macaulay"
+}
+
+src_compile() {
+ # Parallel build not supported yet
+ emake IgnoreExampleErrors=true -j1
+
+ if use emacs; then
+ cd "${S}/Macaulay2/emacs" || die
+ elisp-compile *.el
+ fi
+}
+
+src_test() {
+ # No parallel tests yet & Need to increase the time
+ # limit for long running tests in Schubert2 to pass
+ emake TLIMIT=550 -j1 check
+}
+
+src_install () {
+ # Parallel install not supported yet
+ emake IgnoreExampleErrors=true -j1 install
+
+ # Remove emacs files and install them in the
+ # correct place if use emacs
+ rm -rf "${ED}"/usr/share/emacs/site-lisp || die
+ if use emacs; then
+ cd "${S}/Macaulay2/emacs" || die
+ elisp-install ${PN} *.elc *.el
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ elog "If you want to set a hot key for Macaulay2 in Emacs add a line similar to"
+ elog "(global-set-key [ f12 ] 'M2)"
+ elog "in order to set it to F12 (or choose a different one)."
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/Macaulay2/Manifest b/sci-mathematics/Macaulay2/Manifest
new file mode 100644
index 00000000000..1cab32948f7
--- /dev/null
+++ b/sci-mathematics/Macaulay2/Manifest
@@ -0,0 +1,4 @@
+DIST Macaulay2-1.7_pre.tar.bz2 4639477 SHA256 b14918187724f8911bc50edf87c9692209ff0c2191feb257084adc87609eb1cd SHA512 e70376d1e54b6e239ebb3bf676507a2115fdf5c4fbe05f320553029a84114b74d78f54e4d1bdc7643131f3c45c301e83c21ff99e4d4b675372e971368398d6f5 WHIRLPOOL 396311aadb8a7845deaee5aeca49c431430abc46201e935ef72c4579c9cbe6cd4da85f3e09ff0fe647031f8050fb7c62f63ecce251bf34648c1848cd00eef68e
+DIST factory-4.0.0+m4.tar.gz 4711126 SHA256 9b2498cc7fc6765f1c586e8061ebe236cdce4b32a44721a235ad2644ec3124fb SHA512 1dacb9aae52e655bccbbc960397b02351050791594dd9c39771f0da7f8c6e8130a8827c2a675c3fbaaa214606e123ac9776e1c73d143649353cefc50cadeea3e WHIRLPOOL 47c4d6261fc6cc9c172035d8774f0cde9fa669fa164fc4a0f47e84ba789d69d14f5a16d042451564412fdedddec71335714ad751508495c22cea25b69f10b925
+DIST factory.4.0.1-gftables.tar.gz 2974152 SHA256 9cd158ceb1c2b1c47bdca2c0b004bba92cb0e0aaa0ea6a43ca784ebdce10eebd SHA512 060c58fe6e4565dd5e7649bfa070f14dec3c383a55ebab52a9f02b58a6405e2183e0c7e08964cddb87b81e872c0d8a52d7bd4575d07269547be544cf6a725a76 WHIRLPOOL a721a6824681118578c7289cea77a3f47e5c7654f30dc454eaac76b19cc89e416ae54b8d21a69f897d7087d4b67990634fc960f81df2ea53f428868d608dc9c2
+DIST gtest-1.7.0.tar.gz 1001582 SHA256 c0f860eee47c86e0aeb462fd0bdfd70e3975297e0b8b178e0e03a95e1f6c9bc4 SHA512 a9f5c047b39efb2d11b55ee9913662ca402ac6837b3ad2d278ecfbd1caf32ed4546f169e3e92503d57bf3b62ccf89cd062da1c7ea3638aae98e868d2766363c3 WHIRLPOOL 36edbdf8be7c3793a89918a3c43d74e75a6281a37c394f7d2f20506130a76aab04a3beddba01bf7f0e9b6901c7e834ca014c31c913c0ea846d3f6be9c93599d2
diff --git a/sci-mathematics/Macaulay2/files/1.6-lapack.patch b/sci-mathematics/Macaulay2/files/1.6-lapack.patch
new file mode 100644
index 00000000000..e9a434eeb28
--- /dev/null
+++ b/sci-mathematics/Macaulay2/files/1.6-lapack.patch
@@ -0,0 +1,50 @@
+--- configure.ac 2012-10-24 09:29:55.240498786 -0700
++++ configure.ac.2 2012-10-30 15:07:27.172846300 -0700
+@@ -1285,46 +1285,7 @@
+ done
+ test $BUILD_factory = yes && BUILTLIBS="$SINGULARLIBS $BUILTLIBS"
+
+-# we need to do the fortran library testing last, in case AC_SEARCH_LIBS adds
+-# one of them to $LIBS, making it impossible to check for the presence of C or
+-# C++ libraries. (I'm not sure why putting -llapack on the gcc command line
+-# needlessly causes the library to be linked against.)
+-FORTRANUSED=no
+-if test "$LAPACK" = yes
+-then AC_MSG_CHECKING([whether the vecLib framework is available])
+- SAVELIBS=$LIBS LIBS="-framework vecLib $LIBS"
+- AC_LANG(C)
+- AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM(,[sgemv_();dgetrf_();])],
+- [
+- AC_MSG_RESULT(yes)
+- ],
+- [
+- AC_MSG_RESULT(no)
+- LIBS=$SAVELIBS
+- FORTRANUSED=yes
+- if test $BUILD_lapack = no
+- then AC_LANG(Fortran)
+- if test "$FC" = ""
+- then AC_MSG_ERROR(no fortran compiler found)
+- else AC_MSG_NOTICE(using fortran compiler $FC)
+- fi
+- AC_SEARCH_LIBS(sgemv,blas f77blas,,BUILD_lapack=yes)
+- AC_SEARCH_LIBS(dgetrf,lapack,,BUILD_lapack=yes)
+- fi
+- ])
+-fi
+-test $BUILD_lapack = yes && BUILTLIBS="-llapack -lblas $BUILTLIBS"
+-
+-if test $BUILD_lapack = yes
+-then # test whether the fortran compiler can handle lapack, which, starting with
+- # version 3.2, requires fortran 90, not fortran 77
+- AC_LANG(Fortran)
+- AC_MSG_CHECKING([whether the fortran compiler is modern enough for lapack])
+- AC_COMPILE_IFELSE([instrinsic maxloc],
+- AC_MSG_ERROR(the fortran compiler ($FC) does not support the Fortran 90 language required for compiling lapack),
+- AC_MSG_RESULT(yes))
+-fi
++BUILTLIBS="$(${PKG_CONFIG} --libs lapack) $BUILTLIBS"
+
+ if test $BUILD_memtailor = yes
+ then BUILTLIBS="-lmemtailor $BUILTLIBS"
diff --git a/sci-mathematics/Macaulay2/files/1.6-paths-of-external-programs.patch b/sci-mathematics/Macaulay2/files/1.6-paths-of-external-programs.patch
new file mode 100644
index 00000000000..4c090deec9d
--- /dev/null
+++ b/sci-mathematics/Macaulay2/files/1.6-paths-of-external-programs.patch
@@ -0,0 +1,73 @@
+diff -U 3 -dHrN M2source/Macaulay2/packages/FourTiTwo.m2 M2source.patch/Macaulay2/packages/FourTiTwo.m2
+--- M2source/Macaulay2/packages/FourTiTwo.m2 2011-09-22 14:36:51.000000000 +0100
++++ M2source.patch/Macaulay2/packages/FourTiTwo.m2 2011-09-24 21:24:12.000000000 +0100
+@@ -47,7 +47,7 @@
+
+ path'4ti2 = (options FourTiTwo).Configuration#"path"
+ -- NOTE: the absolute path should be put into the .init file for 4ti2 inside the .Macaulay2 directory.
+-if path'4ti2 == "" then path'4ti2 = prefixDirectory | currentLayout#"programs"
++if path'4ti2 == "" then path'4ti2 = "/usr/bin/"
+
+ getFilename = () -> (
+ filename := temporaryFileName();
+diff -U 3 -dHrN M2source/Macaulay2/packages/gfanInterface.m2 M2source.patch/Macaulay2/packages/gfanInterface.m2
+--- M2source/Macaulay2/packages/gfanInterface.m2 2011-05-14 12:00:59.000000000 +0100
++++ M2source.patch/Macaulay2/packages/gfanInterface.m2 2011-09-24 21:24:12.000000000 +0100
+@@ -25,7 +25,7 @@
+ }
+
+ gfan'path = gfanInterface#Options#Configuration#"path"
+-if gfan'path == "" then gfan'path = prefixDirectory | currentLayout#"programs"
++if gfan'path == "" then gfan'path = "/usr/bin/"
+ if instance(gfan'path, String) then gfan'path = {gfan'path}
+ if not instance(gfan'path,List) then error "expected configuration option gfan'path to be a list of strings or a string"
+ gfan'path = join(
+diff -U 3 -dHrN M2source/Macaulay2/packages/NautyGraphs.m2 M2source.patch/Macaulay2/packages/NautyGraphs.m2
+--- M2source/Macaulay2/packages/NautyGraphs.m2 2011-08-26 11:05:30.000000000 +0100
++++ M2source.patch/Macaulay2/packages/NautyGraphs.m2 2011-09-24 21:25:53.000000000 +0100
+@@ -32,7 +32,7 @@
+ -- Check the ~/.Macaulay2/init-NautyGraphs.m2 file for the absolute path.
+ -- If it's not there, then use the M2-Programs directory.
+ nauty'path = (options NautyGraphs).Configuration#"path";
+-if nauty'path == "" then nauty'path = prefixDirectory | currentLayout#"programs";
++if nauty'path == "" then nauty'path = "/usr/bin/";
+
+ -------------------
+ -- Exports
+diff -U 3 -dHrN M2source/Macaulay2/packages/Nauty.m2 M2source.patch/Macaulay2/packages/Nauty.m2
+--- M2source/Macaulay2/packages/Nauty.m2 2011-08-26 11:05:30.000000000 +0100
++++ M2source.patch/Macaulay2/packages/Nauty.m2 2011-09-24 21:24:12.000000000 +0100
+@@ -48,7 +48,8 @@
+ -- Check the ~/.Macaulay2/init-Nauty.m2 file for the absolute path.
+ -- If it's not there, then use the M2-Programs directory.
+ nauty'path = (options Nauty).Configuration#"path";
+-if nauty'path == "" then nauty'path = prefixDirectory | currentLayout#"programs";
++if nauty'path == "" then nauty'path = "/usr/bin/";
++
+
+ -------------------
+ -- Exports
+diff -U 3 -dHrN M2source/Macaulay2/packages/Normaliz.m2 M2source.patch/Macaulay2/packages/Normaliz.m2
+--- M2source/Macaulay2/packages/Normaliz.m2 2011-05-25 16:47:50.000000000 +0100
++++ M2source.patch/Macaulay2/packages/Normaliz.m2 2011-09-24 21:24:12.000000000 +0100
+@@ -166,7 +166,7 @@
+ nmzExec="normaliz";
+ );
+ -- return nmzExec;
+- return prefixDirectory | currentLayout#"programs" | nmzExec;
++ return "/usr/bin/" | nmzExec;
+ );
+
+
+diff -U 3 -dHrN M2source/Macaulay2/packages/StatePolytope.m2 M2source.patch/Macaulay2/packages/StatePolytope.m2
+--- M2source/Macaulay2/packages/StatePolytope.m2 2010-09-10 16:47:20.000000000 +0100
++++ M2source.patch/Macaulay2/packages/StatePolytope.m2 2011-09-24 21:24:12.000000000 +0100
+@@ -31,7 +31,7 @@
+
+
+ gfanCommand = (options StatePolytope)#Configuration#"gfan command"
+-if gfanCommand === "gfan" then gfanCommand = prefixDirectory | currentLayout#"programs" | gfanCommand
++if gfanCommand === "gfan" then gfanCommand = "/usr/bin/" | gfanCommand
+ gfanCommand = "!" | gfanCommand
+
+ --The next two functions print out the ring and the ideal in the format required by gfan
diff --git a/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el b/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el
new file mode 100644
index 00000000000..ac86e2132ed
--- /dev/null
+++ b/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el
@@ -0,0 +1,11 @@
+;; sci-mathematics/Macaulay2 init file
+
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/Macaulay2")
+
+(defvar M2-exe "/usr/bin/M2" "*The default Macaulay2 executable name.")
+(autoload 'M2 "M2.el" "Run Macaulay 2 in a buffer." t)
+(autoload 'Macaulay2 "M2" "Run Macaulay 2 in a buffer, non-interactive." t)
+(autoload 'M2-mode "M2" "Macaulay 2 editing mode" t)
+(autoload 'm2-mode "M2" "Macaulay 2 editing mode, name in lower case" t)
+(autoload 'm2-comint-mode "M2" "Macaulay 2 command interpreter mode, name in lower case" t)
+(setq auto-mode-alist (append auto-mode-alist '(("\\.m2$" . M2-mode)))) \ No newline at end of file
diff --git a/sci-mathematics/Macaulay2/metadata.xml b/sci-mathematics/Macaulay2/metadata.xml
new file mode 100644
index 00000000000..3513de74db1
--- /dev/null
+++ b/sci-mathematics/Macaulay2/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>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+ </maintainer>
+ <herd>sci-mathematics</herd>
+ <use>
+ <flag name="optimization">Accept upstream's choices for -O option, i.e. -O3 almost everywhere.</flag>
+ </use>
+ <longdescription lang="en">
+ Macaulay2 is a research tool for algraic geometry and commutative
+ algebra.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/agda-executable/Manifest b/sci-mathematics/agda-executable/Manifest
new file mode 100644
index 00000000000..3f091e25659
--- /dev/null
+++ b/sci-mathematics/agda-executable/Manifest
@@ -0,0 +1 @@
+DIST Agda-executable-2.3.0.1.tar.gz 1765 SHA256 614594c414c828c87abb1913741db66447c09617d57b92e58ffe445ceffed694 SHA512 8abdd2739a36a952bb754c069717be70e9fa74b55fc048c2877f7d0c6791a5a8f7944b3b3a97be754fd00431ff94b9f7c6f35f40b8376155952c4b9b414890b2 WHIRLPOOL 84b738ef4fb75d7dcff8c9cc0002509ff2ccc9bdd5e27c04472deed6df960047da907948f7d5e585a5e3e8f6caafc05cf2e25718cd9b575e4cf18a0e1e8cd422
diff --git a/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r1.ebuild b/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r1.ebuild
new file mode 100644
index 00000000000..b05e0617850
--- /dev/null
+++ b/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.3.9999
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal eutils
+
+MY_PN="Agda-executable"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Command-line program for type-checking and compiling Agda programs"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ >=sci-mathematics/agda-2.3.0.1
+ >=dev-haskell/cabal-1.8
+ >=dev-lang/ghc-6.10.4"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cabal-mksetup
+ sed -e 's@Agda == 2.3.0.1@Agda >= 2.3.0.1@' \
+ -i "${S}/${MY_PN}.cabal" || die "Could not loosen dependencies"
+}
diff --git a/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r2.ebuild b/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r2.ebuild
new file mode 100644
index 00000000000..b6bc07a1c28
--- /dev/null
+++ b/sci-mathematics/agda-executable/agda-executable-2.3.0.1-r2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.3.9999
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal eutils
+
+MY_PN="Agda-executable"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Command-line program for type-checking and compiling Agda programs"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=sci-mathematics/agda-2.3.0.1:="
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8
+ >=dev-lang/ghc-6.10.4"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cabal-mksetup
+ sed -e 's@Agda == 2.3.0.1@Agda >= 2.3.0.1@' \
+ -i "${S}/${MY_PN}.cabal" || die "Could not loosen dependencies"
+}
diff --git a/sci-mathematics/agda-executable/metadata.xml b/sci-mathematics/agda-executable/metadata.xml
new file mode 100644
index 00000000000..58fbc0e3204
--- /dev/null
+++ b/sci-mathematics/agda-executable/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>haskell</herd>
+ <maintainer>
+ <email>haskell@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ This package provides a command-line program for type-checking and
+ compiling Agda programs. The program can also generate hyperlinked,
+ highlighted HTML files from Agda sources.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/agda-lib-ffi/Manifest b/sci-mathematics/agda-lib-ffi/Manifest
new file mode 100644
index 00000000000..d8103164a7e
--- /dev/null
+++ b/sci-mathematics/agda-lib-ffi/Manifest
@@ -0,0 +1,2 @@
+DIST agda-stdlib-2.4.2.3.tar.gz 252558 SHA256 bb444fb35096be277c07aa27652c24509449fee9188325bb13eaac68b91eca7d SHA512 d503fc2abd18ab8c367a1947301e0302a6ff9fcbb6376a01f016aa2ab7a9a967e5adb96c5013db1892f4acd9fab62bead11c58c4d443784aff1e42ee4ffd4aa9 WHIRLPOOL 829e5613f2e03cda80608ef0899db413c98a505c9ba595d3aacd12171fc2e30e18e72365770a85655c7670fc5d45103c3b186d2bf8d9697aebae15bc9f40feaf
+DIST lib-0.7.tar.gz 226400 SHA256 631a33e8e27ead32c85cc92a0a85849744d3b2960ef9675736d54288267ed2fa SHA512 557aa7b9b143f2e4a2249881a98c753035962bc5d9222241e6b4fe86aab8642986aa9db7ca6fc2b2da8486f9294ff30c4c2edfa0222ba95d9216ed2d0e00c114 WHIRLPOOL f51ba5c3430e9a8a11d8eacab3b6121c730e4a437286b88f743fc2521bf1941a889d5274dd4aa7f4fe283595b5ac29a8a35735d873eedc94505455178d167536
diff --git a/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2-r2.ebuild b/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2-r2.ebuild
new file mode 100644
index 00000000000..2774fd4407d
--- /dev/null
+++ b/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2-r2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.3.5
+
+CABAL_FEATURES="lib"
+inherit haskell-cabal
+
+AGDA_PN="agda-stdlib"
+AGDA_PV="2.4.2.3"
+AGDA_P="${AGDA_PN}-${AGDA_PV}"
+
+DESCRIPTION="Auxiliary Haskell code used by Agda's standard library"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="https://github.com/agda/${AGDA_PN}/archive/${AGDA_PV}.tar.gz -> ${AGDA_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/ghc-6.10.4:=
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8
+"
+
+S="${WORKDIR}/${AGDA_P}/ffi"
diff --git a/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2.ebuild b/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2.ebuild
new file mode 100644
index 00000000000..ba329a2a9de
--- /dev/null
+++ b/sci-mathematics/agda-lib-ffi/agda-lib-ffi-0.0.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.3.5
+
+CABAL_FEATURES="lib"
+inherit haskell-cabal
+
+AGDA_P="lib-0.7"
+
+DESCRIPTION="Auxiliary Haskell code used by Agda's standard library"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="http://www.cse.chalmers.se/~nad/software/${AGDA_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/ghc-6.10.4:=
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8
+"
+
+S="${WORKDIR}/${AGDA_P}/ffi"
+
+src_prepare() {
+ cabal_chdeps \
+ 'base >= 3.0.3.1 && < 4.7' 'base >= 3.0.3.1'
+}
diff --git a/sci-mathematics/agda-lib-ffi/metadata.xml b/sci-mathematics/agda-lib-ffi/metadata.xml
new file mode 100644
index 00000000000..1439b435aad
--- /dev/null
+++ b/sci-mathematics/agda-lib-ffi/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>haskell</herd>
+ <maintainer>
+ <email>haskell@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ Auxiliary Haskell code used by Agda's standard library.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">agda/agda-stdlib</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/agda-stdlib/Manifest b/sci-mathematics/agda-stdlib/Manifest
new file mode 100644
index 00000000000..3065d6d022f
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/Manifest
@@ -0,0 +1,3 @@
+DIST agda-stdlib-0.8.tar.gz 246158 SHA256 e8b8380bb03871ee3348aa2df32201a387ca0af02171d32ac58664f58467ed0d SHA512 5ac3bda61eb209a4db650edbbdfb96b73cb58b24e43842957696a20a93454d9846a19e4866af0b736c2c3390184223473da75277e490a6a8348531431ca27af0 WHIRLPOOL ccb5f294cb303b7d502227a6f908fa4904c56c55af1c3897753da3f39c7271cd07c292b56e030b8d80f97e6d6a8ad9f0a5fba1f22e0d169bdb4cb79e6e2db060
+DIST agda-stdlib-0.9.tar.gz 248895 SHA256 923b487876235863e4f778aa40c508984b26636d50d531f0f31ca9dc45ab3717 SHA512 aa297e250c5d98ca3f267c5ef95fc33999f9b120256c1983774d814b940a0f5952e524024908e3716af71ad544a586576c1bae6cca19e63797b1d4004ba88413 WHIRLPOOL dd200c61e91e397dfc7de8f6269edaefc20aa3daf5ead9e9fbab62468e5385481a74d5cec62df88e5c5304e06dfbd47b1870f71f70aba7fad29eceb0d836e2b1
+DIST agda-stdlib-2.4.2.3.tar.gz 252558 SHA256 bb444fb35096be277c07aa27652c24509449fee9188325bb13eaac68b91eca7d SHA512 d503fc2abd18ab8c367a1947301e0302a6ff9fcbb6376a01f016aa2ab7a9a967e5adb96c5013db1892f4acd9fab62bead11c58c4d443784aff1e42ee4ffd4aa9 WHIRLPOOL 829e5613f2e03cda80608ef0899db413c98a505c9ba595d3aacd12171fc2e30e18e72365770a85655c7670fc5d45103c3b186d2bf8d9697aebae15bc9f40feaf
diff --git a/sci-mathematics/agda-stdlib/agda-stdlib-0.8.ebuild b/sci-mathematics/agda-stdlib/agda-stdlib-0.8.ebuild
new file mode 100644
index 00000000000..6ccbc88c9a0
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/agda-stdlib-0.8.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal elisp-common
+
+DESCRIPTION="Agda standard library"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="https://github.com/agda/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="profile +ffi"
+
+# filemanip is used in lib.cabal to make the GenerateEverything and
+# AllNonAsciiChars executables, so agda-stdlib does not require a subslot
+# dependency on filemanip.
+
+RDEPEND=">=sci-mathematics/agda-2.4:=[profile?]
+ =dev-haskell/filemanip-0.3*[profile?]
+ >=sci-mathematics/agda-executable-2.3.0.1:=
+ >=dev-lang/ghc-6.12.1
+ ffi? ( =sci-mathematics/agda-lib-ffi-0.0.2 )
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8.0.2
+"
+
+SITEFILE="50${PN}-gentoo.el"
+
+src_prepare() {
+ cabal-mksetup
+}
+
+src_compile() {
+ haskell-cabal_src_compile
+ "${S}"/dist/build/GenerateEverything/GenerateEverything \
+ || die "GenerateEverything failed"
+ local prof
+ use profile && prof="--ghc-flag=-prof"
+ agda +RTS -K1G -RTS ${prof} \
+ -i "${S}" -i "${S}"/src "${S}"/Everything.agda || die
+ # Although my agda-9999 build has
+ # /var/tmp/portage/sci-mathematics/agda-9999/work/agda-9999/dist/build/autogen/Paths_Agda.hs
+ # containing:
+ # datadir = "/usr/share/agda-9999/ghc-7.6.1"
+ # it fails without the --css option like:
+ # /usr/share/agda-9999/ghc-7.4.1/Agda.css: copyFile: does not exist
+ local cssdir=$(egrep 'datadir *=' "${S}/dist/build/autogen/Paths_lib.hs" | sed -e 's@datadir = \(.*\)@\1@')
+ agda --html -i "${S}" -i "${S}"/src --css="${cssdir}/Agda.css" "${S}"/README.agda || die
+}
+
+src_test() {
+ agda -i "${S}" -i "${S}"/src README.agda || die
+}
+
+src_install() {
+ insinto usr/share/agda-stdlib
+ export INSOPTIONS=--preserve-timestamps
+ doins -r src/*
+ dodoc -r html/*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
+}
diff --git a/sci-mathematics/agda-stdlib/agda-stdlib-0.9.ebuild b/sci-mathematics/agda-stdlib/agda-stdlib-0.9.ebuild
new file mode 100644
index 00000000000..6ccbc88c9a0
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/agda-stdlib-0.9.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal elisp-common
+
+DESCRIPTION="Agda standard library"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="https://github.com/agda/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="profile +ffi"
+
+# filemanip is used in lib.cabal to make the GenerateEverything and
+# AllNonAsciiChars executables, so agda-stdlib does not require a subslot
+# dependency on filemanip.
+
+RDEPEND=">=sci-mathematics/agda-2.4:=[profile?]
+ =dev-haskell/filemanip-0.3*[profile?]
+ >=sci-mathematics/agda-executable-2.3.0.1:=
+ >=dev-lang/ghc-6.12.1
+ ffi? ( =sci-mathematics/agda-lib-ffi-0.0.2 )
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8.0.2
+"
+
+SITEFILE="50${PN}-gentoo.el"
+
+src_prepare() {
+ cabal-mksetup
+}
+
+src_compile() {
+ haskell-cabal_src_compile
+ "${S}"/dist/build/GenerateEverything/GenerateEverything \
+ || die "GenerateEverything failed"
+ local prof
+ use profile && prof="--ghc-flag=-prof"
+ agda +RTS -K1G -RTS ${prof} \
+ -i "${S}" -i "${S}"/src "${S}"/Everything.agda || die
+ # Although my agda-9999 build has
+ # /var/tmp/portage/sci-mathematics/agda-9999/work/agda-9999/dist/build/autogen/Paths_Agda.hs
+ # containing:
+ # datadir = "/usr/share/agda-9999/ghc-7.6.1"
+ # it fails without the --css option like:
+ # /usr/share/agda-9999/ghc-7.4.1/Agda.css: copyFile: does not exist
+ local cssdir=$(egrep 'datadir *=' "${S}/dist/build/autogen/Paths_lib.hs" | sed -e 's@datadir = \(.*\)@\1@')
+ agda --html -i "${S}" -i "${S}"/src --css="${cssdir}/Agda.css" "${S}"/README.agda || die
+}
+
+src_test() {
+ agda -i "${S}" -i "${S}"/src README.agda || die
+}
+
+src_install() {
+ insinto usr/share/agda-stdlib
+ export INSOPTIONS=--preserve-timestamps
+ doins -r src/*
+ dodoc -r html/*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
+}
diff --git a/sci-mathematics/agda-stdlib/agda-stdlib-2.4.2.3.ebuild b/sci-mathematics/agda-stdlib/agda-stdlib-2.4.2.3.ebuild
new file mode 100644
index 00000000000..867f3557dcc
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/agda-stdlib-2.4.2.3.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal elisp-common
+
+DESCRIPTION="Agda standard library"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="https://github.com/agda/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="profile +ffi"
+
+# filemanip is used in lib.cabal to make the GenerateEverything and
+# AllNonAsciiChars executables, so agda-stdlib does not require a subslot
+# dependency on filemanip.
+
+RDEPEND="=sci-mathematics/agda-${PV}*:=[profile?]
+ =dev-haskell/filemanip-0.3*[profile?]
+ >=dev-lang/ghc-6.12.1
+ ffi? ( sci-mathematics/agda-lib-ffi )
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8.0.2
+"
+
+SITEFILE="50${PN}-gentoo.el"
+
+src_prepare() {
+ cabal-mksetup
+}
+
+src_compile() {
+ haskell-cabal_src_compile
+ "${S}"/dist/build/GenerateEverything/GenerateEverything \
+ || die "GenerateEverything failed"
+ local prof
+ use profile && prof="--ghc-flag=-prof"
+ agda +RTS -K1G -RTS ${prof} \
+ -i "${S}" -i "${S}"/src "${S}"/Everything.agda || die
+ # Although my agda-9999 build has
+ # /var/tmp/portage/sci-mathematics/agda-9999/work/agda-9999/dist/build/autogen/Paths_Agda.hs
+ # containing:
+ # datadir = "/usr/share/agda-9999/ghc-7.6.1"
+ # it fails without the --css option like:
+ # /usr/share/agda-9999/ghc-7.4.1/Agda.css: copyFile: does not exist
+ local cssdir=$(egrep 'datadir *=' "${S}/dist/build/autogen/Paths_lib.hs" | sed -e 's@datadir = \(.*\)@\1@')
+ agda --html -i "${S}" -i "${S}"/src --css="${cssdir}/Agda.css" "${S}"/README.agda || die
+}
+
+src_test() {
+ agda -i "${S}" -i "${S}"/src README.agda || die
+}
+
+src_install() {
+ insinto usr/share/agda-stdlib
+ export INSOPTIONS=--preserve-timestamps
+ doins -r src/*
+ dodoc -r html/*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
+}
diff --git a/sci-mathematics/agda-stdlib/files/50agda-stdlib-gentoo.el b/sci-mathematics/agda-stdlib/files/50agda-stdlib-gentoo.el
new file mode 100644
index 00000000000..62264a4451a
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/files/50agda-stdlib-gentoo.el
@@ -0,0 +1 @@
+(setq agda2-include-dirs '("." "/usr/share/agda-stdlib"))
diff --git a/sci-mathematics/agda-stdlib/metadata.xml b/sci-mathematics/agda-stdlib/metadata.xml
new file mode 100644
index 00000000000..91a8ae913e0
--- /dev/null
+++ b/sci-mathematics/agda-stdlib/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-mathematics</herd>
+ <herd>haskell</herd>
+ <longdescription lang="en">
+ Agda standard library.
+</longdescription>
+ <use>
+ <flag name="ffi">Install agda-lib-ffi for compilation using the MAlonzo backend</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">agda/agda-stdlib</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/agda/Manifest b/sci-mathematics/agda/Manifest
new file mode 100644
index 00000000000..913d7084861
--- /dev/null
+++ b/sci-mathematics/agda/Manifest
@@ -0,0 +1,3 @@
+DIST Agda-2.4.0.1.tar.gz 906887 SHA256 58e678b9d193e19d4e69d8899129d9ae16df08a394873af850797f03cc2cbe86 SHA512 edd56ecea83241f3cb1aca4ac1e17970acf122c323a4ff38e2b5d8e46e46b1afd90fbbd460a6674a51cbb13a7cbf3a57b489e91a92ce3e709b2fc3d659013601 WHIRLPOOL 4e94c4277e8be99bd5a513c274fd5712f1d4a3e99d1e626a3b195b9cf83f9216de62220cfb5e8298cc0f11560a9c32dc0116db3bd67c2240842fa798f733065c
+DIST Agda-2.4.2.2.tar.gz 963302 SHA256 2344107654d0cb2a18dcf179ed3ea0f427839e058771ed628da64fbaed55bbc3 SHA512 62376775255099570d9eb7814de77a239d0806669ee0993283429a400c7c45ca756c6735bab85b4d3a4b82defae544364ac9107fd622f2df1ebcbded3113204d WHIRLPOOL dd220346109b7e137cca2e3b091c581b0b4ed0e23340209c7eebc48b39d807a569c984fbe1aee813d18a7f953db86e82b6a6aa7e197e6a2c5569dc311625f45f
+DIST Agda-2.4.2.3.tar.gz 990268 SHA256 bc6def45e32498f51863d67acfbe048c039d630c6a36761ed27e99a5f68d7b27 SHA512 84c24c517c830128032af8de9c8ce9ed8d5333becf65e6c96d67104caae1b66fb37ae9bcdff8f42a3e2997f4dcef2f4ea5addd7c94c45a0533c833da9af4d55a WHIRLPOOL ccef337495a5bc6d4272821700126a793ac0cac8b0ebbef44be478b725545797959c0edba910b5e2b68076e7c5c01e98580ea40016d02b268960dfba5f62a24a
diff --git a/sci-mathematics/agda/agda-2.4.0.1.ebuild b/sci-mathematics/agda/agda-2.4.0.1.ebuild
new file mode 100644
index 00000000000..a278e74af5d
--- /dev/null
+++ b/sci-mathematics/agda/agda-2.4.0.1.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.4.2.9999
+
+CABAL_FEATURES="lib profile haddock hoogle hscolour"
+inherit haskell-cabal elisp-common
+
+MY_PN="Agda"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A dependently typed functional programming language and proof assistant"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="epic +stdlib"
+
+RDEPEND=">=dev-haskell/binary-0.6:=[profile?] <dev-haskell/binary-0.8:=[profile?]
+ >=dev-haskell/boxes-0.1.3:=[profile?] <dev-haskell/boxes-0.2:=[profile?]
+ ~dev-haskell/data-hash-0.2.0.0:=[profile?]
+ >=dev-haskell/equivalence-0.2.3:=[profile?] <dev-haskell/equivalence-0.3:=[profile?]
+ >=dev-haskell/geniplate-0.6.0.3:=[profile?] <dev-haskell/geniplate-0.7:=[profile?]
+ >=dev-haskell/hashtables-1.0:=[profile?] <dev-haskell/hashtables-1.2:=[profile?]
+ >=dev-haskell/haskeline-0.7:=[profile?] <dev-haskell/haskeline-0.8:=[profile?]
+ >=dev-haskell/haskell-src-exts-1.9.6:=[profile?] <dev-haskell/haskell-src-exts-1.16:=[profile?]
+ >=dev-haskell/mtl-2.1.1:=[profile?] <dev-haskell/mtl-2.3:=[profile?]
+ <dev-haskell/parallel-3.3:=[profile?]
+ >=dev-haskell/quickcheck-2.7.5:2=[profile?] <dev-haskell/quickcheck-2.8:2=[profile?]
+ >=dev-haskell/stmonadtrans-0.3.2:=[profile?] <dev-haskell/stmonadtrans-0.4:=[profile?]
+ >=dev-haskell/strict-0.3.2:=[profile?] <dev-haskell/strict-0.4:=[profile?]
+ >=dev-haskell/text-0.11:=[profile?] <dev-haskell/text-1.2:=[profile?]
+ >=dev-haskell/transformers-0.3:=[profile?] <dev-haskell/transformers-0.5:=[profile?]
+ >=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
+ >=dev-haskell/xhtml-3000.2:=[profile?] <dev-haskell/xhtml-3000.3:=[profile?]
+ >=dev-haskell/zlib-0.4.0.1:=[profile?] <dev-haskell/zlib-0.6:=[profile?]
+ >=dev-lang/ghc-7.4.1:=
+ || ( ( >=dev-haskell/hashable-1.1.2.3:=[profile?] <dev-haskell/hashable-1.2:=[profile?] )
+ ( >=dev-haskell/hashable-1.2.1.0:=[profile?] <dev-haskell/hashable-1.3:=[profile?] ) )
+ epic? ( >=dev-lang/epic-0.1.13:=[profile?] <dev-lang/epic-0.10:=[profile?] )
+"
+RDEPEND+="
+ app-emacs/haskell-mode
+ virtual/emacs
+"
+PDEPEND="stdlib? ( sci-mathematics/agda-stdlib )"
+DEPEND="${RDEPEND}
+ dev-haskell/alex
+ >=dev-haskell/cabal-1.8
+ dev-haskell/happy
+"
+
+SITEFILE="50${PN}2-gentoo.el"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cabal_chdeps \
+ 'mtl >= 2.1.1 && < 2.2' 'mtl >= 2.1.1 && < 2.3' \
+ 'transformers == 0.3.*' 'transformers >= 0.3 && < 0.5'
+
+ sed -e '/.*emacs-mode.*$/d' \
+ -i "${S}/${MY_PN}.cabal" \
+ || die "Could not remove agda-mode from ${MY_PN}.cabal"
+
+ if use epic && use stdlib; then
+ ewarn "Note that the agda-stdlib README:"
+ ewarn "http://www.cse.chalmers.se/~nad/listings/lib/README.html"
+ ewarn 'says: "Currently the library does not support the Epic or JavaScript compiler'
+ ewarn 'backends." Hence you may wish to remove the epic use flag if you wish to use'
+ ewarn "the Agda standard library."
+ fi
+ sed -e 's@-Werror@@g' \
+ -i "${S}/${MY_PN}.cabal" \
+ || die "sed to remove -Werror failed"
+ sed -e '/, "-Werror"/d' \
+ -i "${S}/src/full/Agda/Compiler/MAlonzo/Compiler.hs" \
+ || die "sed to remove -Werror from Compiler.hs failed"
+}
+
+src_configure() {
+ haskell-cabal_src_configure \
+ $(cabal_flag epic epic)
+}
+
+src_compile() {
+ BYTECOMPFLAGS="-L ./src/data/emacs-mode"
+ elisp-compile src/data/emacs-mode/*.el \
+ || die "Failed to compile emacs mode"
+ haskell-cabal_src_compile
+}
+
+src_install() {
+ local add="${ED}"/usr/share/"${P}/ghc-$(ghc-version)"
+
+ haskell-cabal_src_install
+
+ # generate Primitive.agdai, emulate Setup.hs postinst phase
+ Agda_datadir="${add}" \
+ "${ED}"/usr/bin/agda "${add}"/lib/prim/Agda/Primitive.agda
+
+ rm "${ED}"/usr/bin/agda-mode || die
+ # lives in sci-mathematics/agda-executable
+ rm "${ED}"/usr/bin/agda || die
+
+ elisp-install ${PN} src/data/emacs-mode/*.el \
+ || die "Failed to install emacs mode"
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "Failed to install elisp site file"
+}
+
+pkg_postinst() {
+ ghc-package_pkg_postinst
+ elisp-site-regen
+}
+
+pkg_postrm() {
+ ghc-package_pkg_prerm
+ elisp-site-regen
+}
diff --git a/sci-mathematics/agda/agda-2.4.2.2-r1.ebuild b/sci-mathematics/agda/agda-2.4.2.2-r1.ebuild
new file mode 100644
index 00000000000..06034efa7e6
--- /dev/null
+++ b/sci-mathematics/agda/agda-2.4.2.2-r1.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.4.4.9999
+
+CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
+inherit haskell-cabal elisp-common
+
+MY_PN="Agda"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A dependently typed functional programming language and proof assistant"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="+cpphs epic +stdlib"
+
+RDEPEND=">=dev-haskell/binary-0.6:=[profile?] <dev-haskell/binary-0.8:=[profile?]
+ >=dev-haskell/boxes-0.1.3:=[profile?] <dev-haskell/boxes-0.2:=[profile?]
+ ~dev-haskell/data-hash-0.2.0.0:=[profile?]
+ >=dev-haskell/equivalence-0.2.5:=[profile?] <dev-haskell/equivalence-0.3:=[profile?]
+ >=dev-haskell/geniplate-0.6.0.3:=[profile?] <dev-haskell/geniplate-0.7:=[profile?]
+ >=dev-haskell/hashtables-1.0:=[profile?] <dev-haskell/hashtables-1.3:=[profile?]
+ >=dev-haskell/haskeline-0.7:=[profile?] <dev-haskell/haskeline-0.8:=[profile?]
+ >=dev-haskell/haskell-src-exts-1.9.6:=[profile?] <dev-haskell/haskell-src-exts-1.17:=[profile?]
+ <dev-haskell/parallel-3.3:=[profile?]
+ >=dev-haskell/quickcheck-2.7.5:2=[profile?] <dev-haskell/quickcheck-2.8:2=[profile?]
+ >=dev-haskell/stmonadtrans-0.3.2:=[profile?] <dev-haskell/stmonadtrans-0.4:=[profile?]
+ >=dev-haskell/strict-0.3.2:=[profile?] <dev-haskell/strict-0.4:=[profile?]
+ >=dev-haskell/text-0.11:=[profile?] <dev-haskell/text-1.3:=[profile?]
+ >=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
+ >=dev-haskell/xhtml-3000.2:=[profile?] <dev-haskell/xhtml-3000.3:=[profile?]
+ >=dev-haskell/zlib-0.4.0.1:=[profile?] <dev-haskell/zlib-0.6:=[profile?]
+ >=dev-lang/ghc-7.4.1:=
+ || ( ( >=dev-haskell/hashable-1.1.2.3:=[profile?] <dev-haskell/hashable-1.2:=[profile?] )
+ ( >=dev-haskell/hashable-1.2.1.0:=[profile?] <dev-haskell/hashable-1.3:=[profile?] ) )
+ || ( ( >=dev-haskell/mtl-2.1.1:=[profile?] <=dev-haskell/mtl-2.1.3.1:=[profile?] )
+ ( >=dev-haskell/mtl-2.2.1:=[profile?] <dev-haskell/mtl-2.3:=[profile?] ) )
+ || ( ( >=dev-haskell/transformers-0.3:=[profile?] <dev-haskell/transformers-0.4:=[profile?] )
+ ( >=dev-haskell/transformers-0.4.1.0:=[profile?] <dev-haskell/transformers-0.5:=[profile?] ) )
+ epic? ( >=dev-lang/epic-0.1.13:=[profile?] <dev-lang/epic-0.10:=[profile?] )
+"
+RDEPEND+="
+ app-emacs/haskell-mode
+ virtual/emacs
+"
+PDEPEND="stdlib? ( sci-mathematics/agda-stdlib )"
+DEPEND="${RDEPEND}
+ dev-haskell/alex
+ >=dev-haskell/cabal-1.8
+ dev-haskell/happy
+ cpphs? ( dev-haskell/cpphs )
+"
+
+SITEFILE="50${PN}2-gentoo.el"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cabal_chdeps \
+ 'hashtables >= 1.0 && < 1.2' 'hashtables >= 1.0 && < 1.3' \
+ 'cpphs >= 1.18.6 && < 1.19' 'cpphs >= 1.18.6 && < 1.20'
+
+ sed -e '/.*emacs-mode.*$/d' \
+ -i "${S}/${MY_PN}.cabal" \
+ || die "Could not remove agda-mode from ${MY_PN}.cabal"
+
+ if use epic && use stdlib; then
+ ewarn "Note that the agda-stdlib README:"
+ ewarn "http://www.cse.chalmers.se/~nad/listings/lib/README.html"
+ ewarn 'says: "Currently the library does not support the Epic or JavaScript compiler'
+ ewarn 'backends." Hence you may wish to remove the epic use flag if you wish to use'
+ ewarn "the Agda standard library."
+ fi
+ sed -e 's@-Werror@@g' \
+ -i "${S}/${MY_PN}.cabal" \
+ || die "sed to remove -Werror failed"
+ sed -e '/, "-Werror"/d' \
+ -i "${S}/src/full/Agda/Compiler/MAlonzo/Compiler.hs" \
+ || die "sed to remove -Werror from Compiler.hs failed"
+}
+
+src_configure() {
+ haskell-cabal_src_configure \
+ $(cabal_flag cpphs cpphs) \
+ $(cabal_flag epic epic)
+}
+
+src_compile() {
+ BYTECOMPFLAGS="-L ./src/data/emacs-mode"
+ elisp-compile src/data/emacs-mode/*.el \
+ || die "Failed to compile emacs mode"
+ haskell-cabal_src_compile
+}
+
+src_install() {
+ local add="${ED}"/usr/share/"${P}/ghc-$(ghc-version)"
+
+ haskell-cabal_src_install
+
+ # generate Primitive.agdai, emulate Setup.hs postinst phase
+ Agda_datadir="${add}" \
+ "${ED}"/usr/bin/agda "${add}"/lib/prim/Agda/Primitive.agda
+
+ rm "${ED}"/usr/bin/agda-mode || die
+ # lives in sci-mathematics/agda-executable
+ rm "${ED}"/usr/bin/agda || die
+
+ elisp-install ${PN} src/data/emacs-mode/*.el \
+ || die "Failed to install emacs mode"
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "Failed to install elisp site file"
+}
+
+pkg_postinst() {
+ ghc-package_pkg_postinst
+ elisp-site-regen
+}
+
+pkg_postrm() {
+ ghc-package_pkg_prerm
+ elisp-site-regen
+}
diff --git a/sci-mathematics/agda/agda-2.4.2.3-r1.ebuild b/sci-mathematics/agda/agda-2.4.2.3-r1.ebuild
new file mode 100644
index 00000000000..b6457e53505
--- /dev/null
+++ b/sci-mathematics/agda/agda-2.4.2.3-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# ebuild generated by hackport 0.4.5.9999
+
+CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
+inherit haskell-cabal elisp-common
+
+MY_PN="Agda"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A dependently typed functional programming language and proof assistant"
+HOMEPAGE="http://wiki.portal.chalmers.se/agda/"
+SRC_URI="mirror://hackage/packages/archive/${MY_PN}/${PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="+cpphs +stdlib"
+
+RDEPEND=">=dev-haskell/base-orphans-0.3.1:=[profile?] <dev-haskell/base-orphans-0.4:=[profile?]
+ >=dev-haskell/binary-0.6:=[profile?] <dev-haskell/binary-0.8:=[profile?]
+ >=dev-haskell/boxes-0.1.3:=[profile?] <dev-haskell/boxes-0.2:=[profile?]
+ >=dev-haskell/data-hash-0.2.0.0:=[profile?] <dev-haskell/data-hash-0.3:=[profile?]
+ >=dev-haskell/edit-distance-0.2.1.2:=[profile?] <dev-haskell/edit-distance-0.3:=[profile?]
+ >=dev-haskell/equivalence-0.2.5:=[profile?] <dev-haskell/equivalence-0.4:=[profile?]
+ >=dev-haskell/geniplate-mirror-0.6.0.6:=[profile?] <dev-haskell/geniplate-mirror-0.8:=[profile?]
+ >=dev-haskell/haskeline-0.7:=[profile?] <dev-haskell/haskeline-0.8:=[profile?]
+ >=dev-haskell/haskell-src-exts-1.16.0.1:=[profile?] <dev-haskell/haskell-src-exts-1.17:=[profile?]
+ >=dev-haskell/old-time-1.1.0.0:=[profile?] <dev-haskell/old-time-1.2:=[profile?]
+ >=dev-haskell/parallel-3.2.0.4:=[profile?] <dev-haskell/parallel-3.3:=[profile?]
+ >=dev-haskell/quickcheck-2.8:2=[profile?] <dev-haskell/quickcheck-2.9:2=[profile?]
+ >=dev-haskell/strict-0.3.2:=[profile?] <dev-haskell/strict-0.4:=[profile?]
+ >=dev-haskell/text-0.11:=[profile?] <dev-haskell/text-1.3:=[profile?]
+ >=dev-haskell/transformers-compat-0.3.3.2:=[profile?] <dev-haskell/transformers-compat-0.5:=[profile?]
+ >=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
+ >=dev-haskell/xhtml-3000.2:=[profile?] <dev-haskell/xhtml-3000.3:=[profile?]
+ >=dev-haskell/zlib-0.4.0.1:=[profile?] <dev-haskell/zlib-0.7:=[profile?]
+ >=dev-lang/ghc-7.4.1:=
+ || ( ( >=dev-haskell/hashable-1.1.2.3:=[profile?] <dev-haskell/hashable-1.2:=[profile?] )
+ ( >=dev-haskell/hashable-1.2.1.0:=[profile?] <dev-haskell/hashable-1.3:=[profile?] ) )
+ || ( ( >=dev-haskell/hashtables-1.0:=[profile?] <dev-haskell/hashtables-1.2:=[profile?] )
+ ( >=dev-haskell/hashtables-1.2.0.2:=[profile?] <dev-haskell/hashtables-1.3:=[profile?] ) )
+ || ( ( >=dev-haskell/mtl-2.1.1:=[profile?] <=dev-haskell/mtl-2.1.3.1:=[profile?] )
+ ( >=dev-haskell/mtl-2.2.1:=[profile?] <dev-haskell/mtl-2.3:=[profile?] ) )
+ || ( ( >=dev-haskell/transformers-0.3:=[profile?] <dev-haskell/transformers-0.4:=[profile?] )
+ ( >=dev-haskell/transformers-0.4.1.0:=[profile?] <dev-haskell/transformers-0.5:=[profile?] ) )
+"
+RDEPEND+="
+ app-emacs/haskell-mode
+ virtual/emacs
+"
+PDEPEND="stdlib? ( =sci-mathematics/agda-stdlib-${PV} )"
+DEPEND="${RDEPEND}
+ dev-haskell/alex
+ >=dev-haskell/cabal-1.8
+ dev-haskell/happy
+ cpphs? ( dev-haskell/cpphs )
+"
+RDEPEND+="!sci-mathematics/agda-executable"
+
+SITEFILE="50${PN}2-gentoo.el"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cabal_chdeps \
+ 'data-hash == 0.2.0.0' 'data-hash >= 0.2.0.0 && < 0.3' \
+ 'geniplate-mirror >= 0.6.0.6 && < 0.7' 'geniplate-mirror >= 0.6.0.6 && < 0.8'
+ sed -e '/.*emacs-mode.*$/d' \
+ -i "${S}/${MY_PN}.cabal" \
+ || die "Could not remove agda-mode from ${MY_PN}.cabal"
+}
+
+src_configure() {
+ haskell-cabal_src_configure \
+ $(cabal_flag cpphs cpphs)
+}
+
+src_compile() {
+ BYTECOMPFLAGS="-L ./src/data/emacs-mode"
+ elisp-compile src/data/emacs-mode/*.el \
+ || die "Failed to compile emacs mode"
+ haskell-cabal_src_compile
+}
+
+src_test() {
+ export LD_LIBRARY_PATH="${S}/dist/build${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+ dist/build/agda/agda --test +RTS -M1g || die
+}
+
+src_install() {
+ local add="${ED}"/usr/share/"${P}/ghc-$(ghc-version)"
+
+ haskell-cabal_src_install
+
+ # generate Primitive.agdai, emulate Setup.hs postinst phase
+ Agda_datadir="${add}" \
+ "${ED}"/usr/bin/agda "${add}"/lib/prim/Agda/Primitive.agda
+
+ elisp-install ${PN} src/data/emacs-mode/*.el \
+ || die "Failed to install emacs mode"
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "Failed to install elisp site file"
+}
+
+pkg_postinst() {
+ elisp-site-regen
+}
+
+pkg_postrm() {
+ elisp-site-regen
+}
diff --git a/sci-mathematics/agda/files/50agda2-gentoo.el b/sci-mathematics/agda/files/50agda2-gentoo.el
new file mode 100644
index 00000000000..fd1367f727e
--- /dev/null
+++ b/sci-mathematics/agda/files/50agda2-gentoo.el
@@ -0,0 +1,10 @@
+;;; agda site-lisp configuration
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'agda2-mode "agda2.el"
+ "Major mode for Agda files" t)
+(unless (assoc "\\.agda" auto-mode-alist)
+ (setq auto-mode-alist
+ (nconc '(("\\.agda" . agda2-mode)
+ ("\\.alfa" . agda2-mode)) auto-mode-alist)))
+
diff --git a/sci-mathematics/agda/files/agda-make_install.patch b/sci-mathematics/agda/files/agda-make_install.patch
new file mode 100644
index 00000000000..0d008acd436
--- /dev/null
+++ b/sci-mathematics/agda/files/agda-make_install.patch
@@ -0,0 +1,14 @@
+--- Agda-1.1-cvs20050601/src/Makefile.in.old 2006-07-12 14:47:06.000000000 +0200
++++ Agda-1.1-cvs20050601/src/Makefile.in 2006-07-12 14:47:25.000000000 +0200
+@@ -74,10 +74,9 @@
+
+ install_bin: emacsagda agdachecker
+ ${INSTALL} -d ${destdir}/bin/
++ ${INSTALL} -d ${bindir}
+ cp emacsagda ${destdir}/bin/emacsagda-${VERSION}
+- -rm ${destdir}/bin/emacsagda
+ (cd ${destdir}/bin; ln -s emacsagda-${VERSION} emacsagda)
+- -(cd ${bindir}; ln -s ${destdir}/bin/emacsagda emacsagda)
+ # No more energy to create variants
+ ${INSTALL} agdachecker ${bindir}
+
diff --git a/sci-mathematics/agda/metadata.xml b/sci-mathematics/agda/metadata.xml
new file mode 100644
index 00000000000..11b2cbcae0b
--- /dev/null
+++ b/sci-mathematics/agda/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-mathematics</herd>
+ <herd>haskell</herd>
+<longdescription lang="en">
+ Agda is an interactive proof editor, or proof assistant. Its input language,
+ called Agda language (or simply Agda), is based on a constructive type
+ theory á la Martin-Löf, extended with dependent record types,
+ inductive definitions, module structures and a class hierarchy mechanism.
+</longdescription>
+<use>
+ <flag name='cpphs'>Use cpphs instead of cpp.</flag>
+ <flag name='epic'>Add support for the epic compiler.</flag>
+ <flag name='stdlib'>Install the standard library.</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/axiom/Manifest b/sci-mathematics/axiom/Manifest
new file mode 100644
index 00000000000..ed843094a6b
--- /dev/null
+++ b/sci-mathematics/axiom/Manifest
@@ -0,0 +1 @@
+DIST axiom-may2008-src.tgz 207172456 RMD160 496c91f00d3b8623c13ea82ee5a95698899a5406 SHA1 51949340f754104c0fa72e269737538829cd9062 SHA256 c91cc50a9a6b9d66b398f8b96236249db72b6ce280d51c188db1805a4534380e
diff --git a/sci-mathematics/axiom/axiom-200805.ebuild b/sci-mathematics/axiom/axiom-200805.ebuild
new file mode 100644
index 00000000000..8552dea7f56
--- /dev/null
+++ b/sci-mathematics/axiom/axiom-200805.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils multilib flag-o-matic
+
+DESCRIPTION="Axiom is a general purpose Computer Algebra system"
+HOMEPAGE="http://axiom.axiom-developer.org/"
+SRC_URI="http://www.axiom-developer.org/axiom-website/downloads/${PN}-may2008-src.tgz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# NOTE: Do not strip since this seems to remove some crucial
+# runtime paths as well, thereby, breaking axiom
+RESTRICT="strip"
+
+DEPEND="virtual/latex-base
+ x11-libs/libXaw
+ sys-apps/debianutils
+ sys-process/procps"
+RDEPEND=""
+
+S="${WORKDIR}"/${PN}
+
+pkg_setup() {
+ # for 2.6.25 kernels and higher we need to have
+ # /proc/sys/kernel/randomize_va_space set to somthing other
+ # than 2, otherwise gcl fails to compile (see bug #186926).
+ local current_setting=$(/sbin/sysctl kernel.randomize_va_space 2>/dev/null | cut -d' ' -f3)
+ if [[ ${current_setting} == 2 ]]; then
+ echo
+ eerror "Your kernel has brk randomization enabled. This will"
+ eerror "cause axiom to fail to compile *and* run (see bug #186926)."
+ eerror "You can issue:"
+ eerror
+ eerror " /sbin/sysctl -w kernel.randomize_va_space=1"
+ eerror
+ eerror "as root to turn brk randomization off temporarily."
+ eerror "However, when not using axiom you may want to turn"
+ eerror "brk randomization back on via"
+ eerror
+ eerror " /sbin/sysctl -w kernel.randomize_va_space=2"
+ eerror
+ eerror "since it results in a less secure kernel."
+ die "Kernel brk randomization detected"
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}"/noweb-2.9-insecure-tmp-file.patch.input \
+ "${S}"/zips/noweb-2.9-insecure-tmp-file.patch \
+ || die "Failed to fix noweb"
+ cp "${FILESDIR}"/${PN}-200711-gcl-configure.patch \
+ "${S}"/zips/gcl-2.6.7.configure.in.patch \
+ || die "Failed to fix gcl-2.6.7 configure"
+ epatch "${FILESDIR}"/noweb-2.9-insecure-tmp-file.Makefile.patch
+
+ # lots of strict-aliasing badness
+ append-flags -fno-strict-aliasing
+}
+
+src_compile() {
+ # use gcl 2.6.7
+ sed -e "s:GCLVERSION=gcl-2.6.8pre$:GCLVERSION=gcl-2.6.7:" \
+ -i Makefile.pamphlet Makefile \
+ || die "Failed to select proper gcl"
+
+ # fix libXpm.a location
+ sed -e "s:X11R6/lib:$(get_libdir):g" -i Makefile.pamphlet \
+ || die "Failed to fix libXpm lib paths"
+
+ # Let the fun begin...
+ AXIOM="${S}"/mnt/linux emake -j1
+}
+
+src_install() {
+ emake DESTDIR="${D}"/opt/axiom COMMAND="${D}"/opt/axiom/mnt/linux/bin/axiom install
+
+ mv "${D}"/opt/axiom/mnt/linux/* "${D}"/opt/axiom \
+ || die "Failed to mv axiom into its final destination path."
+ rm -fr "${D}"/opt/axiom/mnt \
+ || die "Failed to remove old directory."
+
+ dodir /usr/bin
+ dosym /opt/axiom/bin/axiom /usr/bin/axiom
+
+ sed -e "2d;3i AXIOM=/opt/axiom" \
+ -i "${D}"/opt/axiom/bin/axiom \
+ || die "Failed to patch axiom runscript!"
+
+ dodoc changelog readme faq
+}
diff --git a/sci-mathematics/axiom/files/axiom-200711-gcl-configure.patch b/sci-mathematics/axiom/files/axiom-200711-gcl-configure.patch
new file mode 100644
index 00000000000..a5ecb58d7cc
--- /dev/null
+++ b/sci-mathematics/axiom/files/axiom-200711-gcl-configure.patch
@@ -0,0 +1,11 @@
+--- configure 2008-02-01 09:06:15.000000000 -0500
++++ configure.new 2008-02-01 09:03:18.000000000 -0500
+@@ -1711,7 +1711,7 @@
+ # results, and the version is kept in special file).
+
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+- system=MP-RAS-`${AWK} '{print $3}' /etc/.relid'`
++ system=MP-RAS-`${AWK} '{print $3}' '/etc/.relid'`
+ fi
+ if test "`uname -s`" = "AIX" ; then
+ system=AIX-`uname -v`.`uname -r`
diff --git a/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.Makefile.patch b/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.Makefile.patch
new file mode 100644
index 00000000000..b8cd40ea03b
--- /dev/null
+++ b/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.Makefile.patch
@@ -0,0 +1,10 @@
+--- Makefile~ 2005-09-05 19:50:31.000000000 +0100
++++ Makefile 2006-02-17 17:08:31.000000000 +0000
+@@ -85,6 +85,7 @@
+ ${PATCH} <${ZIPS}/noweb.modules.c.patch ; \
+ cd ${OBJ}/noweb/src ; \
+ ${PATCH} <${ZIPS}/noweb.src.Makefile.patch ; \
++ ${PATCH} -p0 <${ZIPS}/noweb-2.9-insecure-tmp-file.patch ; \
+ ./awkname ${AWK} ; \
+ ${ENV} ${MAKE} BIN=${MNT}/${SYS}/bin/lib LIB=${MNT}/${SYS}/bin/lib \
+ MAN=${MNT}/${SYS}/bin/man \
diff --git a/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.patch.input b/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.patch.input
new file mode 100644
index 00000000000..00288a8a313
--- /dev/null
+++ b/sci-mathematics/axiom/files/noweb-2.9-insecure-tmp-file.patch.input
@@ -0,0 +1,168 @@
+--- awkname
++++ awkname
+@@ -5,7 +5,7 @@
+ esac
+
+ rc=0
+-new=/tmp/$$.new; old=/tmp/$$.old
++new=$(tempfile -p new); old=$(tempfile -p old)
+
+ for file in lib/emptydefn lib/unmarkup lib/toascii \
+ awk/noidx awk/totex awk/tohtml awk/noindex \
+--- awk/totex.nw
++++ awk/totex.nw
+@@ -24,7 +24,7 @@
+ @
+ On an ugly system, we have to put it in a file.
+ <<invoke awk program using file>>=
+-awkfile=/tmp/totex$$.awk
++awkfile=$(tempfile -p totex)
+ trap 'rm -f $awkfile; exit 1' 0 1 2 15 # clean up files
+ cat > $awkfile << 'EOF'
+ <<awk program for conversion to {\TeX}>>
+--- lib/toascii
++++ lib/toascii
+@@ -7,9 +7,9 @@
+ *) echo "This can't happen -- $i passed to toascii" 1>&2 ; exit 1 ;;
+ esac
+ done
+-awkfile="tmp/awk$$.tmp"
+-textfile="/tmp/text$$.tmp"
+-tagsfile="/tmp/tags$$.tmp"
++awkfile=$(tempfile -p awk -s .tmp)
++textfile=$(tempfile -p text -s .tmp)
++tagsfile=$(tempfile -p tags -s .tmp)
+ export awkfile textfile tagsfile
+ trap 'rm -f $awkfile $textfile $tagsfile' 0 1 2 10 14 15
+ nawk 'BEGIN { textfile=ENVIRON["textfile"]
+--- shell/cpif
++++ shell/cpif
+@@ -17,7 +17,7 @@
+ 0) echo 'Usage: '`basename $0`' [ -eq -ne ] file...' 1>&2; exit 2
+ esac
+
+-new=/tmp/$$
++new=$(tempfile)
+ trap 'rm -f $new; exit 1' 1 2 15 # clean up files
+
+ cat >$new
+--- shell/nonu
++++ shell/nonu
+@@ -2,7 +2,7 @@
+ LIB=/usr/public/pkg/noweb/lib
+ # attempt to convert nuweb to noweb using sam
+
+-tmp=/tmp/nonu$$
++tmp=$(tempfile -p nonu)
+ trap '/bin/rm -f $tmp; exit 1' 1 2 15 # clean up files
+ cp $1 $tmp || exit 1
+
+--- shell/roff.nw
++++ shell/roff.nw
+@@ -80,7 +80,7 @@
+ other, and quoting each quote is ugly. The pragmatic solution is to
+ copy the awk program into a temporary file, using a shell here-document.
+ <<invoke awk program>>=
+-awkfile="/tmp/noweb$$.awk"
++awkfile=$(tempfile -p noweb -s .awk)
+ trap 'rm -f $awkfile' 0 1 2 10 14 15
+ cat > $awkfile << 'EOF'
+ <<awk program>>
+@@ -662,12 +662,13 @@
+
+ base="`basename $1 | sed '/\./s/\.[^.]*$//'`"
+ tagsfile="$base.nwt"
++tmpfile=$(tempfile -p tags)
+ (echo ".so $macrodir/tmac.w"
+ if [ -r "$tagsfile" ]; then
+- cp $tagsfile /tmp/tags.$$
++ cp $tagsfile $tmpfile
+ $AWK '<<action for [[tags]] line>>
+- <<functions>>' /tmp/tags.$$
+- rm -f /tmp/tags.$$
++ <<functions>>' $tmpfile
++ rm -f $tmpfile
+ fi
+ cat "$@") |
+ ($ROFF $opts 2>$tagsfile)
+--- shell/noroff
++++ shell/noroff
+@@ -35,9 +35,10 @@
+
+ base="`basename $1 | sed '/\./s/\.[^.]*$//'`"
+ tagsfile="$base.nwt"
++tmpfile=$(tempfile -p tags)
+ (echo ".so $macrodir/tmac.w"
+ if [ -r "$tagsfile" ]; then
+- cp $tagsfile /tmp/tags.$$
++ cp $tagsfile $tmpfile
+ $AWK '{
+ if (sub(/^###TAG### / , "")) tags[$1] = $2
+ else if (sub(/^###BEGINCHUNKS###/, "")) printf ".de CLIST\n.CLISTBEGIN\n"
+@@ -88,8 +89,8 @@
+ # print str3
+ # print convquote(str3)
+ # }
+- function tag(s) { if (s in tags) return tags[s]; else return "???" }' /tmp/tags.$$
+- rm -f /tmp/tags.$$
++ function tag(s) { if (s in tags) return tags[s]; else return "???" }' $tmpfile
++ rm -f $tmpfile
+ fi
+ cat "$@") |
+ ($ROFF $opts 2>$tagsfile)
+--- shell/toroff
++++ shell/toroff
+@@ -9,7 +9,7 @@
+ exit 1;;
+ esac
+ done
+-awkfile="/tmp/noweb$$.awk"
++awkfile=$(tempfile -p noweb -s .awk)
+ trap 'rm -f $awkfile' 0 1 2 10 14 15
+ cat > $awkfile << 'EOF'
+ /^@begin docs 0$/ { if (delay) next }
+--- lib/toascii.nw
++++ lib/toascii.nw
+@@ -28,9 +28,9 @@
+ Also arranged here is a temporary file for storage of the awk program on an
+ ugly system, as discussed below.
+ <<arrange temporary files>>=
+-awkfile="tmp/awk$$.tmp"
+-textfile="/tmp/text$$.tmp"
+-tagsfile="/tmp/tags$$.tmp"
++awkfile=$(tempfile -p awk -s .tmp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++textfile=$(tempfile -p text -s .tmp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++tagsfile=$(tempfile -p tags -s .tmp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+ export awkfile textfile tagsfile
+ trap 'rm -f $awkfile $textfile $tagsfile' 0 1 2 10 14 15
+ @ %def textfile tagsfile awkfile
+--- shell/roff.mm
++++ shell/roff.mm
+@@ -214,7 +214,7 @@
+ .ADDLIST 1a
+ .PRINTLIST
+
+-awkfile="/tmp/noweb$$.awk"
++awkfile=$(tempfile -p noweb -s .awk) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+ trap 'rm -f $awkfile' 0 1 2 10 14 15
+ cat > $awkfile \&<< 'EOF'
+ \c
+@@ -1628,14 +1628,15 @@
+ tagsfile="$base.nwt"
+ (echo ".so $macrodir/tmac.w"
+ if [ -r "$tagsfile" ]; then
+- cp $tagsfile /tmp/tags.$$
++ tagstemp=$(tempfile -p tags) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++ cp $tagsfile $tagstemp
+ $AWK '\c
+ .USE "action for \*[BEGINCONVQUOTE]tags\*[ENDCONVQUOTE] line" 11c
+ \&
+ \c
+ .USE "functions" 8a
+-\&' /tmp/tags.$$
+- rm -f /tmp/tags.$$
++\&' $tagstemp
++ rm -f $tagstemp
+ fi
+ cat "$@") |
+ ($ROFF $opts 2>$tagsfile)
diff --git a/sci-mathematics/axiom/metadata.xml b/sci-mathematics/axiom/metadata.xml
new file mode 100644
index 00000000000..2b0bd531482
--- /dev/null
+++ b/sci-mathematics/axiom/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-mathematics</herd>
+</pkgmetadata>
diff --git a/sci-mathematics/bertini/Manifest b/sci-mathematics/bertini/Manifest
new file mode 100644
index 00000000000..6140e74e98d
--- /dev/null
+++ b/sci-mathematics/bertini/Manifest
@@ -0,0 +1 @@
+DIST BertiniSource_v1.4.tar.gz 1827401 SHA256 61ce11b2714d1540311c1a8e3192ff92bfbd8fd85c357b554d22ab6cbe67f6a1 SHA512 bb53f8ed24a0f21e95b4e373be36039b69ea0ddb11ad8240bcf52ce64436a56c1f2057a5d733d017fdf68cfb3598a473e1f12b4659308890e2e2575b7d8143f6 WHIRLPOOL f832076f0c2277c35df28d7ed94476e1ec086c5fcb4a80e52fd3cd2d5fce79ecbc66606ba1cb0f71ca0fa6180c0e82e79b5cc85eb5949de64b6c9d8e2e8b7e6a
diff --git a/sci-mathematics/bertini/bertini-1.4.ebuild b/sci-mathematics/bertini/bertini-1.4.ebuild
new file mode 100644
index 00000000000..b6b7c6504c0
--- /dev/null
+++ b/sci-mathematics/bertini/bertini-1.4.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+MYP="BertiniSource_v${PV}"
+
+DESCRIPTION="Software for Numerical Algebraic Geometry"
+HOMEPAGE="http://bertini.nd.edu"
+
+SRC_URI="http://www3.nd.edu/~sommese/bertini/${MYP}.tar.gz"
+
+LICENSE="bertini"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples +optimization"
+DEPEND="
+ sys-devel/bison
+ sys-devel/flex
+"
+RDEPEND="
+ dev-libs/gmp
+ dev-libs/mpfr
+"
+
+S="${WORKDIR}/${MYP}/src"
+
+src_prepare() {
+ if ! use optimization; then
+ sed -i -e "s/\$(OPT)/ ${CXXFLAGS} ${LDFLAGS}/" Makefile
+ else
+ sed -i -e "s/\$(OPT)/ \$(OPT) ${LDFLAGS}/" Makefile
+ fi
+ sed -i -e "s/gcc/$(tc-getCC)/" Makefile
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ emake
+}
+
+src_install() {
+ dobin bertini
+ if use doc; then
+ dodoc "${WORKDIR}/${MYP}/BertiniUsersManual.pdf"
+ fi
+ if use examples; then
+ insinto "/usr/share/${PN}"
+ doins -r "${WORKDIR}/${MYP}/examples"
+ elog "Examples have been installed into /usr/share/${MYP}"
+ fi
+}
diff --git a/sci-mathematics/bertini/metadata.xml b/sci-mathematics/bertini/metadata.xml
new file mode 100644
index 00000000000..e79bcd17ddc
--- /dev/null
+++ b/sci-mathematics/bertini/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-mathematics</herd>
+ <maintainer>
+ <email>tomka@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+Bertini: Software for Numerical Algebraic Geometry
+
+Facts in brief:
+
+ Purpose: The numerical solution of systems of polynomial equations
+
+ Approach: Homotopy continuation.
+
+ Authors: Daniel J. Bates, Jonathan D. Hauenstein, Andrew J. Sommese, Charles W. Wampler
+
+ Background: Bertini is a general-purpose solver, written in C, that was
+ created for research about polynomial continuation.
+</longdescription>
+<use>
+ <flag name="optimization">Accept upstream's choices for -O option.</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/cado-nfs/Manifest b/sci-mathematics/cado-nfs/Manifest
new file mode 100644
index 00000000000..b237edbbf30
--- /dev/null
+++ b/sci-mathematics/cado-nfs/Manifest
@@ -0,0 +1,4 @@
+DIST cado-nfs-1.1.tar.gz 1453860 SHA256 295c8662208c432a98157951ddc117820ff2e57ee36fdae53b30dca89ebfc02f SHA512 e0578c4931eaa044c46e1a11e4d44f0d716f5049b9414a73371a2f1001798e5b011887ae450ff1a4256cd683e928c88b7f4f5af8402570c5dc3f4d17c9801101 WHIRLPOOL 4162a221763cb858beab19259331a1ed2fbafede4f55af1dc962869cfd00cd37af867b021d595f902f0a111f2af5548a783be3ca1fdd4e5c3421a3d804633903
+DIST cado-nfs-2.0.tar.gz 2088866 SHA256 67f2ca3f739e07e89c9873f98d876bf771a3900288eda3d724b06f5736b4bfa2 SHA512 7f531e9ad1445c763a2fd37441e2e3bf6d4184d0d93be414d078b7024860c9d85754afe6629d9436b540361183462792248a88c0af76407d10a621385ec5b18b WHIRLPOOL 91b7a874cedb90c555625f9a0187f62c2cfccebc7236182d6bba17187fa5080b5164b121361035f3c7281881cc44f026fb66c6b242f8abcf6b6628a6eb280b90
+DIST cado-nfs-2.1.1.tar.gz 2560216 SHA256 7493b3d38c7bb7db2e3e8068f6d7da2bf0429d5cc153af668f677af99f0320fa SHA512 8463fddc49cf7ad3caef47f9b96fd8ed63de63fa3aa9791b94e58d920f2bb66d843e6e53bab81eaea62d3cbdc834c4f7b7f294d255ac7def74ff51a651905002 WHIRLPOOL cecea890bc48b80ad8907e69f8ca386a45b99f4735cdec3bdfba936bf502b6efbf76bbae3f4a8f60e8f676c27f441ae03ec8327be05c92eecbcf7751b8d34f9f
+DIST cado-nfs-2.1.tar.gz 2558577 SHA256 ff50baeb2eb5bf0ff3dd8600056e8e762fa30c94c2425fb73843329ced2a5ae1 SHA512 fcdba87ca349485e6d25c1298cc90197855a2fa354b51edb827445b10e7cb023f5d239e02aba0cdae28b4f4b38d260b4b492cdf5eb0c929afdca6aa604b29191 WHIRLPOOL c23a7b5d184efa385689493831f70cff823811d8f320ea3e91f367c580b285dcf6515027d466784d56c5f3f49d51e1d3baccd566096af561710b9267d1e0bdda
diff --git a/sci-mathematics/cado-nfs/cado-nfs-1.1.ebuild b/sci-mathematics/cado-nfs/cado-nfs-1.1.ebuild
new file mode 100644
index 00000000000..518c0079882
--- /dev/null
+++ b/sci-mathematics/cado-nfs/cado-nfs-1.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Number Field Sieve (NFS) implementation for factoring integers"
+HOMEPAGE="http://cado-nfs.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/29330/${P}.tar.gz"
+
+inherit eutils cmake-utils
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/gmp
+ dev-lang/perl
+ !sci-mathematics/ggnfs
+ !sci-biology/shrimp
+ "
+DEPEND="${RDEPEND}
+ "
+
+src_configure() {
+ DESTINATION="/usr/libexec/cado-nfs" cmake-utils_src_configure
+}
+src_compile() {
+ # autodetection goes confused for gf2x
+ ABI=default cmake-utils_src_compile
+}
diff --git a/sci-mathematics/cado-nfs/cado-nfs-2.0.ebuild b/sci-mathematics/cado-nfs/cado-nfs-2.0.ebuild
new file mode 100644
index 00000000000..74f10caa633
--- /dev/null
+++ b/sci-mathematics/cado-nfs/cado-nfs-2.0.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Number Field Sieve (NFS) implementation for factoring integers"
+HOMEPAGE="http://cado-nfs.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/33131/${P}.tar.gz"
+
+inherit eutils cmake-utils
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/gmp
+ dev-lang/perl
+ !sci-mathematics/ggnfs
+ !sci-biology/shrimp
+ "
+DEPEND="${RDEPEND}
+ "
+
+src_prepare() {
+ # looks like packaging mistake
+ sed -i -e 's/add_executable (convert_rels convert_rels.c)//' misc/CMakeLists.txt || die
+ sed -i -e 's/target_link_libraries (convert_rels utils)//' misc/CMakeLists.txt || die
+ sed -i -e 's~install(TARGETS convert_rels RUNTIME DESTINATION bin/misc)~~' misc/CMakeLists.txt || die
+}
+
+src_configure() {
+ DESTINATION="/usr/libexec/cado-nfs" cmake-utils_src_configure
+}
+src_compile() {
+ # autodetection goes confused for gf2x
+ ABI=default cmake-utils_src_compile
+}
diff --git a/sci-mathematics/cado-nfs/cado-nfs-2.1.1.ebuild b/sci-mathematics/cado-nfs/cado-nfs-2.1.1.ebuild
new file mode 100644
index 00000000000..8ef8f4297c7
--- /dev/null
+++ b/sci-mathematics/cado-nfs/cado-nfs-2.1.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Number Field Sieve (NFS) implementation for factoring integers"
+HOMEPAGE="http://cado-nfs.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/file/34110/${P}.tar.gz"
+
+inherit eutils cmake-utils
+
+# Fails F9_{k,m}bucket_test F9_tracektest
+RESTRICT="test"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/gmp
+ dev-lang/perl
+ !sci-mathematics/ggnfs
+ !sci-biology/shrimp
+ "
+DEPEND="${RDEPEND}
+ "
+
+src_prepare() {
+ # looks like packaging mistake
+ sed -i -e 's/add_executable (convert_rels convert_rels.c)//' misc/CMakeLists.txt || die
+ sed -i -e 's/target_link_libraries (convert_rels utils)//' misc/CMakeLists.txt || die
+ sed -i -e 's~install(TARGETS convert_rels RUNTIME DESTINATION bin/misc)~~' misc/CMakeLists.txt || die
+}
+
+src_configure() {
+ DESTINATION="/usr/libexec/cado-nfs" cmake-utils_src_configure
+}
+src_compile() {
+ # autodetection goes confused for gf2x
+ ABI=default cmake-utils_src_compile
+}
diff --git a/sci-mathematics/cado-nfs/cado-nfs-2.1.ebuild b/sci-mathematics/cado-nfs/cado-nfs-2.1.ebuild
new file mode 100644
index 00000000000..af4044b322f
--- /dev/null
+++ b/sci-mathematics/cado-nfs/cado-nfs-2.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Number Field Sieve (NFS) implementation for factoring integers"
+HOMEPAGE="http://cado-nfs.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/file/33856/${P}.tar.gz"
+
+inherit eutils cmake-utils
+
+# Fails F9_{k,m}bucket_test F9_tracektest
+RESTRICT="test"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/gmp
+ dev-lang/perl
+ !sci-mathematics/ggnfs
+ !sci-biology/shrimp
+ "
+DEPEND="${RDEPEND}
+ "
+
+src_prepare() {
+ # looks like packaging mistake
+ sed -i -e 's/add_executable (convert_rels convert_rels.c)//' misc/CMakeLists.txt || die
+ sed -i -e 's/target_link_libraries (convert_rels utils)//' misc/CMakeLists.txt || die
+ sed -i -e 's~install(TARGETS convert_rels RUNTIME DESTINATION bin/misc)~~' misc/CMakeLists.txt || die
+}
+
+src_configure() {
+ DESTINATION="/usr/libexec/cado-nfs" cmake-utils_src_configure
+}
+src_compile() {
+ # autodetection goes confused for gf2x
+ ABI=default cmake-utils_src_compile
+}
diff --git a/sci-mathematics/cado-nfs/metadata.xml b/sci-mathematics/cado-nfs/metadata.xml
new file mode 100644
index 00000000000..24cbb90cf0c
--- /dev/null
+++ b/sci-mathematics/cado-nfs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-mathematics/calc/Manifest b/sci-mathematics/calc/Manifest
new file mode 100644
index 00000000000..3ac4498d354
--- /dev/null
+++ b/sci-mathematics/calc/Manifest
@@ -0,0 +1,5 @@
+DIST calc-2.12.1.5.tar.gz 1020389 SHA256 3a8b6daa60de0b5aa7c33dcfdf0aeec9d4523f51638235468de32f843ce79171
+DIST calc-2.12.2.2.tar.bz2 864687 SHA256 0a334cd331a4953a86365becce9b9f401b264a580a1f2130d5de700fa093772a
+DIST calc-2.12.4.13.tar.bz2 970778 SHA256 1e6fd3256bd7bf738fcfe6e2d6a9d8a6bb0f37393aba6020b01d96274419a92c SHA512 7b7136c793917652ce2f2b3866b2db16a69dbead729d8a72b8c1359ebb8a4e1d4e7a3a8b214f8e85b9ccf41193ba6ffcb49926cc68f494e2b6cdff58559f2534 WHIRLPOOL 365700655f53eb5efb58ee6fbdf1d123943c2cc6a799318d9a48e2c5b8e0e2e871fd36e54b185442e0a0bc5380644edca1612bbfe7e2506247015743cdb556ee
+DIST calc-2.12.4.3.tar.bz2 865956 SHA256 a4e7d8a9313e7d28653e2c372fca9b0defdc02f965b833bb43479bbdfee51a92
+DIST calc-2.12.4.4.tar.bz2 867180 SHA256 106a0e5dc4da94ec8711a8631cd5d17b3979cde1d248ba9385cdcb862cb1390b SHA512 58be9d70a2c79adeb44d86da6f5f2d04dbf09aaec10ad4e8eed870a7b8de1d4a7cd35b1738ccb5cc64ef5f945e6cfbe1944e27f064541289abe1a4e7f4703690 WHIRLPOOL 1a106ba7b10463aca673329b625721d47a14721467e7847fdbe509b8bf16b4c5829b006240faf58f915abb0f0bf9cbc033289077f20f0c74c2704fb63ccaf340
diff --git a/sci-mathematics/calc/calc-2.12.1.5.ebuild b/sci-mathematics/calc/calc-2.12.1.5.ebuild
new file mode 100644
index 00000000000..2ddaa5a451b
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.12.1.5.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="An arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="alpha ~amd64 ~ppc x86"
+
+IUSE=""
+
+DEPEND=">=sys-libs/ncurses-5.2
+ >=sys-libs/readline-4.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/less-348"
+
+src_compile() {
+ make \
+ T="${D}" \
+ DEBUG="${CFLAGS}" \
+ CALCPAGER=less \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory -lncurses" \
+ all \
+ || die
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ make chk || die "Check failed"
+ fi
+}
+
+src_install() {
+ make T="${D}" install || die
+ dodoc BUGS CHANGES LIBRARY README
+}
diff --git a/sci-mathematics/calc/calc-2.12.2.2.ebuild b/sci-mathematics/calc/calc-2.12.2.2.ebuild
new file mode 100644
index 00000000000..c2e889b2aa5
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.12.2.2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils multilib
+
+DESCRIPTION="An arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~alpha amd64 ~ppc ~ppc64 ~x86"
+
+IUSE=""
+
+DEPEND=">=sys-libs/ncurses-5.2
+ >=sys-libs/readline-4.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/less-348"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-libdir-fix.patch
+
+ sed -e "s:LIBDIR= /usr/lib:LIBDIR= /usr/$(get_libdir):" \
+ -i Makefile || die "Failed to fix multilib in makefile"
+}
+
+src_compile() {
+ # bug #299224
+ emake -j1 \
+ T="${D}" \
+ DEBUG="${CFLAGS}" \
+ CALCPAGER=less \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory -lncurses" \
+ all \
+ || die
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ make chk || die "Check failed"
+ fi
+}
+
+src_install() {
+ make T="${D}" install || die
+ dodoc BUGS CHANGES LIBRARY README
+}
diff --git a/sci-mathematics/calc/calc-2.12.4.13.ebuild b/sci-mathematics/calc/calc-2.12.4.13.ebuild
new file mode 100644
index 00000000000..66696e9940d
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.12.4.13.ebuild
@@ -0,0 +1,57 @@
+# 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="Arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="http://www.isthe.com/chongo/src/calc/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE=""
+
+DEPEND="
+ sys-libs/ncurses
+ sys-libs/readline"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.12.4.13-prefix.patch\
+ "${FILESDIR}"/2.12.4.0-ldflags.patch
+ ln -sf libcustcalc.so.${PV} custom/libcustcalc.so || die
+ sed -i -e "/DIR/s:/usr:${EPREFIX}/usr:g" Makefile || die
+}
+
+src_compile() {
+ # parallel compilation hard to fix. better to leave upstream.
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ DEBUG="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CALCPAGER="${PAGER}" \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory -lncurses -L${S}/custom -lcustcalc" \
+ all
+}
+
+src_test() {
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ emake chk
+ fi
+}
+
+src_install() {
+ emake \
+ T="${D}" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+ dodoc BUGS CHANGES LIBRARY README
+}
diff --git a/sci-mathematics/calc/calc-2.12.4.3.ebuild b/sci-mathematics/calc/calc-2.12.4.3.ebuild
new file mode 100644
index 00000000000..4b011af490f
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.12.4.3.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="An arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE=""
+
+DEPEND="
+ >=sys-libs/ncurses-5.2
+ >=sys-libs/readline-4.2"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.12.4.0-prefix.patch
+ epatch "${FILESDIR}"/2.12.4.0-ldflags.patch
+ ln -sf libcustcalc.so.${PV} custom/libcustcalc.so
+}
+
+src_compile() {
+ # parallel compilation hard to fix. better to leave upstream.
+ emake -j1 \
+ CC=$(tc-getCC) \
+ DEBUG="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CALCPAGER="${PAGER}" \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory -lncurses -L${S}/custom -lcustcalc" \
+ all || die "emake failed"
+}
+
+src_test() {
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ make chk || die "Check failed"
+ fi
+}
+
+src_install() {
+ emake T="${D}" LIBDIR="${EPREFIX}/usr/$(get_libdir)" install || die "emake install failed"
+ dodoc BUGS CHANGES LIBRARY README
+}
diff --git a/sci-mathematics/calc/calc-2.12.4.4.ebuild b/sci-mathematics/calc/calc-2.12.4.4.ebuild
new file mode 100644
index 00000000000..9aca67e632b
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.12.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=4
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="http://www.isthe.com/chongo/src/calc/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE=""
+
+DEPEND="
+ sys-libs/ncurses
+ sys-libs/readline"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.12.4.0-prefix.patch
+ epatch "${FILESDIR}"/2.12.4.0-ldflags.patch
+ ln -sf libcustcalc.so.${PV} custom/libcustcalc.so
+ sed -i -e "/DIR/s:/usr:${EPREFIX}/usr:g" Makefile || die
+}
+
+src_compile() {
+ # parallel compilation hard to fix. better to leave upstream.
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ DEBUG="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CALCPAGER="${PAGER}" \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory -lncurses -L${S}/custom -lcustcalc" \
+ all
+}
+
+src_test() {
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ emake chk || die "Check failed"
+ fi
+}
+
+src_install() {
+ emake \
+ T="${D}" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+ dodoc BUGS CHANGES LIBRARY README
+}
diff --git a/sci-mathematics/calc/files/2.12.4.0-ldflags.patch b/sci-mathematics/calc/files/2.12.4.0-ldflags.patch
new file mode 100644
index 00000000000..0f2b67d2c08
--- /dev/null
+++ b/sci-mathematics/calc/files/2.12.4.0-ldflags.patch
@@ -0,0 +1,101 @@
+diff --git a/Makefile b/Makefile
+index b526442..baa8273 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1144,11 +1144,13 @@ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+ LD_SHARE=
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ else
+-LIBCUSTCALC_SHLIB=
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ endif
+ #
+ CC_STATIC=
+@@ -1227,9 +1229,9 @@ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+ LD_SHARE=
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ else
+ LIBCUSTCALC_SHLIB=
+ endif
+@@ -1267,9 +1269,9 @@ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+ LD_SHARE=
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ else
+ LIBCUSTCALC_SHLIB=
+ endif
+@@ -1304,9 +1306,9 @@ CC_SHARE= -fPIC
+ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+ "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ else
+ LIBCUSTCALC_SHLIB=
+ endif
+@@ -1340,8 +1342,8 @@ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+ LD_SHARE=
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ #
+ CC_STATIC=
+ LD_STATIC=
+@@ -1394,9 +1396,9 @@ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+ LD_SHARE=
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ else
+ LIBCUSTCALC_SHLIB=
+ endif
+@@ -1431,9 +1433,9 @@ CC_SHARE= -fPIC
+ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+ "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+-LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+-LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
++LIBCUSTCALC_SHLIB= -shared ${LDFLAGS} "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ else
+ LIBCUSTCALC_SHLIB=
+ endif
+@@ -2002,7 +2004,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
+
+ calc${EXT}: .hsrc ${CALCOBJS} ${CALC_DYNAMIC_LIBS} ${MAKE_FILE}
+ ${RM} -f $@
+- ${CC} ${CALCOBJS} ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${CC} ${LDFLAGS} ${CALCOBJS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+ ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
+
+ libcalc${LIB_EXT_VERSION}: ${LIBOBJS} ver_calc${EXT} ${MAKE_FILE}
diff --git a/sci-mathematics/calc/files/calc-2.12.2.2-libdir-fix.patch b/sci-mathematics/calc/files/calc-2.12.2.2-libdir-fix.patch
new file mode 100644
index 00000000000..f265793ab87
--- /dev/null
+++ b/sci-mathematics/calc/files/calc-2.12.2.2-libdir-fix.patch
@@ -0,0 +1,12 @@
+diff -Naur calc-2.12.2.2.old/Makefile calc-2.12.2.2/Makefile
+--- calc-2.12.2.2.old/Makefile 2007-09-29 12:58:19.000000000 -0400
++++ calc-2.12.2.2/Makefile 2007-10-24 06:40:10.000000000 -0400
+@@ -1131,7 +1131,7 @@
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
++DEFAULT_LIB_INSTALL_PATH= /lib:/usr/lib:${LIBDIR}:/usr/local/lib
+ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+ "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
diff --git a/sci-mathematics/calc/files/calc-2.12.4.0-prefix.patch b/sci-mathematics/calc/files/calc-2.12.4.0-prefix.patch
new file mode 100644
index 00000000000..68d057212c7
--- /dev/null
+++ b/sci-mathematics/calc/files/calc-2.12.4.0-prefix.patch
@@ -0,0 +1,96 @@
+diff --git a/Makefile b/Makefile
+index cc84386..b526442 100644
+--- a/Makefile
++++ b/Makefile
+@@ -959,7 +959,7 @@ LD_DEBUG=
+ #
+ # If in doubt, use CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom
+ #
+-CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
++CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=.
+ #CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \
+ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 LD_LIBRARY_PATH=.:./custom
+ #CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \
+@@ -1143,9 +1143,7 @@ ifeq ($(target),Linux)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1177,9 +1175,8 @@ ifeq ($(target),Darwin)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib
+ LD_SHARE= ${DARWIN_ARCH}
+-LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
++LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION}
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
+ else
+@@ -1196,7 +1193,7 @@ CCWERR=
+ CCOPT= ${DEBUG}
+ CCMISC= ${DARWIN_ARCH}
+ #
+-LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
++LCC= gcc
+ CC= ${PURIFY} ${LCC} ${CCWERR}
+ #
+ # Darmin dynamic shared lib filenames
+@@ -1211,7 +1208,6 @@ LDCONFIG:=
+ # DARWIN_ARCH= -arch i386 # Intel binary
+ # DARWIN_ARCH= -arch ppc # PPC binary
+ DARWIN_ARCH= # native binary
+-MACOSX_DEPLOYMENT_TARGET=10.4
+ #
+ endif
+
+@@ -1230,9 +1226,7 @@ ifeq ($(target),FreeBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1272,9 +1266,7 @@ ifeq ($(target),OpenBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1347,9 +1339,7 @@ ifeq ($(target),simple)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ #
+@@ -1403,9 +1393,7 @@ CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
diff --git a/sci-mathematics/calc/files/calc-2.12.4.13-prefix.patch b/sci-mathematics/calc/files/calc-2.12.4.13-prefix.patch
new file mode 100644
index 00000000000..727618c3fe7
--- /dev/null
+++ b/sci-mathematics/calc/files/calc-2.12.4.13-prefix.patch
@@ -0,0 +1,87 @@
+diff --git a/Makefile b/Makefile
+index cc84386..b526442 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1143,9 +1143,7 @@ ifeq ($(target),Linux)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1177,9 +1175,8 @@ ifeq ($(target),Darwin)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib
+ LD_SHARE= ${DARWIN_ARCH}
+-LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
++LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION}
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
+ else
+@@ -1196,7 +1193,7 @@ CCWERR=
+ CCOPT= ${DEBUG}
+ CCMISC= ${DARWIN_ARCH}
+ #
+-LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
++LCC= gcc
+ CC= ${PURIFY} ${LCC} ${CCWERR}
+ #
+ # Darmin dynamic shared lib filenames
+@@ -1211,7 +1208,6 @@ LDCONFIG:=
+ # DARWIN_ARCH= -arch i386 # Intel binary
+ # DARWIN_ARCH= -arch ppc # PPC binary
+ DARWIN_ARCH= # native binary
+-MACOSX_DEPLOYMENT_TARGET=10.8
+ #
+ endif
+
+@@ -1230,9 +1226,7 @@ ifeq ($(target),FreeBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1272,9 +1266,7 @@ ifeq ($(target),OpenBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1347,9 +1339,7 @@ ifeq ($(target),simple)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ #
+@@ -1403,9 +1393,7 @@ CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
++LD_SHARE=
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
diff --git a/sci-mathematics/calc/metadata.xml b/sci-mathematics/calc/metadata.xml
new file mode 100644
index 00000000000..4c7eb900a0c
--- /dev/null
+++ b/sci-mathematics/calc/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-mathematics</herd>
+<longdescription lang='en'>
+ Calc is an interactive calculator which provides for easy large
+ numeric calculations, but which also can be easily programmed for
+ difficult or long calculations. It can accept a command line argument,
+ in which case it executes that single command and exits. Otherwise, it
+ enters interactive mode.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/cgal/Manifest b/sci-mathematics/cgal/Manifest
new file mode 100644
index 00000000000..3d7cd225965
--- /dev/null
+++ b/sci-mathematics/cgal/Manifest
@@ -0,0 +1,4 @@
+DIST CGAL-4.3-doc_html.tar.xz 15582924 SHA256 dd28989ee950178b3f22d8b14111510312586c1a2c0b29a73a2a14d7d7eb5059 SHA512 41125ab3b5135ae539365e6c128f79119a679292e734e1669cc43a35996363951f5a5d494f8c25c3b1eab75a69137ed51bf7b65ad6d47e56756212565ec245ec WHIRLPOOL 961c4fea224e2c94a65a7dd07b16326159e9fe95f9176abd0cc96be3cb53060c076a80d5efd2d9c640c2aa2eea0d3d06ce64839961906a588706647830849972
+DIST CGAL-4.3.tar.xz 10108992 SHA256 cc475885b4ca4b15ab5d446c0e554b7b69f6980969bc3a8c5b83f8da4ee1bb04 SHA512 dcf329232f6511be6b7eecef7afbfd505529385cb29a3717b762068a3dac52b3706b1d55c6e30b677c6cf2f99aae937de7d730d30cc33680fc39df0f0ff76e70 WHIRLPOOL 862d5bc3387afa1b6702974b7fab3b7d4c35334023eb813bb52a6c7092d6f89104db8c7b851fd7ebb7dfdd38392f9d6459e9afab34bf237b0484f7d395035873
+DIST CGAL-4.6.1-doc_html.tar.xz 33812896 SHA256 eac811009dac1cf87fac42f493e57b902e90f3d5e74201d0ea9b688835854886 SHA512 d351bae419cff4d2bc576f461b9c29335a25afbccd7d56f83f3ad503ca6f9295cda4aa27b1d74563fbb41a9d92c71600f9575302a4597623e984097484928161 WHIRLPOOL d4f0ab9b57fcf9a4317a1c3f6f6fae26396b2b95c2a24d410d231c74ac6f544f5394962702fcbf841e606078a81520c2e3b236e2f5bc9b3a25f4675d757e8c9f
+DIST CGAL-4.6.1.tar.xz 12014652 SHA256 33bd82871ccbaf16dc509f78f3f91dd35d44197cad64bffa63a1671a1812351a SHA512 4227ea03c23f3858a47e0559bc0a3df34e447e18e2b053048378c479b9b7fa2a157cf9aa546d7659a1d4d640218944fe1104a21769144cdfdc8a5144299f4b61 WHIRLPOOL 309deea6268d036b14796b411a7dcdbe75433a6d5eb2296387b05f2957e538cce6e6fe0b23be3921a500eae74db954058ed57aeef8759e44f4038d2fbab884f7
diff --git a/sci-mathematics/cgal/cgal-4.3-r1.ebuild b/sci-mathematics/cgal/cgal-4.3-r1.ebuild
new file mode 100644
index 00000000000..caf5f20129e
--- /dev/null
+++ b/sci-mathematics/cgal/cgal-4.3-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_BUILD_TYPE=Release
+
+inherit multilib cmake-utils
+
+MY_P=CGAL-${PV}
+PID=32995
+DPID=33000
+
+DESCRIPTION="C++ library for geometric algorithms and data structures"
+HOMEPAGE="http://www.cgal.org/ https://gforge.inria.fr/projects/cgal/"
+SRC_URI="
+ http://gforge.inria.fr/frs/download.php/${PID}/${MY_P}.tar.xz
+ doc? ( http://gforge.inria.fr/frs/download.php/${DPID}/${MY_P}-doc_html.tar.xz )"
+
+LICENSE="LGPL-3 GPL-3 Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples +gmp mpfi qt4"
+
+RDEPEND="
+ dev-libs/boost
+ dev-libs/mpfr:0
+ sys-libs/zlib
+ x11-libs/libX11
+ virtual/glu
+ virtual/opengl
+ gmp? ( dev-libs/gmp[cxx] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ )
+ mpfi? ( sci-libs/mpfi )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS="AUTHORS CHANGES* README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cmake-3.3.patch
+
+ cmake-utils_src_prepare
+ sed \
+ -e '/install(FILES AUTHORS/d' \
+ -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCGAL_INSTALL_LIB_DIR=$(get_libdir)
+ -DWITH_CGAL_Qt3=OFF
+ -DWITH_LEDA=OFF
+ $(cmake-utils_use_with gmp)
+ $(cmake-utils_use_with gmp GMPXX)
+ $(cmake-utils_use_with qt4 CGAL_Qt4)
+ $(cmake-utils_use_with mpfi)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${WORKDIR}"/doc_html/. )
+ cmake-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples demo
+ fi
+}
diff --git a/sci-mathematics/cgal/cgal-4.3.ebuild b/sci-mathematics/cgal/cgal-4.3.ebuild
new file mode 100644
index 00000000000..46bbca20223
--- /dev/null
+++ b/sci-mathematics/cgal/cgal-4.3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_BUILD_TYPE=Release
+
+inherit multilib cmake-utils
+
+MY_P=CGAL-${PV}
+PID=32995
+DPID=33000
+
+DESCRIPTION="C++ library for geometric algorithms and data structures"
+HOMEPAGE="http://www.cgal.org/ https://gforge.inria.fr/projects/cgal/"
+SRC_URI="
+ http://gforge.inria.fr/frs/download.php/${PID}/${MY_P}.tar.xz
+ doc? ( http://gforge.inria.fr/frs/download.php/${DPID}/${MY_P}-doc_html.tar.xz )"
+
+LICENSE="LGPL-3 GPL-3 Boost-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples +gmp mpfi qt4"
+
+RDEPEND="
+ dev-libs/boost
+ dev-libs/mpfr:0
+ sys-libs/zlib
+ x11-libs/libX11
+ virtual/glu
+ virtual/opengl
+ gmp? ( dev-libs/gmp[cxx] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ )
+ mpfi? ( sci-libs/mpfi )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS="AUTHORS CHANGES* README"
+
+src_prepare() {
+ cmake-utils_src_prepare
+ sed \
+ -e '/install(FILES AUTHORS/d' \
+ -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs+=(
+ -DCGAL_INSTALL_LIB_DIR=$(get_libdir)
+ -DWITH_CGAL_Qt3=OFF
+ -DWITH_LEDA=OFF
+ $(cmake-utils_use_with gmp)
+ $(cmake-utils_use_with gmp GMPXX)
+ $(cmake-utils_use_with qt4 CGAL_Qt4)
+ $(cmake-utils_use_with mpfi)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${WORKDIR}"/doc_html/. )
+ cmake-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples demo
+ fi
+}
diff --git a/sci-mathematics/cgal/cgal-4.6.1.ebuild b/sci-mathematics/cgal/cgal-4.6.1.ebuild
new file mode 100644
index 00000000000..33382d425c7
--- /dev/null
+++ b/sci-mathematics/cgal/cgal-4.6.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CMAKE_BUILD_TYPE=Release
+
+inherit multilib cmake-utils
+
+MY_P=CGAL-${PV}
+PID=34900
+DPID=34902
+
+DESCRIPTION="C++ library for geometric algorithms and data structures"
+HOMEPAGE="http://www.cgal.org/ https://gforge.inria.fr/projects/cgal/"
+SRC_URI="
+ http://gforge.inria.fr/frs/download.php/${PID}/${MY_P}.tar.xz
+ doc? ( http://gforge.inria.fr/frs/download.php/${DPID}/${MY_P}-doc_html.tar.xz )"
+
+LICENSE="LGPL-3 GPL-3 Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples +gmp mpfi qt4"
+
+RDEPEND="
+ dev-libs/boost
+ dev-libs/mpfr:0
+ sys-libs/zlib
+ x11-libs/libX11
+ virtual/glu
+ virtual/opengl
+ gmp? ( dev-libs/gmp[cxx] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ )
+ mpfi? ( sci-libs/mpfi )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS="AUTHORS CHANGES* README"
+
+src_prepare() {
+ cmake-utils_src_prepare
+ sed \
+ -e '/install(FILES AUTHORS/d' \
+ -i CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCGAL_INSTALL_LIB_DIR=$(get_libdir)
+ -DWITH_CGAL_Qt3=OFF
+ -DWITH_LEDA=OFF
+ $(cmake-utils_use_with gmp)
+ $(cmake-utils_use_with gmp GMPXX)
+ $(cmake-utils_use_with qt4 CGAL_Qt4)
+ $(cmake-utils_use_with mpfi)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${WORKDIR}"/doc_html/. )
+ cmake-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples demo
+ fi
+}
diff --git a/sci-mathematics/cgal/files/cgal-4.3-cmake-3.3.patch b/sci-mathematics/cgal/files/cgal-4.3-cmake-3.3.patch
new file mode 100644
index 00000000000..b1490454e55
--- /dev/null
+++ b/sci-mathematics/cgal/files/cgal-4.3-cmake-3.3.patch
@@ -0,0 +1,24 @@
+--- CGAL-4.3/CMakeLists.txt
++++ CGAL-4.3/CMakeLists.txt
+@@ -19,6 +19,10 @@
+ cmake_policy(VERSION 2.6)
+ endif()
+
++if(POLICY CMP0026)
++ cmake_policy(SET CMP0026 OLD)
++endif()
++
+ #--------------------------------------------------------------------------------------------------
+ #
+ # -= PACKAGE SETUP =-
+--- CGAL-4.3/src/CMakeLists.txt
++++ CGAL-4.3/src/CMakeLists.txt
+@@ -116,7 +116,7 @@
+ file(GLOB CONFIGURED_LIBS_IN_PACKAGE ${package}/src/CGAL_*/CMakeLists.txt)
+ foreach (libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE})
+ string(REPLACE "${package}/src/" "" libconfigfile ${libconfigfile})
+- string(REPLACE "//CMakeLists.txt" "" CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile})
++ string(REPLACE "/CMakeLists.txt" "" CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile})
+ if (NOT ${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL")
+
+ message(STATUS "Sources for CGAL component library '${CGAL_CONFIGURED_LIBRARY_NAME}' detected")
diff --git a/sci-mathematics/cgal/metadata.xml b/sci-mathematics/cgal/metadata.xml
new file mode 100644
index 00000000000..aa54a0b5987
--- /dev/null
+++ b/sci-mathematics/cgal/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-mathematics</herd>
+ <longdescription lang="en">
+ The Computational Geometry Algorithms Library is a collaborative
+ open source library containing:
+ * the Kernel with geometric primitives such as points, vectors,
+ lines, predicates for testing things such as relative positions of
+ points, and operations such as intersections and distance calculation.
+ * the Basic Library which is a collection of standard data
+ structures and geometric algorithms, such as convex hull in 2D/3D,
+ (Delaunay) triangulation in 2D/3D, planar map, polyhedron, smallest
+ enclosing circle, and multidimensional query structures.
+ * the Support Library which offers interfaces to other packages,
+ e.g., for visualisation, and I/O, and other support facilities.
+</longdescription>
+ <use>
+ <flag name="mpfi">Enable support for multiple recision interval arithmetic via <pkg>sci-mathematics/mpfi</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/coq/Manifest b/sci-mathematics/coq/Manifest
new file mode 100644
index 00000000000..d322df030f8
--- /dev/null
+++ b/sci-mathematics/coq/Manifest
@@ -0,0 +1,6 @@
+DIST coq-8.3pl1.tar.gz 3756961 SHA256 3a497386bd74f43a5af1d0c53f29a017ce7ed1b1e60c052217fe04b7f40be928
+DIST coq-8.4pl1.tar.gz 4139808 SHA256 5d0e4553ab50677a94b4d5ca1650a90718e9362082a649ba95be4010390a0f80 SHA512 dc0073d2cbce91ac27749d84de1b350ad71632555a682d8af6612768d2c92311eb1fd36b7370e0fb630d540639a1c7e16f26a9de25d03d82c3a6eefb99aa3420 WHIRLPOOL e912b97ba1f91d3398d569a588d7cb420389c88971847e66ddff38c3fc715e45842aab285e343c0c6339da659f324ee7b60f37fd0cdcd5a8ce27ab0e8cce915a
+DIST coq-8.4pl2.tar.gz 4145112 SHA256 fb719a38f613b01861e3b251e745a5c8ef395a26ce7029668e85ac75fcbca2d8 SHA512 151291a508c56f9fdc9efd96096852e94c247724030ad13122ad729476f3f7d4885c9202737d9109b6fa7f58029d3b9e8f472a7e587e0b60a49a0224ac399031 WHIRLPOOL ac338571da5f6efc08e9184f1e13b9783bd750627c70af2eee46116d2d949e61a0cbf31745373ccea3b3b862c1188316c2aa3b38e211a398185503c2844a33c5
+DIST coq-8.4pl3.tar.gz 4064579 SHA256 97583d637f981c5554007f4e99ce6420ebc737186b1d021bd71766fd891cfb38 SHA512 e4a385b10b30159545c283e11400f5790a6ca1b91632afe93b73c6a8b523fd408db173b25a1797f69bdfde9a16b37751944041aa9be5a1194b0fe49a9bb56240 WHIRLPOOL c44cc9f55f25dfb37d7b011c3ede3ad47f7191b02a6258bd4bda67854b9cce0e32b412ead826a5ca7a21dc2fe8841774231cb0693da335f5146172463ec57aa2
+DIST coq-8.4pl5.tar.gz 4070062 SHA256 35815ab78a58d72799eacaab155427620ab071677882ca6c98d7bfec97d25245 SHA512 0965ff409933d601a5c96963ea805ce20dd22f1fd9a9473898de1b376403b4e7a9a86b36b58eb1480cfb3a25970626e1dcd225899c089f5a301f4809e7f8f242 WHIRLPOOL 6dea97e7fe655a33757e8f031b28f91f98558e53205890d6b9d928d5641c05814f8d743cb02c39b26dcf93aa4076c5bbd9710a7dfd9f6a3456e38039b0cb8220
+DIST coq-8.4pl6.tar.gz 4099815 SHA256 a540a231a9970a49353ca039f3544616ff86a208966ab1c593779ae13c91ebd6 SHA512 238bc6e28348f40f5619aa28d2e871179d9edeb6eb3f2521af6f407e24a889c8c68fa11c8b12e026f016f0fb7d5006447c3ab7eeae0804fc082d65774aefe0ef WHIRLPOOL 2120dcddce773d90ba024e97fc00df3d563edf398eaf0bbb3dc1df1265b5e657cb4044d334f598898c30a88f0579b35b38f1d6bad4ea5e373a0a30826b245e99
diff --git a/sci-mathematics/coq/coq-8.3_p1.ebuild b/sci-mathematics/coq/coq-8.3_p1.ebuild
new file mode 100644
index 00000000000..28c3feb39ec
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.3_p1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="gtk debug +ocamlopt doc"
+
+RDEPEND=">=dev-lang/ocaml-3.10[ocamlopt?]
+ >=dev-ml/camlp5-5.09[ocamlopt?]
+ gtk? ( >=dev-ml/lablgtk-2.10.1[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # configure has an error at line 640 leading to closing a string
+ # to early in the generated coq_config.ml. Here is a wild sed :)
+ # It replaces \"$LABLGTKLIB\" by $LABLGTKLIB
+ sed -i "s/\\\\\"\\\$LABLGTKLIB\\\\\"/\\\$LABLGTKLIB/" configure
+}
+
+src_configure() {
+ ocaml_lib=`ocamlc -where`
+ local myconf="--prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --camlp5dir ${ocaml_lib}/camlp5
+ --lablgtkdir ${ocaml_lib}/lablgtk2"
+
+ use debug && myconf="--debug $myconf"
+ use doc || myconf="$myconf --with-doc no"
+
+ if use gtk; then
+ use ocamlopt && myconf="$myconf --coqide opt"
+ use ocamlopt || myconf="$myconf --coqide byte"
+ else
+ myconf="$myconf --coqide no"
+ fi
+ use ocamlopt || myconf="$myconf -byte-only"
+ use ocamlopt && myconf="$myconf --opt"
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure $myconf || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1 || die "make failed"
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install || die
+ dodoc README CREDITS CHANGES
+
+ use gtk && domenu "${FILESDIR}/coqide.desktop"
+}
diff --git a/sci-mathematics/coq/coq-8.4_p1.ebuild b/sci-mathematics/coq/coq-8.4_p1.ebuild
new file mode 100644
index 00000000000..0f01228661f
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.4_p1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="gtk debug +ocamlopt doc camlp5"
+
+RDEPEND=">=dev-lang/ocaml-3.11.2:=[ocamlopt?]
+ camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
+ gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-camlp4.patch"
+}
+
+src_configure() {
+ ocaml_lib=`ocamlc -where`
+ local myconf="--prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --configdir /etc/xdg/${PN}
+ --lablgtkdir ${ocaml_lib}/lablgtk2"
+
+ use debug && myconf="--debug $myconf"
+ use doc || myconf="$myconf --with-doc no"
+
+ if use gtk; then
+ use ocamlopt && myconf="$myconf --coqide opt"
+ use ocamlopt || myconf="$myconf --coqide byte"
+ else
+ myconf="$myconf --coqide no"
+ fi
+ use ocamlopt || myconf="$myconf -byte-only"
+ use ocamlopt && myconf="$myconf --opt"
+
+ use camlp5 || myconf="$myconf --usecamlp4"
+ use camlp5 && myconf="$myconf --camlp5dir ${ocaml_lib}/camlp5"
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure $myconf || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1 || die "make failed"
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install || die
+ dodoc README CREDITS CHANGES
+
+ use gtk && make_desktop_entry "/usr/bin/coqide" "Coq IDE" "/usr/share/coq/coq.png"
+}
diff --git a/sci-mathematics/coq/coq-8.4_p2.ebuild b/sci-mathematics/coq/coq-8.4_p2.ebuild
new file mode 100644
index 00000000000..15fb377f1b5
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.4_p2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="gtk debug +ocamlopt doc camlp5"
+
+RDEPEND="
+ >=dev-lang/ocaml-3.11.2:=[ocamlopt?]
+ camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
+ gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+ ocaml_lib=`ocamlc -where`
+ local myconf="--prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --configdir /etc/xdg/${PN}
+ --lablgtkdir ${ocaml_lib}/lablgtk2"
+
+ use debug && myconf="--debug $myconf"
+ use doc || myconf="$myconf --with-doc no"
+
+ if use gtk; then
+ use ocamlopt && myconf="$myconf --coqide opt"
+ use ocamlopt || myconf="$myconf --coqide byte"
+ else
+ myconf="$myconf --coqide no"
+ fi
+ use ocamlopt || myconf="$myconf -byte-only"
+ use ocamlopt && myconf="$myconf --opt"
+
+ use camlp5 || myconf="$myconf --usecamlp4"
+ use camlp5 && myconf="$myconf --camlp5dir ${ocaml_lib}/camlp5"
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure $myconf || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install
+ dodoc README CREDITS CHANGES
+
+ use gtk && make_desktop_entry "/usr/bin/coqide" "Coq IDE" "/usr/share/coq/coq.png"
+}
diff --git a/sci-mathematics/coq/coq-8.4_p3.ebuild b/sci-mathematics/coq/coq-8.4_p3.ebuild
new file mode 100644
index 00000000000..25516ad987e
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.4_p3.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="gtk debug +ocamlopt doc camlp5"
+
+RDEPEND="
+ >=dev-lang/ocaml-3.11.2:=[ocamlopt?]
+ camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
+ gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+ ocaml_lib=$(ocamlc -where)
+ local myconf=(
+ --prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --configdir /etc/xdg/${PN}
+ --lablgtkdir ${ocaml_lib}/lablgtk2
+ )
+
+ use debug && myconf+=( --debug )
+ use doc || myconf+=( --with-doc no )
+
+ if use gtk; then
+ if use ocamlopt; then
+ myconf+=( --coqide opt )
+ else
+ myconf+=( --coqide byte )
+ fi
+ else
+ myconf+=( --coqide no )
+ fi
+
+ if use ocamlopt; then
+ myconf+=( --opt )
+ else
+ myconf+=( -byte-only )
+ fi
+
+ if use camlp5; then
+ myconf+=( --camlp5dir ${ocaml_lib}/camlp5 )
+ else
+ myconf+=( --usecamlp4 )
+ fi
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install
+ dodoc README CREDITS CHANGES
+
+ use gtk && make_desktop_entry "coqide" "Coq IDE" "${EPREFIX}/usr/share/coq/coq.png"
+}
diff --git a/sci-mathematics/coq/coq-8.4_p5.ebuild b/sci-mathematics/coq/coq-8.4_p5.ebuild
new file mode 100644
index 00000000000..9840c716d59
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.4_p5.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/distrib/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~x86"
+IUSE="gtk debug +ocamlopt doc camlp5"
+
+RDEPEND="
+ >=dev-lang/ocaml-3.11.2:=[ocamlopt?]
+ camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
+ !camlp5? ( || ( dev-ml/camlp4:= <dev-lang/ocaml-4.02.0 ) )
+ gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-8.4_p5-do-not-install-revision.patch"
+ # Fix generation of the index_urls.txt file with Gentoo dev-tex/hevea versions.
+ # http://lists.gforge.inria.fr/pipermail/coq-commits/2014-October/013582.html
+ epatch "${FILESDIR}/${P}-hevea.patch"
+ epatch "${FILESDIR}/${PN}-8.4_p5-no-clean-before-test.patch"
+}
+
+src_configure() {
+ ocaml_lib=$(ocamlc -where)
+ local myconf=(
+ --prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --configdir /etc/xdg/${PN}
+ --lablgtkdir ${ocaml_lib}/lablgtk2
+ )
+
+ use debug && myconf+=( --debug )
+ use doc || myconf+=( --with-doc no )
+
+ if use gtk; then
+ if use ocamlopt; then
+ myconf+=( --coqide opt )
+ else
+ myconf+=( --coqide byte )
+ fi
+ else
+ myconf+=( --coqide no )
+ fi
+
+ if use ocamlopt; then
+ myconf+=( --opt )
+ else
+ myconf+=( -byte-only )
+ fi
+
+ if use camlp5; then
+ myconf+=( --camlp5dir ${ocaml_lib}/camlp5 )
+ else
+ myconf+=( --usecamlp4 )
+ fi
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1 world VERBOSE=1
+}
+
+src_test() {
+ emake STRIP="true" check VERBOSE=1
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install VERBOSE=1
+ dodoc README CREDITS CHANGES
+
+ use gtk && make_desktop_entry "coqide" "Coq IDE" "${EPREFIX}/usr/share/coq/coq.png"
+}
diff --git a/sci-mathematics/coq/coq-8.4_p6.ebuild b/sci-mathematics/coq/coq-8.4_p6.ebuild
new file mode 100644
index 00000000000..be183f11229
--- /dev/null
+++ b/sci-mathematics/coq/coq-8.4_p6.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib
+
+MY_PV=${PV/_p/pl}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Proof assistant written in O'Caml"
+HOMEPAGE="http://coq.inria.fr/"
+SRC_URI="http://${PN}.inria.fr/distrib/V${MY_PV}/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="gtk debug +ocamlopt doc camlp5"
+
+RDEPEND="
+ >=dev-lang/ocaml-3.11.2:=[ocamlopt?]
+ camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
+ !camlp5? ( || ( dev-ml/camlp4:= <dev-lang/ocaml-4.02.0 ) )
+ gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
+DEPEND="${RDEPEND}
+ doc? (
+ media-libs/netpbm[png,zlib]
+ virtual/latex-base
+ dev-tex/hevea
+ dev-tex/xcolor
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-latexextra
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-8.4_p5-do-not-install-revision.patch"
+ # Fix generation of the index_urls.txt file with Gentoo dev-tex/hevea versions.
+ # http://lists.gforge.inria.fr/pipermail/coq-commits/2014-October/013582.html
+ epatch "${FILESDIR}/${PN}-8.4_p5-hevea.patch"
+ epatch "${FILESDIR}/${PN}-8.4_p5-no-clean-before-test.patch"
+}
+
+src_configure() {
+ ocaml_lib=$(ocamlc -where)
+ local myconf=(
+ --prefix /usr
+ --bindir /usr/bin
+ --libdir /usr/$(get_libdir)/coq
+ --mandir /usr/share/man
+ --emacslib /usr/share/emacs/site-lisp
+ --coqdocdir /usr/$(get_libdir)/coq/coqdoc
+ --docdir /usr/share/doc/${PF}
+ --configdir /etc/xdg/${PN}
+ --lablgtkdir ${ocaml_lib}/lablgtk2
+ )
+
+ use debug && myconf+=( --debug )
+ use doc || myconf+=( --with-doc no )
+
+ if use gtk; then
+ if use ocamlopt; then
+ myconf+=( --coqide opt )
+ else
+ myconf+=( --coqide byte )
+ fi
+ else
+ myconf+=( --coqide no )
+ fi
+
+ if use ocamlopt; then
+ myconf+=( --opt )
+ else
+ myconf+=( -byte-only )
+ fi
+
+ if use camlp5; then
+ myconf+=( --camlp5dir ${ocaml_lib}/camlp5 )
+ else
+ myconf+=( --usecamlp4 )
+ fi
+
+ export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
+ ./configure ${myconf[@]} || die "configure failed"
+}
+
+src_compile() {
+ emake STRIP="true" -j1 world VERBOSE=1
+}
+
+src_test() {
+ emake STRIP="true" check VERBOSE=1
+}
+
+src_install() {
+ emake STRIP="true" COQINSTALLPREFIX="${D}" install VERBOSE=1
+ dodoc README CREDITS CHANGES
+
+ use gtk && make_desktop_entry "coqide" "Coq IDE" "${EPREFIX}/usr/share/coq/coq.png"
+}
diff --git a/sci-mathematics/coq/files/coq-8.4_p1-camlp4.patch b/sci-mathematics/coq/files/coq-8.4_p1-camlp4.patch
new file mode 100644
index 00000000000..bc60b9f56f4
--- /dev/null
+++ b/sci-mathematics/coq/files/coq-8.4_p1-camlp4.patch
@@ -0,0 +1,17 @@
+Upstream rev 16121
+https://bugs.gentoo.org/show_bug.cgi?id=450954
+
+Index: coq-8.4pl1/scripts/coqmktop.ml
+===================================================================
+--- coq-8.4pl1.orig/scripts/coqmktop.ml
++++ coq-8.4pl1/scripts/coqmktop.ml
+@@ -45,8 +45,7 @@ let camlp4topobjs =
+ [ "Camlp4Top.cmo";
+ "Camlp4Parsers/Camlp4OCamlRevisedParser.cmo";
+ "Camlp4Parsers/Camlp4OCamlParser.cmo";
+- "Camlp4Parsers/Camlp4GrammarParser.cmo";
+- "q_util.cmo"; "q_coqast.cmo" ]
++ "Camlp4Parsers/Camlp4GrammarParser.cmo" ]
+ let topobjs = camlp4topobjs
+
+ let gramobjs = []
diff --git a/sci-mathematics/coq/files/coq-8.4_p5-do-not-install-revision.patch b/sci-mathematics/coq/files/coq-8.4_p5-do-not-install-revision.patch
new file mode 100644
index 00000000000..e97f4a165f8
--- /dev/null
+++ b/sci-mathematics/coq/files/coq-8.4_p5-do-not-install-revision.patch
@@ -0,0 +1,19 @@
+--- coq-8.4pl5-orig/Makefile.build 2014-10-22 19:30:53.000000000 +1100
++++ coq-8.4pl5/Makefile.build 2015-02-15 12:06:48.044999959 +1100
+@@ -655,16 +655,12 @@
+ # it with libraries
+ -$(MKDIR) $(FULLCOQLIB)/plugins/micromega
+ $(INSTALLBIN) $(CSDPCERT) $(FULLCOQLIB)/plugins/micromega
+- rm -f $(FULLCOQLIB)/revision
+- -$(INSTALLLIB) revision $(FULLCOQLIB)
+
+ install-library-light:
+ $(MKDIR) $(FULLCOQLIB)
+ $(INSTALLSH) $(FULLCOQLIB) $(LIBFILESLIGHT) $(INITPLUGINS)
+ $(MKDIR) $(FULLCOQLIB)/states
+ $(INSTALLLIB) states/*.coq $(FULLCOQLIB)/states
+- rm -f $(FULLCOQLIB)/revision
+- -$(INSTALLLIB) revision $(FULLCOQLIB)
+ ifeq ($(BEST),opt)
+ $(INSTALLSH) $(FULLCOQLIB) $(INITPLUGINSOPT)
+ endif
diff --git a/sci-mathematics/coq/files/coq-8.4_p5-hevea.patch b/sci-mathematics/coq/files/coq-8.4_p5-hevea.patch
new file mode 100644
index 00000000000..c76f1dea8e1
--- /dev/null
+++ b/sci-mathematics/coq/files/coq-8.4_p5-hevea.patch
@@ -0,0 +1,11 @@
+--- coq-8.4pl5-orig/Makefile.doc 2014-10-22 19:30:53.000000000 +1100
++++ coq-8.4pl5/Makefile.doc 2015-02-15 15:28:34.797911303 +1100
+@@ -148,7 +148,7 @@
+ ######################################################################
+
+ $(INDEXURLS): $(INDEXES)
+- cat $< | grep li-indexenv | grep HREF | sed -e 's@.*<TT>\(.*\)</TT>.*, <A HREF="\(.*\)">.*@\1,\2@' > $@
++ cat $< | grep li-indexenv | grep href | sed -e 's@.*>\([^<]*\)</span>.*, <a href="\([^"]*\)">.*@\1,\2@' > $@
+
+
+ ######################################################################
diff --git a/sci-mathematics/coq/files/coq-8.4_p5-no-clean-before-test.patch b/sci-mathematics/coq/files/coq-8.4_p5-no-clean-before-test.patch
new file mode 100644
index 00000000000..ef4b6cf3e82
--- /dev/null
+++ b/sci-mathematics/coq/files/coq-8.4_p5-no-clean-before-test.patch
@@ -0,0 +1,12 @@
+--- coq-8.4pl5-orig/Makefile.build 2015-02-15 12:06:48.044999959 +1100
++++ coq-8.4pl5/Makefile.build 2015-02-15 16:41:06.521892146 +1100
+@@ -395,8 +395,7 @@
+
+ check:: validate test-suite
+
+-test-suite: world $(ALLSTDLIB).v
+- $(MAKE) $(MAKE_TSOPTS) clean
++test-suite: $(ALLSTDLIB).v
+ $(MAKE) $(MAKE_TSOPTS) all
+ $(HIDE)if grep -F 'Error!' test-suite/summary.log ; then false; fi
+
diff --git a/sci-mathematics/coq/files/coqide.desktop b/sci-mathematics/coq/files/coqide.desktop
new file mode 100644
index 00000000000..cc8bb54e1ad
--- /dev/null
+++ b/sci-mathematics/coq/files/coqide.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Comment=Coq integrated developpment environment
+Icon=/usr/lib/coq/ide/coq.png
+Exec=/usr/bin/coqide
+Name=CoqIDE
+GenericName=Coq IDE
+Terminal=false
+Type=Application
+Categories=Science;Math;
diff --git a/sci-mathematics/coq/metadata.xml b/sci-mathematics/coq/metadata.xml
new file mode 100644
index 00000000000..2fbebc05a0d
--- /dev/null
+++ b/sci-mathematics/coq/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>ml</herd>
+ <herd>sci-mathematics</herd>
+ <longdescription lang="en">
+ Developed in the LogiCal project, the Coq tool is a formal proof
+ management system: a proof done with Coq is mechanically checked
+ by the machine.
+ In particular, Coq allows:
+ * the definition of functions or predicates,
+ * to state mathematical theorems and software specifications,
+ * to develop interactively formal proofs of these theorems,
+ * to check these proofs by a small certification "kernel".
+ Coq is based on a logical framework called "Calculus of Inductive
+ Constructions" extended by a modular development system for
+ theories.
+</longdescription>
+ <use>
+ <flag name="camlp5">Build using camlp5. This is required for some plugins like Ssreflect.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/cvc3/Manifest b/sci-mathematics/cvc3/Manifest
new file mode 100644
index 00000000000..e13e2e2bb3e
--- /dev/null
+++ b/sci-mathematics/cvc3/Manifest
@@ -0,0 +1 @@
+DIST cvc3-2.4.1.tar.gz 1196616 SHA256 d55b1d6006cfbac3f6d4c086964558902c3ed0efa66ac499cfb2193f3ee4acf7 SHA512 48e5cd82b3eb7506d762c2abc8db0c8fbc548575a1362dda53888075ac105a5bc0f0d58dfe01b60f207bc00ff8dfc39a5b3d9317784fe551658c884bb02e1ff2 WHIRLPOOL 9d39dacff010f093685191737d41760a84ac7d12246ddaafbb9f48c78c7bff5697c5e85c62ef44b7dc76f86a55c118c041323c3a1b1953f5c725447795375d93
diff --git a/sci-mathematics/cvc3/cvc3-2.4.1.ebuild b/sci-mathematics/cvc3/cvc3-2.4.1.ebuild
new file mode 100644
index 00000000000..8ac2c53297c
--- /dev/null
+++ b/sci-mathematics/cvc3/cvc3-2.4.1.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit elisp-common
+
+DESCRIPTION="CVC3 is an automatic theorem prover for Satisfiability Modulo Theories (SMT) problems"
+HOMEPAGE="http://www.cs.nyu.edu/acsys/cvc3/index.html"
+SRC_URI="http://www.cs.nyu.edu/acsys/cvc3/releases/2.4.1/${P}.tar.gz"
+
+LICENSE="BSD MIT HPND zchaff? ( zchaff )"
+RESTRICT="mirror zchaff? ( bindist )"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc emacs isabelle test zchaff"
+
+RDEPEND="dev-libs/gmp
+ isabelle? (
+ >=sci-mathematics/isabelle-2011.1-r1:=
+ )"
+DEPEND="${RDEPEND}
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz
+ )
+ emacs? (
+ virtual/emacs
+ )"
+
+SITEFILE=50${PN}-gentoo.el
+
+src_prepare() {
+ sed -e 's#prefix=@prefix@#prefix=$(patsubst %/,%,$(DESTDIR))@prefix@#' \
+ -e 's#libdir=@libdir@#libdir=$(patsubst %/,%,$(DESTDIR))@libdir@#' \
+ -e 's#mandir=@mandir@#mandir=$(patsubst %/,%,$(DESTDIR))@mandir@#' \
+ -i "${S}/Makefile.local.in" \
+ || die "Could not set DESTDIR in Makefile.local.in"
+}
+
+src_configure() {
+ # --enable-static disables building of shared libraries, statically
+ # links /usr/bin/cvc3 and installs static libraries.
+ # --enable-static --enable-sharedlibs behaves the same as just --enable-static
+ econf \
+ --enable-dynamic \
+ $(use_enable zchaff)
+
+ if use test; then
+ sed -e 's@LD_LIBS = @LD_LIBS = -L'"${S}"'/lib -Wl,-R'"${S}"'/lib @' \
+ -i "${S}/test/Makefile" \
+ || die "Could not set library paths in test/Makefile"
+ fi
+}
+
+src_compile() {
+ emake
+
+ if use doc; then
+ pushd doc || die "Could not cd to doc"
+ emake
+ popd
+ fi
+
+ if use emacs ; then
+ pushd "${S}/emacs" || die "Could change directory to emacs"
+ elisp-compile *.el || die "emacs elisp compile failed"
+ popd
+ fi
+
+ if use test; then
+ pushd test || die "Could not cd to test"
+ emake
+ popd
+ fi
+}
+
+src_test() {
+ pushd test || die "Could not cd to test"
+ ./bin/test || die "tests failed"
+ popd
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use doc; then
+ pushd "${S}"/doc/html || die "Could not cd to doc/html"
+ dohtml *.html
+ insinto /usr/share/doc/${PF}/html
+ doins *.css *.gif *.png
+ popd
+ fi
+
+ if use emacs ; then
+ elisp-install ${PN} emacs/*.{el,elc}
+ cp "${FILESDIR}"/${SITEFILE} "${S}"
+ elisp-site-file-install ${SITEFILE}
+ fi
+
+ if use isabelle; then
+ ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)" \
+ || die "isabelle getenv ISABELLE_HOME failed"
+ [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
+ dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ cat <<- EOF >> "${S}/settings"
+ CVC3_COMPONENT="\$COMPONENT"
+ CVC3_HOME="${ROOT}usr/bin"
+ CVC3_SOLVER="\$CVC3_HOME/cvc3"
+ CVC3_REMOTE_SOLVER="cvc3"
+ CVC3_INSTALLED="yes"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+ if use zchaff; then
+ einfo "This copy of CVC3 is also configured to use the SAT solver zchaff whose"
+ einfo "copyright is owned by Princeton University and is more restrictive."
+ einfo "Specifically, it may be used for internal, noncommercial, research purposes"
+ einfo "only. See the copyright notices from the zchaff source files which are"
+ einfo "included in the LICENSE file."
+ einfo "To build CVC3 without these files, please build cvc3 without the zchaff"
+ einfo "use flag (note: zchaff is disabled by default):"
+ einfo "USE=-zchaff emerge sci-mathemathematics/cvc3"
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/cvc3" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new CVC3 being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}
diff --git a/sci-mathematics/cvc3/files/50cvc3-gentoo.el b/sci-mathematics/cvc3/files/50cvc3-gentoo.el
new file mode 100644
index 00000000000..8e046edf7ad
--- /dev/null
+++ b/sci-mathematics/cvc3/files/50cvc3-gentoo.el
@@ -0,0 +1,3 @@
+(add-to-list 'load-path "@SITELISP@")
+(add-to-list 'auto-mode-alist '("\\.cvc\\'" . cvc-mode))
+(autoload 'cvc-mode "cvc-mode" "CVC specifications editing mode." t)
diff --git a/sci-mathematics/cvc3/metadata.xml b/sci-mathematics/cvc3/metadata.xml
new file mode 100644
index 00000000000..fd176a8c8c6
--- /dev/null
+++ b/sci-mathematics/cvc3/metadata.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>gienah@gentoo.org</email>
+ <name>Mark Wright</name>
+</maintainer>
+<herd>sci-mathematics</herd>
+<longdescription lang='en'>
+CVC3 is an automatic theorem prover for Satisfiability Modulo Theories
+(SMT) problems. It can be used to prove the validity (or, dually, the
+satisfiability) of first-order formulas in a large number of built-in
+logical theories and their combination.
+
+CVC3 is the last offspring of a series of popular SMT provers, which
+originated at Stanford University with the SVC system. In particular,
+it builds on the code base of CVC Lite, its most recent
+predecessor. Its high level design follows that of the Sammy prover.
+
+CVC3 works with a version of first-order logic with polymorphic types
+and has a wide variety of features including:
+
+ several built-in base theories: rational and integer linear
+ arithmetic, arrays, tuples, records, inductive data types, bit
+ vectors, and equality over uninterpreted function symbols;
+ support for quantifiers;
+ an interactive text-based interface;
+ a rich C and C++ API for embedding in other systems;
+ proof and model generation abilities;
+ predicate subtyping;
+ essentially no limit on its use for research or commercial
+ purposes (see license).
+</longdescription>
+<use>
+ <flag name='isabelle'>Add integration support for the Isabelle/HOL
+ theorem prover.</flag>
+ <flag name='zchaff'>Use the SAT solver zchaff whose copyright is
+ owned by Princeton University and is more restrictive (see zchaff
+ license).
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/dataplot/Manifest b/sci-mathematics/dataplot/Manifest
new file mode 100644
index 00000000000..47805108209
--- /dev/null
+++ b/sci-mathematics/dataplot/Manifest
@@ -0,0 +1,2 @@
+DIST dplib.2009_07_15.tar.gz 7507367 SHA256 bb1dce97fbcec611cabe636bbdf20efa77c191b84e9c3db621554daea831f00d SHA512 5e4e6c866a5690c3f67b322d53b6bf1bec33c488a99c95f360ce74785a57286541945fdcab5cbbacb04039046f5ba94aeaf8112b80aa34ed2c2cf04abc6f7d40 WHIRLPOOL f531fe7fa4ef3f2ffb65777dd2e5d08f68fd32f5fcf7fbae19db2e5e015e9aba88577c71e9f4dac1f638d8fccf749b0a9c13fd30f7950a7f24669caed5e7e8b1
+DIST dpsrc_2009_08_21.tar.gz 6656048 SHA256 ee47746fb28b88a5a0affa6a51a0e10c9350b1dc28977ecbee19d64a1e204cd4 SHA512 1e655c6832b724b9f69692f28f5497fb4064d208cde5462c4bd73c8d255605ba62b9b703f5ea32bbe7506b18ccd0ad5c4c2556381fbebdb6e05ce51625a4a339 WHIRLPOOL 7ed6951206cd35e449123bd8863f7b3ae26fbcf947156fb6b018aa200768c72861feca65392740303da644c33738d442aa59cab7a09ddb2bcc6dd9dcff70d003
diff --git a/sci-mathematics/dataplot/dataplot-20090821.ebuild b/sci-mathematics/dataplot/dataplot-20090821.ebuild
new file mode 100644
index 00000000000..c646b4be26e
--- /dev/null
+++ b/sci-mathematics/dataplot/dataplot-20090821.ebuild
@@ -0,0 +1,81 @@
+# 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 autotools
+
+# YEAR MONTH DAY
+MY_PV=${PV:0:4}_${PV:4:2}_${PV:6:2}
+MY_P=dpsrc_${MY_PV}
+# MY_PV_AUX usually ${MY_PV}
+MY_PV_AUX=2009_07_15
+MY_P_AUX=dplib.${MY_PV_AUX}
+
+DESCRIPTION="Program for scientific visualization and statistical analyis"
+HOMEPAGE="http://www.itl.nist.gov/div898/software/dataplot/"
+SRC_URI="
+ ftp://ftp.nist.gov/pub/dataplot/unix/${MY_P}.tar.gz
+ ftp://ftp.nist.gov/pub/dataplot/unix/${MY_P_AUX}.tar.gz"
+
+SLOT="0"
+LICENSE="public-domain"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples gd opengl X"
+
+COMMON_DEPEND="
+ media-libs/plotutils
+ opengl? ( virtual/opengl )
+ gd? ( media-libs/gd[png,jpeg] )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+ X? ( x11-misc/xdg-utils )"
+
+S="${WORKDIR}/${MY_P}"
+S_AUX="${WORKDIR}/${MY_P_AUX}"
+
+src_unpack() {
+ # unpacking and renaming because
+ # upstream does not use directories
+ mkdir "${S_AUX}" || die
+ pushd "${S_AUX}" > /dev/null || die
+ unpack ${MY_P_AUX}.tar.gz
+ popd > /dev/null || die
+ mkdir ${MY_P} || die
+ cd "${S}" || die
+ unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-opengl.patch
+ cp "${FILESDIR}"/Makefile.am.${PV} Makefile.am || die
+ cp "${FILESDIR}"/configure.ac.${PV} configure.ac || die
+ sed -e "s:IHOST1='SUN':IHOST1='@HOST@:" \
+ -e "s:/usr/local/lib:@datadir@:g" \
+ dp1_linux.f > dp1_linux.f.in || die
+ sed -e "s/(MAXOBV=.*)/(MAXOBV=@MAXOBV@)/" \
+ -e "s:/usr/local/lib:@datadir@:g" \
+ DPCOPA.INC > DPCOPA.INC.in || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable gd) \
+ $(use_enable opengl gl) \
+ $(use_enable X)
+}
+
+src_install() {
+ default
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r "${S_AUX}"/data/*
+ fi
+ insinto /usr/share/dataplot
+ doins "${S_AUX}"/dp{mes,sys,log}f.tex
+ doenvd "${FILESDIR}"/90${PN}
+}
diff --git a/sci-mathematics/dataplot/files/90dataplot b/sci-mathematics/dataplot/files/90dataplot
new file mode 100644
index 00000000000..9bb5e1dc56d
--- /dev/null
+++ b/sci-mathematics/dataplot/files/90dataplot
@@ -0,0 +1,3 @@
+DATAPLOT_FILES="/usr/share/dataplot"
+DATAPLOT_WEB="OFF"
+BROWSER="xdg-open"
diff --git a/sci-mathematics/dataplot/files/Makefile.am.20090821 b/sci-mathematics/dataplot/files/Makefile.am.20090821
new file mode 100644
index 00000000000..e10cf41ebd5
--- /dev/null
+++ b/sci-mathematics/dataplot/files/Makefile.am.20090821
@@ -0,0 +1,46 @@
+bin_PROGRAMS = dataplot
+dataplot_SOURCES = dp1_linux.f \
+ dp2.f dp3.f dp4.f dp5.f dp6.f dp7.f dp8.f dp9.f dp10.f dp11.f \
+ dp12.f dp13.f dp14.f dp15.f dp16.f dp17.f dp18.f dp19.f dp20.f dp21.f \
+ dp22.f dp23.f dp24.f dp25.f dp26.f dp27.f dp28.f dp29.f dp30.f dp31.f \
+ dp32.f dp33.f dp34.f dp35.f dp36.f dp37.f dp38.f dp39.f dp40.f dp41.f \
+ dp42.f dp43.f dp44.f dp45.f dp46.f \
+ dpcalc.f dpdds2.f dpdds3.f dpdds.f edinit.f edmai2.f edsear.f edsub.f \
+ edwrst.f fit3b.f starpac.f tcdriv_nopc.f aqua_src.f cluster.f compgeom.f \
+ optimi.f libplot_src.c rldp.c main.f
+
+if ENABLE_GD
+dataplot_SOURCES += gd_src.c
+else
+dataplot_SOURCES += gd_src.f
+endif
+
+if ENABLE_GL
+dataplot_SOURCES += gl_src.c
+else
+dataplot_SOURCES += gl_src.f
+endif
+
+if ENABLE_X11
+dataplot_SOURCES += x11_src.c
+else
+dataplot_SOURCES += x11src.f
+endif
+
+dataplot_CFLAGS = @GL_CFLAGS@
+dataplot_LDADD = @GD_LIBS@ @GL_LIBS@ @X11_LIBS@ $(FLIBS) -lreadline
+
+# this is to remove ambiguity between the similar filenames
+# of the c and f77 version (shortcoming of automake)
+# the f77 versions are forced
+# the c versions objects are called dataplot-gd_src.o etc
+gd_src.o: gd_src.f
+ $(F77COMPILE) -c -o $@ $<
+gl_src.o: gl_src.f
+ $(F77COMPILE) -c -o $@ $<
+aqua_src.o: aqua_src.f
+ $(F77COMPILE) -c -o $@ $<
+libplot_src.o: libplot_src.f
+ $(F77COMPILE) -c -o $@ $<
+rldp.o: rldp.f
+ $(F77COMPILE) -c -o $@ $<
diff --git a/sci-mathematics/dataplot/files/configure.ac.20090821 b/sci-mathematics/dataplot/files/configure.ac.20090821
new file mode 100644
index 00000000000..2343b23823d
--- /dev/null
+++ b/sci-mathematics/dataplot/files/configure.ac.20090821
@@ -0,0 +1,76 @@
+AC_PREREQ(2.59)
+AC_INIT([dataplot], [20080225], [n.heckert@nist.gov])
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_AUX_DIR(config)
+AM_MAINTAINER_MODE
+AM_INIT_AUTOMAKE([foreign])
+
+AC_PROG_CC
+AC_PROG_F77
+AC_F77_LIBRARY_LDFLAGS
+case $F77 in
+ *gfortran*) FFLAGS="${FFLAGS} -w -fno-range-check" ;;
+ *) ;;
+esac
+
+AC_CANONICAL_HOST
+case $host in
+ i?86*linux*) MAXOBV=100000 ;;
+ *64*linux*) MAXOBV=1000000 ;;
+esac
+AC_SUBST(MAXOBV)
+
+AC_ARG_ENABLE(gd,
+ [AS_HELP_STRING([--enable-gd], [Enable the gd device driver])],
+ [enable_gd=$enableval],
+ [enable_gd=no])
+
+AC_CHECK_LIB(plot, pl_closepl_r, ,
+ [AC_MSG_ERROR([plotutils libraries not found])])
+
+AC_ARG_ENABLE(gl,
+ [AS_HELP_STRING([--enable-gl], [Enable the OpenGL device driver])],
+ [enable_gl=$enableval],
+ [enable_gl=no])
+
+AC_ARG_ENABLE(X,
+ [AS_HELP_STRING([--enable-X], [Enable the X11 device driver])],
+ [enable_x11=$enableval],
+ [enable_x11=no])
+
+if test x"$enable_gd" = x"yes"; then
+ AC_CHECK_PROG(enable_gd, [gdlib-config],,
+ [AC_MSG_ERROR([GD driver requested but gdlib-config not found])])
+ GD_LIBS="`gdlib-config --libs` -lgd"
+ GD_CFLAGS="`gdlib-config --cflags`"
+ AC_SUBST(GD_LIBS)
+ AC_SUBST(GD_CFLAGS)
+fi
+AM_CONDITIONAL(ENABLE_GD, [test x"$enable_gd" = x"yes"] )
+
+if test x"$enable_gl" = x"yes"; then
+dnl hardcoded opengl libs (should be host/implementation dependent)
+ AC_CHECK_HEADER(GL/gl.h,,
+ [AC_MSG_ERROR([OpenGL driver requested but header gl.h not found])])
+ AC_CHECK_HEADER(GL/glu.h,,
+ [AC_MSG_ERROR([OpenGL driver requested but header glu.h not found])])
+ GL_CFLAGS="-DUNIX_OS -DAPPEND_UNDERSCORE -DSUBROUTINE_CASE"
+ AC_SUBST(GL_CFLAGS)
+
+ AC_CHECK_LIB(GL, glXCreateContext, GL_LIBS="-lGL",
+ [AC_MSG_ERROR([OpenGL driver requested but libraries not found])])
+ AC_CHECK_LIB(GLU, gluPerspective, GL_LIBS="-lGL -lGLU",
+ [AC_MSG_ERROR([OpenGL driver requested but libraries not found])])
+ GL_LIBS="-lGL -lGLU"
+ AC_SUBST(GL_LIBS)
+fi
+AM_CONDITIONAL(ENABLE_GL, [ test x"$enable_gl" = x"yes" ])
+
+if test x"$enable_x11" = x"yes"; then
+ PKG_CHECK_MODULES(X11, x11,,
+ [AC_MSG_ERROR([X11 driver requested but pkgconfig module not found])])
+fi
+AM_CONDITIONAL(ENABLE_X11, [ test x"$enable_x11" = x"yes" ])
+
+AC_CONFIG_FILES([Makefile DPCOPA.INC dp1_linux.f])
+AC_OUTPUT
diff --git a/sci-mathematics/dataplot/files/dataplot-20090821-opengl.patch b/sci-mathematics/dataplot/files/dataplot-20090821-opengl.patch
new file mode 100644
index 00000000000..5810b6029b8
--- /dev/null
+++ b/sci-mathematics/dataplot/files/dataplot-20090821-opengl.patch
@@ -0,0 +1,47 @@
+--- gl_src.c.orig 2001-02-28 16:45:56.000000000 -0500
++++ gl_src.c 2008-04-10 17:03:03.000000000 -0400
+@@ -154,7 +154,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+-#include <strings.h>
++#include <string.h>
+
+ #if UNIX == 0
+ #include <X11/Xlib.h>
+@@ -257,7 +257,7 @@
+ /* flags for current attribute settings */
+ static int OPEN_FLAG = 0; /* 0 - X11 closed, 1 - X11 open */
+ static int OPEN_FLAG_2 = 0; /* 0 - repeat graph window closed, 1 - open */
+-int GRAPH_FLAG = 0; /* 0 - gleras has not been called, 1 - gleras has been called */
++static int GRAPH_FLAG = 0; /* 0 - gleras has not been called, 1 - gleras has been called */
+ int WIDTH_CURRENT; /* current line width */
+ int LINE_STYLE_CURRENT; /* current line style */
+ char FONT_NAME_CURRENT[80]; /* name of current font */
+@@ -922,7 +922,7 @@
+ glNewList(list_id, GL_COMPILE_AND_EXECUTE);
+
+ glClearColor(red_temp,green_temp,blue_temp,1.0);
+- glclear(GL_COLOR_BUFFER_BIT);
++ glClear(GL_COLOR_BUFFER_BIT);
+
+ GRAPH_FLAG = 1;
+ }
+@@ -1486,7 +1486,7 @@
+ * Color only set if being changed.
+ */
+ #if APPEND_UNDERSCORE == 1 && SUBROUTINE_CASE == 1
+-void glseco(jcol, red, green, blue)
++void glseco_(jcol, red, green, blue)
+ #elif APPEND_UNDERSCORE == 1 && SUBROUTINE_CASE == 0
+ void GLSECO_(jcol, red, green, blue)
+ #elif APPEND_UNDERSCORE == 0 && SUBROUTINE_CASE == 1
+@@ -1691,7 +1691,7 @@
+ width = isize[0];
+ #endif
+ if (width < 1.0) width = 1.0;
+- glPointsize(width);
++ glPointSize(width);
+ glBegin(GL_POINTS);
+ #if PRECISION == 0
+ glVertex2f(*ix, *iy);
diff --git a/sci-mathematics/dataplot/metadata.xml b/sci-mathematics/dataplot/metadata.xml
new file mode 100644
index 00000000000..3f98dafdd5f
--- /dev/null
+++ b/sci-mathematics/dataplot/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-mathematics</herd>
+ <longdescription lang="en">
+ Dataplot is a software system for scientific visualization,
+ statistical analysis, and non-linear modeling. The target Dataplot
+ user is the researcher and analyst engaged in the characterization,
+ modeling, visualization, analysis, monitoring, and optimization of
+ scientific and engineering processes (original version:1978).
+ Gentoo version adds autotools to facilitate building and robustness.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/diagrtb/Manifest b/sci-mathematics/diagrtb/Manifest
new file mode 100644
index 00000000000..0c9f34449ed
--- /dev/null
+++ b/sci-mathematics/diagrtb/Manifest
@@ -0,0 +1 @@
+DIST diagrtb-2.64.tar.gz 2429842 SHA256 bbab6ed2f9eeae1c64d0d55764908748a5e321589df81c7d87647623950b7aa0
diff --git a/sci-mathematics/diagrtb/diagrtb-2.64.ebuild b/sci-mathematics/diagrtb/diagrtb-2.64.ebuild
new file mode 100644
index 00000000000..1283039df7e
--- /dev/null
+++ b/sci-mathematics/diagrtb/diagrtb-2.64.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils fortran-2
+
+DESCRIPTION="Calculation of some eigenvectors of a large real, symmetrical, matrix"
+HOMEPAGE="http://ecole.modelisation.free.fr/modes.html"
+SRC_URI="http://ecole.modelisation.free.fr/rtb2011.tar.gz -> ${P}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+RESTRICT="mirror bindist"
+
+S="${WORKDIR}"/Source_RTB2011
+
+src_prepare() {
+ cp "${FILESDIR}"/CMakeLists.txt . || die
+}
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use examples EXAMPLES)
+ )
+ cmake-utils_src_configure
+}
diff --git a/sci-mathematics/diagrtb/files/CMakeLists.txt b/sci-mathematics/diagrtb/files/CMakeLists.txt
new file mode 100644
index 00000000000..d1eb6c62f09
--- /dev/null
+++ b/sci-mathematics/diagrtb/files/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required (VERSION 2.6)
+project (DIAGRTB Fortran)
+
+option (EXAMPLES "Instal additional example files" OFF)
+
+add_executable(diagrtb diagrtb.f)
+
+install (TARGETS diagrtb DESTINATION bin)
+install (FILES diagrtb.README DESTINATION share/doc/diagrtb)
+
+if ( EXAMPLES )
+ install (DIRECTORY ../Try_RTB2011 DESTINATION share/diagrtb/examples)
+endif (EXAMPLES)
diff --git a/sci-mathematics/diagrtb/metadata.xml b/sci-mathematics/diagrtb/metadata.xml
new file mode 100644
index 00000000000..b2b6df7d599
--- /dev/null
+++ b/sci-mathematics/diagrtb/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>
+A fortran program for the calculation of some eigenvectors of a large real,
+symmetrical, matrix.
+If the matrix was obtained, for instance, with the PDBMAT program, these
+eigenvectors correspond to the low-frequency normal modes (i.e., mostly
+those with a collective character) of the system. Note that in the case of
+proteins, low-frequency normal modes thus obtained are found to be very close
+to those obtained with standard, much more realistic (e.g., all atoms with
+empirical force fields), models.
+
+The method used rests upon the RTB approximation (standing for
+Rotations-Translations-of-Blocks). Within the frame of this approximation,
+blocks of n (n=1,2,...) consecutive monomers (amino-acid residues) are
+assumed to behave like rigid bodies.
+
+Requirements: a matrix in the "i j non-zero-ij-matrix-element" format.
+A file with the coordinates of the system, in the PDB or "x y z mass
+block-number" format.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/drgeo/Manifest b/sci-mathematics/drgeo/Manifest
new file mode 100644
index 00000000000..612ef3a452c
--- /dev/null
+++ b/sci-mathematics/drgeo/Manifest
@@ -0,0 +1,2 @@
+DIST drgeo-1.1.0.tar.gz 1608361 SHA256 8c93bb637c11ca1647f90e0d97ea03d5938efddc36c2d73b40f15ff8df672216
+DIST drgeo-doc-1.5.tar.gz 2730242 SHA256 a6453dc630a40dd1c84ed90a7b7ff4fa3806e4e3ce01d149b59df29318255cb2
diff --git a/sci-mathematics/drgeo/drgeo-1.1.0.ebuild b/sci-mathematics/drgeo/drgeo-1.1.0.ebuild
new file mode 100644
index 00000000000..c82df5f42dd
--- /dev/null
+++ b/sci-mathematics/drgeo/drgeo-1.1.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DOCN="${PN}-doc"
+DOCV="1.5"
+DOC="${DOCN}-${DOCV}"
+
+DESCRIPTION="Interactive geometry package"
+HOMEPAGE="http://www.ofset.org/drgeo"
+SRC_URI="
+ mirror://sourceforge/ofset/${P}.tar.gz
+ mirror://sourceforge/ofset/${DOC}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="nls"
+
+RDEPEND="
+ x11-libs/gtk+:2
+ gnome-base/libglade:2.0
+ dev-libs/libxml2:2
+ || (
+ >=dev-scheme/guile-1.8[deprecated]
+ =dev-scheme/guile-1.6*
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc45.patch
+}
+
+src_configure() {
+ default
+ # Can't make the documentation as it depends on Hyperlatex which isn't
+ # yet in portage. Fortunately HTML is already compiled for us in the
+ # tarball and so can be installed. Just create the make install target.
+ cd "${WORKDIR}"/${DOC}
+ econf
+}
+
+src_install() {
+ default
+ if use nls; then
+ cd "${WORKDIR}"/${DOC}
+ else
+ cd "${WORKDIR}"/${DOC}/c
+ fi
+ emake install DESTDIR="${D}"
+}
diff --git a/sci-mathematics/drgeo/files/drgeo-1.1.0-gcc45.patch b/sci-mathematics/drgeo/files/drgeo-1.1.0-gcc45.patch
new file mode 100644
index 00000000000..1d8e93e06fe
--- /dev/null
+++ b/sci-mathematics/drgeo/files/drgeo-1.1.0-gcc45.patch
@@ -0,0 +1,61 @@
+Fix build with GCC 4.5, fix random SIGSEGV
+
+http://bugs.gentoo.org/show_bug.cgi?id=322211
+https://bugzilla.redhat.com/show_bug.cgi?id=454045
+
+--- geo/drgeo_figure.h
++++ geo/drgeo_figure.h
+@@ -322,4 +322,11 @@
+ gboolean showGrid;
+ };
+
++struct
++{
++ drgeoPoint mouse;
++ drgeoFigure *figure;
++}
++drgeoDialogData;
++
+ #endif
+--- geo/drgeo_figure.cc
++++ geo/drgeo_figure.cc
+@@ -48,13 +48,6 @@
+ #include "drgeo_dialog.h"
+ #include "traite.h"
+
+-extern struct
+-{
+- drgeoPoint mouse;
+- drgeoFigure *figure;
+-}
+-drgeoDialogData;
+-
+ typedef struct drgeoSearchValue
+ {
+ gpointer value;
+@@ -1309,7 +1302,7 @@
+ gint
+ drgeoFigure::preferedUndoLevel ()
+ {
+- atoi (drgeoConfigGet (":undoLevel"));
++ return atoi (drgeoConfigGet (":undoLevel"));
+ }
+
+ void
+--- geo/drgeo_dialog.cc
++++ geo/drgeo_dialog.cc
+@@ -38,14 +38,6 @@
+ // Used in the style dialod callback, I know it's ugly, but so easy
+ static drgeoFigure *selected_figure;
+
+-struct
+-{
+- drgeoPoint mouse;
+- drgeoFigure *figure;
+-}
+-drgeoDialogData;
+-
+-
+ static void drgeo_edit_dialog_cb (GtkWidget * dialog,
+ gint button, gpointer entry);
+
diff --git a/sci-mathematics/drgeo/metadata.xml b/sci-mathematics/drgeo/metadata.xml
new file mode 100644
index 00000000000..644b7bab5c8
--- /dev/null
+++ b/sci-mathematics/drgeo/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-mathematics</herd>
+ <longdescription lang="en">
+ Dr. Geo is a GTK2 interactive geometry software. It allows one to
+ create geometric figure plus the interactive manipulation of
+ such figure in respect with their geometric constraints. It is
+ useable in teaching situation with students from primary or
+ secondary level. It also features an integrated Scheme
+ programming language to define scripts within a figure.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">ofset</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/e/Manifest b/sci-mathematics/e/Manifest
new file mode 100644
index 00000000000..8172c087e78
--- /dev/null
+++ b/sci-mathematics/e/Manifest
@@ -0,0 +1,3 @@
+DIST E-1.5.tgz 1689077 SHA256 37239f169a9af3bb64edd205abe5022a043a1f4ea9ec694b39a9e61b37f5e46f SHA512 a2534c9e278741fed2f0005f5fa2b4ea60d71babd4e38c207a48f496df6916bf9ff4bf0ba41ae899eaeeeec7235ff1d759629dbcb627dd8766168f9bc98a4894 WHIRLPOOL e659d8e5917c505f2976532f0a19f0e2f845230c656f4cc62c5538f760e2559b06c0d9e47bc0e1df7eb9000791d0fa09ef5bf94dcc43f233e7514cffacf6893a
+DIST E-1.6.tgz 1627003 SHA256 91afe68f37ca2005a8eead3bdba0a4452de7cf7100369c9955304c8609b70c90 SHA512 769aa4d04595181285be49c1f21d7e8a47936fab78b5d6f2975910a64d4928cd2be97d781c4092dadab48d213a6bc788b8247a2310cf71042b1339129fe0cdf2 WHIRLPOOL 96c82427132017ee3f78c644ede9a018c74d59d7029fe006435baac9502d6cf6b097c51eeb1078b98ce8a208572956db756dcccd6529bcaba32519596dabf486
+DIST E-1.8.tgz 1832975 SHA256 636a5353046680f9c960d02d942df0a55af2e3941676df76e3356a334f6e842e SHA512 1b4358c636e8ea564ca942e1221e78234a9f0f793991f637bd7ec4d92eb9aa4a408a14c707405271fc017a9d63884d70bdfb0ed1b878383a1a44cfa57a7bdd51 WHIRLPOOL a917f756ce820344500712597db52d9e3716eab7eb60fb54fc15a247ecea25eb7a6bd3ac20bced771ece6296d78aaa7c64ea87a6239d6a7e3cd43d79fbaa83b9
diff --git a/sci-mathematics/e/e-1.5.ebuild b/sci-mathematics/e/e-1.5.ebuild
new file mode 100644
index 00000000000..a9475165619
--- /dev/null
+++ b/sci-mathematics/e/e-1.5.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_PN="E"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="E is a theorem prover for full first-order logic with equality"
+HOMEPAGE="http://www4.informatik.tu-muenchen.de/~schulz/E/E.html"
+SRC_URI="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_${PV}/${MY_PN}.tgz -> ${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples isabelle"
+
+RDEPEND="isabelle? (
+ >=sci-mathematics/isabelle-2011.1-r1:=
+ )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_PN}
+
+src_configure() {
+ ./configure --prefix="${ROOT}usr" \
+ --man-prefix="${ROOT}share/man" \
+ || die "E configure failed"
+
+ sed -e "s@CFLAGS = @CFLAGS = ${CFLAGS} @" \
+ -e "s@LD = \$(CC) @LD = \$(CC) ${LDFLAGS} @" \
+ -i "${S}/Makefile.vars" \
+ || die "Could not add our flags to Makefile.vars"
+}
+
+src_install() {
+ for i in "${S}/PROVER/eprover" \
+ "${S}/PROVER/epclextract" \
+ "${S}/PROVER/eproof" \
+ "${S}/PROVER/eproof_ram" \
+ "${S}/PROVER/eground" \
+ "${S}/PROVER/e_ltb_runner" \
+ "${S}/PROVER/e_axfilter" \
+ "${S}/PROVER/checkproof" \
+ "${S}/PROVER/ekb_create" \
+ "${S}/PROVER/ekb_delete" \
+ "${S}/PROVER/ekb_ginsert" \
+ "${S}/PROVER/ekb_insert"
+ do
+ dobin "${i}"
+ done
+
+ for i in "${S}/DOC/man/eprover.1" \
+ "${S}/DOC/man/epclextract.1" \
+ "${S}/DOC/man/eproof.1" \
+ "${S}/DOC/man/eproof_ram.1" \
+ "${S}/DOC/man/eground.1" \
+ "${S}/DOC/man/e_ltb_runner.1" \
+ "${S}/DOC/man/e_axfilter.1" \
+ "${S}/DOC/man/checkproof.1" \
+ "${S}/DOC/man/ekb_create.1" \
+ "${S}/DOC/man/ekb_delete.1" \
+ "${S}/DOC/man/ekb_ginsert.1" \
+ "${S}/DOC/man/ekb_insert.1"
+ do
+ doman "${i}"
+ done
+
+ if use doc; then
+ pushd "${S}"/DOC || die "Could not cd to DOC"
+ dodoc ANNOUNCE CREDITS DONE E-REMARKS E-REMARKS.english E-USERS \
+ HISTORY NEWS PORTING ReadMe THINKME TODO TPTP_SUBMISSION \
+ WISHLIST eprover.pdf
+ dohtml *.html
+ insinto /usr/share/doc/${PF}/html
+ doins estyle.sty
+ popd
+ fi
+
+ if use examples; then
+ dodir /usr/share/${MY_PN}/examples
+ insinto /usr/share/${MY_PN}/examples
+ doins -r EXAMPLE_PROBLEMS
+ doins -r SIMPLE_APPS
+ fi
+
+ if use isabelle; then
+ ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)" \
+ || die "isabelle getenv ISABELLE_HOME failed"
+ [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
+ dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ cat <<- EOF >> "${S}/settings"
+ E_HOME="${ROOT}usr/bin"
+ E_VERSION="${PV}"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+}
+
+pkg_postinst() {
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+}
+
+pkg_postrm() {
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/eproof" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new E being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}
diff --git a/sci-mathematics/e/e-1.6.ebuild b/sci-mathematics/e/e-1.6.ebuild
new file mode 100644
index 00000000000..4f56c1638bb
--- /dev/null
+++ b/sci-mathematics/e/e-1.6.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_PN="E"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="E is a theorem prover for full first-order logic with equality"
+HOMEPAGE="http://www4.informatik.tu-muenchen.de/~schulz/E/E.html"
+SRC_URI="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_${PV}/${MY_PN}.tgz -> ${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples isabelle"
+
+RDEPEND="isabelle? (
+ >=sci-mathematics/isabelle-2011.1-r1:=
+ )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_PN}
+
+src_configure() {
+ ./configure --prefix="${ROOT}usr" \
+ --man-prefix="${ROOT}share/man" \
+ || die "E configure failed"
+
+ sed -e "s@CFLAGS = @CFLAGS = ${CFLAGS} @" \
+ -e "s@LD = \$(CC) @LD = \$(CC) ${LDFLAGS} @" \
+ -i "${S}/Makefile.vars" \
+ || die "Could not add our flags to Makefile.vars"
+}
+
+src_install() {
+ for i in "${S}/PROVER/eprover" \
+ "${S}/PROVER/epclextract" \
+ "${S}/PROVER/eproof" \
+ "${S}/PROVER/eproof_ram" \
+ "${S}/PROVER/eground" \
+ "${S}/PROVER/e_ltb_runner" \
+ "${S}/PROVER/e_axfilter" \
+ "${S}/PROVER/checkproof" \
+ "${S}/PROVER/ekb_create" \
+ "${S}/PROVER/ekb_delete" \
+ "${S}/PROVER/ekb_ginsert" \
+ "${S}/PROVER/ekb_insert"
+ do
+ dobin "${i}"
+ done
+
+ for i in "${S}/DOC/man/eprover.1" \
+ "${S}/DOC/man/epclextract.1" \
+ "${S}/DOC/man/eproof.1" \
+ "${S}/DOC/man/eproof_ram.1" \
+ "${S}/DOC/man/eground.1" \
+ "${S}/DOC/man/e_ltb_runner.1" \
+ "${S}/DOC/man/e_axfilter.1" \
+ "${S}/DOC/man/checkproof.1" \
+ "${S}/DOC/man/ekb_create.1" \
+ "${S}/DOC/man/ekb_delete.1" \
+ "${S}/DOC/man/ekb_ginsert.1" \
+ "${S}/DOC/man/ekb_insert.1"
+ do
+ doman "${i}"
+ done
+
+ if use doc; then
+ pushd "${S}"/DOC || die "Could not cd to DOC"
+ dodoc ANNOUNCE CREDITS DONE E-REMARKS E-REMARKS.english E-USERS \
+ HISTORY NEWS PORTING ReadMe THINKME TODO TPTP_SUBMISSION \
+ WISHLIST eprover.pdf
+ dohtml *.html
+ insinto /usr/share/doc/${PF}/html
+ doins estyle.sty
+ popd
+ fi
+
+ if use examples; then
+ dodir /usr/share/${MY_PN}/examples
+ insinto /usr/share/${MY_PN}/examples
+ doins -r EXAMPLE_PROBLEMS
+ doins -r SIMPLE_APPS
+ fi
+
+ if use isabelle; then
+ ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)" \
+ || die "isabelle getenv ISABELLE_HOME failed"
+ [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
+ dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ cat <<- EOF >> "${S}/settings"
+ E_HOME="${ROOT}usr/bin"
+ E_VERSION="${PV}"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+}
+
+pkg_postinst() {
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+}
+
+pkg_postrm() {
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/eproof" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new E being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}
diff --git a/sci-mathematics/e/e-1.8.ebuild b/sci-mathematics/e/e-1.8.ebuild
new file mode 100644
index 00000000000..3c86f52819c
--- /dev/null
+++ b/sci-mathematics/e/e-1.8.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_PN="E"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="E is a theorem prover for full first-order logic with equality"
+HOMEPAGE="http://www4.informatik.tu-muenchen.de/~schulz/E/E.html"
+SRC_URI="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_${PV}/${MY_PN}.tgz -> ${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples isabelle"
+
+RDEPEND="isabelle? (
+ >=sci-mathematics/isabelle-2011.1-r1:=
+ )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_PN}
+
+src_configure() {
+ ./configure --prefix="${ROOT}usr" \
+ --man-prefix="${ROOT}share/man" \
+ || die "E configure failed"
+
+ sed -e "s@CFLAGS = @CFLAGS = ${CFLAGS} @" \
+ -e "s@LD = \$(CC) @LD = \$(CC) ${LDFLAGS} @" \
+ -i "${S}/Makefile.vars" \
+ || die "Could not add our flags to Makefile.vars"
+}
+
+src_install() {
+ dobin "${S}/PROVER/eprover" \
+ "${S}/PROVER/epclextract" \
+ "${S}/PROVER/eproof" \
+ "${S}/PROVER/eproof_ram" \
+ "${S}/PROVER/eground" \
+ "${S}/PROVER/e_ltb_runner" \
+ "${S}/PROVER/e_axfilter" \
+ "${S}/PROVER/checkproof" \
+ "${S}/PROVER/ekb_create" \
+ "${S}/PROVER/ekb_delete" \
+ "${S}/PROVER/ekb_ginsert" \
+ "${S}/PROVER/ekb_insert"
+
+ doman "${S}/DOC/man/eprover.1" \
+ "${S}/DOC/man/epclextract.1" \
+ "${S}/DOC/man/eproof.1" \
+ "${S}/DOC/man/eproof_ram.1" \
+ "${S}/DOC/man/eground.1" \
+ "${S}/DOC/man/e_ltb_runner.1" \
+ "${S}/DOC/man/e_axfilter.1" \
+ "${S}/DOC/man/checkproof.1" \
+ "${S}/DOC/man/ekb_create.1" \
+ "${S}/DOC/man/ekb_delete.1" \
+ "${S}/DOC/man/ekb_ginsert.1" \
+ "${S}/DOC/man/ekb_insert.1"
+
+ if use doc; then
+ pushd "${S}"/DOC || die "Could not cd to DOC"
+ dodoc ANNOUNCE CREDITS DONE E-REMARKS E-REMARKS.english E-USERS \
+ HISTORY NEWS PORTING ReadMe THINKME TODO TPTP_SUBMISSION \
+ WISHLIST eprover.pdf
+ dohtml *.html
+ dohtml estyle.sty
+ popd
+ fi
+
+ if use examples; then
+ insinto /usr/share/${MY_PN}/examples
+ doins -r EXAMPLE_PROBLEMS
+ doins -r SIMPLE_APPS
+ fi
+
+ if use isabelle; then
+ ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)" \
+ || die "isabelle getenv ISABELLE_HOME failed"
+ [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
+ cat <<- EOF >> "${S}/settings"
+ E_HOME="${ROOT}usr/bin"
+ E_VERSION="${PV}"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+}
+
+pkg_postinst() {
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+}
+
+pkg_postrm() {
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/eproof" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new E being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}
diff --git a/sci-mathematics/e/metadata.xml b/sci-mathematics/e/metadata.xml
new file mode 100644
index 00000000000..215faaa6df4
--- /dev/null
+++ b/sci-mathematics/e/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>gienah@gentoo.org</email>
+ <name>Mark Wright</name>
+</maintainer>
+<herd>sci-mathematics</herd>
+<longdescription lang='en'>
+E is a theorem prover for full first-order logic with equality. It
+accepts a problem specification, typically consisting of a number of
+first-order clauses or formulas, and a conjecture, again either in
+clausal or full first-order form. The system will then try to find a
+formal proof for the conjecture, assuming the axioms.
+
+If a proof is found, the system can provide a detailed list of proof
+steps that can be individually verified. If the conjecture is
+existential (i.e. it’s of the form “there exists an X with property
+P”), the latest versions can also provide possible answers (values for
+X).
+
+Development of E started as part of the E-SETHEO project at TUM. The
+first public release was in in 1998, and the system has been
+continuously improved ever since. I believe that E now is one of the
+most powerful and friendly reasoning systems for first-order
+logic. The prover has successfully participated in many competitions.
+</longdescription>
+<use>
+ <flag name='isabelle'>Add integration support for the Isabelle/HOL
+ theorem prover.</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/ent/Manifest b/sci-mathematics/ent/Manifest
new file mode 100644
index 00000000000..634f75007eb
--- /dev/null
+++ b/sci-mathematics/ent/Manifest
@@ -0,0 +1 @@
+DIST random-101202.zip 76200 RMD160 b21b8401fdbd2aac189fe4a442a1164b172407f8 SHA1 0f2f12dc67d1f02f77776709cf5fc5eee1d1b2e2 SHA256 c14ed62db24511848d6b37d4bf8869185b65be9042ffad5272257f3a249569ec
diff --git a/sci-mathematics/ent/ent-101202.ebuild b/sci-mathematics/ent/ent-101202.ebuild
new file mode 100644
index 00000000000..fa8a0eb052a
--- /dev/null
+++ b/sci-mathematics/ent/ent-101202.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Pseudorandom number sequence test"
+HOMEPAGE="http://www.fourmilab.ch/random/"
+SRC_URI="mirror://gentoo/random-${PV}.zip"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="public-domain"
+IUSE=""
+
+RDEPEND=""
+DEPEND="app-arch/unzip"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ tc-export CC
+}
+
+src_install() {
+ dobin ${PN} || die
+ dohtml ${PN}.html ${PN}itle.gif || die
+}
diff --git a/sci-mathematics/ent/files/101202-gentoo.patch b/sci-mathematics/ent/files/101202-gentoo.patch
new file mode 100644
index 00000000000..a71bc505063
--- /dev/null
+++ b/sci-mathematics/ent/files/101202-gentoo.patch
@@ -0,0 +1,20 @@
+diff --git a/Makefile b/Makefile
+index 2a150cf..3f9b883 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,12 +1,12 @@
+
+ # Unix make file for random test program
+
+-CC = gcc
+-CFLAGS = -g -Wall
++CC ?= gcc
++CFLAGS ?= -g -Wall
+ #CFLAGS = -O
+
+ ent: ent.o iso8859.o randtest.o chisq.o
+- $(CC) $(CFLAGS) ent.o iso8859.o randtest.o chisq.o -o ent -lm
++ $(CC) $(LDFLAGS) $(CFLAGS) ent.o iso8859.o randtest.o chisq.o -o ent -lm
+
+ ent.c: iso8859.h randtest.h
+
diff --git a/sci-mathematics/ent/metadata.xml b/sci-mathematics/ent/metadata.xml
new file mode 100644
index 00000000000..a2070de023f
--- /dev/null
+++ b/sci-mathematics/ent/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-mathematics</herd>
+<maintainer>
+ <email>jlec@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sci-mathematics/euler/Manifest b/sci-mathematics/euler/Manifest
new file mode 100644
index 00000000000..b1411738a67
--- /dev/null
+++ b/sci-mathematics/euler/Manifest
@@ -0,0 +1 @@
+DIST euler-1.61.0.tgz 1202485 SHA256 1350a3ded26fa8bab2580a1dc3a689aabbb100b872df62819327282773e02d95 SHA512 f8b9b0c6aa5aea4bd42bd33fff986a52c624c268ede11b83c2c53293a5acbda45317ecc719c12f377b236460c7ff0dba1d110ee8e90b526fc70af03ed0327b27 WHIRLPOOL 46967a4d5cb82a3fcc42730c8ecdb5b529e176bd6b9dcf1055e7790f9d15cfc85eda60bae66543a6cca1fda73cf88f15bc200ac1cdc5c10347a1237fcaa06aae
diff --git a/sci-mathematics/euler/euler-1.61.0.ebuild b/sci-mathematics/euler/euler-1.61.0.ebuild
new file mode 100644
index 00000000000..1f8ab2c0f68
--- /dev/null
+++ b/sci-mathematics/euler/euler-1.61.0.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils
+
+DESCRIPTION="Mathematical programming environment"
+HOMEPAGE="http://euler.sourceforge.net/"
+SRC_URI="mirror://sourceforge/euler/${P}.tgz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc -sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="x11-libs/gtk+:2
+ virtual/pkgconfig"
+
+RDEPEND="x11-libs/gtk+:2
+ x11-misc/xdg-utils"
+
+PATCHES=(
+ "${FILESDIR}"/configure-gentoo.patch
+ "${FILESDIR}"/command-gcc4-gentoo.patch
+ "${FILESDIR}"/${PN}-glibc-2.4-gentoo.patch
+ "${FILESDIR}"/${PN}-xdg.patch
+ "${FILESDIR}"/${PN}-fortify.patch
+)
+
+src_prepare() {
+ # gentoo specific stuff
+ sed -i -e '/COPYING/d' -e '/INSTALL/d' Makefile.am || die
+ sed -i \
+ -e "s:doc/euler:doc/${PF}:g" \
+ Makefile.am docs/Makefile.am \
+ docs/*/Makefile.am docs/*/images/Makefile.am src/main.c \
+ || die "sed for docs failed"
+ autotools-utils_src_prepare
+}
diff --git a/sci-mathematics/euler/files/command-gcc4-gentoo.patch b/sci-mathematics/euler/files/command-gcc4-gentoo.patch
new file mode 100644
index 00000000000..c405d65bd76
--- /dev/null
+++ b/sci-mathematics/euler/files/command-gcc4-gentoo.patch
@@ -0,0 +1,12 @@
+diff -Naur euler-1.61.0/src/command.c euler-1.61.0-new/src/command.c
+--- euler-1.61.0/src/command.c 2005-10-24 00:38:24.000000000 +0000
++++ euler-1.61.0-new/src/command.c 2006-02-08 23:30:43.000000000 +0000
+@@ -732,7 +732,7 @@
+ }
+
+
+-static int command_count;
++int command_count;
+
+ commandtyp command_list[] = {
+ {"quit",c_quit,do_quit},
diff --git a/sci-mathematics/euler/files/configure-gentoo.patch b/sci-mathematics/euler/files/configure-gentoo.patch
new file mode 100644
index 00000000000..e1e7c6ef1e6
--- /dev/null
+++ b/sci-mathematics/euler/files/configure-gentoo.patch
@@ -0,0 +1,37 @@
+diff -Naur euler-1.61.0/configure.in euler-1.61.0-new/configure.in
+--- euler-1.61.0/configure.in 2005-10-30 16:40:27.000000000 +0000
++++ euler-1.61.0-new/configure.in 2006-02-08 23:38:54.000000000 +0000
+@@ -8,8 +8,6 @@
+ AM_CONFIG_HEADER(config.h)
+
+ AC_ISC_POSIX
+-CFLAGS=""
+-AC_SUBST(CFLAGS)
+ AC_PROG_CC
+ AM_PROG_CC_STDC
+ AC_HEADER_STDC
+@@ -21,6 +19,10 @@
+
+
+ dnl Checks for libraries.
++dnl Check for libm for fmod()
++AC_SEARCH_LIBS([fmod], [m], [], [
++ AC_MSG_ERROR([unable to find the fmod() function])
++])
+
+
+ dnl Checks for header files.
+diff -Naur euler-1.61.0/src/Makefile.am euler-1.61.0-new/src/Makefile.am
+--- euler-1.61.0/src/Makefile.am 2005-10-30 22:48:35.000000000 +0000
++++ euler-1.61.0-new/src/Makefile.am 2006-02-08 23:41:32.000000000 +0000
+@@ -7,10 +7,6 @@
+ INCLUDES = \
+ $(GTK_CFLAGS)
+
+-AM_CFLAGS =\
+- -Wall\
+- -O3
+-
+ bin_PROGRAMS = euler
+
+ euler_SOURCES = \
diff --git a/sci-mathematics/euler/files/euler-fortify.patch b/sci-mathematics/euler/files/euler-fortify.patch
new file mode 100644
index 00000000000..efb366e2cc0
--- /dev/null
+++ b/sci-mathematics/euler/files/euler-fortify.patch
@@ -0,0 +1,36 @@
+diff -Nur euler-1.61.0.orig/src/command.c euler-1.61.0/src/command.c
+--- euler-1.61.0.orig/src/command.c 2010-11-19 17:50:54.000000000 +0000
++++ euler-1.61.0/src/command.c 2010-11-19 18:23:11.000000000 +0000
+@@ -606,7 +606,7 @@
+ void do_help (void)
+ { char name[256];
+ header *hd;
+- int count,i,defaults;
++ size_t count,i,defaults;
+ char *p,*end,*pnote;
+ builtintyp *b;
+ scan_space();
+diff -Nur euler-1.61.0.orig/src/stack.h euler-1.61.0/src/stack.h
+--- euler-1.61.0.orig/src/stack.h 2010-11-19 17:50:54.000000000 +0000
++++ euler-1.61.0/src/stack.h 2010-11-19 18:19:23.000000000 +0000
+@@ -63,7 +63,7 @@
+ #endif
+ } dims;
+
+-typedef struct { unsigned long s; } inttyp;
++typedef struct { size_t s; } inttyp;
+
+ typedef struct { header hd; double val; } realtyp;
+
+diff -Nur euler-1.61.0.orig/src/udf.c euler-1.61.0/src/udf.c
+--- euler-1.61.0.orig/src/udf.c 2010-11-19 17:50:54.000000000 +0000
++++ euler-1.61.0/src/udf.c 2010-11-19 18:21:20.000000000 +0000
+@@ -334,7 +334,7 @@
+ { char name[16];
+ header *hd;
+ char *p,*pnote;
+- int i,count,defaults;
++ size_t i,count,defaults;
+ builtintyp *b;
+ scan_space();
+ scan_name(name); hd=searchudf(name);
diff --git a/sci-mathematics/euler/files/euler-glibc-2.4-gentoo.patch b/sci-mathematics/euler/files/euler-glibc-2.4-gentoo.patch
new file mode 100644
index 00000000000..da377bd5f3b
--- /dev/null
+++ b/sci-mathematics/euler/files/euler-glibc-2.4-gentoo.patch
@@ -0,0 +1,13 @@
+# patch to fix missing CLK_TCK in glibc 2.4
+
+--- src/main.c. 2006-04-04 15:05:34.000000000 +0200
++++ src/main.c 2006-04-04 15:09:20.000000000 +0200
+@@ -439,7 +439,7 @@
+ gettimer(TIMEOFDAY,&t);
+ return (t.tv_sec+t.tv_nsec/1000000000.0);
+ #else
+- return ((double)(times(NULL)))/CLK_TCK;
++ return ((double)(times(NULL)))/CLOCKS_PER_SEC;
+ #endif
+ }
+
diff --git a/sci-mathematics/euler/files/euler-xdg.patch b/sci-mathematics/euler/files/euler-xdg.patch
new file mode 100644
index 00000000000..cb1bf54a2bb
--- /dev/null
+++ b/sci-mathematics/euler/files/euler-xdg.patch
@@ -0,0 +1,23 @@
+--- docs/doc.html.orig 2008-01-07 23:11:25.490634852 +0000
++++ docs/doc.html 2008-01-07 23:13:57.652980222 +0000
+@@ -184,7 +184,8 @@
+ <div align=center><img src="images/pref3.gif"></div>
+
+ <p align="justify">Finally, You can set a flag to let Euler save preferences at exit (the default).
+-You may choose another browser than the one suggested (netscape by default). And
++You may choose another browser than the one suggested (your default
++ desktop browser is selected with xdg-open by default). And
+ You can also reset the preferences to the default values.</p>
+ <div align=center><img src="images/pref4.gif"></div>
+
+--- src/rc.h.orig 2008-01-07 23:15:36.617118688 +0000
++++ src/rc.h 2008-01-07 23:15:54.097371330 +0000
+@@ -26,7 +26,7 @@
+ #define E_GSTACK_DEFAULT 4*1024l
+ #define E_GLINES_DEFAULT 40
+
+-#define E_BROWSER_DEFAULT "netscape"
++#define E_BROWSER_DEFAULT "xdg-open"
+
+ #define MAX_COLORS 16
+
diff --git a/sci-mathematics/euler/metadata.xml b/sci-mathematics/euler/metadata.xml
new file mode 100644
index 00000000000..8e1f11be362
--- /dev/null
+++ b/sci-mathematics/euler/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-mathematics</herd>
+ <upstream>
+ <remote-id type="sourceforge">euler</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/factmsieve/Manifest b/sci-mathematics/factmsieve/Manifest
new file mode 100644
index 00000000000..6d42a346938
--- /dev/null
+++ b/sci-mathematics/factmsieve/Manifest
@@ -0,0 +1 @@
+DIST factmsieve.76.zip 19563 SHA256 961db0a36acc58ebf5ce2f5ba9f952e018a9aefbc2f9f8ab8b2a425757c2e2a2 SHA512 b07b0676a635ff746b1edfaf064d27388df8f9c5c2fe1bd1e80d4c839c6e518e3a0b39a06b76f3d59c9fa3f4cc99df0831ba6309a2a7d2eb779b952a29996431 WHIRLPOOL c5d818122f5db9b744272999bb72c42eb73a35dd20ad4ce46822b7e5be2f978a6582c9c5a2402f5fc9a1db4e8ec9f5373f7b090421000f85abecec156cf97a81
diff --git a/sci-mathematics/factmsieve/factmsieve-76.ebuild b/sci-mathematics/factmsieve/factmsieve-76.ebuild
new file mode 100644
index 00000000000..892331aacc8
--- /dev/null
+++ b/sci-mathematics/factmsieve/factmsieve-76.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Convenient factorization helper script using msieve and ggnfs"
+HOMEPAGE="http://gladman.plushost.co.uk/oldsite/computing/factoring.php"
+SRC_URI="http://gladman.plushost.co.uk/oldsite/computing/${PN}.${PV}.zip"
+
+inherit eutils
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# I guess no one really "needs" python 2.6, but I'm a nice person
+RDEPEND="|| ( dev-lang/python:2.7 dev-lang/python:2.6 )
+ sci-mathematics/msieve
+ sci-mathematics/ggnfs"
+DEPEND=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}.patch"
+}
+
+src_compile() { :;
+}
+
+src_install() {
+ mkdir -p "${D}/usr/bin/"
+ cp "${S}/${PN}.py" "${D}/usr/bin/${PN}" || die "Failed to install"
+ chmod +x "${D}/usr/bin/${PN}" || die
+}
diff --git a/sci-mathematics/factmsieve/files/factmsieve-76.patch b/sci-mathematics/factmsieve/files/factmsieve-76.patch
new file mode 100644
index 00000000000..c22f8860658
--- /dev/null
+++ b/sci-mathematics/factmsieve/files/factmsieve-76.patch
@@ -0,0 +1,52 @@
+--- factmsieve.py 2010-12-02 13:59:20.000000000 +0800
++++ factmsieve.py.new 2012-11-30 15:06:50.566116187 +0800
+@@ -1,3 +1,4 @@
++#!/usr/bin/env python2
+ # factmsieve.py - A Python driver for GGNFS and MSIEVE
+ #
+ # Copyright (c) 2010, Brian Gladman
+@@ -56,9 +57,12 @@
+ import time, subprocess, gzip, glob, math, tempfile, datetime
+ import atexit, threading, collections, multiprocessing, platform
+
++# need to save pwd
++CUR_DIR=os.path.realpath(os.curdir)
++
+ # Set binary directory paths
+-GGNFS_PATH = '../../bin/x64/Release/'
+-MSIEVE_PATH = '../../../msieve/build.vc10/x64/Release/'
++GGNFS_PATH = '/usr/bin/'
++MSIEVE_PATH = '/usr/bin/'
+
+ # Set the number of CPU cores and threads
+ NUM_CORES = 4
+@@ -69,7 +73,7 @@
+ # number of linear algebra threads to launch
+ LA_THREADS = NUM_CORES * THREADS_PER_CORE
+
+-USE_CUDA = True
++USE_CUDA = False
+ GPU_NUM = 0
+ MSIEVE_POLY_TIME_LIMIT = 0
+
+@@ -103,8 +107,8 @@
+
+ # default parameter files
+
+-DEFAULT_PAR_FILE = GGNFS_PATH + 'def-par.txt'
+-DEFAULT_POLSEL_PAR_FILE = GGNFS_PATH + 'def-nm-params.txt'
++DEFAULT_PAR_FILE = '/usr/share/doc/ggnfs/def-par.txt'
++DEFAULT_POLSEL_PAR_FILE = '/usr/share/doc/ggnfs/def-nm-params.txt'
+
+ # temporary files
+
+@@ -258,7 +262,8 @@
+ # write string to log(s):
+
+ def write_string_to_log(s):
+- with open(LOGNAME, 'a') as out_f:
++ # XXX hax
++ with open(CUR_DIR+'/'+LOGNAME, 'a') as out_f:
+ print(date_time_string() + s, file = out_f)
+
+ def output(s, console = True, log = True):
diff --git a/sci-mathematics/factmsieve/metadata.xml b/sci-mathematics/factmsieve/metadata.xml
new file mode 100644
index 00000000000..24cbb90cf0c
--- /dev/null
+++ b/sci-mathematics/factmsieve/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-mathematics/fann/Manifest b/sci-mathematics/fann/Manifest
new file mode 100644
index 00000000000..ea4816c0e5d
--- /dev/null
+++ b/sci-mathematics/fann/Manifest
@@ -0,0 +1,2 @@
+DIST FANN-2.2.0-Source.zip 2285087 SHA256 434b85fce60701c4e0066c442d60110d8e649f278e4edb814f0c0e7a1e0929fd
+DIST fann-2.1.0beta.zip 4033198 SHA256 c24171b5b9c87946bd2f50045cc8dbd0121629fe426615501db14e6043e4a141
diff --git a/sci-mathematics/fann/fann-2.1.0_beta-r1.ebuild b/sci-mathematics/fann/fann-2.1.0_beta-r1.ebuild
new file mode 100644
index 00000000000..dab9cb87eb9
--- /dev/null
+++ b/sci-mathematics/fann/fann-2.1.0_beta-r1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+PYTHON_DEPEND="python? 2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython"
+
+inherit eutils python autotools
+
+MY_P=${P/_/}
+
+DESCRIPTION="Fast Artificial Neural Network Library"
+HOMEPAGE="http://leenissen.dk/fann/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="doc python static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ python? ( dev-lang/swig )
+ app-arch/unzip"
+
+S="${WORKDIR}/${P/_beta/}"
+
+pkg_setup() {
+ use python && python_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-python.patch \
+ "${FILESDIR}"/${P}-benchmark.patch \
+ "${FILESDIR}"/${P}-examples.patch \
+ "${FILESDIR}"/${P}-asneeded.patch \
+ "${FILESDIR}"/${P}-valist.patch \
+ "${FILESDIR}"/${P}-sizecheck.patch
+ eautoreconf
+ use python && python_copy_sources python
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake || die "emake failed"
+ compilation() {
+ emake PYTHON_VERSION="$(python_get_version)" || die "emake python failed"
+ }
+ use python && python_execute_function -s --source-dir python compilation
+}
+
+src_test() {
+ cd "${S}"/examples
+ emake CFLAGS="${CFLAGS} -I../src/include -L../src/.libs" \
+ || die "emake examples failed"
+ LD_LIBRARY_PATH="../src/.libs" emake runtest || die "tests failed"
+ emake clean
+ testing() {
+ emake test || die "failed tests for python wrappers"
+ }
+ use python && python_execute_function -s --source-dir python testing
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc AUTHORS ChangeLog NEWS README TODO || die
+
+ if use doc; then
+ dodoc doc/*.txt
+ insinto /usr/share/doc/${PF}
+ doins doc/fann_en.pdf || die "failed to install reference manual"
+ doins -r examples || die "failed to install examples"
+ doins -r benchmarks || die "failed to install benchmarks"
+ fi
+
+ installation() {
+ emake install ROOT="${D}" || die "failed to install python wrappers"
+ if use doc; then
+ insinto /usr/share/doc/${PF}/examples/python
+ doins -r examples || die "failed to install python examples"
+ fi
+ }
+ use python && python_execute_function -s --source-dir python installation
+}
+
+pkg_postinst() {
+ use python && python_mod_optimize py${PN}
+}
+
+pkg_postrm() {
+ use python && python_mod_cleanup py${PN}
+}
diff --git a/sci-mathematics/fann/fann-2.2.0.ebuild b/sci-mathematics/fann/fann-2.2.0.ebuild
new file mode 100644
index 00000000000..4ba0a43afb7
--- /dev/null
+++ b/sci-mathematics/fann/fann-2.2.0.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+MYP=FANN-${PV}-Source
+
+DESCRIPTION="Fast Artificial Neural Network Library"
+HOMEPAGE="http://leenissen.dk/fann/"
+SRC_URI="mirror://sourceforge/${PN}/${MYP}.zip"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="examples"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}"/${P}-examples.patch )
+
+src_test() {
+ cd examples
+ emake CFLAGS="${CFLAGS} -I../src/include -L${BUILD_DIR}/src"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src" emake runtest
+ emake clean
+}
+
+src_install() {
+ cmake-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+}
diff --git a/sci-mathematics/fann/files/fann-2.0.0-benchmark.patch b/sci-mathematics/fann/files/fann-2.0.0-benchmark.patch
new file mode 100644
index 00000000000..ec37e9940a6
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.0.0-benchmark.patch
@@ -0,0 +1,49 @@
+diff -Naur fann-2.0.0/benchmarks/Makefile fann-2.0.0-new/benchmarks/Makefile
+--- fann-2.0.0/benchmarks/Makefile 2005-11-29 16:33:12.000000000 -0500
++++ fann-2.0.0-new/benchmarks/Makefile 2006-10-28 09:08:00.000000000 -0400
+@@ -16,7 +16,7 @@
+ all: $(TARGETS)
+
+ quality: quality.cc
+- $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -llwneuralnet -ljneural -lfl
++ $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -lfl
+
+ quality_fixed: quality_fixed.c
+ $(GCC) $(CFLAGS) $(LFLAGS) $< -o $@ -lfixedfann
+@@ -25,7 +25,7 @@
+ $(GCC) -ggdb -lm -DDEBUG -Wall -ansi -I../src/ -I../src/include/ ../src/fixedfann.c $< -o $@
+
+ performance: performance.cc
+- $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -llwneuralnet -ljneural -lfl
++ $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -lfl
+
+ performance_fixed: performance.cc
+ $(G++) $(CFLAGS) $(LFLAGS) -DFIXEDFANN $< -o $@ -lfixedfann
+diff -Naur fann-2.0.0/benchmarks/performance.cc fann-2.0.0-new/benchmarks/performance.cc
+--- fann-2.0.0/benchmarks/performance.cc 2005-10-24 16:48:47.000000000 -0400
++++ fann-2.0.0-new/benchmarks/performance.cc 2006-10-28 09:08:28.000000000 -0400
+@@ -19,8 +19,8 @@
+
+ //uncomment lines below to benchmark the libraries
+
+-#define JNEURAL
+-#define LWNN
++/*#define JNEURAL
++#define LWNN */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+diff -Naur fann-2.0.0/benchmarks/quality.cc fann-2.0.0-new/benchmarks/quality.cc
+--- fann-2.0.0/benchmarks/quality.cc 2005-11-29 16:33:12.000000000 -0500
++++ fann-2.0.0-new/benchmarks/quality.cc 2006-10-28 09:08:19.000000000 -0400
+@@ -19,8 +19,8 @@
+
+ //uncomment lines below to benchmark the libraries
+
+-#define JNEURAL
+-#define LWNN
++/*#define JNEURAL
++#define LWNN */
+
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/sci-mathematics/fann/files/fann-2.0.0-shared-libs-gentoo.patch b/sci-mathematics/fann/files/fann-2.0.0-shared-libs-gentoo.patch
new file mode 100644
index 00000000000..2d9782a563a
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.0.0-shared-libs-gentoo.patch
@@ -0,0 +1,23 @@
+diff -Naur fann-2.0.0/python/pyfann/Makefile fann-2.0.0-new/python/pyfann/Makefile
+--- fann-2.0.0/python/pyfann/Makefile 2005-12-02 20:22:43.000000000 -0500
++++ fann-2.0.0-new/python/pyfann/Makefile 2006-10-28 07:36:34.000000000 -0400
+@@ -10,7 +10,7 @@
+ all: $(TARGETS)
+
+ _%.so: pyfann_wrap.o fann_helper.o
+- gcc $(LIBS) -shared -dll $^ -o $@
++ gcc $(LIBS) -fPIC -shared -dll $^ -o $@
+
+ %.o: %.c
+ gcc -c $< -I/usr/include/$(PYTHON)/ -I$(FANN_DIR)/src/include/
+diff -Naur fann-2.0.0/python/setup.py fann-2.0.0-new/python/setup.py
+--- fann-2.0.0/python/setup.py 2006-01-06 16:45:28.000000000 -0500
++++ fann-2.0.0-new/python/setup.py 2006-10-28 07:36:07.000000000 -0400
+@@ -40,6 +40,6 @@
+ url='http://sourceforge.net/projects/fann/',
+ license='GNU LESSER GENERAL PUBLIC LICENSE (LGPL)',
+ py_modules=['pyfann.libfann','pyfann.fann'],
+- ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann.i','pyfann/fann_helper.c'], include_dirs=['../src/include'], extra_objects=['../src/doublefann.o']) ]
++ ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann.i','pyfann/fann_helper.c'], include_dirs=['../src/include'], extra_objects=['../src/.libs/doublefann.o']) ]
+ )
+
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-asneeded.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-asneeded.patch
new file mode 100644
index 00000000000..f68da2d4ecc
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-asneeded.patch
@@ -0,0 +1,8 @@
+--- configure.in.orig 2009-09-09 21:18:25.000000000 +0100
++++ configure.in 2009-09-09 21:18:43.000000000 +0100
+@@ -7,4 +7,5 @@
+ AC_C_CONST
+ AC_HEADER_TIME
+ AC_CHECK_FUNCS(gettimeofday)
++AC_CHECK_LIB(m, sin)
+ AC_OUTPUT(Makefile src/Makefile src/include/Makefile fann.pc fann.spec)
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-benchmark.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-benchmark.patch
new file mode 100644
index 00000000000..60933e5e361
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-benchmark.patch
@@ -0,0 +1,80 @@
+--- benchmarks/Makefile.orig 2008-04-22 10:16:48.664395478 +0000
++++ benchmarks/Makefile 2008-04-22 10:59:59.815994915 +0000
+@@ -1,43 +1,35 @@
+-# The jneural library (http://voltar-confed.org/jneural/) and lwneuralnet library (http://sourceforge.net/projects/lwneuralnet/) needs to be installed in order to run the benchmarks
+-
+-GCC = gcc
+-G++ = g++
++# The jneural library (http://voltar-confed.org/jneural/) and lwneuralnet library (http://sourceforge.net/projects/lwneuralnet/) needs to be installed in order to run the benchmarks with EXTRA_NEURALS
+
+ TARGETS = quality quality_fixed performance performance_fixed shuffle parity two-spirals
+
+-CFLAGS = -O3 -finline-functions -funroll-loops -Werror
+-
+ LFLAGS = -lm
+-
+-JNEURALDIR = ../../libraries/jneural/
+-
+-LWNNDIR = ../../libraries/lwneuralnet-0.8/source/
++#EXTRA_NEURALS="-llwneuralnet -ljneural -DJNEURAL"
+
+ all: $(TARGETS)
+
+ quality: quality.cc
+- $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -llwneuralnet -ljneural -lfl
++ $(CXX) $(CXXFLAGS) $(LFLAGS) $< -o $@ -lfloatfann -lfl $(EXTRA_NEURALS)
+
+ quality_fixed: quality_fixed.c
+- $(GCC) $(CFLAGS) $(LFLAGS) $< -o $@ -lfixedfann
++ $(CC) $(CFLAGS) $(LFLAGS) $< -o $@ -lfixedfann
+
+ quality_fixed_debug: quality_fixed.c
+- $(GCC) -ggdb -lm -DDEBUG -Wall -ansi -I../src/ -I../src/include/ ../src/fixedfann.c $< -o $@
++ $(CC) -ggdb -lm -DDEBUG -Wall -ansi -I../src/ -I../src/include/ ../src/fixedfann.c $< -o $@
+
+ performance: performance.cc
+- $(G++) $(CFLAGS) $(LFLAGS) -I$(JNEURALDIR)include/ -L$(JNEURALDIR) -I$(LWNNDIR) -L$(LWNNDIR) $< -o $@ -lfloatfann -llwneuralnet -ljneural -lfl
++ $(CXX) $(CXXFLAGS) $(LFLAGS) $< -o $@ -lfloatfann -lfl $(EXTRA_NEURALS)
+
+ performance_fixed: performance.cc
+- $(G++) $(CFLAGS) $(LFLAGS) -DFIXEDFANN $< -o $@ -lfixedfann
++ $(CXX) $(CXXFLAGS) $(LFLAGS) -DFIXEDFANN $< -o $@ -lfixedfann
+
+ shuffle: shuffle.c
+- $(GCC) $(CFLAGS) $(LFLAGS) $< -o $@ -lfloatfann
++ $(CC) $(CFLAGS) $(LFLAGS) $< -o $@ -lfloatfann
+
+ two-spirals: two-spirals.c
+- $(GCC) $(CFLAGS) $(LFLAGS) $< -o $@
++ $(CC) $(CFLAGS) $(LFLAGS) $< -o $@
+
+ parity: parity.c
+- $(GCC) $(CFLAGS) $(LFLAGS) $< -o $@
++ $(CC) $(CFLAGS) $(LFLAGS) $< -o $@
+
+ clean:
+ rm -rf -- $(TARGETS) *~
+--- benchmarks/performance.cc.orig 2008-04-22 10:24:38.604894867 +0000
++++ benchmarks/performance.cc 2008-04-22 10:26:57.436806446 +0000
+@@ -19,9 +19,6 @@
+
+ //uncomment lines below to benchmark the libraries
+
+-#define JNEURAL
+-#define LWNN
+-
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+--- benchmarks/quality.cc.orig 2008-04-22 10:59:27.814171235 +0000
++++ benchmarks/quality.cc 2008-04-22 10:59:39.570841209 +0000
+@@ -19,9 +19,6 @@
+
+ //uncomment lines below to benchmark the libraries
+
+-#define JNEURAL
+-#define LWNN
+-
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-examples.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-examples.patch
new file mode 100644
index 00000000000..45bfdd02b38
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-examples.patch
@@ -0,0 +1,23 @@
+--- examples/Makefile.orig 2008-04-22 10:15:42.500625020 +0000
++++ examples/Makefile 2008-04-22 10:16:40.563933859 +0000
+@@ -1,18 +1,16 @@
+ # This makefile is on purpose not made with configure, to show how to use the library
+ # The make file requires that the fann library is installed (see ../README)
+
+-GCC=gcc
+-
+ TARGETS = xor_train xor_test xor_test_fixed simple_train steepness_train simple_test robot mushroom cascade_train scaling_test scaling_train
+ DEBUG_TARGETS = xor_train_debug xor_test_debug xor_test_fixed_debug cascade_train_debug
+
+ all: $(TARGETS)
+
+ %: %.c Makefile
+- $(GCC) -O3 $< -o $@ -lm -lfann
++ $(CC) $(CFLAGS) $< -o $@ -lm -lfann
+
+ %_fixed: %.c Makefile
+- $(GCC) -O3 -DFIXEDFANN $< -o $@ -lm -lfixedfann
++ $(CC) $(CFLAGS) -DFIXEDFANN $< -o $@ -lm -lfixedfann
+
+ clean:
+ rm -f $(TARGETS) $(DEBUG_TARGETS) xor_fixed.data *.net *~ *.obj *.exe *.tds noscale.txt withscale.txt scale_test_results.txt
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-python.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-python.patch
new file mode 100644
index 00000000000..6c6a68201b5
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-python.patch
@@ -0,0 +1,20 @@
+--- python/setup.py.orig 2008-04-22 10:11:05.284827392 +0000
++++ python/setup.py 2008-04-22 10:13:21.668599460 +0000
+@@ -9,7 +9,7 @@
+ import os
+
+ NAME='pyfann'
+-VERSION='2.0.0'
++VERSION='2.1.0'
+
+ LONG_DESCRIPTION="""\
+ Fast Artificial Neural Network Library implements multilayer
+@@ -42,7 +42,7 @@
+ py_modules=['pyfann.libfann'],
+ ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann_wrap.cxx'],
+ include_dirs=['../src/include'],
+- extra_objects=['../src/doublefann.o'],
++ extra_objects=['../src/.libs/doublefann.o'],
+ define_macros=[("SWIG_COMPILE",None)]
+ ),
+ ]
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-pythonlink.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-pythonlink.patch
new file mode 100644
index 00000000000..308a21e0bd4
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-pythonlink.patch
@@ -0,0 +1,30 @@
+From: Christian Kastner <debian@kvr.at>
+Date: Fri, 4 Jun 2010 23:27:24 +0200
+Subject: [PATCH] Link python-pyfann dynamically instead of statically
+
+Upstream links the pyfann extension against libfann's static library. This
+causes all sorts of troubles on some platforms, most notably amd64, where the
+extension FTBFS because the static library isn't compiled with -fPIC. The
+Debian-specific solution presented here is to link to the shared library and
+let package python-pyfann Depend: on it.
+
+Forwarded: no
+Last-Update: 2010-06-04
+---
+ python/setup.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/python/setup.py b/python/setup.py
+index 67cef7e..6b2a3dc 100755
+--- a/python/setup.py
++++ b/python/setup.py
+@@ -42,7 +42,7 @@ setup(
+ py_modules=['pyfann.libfann'],
+ ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann_wrap.cxx'],
+ include_dirs=['../src/include'],
+- extra_objects=['../src/doublefann.o'],
++ extra_objects=['../src/.libs/doublefann.o'],
+ define_macros=[("SWIG_COMPILE",None)]
+ ),
+ ]
+--
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-sizecheck.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-sizecheck.patch
new file mode 100644
index 00000000000..885db95b04f
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-sizecheck.patch
@@ -0,0 +1,25 @@
+From: Christian Kastner <debian@kvr.at>
+Date: Sun, 6 Feb 2011 17:09:05 +0100
+Subject: [PATCH] Correct a typo in a size comparison
+
+Origin: http://leenissen.dk/fann/forum/viewtopic.php?f=1&t=626
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/712290
+Last-Update: 2011-02-06
+---
+ python/pyfann/pyfann.i | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/python/pyfann/pyfann.i b/python/pyfann/pyfann.i
+index 47b17ba..ec55535 100644
+--- a/python/pyfann/pyfann.i
++++ b/python/pyfann/pyfann.i
+@@ -108,7 +108,7 @@
+ for (j = 0; j< num; j++)
+ {
+ PyObject* o1=PySequence_GetItem($input,j);
+- if ((unsigned int)PySequence_Length(o1) == dim) {
++ if ((unsigned int)PySequence_Length(o1) != dim) {
+ PyErr_SetString(PyExc_ValueError,"Size mismatch. All items must be of the same size");
+ SWIG_fail;
+ }
+--
diff --git a/sci-mathematics/fann/files/fann-2.1.0_beta-valist.patch b/sci-mathematics/fann/files/fann-2.1.0_beta-valist.patch
new file mode 100644
index 00000000000..23d130f6065
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.1.0_beta-valist.patch
@@ -0,0 +1,65 @@
+From: Christian Kastner <debian@kvr.at>
+Date: Thu, 1 Jul 2010 01:02:47 +0200
+Subject: [PATCH] Portable handling for va_list
+
+The current code wrongly assumes va_list is always implemented as an array. va_list
+however is an opaque type, and may also be implemented as a struct, for
+example. This patch implements handling of va_list in a platform-independent
+way, fixing a FTBFS on alpha and armel.
+
+Forwarded: no
+Last-Update: 2010-07-01
+---
+ src/include/fann_cpp.h | 21 +++++++++++++++------
+ 1 files changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/include/fann_cpp.h b/src/include/fann_cpp.h
+index eb647af..bf6e75b 100644
+--- a/src/include/fann_cpp.h
++++ b/src/include/fann_cpp.h
+@@ -916,9 +916,12 @@ public:
+ bool create_standard(unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_standard_array(num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_standard_array(num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+@@ -966,9 +969,12 @@ public:
+ bool create_sparse(float connection_rate, unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_sparse_array(connection_rate, num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_sparse_array(connection_rate, num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+@@ -1013,9 +1019,12 @@ public:
+ bool create_shortcut(unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_shortcut_array(num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_shortcut_array(num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+--
diff --git a/sci-mathematics/fann/files/fann-2.2.0-examples.patch b/sci-mathematics/fann/files/fann-2.2.0-examples.patch
new file mode 100644
index 00000000000..bfab1702218
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-2.2.0-examples.patch
@@ -0,0 +1,23 @@
+--- examples/Makefile.orig 2012-01-24 05:31:40.000000000 +0000
++++ examples/Makefile 2012-05-08 19:00:08.000000000 +0100
+@@ -1,7 +1,6 @@
+ # This makefile is on purpose not made with configure, to show how to use the library
+ # The make file requires that the fann library is installed (see ../README)
+
+-GCC=gcc
+
+ TARGETS = xor_train xor_test xor_test_fixed simple_train steepness_train simple_test robot mushroom cascade_train scaling_test scaling_train
+ DEBUG_TARGETS = xor_train_debug xor_test_debug xor_test_fixed_debug cascade_train_debug
+@@ -9,10 +8,10 @@
+ all: $(TARGETS)
+
+ %: %.c Makefile
+- $(GCC) -O3 $< -o $@ -lfann -lm
++ $(CC) $(CFLAGS) $< -lfann -lm -o $@
+
+ %_fixed: %.c Makefile
+- $(GCC) -O3 -DFIXEDFANN $< -o $@ -lfixedfann -lm
++ $(CC) $(CFLAGS) -DFIXEDFANN $< -lfixedfann -lm -o $@
+
+ clean:
+ rm -f $(TARGETS) $(DEBUG_TARGETS) xor_fixed.data *.net *~ *.obj *.exe *.tds noscale.txt withscale.txt scale_test_results.txt
diff --git a/sci-mathematics/fann/metadata.xml b/sci-mathematics/fann/metadata.xml
new file mode 100644
index 00000000000..dd80fbec92e
--- /dev/null
+++ b/sci-mathematics/fann/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-mathematics</herd>
+ <longdescription lang="en">
+ Fast Artificial Neural Network Library implements multilayer artificial
+ neural networks in C with support for both fully connected and sparsely
+ connected networks. Cross-platform execution in both fixed and floating
+ point are supported. It includes a framework for easy handling of
+ training data sets. It is easy to use, versatile, well documented, and
+ fast. Delphi, PHP, Python and other bindings are available.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">fann</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/flint/Manifest b/sci-mathematics/flint/Manifest
new file mode 100644
index 00000000000..959bebfbf32
--- /dev/null
+++ b/sci-mathematics/flint/Manifest
@@ -0,0 +1,4 @@
+DIST flint-2.3.tar.gz 830837 SHA256 6bb059048f822dc9291567949f1baed8c77f337ff2601e91a8e9d20936291a75 SHA512 8b5cb41ef9616c984554f7085dcd914d8d91b0f8b3964939c740336e79cfcc6e81fc9135084845615f56429952a4fc0eb3960c6df13d5f779c997c3b53763e56 WHIRLPOOL 12ee4c4e6efadbe2913783fcfe7583f084c6c10777e04293de6748cf177423f7652e5cd8bcdd0f412be73a40f4c5fc744a84c0de89f6c1ff527c20e55e102258
+DIST flint-2.4.3.tar.gz 1636527 SHA256 93585cd321c5a2fad053c903ba7cd947f54de71d31cf1dd1af6814906c1ee763 SHA512 d7cecb7116c458f554e09524b9df25784ed32f889a4d83a3fc6fbf16f08ace68890b3a748a8b1b03e543c121994ed7e5efbdca9e7dbb694a4571c8d25e983aa9 WHIRLPOOL 4ec1ce3447218c9a45a9548284b7948714327bf264e9087d7c0687936a586cb96eb921079770d78c482af158ca78c65193ccbf489a789771ae527eed4d75d588
+DIST flint-2.4.4.tar.gz 1639262 SHA256 c4799e9394ef06d7b8625f7fd74ba2d8ca115dbb2aa506dcc6e369b49d0e5bc7 SHA512 236997cf64bdc96741740889f450fdbaf7d7e9b58252645f864d28005c9e7bdf87f7187cd17526606c605f0489f026398a1361b8f209f71158ca3b31c42d86d2 WHIRLPOOL 299820bc656e955d54dd06be3a1ba68440e8d9c72785ac54e7d9559da073b31c07b73598c9b18c98889f836dfd25ed8cd96d62a901a12a529698ae00ba30f1d1
+DIST flint-2.4.5.tar.gz 1640022 SHA256 e489354df00f0d84976ccdd0477028693977c87ccd14f3924a89f848bb0e01e3 SHA512 088ff512ea2330f9323a6ca0dc875e8c0926d755317d6007eba4b333a14d7612e82ebcfeabd26d1ec4b9204c4517dee08f914ad1ec852e37336fe378710a8bfc WHIRLPOOL cf5a22a9353cc23f1ab056cf6737d61d8de91ab0dc0c4a2ae46cf0777abee240a49f76de15bf854a8275023735101ce306789bca9a052151b09017e02d111069
diff --git a/sci-mathematics/flint/files/flint-2.4.3-cflags-ldflags.patch b/sci-mathematics/flint/files/flint-2.4.3-cflags-ldflags.patch
new file mode 100644
index 00000000000..f0a2ec8531b
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.3-cflags-ldflags.patch
@@ -0,0 +1,33 @@
+commit afadc8d05674a0e3e2fcf6dfbcf5f3c8f9133119
+Author: hasufell <hasufell@hasufell.de>
+Date: Sun May 18 19:32:59 2014 +0200
+
+ Respect CFLAGS/CXXFLAGS/LDFLAGS, fixes #66
+
+ Even in linking command CFLAGS should be respected, no matter
+ if all objects have already been compiled or not. Some flags
+ affect both linking and object compilation and users shouldn't
+ be required to figure them out. This is standard in most build
+ systems anyway.
+
+ Reorderd the linker line a bit, so it matches common practice,
+ although this doesn't matter technically (except that LDFLAGS
+ must go before libraries we link against).
+
+diff --git a/Makefile.in b/Makefile.in
+index a522ac1..6dda689 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -104,10 +104,10 @@ $(FLINT_LIB): $(LOBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) |
+ $(AT)$(foreach dir, $(BUILD_DIRS), mkdir -p build/$(dir); BUILD_DIR=../build/$(dir); export BUILD_DIR; MOD_DIR=$(dir); export MOD_DIR; $(MAKE) -f ../Makefile.subdirs -C $(dir) shared || exit $$?;)
+ $(AT)if [ "$(WANT_NTL)" -eq "1" ]; then \
+ $(MAKE) build/interfaces/NTL-interface.lo; \
+- $(CXX) $(ABI_FLAG) -shared $(EXTRA_SHARED_FLAGS) build/interfaces/NTL-interface.lo $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) $(LIBS2) -o $(FLINT_LIB); \
++ $(CXX) $(CXXFLAGS) $(ABI_FLAG) -shared $(EXTRA_SHARED_FLAGS) build/interfaces/NTL-interface.lo $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) -o $(FLINT_LIB) $(LDFLAGS) $(LIBS2); \
+ fi
+ $(AT)if [ "$(WANT_NTL)" -ne "1" ]; then \
+- $(CC) $(ABI_FLAG) -shared $(EXTRA_SHARED_FLAGS) $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) $(LIBS2) -o $(FLINT_LIB); \
++ $(CC) $(CFLAGS) $(ABI_FLAG) -shared $(EXTRA_SHARED_FLAGS) $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) -o $(FLINT_LIB) $(LDFLAGS) $(LIBS2); \
+ fi
+
+ libflint.a: $(OBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) | build build/interfaces
diff --git a/sci-mathematics/flint/files/flint-2.4.3-libdir.patch b/sci-mathematics/flint/files/flint-2.4.3-libdir.patch
new file mode 100644
index 00000000000..a569be40b8b
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.3-libdir.patch
@@ -0,0 +1,44 @@
+From 27eb23c1844029ee64907500bd8aa87097ffcd32 Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@hasufell.de>
+Date: Sun, 18 May 2014 18:46:24 +0200
+Subject: [PATCH] Allow to control LIBDIR
+
+Some distributions have lib32/lib64 and need to control
+the destination properly.
+---
+ Makefile.in | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c16f838..b6ea4c9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -4,6 +4,8 @@ else
+ $(DLPATH):=$(DLPATH_ADD)
+ endif
+
++LIBDIR=lib
++
+ QUIET_CC = @echo ' ' CC ' ' $@;
+ QUIET_CXX = @echo ' ' CXX ' ' $@;
+ QUIET_AR = @echo ' ' AR ' ' $@;
+@@ -169,13 +171,13 @@ else
+ endif
+
+ install: library
+- mkdir -p $(DESTDIR)$(PREFIX)/lib
++ mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/include/flint
+ $(AT)if [ "$(FLINT_SHARED)" -eq "1" ]; then \
+- cp $(FLINT_LIB) $(DESTDIR)$(PREFIX)/lib; \
++ cp $(FLINT_LIB) $(DESTDIR)$(PREFIX)/$(LIBDIR); \
+ fi
+ $(AT)if [ "$(FLINT_STATIC)" -eq "1" ]; then \
+- cp libflint.a $(DESTDIR)$(PREFIX)/lib; \
++ cp libflint.a $(DESTDIR)$(PREFIX)/$(LIBDIR); \
+ fi
+ cp $(HEADERS) $(DESTDIR)$(PREFIX)/include/flint
+ $(AT)if [ ! -z $(EXT_HEADERS) ]; then \
+--
+1.9.3
+
diff --git a/sci-mathematics/flint/files/flint-2.4.3-whitespaces.patch b/sci-mathematics/flint/files/flint-2.4.3-whitespaces.patch
new file mode 100644
index 00000000000..3d63aedeab3
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.3-whitespaces.patch
@@ -0,0 +1,54 @@
+From 3506d617ef9dfc5184aa99be05a25e4f73d6c3f6 Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@hasufell.de>
+Date: Sun, 18 May 2014 18:47:27 +0200
+Subject: [PATCH] Quote variables that could contain whitespaces
+
+Make does NOT take care of this in this context. It's
+not a variable assignment and installation would fail
+if DESTDIR contains any whitespace.
+---
+ Makefile.in | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index b6ea4c9..a522ac1 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -171,23 +171,23 @@ else
+ endif
+
+ install: library
+- mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR)
+- mkdir -p $(DESTDIR)$(PREFIX)/include/flint
++ mkdir -p "$(DESTDIR)$(PREFIX)/$(LIBDIR)"
++ mkdir -p "$(DESTDIR)$(PREFIX)/include/flint"
+ $(AT)if [ "$(FLINT_SHARED)" -eq "1" ]; then \
+- cp $(FLINT_LIB) $(DESTDIR)$(PREFIX)/$(LIBDIR); \
++ cp $(FLINT_LIB) "$(DESTDIR)$(PREFIX)/$(LIBDIR)"; \
+ fi
+ $(AT)if [ "$(FLINT_STATIC)" -eq "1" ]; then \
+- cp libflint.a $(DESTDIR)$(PREFIX)/$(LIBDIR); \
++ cp libflint.a "$(DESTDIR)$(PREFIX)/$(LIBDIR)"; \
+ fi
+- cp $(HEADERS) $(DESTDIR)$(PREFIX)/include/flint
++ cp $(HEADERS) "$(DESTDIR)$(PREFIX)/include/flint"
+ $(AT)if [ ! -z $(EXT_HEADERS) ]; then \
+- cp $(EXT_HEADERS) $(DESTDIR)$(PREFIX)/include/flint; \
++ cp $(EXT_HEADERS) "$(DESTDIR)$(PREFIX)/include/flint"; \
+ fi
+- mkdir -p $(DESTDIR)$(FLINT_CPIMPORT_DIR)
+- cp qadic/CPimport.txt $(DESTDIR)$(FLINT_CPIMPORT_DIR)
+- mkdir -p $(DESTDIR)$(PREFIX)/include/flint/flintxx
+- cp flintxx/*.h $(DESTDIR)$(PREFIX)/include/flint/flintxx
+- cp *xx.h $(DESTDIR)$(PREFIX)/include/flint
++ mkdir -p "$(DESTDIR)$(FLINT_CPIMPORT_DIR)"
++ cp qadic/CPimport.txt "$(DESTDIR)$(FLINT_CPIMPORT_DIR)"
++ mkdir -p "$(DESTDIR)$(PREFIX)/include/flint/flintxx"
++ cp flintxx/*.h "$(DESTDIR)$(PREFIX)/include/flint/flintxx"
++ cp *xx.h "$(DESTDIR)$(PREFIX)/include/flint"
+
+ build:
+ mkdir -p build
+--
+1.9.3
+
diff --git a/sci-mathematics/flint/files/flint-2.4.4-test.patch b/sci-mathematics/flint/files/flint-2.4.4-test.patch
new file mode 100644
index 00000000000..11b7cfe2111
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.4-test.patch
@@ -0,0 +1,19 @@
+commit 5e3d4a0504158f70d227e7cfc03985fe9a646797
+Author: hasufell <hasufell@hasufell.de>
+Date: Wed Jul 2 12:58:50 2014 +0200
+
+ Fix NTL test build
+
+diff --git a/Makefile.in b/Makefile.in
+index 6dda689..e9de7da 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -214,7 +214,7 @@ build/interfaces/NTL-interface.o: interfaces/NTL-interface.cpp NTL-interface.h
+ $(QUIET_CXX) $(CXX) $(CFLAGS) $(INCS) -c $< -o $@;
+
+ build/interfaces/test/t-NTL-interface$(EXEEXT): interfaces/test/t-NTL-interface.cpp
+- $(QUIET_CXX) $(CXX) $(CFLAGS) $(INCS) $< build/interfaces/NTL-interface.o -o $@ $(LIBS);
++ $(QUIET_CXX) $(CXX) $(CFLAGS) $(INCS) $< build/interfaces/NTL-interface.lo -o $@ $(LIBS);
+
+ print-%:
+ @echo '$*=$($*)'
diff --git a/sci-mathematics/flint/files/flint-2.4.5-gmp6-compat.patch b/sci-mathematics/flint/files/flint-2.4.5-gmp6-compat.patch
new file mode 100644
index 00000000000..559cbe51fb2
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.5-gmp6-compat.patch
@@ -0,0 +1,115 @@
+From a7f911140e7d0a0125653a40aa2c5fe257bd78f5 Mon Sep 17 00:00:00 2001
+From: Fredrik Johansson <fredrik.johansson@gmail.com>
+Date: Thu, 18 Sep 2014 14:49:05 +0200
+Subject: [PATCH] redefine fmpz_invmod to consider any integer invertible mod 1
+ (for gmp 6.0 compatibility)
+
+---
+ fmpz/doc/fmpz.txt | 3 ++-
+ fmpz/invmod.c | 11 +++++++++--
+ fmpz/test/t-invmod.c | 21 +++++++++++++++++----
+ 3 files changed, 28 insertions(+), 7 deletions(-)
+
+diff --git a/fmpz/doc/fmpz.txt b/fmpz/doc/fmpz.txt
+index fb422d8..2ada719 100644
+--- a/fmpz/doc/fmpz.txt
++++ b/fmpz/doc/fmpz.txt
+@@ -899,7 +899,8 @@ int fmpz_invmod(fmpz_t f, const fmpz_t g, const fmpz_t h)
+ Sets $f$ to the inverse of $g$ modulo $h$. The value of $h$ may
+ not be $0$ otherwise an exception results. If the inverse exists
+ the return value will be non-zero, otherwise the return value will
+- be $0$ and the value of $f$ undefined.
++ be $0$ and the value of $f$ undefined. As a special case, we
++ consider any number invertible modulo $h = \pm 1$, with inverse 0.
+
+ void fmpz_negmod(fmpz_t f, const fmpz_t g, const fmpz_t h)
+
+diff --git a/fmpz/invmod.c b/fmpz/invmod.c
+index a0cf601..0e20f39 100644
+--- a/fmpz/invmod.c
++++ b/fmpz/invmod.c
+@@ -67,7 +67,11 @@ fmpz_invmod(fmpz_t f, const fmpz_t g, const fmpz_t h)
+ if (c2 < WORD(0))
+ c2 = -c2;
+ if (c2 == WORD(1))
+- return 0; /* special case not handled by n_invmod */
++ {
++ fmpz_zero(f);
++ return 1; /* special case not handled by n_invmod */
++ }
++
+ gcd = z_gcdinv(&inv, c1, c2);
+
+ return (gcd == UWORD(1) ? fmpz_set_si(f, inv), 1 : 0);
+@@ -106,7 +110,10 @@ fmpz_invmod(fmpz_t f, const fmpz_t g, const fmpz_t h)
+ if (c2 < WORD(0))
+ c2 = -c2;
+ if (c2 == WORD(1))
+- return 0; /* special case not handled by z_gcd_invert */
++ {
++ fmpz_zero(f);
++ return 1; /* special case not handled by z_gcd_invert */
++ }
+ /* reduce g mod h first */
+
+ r = flint_mpz_fdiv_ui(COEFF_TO_PTR(c1), c2);
+diff --git a/fmpz/test/t-invmod.c b/fmpz/test/t-invmod.c
+index aea236e..8ff1c7f 100644
+--- a/fmpz/test/t-invmod.c
++++ b/fmpz/test/t-invmod.c
+@@ -30,6 +30,19 @@
+ #include "ulong_extras.h"
+ #include "fmpz.h"
+
++/* Use the definiton of GMP versions >= 6.0 */
++int
++mpz_invert2(mpz_t a, const mpz_t b, const mpz_t c)
++{
++ if (mpz_cmpabs_ui(c, 1) == 0)
++ {
++ mpz_set_ui(a, 0);
++ return 1;
++ }
++ else
++ return mpz_invert(a, b, c);
++}
++
+ int
+ main(void)
+ {
+@@ -63,7 +76,7 @@ main(void)
+ fmpz_get_mpz(e, b);
+
+ r1 = fmpz_invmod(c, a, b);
+- r2 = mpz_invert(f, d, e);
++ r2 = mpz_invert2(f, d, e);
+
+ fmpz_get_mpz(g, c);
+
+@@ -106,7 +119,7 @@ main(void)
+ fmpz_get_mpz(d, a);
+
+ r1 = fmpz_invmod(c, a, a);
+- r2 = mpz_invert(f, d, d);
++ r2 = mpz_invert2(f, d, d);
+
+ fmpz_get_mpz(g, c);
+
+@@ -149,7 +162,7 @@ main(void)
+ fmpz_get_mpz(e, b);
+
+ r1 = fmpz_invmod(a, a, b);
+- r2 = mpz_invert(f, d, e);
++ r2 = mpz_invert2(f, d, e);
+
+ fmpz_get_mpz(g, a);
+
+@@ -192,7 +205,7 @@ main(void)
+ fmpz_get_mpz(e, b);
+
+ r1 = fmpz_invmod(b, a, b);
+- r2 = mpz_invert(f, d, e);
++ r2 = mpz_invert2(f, d, e);
+
+ fmpz_get_mpz(g, b);
+
diff --git a/sci-mathematics/flint/files/flint-2.4.5-ntl62.patch b/sci-mathematics/flint/files/flint-2.4.5-ntl62.patch
new file mode 100644
index 00000000000..e08fa774e29
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-2.4.5-ntl62.patch
@@ -0,0 +1,13 @@
+diff -druN flint-2.5.orig/interfaces/NTL-interface.cpp flint-2.5/interfaces/NTL-interface.cpp
+--- flint-2.5.orig/interfaces/NTL-interface.cpp 2014-07-16 07:50:40.000000000 -0700
++++ flint-2.5/interfaces/NTL-interface.cpp 2014-08-26 07:51:55.585884615 -0700
+@@ -32,9 +32,7 @@
+ #include <NTL/ZZ.h>
+ #include <NTL/ZZX.h>
+ #include <NTL/mat_ZZ.h>
+-#include <NTL/lip.h>
+ #include <NTL/ctools.h>
+-#include <NTL/g_lip.h>
+ #include <gmp.h>
+
+ #include "flint.h"
diff --git a/sci-mathematics/flint/flint-2.3.ebuild b/sci-mathematics/flint/flint-2.3.ebuild
new file mode 100644
index 00000000000..92e95534745
--- /dev/null
+++ b/sci-mathematics/flint/flint-2.3.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 multilib
+
+DESCRIPTION="Fast Library for Number Theory"
+HOMEPAGE="http://www.flintlib.org/"
+SRC_URI="http://www.flintlib.org/${P}.tar.gz"
+
+RESTRICT="mirror"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/mpfr
+ dev-libs/ntl
+ sci-libs/mpir
+ "
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Correct lib paths to be multilib-proper #470732
+ sed -i -e 's~/lib~/'$(get_libdir)'~' Makefile.in || die
+}
+
+src_configure() {
+ # handwritten script, needs extra stabbing
+ ./configure --with-mpir=/usr --with-mpfr=/usr --with-ntl=/usr --prefix="${D}/usr" || die
+}
diff --git a/sci-mathematics/flint/flint-2.4.3.ebuild b/sci-mathematics/flint/flint-2.4.3.ebuild
new file mode 100644
index 00000000000..37a89b8a6ad
--- /dev/null
+++ b/sci-mathematics/flint/flint-2.4.3.ebuild
@@ -0,0 +1,62 @@
+# 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="Fast Library for Number Theory"
+HOMEPAGE="http://www.flintlib.org/"
+SRC_URI="http://www.flintlib.org/${P}.tar.gz"
+
+RESTRICT="mirror"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gc ntl static-libs test"
+
+RDEPEND="dev-libs/gmp
+ dev-libs/mpfr
+ gc? ( dev-libs/boehm-gc )
+ ntl? ( dev-libs/ntl )"
+DEPEND="${RDEPEND}
+ doc? ( app-text/texlive-core )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.3-libdir.patch \
+ "${FILESDIR}"/${PN}-2.4.3-whitespaces.patch \
+ "${FILESDIR}"/${PN}-2.4.3-cflags-ldflags.patch
+}
+
+src_configure() {
+ ./configure \
+ --prefix="${EPREFIX}/usr" \
+ --with-gmp="${EPREFIX}/usr" \
+ --with-mpfr="${EPREFIX}/usr" \
+ $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
+ $(use_enable static-libs static) \
+ $(usex gc "--with-gc=${EPREFIX}/usr" "") \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ AR=$(tc-getAR) \
+ || die
+}
+
+src_compile() {
+ emake verbose
+
+ if use doc ; then
+ emake -C doc/latex
+ fi
+}
+
+src_test() {
+ emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
+}
+
+src_install() {
+ emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
+ einstalldocs
+ use doc && dodoc doc/latex/flint-manual.pdf
+}
diff --git a/sci-mathematics/flint/flint-2.4.4-r1.ebuild b/sci-mathematics/flint/flint-2.4.4-r1.ebuild
new file mode 100644
index 00000000000..ebd73600599
--- /dev/null
+++ b/sci-mathematics/flint/flint-2.4.4-r1.ebuild
@@ -0,0 +1,67 @@
+# 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="Fast Library for Number Theory"
+HOMEPAGE="http://www.flintlib.org/"
+SRC_URI="http://www.flintlib.org/${P}.tar.gz"
+
+RESTRICT="mirror"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc gc ntl static-libs test"
+
+RDEPEND="dev-libs/gmp
+ dev-libs/mpfr
+ gc? ( dev-libs/boehm-gc )
+ ntl? ( dev-libs/ntl )"
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/texlive-core
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.3-libdir.patch \
+ "${FILESDIR}"/${PN}-2.4.3-whitespaces.patch \
+ "${FILESDIR}"/${PN}-2.4.3-cflags-ldflags.patch \
+ "${FILESDIR}"/${PN}-2.4.4-test.patch
+}
+
+src_configure() {
+ ./configure \
+ --prefix="${EPREFIX}/usr" \
+ --with-gmp="${EPREFIX}/usr" \
+ --with-mpfr="${EPREFIX}/usr" \
+ $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
+ $(use_enable static-libs static) \
+ $(usex gc "--with-gc=${EPREFIX}/usr" "") \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ AR=$(tc-getAR) \
+ || die
+}
+
+src_compile() {
+ emake verbose
+
+ if use doc ; then
+ emake -C doc/latex
+ fi
+}
+
+src_test() {
+ emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
+}
+
+src_install() {
+ emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
+ einstalldocs
+ use doc && dodoc doc/latex/flint-manual.pdf
+}
diff --git a/sci-mathematics/flint/flint-2.4.5.ebuild b/sci-mathematics/flint/flint-2.4.5.ebuild
new file mode 100644
index 00000000000..a1da9e67987
--- /dev/null
+++ b/sci-mathematics/flint/flint-2.4.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"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Fast Library for Number Theory"
+HOMEPAGE="http://www.flintlib.org/"
+SRC_URI="http://www.flintlib.org/${P}.tar.gz"
+
+RESTRICT="mirror"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gc ntl static-libs test"
+
+RDEPEND="dev-libs/gmp
+ dev-libs/mpfr
+ gc? ( dev-libs/boehm-gc )
+ ntl? ( dev-libs/ntl )"
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/texlive-core
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.3-libdir.patch \
+ "${FILESDIR}"/${PN}-2.4.3-whitespaces.patch \
+ "${FILESDIR}"/${PN}-2.4.3-cflags-ldflags.patch \
+ "${FILESDIR}"/${PN}-2.4.4-test.patch \
+ "${FILESDIR}"/${PN}-2.4.5-gmp6-compat.patch \
+ "${FILESDIR}"/${PN}-2.4.5-ntl62.patch
+}
+
+src_configure() {
+ ./configure \
+ --prefix="${EPREFIX}/usr" \
+ --with-gmp="${EPREFIX}/usr" \
+ --with-mpfr="${EPREFIX}/usr" \
+ $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
+ $(use_enable static-libs static) \
+ $(usex gc "--with-gc=${EPREFIX}/usr" "") \
+ CC=$(tc-getCC) \
+ CXX=$(tc-getCXX) \
+ AR=$(tc-getAR) \
+ || die
+}
+
+src_compile() {
+ emake verbose
+
+ if use doc ; then
+ emake -C doc/latex
+ fi
+}
+
+src_test() {
+ emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
+}
+
+src_install() {
+ emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
+ einstalldocs
+ use doc && dodoc doc/latex/flint-manual.pdf
+}
diff --git a/sci-mathematics/flint/metadata.xml b/sci-mathematics/flint/metadata.xml
new file mode 100644
index 00000000000..98dccf28e26
--- /dev/null
+++ b/sci-mathematics/flint/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>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <upstream>
+ <remote-id type='github'>wbhart/flint2</remote-id>
+ </upstream>
+ <use>
+ <flag name='gc'>Enable garbage collection
+ support via <pkg>dev-libs/boehm-gc</pkg></flag>
+ <flag name='ntl'>Build NTL interface</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/form/Manifest b/sci-mathematics/form/Manifest
new file mode 100644
index 00000000000..93a5895b3d2
--- /dev/null
+++ b/sci-mathematics/form/Manifest
@@ -0,0 +1 @@
+DIST form-4.1.tar.gz 1260530 SHA256 fb3470937d66ed5cb1af896b15058836d2c805d767adac1b9073ed2df731cbe9 SHA512 39ab2fa1e448d6d5e427cc2c92285cc27f84724addffc378f3b799fc2b3f6381b8dceb87cb980062b980885d8d81591c5c7ff7b0dbeae7b6d9a3cf0b03d58aae WHIRLPOOL 1950ebc2357a78bf7430dd35852ab538e14b2ec68df8e9d11d7adcc31c365c14175c91bee984458794346a3b66b0580bea8625eeeff8c9c0f2045bab2bb1b5f8
diff --git a/sci-mathematics/form/form-4.1.ebuild b/sci-mathematics/form/form-4.1.ebuild
new file mode 100644
index 00000000000..b035f003dc6
--- /dev/null
+++ b/sci-mathematics/form/form-4.1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="Symbolic Manipulation System"
+HOMEPAGE="http://www.nikhef.nl/~form/"
+SRC_URI="http://www.nikhef.nl/~form/maindir/binaries/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="devref doc doxygen gmp mpi threads zlib"
+
+RDEPEND="
+ gmp? ( dev-libs/gmp )
+ mpi? ( virtual/mpi )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ devref? ( dev-texlive/texlive-latex )
+ doc? ( dev-texlive/texlive-latex )
+ doxygen? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -i 's/LINKFLAGS = -s/LINKFLAGS =/' sources/Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --enable-scalar \
+ --enable-largefile \
+ --disable-debug \
+ --disable-static-link \
+ --with-api=posix \
+ $(use_with gmp ) \
+ $(use_enable mpi parform ) \
+ $(use_enable threads threaded ) \
+ $(use_with zlib ) \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}"
+}
+
+src_compile() {
+ default
+ if use devref; then
+ pushd doc/devref > /dev/null || die "doc/devref does not exist"
+ LANG=C emake pdf
+ popd > /dev/null
+ fi
+ if use doc; then
+ pushd doc/manual > /dev/null || die "doc/manual does not exist"
+ LANG=C emake pdf
+ popd > /dev/null
+ fi
+ if use doxygen; then
+ pushd doc/doxygen > /dev/null || die "doc/doxygen does not exist"
+ emake html
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+ if use devref; then
+ insinto /usr/share/doc/${PF}
+ doins doc/devref/devref.pdf
+ fi
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins doc/manual/manual.pdf
+ fi
+ if use doxygen; then
+ dohtml -r doc/doxygen/html/*
+ fi
+}
diff --git a/sci-mathematics/form/metadata.xml b/sci-mathematics/form/metadata.xml
new file mode 100644
index 00000000000..05d73a9db6b
--- /dev/null
+++ b/sci-mathematics/form/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-mathematics</herd>
+ <longdescription lang="en">
+A system which can efficiently manipulate huge formulas limited only by available disk space.
+</longdescription>
+ <use>
+ <flag name="devref">Build and install developers reference</flag>
+ <flag name="doxygen">Build and install API documentation</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/freemat/Manifest b/sci-mathematics/freemat/Manifest
new file mode 100644
index 00000000000..c794a4aef3a
--- /dev/null
+++ b/sci-mathematics/freemat/Manifest
@@ -0,0 +1 @@
+DIST FreeMat-4.2-Source.tar.gz 106222549 SHA256 5f56dc18458da72fb8143d47faeb7a66fa104f8ac9160558e032f6d2d68c9ffb SHA512 85f56ab910358bac63bb50d9ef8fac51a486c32ffc246b47aea02fc6a629c36f0cd8d55feb755c4697530a87cf08fa8cc7b69ebde0f09535561014ea280b902a WHIRLPOOL 94b72375f451afd3da6bc756b9fa3e9a782edf8827a1b90f3d30723235df99c093ea7c4455b7d5cca1633f1d8d95302b237e0b389647ed242504626dd3f2c304
diff --git a/sci-mathematics/freemat/files/freemat-4.0-gcc45.patch b/sci-mathematics/freemat/files/freemat-4.0-gcc45.patch
new file mode 100644
index 00000000000..7492e16b783
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.0-gcc45.patch
@@ -0,0 +1,208 @@
+Fix building with gcc-4.5
+
+http://bugs.gentoo.org/show_bug.cgi?id=318045
+
+--- libs/libFreeMat/Array.cpp
++++ libs/libFreeMat/Array.cpp
+@@ -465,7 +465,7 @@
+
+ void Array::set(const QString& field, ArrayVector& data) {
+ if (isEmpty() && m_type.Class != Struct)
+- *this = Array::Array(Struct);
++ *this = Array(Struct);
+ if (m_type.Class != Struct) throw Exception("Unsupported type for A.field=B");
+ StructArray &rp(structPtr());
+ if (isEmpty())
+--- libs/libFreeMat/Math.cpp
++++ libs/libFreeMat/Math.cpp
+@@ -1590,9 +1590,9 @@
+
+ Array Not(const Array& A) {
+ if (A.isScalar())
+- return Array::Array(!A.toClass(Bool).constRealScalar<bool>());
++ return Array(!A.toClass(Bool).constRealScalar<bool>());
+ const Array &Abool(A.toClass(Bool));
+- return Array::Array(Apply(Abool.constReal<bool>(),notfunc));
++ return Array(Apply(Abool.constReal<bool>(),notfunc));
+ }
+
+ Array Plus(const Array& A) {
+--- libs/libFreeMat/Operators.hpp
++++ libs/libFreeMat/Operators.hpp
+@@ -142,11 +142,11 @@
+ if (!Bcast.isScalar()) Bcast = Bcast.asDenseArray();
+ if (Acast.isScalar() && Bcast.isScalar()) {
+ if (Acast.allReal() && Bcast.allReal()) {
+- F = Array::Array(Op::func(Acast.constRealScalar<T>(),
++ F = Array(Op::func(Acast.constRealScalar<T>(),
+ Bcast.constRealScalar<T>()));
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(T(0),T(0));
++ F = Array(T(0),T(0));
+ Op::func(Acast.constRealScalar<T>(),
+ Acast.constImagScalar<T>(),
+ Bcast.constRealScalar<T>(),
+@@ -155,7 +155,7 @@
+ }
+ } else if (Acast.isScalar()) {
+ if (Acast.allReal() && Bcast.allReal()) {
+- F = Array::Array(Tclass,Bcast.dimensions());
++ F = Array(Tclass,Bcast.dimensions());
+ T* ret = F.real<T>().data();
+ const T& Ap = Acast.constRealScalar<T>();
+ const T* Bp = Bcast.constReal<T>().constData();
+@@ -163,7 +163,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap,Bp[i]);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Tclass,Bcast.dimensions());
++ F = Array(Tclass,Bcast.dimensions());
+ T* Cr = F.real<T>().data();
+ T* Ci = F.imag<T>().data();
+ const T& Ar = Acast.constRealScalar<T>();
+@@ -175,7 +175,7 @@
+ }
+ } else if (Bcast.isScalar()) {
+ if (Bcast.allReal() && Acast.allReal()) {
+- F = Array::Array(Tclass,Acast.dimensions());
++ F = Array(Tclass,Acast.dimensions());
+ T* ret = F.real<T>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T& Bp = Bcast.constRealScalar<T>();
+@@ -183,7 +183,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap[i],Bp);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Tclass,Acast.dimensions());
++ F = Array(Tclass,Acast.dimensions());
+ T* Cr = F.real<T>().data();
+ T* Ci = F.imag<T>().data();
+ const T* Ar = Acast.constReal<T>().constData();
+@@ -197,7 +197,7 @@
+ if (Acast.dimensions() != Bcast.dimensions())
+ throw Exception("size mismatch in arguments to binary operator");
+ if (Bcast.allReal() && Acast.allReal()) {
+- F = Array::Array(Tclass,Acast.dimensions());
++ F = Array(Tclass,Acast.dimensions());
+ T* ret = F.real<T>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T* Bp = Bcast.constReal<T>().constData();
+@@ -205,7 +205,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap[i],Bp[i]);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Tclass,Acast.dimensions());
++ F = Array(Tclass,Acast.dimensions());
+ T* Cr = F.real<T>().data();
+ T* Ci = F.imag<T>().data();
+ const T* Ar = Acast.constReal<T>().constData();
+@@ -328,17 +328,17 @@
+ if (!Acast.isScalar()) Acast = Acast.asDenseArray();
+ if (!Bcast.isScalar()) Bcast = Bcast.asDenseArray();
+ if (Acast.isScalar() && Bcast.isScalar()) {
+- F = Array::Array(Op::func(Acast.constRealScalar<T>(),
++ F = Array(Op::func(Acast.constRealScalar<T>(),
+ Bcast.constRealScalar<T>()));
+ } else if (Acast.isScalar()) {
+- F = Array::Array(Bool,Bcast.dimensions());
++ F = Array(Bool,Bcast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T& Ap = Acast.constRealScalar<T>();
+ const T* Bp = Bcast.constReal<T>().constData();
+ uint64 q = uint64(Bcast.length());
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap,Bp[i]);
+ } else if (Bcast.isScalar()) {
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T& Bp = Bcast.constRealScalar<T>();
+@@ -347,7 +347,7 @@
+ } else {
+ if (Acast.dimensions() != Bcast.dimensions())
+ throw Exception("size mismatch in arguments to binary operator");
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T* Bp = Bcast.constReal<T>().constData();
+@@ -395,18 +395,18 @@
+ if (!Bcast.isScalar()) Bcast = Bcast.asDenseArray();
+ if (Acast.isScalar() && Bcast.isScalar()) {
+ if (Acast.allReal() && Bcast.allReal()) {
+- F = Array::Array(Op::func(Acast.constRealScalar<T>(),
++ F = Array(Op::func(Acast.constRealScalar<T>(),
+ Bcast.constRealScalar<T>()));
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Op::func(Acast.constRealScalar<T>(),
++ F = Array(Op::func(Acast.constRealScalar<T>(),
+ Acast.constImagScalar<T>(),
+ Bcast.constRealScalar<T>(),
+ Bcast.constImagScalar<T>()));
+ }
+ } else if (Acast.isScalar()) {
+ if (Acast.allReal() && Bcast.allReal()) {
+- F = Array::Array(Bool,Bcast.dimensions());
++ F = Array(Bool,Bcast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T& Ap = Acast.constRealScalar<T>();
+ const T* Bp = Bcast.constReal<T>().constData();
+@@ -414,7 +414,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap,Bp[i]);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Bool,Bcast.dimensions());
++ F = Array(Bool,Bcast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T& Ar = Acast.constRealScalar<T>();
+ const T& Ai = Acast.constImagScalar<T>();
+@@ -425,7 +425,7 @@
+ }
+ } else if (Bcast.isScalar()) {
+ if (Bcast.allReal() && Acast.allReal()) {
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T& Bp = Bcast.constRealScalar<T>();
+@@ -433,7 +433,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap[i],Bp);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ar = Acast.constReal<T>().constData();
+ const T* Ai = Acast.constImag<T>().constData();
+@@ -446,7 +446,7 @@
+ if (Acast.dimensions() != Bcast.dimensions())
+ throw Exception("size mismatch in arguments to binary operator");
+ if (Bcast.allReal() && Acast.allReal()) {
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ap = Acast.constReal<T>().constData();
+ const T* Bp = Bcast.constReal<T>().constData();
+@@ -454,7 +454,7 @@
+ for (uint64 i=0;i<q;i++) ret[i] = Op::func(Ap[i],Bp[i]);
+ } else {
+ Acast.forceComplex(); Bcast.forceComplex();
+- F = Array::Array(Bool,Acast.dimensions());
++ F = Array(Bool,Acast.dimensions());
+ bool* ret = F.real<bool>().data();
+ const T* Ar = Acast.constReal<T>().constData();
+ const T* Ai = Acast.constImag<T>().constData();
+@@ -533,9 +533,9 @@
+ if (!Acast.isScalar()) Acast = Acast.asDenseArray();
+ if (Acast.isScalar()) {
+ if (Acast.allReal()) {
+- F = Array::Array(Op::func(Acast.constRealScalar<T>()));
++ F = Array(Op::func(Acast.constRealScalar<T>()));
+ } else {
+- F = Array::Array(T(0),T(0));
++ F = Array(T(0),T(0));
+ Op::func(Acast.constRealScalar<T>(),
+ Acast.constImagScalar<T>(),
+ F.realScalar<T>(),F.imagScalar<T>());
diff --git a/sci-mathematics/freemat/files/freemat-4.0-no_implicit_GLU.patch b/sci-mathematics/freemat/files/freemat-4.0-no_implicit_GLU.patch
new file mode 100644
index 00000000000..dd3798bb8f6
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.0-no_implicit_GLU.patch
@@ -0,0 +1,14 @@
+error: 'gluProject' was not declared in this scope
+
+http://bugs.gentoo.org/402361
+
+--- libs/libGraphics/GLRenderEngine.cpp
++++ libs/libGraphics/GLRenderEngine.cpp
+@@ -20,6 +20,7 @@
+ #include <qimage.h>
+ #include <qpainter.h>
+ #include <QtOpenGL>
++#include <GL/glu.h>
+ #include <math.h>
+ #include "IEEEFP.hpp"
+
diff --git a/sci-mathematics/freemat/files/freemat-4.1-fixes.patch b/sci-mathematics/freemat/files/freemat-4.1-fixes.patch
new file mode 100644
index 00000000000..8ebb1bceb06
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-fixes.patch
@@ -0,0 +1,21 @@
+--- libs/libGraphics/VTKWindow.cpp.orig 2012-01-27 19:54:55.000000000 +0100
++++ libs/libGraphics/VTKWindow.cpp 2012-01-27 19:54:49.000000000 +0100
+@@ -3,6 +3,7 @@
+ #include "VTKWrap.hpp"
+ #include "VTKWindow.hpp"
+
++#include <QObject>
+ #include <QtCore/QString>
+ #include <QtGui/QLabel>
+ #include <QtGui/QMenu>
+--- libs/libGraphics/GLRenderEngine.cpp.orig 2011-11-27 00:27:43.000000000 +0000
++++ libs/libGraphics/GLRenderEngine.cpp 2012-01-29 03:57:48.453433954 +0000
+@@ -16,6 +16,8 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
++
++#include <GL/glu.h>
+ #include "GLRenderEngine.hpp"
+ #include <qimage.h>
+ #include <qpainter.h>
diff --git a/sci-mathematics/freemat/files/freemat-4.1-have_fftw.patch b/sci-mathematics/freemat/files/freemat-4.1-have_fftw.patch
new file mode 100644
index 00000000000..1415b3d716a
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-have_fftw.patch
@@ -0,0 +1,78 @@
+diff -rupN libs/libCore.orig/FFT.cpp libs/libCore/FFT.cpp
+--- libs/libCore.orig/FFT.cpp 2011-11-27 01:27:43.856779929 +0100
++++ libs/libCore/FFT.cpp 2012-01-30 00:14:18.682460150 +0100
+@@ -104,6 +104,7 @@ public:
+ #endif
+
+
++#if HAVE_FFTWF
+ class OpVecFFT {
+ WrapFFTWF fft_float;
+ WrapFFTW fft_double;
+@@ -169,7 +170,9 @@ public:
+ }
+ }
+ };
++#endif
+
++#if HAVE_FFTWF
+ class OpVecIFFT {
+ WrapFFTWF fft_float;
+ WrapFFTW fft_double;
+@@ -228,6 +231,7 @@ public:
+ }
+ }
+ };
++#endif
+
+ //!
+ //@Module FFT (Inverse) Fast Fourier Transform Function
+@@ -350,6 +354,8 @@ public:
+ //inputs x len dim
+ //outputs y
+ //!
++
++#if HAVE_FFTWF
+ ArrayVector FFTFunction(int nargout, const ArrayVector& arg) {
+ // Get the data argument
+ if (arg.size() < 1)
+@@ -384,7 +390,9 @@ ArrayVector FFTFunction(int nargout, con
+ OpVecFFT op(FFTLength);
+ return ArrayVector(VectorOpDynamic<OpVecFFT>(arg0,FFTLength,FFTDim,op));
+ }
++#endif
+
++#if HAVE_FFTWF
+ ArrayVector IFFTFunction(int nargout, const ArrayVector& arg) {
+ // Get the data argument
+ if (arg.size() < 1)
+@@ -419,3 +427,4 @@ ArrayVector IFFTFunction(int nargout, co
+ OpVecIFFT op(FFTLength);
+ return ArrayVector(VectorOpDynamic<OpVecIFFT>(arg0,FFTLength,FFTDim,op));
+ }
++#endif
+diff -rupN libs/libCore.orig/Loader.cpp libs/libCore/Loader.cpp
+--- libs/libCore.orig/Loader.cpp 2012-01-30 00:08:41.463155562 +0100
++++ libs/libCore/Loader.cpp 2012-01-30 00:12:24.422448304 +0100
+@@ -43,8 +43,10 @@ ArrayVector FeofFunction(int, const Arra
+ ArrayVector FseekFunction(int, const ArrayVector&);
+ ArrayVector FgetlineFunction(int, const ArrayVector&);
+ ArrayVector FscanfFunction(int, const ArrayVector&);
++#ifdef HAVE_FFTW
+ ArrayVector FFTFunction(int, const ArrayVector&);
+ ArrayVector IFFTFunction(int, const ArrayVector&);
++#endif
+ ArrayVector StrCmpFunction(int, const ArrayVector&);
+ ArrayVector StrCmpiFunction(int, const ArrayVector&);
+ ArrayVector StrnCmpFunction(int, const ArrayVector&);
+@@ -286,8 +288,10 @@ void LoadBuiltinFunctionsCore(Context *c
+ context->addFunction("fseek",FseekFunction,0,3,0,"handle","offset","style",NULL);
+ context->addFunction("fgetline",FgetlineFunction,0,1,1,"handle",NULL);
+ context->addFunction("fscanf",FscanfFunction,0,-1,-1,NULL);
++#ifdef HAVE_FFTW
+ context->addFunction("fft",FFTFunction,0,3,1,"x","len","dim",NULL);
+ context->addFunction("ifft",IFFTFunction,0,3,1,"x","len","dim",NULL);
++#endif
+ context->addFunction("strcmp",StrCmpFunction,0,2,1,"string1","string2",NULL);
+ context->addFunction("strcmpi",StrCmpiFunction,0,2,1,"string1","string2",NULL);
+ context->addFunction("strncmp",StrnCmpFunction,0,3,1,"string1","string2","len",NULL);
diff --git a/sci-mathematics/freemat/files/freemat-4.1-local_libffi.patch b/sci-mathematics/freemat/files/freemat-4.1-local_libffi.patch
new file mode 100644
index 00000000000..3fbfef9c951
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-local_libffi.patch
@@ -0,0 +1,13 @@
+--- CMakeLists.txt.orig 2011-11-27 01:27:11.116482600 +0100
++++ CMakeLists.txt 2012-01-29 17:09:54.072342306 +0100
+@@ -160,8 +160,8 @@ if(MINGW)
+ INCLUDE_DIRECTORIES(${FFI_INCLUDE_DIR})
+ INSTALL(FILES ${FFI_LIBRARY_DLL} DESTINATION bin )
+ else(MINGW)
+- FIND_LIBRARY(FFI_LIBRARY NAMES ffi DOC "Location of the FFI library" PATHS ${LOCAL_PATH})
+- FIND_PATH(FFI_INCLUDE_DIR ffi.h doc "Location of ffi.h" PATHS ${LOCAL_PATH} /usr/include/ffi /usr/lib64/libffi-3.0.9/include)
++ FIND_LIBRARY(FFI_LIBRARY NAMES ffi DOC "Location of the FFI library" PATHS ${LOCAL_PATH} ${PROJECT_SOURCE_DIR}/dependencies/libffi/build/.libs)
++ FIND_PATH(FFI_INCLUDE_DIR ffi.h doc "Location of ffi.h" PATHS ${LOCAL_PATH} /usr/include/ffi /usr/lib64/libffi-3.0.9/include ${PROJECT_SOURCE_DIR}/dependencies/libffi/build/include /mingw/include/ffi)
+ SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${FFI_LIBRARY})
+ INCLUDE_DIRECTORIES(${FFI_INCLUDE_DIR})
+ endif(MINGW)
diff --git a/sci-mathematics/freemat/files/freemat-4.1-portaudio.patch b/sci-mathematics/freemat/files/freemat-4.1-portaudio.patch
new file mode 100644
index 00000000000..518ccfbd133
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-portaudio.patch
@@ -0,0 +1,10 @@
+--- libs/thirdparty/portaudio/CMakeLists.txt.orig 2012-01-29 02:08:08.422664514 +0100
++++ libs/thirdparty/portaudio/CMakeLists.txt 2012-01-29 02:04:26.826460722 +0100
+@@ -73,6 +73,7 @@ IF (NOT WIN32 AND NOT APPLE)
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/common/pa_stream.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/common/pa_trace.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/hostapi/oss/pa_unix_oss.c
++ ${CMAKE_CURRENT_SOURCE_DIR}/src/hostapi/skeleton/pa_hostapi_skeleton.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/os/unix/pa_unix_hostapis.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/os/unix/pa_unix_util.c )
+ ENDIF (NOT WIN32 AND NOT APPLE)
diff --git a/sci-mathematics/freemat/files/freemat-4.1-python3.patch b/sci-mathematics/freemat/files/freemat-4.1-python3.patch
new file mode 100644
index 00000000000..a7aad97cfc7
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-python3.patch
@@ -0,0 +1,24 @@
+diff -Nur tools.orig/jitgen.py tools/jitgen.py
+--- tools.orig/jitgen.py 2012-04-13 00:25:18.000000000 +0100
++++ tools/jitgen.py 2012-04-13 00:25:40.000000000 +0100
+@@ -39,7 +39,7 @@
+ f.write("// \n\n// Here, each function gets prototyped.\n");
+ f.close()
+
+-os.path.walk(sys.argv[1], visit, '')
++os.walk(sys.argv[1], visit, '')
+
+ f = open(sys.argv[2],'a')
+ f.write("static const char* jit_scalar_list[] = {");
+diff -Nur tools.orig/siggen.py tools/siggen.py
+--- tools.orig/siggen.py 2012-04-13 00:25:18.000000000 +0100
++++ tools/siggen.py 2012-04-13 00:25:53.000000000 +0100
+@@ -81,7 +81,7 @@
+ function_name = fsplit[1]
+ function_internal_name = fsplit[2];
+ if (function_name == '') or (function_internal_name == ''):
+- print 'MISSING Function Name: <%s> <%s> <%s>'%(fline,function_name,function_internal_name)
++ print('MISSING Function Name: <%s> <%s> <%s>'%(fline,function_name,function_internal_name))
+ inputs = iline.split()
+ inputs = inputs[1:]
+ outputs = oline.split()
diff --git a/sci-mathematics/freemat/files/freemat-4.1-use_llvm.patch b/sci-mathematics/freemat/files/freemat-4.1-use_llvm.patch
new file mode 100644
index 00000000000..327aa30f09a
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.1-use_llvm.patch
@@ -0,0 +1,29 @@
+--- libs/libMatC/CMakeLists.txt.orig 2011-11-27 01:27:43.000000000 +0100
++++ libs/libMatC/CMakeLists.txt 2012-01-29 14:39:19.842402326 +0100
+@@ -1,10 +1,14 @@
+
+ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} )
+
++IF( USE_LLVM )
++ set(LLVM_SOURCES "CJitFuncClang.cpp")
++endif( USE_LLVM )
++
+ ADD_LIBRARY( MatC
+ JITFactory.cpp
+ CJitFunc.cpp
+- CJitFuncClang.cpp
++ ${LLVM_SOURCES}
+ CArray.cpp
+ )
+
+--- libs/libMatC.orig/JITFactory.cpp 2011-11-27 01:27:43.000000000 +0100
++++ libs/libMatC/JITFactory.cpp 2012-01-29 14:53:17.296686846 +0100
+@@ -1,5 +1,7 @@
+ #include "JITFactory.hpp"
+-#include "CJitFuncClang.hpp"
++#ifdef HAVE_LLVM
++# include "CJitFuncClang.hpp"
++#endif
+
+ JITFuncBase* JITFactory::GetJITFunc(Interpreter *eval)
+ {
diff --git a/sci-mathematics/freemat/files/freemat-4.2-use_llvm.patch b/sci-mathematics/freemat/files/freemat-4.2-use_llvm.patch
new file mode 100644
index 00000000000..c29b8694ddb
--- /dev/null
+++ b/sci-mathematics/freemat/files/freemat-4.2-use_llvm.patch
@@ -0,0 +1,45 @@
+--- libs/libMatC/CMakeLists.txt.orig 2011-11-27 01:27:43.000000000 +0100
++++ libs/libMatC/CMakeLists.txt 2012-01-29 14:39:19.842402326 +0100
+@@ -1,10 +1,14 @@
+
+ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} )
+
++IF( USE_LLVM )
++ set(LLVM_SOURCES "CJitFuncClang.cpp")
++endif( USE_LLVM )
++
+ ADD_LIBRARY( MatC
+ JITFactory.cpp
+ CJitFunc.cpp
+- CJitFuncClang.cpp
++ ${LLVM_SOURCES}
+ CArray.cpp
+ )
+
+--- libs/libMatC.orig/JITFactory.cpp 2011-11-27 01:27:43.000000000 +0100
++++ libs/libMatC/JITFactory.cpp 2012-01-29 14:53:17.296686846 +0100
+@@ -1,5 +1,7 @@
+ #include "JITFactory.hpp"
+-#include "CJitFuncClang.hpp"
++#ifdef HAVE_LLVM
++# include "CJitFuncClang.hpp"
++#endif
+
+ JITFuncBase* JITFactory::GetJITFunc(Interpreter *eval)
+ {
+--- CMakeLists.txt 2014-12-06 21:47:39.685839650 +0100
++++ CMakeLists.txt 2014-12-06 21:48:01.752127927 +0100
+@@ -249,9 +249,10 @@
+ # LLVM Support
+ ######################################################################
+ OPTION(USE_LLVM "Build with LLVM support?" ON)
+-
+-FIND_PACKAGE(LLVM)
+-FIND_PACKAGE(CLANG)
++IF(USE_LLVM)
++ FIND_PACKAGE(LLVM)
++ FIND_PACKAGE(CLANG)
++ENDIF()
+
+ IF (LLVM_FOUND AND CLANG_FOUND)
+ add_definitions(-DHAVE_LLVM)
diff --git a/sci-mathematics/freemat/freemat-4.2.ebuild b/sci-mathematics/freemat/freemat-4.2.ebuild
new file mode 100644
index 00000000000..a00f52f3a7e
--- /dev/null
+++ b/sci-mathematics/freemat/freemat-4.2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils cmake-utils fdo-mime
+
+MY_PN=FreeMat
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Environment for rapid engineering and scientific processing"
+HOMEPAGE="http://freemat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/freemat/${MY_P}-Source.tar.gz"
+
+IUSE="volpack vtk"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-libs/libpcre
+ media-libs/portaudio
+ sci-libs/arpack
+ sci-libs/fftw:3.0
+ sci-libs/matio
+ sci-libs/umfpack
+ sys-libs/ncurses
+ virtual/glu
+ virtual/lapack
+ virtual/libffi
+ virtual/opengl
+ dev-qt/qtgui:4
+ dev-qt/qtopengl:4
+ dev-qt/qtsvg:4
+ dev-qt/qtwebkit:4
+ volpack? ( media-libs/volpack )
+ vtk? ( sci-libs/vtk )"
+
+DEPEND="${RDEPEND}
+ dev-lang/python
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}-Source"
+
+src_prepare(){
+ epatch \
+ "${FILESDIR}"/${PN}-4.1-fixes.patch \
+ "${FILESDIR}"/${PN}-4.1-python3.patch \
+ "${FILESDIR}"/${P}-use_llvm.patch
+ rm -f CMakeCache.txt
+ find . -type f -name '*.moc.cpp' -exec rm -f {} \;
+ find . -type f -name 'add.so' -exec rm -f {} \;
+}
+
+src_configure() {
+ mycmakeargs+=(
+ -DFORCE_SYSTEM_LIBS=ON
+ -DUSE_LLVM=OFF
+ -DUSE_ITK=OFF
+ -DFFI_INCLUDE_DIR="$(pkg-config --cflags-only-I libffi | sed -e s/-I//)"
+ $(cmake-utils_use_with volpack VOLPACK)
+ $(cmake-utils_use_with vtk VTK)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install -j1
+ dodoc ChangeLog
+ newicon images/freemat_small_mod_64.png ${PN}.png
+ make_desktop_entry FreeMat FreeMat
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ elog "Before using ${MY_PN}, do (as a normal user)"
+ elog "FreeMat -i ${EROOT}usr/share/${MY_P}"
+ elog "Then start ${MY_PN}, choose Tools -> Path Tool,"
+ elog "select ${EROOT}usr/share/${MY_P}/toolbox and Add With Subfolders"
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-mathematics/freemat/metadata.xml b/sci-mathematics/freemat/metadata.xml
new file mode 100644
index 00000000000..380a6559bf4
--- /dev/null
+++ b/sci-mathematics/freemat/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-mathematics</herd>
+ <longdescription lang="en">
+ FreeMat is an open sources environment for rapid engineering and
+ scientific prototyping and data processing. It is similar to
+ commercial systems such as MATLAB from Mathworks. FreeMat includes a
+ codeless interface to external C/C++/FORTRAN code,
+ parallel/distributed algorithm development (via MPI), and plotting
+ and visualization capabilities.
+</longdescription>
+ <use>
+ <flag name="volpack">Add volume rendering via <pkg>media-libs/volpack</pkg></flag>
+ <flag name="vtk">Add 3D capabilities via <pkg>sci-libs/vtk</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">freemat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/fricas/Manifest b/sci-mathematics/fricas/Manifest
new file mode 100644
index 00000000000..524b685148d
--- /dev/null
+++ b/sci-mathematics/fricas/Manifest
@@ -0,0 +1,2 @@
+DIST fricas-1.2.5-full.tar.bz2 10153745 SHA256 842e85d2799fd5271957c0d306c243f9f9d9db791e781e848b430f17a11d5e57 SHA512 78e99c2b791d8680e939adf8dfde96d3b305c58e9333da1ae98e214b5fc9ca2d6c365c7857cb4e30a68aa5450c992973243e058e4d4a412f57ff37137bc19ba0 WHIRLPOOL 13e91e451ffa707c220704aa5d017df264806feaa6b1b52c03ddaecff57594d06fe957ae61e0c5a0f49e4f96fb6f420a99aac49279f4f9e0efa07a11bedac1cd
+DIST fricas-1.2.6-full.tar.bz2 10196018 SHA256 725b62d9139a345a3bc0eb0d29bd0e0764de475792918165c3bcd293d3c292ae SHA512 6c98844b6815bd6bfbe50881179b746aa38af48e3992179e3746bd175ef2a0940d9855e79b66b1b5e34d9fc9fe1b8f3578483847b18d7cc2781f7f72b65fb2ac WHIRLPOOL de221add1c68da205d8689834ccb52a0ea468af253ccae70ce7c25156b0ece810dcc50a9db99549ed461a10dcaea13f503c1f0838141262dd6c6d524a217be61
diff --git a/sci-mathematics/fricas/files/64fricas-gentoo.el b/sci-mathematics/fricas/files/64fricas-gentoo.el
new file mode 100644
index 00000000000..bc610ea8392
--- /dev/null
+++ b/sci-mathematics/fricas/files/64fricas-gentoo.el
@@ -0,0 +1,2 @@
+;; site-init for sci-mathematics/fricas
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/fricas")
diff --git a/sci-mathematics/fricas/fricas-1.2.5.ebuild b/sci-mathematics/fricas/fricas-1.2.5.ebuild
new file mode 100644
index 00000000000..a6701e5bcd7
--- /dev/null
+++ b/sci-mathematics/fricas/fricas-1.2.5.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+EAPI=5
+inherit multilib elisp-common
+
+DESCRIPTION="FriCAS is a fork of Axiom computer algebra system"
+HOMEPAGE="http://${PN}.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}-full.tar.bz2"
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Supported lisps, number 0 is the default
+LISPS=( sbcl cmucl gcl ecls clisp clozurecl )
+# command name: . means just ${LISP}
+COMS=( . lisp . ecl . ccl )
+
+IUSE="${LISPS[*]} X emacs gmp"
+RDEPEND="X? ( x11-libs/libXpm x11-libs/libICE )
+ emacs? ( virtual/emacs )
+ gmp? ( dev-libs/gmp )"
+
+# Generating lisp deps
+n=${#LISPS[*]}
+for ((n--; n > 0; n--)); do
+ LISP=${LISPS[$n]}
+ RDEPEND="${RDEPEND} ${LISP}? ( dev-lisp/${LISP}:= ) !${LISP}? ("
+done
+RDEPEND="${RDEPEND} dev-lisp/${LISPS[0]}:="
+n=${#LISPS[*]}
+for ((n--; n > 0; n--)); do
+ RDEPEND="${RDEPEND} )"
+done
+
+DEPEND="${RDEPEND}"
+
+# necessary for clisp and gcl
+RESTRICT="strip"
+
+src_configure() {
+ local LISP n
+ LISP=sbcl
+ n=${#LISPS[*]}
+ for ((n--; n > 0; n--)); do
+ if use ${LISPS[$n]}; then
+ LISP=${COMS[$n]}
+ if [ "${LISP}" = "." ]; then
+ LISP=${LISPS[$n]}
+ fi
+ fi
+ done
+ einfo "Using lisp: ${LISP}"
+
+ # aldor is not yet in portage
+ econf --disable-aldor --with-lisp=${LISP} $(use_with X x) $(use_with gmp)
+}
+
+src_compile() {
+ # bug #300132
+ emake -j1
+}
+
+src_test() {
+ emake -j1 all-input
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install
+ dodoc README FAQ
+
+ if use emacs; then
+ sed -e "s|(setq load-path (cons (quote \"/usr/$(get_libdir)/fricas/emacs\") load-path)) ||" \
+ -i "${D}"/usr/bin/efricas \
+ || die "sed efricas failed"
+ elisp-install ${PN} "${D}"/usr/$(get_libdir)/${PN}/emacs/*.el
+ elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
+ else
+ rm "${D}"/usr/bin/efricas || die "rm efricas failed"
+ fi
+ rm -r "${D}"/usr/$(get_libdir)/${PN}/emacs || die "rm -r emacs failed"
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/fricas/fricas-1.2.6.ebuild b/sci-mathematics/fricas/fricas-1.2.6.ebuild
new file mode 100644
index 00000000000..a6701e5bcd7
--- /dev/null
+++ b/sci-mathematics/fricas/fricas-1.2.6.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+EAPI=5
+inherit multilib elisp-common
+
+DESCRIPTION="FriCAS is a fork of Axiom computer algebra system"
+HOMEPAGE="http://${PN}.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}-full.tar.bz2"
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Supported lisps, number 0 is the default
+LISPS=( sbcl cmucl gcl ecls clisp clozurecl )
+# command name: . means just ${LISP}
+COMS=( . lisp . ecl . ccl )
+
+IUSE="${LISPS[*]} X emacs gmp"
+RDEPEND="X? ( x11-libs/libXpm x11-libs/libICE )
+ emacs? ( virtual/emacs )
+ gmp? ( dev-libs/gmp )"
+
+# Generating lisp deps
+n=${#LISPS[*]}
+for ((n--; n > 0; n--)); do
+ LISP=${LISPS[$n]}
+ RDEPEND="${RDEPEND} ${LISP}? ( dev-lisp/${LISP}:= ) !${LISP}? ("
+done
+RDEPEND="${RDEPEND} dev-lisp/${LISPS[0]}:="
+n=${#LISPS[*]}
+for ((n--; n > 0; n--)); do
+ RDEPEND="${RDEPEND} )"
+done
+
+DEPEND="${RDEPEND}"
+
+# necessary for clisp and gcl
+RESTRICT="strip"
+
+src_configure() {
+ local LISP n
+ LISP=sbcl
+ n=${#LISPS[*]}
+ for ((n--; n > 0; n--)); do
+ if use ${LISPS[$n]}; then
+ LISP=${COMS[$n]}
+ if [ "${LISP}" = "." ]; then
+ LISP=${LISPS[$n]}
+ fi
+ fi
+ done
+ einfo "Using lisp: ${LISP}"
+
+ # aldor is not yet in portage
+ econf --disable-aldor --with-lisp=${LISP} $(use_with X x) $(use_with gmp)
+}
+
+src_compile() {
+ # bug #300132
+ emake -j1
+}
+
+src_test() {
+ emake -j1 all-input
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install
+ dodoc README FAQ
+
+ if use emacs; then
+ sed -e "s|(setq load-path (cons (quote \"/usr/$(get_libdir)/fricas/emacs\") load-path)) ||" \
+ -i "${D}"/usr/bin/efricas \
+ || die "sed efricas failed"
+ elisp-install ${PN} "${D}"/usr/$(get_libdir)/${PN}/emacs/*.el
+ elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
+ else
+ rm "${D}"/usr/bin/efricas || die "rm efricas failed"
+ fi
+ rm -r "${D}"/usr/$(get_libdir)/${PN}/emacs || die "rm -r emacs failed"
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/fricas/metadata.xml b/sci-mathematics/fricas/metadata.xml
new file mode 100644
index 00000000000..f10acfb41f9
--- /dev/null
+++ b/sci-mathematics/fricas/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-mathematics</herd>
+ <maintainer>
+ <email>grozin@gentoo.org</email>
+ <name>Andrey Grozin</name>
+ </maintainer>
+ <longdescription lang="en">
+FriCAS is a fork of Axiom computer algebra system.
+</longdescription>
+ <use>
+ <flag name="clisp">Add support for GNU CLISP
+ (<pkg>dev-lisp/clisp</pkg>)</flag>
+ <flag name="cmucl">Add support for CMU Common Lisp
+ (<pkg>dev-lisp/cmucl</pkg>)</flag>
+ <flag name="gcl">Add support for GNU Common Lisp
+ (<pkg>dev-lisp/gcl</pkg>)</flag>
+ <flag name="sbcl">Add support for Steel Bank Common Lisp
+ (<pkg>dev-lisp/sbcl</pkg>)</flag>
+ <flag name="ecls">Add support for Embeddable Common Lisp
+ (<pkg>dev-lisp/ecls</pkg>)</flag>
+ <flag name="clozurecl">Add support for Clozure Common Lisp
+ (<pkg>dev-lisp/clozurecl</pkg>)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fricas</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/frobby/Manifest b/sci-mathematics/frobby/Manifest
new file mode 100644
index 00000000000..b2c0528d8ed
--- /dev/null
+++ b/sci-mathematics/frobby/Manifest
@@ -0,0 +1 @@
+DIST frobby_v0.9.0.tar.gz 852524 SHA256 af092383e6dc849c86f4e79747ae0e5cd309a690747230e10aa38d60640062df SHA512 b1f64d7a8630ba7f5464e36f66a06a7a7909bc42f2e52898b2967b8ad6288da8ce11a5d79ebfbbfe2f3933930ad26444173f721465ae9a42b6dcf3eef7ecc59e WHIRLPOOL f02c6c794c214c047ae6e1d764b0a29a87be1c080e8ac7489aedb1394a90169f8dc5bb6447c961760a35ba2af90c34ed9bb8e282590d0d05abe791aff7473025
diff --git a/sci-mathematics/frobby/files/frobby-cflags-no-strip-soname.patch b/sci-mathematics/frobby/files/frobby-cflags-no-strip-soname.patch
new file mode 100644
index 00000000000..2f5721d62a7
--- /dev/null
+++ b/sci-mathematics/frobby/files/frobby-cflags-no-strip-soname.patch
@@ -0,0 +1,47 @@
+diff -U 3 -dHrN frobby_v0.9.0.orig/Makefile frobby_v0.9.0/Makefile
+--- frobby_v0.9.0.orig/Makefile 2013-01-15 22:40:13.127937655 +0100
++++ frobby_v0.9.0/Makefile 2013-02-16 10:54:42.265322522 +0100
+@@ -70,7 +70,7 @@
+ BIN_INSTALL_DIR = "/usr/local/bin/"
+ endif
+
+-cflags = $(CFLAGS) $(CPPFLAGS) -Wall -ansi -pedantic -I $(GMP_INC_DIR) \
++cflags = $(CPPFLAGS) -Wall -ansi -pedantic -I $(GMP_INC_DIR) \
+ -Wno-uninitialized -Wno-unused-parameter
+ program = frobby
+ library = libfrobby.a
+@@ -87,7 +87,6 @@
+ MATCH=false
+ ifeq ($(MODE), release)
+ outdir = bin/release/
+- cflags += -O2
+ MATCH=true
+ endif
+ ifeq ($(MODE), debug)
+@@ -99,7 +98,7 @@
+ endif
+ ifeq ($(MODE), shared)
+ outdir = bin/shared/
+- cflags += -O2 -fPIC
++ cflags += -fPIC
+ library = libfrobby.so
+ MATCH=true
+ endif
+@@ -204,16 +203,13 @@
+ mv -f $@.exe $@; \
+ fi
+ endif
+-ifeq ($(MODE), release)
+- strip $@
+-endif
+
+ # Link object files into library
+ library: bin/$(library)
+ bin/$(library): $(objs) | bin/
+ rm -f bin/$(library)
+ ifeq ($(MODE), shared)
+- $(CXX) -shared -o bin/$(library) $(ldflags) \
++ $(CXX) -shared -Wl,-soname,libfrobby.so.0 -o bin/$(library) $(ldflags) \
+ $(patsubst $(outdir)main.o,,$(objs))
+ else
+ ar crs bin/$(library) $(patsubst $(outdir)main.o,,$(objs))
diff --git a/sci-mathematics/frobby/files/frobby-gcc-4.7.patch b/sci-mathematics/frobby/files/frobby-gcc-4.7.patch
new file mode 100644
index 00000000000..4a73161166d
--- /dev/null
+++ b/sci-mathematics/frobby/files/frobby-gcc-4.7.patch
@@ -0,0 +1,32 @@
+ src/main.cpp | 3 +++
+ src/randomDataGenerators.cpp | 3 +++
+ 2 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/main.cpp b/src/main.cpp
+index a16754e..315ea53 100755
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -25,6 +25,9 @@
+ #include <ctime>
+ #include <cstdlib>
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ /** This function runs the Frobby console interface. the ::main
+ function calls this function after having set up DEBUG-specific
+ things, catching exceptions, setting the random seed and so on.
+diff --git a/src/randomDataGenerators.cpp b/src/randomDataGenerators.cpp
+index 432a90a..1de3559 100755
+--- a/src/randomDataGenerators.cpp
++++ b/src/randomDataGenerators.cpp
+@@ -26,6 +26,9 @@
+ #include <limits>
+ #include <ctime>
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ void generateLinkedListIdeal(BigIdeal& ideal, size_t variableCount) {
+ VarNames names(variableCount);
+ ideal.clearAndSetNames(variableCount);
diff --git a/sci-mathematics/frobby/files/frobby-gmp-5.1.patch b/sci-mathematics/frobby/files/frobby-gmp-5.1.patch
new file mode 100644
index 00000000000..23cf295b896
--- /dev/null
+++ b/sci-mathematics/frobby/files/frobby-gmp-5.1.patch
@@ -0,0 +1,12 @@
+diff -U 3 -dHrN frobby_v0.9.0.orig/src/StatisticsStrategy.cpp frobby_v0.9.0/src/StatisticsStrategy.cpp
+--- frobby_v0.9.0.orig/src/StatisticsStrategy.cpp 2013-01-15 22:40:13.186967442 +0100
++++ frobby_v0.9.0/src/StatisticsStrategy.cpp 2013-01-15 22:40:33.267100780 +0100
+@@ -140,7 +140,7 @@
+ if (_nodeCount == 0)
+ return 0.0;
+ else {
+- mpz_class q = mpq_class(_subGenSum) / _nodeCount;
++ mpq_class q = mpq_class(_subGenSum) / _nodeCount;
+ return q.get_d();
+ }
+ }
diff --git a/sci-mathematics/frobby/frobby-0.9.0-r1.ebuild b/sci-mathematics/frobby/frobby-0.9.0-r1.ebuild
new file mode 100644
index 00000000000..72bcfe71355
--- /dev/null
+++ b/sci-mathematics/frobby/frobby-0.9.0-r1.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
+
+DESCRIPTION="Software system and project for computations with monomial ideals"
+HOMEPAGE="http://www.broune.com/frobby/"
+SRC_URI="http://www.broune.com/frobby/frobby_v${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc static-libs"
+
+RDEPEND="dev-libs/gmp[cxx]"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/frobby_v${PV}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-cflags-no-strip-soname.patch" \
+ "${FILESDIR}/${PN}-gcc-4.7.patch" \
+ "${FILESDIR}/${PN}-gmp-5.1.patch"
+ # CXXFLAGS are called CPPFLAGS
+ sed "s/CPPFLAGS/CXXFLAGS/" -i Makefile || die
+}
+
+src_compile() {
+ # Makefile uses the value of CXX which may be defined in /etc/env,
+ # breaking cross-compile.
+ CXX=$(tc-getCXX) emake
+ MODE=shared CXX=$(tc-getCXX) emake library
+ use static-libs && CXX=$(tc-getCXX) emake library
+ use doc && emake docPdf
+}
+
+src_install() {
+ dobin bin/frobby
+ dolib.so bin/libfrobby.so
+ dosym libfrobby.so "${PREFIX}/usr/$(get_libdir)/libfrobby.so.0"
+ use static-libs && dolib.a bin/libfrobby.a
+
+ insinto /usr/include
+ doins src/frobby.h
+
+ insinto /usr/include/"${PN}"
+ doins src/stdinc.h
+
+ use doc && dodoc bin/manual.pdf
+}
diff --git a/sci-mathematics/frobby/metadata.xml b/sci-mathematics/frobby/metadata.xml
new file mode 100644
index 00000000000..4e93bbb7622
--- /dev/null
+++ b/sci-mathematics/frobby/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+ </maintainer>
+ <herd>sci</herd>
+ <longdescription lang="en">
+Frobby is a software system and library for computations with monomial ideals.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/genius/Manifest b/sci-mathematics/genius/Manifest
new file mode 100644
index 00000000000..c805b44097c
--- /dev/null
+++ b/sci-mathematics/genius/Manifest
@@ -0,0 +1,3 @@
+DIST genius-1.0.17.tar.xz 2314316 SHA256 2af0cf64a3bae45e8e6c38ce8c0c0724386ae29614a83d9eff179ee09ecef44f SHA512 8047efb1b5d278186b093bca3624f96059670ce3cdf757759abf6e01a27bb4bba82a4158e6baa3b42f349a55fdf6e984388fb7f96f14b0e4faba0ada069e9b6c WHIRLPOOL bb6ba7bb5c635f331e523887e5f5995e83392f58046893ae2bebc56fcaa26f817c8ddd481663fa5818377d721911c430dbd50dd8ab24a07e9dd5c4ad6fcf77bd
+DIST genius-1.0.19.tar.xz 2447724 SHA256 e5a979d13ae39fb1ae176078dbb301222e6c7a1c2cda8d999bac3ff6a4a7e6c2 SHA512 84ec48c0e13af088f61674e170c23cbc06e081bea43babe3460b88fd2e256c9fc44b891afa3270d5117ccd91ec6d2c25b022dde3d468635df9d1c6e573c4ef05 WHIRLPOOL 772637bd2c2333a08115397781773b1aa74cb195b9731b1b07ddf689fef47790aad79d2f2a6c7e45fe5c6738eb8bda56e0cebe3802c01cd5c1a99bfb3b00b0d5
+DIST genius-reference.pdf 1024944 SHA256 79011ae33ff781507185898ba76b156699061eda78ed16e15aa02195c896ee4b SHA512 04af3870104d2320b1d4b345d74d713a0dfcdf8a228002506508f437659b3ef6037ead0b1f6b37cc335692150750b58c4007fdaaddd9540233474ccd10dac285 WHIRLPOOL 301302145d43843ddd749ab33612438d360462c9d3daa12d7050d9ca6da82bdea3ef53b917989d0c518327780b147a9f74e407f555a62dcdbe0f0c2ef864fa88
diff --git a/sci-mathematics/genius/files/genius-1.0.17-gcc4.8.patch b/sci-mathematics/genius/files/genius-1.0.17-gcc4.8.patch
new file mode 100644
index 00000000000..34427a72dda
--- /dev/null
+++ b/sci-mathematics/genius/files/genius-1.0.17-gcc4.8.patch
@@ -0,0 +1,28 @@
+ src/genius-readline-helper.c | 2 +-
+ src/inter.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/genius-readline-helper.c b/src/genius-readline-helper.c
+index 7e9e84b..dbf8fd2 100644
+--- a/src/genius-readline-helper.c
++++ b/src/genius-readline-helper.c
+@@ -183,7 +183,7 @@ main(int argc, char *argv[])
+ rl_terminal_name = "xterm";
+ rl_readline_name = "Genius";
+ rl_attempted_completion_function =
+- (CPPFunction *)tab_completion;
++ (rl_completion_func_t *)tab_completion;
+
+ while(fgets(buf,4096,infp)) {
+ int count;
+diff --git a/src/inter.c b/src/inter.c
+index 915f115..f0d2558 100644
+--- a/src/inter.c
++++ b/src/inter.c
+@@ -367,5 +367,5 @@ init_inter(void)
+ {
+ rl_readline_name = "Genius";
+ rl_attempted_completion_function =
+- (CPPFunction *)tab_completion;
++ (rl_completion_func_t *)tab_completion;
+ }
diff --git a/sci-mathematics/genius/files/genius-make.patch b/sci-mathematics/genius/files/genius-make.patch
new file mode 100644
index 00000000000..b9754325aea
--- /dev/null
+++ b/sci-mathematics/genius/files/genius-make.patch
@@ -0,0 +1,73 @@
+--- gtkextra/Makefile.in-orig 2010-08-22 16:18:31.099596456 -0500
++++ gtkextra/Makefile.in 2010-08-22 16:20:46.375575923 -0500
+@@ -106,16 +106,16 @@
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
++ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
++ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+- if test "$$first2" = "$$first"; then \
+- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+- else \
+- dir2="../$$dir2"; \
+- fi; \
+- dir0="$$dir0"/"$$first"; \
++ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
++ if test "$$first2" = "$$first"; then \
++ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
++ else \
++ dir2="../$$dir2"; \
++ fi; \
++ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+@@ -391,7 +391,7 @@
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+- && { if test -f $@; then exit 0; else break; fi; }; \
++ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+@@ -670,12 +670,12 @@
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+- top_distdir="$$new_top_distdir" \
+- distdir="$$new_distdir" \
++ top_distdir="$$new_top_distdir" \
++ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+- distdir) \
++ distdir) \
+ || exit 1; \
+ fi; \
+ done
+@@ -800,13 +800,13 @@
+
+
+ $(srcdir)/gtkextra-marshal.h: gtkextra-marshal.list
+- ( @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --header > gtkextra-marshal.tmp \
+- && mv gtkextra-marshal.tmp gtkextra-marshal.h ) \
+- || ( rm -f gtkextra-marshal.tmp && exit 1 )
++ ( @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --header > gtkextra-marshal.tmp \
++ && mv gtkextra-marshal.tmp gtkextra-marshal.h ) \
++ || ( rm -f gtkextra-marshal.tmp && exit 1 )
+ $(srcdir)/gtkextra-marshal.c: gtkextra-marshal.h
+- ( @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --body > gtkextra-marshal.tmp \
+- && mv gtkextra-marshal.tmp gtkextra-marshal.c ) \
+- || ( rm -f gtkextra-marshal.tmp && exit 1 )
++ ( @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --body > gtkextra-marshal.tmp \
++ && mv gtkextra-marshal.tmp gtkextra-marshal.c ) \
++ || ( rm -f gtkextra-marshal.tmp && exit 1 )
+
+ $(srcdir)/gtkextratypebuiltins.h: $(public_h_sources)
+ ( cd $(srcdir) && glib-mkenums \
diff --git a/sci-mathematics/genius/genius-1.0.17.ebuild b/sci-mathematics/genius/genius-1.0.17.ebuild
new file mode 100644
index 00000000000..5ad622fa3a1
--- /dev/null
+++ b/sci-mathematics/genius/genius-1.0.17.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils gnome2
+
+DESCRIPTION="Genius Mathematics Tool and the GEL Language"
+HOMEPAGE="http://www.jirka.org/genius.html"
+SRC_URI="
+ mirror://gnome/sources/${PN}/1.0/${P}.tar.xz
+ doc? ( http://www.jirka.org/${PN}-reference.pdf )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gnome nls"
+
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/gmp
+ dev-libs/mpfr
+ dev-libs/popt
+ sys-libs/ncurses
+ sys-libs/readline
+ gnome? (
+ x11-libs/gtk+:2
+ gnome-base/libgnome
+ gnome-base/libgnomeui
+ gnome-base/libglade:2.0
+ x11-libs/gtksourceview:2.0
+ x11-libs/vte:0 )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ || ( sys-devel/bison dev-util/yacc )
+ sys-devel/flex
+ app-text/scrollkeeper
+ app-text/gnome-doc-utils
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ G2CONF="${G2CONF} $(use_enable gnome) $(use_enable nls) \
+ --disable-update-mimedb --disable-scrollkeeper \
+ --disable-extra-gcc-optimization"
+ # gnome2.eclass adds --disable-gtk-doc or --enable-gtk-doc to G2CONF
+ # if there is the USE flag doc, thus leading to QA warnings
+ GCONF_DEBUG="no"
+ DOCS="AUTHORS ChangeLog NEWS README TODO"
+ USE_DESTDIR="1"
+
+ epatch "${FILESDIR}"/${P}-gcc4.8.patch
+}
+
+src_install() {
+ use doc && DOCS+=" ${DISTDIR}/${PN}-reference.pdf"
+ gnome2_src_install
+}
diff --git a/sci-mathematics/genius/genius-1.0.19.ebuild b/sci-mathematics/genius/genius-1.0.19.ebuild
new file mode 100644
index 00000000000..32c5e25a4f1
--- /dev/null
+++ b/sci-mathematics/genius/genius-1.0.19.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 eutils gnome2
+
+DESCRIPTION="Genius Mathematics Tool and the GEL Language"
+HOMEPAGE="http://www.jirka.org/genius.html"
+SRC_URI="
+ mirror://gnome/sources/${PN}/1.0/${P}.tar.xz
+ doc? ( http://www.jirka.org/${PN}-reference.pdf )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gnome nls"
+
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/gmp
+ dev-libs/mpfr
+ dev-libs/popt
+ sys-libs/ncurses
+ sys-libs/readline
+ gnome? (
+ x11-libs/gtk+:2
+ gnome-base/libgnome
+ gnome-base/libgnomeui
+ gnome-base/libglade:2.0
+ x11-libs/gtksourceview:2.0
+ x11-libs/vte:0 )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ || ( sys-devel/bison dev-util/yacc )
+ sys-devel/flex
+ app-text/scrollkeeper
+ app-text/gnome-doc-utils
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ G2CONF="${G2CONF} $(use_enable gnome) $(use_enable nls) \
+ --disable-update-mimedb --disable-scrollkeeper \
+ --disable-extra-gcc-optimization"
+ # gnome2.eclass adds --disable-gtk-doc or --enable-gtk-doc to G2CONF
+ # if there is the USE flag doc, thus leading to QA warnings
+ GCONF_DEBUG="no"
+ DOCS="AUTHORS ChangeLog NEWS README TODO"
+ USE_DESTDIR="1"
+}
+
+src_install() {
+ use doc && DOCS+=" ${DISTDIR}/${PN}-reference.pdf"
+ gnome2_src_install
+}
diff --git a/sci-mathematics/genius/metadata.xml b/sci-mathematics/genius/metadata.xml
new file mode 100644
index 00000000000..6260aca8ea5
--- /dev/null
+++ b/sci-mathematics/genius/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</herd>
+ <maintainer>
+ <email>grozin@gentoo.org</email>
+ <name>Andrey Grozin</name>
+ </maintainer>
+ <longdescription>Genius is a calculator program which can work
+ with arbitrary precision integers, multiple precision floats,
+ rational numbers, complex numbers, linear algebra, number theory,
+ numerical calculus, statistics, numerical equation solving,
+ combinatorics, elementary functions, modular arithmetic.
+ It has a programming language with automatic typing.
+ It can do various 2D and 3D plots, with possibility
+ to export to eps or png. Genius has a GUI IDE.
+ It can output matrices in LaTeX, Troff (eqn) or MathML.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/geogebra/Manifest b/sci-mathematics/geogebra/Manifest
new file mode 100644
index 00000000000..bf75d3c8b6d
--- /dev/null
+++ b/sci-mathematics/geogebra/Manifest
@@ -0,0 +1 @@
+DIST GeoGebra-Unixlike-Installer-4.1.120.0.tar.gz 44859986 SHA256 39f4462ad934923673f14e5c34c4bc1da167c5af5e411f58d89c8a935ae08648 SHA512 9c52c4850e8d003ff2edbc2af6607fb02779063aca10e5b76ef2f8be3992ce2eb4f148323dbee324bbbdc0f56e8d1b15fd5971cda734c813796213895003e1a4 WHIRLPOOL 6cb59b6023a1a3a8eaba105d3bb5f1df24baf78de3d35fdcce21ff370c9630087f8096b8e95f19ba8118825f9968c10eacf9dd76bcd941c5d66ccb24d5e24aec
diff --git a/sci-mathematics/geogebra/files/geogebra-fix-install.sh.patch b/sci-mathematics/geogebra/files/geogebra-fix-install.sh.patch
new file mode 100644
index 00000000000..6597a4f48dd
--- /dev/null
+++ b/sci-mathematics/geogebra/files/geogebra-fix-install.sh.patch
@@ -0,0 +1,78 @@
+--- install.sh 2012-06-04 17:14:09.129571330 +0200
++++ install.sh 2012-06-04 17:11:58.588706799 +0200
+@@ -2,41 +2,41 @@
+ # simple ./install-sh script that copies everything to the right place
+
+ # create all needed directories
+-./install-sh -d -m 755 /usr/share/geogebra/unsigned
+-./install-sh -d -m 755 /usr/share/icons/hicolor/16x16/apps /usr/share/icons/hicolor/22x22/apps /usr/share/icons/hicolor/24x24/apps /usr/share/icons/hicolor/32x32/apps /usr/share/icons/hicolor/36x36/apps /usr/share/icons/hicolor/48x48/apps /usr/share/icons/hicolor/64x64/apps /usr/share/icons/hicolor/72x72/apps /usr/share/icons/hicolor/96x96/apps /usr/share/icons/hicolor/128x128/apps /usr/share/icons/hicolor/192x192/apps /usr/share/icons/hicolor/256x256/apps /usr/share/icons/hicolor/scalable/apps
+-./install-sh -d -m 755 /usr/share/icons/hicolor/16x16/mimetypes /usr/share/icons/hicolor/22x22/mimetypes /usr/share/icons/hicolor/24x24/mimetypes /usr/share/icons/hicolor/32x32/mimetypes /usr/share/icons/hicolor/36x36/mimetypes /usr/share/icons/hicolor/48x48/mimetypes /usr/share/icons/hicolor/64x64/mimetypes /usr/share/icons/hicolor/72x72/mimetypes /usr/share/icons/hicolor/96x96/mimetypes /usr/share/icons/hicolor/128x128/mimetypes /usr/share/icons/hicolor/192x192/mimetypes /usr/share/icons/hicolor/256x256/mimetypes /usr/share/icons/hicolor/scalable/mimetypes
++./install-sh -d -m 755 ${D}/usr/share/geogebra/unsigned
++./install-sh -d -m 755 ${D}/usr/share/icons/hicolor/16x16/apps ${D}/usr/share/icons/hicolor/22x22/apps ${D}/usr/share/icons/hicolor/24x24/apps ${D}/usr/share/icons/hicolor/32x32/apps ${D}/usr/share/icons/hicolor/36x36/apps ${D}/usr/share/icons/hicolor/48x48/apps ${D}/usr/share/icons/hicolor/64x64/apps ${D}/usr/share/icons/hicolor/72x72/apps ${D}/usr/share/icons/hicolor/96x96/apps ${D}/usr/share/icons/hicolor/128x128/apps ${D}/usr/share/icons/hicolor/192x192/apps ${D}/usr/share/icons/hicolor/256x256/apps ${D}/usr/share/icons/hicolor/scalable/apps
++./install-sh -d -m 755 ${D}/usr/share/icons/hicolor/16x16/mimetypes ${D}/usr/share/icons/hicolor/22x22/mimetypes ${D}/usr/share/icons/hicolor/24x24/mimetypes ${D}/usr/share/icons/hicolor/32x32/mimetypes ${D}/usr/share/icons/hicolor/36x36/mimetypes ${D}/usr/share/icons/hicolor/48x48/mimetypes ${D}/usr/share/icons/hicolor/64x64/mimetypes ${D}/usr/share/icons/hicolor/72x72/mimetypes ${D}/usr/share/icons/hicolor/96x96/mimetypes ${D}/usr/share/icons/hicolor/128x128/mimetypes ${D}/usr/share/icons/hicolor/192x192/mimetypes ${D}/usr/share/icons/hicolor/256x256/mimetypes ${D}/usr/share/icons/hicolor/scalable/mimetypes
+
+ # ./install-sh files
+-./install-sh -m 644 *.jar /usr/share/geogebra
+-./install-sh -m 644 unsigned/*.jar /usr/share/geogebra/unsigned
+-./install-sh -m 755 geogebra /usr/bin
+-./install-sh -m 644 geogebra.xml /usr/share/mime/packages
+-./install-sh -m 644 geogebra.desktop /usr/share/applications
++./install-sh -m 644 *.jar ${D}/usr/share/geogebra
++./install-sh -m 644 unsigned/*.jar ${D}/usr/share/geogebra/unsigned
++./install-sh -m 755 geogebra ${D}/usr/bin/geogebra
++./install-sh -m 644 geogebra.xml ${D}/usr/share/mime/packages/gegebra.xml
++./install-sh -m 644 geogebra.desktop ${D}/usr/share/applications/geogebra.desktop
+
+-./install-sh -m 644 icons/hicolor/16x16/apps/geogebra.png /usr/share/icons/hicolor/16x16/apps
+-./install-sh -m 644 icons/hicolor/22x22/apps/geogebra.png /usr/share/icons/hicolor/22x22/apps
+-./install-sh -m 644 icons/hicolor/24x24/apps/geogebra.png /usr/share/icons/hicolor/24x24/apps
+-./install-sh -m 644 icons/hicolor/32x32/apps/geogebra.png /usr/share/icons/hicolor/32x32/apps
+-./install-sh -m 644 icons/hicolor/36x36/apps/geogebra.png /usr/share/icons/hicolor/36x36/apps
+-./install-sh -m 644 icons/hicolor/48x48/apps/geogebra.png /usr/share/icons/hicolor/48x48/apps
+-./install-sh -m 644 icons/hicolor/64x64/apps/geogebra.png /usr/share/icons/hicolor/64x64/apps
+-./install-sh -m 644 icons/hicolor/72x72/apps/geogebra.png /usr/share/icons/hicolor/72x72/apps
+-./install-sh -m 644 icons/hicolor/96x96/apps/geogebra.png /usr/share/icons/hicolor/96x96/apps
+-./install-sh -m 644 icons/hicolor/128x128/apps/geogebra.png /usr/share/icons/hicolor/128x128/apps
+-./install-sh -m 644 icons/hicolor/192x192/apps/geogebra.png /usr/share/icons/hicolor/192x192/apps
+-./install-sh -m 644 icons/hicolor/256x256/apps/geogebra.png /usr/share/icons/hicolor/256x256/apps
+-./install-sh -m 644 icons/hicolor/scalable/apps/geogebra.svgz /usr/share/icons/hicolor/scalable/apps
++./install-sh -m 644 icons/hicolor/16x16/apps/geogebra.png ${D}/usr/share/icons/hicolor/16x16/apps
++./install-sh -m 644 icons/hicolor/22x22/apps/geogebra.png ${D}/usr/share/icons/hicolor/22x22/apps
++./install-sh -m 644 icons/hicolor/24x24/apps/geogebra.png ${D}/usr/share/icons/hicolor/24x24/apps
++./install-sh -m 644 icons/hicolor/32x32/apps/geogebra.png ${D}/usr/share/icons/hicolor/32x32/apps
++./install-sh -m 644 icons/hicolor/36x36/apps/geogebra.png ${D}/usr/share/icons/hicolor/36x36/apps
++./install-sh -m 644 icons/hicolor/48x48/apps/geogebra.png ${D}/usr/share/icons/hicolor/48x48/apps
++./install-sh -m 644 icons/hicolor/64x64/apps/geogebra.png ${D}/usr/share/icons/hicolor/64x64/apps
++./install-sh -m 644 icons/hicolor/72x72/apps/geogebra.png ${D}/usr/share/icons/hicolor/72x72/apps
++./install-sh -m 644 icons/hicolor/96x96/apps/geogebra.png ${D}/usr/share/icons/hicolor/96x96/apps
++./install-sh -m 644 icons/hicolor/128x128/apps/geogebra.png ${D}/usr/share/icons/hicolor/128x128/apps
++./install-sh -m 644 icons/hicolor/192x192/apps/geogebra.png ${D}/usr/share/icons/hicolor/192x192/apps
++./install-sh -m 644 icons/hicolor/256x256/apps/geogebra.png ${D}/usr/share/icons/hicolor/256x256/apps
++./install-sh -m 644 icons/hicolor/scalable/apps/geogebra.svgz ${D}/usr/share/icons/hicolor/scalable/apps
+
+-./install-sh -m 644 icons/hicolor/16x16/mimetypes/*.* /usr/share/icons/hicolor/16x16/mimetypes
+-./install-sh -m 644 icons/hicolor/22x22/mimetypes/*.* /usr/share/icons/hicolor/22x22/mimetypes
+-./install-sh -m 644 icons/hicolor/24x24/mimetypes/*.* /usr/share/icons/hicolor/24x24/mimetypes
+-./install-sh -m 644 icons/hicolor/32x32/mimetypes/*.* /usr/share/icons/hicolor/32x32/mimetypes
+-./install-sh -m 644 icons/hicolor/36x36/mimetypes/*.* /usr/share/icons/hicolor/36x36/mimetypes
+-./install-sh -m 644 icons/hicolor/48x48/mimetypes/*.* /usr/share/icons/hicolor/48x48/mimetypes
+-./install-sh -m 644 icons/hicolor/64x64/mimetypes/*.* /usr/share/icons/hicolor/64x64/mimetypes
+-./install-sh -m 644 icons/hicolor/72x72/mimetypes/*.* /usr/share/icons/hicolor/72x72/mimetypes
+-./install-sh -m 644 icons/hicolor/96x96/mimetypes/*.* /usr/share/icons/hicolor/96x96/mimetypes
+-./install-sh -m 644 icons/hicolor/128x128/mimetypes/*.* /usr/share/icons/hicolor/128x128/mimetypes
+-./install-sh -m 644 icons/hicolor/192x192/mimetypes/*.* /usr/share/icons/hicolor/192x192/mimetypes
+-./install-sh -m 644 icons/hicolor/256x256/mimetypes/*.* /usr/share/icons/hicolor/256x256/mimetypes
+-./install-sh -m 644 icons/hicolor/scalable/mimetypes/*.* /usr/share/icons/hicolor/scalable/mimetypes
++./install-sh -m 644 icons/hicolor/16x16/mimetypes/*.* ${D}/usr/share/icons/hicolor/16x16/mimetypes
++./install-sh -m 644 icons/hicolor/22x22/mimetypes/*.* ${D}/usr/share/icons/hicolor/22x22/mimetypes
++./install-sh -m 644 icons/hicolor/24x24/mimetypes/*.* ${D}/usr/share/icons/hicolor/24x24/mimetypes
++./install-sh -m 644 icons/hicolor/32x32/mimetypes/*.* ${D}/usr/share/icons/hicolor/32x32/mimetypes
++./install-sh -m 644 icons/hicolor/36x36/mimetypes/*.* ${D}/usr/share/icons/hicolor/36x36/mimetypes
++./install-sh -m 644 icons/hicolor/48x48/mimetypes/*.* ${D}/usr/share/icons/hicolor/48x48/mimetypes
++./install-sh -m 644 icons/hicolor/64x64/mimetypes/*.* ${D}/usr/share/icons/hicolor/64x64/mimetypes
++./install-sh -m 644 icons/hicolor/72x72/mimetypes/*.* ${D}/usr/share/icons/hicolor/72x72/mimetypes
++./install-sh -m 644 icons/hicolor/96x96/mimetypes/*.* ${D}/usr/share/icons/hicolor/96x96/mimetypes
++./install-sh -m 644 icons/hicolor/128x128/mimetypes/*.* ${D}/usr/share/icons/hicolor/128x128/mimetypes
++./install-sh -m 644 icons/hicolor/192x192/mimetypes/*.* ${D}/usr/share/icons/hicolor/192x192/mimetypes
++./install-sh -m 644 icons/hicolor/256x256/mimetypes/*.* ${D}/usr/share/icons/hicolor/256x256/mimetypes
++./install-sh -m 644 icons/hicolor/scalable/mimetypes/*.* ${D}/usr/share/icons/hicolor/scalable/mimetypes
diff --git a/sci-mathematics/geogebra/geogebra-4.1.120.0.ebuild b/sci-mathematics/geogebra/geogebra-4.1.120.0.ebuild
new file mode 100644
index 00000000000..5b27243f73d
--- /dev/null
+++ b/sci-mathematics/geogebra/geogebra-4.1.120.0.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Mathematics software for geometry"
+HOMEPAGE="http://www.geogebra.org/cms/en"
+SRC_URI="https://geogebra.googlecode.com/files/GeoGebra-Unixlike-Installer-${PV}.tar.gz"
+
+LICENSE="GPL-3 CC-BY-SA-3.0 BSD public-domain GPL-2 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=virtual/jdk-1.6.0-r1
+ ${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-fix-install.sh.patch"
+}
+
+src_install() {
+ ./install.sh || die
+}
diff --git a/sci-mathematics/geogebra/metadata.xml b/sci-mathematics/geogebra/metadata.xml
new file mode 100644
index 00000000000..3b9435b6b00
--- /dev/null
+++ b/sci-mathematics/geogebra/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>amynka@gentoo.org</email>
+</maintainer>
+<longdescription lang="en">
+ GeoGebra is interactive mathematics software for learning and teaching mathematics
+ and science from primary school up to university level.
+ Constructions can be made with points, vectors, segments, lines, polygons,
+ conic sections, inequalities, implicit polynomials and functions.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/geomview/Manifest b/sci-mathematics/geomview/Manifest
new file mode 100644
index 00000000000..ac8133e2efa
--- /dev/null
+++ b/sci-mathematics/geomview/Manifest
@@ -0,0 +1,2 @@
+DIST geomview-1.9.5.tar.bz2 4532535 SHA256 6b683735582ac4eab7f2618cf924c1244de58dd3ef195d06442aaea54cd9fb40 SHA512 a22bcd254e1e4c5c6797811f315d158f84fe82a3f95646bfdf3be203e9cd7fc8cacbf26f55a0a08bcb47cf2b2ad17ae4b48cdc4d78f810f48dab9fa1c7d56e7f WHIRLPOOL f89188ba357f814408fd8523ec416aab6052c1fb110110547e3e48a6c2d4bd8aa3d14f9d4995173e38714fa69156940950e2e4266d34685159d6ad35279b67f1
+DIST geomview.png.tar 10240 SHA256 cf1f5b94d868d363fa6f251343b1426cc7e9ed36ed8ee1fea4339ccabcba33cb SHA512 3abdc04f04410a50876af6b0f1aefc6891c47926ca9e5a4a31bd001310972996497f4e6c33db059fdbca09b236b7763e5476d75427e653d54861b4b3a4e54f51 WHIRLPOOL fecc6989bbef303b379673a503c322db1c8bbe61c346bc3dee984319eb29537985f2696c5a716e94398eb873fd6ed77a06e2462b615d7d4f22bad0bb033765a3
diff --git a/sci-mathematics/geomview/files/50geomview-gentoo.el b/sci-mathematics/geomview/files/50geomview-gentoo.el
new file mode 100644
index 00000000000..2e078ec06c3
--- /dev/null
+++ b/sci-mathematics/geomview/files/50geomview-gentoo.el
@@ -0,0 +1,7 @@
+
+;;; geomview site-lisp configuration
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'gvcl-mode "gvcl-mode"
+ "Major mode for editing Geomview Command Language files." t)
+(add-to-list 'auto-mode-alist '("\\.gcl\\'" . gvcl-mode))
diff --git a/sci-mathematics/geomview/files/gvcl-mode.el b/sci-mathematics/geomview/files/gvcl-mode.el
new file mode 100644
index 00000000000..cbfadafc205
--- /dev/null
+++ b/sci-mathematics/geomview/files/gvcl-mode.el
@@ -0,0 +1,172 @@
+;;; gvcl-mode.el --- A major mode for editing Geomview Command Language files
+
+;; Copyright (C) 2007 Claus-Justus Heine
+
+;; Author: Claus-Justus Heine
+;; Keywords: extensions
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Writing an Emacs major mode is really a non-trivial task. This file
+;; really covers only some basic things (comment-start,
+;; syntax-highlighting, crude indentation support).
+
+;;; Code:
+
+;; Setup
+
+;;First, we define some variables that all modes should
+;;define. gvlisp-mode-hook allows the user to run their own code when
+;;your mode is run
+
+(defvar gvcl-mode-hook nil)
+
+(defvar gvcl-indent-offset 2 "Incremental indentation offset.")
+
+;;Now we create a keymap. This map, here called gvcl-mode-map, allows
+;;both you and users to define their own keymaps. The keymap is
+;;immediately set to a default keymap. Then, using define-key, we
+;;insert an example keybinding into the keymap, which maps the
+;;newline-and-indent function to Control-j (which is actually the
+;;default binding for this function, but is included anyway as an
+;;example). Of course, you may define as many keybindings as you wish.
+;;
+;;If your keymap will have very few entries, then you may want to
+;;consider make-sparse-keymap rather than make-keymap
+(defvar gvcl-mode-map
+ (let ((gvcl-mode-map (make-keymap)))
+ (define-key gvcl-mode-map "\C-j" 'newline-and-indent)
+ gvcl-mode-map)
+ "Keymap for Geomview Command Language major mode.")
+
+;;Here, we append a definition to auto-mode-alist. This tells emacs
+;;that when a buffer with a name ending with .wpd is opened, then
+;;gvcl-mode should be started in that buffer. Some modes leave this
+;;step to the user.
+(add-to-list 'auto-mode-alist '("\\.gcl\\'" . gvcl-mode))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Syntax highlighting using keywords
+
+(defconst gvcl-font-lock-keywords-1
+ (list
+ '("(\\s-*\\(redraw\\|process-events\\|interest\\|time-interests\\|and\\|sleep-\\(for\\|until\\)\\|or\\|hdefine\\|geometry\\|quote\\|eval\\|if\\|while\\|setq\\|echo\\|let\\|exit\\|quit\\|lambda\\|defun\\|progn\\|backcolor\\|read\\|camera\\|new-geometry\\|car\\|cdr\\|cons\\|emodule\\S-*\\|ui-\\S-+\\|normalization\\)\\>" . font-lock-builtin-face)
+ '("\\(\"\\w*\"\\)" . font-lock-variable-name-face))
+ "Minimal highlighting expressions for GVCL mode.")
+
+(defconst gvcl-font-lock-keywords-2
+ (append gvcl-font-lock-keywords-1
+ (list
+ '("\\<\\(\\(location\\|origin\\)\\s-+\\(camera\\|local\\|global\\|ndc\\|screen\\)\\)\\>" . font-lock-constant-face)
+ '("\\<\\(define\\|geom\\(etry\\)?\\|camera\\|window\\|inertia\\|allgeoms\\|focus-change\\)\\>" . font-lock-keyword-face)))
+ "Additional Keywords to highlight in GVCL mode.")
+
+(defconst gvcl-font-lock-keywords-3
+ (append gvcl-font-lock-keywords-2
+ (list
+ '("\\<\\(INST\\|T?LIST\\|\\(ST\\)?Z?u?v?C?N?U?4?n?\\(OFF\\|MESH\\|SKEL\\|VECT\\|QUAD\\|BEZ\\|BBP\\|BBOX\\|SPHERE\\|GROUP\\|DISCGRP\\|COMMENT\\)\\)\\>" . font-lock-type-face)
+ ;; more OOGL keywords
+ '("\\<\\(SINUSOIDAL\\|CYLINDRICAL\\|RECTANGULAR\\|STEREOGRAPHIC\\|ONEFACE\\)\\>" . font-lock-keyword-face)
+ ;; apperance constants
+ '("\\<\\(blend\\|modulate\\|replace\\|decal\\|replacelights\\|face\\|edge\\|vect\\|transparent\\|normal\\|normscale\\|evert\\|texturing\\|mipmap\\|linear\\|mipinterp\\|backcull\\|concave\\|shadelines\\|keepcolor\\|smooth\\|flat\\|constant\\|csmooth\\|vcflat\\|replacelights\\|clamp\\s-+\\(s\\|t\\|st\\|none\\)\\)\\>" . font-lock-constant-face)
+ ;; image constants
+ '("\\<\\(RGB\\|RGBA\\|ALPHA\\|LUMINANCE\\|LUMINANCE_ALPHA\\)\\>" . font-lock-constant-face)
+ ;; image keywords
+ '("\\<\\(inertia\\|width\\|height\\|channels\\|maxval\\|data\\)\\>" . font-lock-keyword-face)
+ ;; apperance keywords
+ '("\\<\\(apply\\|shading\\|localviewer\\|attenconst\\|attenmult2?\\|normscale\\|shading\\|linewidth\\|patchdice\\|ka\\|ambient\\|kd\\|diffuse\\|ks\\|specular\\|shininess\\|backdiffuse\\|alpha\\|edgecolor\\|normalcolor\\|color\\|position\\|file\\|alphafile\\|background\\|texturing\\)\\>" . font-lock-keyword-face)
+ ;; some more types
+ '("\\<\\(texture\\|light\\|material\\|lighting\\|light\\|image\\|appearance\\|n?transforms?\\|tlist\\)\\>" . font-lock-type-face)
+ ;; some more constants
+ '("\\<\\(yes\\|no\\|on\\|off\\|toggle\\|center\\|none\\)\\>" . font-lock-constant-face)
+ ))
+ "Balls-out highlighting in GVCL mode.")
+
+;;I've now defined more GVCL constants. This completes the list of
+;;GVCL keywords.
+
+(defvar gvcl-font-lock-keywords gvcl-font-lock-keywords-3
+ "Default highlighting expressions for GVCL mode.")
+
+;;Here I've defined the default level of highlighting to be the
+;;maximum. This is just my preference\u2014 the user can change this
+;;variable (if the user knows how! This might be something to put in
+;;the documentation for your own mode).
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Indentation
+
+(defun gvcl-indent-line ()
+ "Indent current line as GVCL code."
+ (interactive)
+;; (beginning-of-line)
+ (let ((savep (> (current-column) (current-indentation)))
+ (indent (condition-case nil (max (gvcl-calculate-indentation) 0)
+ (error 0))))
+ (if savep
+ (save-excursion (indent-line-to indent))
+ (indent-line-to indent))))
+
+(defun gvcl-calculate-indentation ()
+ "Return the column to which the current line should be indented."
+ (save-excursion
+ (beginning-of-line)
+ (if (< (point) 2)
+ 0
+ (skip-chars-forward " \t")
+ (let ((indent-above (if (eq (char-syntax (following-char)) ?\) )
+ 0
+ gvcl-indent-offset)))
+ (up-list -1)
+ (+ (current-indentation) indent-above)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; The syntax table
+
+(defvar gvcl-mode-syntax-table
+ (let ((st (make-syntax-table)))
+ (modify-syntax-entry ?_ "w" st)
+ (modify-syntax-entry ?# "<" st)
+ (modify-syntax-entry ?\n ">" st)
+ (modify-syntax-entry ?{ "(}" st)
+ (modify-syntax-entry ?} "){" st)
+ (modify-syntax-entry ?( "()" st)
+ (modify-syntax-entry ?) ")(" st)
+ st)
+ "Syntax table for `gvcl-mode'.")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Derive the stuff from fundamental mode
+
+(define-derived-mode gvcl-mode fundamental-mode "GVCL"
+ "Major mode for editing Geomview Command Language files."
+ (set (make-local-variable 'font-lock-defaults) '(gvcl-font-lock-keywords))
+ (set (make-local-variable 'comment-start) "# ")
+ (set (make-local-variable 'comment-start-skip) "#+\\s-*")
+ (set (make-local-variable 'indent-line-function) 'gvcl-indent-line))
+
+
+(provide 'gvcl-mode)
+
+(provide 'gvcl-mode)
+
+;;; gvcl-mode.el ends here
diff --git a/sci-mathematics/geomview/geomview-1.9.5.ebuild b/sci-mathematics/geomview/geomview-1.9.5.ebuild
new file mode 100644
index 00000000000..09be63e4526
--- /dev/null
+++ b/sci-mathematics/geomview/geomview-1.9.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
+
+inherit elisp-common eutils flag-o-matic fdo-mime
+
+DESCRIPTION="Interactive Geometry Viewer"
+HOMEPAGE="http://geomview.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ http://dev.gentoo.org/~jlec/distfiles/geomview.png.tar"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="motionaveraging debug emacs zlib"
+
+DEPEND=">=x11-libs/motif-2.3:0
+ virtual/glu
+ virtual/opengl
+ emacs? ( virtual/emacs )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}
+ x11-misc/xdg-utils"
+
+S="${WORKDIR}/${P/_/-}"
+
+SITEFILE=50${PN}-gentoo.el
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} \
+ --with-htmlbrowser=xdg-open \
+ --with-pdfviewer=xdg-open \
+ $(use_enable debug d1debug) \
+ $(use_with zlib) \
+ $(use_enable motionaveraging motion-averaging)
+}
+
+src_compile() {
+ default
+ if use emacs; then
+ cp "${FILESDIR}/gvcl-mode.el" "${S}"
+ elisp-compile *.el
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog NEWS INSTALL.Geomview || die
+ doicon "${WORKDIR}"/geomview.png || die
+ make_desktop_entry ${PN} "GeomView ${PV}" \
+ /usr/share/pixmaps/${PN}.png \
+ "Science;Math;Education"
+
+ if use emacs; then
+ elisp-install ${PN} *.el *.elc
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/geomview/metadata.xml b/sci-mathematics/geomview/metadata.xml
new file mode 100644
index 00000000000..3094fb6de48
--- /dev/null
+++ b/sci-mathematics/geomview/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-mathematics</herd>
+ <longdescription>Geomview is an interactive geometry viewer and Object Oriented Graphics Library (OOGL).</longdescription>
+ <use>
+ <flag name="motionaveraging">Enable experimental motion averaging technique</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">geomview</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/gfan/Manifest b/sci-mathematics/gfan/Manifest
new file mode 100644
index 00000000000..eee9388d133
--- /dev/null
+++ b/sci-mathematics/gfan/Manifest
@@ -0,0 +1 @@
+DIST gfan0.5.tar.gz 1134987 SHA256 d7307c8979220adc0a7ce5acf472178a6c280c963967df6241392ed9954cc1fb
diff --git a/sci-mathematics/gfan/files/gfan-0.5-double-declare-fix.patch b/sci-mathematics/gfan/files/gfan-0.5-double-declare-fix.patch
new file mode 100644
index 00000000000..23954088401
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.5-double-declare-fix.patch
@@ -0,0 +1,12 @@
+diff -U 3 -dHrN gfan0.5/app_minkowski.cpp gfan0.5-new/app_minkowski.cpp
+--- gfan0.5/app_minkowski.cpp 2011-01-23 12:21:47.000000000 -0500
++++ gfan0.5-new/app_minkowski.cpp 2012-06-29 15:23:48.604280985 -0400
+@@ -160,7 +160,7 @@
+ //log0 fprintf(Stderr,"4");
+ f.insert(c);
+ //log0 fprintf(Stderr,"5\n");
+- static int i;
++ // static int i;
+ //log0 fprintf(Stderr,"inserted:%i\n",++i);
+ }
+ log1 fprintf(Stderr,"Resolving symmetries.\n");
diff --git a/sci-mathematics/gfan/gfan-0.5.ebuild b/sci-mathematics/gfan/gfan-0.5.ebuild
new file mode 100644
index 00000000000..e08db31f7ee
--- /dev/null
+++ b/sci-mathematics/gfan/gfan-0.5.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="computes Groebner fans and tropical varities"
+HOMEPAGE="http://www.math.tu-berlin.de/~jensen/software/gfan/gfan.html"
+SRC_URI="http://www.math.tu-berlin.de/~jensen/software/gfan/${PN}${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="dev-libs/gmp[cxx]
+ sci-libs/cddlib"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}${PV}/"
+
+src_prepare () {
+ epatch "${FILESDIR}/${P}-double-declare-fix.patch"
+ sed -i -e "s/-O2/${CXXFLAGS}/" \
+ -e "/GPROFFLAG =/d" \
+ -e "s/g++/$(tc-getCXX)/" \
+ -e "s/\$(CCLINKER)/& \$(LDFLAGS)/" Makefile || die
+}
+
+src_install() {
+ emake PREFIX="${ED}/usr" install || die "emake install failed"
+}
diff --git a/sci-mathematics/gfan/metadata.xml b/sci-mathematics/gfan/metadata.xml
new file mode 100644
index 00000000000..9c8024fff3c
--- /dev/null
+++ b/sci-mathematics/gfan/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+</maintainer>
+<herd>sci-mathematics</herd>
+ <longdescription lang="en">
+ gfan is a computer algebra tool to compute Groebner fans and tropical varieties.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/ggnfs/Manifest b/sci-mathematics/ggnfs/Manifest
new file mode 100644
index 00000000000..11526490e57
--- /dev/null
+++ b/sci-mathematics/ggnfs/Manifest
@@ -0,0 +1,4 @@
+DIST def-nm-params.txt 3495 SHA256 5febf991cdd4112265bd58379c6d0819e6bb01b6e656902256fe13e4b63ba97c SHA512 b924292bc5354f87a3f88f2c35b767b9183704ced61c0e709cdd0974a2e1f34a4c170c6d12524b10162f63306f74001ad30e82ac7997d98db823006086772460 WHIRLPOOL 9ecabb6bee118269bd4d345582d36f9f82d54585ce7092adb3b6e1d27be4d0297201a408c76bb692047192a996982113d8387aad3c4764062f6d23f2f9febc82
+DIST def-par.txt 4957 SHA256 40d0b9be2c52282f29ff8cbc50799b625fc05b1da6eb7f2070fb3eb2ac81e7fa SHA512 fc0851513b1170e0a43e7458e24da4274146272018b7fefbe35280005ebeba20458756c4d4715b2a98780354dd1c5bcf31d98dd1388f1d352fb718062141c434 WHIRLPOOL 81151ab8235b2b55a7e8ceca4453b49bab3d3109eaf1352808b7e42c3612977402856c518ba8d8a1e5b6b80e33bbc3f33bdc565da5d3ee9e4251a1d253ace496
+DIST ggnfs-0.77.1.zip 2279013 SHA256 f6509661f22c562b3616e99989d39c160e8f49664e1fe3215d2f0d1441003a7a SHA512 77f5050d1310df5de45e80a25c8421cc9240ce11776fc4af596ce19d8b064b926dcc7e6dd7b2ef12d86056f7af0b67db2f746fc261cba24bbcf1efef06287513 WHIRLPOOL 5cb0e67aebd7ed9001ea2347b2211f9ca84ec50d18982436b111c0abb1c3223c66fbb5d029fa38d43e1137e7e7c7087daca85648fba7da92bbfcfe3760ccf87e
+DIST ggnfs-doc.pdf 252344 SHA256 6319442ba7fbeffa7000eb8ded1998877f3ecafc96551fa52c396d7f5d0775f2 SHA512 60f4153dbd31d7484b37a4f805eb71c9a785af884f228039136cd92e64ef145593dc0fde9e6f1c58a11d2d5124760d08d66566134f764e65f7dce86a36a11f01 WHIRLPOOL d93477a474172feb6bcb1db8cad04084496105e990d7906eee839ec49884718c3310e413cdfc6c3a36a42da755cf430a1db337a27a72a152aec6f62b17005758
diff --git a/sci-mathematics/ggnfs/files/ggnfs-0.77.1-gentoo.patch b/sci-mathematics/ggnfs/files/ggnfs-0.77.1-gentoo.patch
new file mode 100644
index 00000000000..ac751603414
--- /dev/null
+++ b/sci-mathematics/ggnfs/files/ggnfs-0.77.1-gentoo.patch
@@ -0,0 +1,158 @@
+ src/Makefile | 34 +++++++++++++++++-----------------
+ src/lasieve4/Makefile | 6 +++---
+ src/pol5/Makefile | 8 ++++----
+ 3 files changed, 24 insertions(+), 24 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 01f66be..59b433f 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,15 +1,15 @@
+ # Workaround for PPC
+ # Due to unknown reason -march isn't supported there
+ ifeq ($(ARCH),970)
+- ALLOPT=-mcpu=$(ARCH) -m64 -pipe
++ ALLOPT=
+ else
+- ALLOPT=-march=$(ARCH) -pipe
++ ALLOPT=
+ endif
+
+ INC=-I. -I.. -I../include $(LOCALINC)
+ LIBS=-lgmp -lm
+ BINDIR=../bin
+-LIBFLAGS=$(LOCALLIB)
++LDFLAGS+=$(LOCALLIB)
+
+ MATBUILD_TPIE=0
+ TPIE_DIR=../../tpie
+@@ -17,7 +17,7 @@ TPIE_DIR=../../tpie
+ # Turn on\off workaround for GMP 4.2 bug
+ # Consult http://swox.com/list-archives/gmp-bugs/2006-May/000475.html
+ # for more info
+-GMP_BUG=1
++GMP_BUG=0
+
+ ifeq ($(HOST),generic)
+ ALLOPT+= -DGGNFS_HOST_GENERIC
+@@ -32,10 +32,10 @@ ifeq ($(ARCH),prescott)
+ ALLOPT+= -DL2_CACHE_SIZE=1024
+ endif
+
+-DEBUGOPT=-W -Wall -g -pg
++DEBUGOPT=-W -Wall
+
+-CFLAGS=-DNDEBUG -O3 -funroll-loops -finline-functions \
+- -ftracer -fomit-frame-pointer -W -Wall $(ALLOPT)
++CFLAGS+=-DNDEBUG \
++ -W -Wall $(ALLOPT)
+ # CFLAGS=$(DEBUGOPT) $(ALLOPT)
+ # -ffast-math removed since -funsafe-math-optimizations seems to cause occasional problems, especially in sqrt
+
+@@ -71,7 +71,7 @@ endif
+ ifeq ($(MATBUILD_TPIE),1)
+ BINS+= $(BINDIR)/matbuild-tpie
+ INC+= -I$(TPIE_DIR)/include
+- LIBFLAGS+= -L$(TPIE_DIR)/lib
++ LDFLAGS+= -L$(TPIE_DIR)/lib
+ LIBS+=-ltpie
+ endif
+
+@@ -97,35 +97,35 @@ bins : $(BINS)
+ $(CC) $(CFLAGS) -o $@ -c $*.S
+
+ $(BINDIR)/sieve : sieve.c clsieve.c $(OBJS) makefb.o
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ $^ $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ $(BINDIR)/makefb : makefb.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -D_MAKEFB_STANDALONE -o $@ \
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -D_MAKEFB_STANDALONE -o $@ \
+ makefb.c $(OBJS) $(LIBS)
+
+ $(BINDIR)/procrels : procrels.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ procrels.c $(OBJS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ procrels.c $(OBJS) $(LIBS)
+
+ $(BINDIR)/matbuild : matbuild.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matbuild.c combparts.c \
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matbuild.c combparts.c \
+ $(OBJS) $(LIBS)
+
+ $(BINDIR)/matbuild-tpie : matbuild.c $(OBJS)
+- $(CPP) $(INC) $(CFLAGS) $(LIBFLAGS) -DGGNFS_TPIE -o $@ matbuild.c \
++ $(CPP) $(INC) $(CFLAGS) $(LDFLAGS) -DGGNFS_TPIE -o $@ matbuild.c \
+ experimental/combparts_tpie.cpp experimental/llist_tpie.cpp \
+ $(OBJS) $(LIBS)
+
+ $(BINDIR)/matprune : matprune.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matprune.c $(OBJS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matprune.c $(OBJS) $(LIBS)
+
+ $(BINDIR)/matsolve : matsolve.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matsolve.c $(OBJS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matsolve.c $(OBJS) $(LIBS)
+
+ $(BINDIR)/sqrt : sqrt.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ sqrt.c $(OBJS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ sqrt.c $(OBJS) $(LIBS)
+
+ $(BINDIR)/polyselect : polyselect.c $(OBJS)
+- $(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ polyselect.c $(OBJS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ polyselect.c $(OBJS) $(LIBS)
+
+ latsiever :
+ $(MAKE) -C lasieve4
+diff --git a/src/lasieve4/Makefile b/src/lasieve4/Makefile
+index 31e05a9..6886b16 100644
+--- a/src/lasieve4/Makefile
++++ b/src/lasieve4/Makefile
+@@ -10,8 +10,8 @@
+ # 6/13/04: Hacked up for use in GGNFS by Chris Monico.
+
+ INC=-I.. -I../../include $(LOCALINC)
+-LIBFLAGS=-L. $(LOCALLIB)
+-CFLAGS+=-Os
++LDFLAGS+=-L. $(LOCALLIB)
++CFLAGS+=
+
+ BINDIR=../../bin
+ FACT=prho.o
+@@ -58,7 +58,7 @@ gnfs-lasieve4eI%.o: gnfs-lasieve4e.c lasieve.h asm/siever-config.h
+
+ $(BINDIR)/gnfs-lasieve4I%e: gnfs-lasieve4eI%.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI%.a $(FACT)
+- $(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS)
++ $(CC) $(CFLAGS) $(INC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ asm/lib%.a:
+ $(MAKE) -C asm
+diff --git a/src/pol5/Makefile b/src/pol5/Makefile
+index 44b08be..e474ffb 100644
+--- a/src/pol5/Makefile
++++ b/src/pol5/Makefile
+@@ -1,6 +1,6 @@
+ BINDIR=../../bin
+ INC=-I.. -I../../include $(LOCALINC)
+-LIBFLAGS=$(LOCALLIB)
++LDFLAGS+=$(LOCALLIB)
+ LIBS=-lm -lgmp
+ CFLAGS2=
+
+@@ -46,13 +46,13 @@ all: $(BINS)
+ $(CC) $(INC) -c $(CFLAGS) $(CFLAGS2) $^
+
+ $(BINDIR)/pol51m0b: pol51m0b.o $(OBJS) $(OBJS2)
+- $(CC) $(INC) -o $@ $(CFLAGS) $(CFLAGS2) $^ $(LIBFLAGS) $(LIBS)
++ $(CC) $(INC) $(LDFLAGS) -o $@ $(CFLAGS) $(CFLAGS2) $^ $(LIBS)
+
+ $(BINDIR)/pol51m0n: pol51m0n.o $(OBJS) $(OBJS3)
+- $(CC) $(INC) $(CFLAGS) $(CFLAGS2) -o $@ $^ $(LIBFLAGS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ $(BINDIR)/pol51opt: pol51opt.o $(OBJS) $(OBJS4)
+- $(CC) $(INC) $(CFLAGS) $(CFLAGS2) -o $@ $^ $(LIBFLAGS) $(LIBS)
++ $(CC) $(INC) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ clean : ;
+ rm -f $(BINS) *.o core
diff --git a/sci-mathematics/ggnfs/ggnfs-0.77.1-r2.ebuild b/sci-mathematics/ggnfs/ggnfs-0.77.1-r2.ebuild
new file mode 100644
index 00000000000..30cf4c9e1c7
--- /dev/null
+++ b/sci-mathematics/ggnfs/ggnfs-0.77.1-r2.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
+
+DESCRIPTION="A suite of algorithms to help factoring large integers"
+# inactive old homepage exists, this is a fork
+HOMEPAGE="https://github.com/radii/ggnfs"
+# snapshot because github makes people stupid
+SRC_URI="
+ http://dev.gentooexperimental.org/~dreeevil/${P}.zip
+ http://stuff.mit.edu/afs/sipb/project/pari-gp/ggnfs/Linux/src/def-par.txt
+ http://stuff.mit.edu/afs/sipb/project/pari-gp/ggnfs/Linux/src/def-nm-params.txt
+ http://gentooexperimental.org/~patrick/ggnfs-doc.pdf"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/gmp-4.3:0
+ app-arch/unzip"
+RDEPEND="${DEPEND}
+ !sci-mathematics/cado-nfs" # file collisions, fixable
+
+S=${WORKDIR}/${PN}-master
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ echo "#define GGNFS_VERSION \"0.77.1-$ARCH\"" > include/version.h || die
+ # fix directory symlink, add missing targets, rewrite variable used by portage internally
+ cd src/lasieve4 && rm -f -r asm && ln -s ppc32 asm || die
+ sed -i -e 's/all: liblasieve.a/all: liblasieve.a liblasieveI11.a liblasieveI15.a liblasieveI16.a/' asm/Makefile || die
+ cd "${S}"
+ sed -i -e 's/ARCH/MARCH/g' Makefile src/Makefile || die
+ sed -i -e 's/$(LSBINS) strip/$(LSBINS)/' src/Makefile || die #No stripping!
+ sed -i -e 's/SVN \$Revision\$/0.77.1 snapshot/' src/experimental/lasieve4_64/gnfs-lasieve4e.c src/lasieve4/gnfs-lasieve4e.c || die
+ tc-export CC
+}
+
+src_configure() { :; }
+
+src_compile() {
+ # setting MARCH like this is fugly, but it uses -march=$ARCH - better fix welcome
+ # it also assumes a recent-ish compiler
+ cd src
+ HOST="generic" MARCH="${ARCH}" emake -j1
+}
+
+src_install() {
+ mkdir -p "${D}/usr/bin/"
+ for i in gnfs-lasieve4I11e gnfs-lasieve4I12e gnfs-lasieve4I13e gnfs-lasieve4I14e \
+ gnfs-lasieve4I15e gnfs-lasieve4I16e makefb matbuild matprune matsolve pol51m0b pol51m0n \
+ pol51opt polyselect procrels sieve sqrt; do
+ cp "${S}/bin/${i}" "${D}/usr/bin/" || die
+ done
+ mkdir -p "${D}/usr/share/doc/${PN}"
+ cp "${DISTDIR}/def-par.txt" "${D}/usr/share/doc/${PN}" || die
+ cp "${DISTDIR}/def-nm-params.txt" "${D}/usr/share/doc/${PN}" || die
+ docompress -x "/usr/share/doc/${PN}/def-par.txt"
+ docompress -x "/usr/share/doc/${PN}/def-nm-params.txt"
+ # TODO: docs? File collisions?
+ cp ${DISTDIR}/ggnfs-doc.pdf "${D}/usr/share/doc/${PN}" || die
+}
diff --git a/sci-mathematics/ggnfs/metadata.xml b/sci-mathematics/ggnfs/metadata.xml
new file mode 100644
index 00000000000..b5260b94eb2
--- /dev/null
+++ b/sci-mathematics/ggnfs/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">radii/ggnfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/gimps/Manifest b/sci-mathematics/gimps/Manifest
new file mode 100644
index 00000000000..47f3c2419da
--- /dev/null
+++ b/sci-mathematics/gimps/Manifest
@@ -0,0 +1,6 @@
+DIST p95v279.linux32.tar.gz 4539547 SHA256 500d7e0f5a6f19084bdc439f25532ca0b8609ceb4fe88f792fbc01dd844abdbe SHA512 a4391e3767492cd427390206e5e5cd1da70b062214cd2e067914c18df76d8dd4688991e3269cb22f9ea006f208b3659e0940ed555f36749189cc58dad6457254 WHIRLPOOL e6ecc301dcc558906ea523c94ea8cb61c99505de6f171f0b070c75b0999edb9155aa1c2c15aa5c3b6a579fd72aba12c1ff08ff3e0377d7a50e30f7333221cebc
+DIST p95v279.linux64.tar.gz 4873050 SHA256 7fb64f49f4825945d0ed470ecaa12f4b1ffc62c5e56edc7a181fb0751785692d SHA512 555a53f46f49131b737b44bd8a8fca018e40812beefd0fe4bc452501c65e68c892460aa3c816bc8f9d38d62f1afd0d031a51aa0936f103bb0f8b9272947bd697 WHIRLPOOL 3424ace005d9453a5ec2633d02f03cbf37bd32ec8bc8c87478ba09c4c6046016b658f2a21a320a62ab2cdb68c9ec1c492006b9a5a7a607fd57c4257caf856e97
+DIST p95v285.linux32.tar.gz 4608961 SHA256 534b7e5ab5e1574b51a2bb2928f057f91d375f49a5ba9507be1638544a6d431e SHA512 7fcf6d3f746a1af9421f00938524c86c1d72d34006505144389719aa18557318b3849f9202b122e5732b7d4a80a5d6df3b08d751617074bf6dd36002c5d1d399 WHIRLPOOL 257cf83598c0b83b11e2645541b30ef5cafa9728148b131504c81d52513610ac00194d24b6a77f162499c0fbad3ea9443d76ab3bb38fc291b998a54a0c78c7d4
+DIST p95v285.linux64.tar.gz 5658391 SHA256 185959f251f1c91591ced4436065e6837758e7d0fcce6cceaba04c4ba4161313 SHA512 1076fbec085fe18db665d538e54f1c7b6272aee5a9886f5a5c5528713435610c6c45a076cc9c40e2b7fcb72a83feb3b9051c6d78a00c623194668b0f023b0a80 WHIRLPOOL a792867121732fff818bf7be148f8da4d6386d2bc81d0b0cf0da639787a1f8cea04796e902c7df480f1f7a31f93c2e26710232a570ff3da07ecf09d25b47e259
+DIST p95v286.linux32.tar.gz 4610624 SHA256 dc4e90670c984e2e2628022b9e7347220e50e06f4d17c3bce21ffd743aeb26fb SHA512 fc78c06eea5850b84f4f8d62c042a0cac1280711a40a55c78cf31610acfeb55773098041c4bf93c2e89e7e2b32f37da4d9d714bfc69116cb3131fc3bf7137d2c WHIRLPOOL 4dab596cd6503df2370faaf111c32affe6cbdafa75b225c40f88c45856d9f33ec4b9072e115b69af3116c5679e77a8c528f13356abdd3f6b7c4c4db8a7f99391
+DIST p95v286.linux64.tar.gz 5661343 SHA256 50e86250e774ffb4120a17cf778411cac62a9ffa41e32ccf532f99eff3660f28 SHA512 b6fa3ff241feeca98dae7792d4912f491911a70a33ba243fac38ca43ba31fe1fddb6dea37670f082e6efa91abd24e0443143b031697d135cd270efa3d3998469 WHIRLPOOL 05dcd380528f1bc79303609174c65174e19f67b828245860b0516666b1b146331fb1148a007d1285be0dbd2e4ae73e53ced5dff5f59e37b524a9e3ab3176f87f
diff --git a/sci-mathematics/gimps/files/gimps-25.6-conf.d b/sci-mathematics/gimps/files/gimps-25.6-conf.d
new file mode 100644
index 00000000000..4b98e1dbc28
--- /dev/null
+++ b/sci-mathematics/gimps/files/gimps-25.6-conf.d
@@ -0,0 +1,12 @@
+# Config file for /etc/init.d/gimps
+
+USER="nobody"
+GROUP="nobody"
+
+# set up any options you want for GIMPS
+# for more info, `mprime -h`
+# GIMPS_OPTIONS=""
+
+# this is the directory where GIMPS run-time
+# data files will be stored
+GIMPS_DIR=/var/lib/gimps
diff --git a/sci-mathematics/gimps/files/gimps-26.6-r1-init.d b/sci-mathematics/gimps/files/gimps-26.6-r1-init.d
new file mode 100644
index 00000000000..dfee0e8c0c3
--- /dev/null
+++ b/sci-mathematics/gimps/files/gimps-26.6-r1-init.d
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -e "${GIMPS_DIR}" ]; then
+ einfo "Creating ${GIMPS_DIR}"
+ /bin/mkdir "${GIMPS_DIR}"
+ fi
+
+ /bin/chown -R ${USER}:${GROUP} ${GIMPS_DIR}
+
+ if [ ! -e "${GIMPS_DIR}/local.txt" ]; then
+ eerror "GIMPS has not been configured. Please configure it manually before"
+ eerror "starting this initscript."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting GIMPS"
+ start-stop-daemon --quiet --start -b --exec /opt/gimps/mprime \
+ --chdir ${GIMPS_DIR} --user ${USER}:${GROUP} \
+ -- -w${GIMPS_DIR} ${GIMPS_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping GIMPS"
+ start-stop-daemon --quiet --stop --exec /opt/gimps/mprime
+ eend $?
+}
diff --git a/sci-mathematics/gimps/files/gimps.service b/sci-mathematics/gimps/files/gimps.service
new file mode 100644
index 00000000000..d3436717b17
--- /dev/null
+++ b/sci-mathematics/gimps/files/gimps.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Great Internet Mersenne Prime Search client
+After=network.target local-fs.target
+Wants=local-fs.target
+
+[Service]
+User=nobody
+Group=nobody
+ExecStart=/opt/gimps/mprime -w/var/lib/gimps
+StandardOutput=null
+StandardError=journal
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sci-mathematics/gimps/files/gimps.tmpfiles b/sci-mathematics/gimps/files/gimps.tmpfiles
new file mode 100644
index 00000000000..c965e7de535
--- /dev/null
+++ b/sci-mathematics/gimps/files/gimps.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/gimps 0755 nobody nobody -
diff --git a/sci-mathematics/gimps/gimps-27.9-r2.ebuild b/sci-mathematics/gimps/gimps-27.9-r2.ebuild
new file mode 100644
index 00000000000..0a48670de02
--- /dev/null
+++ b/sci-mathematics/gimps/gimps-27.9-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pax-utils systemd
+
+DESCRIPTION="The Great Internet Mersenne Prime Search"
+HOMEPAGE="http://mersenne.org/"
+SRC_URI="
+ amd64? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux64.tar.gz )
+ x86? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux32.tar.gz )"
+
+SLOT="0"
+LICENSE="GIMPS"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+# Since there are no statically linked binaries for this version of mprime,
+# and no static binaries for amd64 in general, we use the dynamically linked
+# ones and try to cover the .so deps with the packages listed in RDEPEND.
+DEPEND=""
+RDEPEND="net-misc/curl"
+
+S="${WORKDIR}"
+I="/opt/gimps"
+
+QA_PREBUILT="opt/gimps/mprime"
+
+src_install() {
+ dodir ${I} /var/lib/gimps
+ pax-mark m mprime
+ cp mprime "${D}/${I}"
+ fperms a-w "${I}/mprime"
+ fowners root:0 "${I}"
+ fowners root:0 "${I}/mprime"
+
+ dodoc license.txt readme.txt stress.txt whatsnew.txt undoc.txt
+
+ newinitd "${FILESDIR}/${PN}-26.6-r1-init.d" gimps
+ newconfd "${FILESDIR}/${PN}-25.6-conf.d" gimps
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
+}
+
+pkg_postinst() {
+ echo
+ einfo "You can use \`/etc/init.d/gimps start\` to start a GIMPS client in the"
+ einfo "background at boot. Have a look at /etc/conf.d/gimps and check some"
+ einfo "configuration options."
+ einfo
+ einfo "If you don't want to use the init script to start gimps, remember to"
+ einfo "pass it an additional command line parameter specifying where the data"
+ einfo "files are to be stored, e.g.:"
+ einfo " ${I}/mprime -w/var/lib/gimps"
+ echo
+}
+
+pkg_postrm() {
+ echo
+ einfo "GIMPS data files were not removed."
+ einfo "Remove them manually from /var/lib/gimps/"
+ echo
+}
diff --git a/sci-mathematics/gimps/gimps-28.5.ebuild b/sci-mathematics/gimps/gimps-28.5.ebuild
new file mode 100644
index 00000000000..0a48670de02
--- /dev/null
+++ b/sci-mathematics/gimps/gimps-28.5.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pax-utils systemd
+
+DESCRIPTION="The Great Internet Mersenne Prime Search"
+HOMEPAGE="http://mersenne.org/"
+SRC_URI="
+ amd64? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux64.tar.gz )
+ x86? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux32.tar.gz )"
+
+SLOT="0"
+LICENSE="GIMPS"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+# Since there are no statically linked binaries for this version of mprime,
+# and no static binaries for amd64 in general, we use the dynamically linked
+# ones and try to cover the .so deps with the packages listed in RDEPEND.
+DEPEND=""
+RDEPEND="net-misc/curl"
+
+S="${WORKDIR}"
+I="/opt/gimps"
+
+QA_PREBUILT="opt/gimps/mprime"
+
+src_install() {
+ dodir ${I} /var/lib/gimps
+ pax-mark m mprime
+ cp mprime "${D}/${I}"
+ fperms a-w "${I}/mprime"
+ fowners root:0 "${I}"
+ fowners root:0 "${I}/mprime"
+
+ dodoc license.txt readme.txt stress.txt whatsnew.txt undoc.txt
+
+ newinitd "${FILESDIR}/${PN}-26.6-r1-init.d" gimps
+ newconfd "${FILESDIR}/${PN}-25.6-conf.d" gimps
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
+}
+
+pkg_postinst() {
+ echo
+ einfo "You can use \`/etc/init.d/gimps start\` to start a GIMPS client in the"
+ einfo "background at boot. Have a look at /etc/conf.d/gimps and check some"
+ einfo "configuration options."
+ einfo
+ einfo "If you don't want to use the init script to start gimps, remember to"
+ einfo "pass it an additional command line parameter specifying where the data"
+ einfo "files are to be stored, e.g.:"
+ einfo " ${I}/mprime -w/var/lib/gimps"
+ echo
+}
+
+pkg_postrm() {
+ echo
+ einfo "GIMPS data files were not removed."
+ einfo "Remove them manually from /var/lib/gimps/"
+ echo
+}
diff --git a/sci-mathematics/gimps/gimps-28.6.ebuild b/sci-mathematics/gimps/gimps-28.6.ebuild
new file mode 100644
index 00000000000..0a48670de02
--- /dev/null
+++ b/sci-mathematics/gimps/gimps-28.6.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pax-utils systemd
+
+DESCRIPTION="The Great Internet Mersenne Prime Search"
+HOMEPAGE="http://mersenne.org/"
+SRC_URI="
+ amd64? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux64.tar.gz )
+ x86? ( ftp://mersenne.org/gimps/p95v${PV/./}.linux32.tar.gz )"
+
+SLOT="0"
+LICENSE="GIMPS"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+# Since there are no statically linked binaries for this version of mprime,
+# and no static binaries for amd64 in general, we use the dynamically linked
+# ones and try to cover the .so deps with the packages listed in RDEPEND.
+DEPEND=""
+RDEPEND="net-misc/curl"
+
+S="${WORKDIR}"
+I="/opt/gimps"
+
+QA_PREBUILT="opt/gimps/mprime"
+
+src_install() {
+ dodir ${I} /var/lib/gimps
+ pax-mark m mprime
+ cp mprime "${D}/${I}"
+ fperms a-w "${I}/mprime"
+ fowners root:0 "${I}"
+ fowners root:0 "${I}/mprime"
+
+ dodoc license.txt readme.txt stress.txt whatsnew.txt undoc.txt
+
+ newinitd "${FILESDIR}/${PN}-26.6-r1-init.d" gimps
+ newconfd "${FILESDIR}/${PN}-25.6-conf.d" gimps
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
+}
+
+pkg_postinst() {
+ echo
+ einfo "You can use \`/etc/init.d/gimps start\` to start a GIMPS client in the"
+ einfo "background at boot. Have a look at /etc/conf.d/gimps and check some"
+ einfo "configuration options."
+ einfo
+ einfo "If you don't want to use the init script to start gimps, remember to"
+ einfo "pass it an additional command line parameter specifying where the data"
+ einfo "files are to be stored, e.g.:"
+ einfo " ${I}/mprime -w/var/lib/gimps"
+ echo
+}
+
+pkg_postrm() {
+ echo
+ einfo "GIMPS data files were not removed."
+ einfo "Remove them manually from /var/lib/gimps/"
+ echo
+}
diff --git a/sci-mathematics/gimps/metadata.xml b/sci-mathematics/gimps/metadata.xml
new file mode 100644
index 00000000000..81018d3a835
--- /dev/null
+++ b/sci-mathematics/gimps/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-mathematics</herd>
+ <maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-mathematics/ginac/Manifest b/sci-mathematics/ginac/Manifest
new file mode 100644
index 00000000000..9fafd43dd3e
--- /dev/null
+++ b/sci-mathematics/ginac/Manifest
@@ -0,0 +1,3 @@
+DIST ginac-1.5.8.tar.bz2 1003965 SHA256 8ce72e70f7539e9a2b32539e13eb651fd688d1423dd90bcf0b9c37b592cfc2dd
+DIST ginac-1.6.1.tar.bz2 1048724 SHA256 0658c4a528f37871c5ec24496373fede4e3e59d3223beaf880c75f07a9c2f680
+DIST ginac-1.6.2.tar.bz2 1048764 SHA256 0f34d255024b3fb258e44da84f9e82dfb3dc9bc15f0999b7a18204a730663bde SHA512 6625f9958a1a6167e49d3a3ca442855fa1eab88926565747fda70a8b770db34da0c001f175fa94102ecec1f823d921eba9c98daabd6ed63548bff2b31a3b49cb WHIRLPOOL 40442b8c5820165f4970e95107ce2ac8e22d1c39b60be615d00eefe1f94e061eb6407cf3e8c0bfab15b4b9974168c97ece6cc188c76a8e9484ad9ff065f87962
diff --git a/sci-mathematics/ginac/files/ginac-1.5.1-pkgconfig.patch b/sci-mathematics/ginac/files/ginac-1.5.1-pkgconfig.patch
new file mode 100644
index 00000000000..5a6784d6b80
--- /dev/null
+++ b/sci-mathematics/ginac/files/ginac-1.5.1-pkgconfig.patch
@@ -0,0 +1,9 @@
+--- ginac-1.4.4.org/ginac.pc.in 2009-03-16 21:17:22.000000000 +0530
++++ ginac-1.4.4/ginac.pc.in 2009-03-16 21:25:28.000000000 +0530
+@@ -7,5 +7,5 @@
+ Description: C++ library for symbolic calculations
+ Version: @VERSION@
+ Requires: cln >= 1.1.6
+-Libs: -L${libdir} -lginac @GINACLIB_RPATH@
++Libs: -L${libdir} -lginac
+ Cflags: -I${includedir}
diff --git a/sci-mathematics/ginac/ginac-1.5.8.ebuild b/sci-mathematics/ginac/ginac-1.5.8.ebuild
new file mode 100644
index 00000000000..e790ea18fb0
--- /dev/null
+++ b/sci-mathematics/ginac/ginac-1.5.8.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="C++ library and tools for symbolic calculations"
+SRC_URI="ftp://ftpthep.physik.uni-mainz.de/pub/GiNaC/${P}.tar.bz2"
+HOMEPAGE="http://www.ginac.de/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="doc"
+
+RDEPEND=">=sci-libs/cln-1.2.2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen
+ media-gfx/transfig
+ virtual/texi2dvi
+ dev-texlive/texlive-fontsrecommended
+ )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.1-pkgconfig.patch
+}
+
+src_compile() {
+ emake || die "emake failed"
+ if use doc; then
+ export VARTEXFONTS="${T}"/fonts
+ cd "${S}/doc/reference"
+ #pdf generation for reference failed (1.5.1), bug #264774
+ #emake html pdf || die "emake doc reference failed"
+ emake html || die "emake ref failed"
+ cd "${S}/doc/tutorial"
+ emake ginac.pdf ginac.html || die "emake doc tutorial failed"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README NEWS AUTHORS || die
+
+ if use doc; then
+ cd doc
+ insinto /usr/share/doc/${PF}
+ newins tutorial/ginac.pdf tutorial.pdf || die "tutorial install failed"
+ #newins reference/ginac.pdf reference.pdf || die "ref install failed"
+ insinto /usr/share/doc/${PF}/html/reference
+ doins -r reference/html_files/* || die
+ insinto /usr/share/doc/${PF}/html
+ newins tutorial/ginac.html tutorial.html
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*.cpp examples/ginac-examples.txt
+ fi
+}
diff --git a/sci-mathematics/ginac/ginac-1.6.1.ebuild b/sci-mathematics/ginac/ginac-1.6.1.ebuild
new file mode 100644
index 00000000000..a7b49f90b91
--- /dev/null
+++ b/sci-mathematics/ginac/ginac-1.6.1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="C++ library and tools for symbolic calculations"
+SRC_URI="ftp://ftpthep.physik.uni-mainz.de/pub/GiNaC/${P}.tar.bz2"
+HOMEPAGE="http://www.ginac.de/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="doc static-libs"
+
+RDEPEND=">=sci-libs/cln-1.2.2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen
+ media-gfx/transfig
+ virtual/texi2dvi
+ dev-texlive/texlive-fontsrecommended
+ )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.1-pkgconfig.patch
+}
+
+src_configure() {
+ econf \
+ --disable-rpath \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake
+ if use doc; then
+ export VARTEXFONTS="${T}"/fonts
+ cd "${S}/doc/reference"
+ #pdf generation for reference failed (1.5.1), bug #264774
+ #emake html pdf || die "emake doc reference failed"
+ emake html
+ cd "${S}/doc/tutorial"
+ emake ginac.pdf ginac.html
+ fi
+}
+
+src_install() {
+ default
+ if use doc; then
+ cd doc
+ insinto /usr/share/doc/${PF}
+ newins tutorial/ginac.pdf tutorial.pdf
+ insinto /usr/share/doc/${PF}/html/reference
+ doins -r reference/html_files/*
+ insinto /usr/share/doc/${PF}/html
+ newins tutorial/ginac.html tutorial.html
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*.cpp examples/ginac-examples.txt
+ fi
+}
diff --git a/sci-mathematics/ginac/ginac-1.6.2.ebuild b/sci-mathematics/ginac/ginac-1.6.2.ebuild
new file mode 100644
index 00000000000..14791558d1a
--- /dev/null
+++ b/sci-mathematics/ginac/ginac-1.6.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="C++ library and tools for symbolic calculations"
+SRC_URI="ftp://ftpthep.physik.uni-mainz.de/pub/GiNaC/${P}.tar.bz2"
+HOMEPAGE="http://www.ginac.de/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc static-libs"
+
+RDEPEND=">=sci-libs/cln-1.2.2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen
+ media-gfx/transfig
+ virtual/texi2dvi
+ dev-texlive/texlive-fontsrecommended
+ )"
+
+PATCHES=( "${FILESDIR}"/${PN}-1.5.1-pkgconfig.patch )
+
+src_configure() {
+ local myeconfargs=( --disable-rpath )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+ if use doc; then
+ export VARTEXFONTS="${T}"/fonts
+ cd "${BUILD_DIR}/doc/reference"
+ #pdf generation for reference failed (1.6.2), bug #264774
+ #emake html pdf
+ emake html
+ cd "${BUILD_DIR}/doc/tutorial"
+ emake ginac.pdf ginac.html
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use doc; then
+ cd ${BUILD_DIR}/doc
+ insinto /usr/share/doc/${PF}
+ newins tutorial/ginac.pdf tutorial.pdf
+ insinto /usr/share/doc/${PF}/html/reference
+ doins -r reference/html_files/*
+ insinto /usr/share/doc/${PF}/html
+ newins tutorial/ginac.html tutorial.html
+ insinto /usr/share/doc/${PF}/examples
+ doins "${S}"/doc/examples/*.cpp examples/ginac-examples.*
+ fi
+}
diff --git a/sci-mathematics/ginac/metadata.xml b/sci-mathematics/ginac/metadata.xml
new file mode 100644
index 00000000000..307010c65aa
--- /dev/null
+++ b/sci-mathematics/ginac/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-mathematics</herd>
+<longdescription lang="en">
+ GiNaC is an iterated and recursive acronym for GiNaC is Not a CAS,
+ where CAS stands for Computer Algebra System. It is designed to allow
+ the creation of integrated systems that embed symbolic manipulations
+ together with more established areas of computer science (like
+ computation-intense numeric applications, graphical interfaces, etc.)
+ under one roof.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/glpk/Manifest b/sci-mathematics/glpk/Manifest
new file mode 100644
index 00000000000..0a4f763600c
--- /dev/null
+++ b/sci-mathematics/glpk/Manifest
@@ -0,0 +1,4 @@
+DIST glpk-4.45.tar.gz 3132439 SHA256 9207cb613d4436d9a66bc1b1f2018176d106cef0e92a3a85500feeec373be98c SHA512 27089b760d89ee16c5a3332d319007af4b05e8d27df0b990311508f856a01461d8b7b40b111bbf1f3dd4d754af84000112f95349d5286e6d3e42e56226f98649 WHIRLPOOL 7c050210e29f4c13b39e85dc10c9aeed846d7ee912c7dac5a83d13b87648a4e4bf4dce365d2575b6ad7994c56570d74ec87c219f101aaccbec39fd0e14353182
+DIST glpk-4.48.tar.gz 3488482 SHA256 abc2c8f895b20a91cdfcfc04367a0bc8677daf8b4ec3f3e86c5b71c79ac6adb1 SHA512 16795e6cf4db302f25e06e5c9a660e5ed8c7b24ffc5126cde0f864e83fa77d4d61838eab4f716291d568963dddf7442a36a39425a62bd58bd00ca73dac4ffa70 WHIRLPOOL c3e826d08cc6033e8553d7d1fb2a556d42622f38a184e8bbc18bf29d872103245218482b749bfb214cf707cc60eaaf54d7e6840537b483cf8e63c2d33b2c313d
+DIST glpk-4.54.tar.gz 3098202 SHA256 ab72c8078402d34d176eda18c3f9a6ef006e223d530897a4d1d73fb4ad12f9a1 SHA512 7eb815a6d8416dd9f2bb94e9a4aef493c171898404ebc6276fcc1c4f3b4244220213a2bd098707104589348080820a7cb8a717aab73ca513f05b2f9a10aea070 WHIRLPOOL 56ff0baf5e98fdc8e12e4d4db664a4a287dc358dd75839d90d463c04e3e7d97b1023ea93217dd642f6737cccddecdb8f534980e48f8893aff395dc430622de69
+DIST glpk-4.55.tar.gz 3424345 SHA256 37090d7f16796ec1034496e182a39d5cc8bb7c9fb5dc48a38b13d620bf2b1de7 SHA512 a0c8ce0c850e0075098f0526db8f7584a86d5cb44d8ddefa55abf9f1f66af89f5aec19cf1cad51fc5585d8dfa50eab6ece984a038e00c472aec2ef1473eac689 WHIRLPOOL 4b3f543c862008dd09e867947c0383eb2f482f63b8fe30d9f682ccc7d0af1693af043c8cd63362be1bc736ef39393d59cdf0196326b08c7f48495bb5b5937487
diff --git a/sci-mathematics/glpk/files/glpk-4.52.1-mariadb-5.5.patch b/sci-mathematics/glpk/files/glpk-4.52.1-mariadb-5.5.patch
new file mode 100644
index 00000000000..06aa8e5de95
--- /dev/null
+++ b/sci-mathematics/glpk/files/glpk-4.52.1-mariadb-5.5.patch
@@ -0,0 +1,11 @@
+--- glpk-4.52.1/src/glpsql.c.orig 2014-02-05 22:14:21.487843989 +0100
++++ glpk-4.52.1/src/glpsql.c 2014-02-05 22:14:32.764510562 +0100
+@@ -1106,8 +1106,6 @@
+ #define byte_defined 1
+ #endif
+
+-#include <my_global.h>
+-#include <my_sys.h>
+ #include <mysql.h>
+
+ struct db_mysql
diff --git a/sci-mathematics/glpk/files/glpk-4.53-debundle-system-libs.patch b/sci-mathematics/glpk/files/glpk-4.53-debundle-system-libs.patch
new file mode 100644
index 00000000000..326e6130154
--- /dev/null
+++ b/sci-mathematics/glpk/files/glpk-4.53-debundle-system-libs.patch
@@ -0,0 +1,87 @@
+Remove suitesparse (camd,colamd) and zlib bundles
+
+--- configure.ac.orig 2014-03-24 10:40:24.406906149 -0700
++++ configure.ac 2014-03-24 10:41:15.637207696 -0700
+@@ -140,6 +140,13 @@
+ AC_MSG_RESULT([no])
+ fi
+
++AC_CHECK_LIB([amd], [amd_1])
++AC_CHECK_LIB([colamd], [colamd])
++
++AC_CHECK_HEADER([amd.h])
++
++AC_CHECK_LIB([z], [gzopen])
++
+ AC_CONFIG_FILES(
+ [src/Makefile examples/Makefile Makefile])
+ AC_OUTPUT
+--- src/Makefile.am.orig 2014-03-24 10:40:24.413906191 -0700
++++ src/Makefile.am 2014-03-24 10:41:15.636207690 -0700
+@@ -6,15 +6,12 @@
+
+ libglpk_la_CPPFLAGS = \
+ -I$(srcdir) \
+--I$(srcdir)/amd \
+ -I$(srcdir)/bflib \
+ -I$(srcdir)/cglib \
+--I$(srcdir)/colamd \
+ -I$(srcdir)/env \
+ -I$(srcdir)/minisat \
+ -I$(srcdir)/misc \
+--I$(srcdir)/proxy \
+--I$(srcdir)/zlib
++-I$(srcdir)/proxy
+
+ libglpk_la_LDFLAGS = \
+ -version-info 37:0:1 \
+@@ -93,18 +90,6 @@
+ glpssx02.c \
+ glptsp.c \
+ lux.c \
+-amd/amd_1.c \
+-amd/amd_2.c \
+-amd/amd_aat.c \
+-amd/amd_control.c \
+-amd/amd_defaults.c \
+-amd/amd_dump.c \
+-amd/amd_info.c \
+-amd/amd_order.c \
+-amd/amd_post_tree.c \
+-amd/amd_postorder.c \
+-amd/amd_preprocess.c \
+-amd/amd_valid.c \
+ bflib/fhv.c \
+ bflib/fhvint.c \
+ bflib/ifu.c \
+@@ -114,7 +99,6 @@
+ bflib/sva.c \
+ cglib/cfg.c \
+ cglib/cfg1.c \
+-colamd/colamd.c \
+ env/alloc.c \
+ env/dlsup.c \
+ env/env.c \
+@@ -147,21 +131,6 @@
+ misc/wclique.c \
+ misc/wclique1.c \
+ proxy/proxy.c \
+-proxy/proxy1.c \
+-zlib/adler32.c \
+-zlib/compress.c \
+-zlib/crc32.c \
+-zlib/deflate.c \
+-zlib/gzclose.c \
+-zlib/gzlib.c \
+-zlib/gzread.c \
+-zlib/gzwrite.c \
+-zlib/inffast.c \
+-zlib/inflate.c \
+-zlib/inftrees.c \
+-zlib/trees.c \
+-zlib/uncompr.c \
+-zlib/zio.c \
+-zlib/zutil.c
++proxy/proxy1.c
+
+ ## eof ##
diff --git a/sci-mathematics/glpk/files/glpk-4.54-debundle-system-libs.patch b/sci-mathematics/glpk/files/glpk-4.54-debundle-system-libs.patch
new file mode 100644
index 00000000000..a3140341a48
--- /dev/null
+++ b/sci-mathematics/glpk/files/glpk-4.54-debundle-system-libs.patch
@@ -0,0 +1,86 @@
+Remove suitesparse (camd,colamd) and zlib bundles
+bicatali - apr 2014
+
+--- configure.ac.orig 2014-04-05 14:18:56.045148287 -0700
++++ configure.ac 2014-04-05 14:23:24.878803309 -0700
+@@ -59,6 +59,11 @@
+ dnl Check for math library
+ AC_CHECK_LIB([m], [exp])
+
++AC_CHECK_LIB([amd], [amd_1])
++AC_CHECK_LIB([colamd], [colamd])
++AC_CHECK_HEADER([amd.h])
++AC_CHECK_LIB([z], [gzopen])
++
+ dnl Check for <sys/time.h> header
+ AC_CHECK_HEADER([sys/time.h],
+ AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A]))
+--- src/Makefile.am.orig 2014-04-05 14:19:16.401273769 -0700
++++ src/Makefile.am 2014-04-05 14:21:56.696259485 -0700
+@@ -6,15 +6,12 @@
+
+ libglpk_la_CPPFLAGS = \
+ -I$(srcdir) \
+--I$(srcdir)/amd \
+ -I$(srcdir)/bflib \
+ -I$(srcdir)/cglib \
+--I$(srcdir)/colamd \
+ -I$(srcdir)/env \
+ -I$(srcdir)/minisat \
+ -I$(srcdir)/misc \
+--I$(srcdir)/proxy \
+--I$(srcdir)/zlib
++-I$(srcdir)/proxy
+
+ libglpk_la_LDFLAGS = \
+ -version-info 37:1:1 \
+@@ -92,18 +89,6 @@
+ glpssx02.c \
+ glptsp.c \
+ lux.c \
+-amd/amd_1.c \
+-amd/amd_2.c \
+-amd/amd_aat.c \
+-amd/amd_control.c \
+-amd/amd_defaults.c \
+-amd/amd_dump.c \
+-amd/amd_info.c \
+-amd/amd_order.c \
+-amd/amd_post_tree.c \
+-amd/amd_postorder.c \
+-amd/amd_preprocess.c \
+-amd/amd_valid.c \
+ bflib/btf.c \
+ bflib/btfint.c \
+ bflib/fhv.c \
+@@ -117,7 +102,6 @@
+ bflib/sva.c \
+ cglib/cfg.c \
+ cglib/cfg1.c \
+-colamd/colamd.c \
+ env/alloc.c \
+ env/dlsup.c \
+ env/env.c \
+@@ -150,21 +134,6 @@
+ misc/wclique.c \
+ misc/wclique1.c \
+ proxy/proxy.c \
+-proxy/proxy1.c \
+-zlib/adler32.c \
+-zlib/compress.c \
+-zlib/crc32.c \
+-zlib/deflate.c \
+-zlib/gzclose.c \
+-zlib/gzlib.c \
+-zlib/gzread.c \
+-zlib/gzwrite.c \
+-zlib/inffast.c \
+-zlib/inflate.c \
+-zlib/inftrees.c \
+-zlib/trees.c \
+-zlib/uncompr.c \
+-zlib/zio.c \
+-zlib/zutil.c
++proxy/proxy1.c
+
+ ## eof ##
diff --git a/sci-mathematics/glpk/glpk-4.45.ebuild b/sci-mathematics/glpk/glpk-4.45.ebuild
new file mode 100644
index 00000000000..22aad3ba5f4
--- /dev/null
+++ b/sci-mathematics/glpk/glpk-4.45.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="GNU Linear Programming Kit"
+LICENSE="GPL-3"
+HOMEPAGE="http://www.gnu.org/software/glpk/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+SLOT="0"
+IUSE="doc examples gmp odbc mysql static-libs"
+KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux"
+
+RDEPEND="sys-libs/zlib
+ odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
+ gmp? ( dev-libs/gmp )
+ mysql? ( virtual/mysql )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.52.1-mariadb-5.5.patch
+}
+
+src_configure() {
+ local myconf="--disable-dl"
+ if use mysql || use odbc; then
+ myconf="--enable-dl"
+ fi
+
+ [[ -z $(type -P odbc-config) ]] && \
+ append-cppflags $(pkg-config --cflags libiodbc)
+
+ econf \
+ --with-zlib \
+ $(use_enable static-libs static) \
+ $(use_with gmp) \
+ $(use_enable odbc) \
+ $(use_enable mysql) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodoc AUTHORS ChangeLog NEWS README || \
+ die "failed to install docs"
+
+ insinto /usr/share/doc/${PF}
+ if use examples; then
+ emake distclean
+ doins -r examples || die "failed to install examples"
+ fi
+ if use doc; then
+ cd "${S}"/doc
+ doins *.pdf notes/*.pdf || die "failed to instal djvu and pdf"
+ dodoc *.txt || die "failed to install manual files"
+ fi
+}
diff --git a/sci-mathematics/glpk/glpk-4.48.ebuild b/sci-mathematics/glpk/glpk-4.48.ebuild
new file mode 100644
index 00000000000..f7deb9c172a
--- /dev/null
+++ b/sci-mathematics/glpk/glpk-4.48.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 flag-o-matic toolchain-funcs autotools-utils
+
+DESCRIPTION="GNU Linear Programming Kit"
+LICENSE="GPL-3"
+HOMEPAGE="http://www.gnu.org/software/glpk/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+SLOT="0"
+IUSE="doc examples gmp odbc mysql static-libs"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+RDEPEND="
+ gmp? ( dev-libs/gmp:0 )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.52.1-mariadb-5.5.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable mysql)
+ $(use_enable odbc)
+ $(use_with gmp)
+ )
+ if use mysql || use odbc; then
+ myeconfargs+=( --enable-dl )
+ else
+ myeconfargs+=( --disable-dl )
+ fi
+ [[ -z $(type -P odbc-config) ]] && \
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags libiodbc)
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+ use doc && dodoc doc/*.pdf doc/notes/*.pdf doc/*.txt
+}
diff --git a/sci-mathematics/glpk/glpk-4.54.ebuild b/sci-mathematics/glpk/glpk-4.54.ebuild
new file mode 100644
index 00000000000..d31d5aa9636
--- /dev/null
+++ b/sci-mathematics/glpk/glpk-4.54.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+
+inherit eutils flag-o-matic toolchain-funcs autotools-utils
+
+DESCRIPTION="GNU Linear Programming Kit"
+LICENSE="GPL-3"
+HOMEPAGE="http://www.gnu.org/software/glpk/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+SLOT="0/36"
+IUSE="doc examples gmp odbc mysql static-libs"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+RDEPEND="
+ sci-libs/amd:0=
+ sci-libs/colamd:=
+ sys-libs/zlib:0=
+ gmp? ( dev-libs/gmp:0= )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc:0 dev-db/unixODBC:0 ) )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.54-debundle-system-libs.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable mysql)
+ $(use_enable odbc)
+ $(use_with gmp)
+ )
+ if use mysql || use odbc; then
+ myeconfargs+=( --enable-dl )
+ else
+ myeconfargs+=( --disable-dl )
+ fi
+ [[ -z $(type -P odbc-config) ]] && \
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags libiodbc)
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+ use doc && dodoc doc/*.pdf doc/notes/*.pdf doc/*.txt
+}
diff --git a/sci-mathematics/glpk/glpk-4.55.ebuild b/sci-mathematics/glpk/glpk-4.55.ebuild
new file mode 100644
index 00000000000..d31d5aa9636
--- /dev/null
+++ b/sci-mathematics/glpk/glpk-4.55.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+
+inherit eutils flag-o-matic toolchain-funcs autotools-utils
+
+DESCRIPTION="GNU Linear Programming Kit"
+LICENSE="GPL-3"
+HOMEPAGE="http://www.gnu.org/software/glpk/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+SLOT="0/36"
+IUSE="doc examples gmp odbc mysql static-libs"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+RDEPEND="
+ sci-libs/amd:0=
+ sci-libs/colamd:=
+ sys-libs/zlib:0=
+ gmp? ( dev-libs/gmp:0= )
+ mysql? ( virtual/mysql )
+ odbc? ( || ( dev-db/libiodbc:0 dev-db/unixODBC:0 ) )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.54-debundle-system-libs.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable mysql)
+ $(use_enable odbc)
+ $(use_with gmp)
+ )
+ if use mysql || use odbc; then
+ myeconfargs+=( --enable-dl )
+ else
+ myeconfargs+=( --disable-dl )
+ fi
+ [[ -z $(type -P odbc-config) ]] && \
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags libiodbc)
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+ use doc && dodoc doc/*.pdf doc/notes/*.pdf doc/*.txt
+}
diff --git a/sci-mathematics/glpk/metadata.xml b/sci-mathematics/glpk/metadata.xml
new file mode 100644
index 00000000000..f58fdc6b640
--- /dev/null
+++ b/sci-mathematics/glpk/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-mathematics</herd>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ The GNU Linear Programming Kit package is intended for solving
+ large-scale linear programming (LP), mixed integer programming
+ (MIP), and other related problems. It is a set of routines written
+ in ANSI C and organized in the form of a callable library.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/gmm/Manifest b/sci-mathematics/gmm/Manifest
new file mode 100644
index 00000000000..d823de5c9d3
--- /dev/null
+++ b/sci-mathematics/gmm/Manifest
@@ -0,0 +1 @@
+DIST gmm-4.2.tar.gz 489912 SHA256 bc94080c9b2e1da2f8c886cfafa490bc1d5640912e6342ddd457c789f577fdb6 SHA512 c59941ec17870ae3a0fb4efa77a65a3ae4456d2589a13d4818f1b140f7ef3dbbafaf4597f553a98175ae592004fc000ea3435172ab5503de9b89a5cc510a9d23 WHIRLPOOL 362cfcc13e8f1c955afc1751d0e69436c821fdf3cc685c43a7ddddbd552eb88faf693d5e4207769e7274bc48605fca6f6c17d640edac5bb12e16ac29c3fa867a
diff --git a/sci-mathematics/gmm/gmm-4.2.ebuild b/sci-mathematics/gmm/gmm-4.2.ebuild
new file mode 100644
index 00000000000..9f248b2d09b
--- /dev/null
+++ b/sci-mathematics/gmm/gmm-4.2.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Generic C++ template library for sparse, dense and skyline matrices"
+SRC_URI="http://download.gna.org/getfem/stable/${P}.tar.gz"
+HOMEPAGE="http://www-gmm.insa-toulouse.fr/getfem/"
+
+LICENSE="|| ( LGPL-3 LGPL-3-with-linking-exception )"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~hppa ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+DOCS=( AUTHORS )
diff --git a/sci-mathematics/gmm/metadata.xml b/sci-mathematics/gmm/metadata.xml
new file mode 100644
index 00000000000..282fd304492
--- /dev/null
+++ b/sci-mathematics/gmm/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+<longdescription lang='en'>
+ Gmm++ is a generic C++ template library for sparse, dense and
+ skyline matrices. It is built as a set of generic algorithms (mult,
+ add, copy, sub-matrices, dense and sparse solvers ...) for any
+ interfaced vector type or matrix type. It can be view as a glue
+ library allowing cooperation between several vector and matrix
+ types. However, basic sparse, dense and skyline matrix/vector types
+ are built in Gmm++, hence it can be used as a standalone linear
+ algebra library.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-mathematics/gmp-ecm/Manifest b/sci-mathematics/gmp-ecm/Manifest
new file mode 100644
index 00000000000..8efad5c299a
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/Manifest
@@ -0,0 +1,2 @@
+DIST gmp-ecm-6.4.3.tar.gz 944719 SHA256 946c9870c0b76ada2f6342515386828800c096fe32ff347c82374d5a4ec73685 SHA512 71ccdf3b48e96b0acad45302c87a7b17a20ad289efde212a34fb11491531b96848f1824606fdab7604874ca7d8165baba4bbfbc8424e27e8844444ad0d4f56a6 WHIRLPOOL b177904307fefbffc0c8aec2d20eb6de8475428f84f4e263b032fd47b671dba44211a2fcb80cacead76545429a7df5cd444137853145ee4ced62cb8356753579
+DIST gmp-ecm-6.4.4.tar.gz 941058 SHA256 c813a814592d8092745012debdba25388211e1a2579c26183adda7cfa215b06c SHA512 039009de2d1a22de7abed2e2b843fa2bc684ddcfc45892891a24b93ad4b3640a97d2e7612ebcbdbca8db032534c226ad77c67199772b21a6139e5fa205687097 WHIRLPOOL 47cb942a4e3fd3d8a978df031dbcb19ea200e43eb9cd6ac2a9b551b7d7a8caed6f2e6ec8d7f7ec84584035b24ed2b49839582f758d245df8e297038d82be2cf8
diff --git a/sci-mathematics/gmp-ecm/gmp-ecm-6.4.3-r5.ebuild b/sci-mathematics/gmp-ecm/gmp-ecm-6.4.3-r5.ebuild
new file mode 100644
index 00000000000..7185d6085d8
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/gmp-ecm-6.4.3-r5.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="Elliptic Curve Method for Integer Factorization"
+HOMEPAGE="http://ecm.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/30965/${P}.tar.gz"
+
+inherit eutils
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+blas +custom-tune gwnum -openmp test"
+
+# gmp 5.1 breaks a few things with this version
+DEPEND="<dev-libs/gmp-5.1.0
+ blas? ( sci-libs/gsl )
+ gwnum? ( sci-mathematics/gwnum )
+ openmp? ( sys-devel/gcc[openmp] )"
+RDEPEND="${DEPEND}"
+
+# can't be both enabled
+REQUIRED_USE="gwnum? ( !openmp )"
+
+S=${WORKDIR}/ecm-${PV}
+
+src_configure() {
+ if use gwnum; then myconf="--with-gwnum=/usr/lib"; fi
+ # --enable-shellcmd is broken
+ econf $(use_enable openmp) $myconf
+}
+
+src_compile() {
+ if use custom-tune; then
+ use amd64 && cd x86_64
+ use x86 && cd pentium4
+ emake -j1 || die # build libecm/libmulredc.la
+ cd .. && make bench_mulredc || die
+ sed -i -e 's:#define TUNE_MULREDC_TABLE://#define TUNE_MULREDC_TABLE:g' `readlink ecm-params.h` || die
+ sed -i -e 's:#define TUNE_SQRREDC_TABLE://#define TUNE_SQRREDC_TABLE:g' `readlink ecm-params.h` || die
+ ./bench_mulredc | tail -n 4 >> `readlink ecm-params.h` || die
+ fi
+ emake -j1 || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ mkdir -p "${D}/usr/include/${PN}/"
+ cp "${S}"/*.h "${D}/usr/include/${PN}" || die "Failed to copy headers" # needed by other apps like YAFU
+}
+
+src_test() {
+ make check || die
+}
diff --git a/sci-mathematics/gmp-ecm/gmp-ecm-6.4.4-r1.ebuild b/sci-mathematics/gmp-ecm/gmp-ecm-6.4.4-r1.ebuild
new file mode 100644
index 00000000000..329a7d55ab7
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/gmp-ecm-6.4.4-r1.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 autotools eutils flag-o-matic multilib
+
+DESCRIPTION="Elliptic Curve Method for Integer Factorization"
+HOMEPAGE="http://ecm.gforge.inria.fr/"
+SRC_URI="https://gforge.inria.fr/frs/download.php/32159/${P}.tar.gz"
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+blas +custom-tune gwnum -openmp static-libs test"
+
+DEPEND="
+ dev-libs/gmp
+ blas? ( sci-libs/gsl )
+ gwnum? ( sci-mathematics/gwnum )
+ openmp? ( sys-devel/gcc[openmp] )"
+RDEPEND="${DEPEND}"
+
+# can't be both enabled
+REQUIRED_USE="gwnum? ( !openmp )"
+
+S=${WORKDIR}/ecm-${PV}
+
+MAKEOPTS+=" -j1"
+
+src_prepare() {
+ sed -e '/libecm_la_LIBADD/s:$: -lgmp:g' -i Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ use gwnum && local myconf="--with-gwnum="${EPREFIX}"/usr/$(get_libdir)"
+ # --enable-shellcmd is broken
+ econf \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(use_enable openmp) \
+ ${myconf}
+}
+
+src_compile() {
+ append-ldflags "-Wl,-z,noexecstack"
+ if use custom-tune; then
+ use amd64 && cd x86_64
+ use x86 && cd pentium4
+ emake
+ cd .. && make bench_mulredc || die
+ sed -i -e 's:#define TUNE_MULREDC_TABLE://#define TUNE_MULREDC_TABLE:g' `readlink ecm-params.h` || die
+ sed -i -e 's:#define TUNE_SQRREDC_TABLE://#define TUNE_SQRREDC_TABLE:g' `readlink ecm-params.h` || die
+ ./bench_mulredc | tail -n 4 >> `readlink ecm-params.h` || die
+ fi
+ default
+}
+
+src_install() {
+ default
+ mkdir -p "${ED}/usr/include/${PN}/"
+ cp "${S}"/*.h "${ED}/usr/include/${PN}" || die "Failed to copy headers" # needed by other apps like YAFU
+}
diff --git a/sci-mathematics/gmp-ecm/gmp-ecm-9999.ebuild b/sci-mathematics/gmp-ecm/gmp-ecm-9999.ebuild
new file mode 100644
index 00000000000..0c39ab7005d
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/gmp-ecm-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Elliptic Curve Method for Integer Factorization"
+HOMEPAGE="http://ecm.gforge.inria.fr/"
+#SRC_URI="https://gforge.inria.fr/frs/download.php/30965/${P}.tar.gz"
+ESVN_REPO_URI="svn://scm.gforge.inria.fr/svnroot/ecm/trunk"
+
+inherit autotools eutils flag-o-matic subversion
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS=""
+IUSE="blas gwnum -openmp test"
+
+DEPEND="
+ dev-libs/gmp
+ blas? ( sci-libs/gsl )
+ gwnum? ( sci-mathematics/gwnum )
+ openmp? ( sys-devel/gcc[openmp] )"
+RDEPEND="${DEPEND}"
+
+# can't be both enabled
+REQUIRED_USE="gwnum? ( !openmp )"
+
+S=${WORKDIR}/ecm-${PV}
+
+MAKEOPTS+=" -j1"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ if use gwnum; then myconf="--with-gwnum=/usr/lib"; fi
+ # --enable-shellcmd is broken
+ econf $(use_enable openmp) $myconf
+}
+
+src_compile() {
+ append-ldflags "-Wl,-z,noexecstack"
+ # the custom-tune bits are obsoleted with sane defaults
+ default
+}
+
+src_install() {
+ default
+ mkdir -p "${D}/usr/include/${PN}/"
+ cp "${S}"/*.h "${D}/usr/include/${PN}" || die "Failed to copy headers" # needed by other apps like YAFU
+}
diff --git a/sci-mathematics/gmp-ecm/metadata.xml b/sci-mathematics/gmp-ecm/metadata.xml
new file mode 100644
index 00000000000..1723f3d6a58
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <use>
+ <flag name="custom-tune">Improve performance of some operations by selecting machine-specific defaults</flag>
+ <flag name="gwnum">Use GWNum lib where possible</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/gretl/Manifest b/sci-mathematics/gretl/Manifest
new file mode 100644
index 00000000000..e5264a78563
--- /dev/null
+++ b/sci-mathematics/gretl/Manifest
@@ -0,0 +1,2 @@
+DIST gretl-1.9.14.tar.xz 7564192 SHA256 ceabb8cbf461ab340093f3d38d9c87d91f6d17c62906d3d8d7bfe58812ba965b SHA512 61ff44cc52f3da971d3cf2cc6e52e0401280521fd761ea098f753acc529c9d35a12fc296b46136d5d257c9a29a83f91a78a77822a00ce3f65776a17f97223ee1 WHIRLPOOL d592d50ba57cfcde2cba6e31199f2d853d300fe5fcc4e2afc6c9906f8f9f6c3ac02a2d24a98c53fb86fb92e7c133717bbdadaa6bd93406d1deb69b3b30be2756
+DIST gretl-1.9.90.tar.xz 7764820 SHA256 f14941786de985e40af8e5f31fb71ee05b17002627055f0f6341b63258c4fdcc SHA512 35ec45fb2ad2dec490567411c1a5d909dc7fc8f0c4a6ca142e6e92b2d95a9efc9581f154a7806cf3f5178b530cdca9508b7c215bca29e1bcaebfa874d476667a WHIRLPOOL c688135030057df291576b5e8e08300d59b183a013064ae9adb7a934e4fd5436b0b2b23d27f340dcd4c0aac24fd16419dd377e3c650a2c90705e5caa8cedf24f
diff --git a/sci-mathematics/gretl/files/50gretl-gentoo.el b/sci-mathematics/gretl/files/50gretl-gentoo.el
new file mode 100644
index 00000000000..c5f3159efc0
--- /dev/null
+++ b/sci-mathematics/gretl/files/50gretl-gentoo.el
@@ -0,0 +1,16 @@
+
+;;; sci-mathematics/gretl site-lisp configuration
+
+(add-to-list 'load-path "@SITELISP@")
+
+(autoload 'gretl-mode "gretl" nil t)
+;; not adding to auto-mode-alist since .inp is too generic as extension
+;;(add-to-list 'auto-mode-alist '("\\.inp\\'" . gretl-mode))
+
+;; Automatically turn on the abbrev, auto-fill and font-lock features
+(add-hook 'gretl-mode-hook
+ (lambda ()
+ (abbrev-mode 1)
+ (auto-fill-mode 1)
+ (if (eq window-system 'x)
+ (font-lock-mode 1))))
diff --git a/sci-mathematics/gretl/files/gretl-1.9.14-readline.patch b/sci-mathematics/gretl/files/gretl-1.9.14-readline.patch
new file mode 100644
index 00000000000..9f6996b9c91
--- /dev/null
+++ b/sci-mathematics/gretl/files/gretl-1.9.14-readline.patch
@@ -0,0 +1,10 @@
+--- cli/complete.c.ORIG 2007-08-22 16:44:46.000000000 +0200
++++ cli/complete.c 2014-03-26 16:54:40.463070119 +0100
+@@ -126,6 +126,6 @@
+ rl_readline_name = "gretl";
+
+ /* Tell the completer that we want a crack first. */
+- rl_attempted_completion_function = (CPPFunction *) gretl_completion;
++ rl_attempted_completion_function = (rl_completion_func_t*) gretl_completion;
+ }
+
diff --git a/sci-mathematics/gretl/gretl-1.9.14.ebuild b/sci-mathematics/gretl/gretl-1.9.14.ebuild
new file mode 100644
index 00000000000..a6904c11153
--- /dev/null
+++ b/sci-mathematics/gretl/gretl-1.9.14.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+USE_EINSTALL=true
+
+inherit eutils elisp-common toolchain-funcs
+
+DESCRIPTION="Regression, econometrics and time-series library"
+HOMEPAGE="http://gretl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="accessibility cpu_flags_x86_avx emacs gnome gtk nls odbc openmp python
+ readline cpu_flags_x86_sse2 R static-libs"
+
+CDEPEND="
+ dev-libs/glib:2
+ dev-libs/gmp
+ dev-libs/libxml2:2
+ dev-libs/mpfr
+ sci-libs/fftw:3.0
+ sci-visualization/gnuplot
+ virtual/lapack
+ virtual/latex-base
+ accessibility? ( app-accessibility/flite )
+ emacs? ( virtual/emacs )
+ gtk? (
+ media-libs/gd[png]
+ sci-visualization/gnuplot[gd]
+ x11-libs/gtk+:3
+ x11-libs/gtksourceview:3.0 )
+ odbc? ( dev-db/unixODBC )
+ R? ( dev-lang/R )
+ readline? ( sys-libs/readline )"
+RDEPEND="${CDEPEND}
+ python? ( dev-python/numpy )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+SITEFILE=50${PN}-gentoo.el
+
+REQUIRED_USE="emacs? ( gtk )"
+
+pkg_setup() {
+ if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp
+ then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
+ die "Need an OpenMP capable compiler"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-readline.patch
+}
+
+src_configure() {
+ econf \
+ --disable-rpath \
+ --enable-shared \
+ --with-mpfr \
+ $(use_enable cpu_flags_x86_avx avx) \
+ $(use_enable gtk gui) \
+ $(use_enable gtk gtk3) \
+ $(use_enable gtk xdg) \
+ $(use_enable gtk xdg-utils) \
+ $(use_enable nls) \
+ $(use_enable openmp) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable static-libs static) \
+ $(use_with accessibility audio) \
+ $(use_with odbc) \
+ $(use_with readline) \
+ $(use_with R libR) \
+ ${myconf} \
+ LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ cd utils/emacs && emake
+ elisp-compile gretl.el
+ fi
+}
+
+src_install() {
+ # to fix
+ emake -j1 DESTDIR="${D}" install
+ if use emacs; then
+ elisp-install ${PN} utils/emacs/gretl.{el,elc}
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+ dodoc README README.audio ChangeLog CompatLog
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ elog "To begin using gretl-mode for all \".inp\" files that you edit,"
+ elog "add the following line to your \"~/.emacs\" file:"
+ elog " (add-to-list 'auto-mode-alist '(\"\\\\.inp\\\\'\" . gretl-mode))"
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/gretl/gretl-1.9.90.ebuild b/sci-mathematics/gretl/gretl-1.9.90.ebuild
new file mode 100644
index 00000000000..4ffc0d43fa4
--- /dev/null
+++ b/sci-mathematics/gretl/gretl-1.9.90.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+USE_EINSTALL=true
+
+inherit eutils elisp-common toolchain-funcs
+
+DESCRIPTION="Regression, econometrics and time-series library"
+HOMEPAGE="http://gretl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0/10"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="accessibility cpu_flags_x86_avx +curl emacs gnome gtk mpi nls odbc openmp python
+ readline cpu_flags_x86_sse2 R static-libs"
+
+CDEPEND="
+ dev-libs/glib:2=
+ dev-libs/gmp:0=
+ dev-libs/libxml2:2=
+ dev-libs/mpfr:0=
+ sci-libs/fftw:3.0=
+ sci-visualization/gnuplot
+ virtual/lapack
+ virtual/latex-base
+ accessibility? ( app-accessibility/flite:= )
+ curl? ( net-misc/curl:0= )
+ emacs? ( virtual/emacs )
+ gtk? (
+ media-libs/gd:2=[png]
+ sci-visualization/gnuplot[gd]
+ x11-libs/gtk+:3=
+ x11-libs/gtksourceview:3.0= )
+ mpi? ( virtual/mpi )
+ odbc? ( dev-db/unixODBC:0= )
+ R? ( dev-lang/R:0= )
+ readline? ( sys-libs/readline:0= )"
+RDEPEND="${CDEPEND}
+ python? ( dev-python/numpy )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+SITEFILE=50${PN}-gentoo.el
+
+REQUIRED_USE="emacs? ( gtk ) !curl? ( !gtk )"
+
+pkg_setup() {
+ if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp ; then
+ ewarn "You are using a non capable gcc compiler ( < 4.2 ? )"
+ die "Need an OpenMP capable compiler"
+ fi
+}
+
+src_configure() {
+ econf \
+ --disable-rpath \
+ --enable-shared \
+ --with-mpfr \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ $(use_enable cpu_flags_x86_avx avx) \
+ $(use_enable curl www) \
+ $(use_enable gtk gui) \
+ $(use_enable gtk xdg) \
+ $(use_enable gtk xdg-utils) \
+ $(use_enable nls) \
+ $(use_enable openmp) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable static-libs static) \
+ $(use_with accessibility audio) \
+ $(use_with mpi) \
+ $(use_with odbc) \
+ $(use_with readline) \
+ $(use_with R libR) \
+ ${myconf} \
+ LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ cd utils/emacs && emake
+ elisp-compile gretl.el
+ fi
+}
+
+src_install() {
+ # to fix
+ emake -j1 DESTDIR="${D}" install
+ if use emacs; then
+ elisp-install ${PN} utils/emacs/gretl.{el,elc}
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+ dodoc README README.audio ChangeLog CompatLog
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ elog "To use gretl-mode for all \".inp\" files that you edit,"
+ elog "add the following line to your \"~/.emacs\" file:"
+ elog " (add-to-list 'auto-mode-alist '(\"\\\\.inp\\\\'\" . gretl-mode))"
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/gretl/metadata.xml b/sci-mathematics/gretl/metadata.xml
new file mode 100644
index 00000000000..98532cfda4e
--- /dev/null
+++ b/sci-mathematics/gretl/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-mathematics</herd>
+ <longdescription lang="en">
+ GNU Regression, Econometrics and Time-series Library provides
+ a library which comprises various functions relating to econometric
+ estimation, a command-line client program and a GUI. The library is
+ based on the stand-alone command-line econometrics program ESL,
+ originally written by Ramu Ramanathan of the Department of Economics
+ at UC-San Diego. The interfaces offer several least-squares based
+ estimators. Besides reading data files in its own format it also
+ reads RATS 4 databases. It has a built-in spreadsheet for editing
+ data, and uses gnuplot for graphing. It can output regression results
+ in LaTeX format.
+</longdescription>
+ <use>
+ <flag name="R">Enable support for <pkg>dev-lang/R</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">gretl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/gsl-shell/Manifest b/sci-mathematics/gsl-shell/Manifest
new file mode 100644
index 00000000000..8fe68cc84f8
--- /dev/null
+++ b/sci-mathematics/gsl-shell/Manifest
@@ -0,0 +1 @@
+DIST gsl-shell-2.2.0.tar.gz 3138063 SHA256 e05bcc78ea3c70d209b12a3db5c86b5ed23e50617d68cb0081046382973b2d33 SHA512 1394cbafecd55ddf5c8c992273f1fa400825b21202cd53ac548a99e34a9183ba4a5dcb2ef10ef9a7930f78ed4e6343b8d2a5d34c38a8e7766300b5bf73596d89 WHIRLPOOL 9bbfa55c988611fa0c771fc6c49473e139eff936f4f22b4b419c409e8450c733a57f2d9bbbc799f754654ff5cf5b303ab263bb502ef712ad439564c6e3b28fef
diff --git a/sci-mathematics/gsl-shell/files/gsl-shell-2.2.0-pkg-config.patch b/sci-mathematics/gsl-shell/files/gsl-shell-2.2.0-pkg-config.patch
new file mode 100644
index 00000000000..8bb28635df2
--- /dev/null
+++ b/sci-mathematics/gsl-shell/files/gsl-shell-2.2.0-pkg-config.patch
@@ -0,0 +1,33 @@
+ makepackages | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/makepackages b/makepackages
+index afeef79..a724e82 100644
+--- a/makepackages
++++ b/makepackages
+@@ -52,17 +52,17 @@ else
+ PTHREADS_LIBS = -lpthread
+
+ else
+- AGG_INCLUDES = -I/usr/include/agg2
+- AGG_LIBS = -lagg -lX11
++ AGG_INCLUDES = $(shell $(PKG_CONFIG) --cflags libagg)
++ AGG_LIBS = $(shell $(PKG_CONFIG) --libs libagg) -lX11
+
+- GSL_INCLUDES =
+- GSL_LIBS = -lgsl -lblas
++ GSL_INCLUDES = $(shell $(PKG_CONFIG) --cflags gsl)
++ GSL_LIBS = $(shell $(PKG_CONFIG) --libs gsl)
+
+- FOX_INCLUDES := $(shell pkg-config fox --cflags)
+- FOX_LIBS = $(shell pkg-config fox --libs)
++ FOX_INCLUDES := $(shell $(PKG_CONFIG) fox --cflags)
++ FOX_LIBS = $(shell $(PKG_CONFIG) fox --libs)
+
+- FREETYPE_INCLUDES = -I/usr/include/freetype2
+- FREETYPE_LIBS = -lfreetype
++ FREETYPE_INCLUDES = $(shell $(PKG_CONFIG) --cflags freetype2)
++ FREETYPE_LIBS = $(shell $(PKG_CONFIG) --libs freetype2)
+
+ PTHREADS_LIBS = -lpthread
+ endif
diff --git a/sci-mathematics/gsl-shell/files/gsl-shell-font.patch b/sci-mathematics/gsl-shell/files/gsl-shell-font.patch
new file mode 100644
index 00000000000..d8879497c4c
--- /dev/null
+++ b/sci-mathematics/gsl-shell/files/gsl-shell-font.patch
@@ -0,0 +1,10 @@
+diff -r -U1 gsl-shell.orig/agg-plot/support_x11.cpp gsl-shell/agg-plot/support_x11.cpp
+--- gsl-shell.orig/agg-plot/support_x11.cpp 2012-11-27 04:55:38.000000000 +0700
++++ gsl-shell/agg-plot/support_x11.cpp 2012-11-30 23:02:31.000000000 +0700
+@@ -9,4 +9,4 @@
+ #else
+-const char *ttf_names[] = {"ubuntu-font-family/Ubuntu-R.ttf", "freefont/FreeSans.ttf", "ttf-dejavu/DejaVuSans.ttf", 0};
+-#define TTF_SYSTEM_DIR "/usr/share/fonts/truetype/"
++const char *ttf_names[] = {"ubuntu-font-family/Ubuntu-R.ttf", "freefont-ttf/FreeSans.ttf", "dejavu/DejaVuSans.ttf", 0};
++#define TTF_SYSTEM_DIR "/usr/share/fonts/"
+ #define CONSOLE_FONT_NAME "monospace"
diff --git a/sci-mathematics/gsl-shell/files/gsl-shell-nogui.patch b/sci-mathematics/gsl-shell/files/gsl-shell-nogui.patch
new file mode 100644
index 00000000000..16d3eb0f04d
--- /dev/null
+++ b/sci-mathematics/gsl-shell/files/gsl-shell-nogui.patch
@@ -0,0 +1,25 @@
+diff -r -U1 gsl-shell.orig/Makefile gsl-shell/Makefile
+--- gsl-shell.orig/Makefile 2012-09-21 19:54:05.000000000 +0700
++++ gsl-shell/Makefile 2012-09-21 19:53:37.000000000 +0700
+@@ -29,3 +29,2 @@
+ GSL_SHELL = gsl-shell$(EXE_EXT)
+-GSL_SHELL_GUI = gsl-shell-gui$(EXE_EXT)
+ LUA_CFLAGS = -I$(LUADIR)/src
+@@ -73,4 +72,3 @@
+ INCLUDES += $(PTHREADS_CFLAGS) -Iagg-plot
+-GUI_SUBDIR = fox-gui
+-SUBDIRS += agg-plot $(GUI_SUBDIR)
++SUBDIRS += agg-plot
+ LUAGSL_LIBS += agg-plot/libaggplot.a
+@@ -105,6 +103,5 @@
+
+-install: $(GSL_SHELL) $(GUI_SUBDIR)
++install: $(GSL_SHELL)
+ mkdir -p $(INSTALL_BIN_DIR)
+ cp $(GSL_SHELL) $(INSTALL_BIN_DIR)
+- cp fox-gui/$(GSL_SHELL_GUI) $(INSTALL_BIN_DIR)
+ mkdir -p $(INSTALL_LIB_DIR)
+@@ -122,3 +119,2 @@
+ $(MAKE) -C $(LUADIR) clean
+- $(MAKE) -C fox-gui clean
+ $(HOST_RM) *.o $(TARGETS)
diff --git a/sci-mathematics/gsl-shell/files/gsl-shell-strip.patch b/sci-mathematics/gsl-shell/files/gsl-shell-strip.patch
new file mode 100644
index 00000000000..1d50a7e831a
--- /dev/null
+++ b/sci-mathematics/gsl-shell/files/gsl-shell-strip.patch
@@ -0,0 +1,8 @@
+diff -r -U1 gsl-shell.orig/Makefile gsl-shell/Makefile
+--- gsl-shell.orig/Makefile 2012-09-12 01:13:31.000000000 +0700
++++ gsl-shell/Makefile 2012-09-26 16:13:56.000000000 +0700
+@@ -109,4 +109,2 @@
+ cp fox-gui/$(GSL_SHELL_GUI) $(INSTALL_BIN_DIR)
+- strip $(INSTALL_BIN_DIR)/$(GSL_SHELL)
+- strip $(INSTALL_BIN_DIR)/$(GSL_SHELL_GUI)
+ mkdir -p $(INSTALL_LIB_DIR)
diff --git a/sci-mathematics/gsl-shell/files/gsl-shell-usr.patch b/sci-mathematics/gsl-shell/files/gsl-shell-usr.patch
new file mode 100644
index 00000000000..20ca6d317c7
--- /dev/null
+++ b/sci-mathematics/gsl-shell/files/gsl-shell-usr.patch
@@ -0,0 +1,8 @@
+diff -r -U1 gsl-shell.orig/makeconfig gsl-shell/makeconfig
+--- gsl-shell.orig/makeconfig 2012-09-12 01:13:31.000000000 +0700
++++ gsl-shell/makeconfig 2012-09-26 16:16:43.000000000 +0700
+@@ -21,3 +21,3 @@
+
+-PREFIX= /usr/local
++PREFIX= /usr
+ DESTDIR=
diff --git a/sci-mathematics/gsl-shell/gsl-shell-2.2.0.ebuild b/sci-mathematics/gsl-shell/gsl-shell-2.2.0.ebuild
new file mode 100644
index 00000000000..a034db9f75f
--- /dev/null
+++ b/sci-mathematics/gsl-shell/gsl-shell-2.2.0.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Lua interactive shell for sci-libs/gsl"
+HOMEPAGE="http://www.nongnu.org/gsl-shell/"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc fox"
+
+RDEPEND="
+ >=sci-libs/gsl-1.14
+ virtual/blas
+ >=x11-libs/agg-2.5
+ >=media-libs/freetype-2.4.10
+ sys-libs/readline
+ || ( media-fonts/ubuntu-font-family media-fonts/freefont media-fonts/dejavu )
+ fox? ( x11-libs/fox:1.6 )"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx[latex] )"
+
+S="${WORKDIR}"/${PN}
+
+src_prepare() {
+ tc-export PKG_CONFIG
+ epatch \
+ "${FILESDIR}"/${PN}-font.patch \
+ "${FILESDIR}"/${PN}-strip.patch \
+ "${FILESDIR}"/${PN}-usr.patch \
+ "${FILESDIR}"/${P}-pkg-config.patch
+ use fox || epatch "${FILESDIR}"/${PN}-nogui.patch
+}
+
+src_compile() {
+ local BLAS=$($(tc-getPKG_CONFIG) --libs blas)
+
+ if use fox; then
+ local FOX_INCLUDES=`WANT_FOX=1.6 fox-config --cflags`
+ local FOX_LIBS=`WANT_FOX=1.6 fox-config --libs`
+ emake -j1 CFLAGS="${CFLAGS}" GSL_LIBS="$($(tc-getPKG_CONFIG) --libs gsl) ${BLAS}" \
+ FOX_INCLUDES="${FOX_INCLUDES}" FOX_LIBS="${FOX_LIBS}"
+ else
+ emake -j1 CFLAGS="${CFLAGS}" GSL_LIBS="$($(tc-getPKG_CONFIG) --libs gsl) ${BLAS}"
+ fi
+
+ if use doc; then
+ pushd doc/user-manual > /dev/null
+ emake -j1 html
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+ use doc && dohtml -r doc/user-manual/_build/html/*
+}
diff --git a/sci-mathematics/gsl-shell/metadata.xml b/sci-mathematics/gsl-shell/metadata.xml
new file mode 100644
index 00000000000..d56d122c63c
--- /dev/null
+++ b/sci-mathematics/gsl-shell/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>grozin@gentoo.org</email>
+ <name>Andrey Grozin</name>
+ </maintainer>
+ <herd>sci-mathematics</herd>
+ <longdescription lang="en">
+GSL shell offers an interactive command-line interface
+that gives access to GSL collection of mathematical functions.
+GSL shell is based on the powerful and elegant scripting language Lua.
+GSL shell is not just a wrapper over the C API of GSL
+but does offer much more simple and expressive way to use GSL.
+The objective of GSL shell is to give the user the power
+of easily access GSL functions without having to write a complete C application.
+</longdescription>
+ <use>
+ <flag name="fox">Build a <pkg>x11-libs/fox</pkg> GUI</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/gwnum/Manifest b/sci-mathematics/gwnum/Manifest
new file mode 100644
index 00000000000..d448d4ae40e
--- /dev/null
+++ b/sci-mathematics/gwnum/Manifest
@@ -0,0 +1 @@
+DIST gwnum-277.tar.bz2 24143696 SHA256 bbd7baec05d66b3cbe315e742b1b1aaa882dea838bed4901203c29a2e231397f SHA512 d88a15b01fad458640a84ffa3d5fca6fb35ecd99aff711e679cdae2a58b95c9caefdd4218015f620fd7a93bb54aabad1311205d7ec62d212ca8c6e80af696cc3 WHIRLPOOL db520213f8b324e5c4dc21800424755cd8f23cbbe26619f6393e8b5ed65653a89b73098638fd75137a05a6a323fc71b0acc5496d5ad405fe70f7d26671b301df
diff --git a/sci-mathematics/gwnum/gwnum-277.ebuild b/sci-mathematics/gwnum/gwnum-277.ebuild
new file mode 100644
index 00000000000..1842938ca88
--- /dev/null
+++ b/sci-mathematics/gwnum/gwnum-277.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="George Woltman's GWNUM library"
+HOMEPAGE="http://www.mersenne.org/freesoft/"
+# Sourcecode split out from prime95, we don't need the full lib
+SRC_URI="http://gentooexperimental.org/~patrick/${P}.tar.bz2"
+
+inherit eutils
+
+LICENSE="gwnum BSD GPL-2+"
+SLOT="0"
+# Need to test if it actually compiles on x86
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="bindist" #465566
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ # makefile doesn't return zero? || die fails :(
+ use amd64 && emake -f make64
+ use x86 && emake
+}
+
+src_install() {
+ mkdir "${D}/usr/lib" -p
+ cp gwnum.a gwnum.lib "${D}/usr/lib" || die
+ mkdir "${D}/usr/include" -p
+ cp *.h "${D}/usr/include" || die
+}
diff --git a/sci-mathematics/gwnum/metadata.xml b/sci-mathematics/gwnum/metadata.xml
new file mode 100644
index 00000000000..24cbb90cf0c
--- /dev/null
+++ b/sci-mathematics/gwnum/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-mathematics/isabelle/Manifest b/sci-mathematics/isabelle/Manifest
new file mode 100644
index 00000000000..f3bd2a8ec89
--- /dev/null
+++ b/sci-mathematics/isabelle/Manifest
@@ -0,0 +1,11 @@
+DIST Isabelle2011-1.tar.gz 42239059 SHA256 48d77fe31a16b44f6015aa7953a60bdad8fcec9e60847630dc7b98c053edfc08 SHA512 213207951455395659a91b0bc6c8520c084cb6c75098c8f24c0800e41474c90c92aae86ffb99415142f6cf63d569556661ba350024fe458daa54a5cc9db372fd WHIRLPOOL 7e7868c3f464f507aceb8e1f648c04394fdd69746242179e66cfad64f927cf4d6aba41970428da5e45cce90a30bcee29bdc373d8a9e4943eb61cd97480d0a366
+DIST Isabelle2012-doc-src.tar.gz 2688496 SHA256 e18965fe0f7f89b286d4707e38201f1edbea81f6b26aed59d63a633c03fec097 SHA512 5aaea56eb67e535d745d63314278b6ee8469e6d3bbf4ce4d7b3f5e04b24557783b56d50d905a5ad69187c42f44407023c95a9bfb6faab125c21edff7638ff21d WHIRLPOOL 278b63a243950b1596376ee04cbfddb7a93c747e9f6ee66c5b069ca0dae4ca8d10bef43e03069b6186a19c703f71a585633fc47c3c1a15de3a886ff468232127
+DIST Isabelle2012.tar.gz 49529865 SHA256 b86f957dee221041f92c9d4ced4758d45b4950339743d0d58b1ea6061e2b53f0 SHA512 1346f563233eba10bc14f7d140706b8bfba8e832f7ee5887316c829926136af07d700914a925272d8adc1275b0bdd682540518957910c136a15bfc60d61285a0 WHIRLPOOL 23b764a1a0044a9525d058e95da318f4425fadf7660edc8ab8f35b248f98dcff0dba2e533ff18d8bf47ea164cec12a9648642749de2a49887bbe84ed4e71a68b
+DIST Isabelle2013-2.tar.gz 52603110 SHA256 602e91377b0999c25950ae2a34c0fcb23e3aff3a196bdbc5ce61634bd90d7f22 SHA512 464a2735b2f4e28dcf44e55cd4abb4d8766a6bb7eb86f989f3592e7819e33d97922bdfb6701da85aa9d7c4cc2aee3eadebde1c7e3fc74bb3f6108a5daf5fea45 WHIRLPOOL 0dc354d60e3440ea0909dc09f25b66cb301b82f88fbe21c0b7f4bfef40ecc3631014757abd8657f0464047f0ad32827ad308e3f998fcf2477e05907ff7b19a84
+DIST Isabelle2013.tar.gz 54638791 SHA256 2f2cda9939248bd4346ad7e074cb6b2cfad70708777491c6262a5ae670c8f83a SHA512 e03f9b747f678749a562c3de6100f4f4e010ace51b2eb13bcde0a63591eec0cb4e081f7fad9147d022fe787b56eac3f037ab3a296080fd70cc7d058ea961a789 WHIRLPOOL 5cbcbc93bd2ce4723034c3d95d4678b2de90c924601b795c5da378cb76f58275e5d5f47ce9120234a9ea36e43ab759ced843dca76942378abfa1fb7aff858a65
+DIST jedit_build-20120414.tar.gz 7509120 SHA256 3c5840fd01b87013b05a92742d41f66f655df6fe9edef1525c6722f92d8f3e41 SHA512 2e2f0db4964a041ba54382a9c787246e1d433e43167019c6ea8d4cf6beb84ce438c0bc559d2588229b0166c91bac603bed39abc45d5d4267020f55eaba1aaa0c WHIRLPOOL 40b883943bde312b4c7adc43607ba4759e5ebe22cab3c922c81393375f917af21d4a8dc068e5692ffcf7bdfb1e7fe3081358dc8e346d1942582bf79e249b0cbb
+DIST jedit_build-isabelle-component-20130104.tar.gz 10734679 SHA256 22a4880deb1054a548476b22662b42bfaf5394ceb07b30eba69be433bcea1074 SHA512 bacdb3ca73d48fe9ba71dd32cd68e98333831f205dd3ced69bb9344c5b167ba084662f1108690f371b4b64f6b786955a332bcd51a2dc21c2179fb1b4727430dd WHIRLPOOL fc97923e08202e117ca3112b69f74a9f4663a70f55fa051ac55e02c85be57423f762263cac2ded33d9c2f412736e4fa0937aa07df3f36b915e806959055a796b
+DIST jedit_build-isabelle-component-20131106.tar.gz 8796625 SHA256 a13a896263804f5aee82db0e1fe6be7982abe3ca1266cd15f7fe9c8c2f6e2ba5 SHA512 7fc3313916cd408c906e453a4895f49223a8b9dc1e2c577c16468394b73a3724449b411521884d419683cd3d2eb3ef59929608483ff092b9b0e3663efd5e136e WHIRLPOOL 4e7c933df7eea5b9c312f8e0c2c46d44a442d0dd2bb76415bea1fcf307ff75d1f8fb592fe4cad647674dc387fe6fa017dbf4e0cf2ec64459bdafb093470e2abf
+DIST jfreechart-isabelle-component-1.0.14-1.tar.gz 3444825 SHA256 b0eb7365c4c5877379889100f081a4afc4117afc0d332941c3dd01bef2c4aee9 SHA512 ee1d84a45e43029d5e3acee823176196da19789322e8d3c2c81d5504930ad81d50e16e5da87655e4151034901daefb4ce6b82334839e39134b3a7ce32203aa67 WHIRLPOOL e6f9caadb802ecb5b784e86e96c008e9271aa0b1c940152fb0b0358280d9c1e274bb0dee1507f8ff0fe7f43f863db538d631c76e146d1f66ab6e8a8fb27eb42d
+DIST jfreechart-isabelle-component-1.0.14.tar.gz 3443727 SHA256 c873ad6f07edbcceb5c76aac2e848c7d7f12c78c93c05f7e97c4b1fdba7c2df0 SHA512 c55ec01b215368f064de2f288f788960a256445adca5565c00aa9c0fab5732707a9e72bcdb3838676c80e735c520b9948855d7a32b9076bf35f1a279320ee72a WHIRLPOOL ba1a75e21525c302a3b755d814502dad60c540c2004dd894f60fdd6966766f85d71bbb45728ca220a4a7cff334de81db756fbb89e1059f32e248cabf0a7b97d6
+DIST polyml-isabelle-component-5.5.1-1.tar.gz 831 SHA256 f19a4dfc3117792423270cb98a5c406f7339f4bd7715c16976a281d964792844 SHA512 35ab69d0fd2737f3c6a13ca022103428bcb0e71032304d244614d271848b9ae8986da25bd4ef02668eef169f3a3a72576a619152ce3cbf036af7aa365e857c1a WHIRLPOOL 682e25b677e1b0401a43d4cff35c69658359b4c74f86d3459c050e7c7b0d17f1de1e7b792f2a51f97acf574ad56b3e89ade688bc24d090b3e89eaf0cb99a08d5
diff --git a/sci-mathematics/isabelle/files/isabelle-2011.1-gentoo-settings.patch b/sci-mathematics/isabelle/files/isabelle-2011.1-gentoo-settings.patch
new file mode 100644
index 00000000000..67e3476f217
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2011.1-gentoo-settings.patch
@@ -0,0 +1,39 @@
+--- Isabelle2011-1-orig/etc/settings 2011-10-10 01:47:58.000000000 +1100
++++ Isabelle2011-1/etc/settings 2012-01-01 16:33:27.922565527 +1100
+@@ -24,9 +24,16 @@
+ "/usr/share/polyml/$ML_PLATFORM" \
+ "/opt/polyml/$ML_PLATFORM" \
+ "")"
+-ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
+-ML_OPTIONS="-H 200"
+-ML_SOURCES="$ML_HOME/../src"
++# ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
++# ML_OPTIONS="-H 200"
++# ML_SOURCES="$ML_HOME/../src"
++
++# Poly/ML 5.4.0 (64 bit)
++ML_PLATFORM=x86_64-linux
++ML_HOME=/usr/bin
++ML_SYSTEM=polyml-5.4.0
++ML_OPTIONS="-H 1000"
++#ML_SOURCES="$ML_HOME/../src"
+
+ # Poly/ML 32 bit (manual settings)
+ #ML_SYSTEM=polyml-5.4.0
+@@ -106,7 +113,7 @@
+ ISABELLE_TMP_PREFIX="/tmp/isabelle-$USER"
+
+ # Heap input locations. ML system identifier is included in lookup.
+-ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:$ISABELLE_HOME/heaps"
++ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:/usr/lib64/Isabelle2011-1/heaps"
+
+ # Heap output location. ML system identifier is appended automatically later on.
+ ISABELLE_OUTPUT="$ISABELLE_HOME_USER/heaps"
+@@ -170,6 +177,7 @@
+ "/usr/local/ProofGeneral" \
+ "/usr/share/ProofGeneral" \
+ "/opt/ProofGeneral" \
++ "/usr/share/emacs/site-lisp/ProofGeneral" \
+ "")"
+
+ PROOFGENERAL_OPTIONS=""
diff --git a/sci-mathematics/isabelle/files/isabelle-2011.1-graphbrowser.patch b/sci-mathematics/isabelle/files/isabelle-2011.1-graphbrowser.patch
new file mode 100644
index 00000000000..ed8036a9b2d
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2011.1-graphbrowser.patch
@@ -0,0 +1,11 @@
+--- Isabelle2011-1-orig/lib/browser/build 2011-10-10 01:47:58.000000000 +1100
++++ Isabelle2011-1/lib/browser/build 2012-01-08 12:58:06.041444651 +1100
+@@ -6,6 +6,8 @@
+ #
+ # Requires proper Isabelle settings environment.
+
++ISABELLE_HOME="$(cd "$(dirname "${0}")/../.."; pwd -P)"
++source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
+
+ ## diagnostics
+
diff --git a/sci-mathematics/isabelle/files/isabelle-2011.1-libsha1.patch b/sci-mathematics/isabelle/files/isabelle-2011.1-libsha1.patch
new file mode 100644
index 00000000000..905a1eb60e5
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2011.1-libsha1.patch
@@ -0,0 +1,11 @@
+--- Isabelle2011-1-orig/src/Pure/General/sha1_polyml.ML 2011-10-10 01:47:58.000000000 +1100
++++ Isabelle2011-1/src/Pure/General/sha1_polyml.ML 2012-12-05 23:28:15.004733643 +1100
+@@ -18,7 +18,7 @@
+ in (op ^) (pairself hex_digit (Integer.div_mod (Char.ord c) 16)) end
+
+ val lib_path =
+- ("$ML_HOME/" ^ (if ML_System.platform_is_cygwin then "sha1.dll" else "libsha1.so"))
++ ("$SHA1_HOME/" ^ (if ML_System.platform_is_cygwin then "sha1.dll" else "libsha1.so"))
+ |> Path.explode;
+
+ fun digest_external str =
diff --git a/sci-mathematics/isabelle/files/isabelle-2011.1-proofgeneral-gentoo-path.patch b/sci-mathematics/isabelle/files/isabelle-2011.1-proofgeneral-gentoo-path.patch
new file mode 100644
index 00000000000..67e3476f217
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2011.1-proofgeneral-gentoo-path.patch
@@ -0,0 +1,39 @@
+--- Isabelle2011-1-orig/etc/settings 2011-10-10 01:47:58.000000000 +1100
++++ Isabelle2011-1/etc/settings 2012-01-01 16:33:27.922565527 +1100
+@@ -24,9 +24,16 @@
+ "/usr/share/polyml/$ML_PLATFORM" \
+ "/opt/polyml/$ML_PLATFORM" \
+ "")"
+-ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
+-ML_OPTIONS="-H 200"
+-ML_SOURCES="$ML_HOME/../src"
++# ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
++# ML_OPTIONS="-H 200"
++# ML_SOURCES="$ML_HOME/../src"
++
++# Poly/ML 5.4.0 (64 bit)
++ML_PLATFORM=x86_64-linux
++ML_HOME=/usr/bin
++ML_SYSTEM=polyml-5.4.0
++ML_OPTIONS="-H 1000"
++#ML_SOURCES="$ML_HOME/../src"
+
+ # Poly/ML 32 bit (manual settings)
+ #ML_SYSTEM=polyml-5.4.0
+@@ -106,7 +113,7 @@
+ ISABELLE_TMP_PREFIX="/tmp/isabelle-$USER"
+
+ # Heap input locations. ML system identifier is included in lookup.
+-ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:$ISABELLE_HOME/heaps"
++ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:/usr/lib64/Isabelle2011-1/heaps"
+
+ # Heap output location. ML system identifier is appended automatically later on.
+ ISABELLE_OUTPUT="$ISABELLE_HOME_USER/heaps"
+@@ -170,6 +177,7 @@
+ "/usr/local/ProofGeneral" \
+ "/usr/share/ProofGeneral" \
+ "/opt/ProofGeneral" \
++ "/usr/share/emacs/site-lisp/ProofGeneral" \
+ "")"
+
+ PROOFGENERAL_OPTIONS=""
diff --git a/sci-mathematics/isabelle/files/isabelle-2011.1-reverse-line-editor-order.patch b/sci-mathematics/isabelle/files/isabelle-2011.1-reverse-line-editor-order.patch
new file mode 100644
index 00000000000..b2f2c35ee08
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2011.1-reverse-line-editor-order.patch
@@ -0,0 +1,12 @@
+--- Isabelle2011-1-orig/etc/settings 2011-10-10 01:47:58.000000000 +1100
++++ Isabelle2011-1/etc/settings 2012-05-27 23:28:37.283028668 +1000
+@@ -66,8 +66,8 @@
+ ###
+
+ ISABELLE_LINE_EDITOR=""
+-[ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p rlwrap)"
+ [ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p ledit)"
++[ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p rlwrap)"
+
+
+ ###
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-gentoo-settings.patch b/sci-mathematics/isabelle/files/isabelle-2012-gentoo-settings.patch
new file mode 100644
index 00000000000..8994491445d
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-gentoo-settings.patch
@@ -0,0 +1,62 @@
+--- Isabelle2012-orig/etc/settings 2012-05-23 03:07:38.000000000 +1000
++++ Isabelle2012/etc/settings 2012-05-27 18:07:26.502878614 +1000
+@@ -16,17 +16,24 @@
+ # Only one of the sections below should be activated.
+
+ # Poly/ML default (automated settings)
+-ML_PLATFORM="$ISABELLE_PLATFORM"
+-ML_HOME="$(choosefrom \
+- "$ISABELLE_HOME/contrib/polyml/$ML_PLATFORM" \
+- "$ISABELLE_HOME/../polyml/$ML_PLATFORM" \
+- "/usr/local/polyml/$ML_PLATFORM" \
+- "/usr/share/polyml/$ML_PLATFORM" \
+- "/opt/polyml/$ML_PLATFORM" \
+- "")"
+-ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
+-ML_OPTIONS="-H 200"
+-ML_SOURCES="$ML_HOME/../src"
++# ML_PLATFORM="$ISABELLE_PLATFORM"
++# ML_HOME="$(choosefrom \
++# "$ISABELLE_HOME/contrib/polyml/$ML_PLATFORM" \
++# "$ISABELLE_HOME/../polyml/$ML_PLATFORM" \
++# "/usr/local/polyml/$ML_PLATFORM" \
++# "/usr/share/polyml/$ML_PLATFORM" \
++# "/opt/polyml/$ML_PLATFORM" \
++# "")"
++# ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
++# ML_OPTIONS="-H 200"
++# ML_SOURCES="$ML_HOME/../src"
++
++# Poly/ML Gentoo (x86_64)
++ML_PLATFORM=x86_64-linux
++ML_HOME="/usr/bin"
++ML_SYSTEM=polyml-5.4.0
++ML_OPTIONS="-H 1000"
++ML_SOURCES="/usr/src/debug/dev-lang/polyml-5.4.0"
+
+ # Poly/ML 32 bit (manual settings)
+ #ML_SYSTEM=polyml-5.4.1
+@@ -102,7 +109,7 @@
+ ISABELLE_TMP_PREFIX="/tmp/isabelle-$USER"
+
+ # Heap input locations. ML system identifier is included in lookup.
+-ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:$ISABELLE_HOME/heaps"
++ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:/usr/lib64/Isabelle2012/heaps"
+
+ # Heap output location. ML system identifier is appended automatically later on.
+ ISABELLE_OUTPUT="$ISABELLE_HOME_USER/heaps"
+@@ -161,13 +168,7 @@
+ ###
+
+ # Proof General home, look in a variety of places
+-PROOFGENERAL_HOME="$(choosefrom \
+- "$ISABELLE_HOME/contrib/ProofGeneral" \
+- "$ISABELLE_HOME/../ProofGeneral" \
+- "/usr/local/ProofGeneral" \
+- "/usr/share/ProofGeneral" \
+- "/opt/ProofGeneral" \
+- "")"
++PROOFGENERAL_HOME="/usr/share/emacs/site-lisp/ProofGeneral"
+
+ PROOFGENERAL_OPTIONS=""
+ #PROOFGENERAL_OPTIONS="-m no_brackets -m no_type_brackets"
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-graphbrowser.patch b/sci-mathematics/isabelle/files/isabelle-2012-graphbrowser.patch
new file mode 100644
index 00000000000..3e63f1c6223
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-graphbrowser.patch
@@ -0,0 +1,11 @@
+--- Isabelle2012-orig/lib/browser/build 2012-05-20 19:34:33.000000000 +1000
++++ Isabelle2012/lib/browser/build 2012-05-26 22:18:41.952750622 +1000
+@@ -6,6 +6,8 @@
+ #
+ # Requires proper Isabelle settings environment.
+
++ISABELLE_HOME="$(cd "$(dirname "${0}")/../.."; pwd -P)"
++source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
+
+ ## diagnostics
+
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-libsha1.patch b/sci-mathematics/isabelle/files/isabelle-2012-libsha1.patch
new file mode 100644
index 00000000000..06933669de7
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-libsha1.patch
@@ -0,0 +1,11 @@
+--- Isabelle2012-orig/src/Pure/General/sha1_polyml.ML 2012-05-20 19:34:33.000000000 +1000
++++ Isabelle2012/src/Pure/General/sha1_polyml.ML 2012-12-05 23:24:06.263793934 +1100
+@@ -18,7 +18,7 @@
+ in (op ^) (pairself hex_digit (Integer.div_mod (Char.ord c) 16)) end
+
+ val lib_path =
+- ("$ML_HOME/" ^ (if ML_System.platform_is_cygwin then "sha1.dll" else "libsha1.so"))
++ ("$SHA1_HOME/" ^ (if ML_System.platform_is_cygwin then "sha1.dll" else "libsha1.so"))
+ |> Path.explode;
+
+ fun digest_external str =
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-redundant-equations-in-function-definitions-error.patch b/sci-mathematics/isabelle/files/isabelle-2012-redundant-equations-in-function-definitions-error.patch
new file mode 100644
index 00000000000..18ae43d00fe
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-redundant-equations-in-function-definitions-error.patch
@@ -0,0 +1,35 @@
+diff -r dd611ab202a8 -r e7e647949c95 src/HOL/Tools/Function/fun.ML
+--- a/src/HOL/Tools/Function/fun.ML Wed Jun 06 10:35:05 2012 +0200
++++ b/src/HOL/Tools/Function/fun.ML Wed Jun 06 21:36:21 2012 +0200
+@@ -84,10 +84,10 @@
+ spec @ mk_catchall fixes arity_of
+ end
+
+-fun warnings ctxt origs tss =
++fun further_checks ctxt origs tss =
+ let
+- fun warn_redundant t =
+- warning ("Ignoring redundant equation: " ^ quote (Syntax.string_of_term ctxt t))
++ fun fail_redundant t =
++ error (cat_lines ["Equation is redundant (covered by preceding clauses):", Syntax.string_of_term ctxt t])
+ fun warn_missing strs =
+ warning (cat_lines ("Missing patterns in function definition:" :: strs))
+
+@@ -100,7 +100,7 @@
+ @ ["(" ^ string_of_int (length rest) ^ " more)"])
+
+ val _ = (origs ~~ tss')
+- |> map (fn (t, ts) => if null ts then warn_redundant t else ())
++ |> map (fn (t, ts) => if null ts then fail_redundant t else ())
+ in
+ ()
+ end
+@@ -119,7 +119,7 @@
+ val compleqs = add_catchall ctxt fixes feqs (* Completion *)
+
+ val spliteqs = Function_Split.split_all_equations ctxt compleqs
+- |> tap (warnings ctxt feqs)
++ |> tap (further_checks ctxt feqs)
+
+ fun restore_spec thms =
+ bnds ~~ take (length bnds) (unflat spliteqs thms)
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-reverse-line-editor-order.patch b/sci-mathematics/isabelle/files/isabelle-2012-reverse-line-editor-order.patch
new file mode 100644
index 00000000000..233ea5b50fa
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-reverse-line-editor-order.patch
@@ -0,0 +1,12 @@
+--- Isabelle2012-orig/etc/settings 2012-05-23 03:07:38.000000000 +1000
++++ Isabelle2012/etc/settings 2012-05-27 12:43:36.209715015 +1000
+@@ -62,8 +62,8 @@
+ ###
+
+ ISABELLE_LINE_EDITOR=""
+-[ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p rlwrap)"
+ [ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p ledit)"
++[ -z "$ISABELLE_LINE_EDITOR" ] && ISABELLE_LINE_EDITOR="$(type -p rlwrap)"
+
+
+ ###
diff --git a/sci-mathematics/isabelle/files/isabelle-2012-signal-handling.patch b/sci-mathematics/isabelle/files/isabelle-2012-signal-handling.patch
new file mode 100644
index 00000000000..d238f41bd32
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2012-signal-handling.patch
@@ -0,0 +1,8 @@
+diff -r c79adcae9869 -r 6de952f4069f lib/scripts/run-polyml
+--- a/lib/scripts/run-polyml Fri May 25 13:23:43 2012 +0200
++++ b/lib/scripts/run-polyml Fri May 25 17:14:14 2012 +0200
+@@ -76,3 +76,3 @@
+ "$ISABELLE_HOME/lib/scripts/feeder" -p -h "$MLTEXT" -t "$MLEXIT" $FEEDER_OPTS | \
+- { read FPID; "$POLY" -q $ML_OPTIONS; RC="$?"; kill -HUP "$FPID"; exit "$RC"; }
++ { read FPID; "$POLY" -q $ML_OPTIONS; RC="$?"; kill -TERM "$FPID"; exit "$RC"; }
+ RC="$?"
diff --git a/sci-mathematics/isabelle/files/isabelle-2013-HOL-Predicate_Compile_Examples.patch b/sci-mathematics/isabelle/files/isabelle-2013-HOL-Predicate_Compile_Examples.patch
new file mode 100644
index 00000000000..bce7eec4417
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2013-HOL-Predicate_Compile_Examples.patch
@@ -0,0 +1,82 @@
+--- Isabelle2013-orig/src/HOL/Predicate_Compile_Examples/Hotel_Example_Prolog.thy 2013-02-13 00:31:10.000000000 +1100
++++ Isabelle2013/src/HOL/Predicate_Compile_Examples/Hotel_Example_Prolog.thy 2013-08-31 14:37:02.015159000 +1000
+@@ -82,7 +82,7 @@
+ setup {* Context.theory_map (Quickcheck.add_tester ("prolog", (Code_Prolog.active, Code_Prolog.test_goals))) *}
+
+ lemma "\<lbrakk> hotel s; isinp s r g \<rbrakk> \<Longrightarrow> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ section {* Manual setup to find the counterexample *}
+@@ -110,7 +110,7 @@
+
+ lemma
+ "hotel s ==> feels_safe s r ==> isinp s r g ==> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ section {* Using a global limit for limiting the execution *}
+@@ -146,7 +146,7 @@
+
+ lemma
+ "hotel s ==> feels_safe s r ==> isinp s r g ==> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ end
+\ No newline at end of file
+--- Isabelle2013-orig/src/HOL/Predicate_Compile_Examples/Context_Free_Grammar_Example.thy 2013-02-13 00:31:10.000000000 +1100
++++ Isabelle2013/src/HOL/Predicate_Compile_Examples/Context_Free_Grammar_Example.thy 2013-08-31 14:36:47.049851000 +1000
+@@ -33,7 +33,7 @@
+
+ lemma
+ "S\<^isub>1p w \<Longrightarrow> w = []"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+ definition "filter_a = filter (\<lambda>x. x = a)"
+@@ -67,7 +67,7 @@
+
+ theorem S\<^isub>1_sound:
+ "S\<^isub>1p w \<Longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+
+@@ -91,7 +91,7 @@
+
+ theorem S\<^isub>2_sound:
+ "S\<^isub>2p w \<longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+ inductive_set S\<^isub>3 and A\<^isub>3 and B\<^isub>3 where
+--- Isabelle2013-orig/src/HOL/Predicate_Compile_Examples/Lambda_Example.thy 2013-02-13 00:31:10.000000000 +1100
++++ Isabelle2013/src/HOL/Predicate_Compile_Examples/Lambda_Example.thy 2013-08-31 14:28:11.784390000 +1000
+@@ -92,7 +92,7 @@
+
+ lemma
+ "\<Gamma> \<turnstile> t : U \<Longrightarrow> t \<rightarrow>\<^sub>\<beta> t' \<Longrightarrow> \<Gamma> \<turnstile> t' : U"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ text {* Verifying that the found counterexample really is one by means of a proof *}
+--- Isabelle2013-orig/src/HOL/Predicate_Compile_Examples/List_Examples.thy 2013-02-13 00:31:10.000000000 +1100
++++ Isabelle2013/src/HOL/Predicate_Compile_Examples/List_Examples.thy 2013-08-31 14:27:52.013962000 +1000
+@@ -21,7 +21,7 @@
+ lemma "(xs :: nat list) = ys @ ys --> rev xs = xs"
+ quickcheck[tester = random, iterations = 10000]
+ quickcheck[tester = smart_exhaustive, iterations = 1, expect = counterexample]
+-quickcheck[tester = prolog, expect = counterexample]
++quickcheck[tester = prolog]
+ oops
+
+ end
+\ No newline at end of file
diff --git a/sci-mathematics/isabelle/files/isabelle-2013-classpath.patch b/sci-mathematics/isabelle/files/isabelle-2013-classpath.patch
new file mode 100644
index 00000000000..e3b2271a30c
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2013-classpath.patch
@@ -0,0 +1,149 @@
+--- Isabelle2013-orig/lib/Tools/java 2013-02-13 00:31:02.000000000 +1100
++++ Isabelle2013/lib/Tools/java 2015-04-17 12:16:04.734716358 +1000
+@@ -6,5 +6,5 @@
+
+ CLASSPATH="$(jvmpath "$CLASSPATH")"
+ isabelle_jdk java -Dfile.encoding=UTF-8 -server \
+- "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext")" "$@"
++ "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext:$(java-config -p scala-2.10 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+
+--- Isabelle2013-orig/lib/Tools/scala 2013-02-13 00:31:02.000000000 +1100
++++ Isabelle2013/lib/Tools/scala 2015-04-17 12:12:21.606890256 +1000
+@@ -8,4 +8,4 @@
+
+ CLASSPATH="$(jvmpath "$CLASSPATH")"
+ isabelle_scala scala -Dfile.encoding=UTF-8 \
+- "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext")" "$@"
++ "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext:$(java-config -p scala-2.10 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+--- Isabelle2013-orig/lib/Tools/scalac 2013-02-13 00:31:02.000000000 +1100
++++ Isabelle2013/lib/Tools/scalac 2015-04-17 12:12:36.895871214 +1000
+@@ -8,5 +8,5 @@
+
+ CLASSPATH="$(jvmpath "$CLASSPATH")"
+ isabelle_scala scalac -Dfile.encoding=UTF-8 \
+- "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext")" "$@"
++ "-Djava.ext.dirs=$(jvmpath "$ISABELLE_JAVA_EXT:$ISABELLE_HOME/lib/classes/ext:$(java-config -p scala-2.10 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+
+--- Isabelle2013-orig/src/Pure/build-jars 2013-02-13 00:31:15.000000000 +1100
++++ Isabelle2013/src/Pure/build-jars 2013-08-18 12:55:51.400924000 +1000
+@@ -133,7 +133,7 @@
+ declare -a JFREECHART_JARS=()
+ for NAME in $JFREECHART_JAR_NAMES
+ do
+- JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$JFREECHART_HOME/lib/$NAME"
++ JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$NAME"
+ done
+
+
+--- Isabelle2013-orig/src/Tools/jEdit/lib/Tools/jedit 2013-02-13 00:31:16.000000000 +1100
++++ Isabelle2013/src/Tools/jEdit/lib/Tools/jedit 2013-08-18 16:39:15.495244000 +1000
+@@ -214,97 +214,11 @@
+ declare -a JFREECHART_JARS=()
+ for NAME in $JFREECHART_JAR_NAMES
+ do
+- JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$JFREECHART_HOME/lib/$NAME"
++ JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$NAME"
+ done
+
+-
+-# target
+-
+-TARGET="dist/jars/Isabelle-jEdit.jar"
+-
+-declare -a UPDATED=()
+-
+-if [ "$BUILD_JARS" = jars_fresh ]; then
+- OUTDATED=true
+-else
+- OUTDATED=false
+- if [ ! -e "$TARGET" ]; then
+- OUTDATED=true
+- else
+- if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then
+- declare -a DEPS=(
+- "$JEDIT_JAR" "${JEDIT_JARS[@]}" "${JFREECHART_JARS[@]}"
+- "$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}"
+- )
+- elif [ -e "$ISABELLE_HOME/Admin/build" ]; then
+- declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}")
+- else
+- declare -a DEPS=()
+- fi
+- for DEP in "${DEPS[@]}"
+- do
+- [ ! -e "$DEP" ] && fail "Missing file: $DEP"
+- [ "$DEP" -nt "$TARGET" ] && {
+- OUTDATED=true
+- UPDATED["${#UPDATED[@]}"]="$DEP"
+- }
+- done
+- fi
+-fi
+-
+-
+-# build
+-
+-if [ "$OUTDATED" = true ]
+-then
+- echo "### Building Isabelle/jEdit ..."
+-
+- [ "${#UPDATED[@]}" -gt 0 ] && {
+- echo "Changed files:"
+- for FILE in "${UPDATED[@]}"
+- do
+- echo " $FILE"
+- done
+- }
+-
+- [ -z "$ISABELLE_JEDIT_BUILD_HOME" ] && \
+- fail "Unknown ISABELLE_JEDIT_BUILD_HOME -- missing auxiliary component"
+-
+- rm -rf dist || failed
+- mkdir -p dist dist/classes || failed
+-
+- cp -p -R -f "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/.
+- cp -p -R -f "${RESOURCES[@]}" dist/classes/.
+- cp src/jEdit.props dist/properties/.
+- cp -p -R -f src/modes/. dist/modes/.
+-
+- perl -i -e 'while (<>) {
+- if (m/NAME="javacc"/) {
+- print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,;
+- print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,;
+- print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; }
+- print; }' dist/modes/catalog
+-
+- cp -p -R -f "${JEDIT_JARS[@]}" dist/jars/. || failed
+- (
+- for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "${JFREECHART_JARS[@]}" "$PURE_JAR" \
+- "$GRAPHVIEW_JAR" "$SCALA_HOME/lib/scala-compiler.jar"
+- do
+- CLASSPATH="$CLASSPATH:$JAR"
+- done
+- CLASSPATH="$(jvmpath "$CLASSPATH")"
+- exec "$SCALA_HOME/bin/scalac" $ISABELLE_SCALA_BUILD_OPTIONS -d dist/classes "${SOURCES[@]}"
+- ) || fail "Failed to compile sources"
+-
+- cd dist/classes
+- isabelle_jdk jar cf "../jars/Isabelle-jEdit.jar" * || failed
+- cd ../..
+- rm -rf dist/classes
+-fi
+-
+ popd >/dev/null
+
+-
+ ## main
+
+ if [ "$BUILD_ONLY" = false ]; then
+--- Isabelle2013-orig/contrib/jfreechart-1.0.14/etc/settings 2012-12-09 07:23:53.000000000 +1100
++++ Isabelle2013/contrib/jfreechart-1.0.14/etc/settings 2013-08-18 16:18:10.244698000 +1000
+@@ -1,7 +1,5 @@
+ # -*- shell-script -*- :mode=shellscript:
+
+ JFREECHART_HOME="$COMPONENT"
+-JFREECHART_JAR_NAMES="iText-2.1.5.jar jcommon-1.0.18.jar jfreechart-1.0.14.jar"
+-
+-ISABELLE_JAVA_EXT="$ISABELLE_JAVA_EXT:$JFREECHART_HOME/lib"
++JFREECHART_JAR_NAMES="$(java-config -p itext | sed -e 's@:@ @g') $(java-config -p jcommon-1.0 | sed -e 's@:@ @g') $(java-config -p jfreechart-1.0 | sed -e 's@:@ @g')"
+
diff --git a/sci-mathematics/isabelle/files/isabelle-2013-gentoo-settings.patch b/sci-mathematics/isabelle/files/isabelle-2013-gentoo-settings.patch
new file mode 100644
index 00000000000..7066c6b875a
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2013-gentoo-settings.patch
@@ -0,0 +1,19 @@
+--- Isabelle2013-orig/etc/settings 2013-02-13 00:31:02.000000000 +1100
++++ Isabelle2013/etc/settings 2013-08-17 14:47:46.045988000 +1000
+@@ -176,3 +176,16 @@
+ #ISABELLE_GHC="/usr/bin/ghc"
+ #ISABELLE_OCAML="/usr/bin/ocaml"
+ #ISABELLE_SWIPL="/usr/bin/swipl"
++
++# Poly/ML Gentoo (x86_64)
++ML_PLATFORM=x86_64-linux
++ML_HOME="/usr/bin"
++ML_SYSTEM=polyml-5.5.0
++ML_OPTIONS="-H 1000"
++ML_SOURCES="/usr/src/debug/dev-lang/polyml-5.5.0"
++
++# Proof General home
++PROOFGENERAL_HOME="/usr/share/emacs/site-lisp/ProofGeneral"
++PROOFGENERAL_OPTIONS=""
++#PROOFGENERAL_OPTIONS="-m no_brackets -m no_type_brackets"
++
diff --git a/sci-mathematics/isabelle/files/isabelle-2013.2-HOL-Predicate_Compile_Examples.patch b/sci-mathematics/isabelle/files/isabelle-2013.2-HOL-Predicate_Compile_Examples.patch
new file mode 100644
index 00000000000..e1253016837
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2013.2-HOL-Predicate_Compile_Examples.patch
@@ -0,0 +1,89 @@
+--- Isabelle2013-2-orig/src/HOL/Predicate_Compile_Examples/Hotel_Example_Prolog.thy 2013-12-06 02:18:50.000000000 +1100
++++ Isabelle2013-2/src/HOL/Predicate_Compile_Examples/Hotel_Example_Prolog.thy 2014-02-09 22:21:20.676081140 +1100
+@@ -87,7 +87,7 @@
+ *}
+
+ lemma "\<lbrakk> hotel s; isinp s r g \<rbrakk> \<Longrightarrow> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ section {* Manual setup to find the counterexample *}
+@@ -115,7 +115,7 @@
+
+ lemma
+ "hotel s ==> feels_safe s r ==> isinp s r g ==> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ section {* Using a global limit for limiting the execution *}
+@@ -151,7 +151,7 @@
+
+ lemma
+ "hotel s ==> feels_safe s r ==> isinp s r g ==> owns s r = Some g"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ end
+\ No newline at end of file
+--- Isabelle2013-2-orig/src/HOL/Predicate_Compile_Examples/Context_Free_Grammar_Example.thy 2013-12-06 02:18:50.000000000 +1100
++++ Isabelle2013-2/src/HOL/Predicate_Compile_Examples/Context_Free_Grammar_Example.thy 2014-02-09 22:27:26.826238011 +1100
+@@ -36,7 +36,7 @@
+
+ lemma
+ "S\<^sub>1p w \<Longrightarrow> w = []"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+ definition "filter_a = filter (\<lambda>x. x = a)"
+@@ -70,7 +70,7 @@
+
+ theorem S\<^sub>1_sound:
+ "S\<^sub>1p w \<Longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+
+@@ -94,7 +94,7 @@
+
+ theorem S\<^sub>2_sound:
+ "S\<^sub>2p w \<longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]"
+-quickcheck[tester = prolog, iterations=1, expect = counterexample]
++quickcheck[tester = prolog, iterations=1]
+ oops
+
+ inductive_set S\<^sub>3 and A\<^sub>3 and B\<^sub>3 where
+@@ -171,4 +171,4 @@
+ hide_const a b
+
+
+-end
+\ No newline at end of file
++end
+--- Isabelle2013-2-orig/src/HOL/Predicate_Compile_Examples/Lambda_Example.thy 2013-12-06 02:18:50.000000000 +1100
++++ Isabelle2013-2/src/HOL/Predicate_Compile_Examples/Lambda_Example.thy 2014-02-09 22:21:20.677081168 +1100
+@@ -95,7 +95,7 @@
+
+ lemma
+ "\<Gamma> \<turnstile> t : U \<Longrightarrow> t \<rightarrow>\<^sub>\<beta> t' \<Longrightarrow> \<Gamma> \<turnstile> t' : U"
+-quickcheck[tester = prolog, iterations = 1, expect = counterexample]
++quickcheck[tester = prolog, iterations = 1]
+ oops
+
+ text {* Verifying that the found counterexample really is one by means of a proof *}
+--- Isabelle2013-2-orig/src/HOL/Predicate_Compile_Examples/List_Examples.thy 2013-12-06 02:18:50.000000000 +1100
++++ Isabelle2013-2/src/HOL/Predicate_Compile_Examples/List_Examples.thy 2014-02-09 22:21:20.678081196 +1100
+@@ -24,7 +24,7 @@
+ lemma "(xs :: nat list) = ys @ ys --> rev xs = xs"
+ quickcheck[tester = random, iterations = 10000]
+ quickcheck[tester = smart_exhaustive, iterations = 1, expect = counterexample]
+-quickcheck[tester = prolog, expect = counterexample]
++quickcheck[tester = prolog]
+ oops
+
+ end
+\ No newline at end of file
diff --git a/sci-mathematics/isabelle/files/isabelle-2013.2-classpath.patch b/sci-mathematics/isabelle/files/isabelle-2013.2-classpath.patch
new file mode 100644
index 00000000000..b3ad4ae95cd
--- /dev/null
+++ b/sci-mathematics/isabelle/files/isabelle-2013.2-classpath.patch
@@ -0,0 +1,135 @@
+--- Isabelle2013-2-orig/lib/Tools/java 2013-12-06 02:18:34.000000000 +1100
++++ Isabelle2013-2/lib/Tools/java 2015-04-17 12:23:11.535463796 +1000
+@@ -10,5 +10,5 @@
+ unset CLASSPATH
+
+ isabelle_jdk java "${JAVA_ARGS[@]}" \
+- -classpath "$(jvmpath "$ISABELLE_CLASSPATH")" "$@"
++ -classpath "$(jvmpath "$ISABELLE_CLASSPATH:$(java-config -p scala-2.11 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+
+--- Isabelle2013-2-orig/lib/Tools/scala 2013-12-06 02:18:34.000000000 +1100
++++ Isabelle2013-2/lib/Tools/scala 2015-04-17 12:23:24.836455672 +1000
+@@ -7,5 +7,5 @@
+ isabelle_admin_build jars || exit $?
+
+ isabelle_scala scala -Dfile.encoding=UTF-8 \
+- -classpath "$(jvmpath "$ISABELLE_CLASSPATH")" "$@"
++ -classpath "$(jvmpath "$ISABELLE_CLASSPATH:$(java-config -p scala-2.11 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+
+--- Isabelle2013-2-orig/lib/Tools/scalac 2013-12-06 02:18:34.000000000 +1100
++++ Isabelle2013-2/lib/Tools/scalac 2015-04-17 12:23:33.084450628 +1000
+@@ -7,5 +7,5 @@
+ isabelle_admin_build jars || exit $?
+
+ isabelle_scala scalac -Dfile.encoding=UTF-8 \
+- -classpath "$(jvmpath "$ISABELLE_CLASSPATH")" "$@"
++ -classpath "$(jvmpath "$ISABELLE_CLASSPATH:$(java-config -p scala-2.11 | sed 's@\([^:]*\)/[^:]*:.*@\1@')")" "$@"
+
+--- Isabelle2013-2-orig/src/Tools/jEdit/lib/Tools/jedit 2013-12-06 02:19:04.000000000 +1100
++++ Isabelle2013-2/src/Tools/jEdit/lib/Tools/jedit 2014-02-09 20:59:14.026841490 +1100
+@@ -211,105 +211,6 @@
+ "$ISABELLE_JEDIT_BUILD_HOME/contrib/jsr305-2.0.0.jar"
+ )
+
+-
+-# target
+-
+-TARGET="dist/jars/Isabelle-jEdit.jar"
+-
+-declare -a UPDATED=()
+-
+-if [ "$BUILD_JARS" = jars_fresh ]; then
+- OUTDATED=true
+-else
+- OUTDATED=false
+- if [ ! -e "$TARGET" ]; then
+- OUTDATED=true
+- else
+- if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then
+- declare -a DEPS=(
+- "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR"
+- "${SOURCES[@]}" "${RESOURCES[@]}"
+- )
+- elif [ -e "$ISABELLE_HOME/Admin/build" ]; then
+- declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}")
+- else
+- declare -a DEPS=()
+- fi
+- for DEP in "${DEPS[@]}"
+- do
+- [ ! -e "$DEP" ] && fail "Missing file: $DEP"
+- [ "$DEP" -nt "$TARGET" ] && {
+- OUTDATED=true
+- UPDATED["${#UPDATED[@]}"]="$DEP"
+- }
+- done
+- fi
+-fi
+-
+-
+-# build
+-
+-if [ "$OUTDATED" = true ]
+-then
+- echo "### Building Isabelle/jEdit ..."
+-
+- [ "${#UPDATED[@]}" -gt 0 ] && {
+- echo "Changed files:"
+- for FILE in "${UPDATED[@]}"
+- do
+- echo " $FILE"
+- done
+- }
+-
+- [ -z "$ISABELLE_JEDIT_BUILD_HOME" ] && \
+- fail "Unknown ISABELLE_JEDIT_BUILD_HOME -- missing auxiliary component"
+-
+- rm -rf dist || failed
+- mkdir -p dist dist/classes || failed
+-
+- cp -p -R -f "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/.
+- cp -p -R -f "${RESOURCES[@]}" dist/classes/.
+- cp src/jEdit.props dist/properties/.
+- cp -p -R -f src/modes/. dist/modes/.
+-
+- perl -i -e 'while (<>) {
+- if (m/NAME="javacc"/) {
+- print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,;
+- print qq,<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n,;
+- print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,;
+- print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; }
+- print; }' dist/modes/catalog
+-
+- cd dist
+- isabelle_jdk jar xf jedit.jar
+- cp "$ISABELLE_HOME/lib/logo/isabelle-32.gif" \
+- "org/gjt/sp/jedit/icons/themes/classic/32x32/apps/isabelle.gif" || failed
+- cp "$ISABELLE_HOME/lib/logo/isabelle-32.gif" \
+- "org/gjt/sp/jedit/icons/themes/tango/32x32/apps/isabelle.gif" || failed
+- isabelle_jdk jar cfe jedit.jar org.gjt.sp.jedit.jEdit org || failed
+- rm -rf META-INF org
+- cd ..
+-
+- cp -p -R -f "${JEDIT_JARS[@]}" dist/jars/. || failed
+- (
+- #workaround for scalac 2.10.2
+- function stty() { :; }
+- export -f stty
+-
+- for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR"
+- do
+- classpath "$JAR"
+- done
+- export CLASSPATH="$(jvmpath "$ISABELLE_CLASSPATH")"
+- exec "$SCALA_HOME/bin/scalac" $ISABELLE_SCALA_BUILD_OPTIONS -d dist/classes "${SOURCES[@]}"
+- ) || fail "Failed to compile sources"
+-
+- cd dist/classes
+- isabelle_jdk jar cf "../jars/Isabelle-jEdit.jar" * || failed
+- cd ../..
+- rm -rf dist/classes
+-fi
+-
+ popd >/dev/null
+
+
diff --git a/sci-mathematics/isabelle/isabelle-2011.1-r2.ebuild b/sci-mathematics/isabelle/isabelle-2011.1-r2.ebuild
new file mode 100644
index 00000000000..6b96bcb5726
--- /dev/null
+++ b/sci-mathematics/isabelle/isabelle-2011.1-r2.ebuild
@@ -0,0 +1,254 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 multilib versionator
+
+MY_PN="Isabelle"
+MY_PV=$(replace_all_version_separators '-')
+MY_P="${MY_PN}${MY_PV}"
+
+DESCRIPTION="Isabelle is a generic proof assistant"
+HOMEPAGE="http://www.cl.cam.ac.uk/research/hvg/isabelle/index.html"
+SRC_URI="http://www.cl.cam.ac.uk/research/hvg/isabelle/dist/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+ALL_LOGICS="Pure FOL +HOL ZF CCL CTT Cube FOLP LCF Sequents"
+IUSE="${ALL_LOGICS} doc graphbrowsing ledit readline +proofgeneral test"
+
+#upstream says
+#bash 2.x/3.x, Poly/ML 5.x, Perl 5.x,
+#for document preparation: complete LaTeX
+DEPEND=">=app-shells/bash-3.0:*
+ >=dev-lang/polyml-5.4.1:=[-portable]
+ >=dev-lang/perl-5.8.8-r2"
+
+RDEPEND="dev-perl/libwww-perl
+ sci-mathematics/sha1-polyml
+ doc? (
+ virtual/latex-base
+ dev-tex/rail
+ )
+ proofgeneral? (
+ app-emacs/proofgeneral
+ )
+ ledit? (
+ app-misc/ledit
+ )
+ readline? (
+ app-misc/rlwrap
+ )
+ ${DEPEND}"
+
+S="${WORKDIR}"/Isabelle${MY_PV}
+TARGETDIR="/usr/share/Isabelle"${MY_PV}
+LIBDIR="/usr/"$(get_libdir)"/Isabelle"${MY_PV}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ if ! use proofgeneral
+ then
+ ewarn "You have deselected the Proof General interface."
+ ewarn "Only a text terminal will be installed."
+ ewarn "Emerge Isabelle with the proofgeneral USE flag enabled"
+ ewarn "to get the common interface, that most people want."
+ fi
+}
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ epatch "${FILESDIR}/${PN}-2011.1-gentoo-settings.patch"
+ polymlver=$(poly -v | cut -d' ' -f2)
+ polymlarch=$(poly -v | cut -d' ' -f9 | cut -d'-' -f1)
+ sed -e "s@5.4.0@${polymlver}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml version in etc/settings"
+ sed -e "s@ML_HOME=\"/@ML_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml ML_HOME in etc/settings"
+ sed -e "s@x86_64@${polymlarch}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml arch in etc/settings"
+ sed -e "s@PROOFGENERAL_HOME=\"/@PROOFGENERAL_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure PROOFGENERAL_HOME in etc/settings"
+ sed -e "s@/usr/lib64/Isabelle${MY_PV}@${LIBDIR}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure Isabelle lib directory in etc/settings"
+ epatch "${FILESDIR}/${PN}-2011.1-graphbrowser.patch"
+ epatch "${FILESDIR}/${PN}-2011.1-libsha1.patch"
+ cat <<- EOF >> "${S}/etc/settings"
+
+ ISABELLE_GHC="${ROOT}usr/bin/ghc"
+ ISABELLE_OCAML="${ROOT}usr/bin/ocaml"
+ ISABELLE_SWIPL="${ROOT}usr/bin/swipl"
+ ISABELLE_JDK_HOME="\$(java-config --jdk-home)"
+ SCALA_HOME="${ROOT}usr/share/scala"
+ SHA1_HOME="/usr/$(get_libdir)/sha1-polyml"
+ EOF
+ if use ledit && ! use readline; then
+ epatch "${FILESDIR}/${PN}-2011.1-reverse-line-editor-order.patch"
+ fi
+}
+
+src_compile() {
+ LOGICS=""
+ for l in "${ALL_LOGICS}"; do
+ if has "${l/+/}"; then
+ LOGICS="${LOGICS} ${l/+/}"
+ fi
+ done
+ einfo "Building Isabelle logics ${LOGICS}. This may take some time."
+ ./build -b -i "${LOGICS}" || die "building logics failed"
+ ./bin/isabelle makeall || die "isabelle makeall failed"
+ if use graphbrowsing
+ then
+ rm -f "${S}/lib/browser/GraphBrowser.jar" \
+ || die "failed cleaning graph browser directory"
+ pushd "${S}/lib/browser" \
+ || die "Could not change directory to lib/browser"
+ ./build || die "failed building the graph browser"
+ popd
+ fi
+}
+
+src_test() {
+ einfo "Running tests. A test run can take up to several hours!"
+ ./build -b -t || die "tests failed"
+}
+
+src_install() {
+ exeinto ${TARGETDIR}/bin
+ doexe bin/isabelle-process bin/isabelle
+
+ insinto ${TARGETDIR}
+ doins -r src
+ doins -r lib
+
+ for i in "./build" \
+ "src/Pure/mk" \
+ "src/Pure/build-jars" \
+ "src/Tools/jEdit/dist/build-support/ci/copy_properties.groovy" \
+ "src/Tools/jEdit/dist/build-support/ci/ci_release.groovy" \
+ "src/Tools/jEdit/lib/Tools/jedit" \
+ "src/Tools/Metis/fix_metis_license" \
+ "src/Tools/Metis/make_metis" \
+ "src/Tools/Metis/scripts/mlpp" \
+ "src/Tools/WWW_Find/lib/Tools/wwwfind" \
+ "src/Tools/Code/lib/Tools/codegen" \
+ "src/HOL/Mirabelle/lib/Tools/mirabelle" \
+ "src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version" \
+ "src/HOL/Tools/SMT/lib/scripts/remote_smt" \
+ "src/HOL/Tools/ATP/scripts/remote_atp" \
+ "src/HOL/Tools/ATP/scripts/spass" \
+ "src/HOL/Tools/Nitpick/lib/Tools/nitrox" \
+ "src/HOL/Mutabelle/lib/Tools/mutabelle" \
+ "src/HOL/Library/Sum_of_Squares/neos_csdp_client" \
+ "lib/browser/build" \
+ "lib/Tools/tty" \
+ "lib/Tools/mkproject" \
+ "lib/Tools/keywords" \
+ "lib/Tools/browser" \
+ "lib/Tools/install" \
+ "lib/Tools/mkdir" \
+ "lib/Tools/unsymbolize" \
+ "lib/Tools/getenv" \
+ "lib/Tools/java" \
+ "lib/Tools/make" \
+ "lib/Tools/emacs" \
+ "lib/Tools/scala" \
+ "lib/Tools/print" \
+ "lib/Tools/latex" \
+ "lib/Tools/findlogics" \
+ "lib/Tools/doc" \
+ "lib/Tools/logo" \
+ "lib/Tools/usedir" \
+ "lib/Tools/yxml" \
+ "lib/Tools/version" \
+ "lib/Tools/makeall" \
+ "lib/Tools/scalac" \
+ "lib/Tools/document" \
+ "lib/Tools/env" \
+ "lib/Tools/display" \
+ "lib/Tools/dimacs2hol" \
+ "lib/scripts/keywords" \
+ "lib/scripts/unsymbolize" \
+ "lib/scripts/run-polyml" \
+ "lib/scripts/run-smlnj" \
+ "lib/scripts/feeder" \
+ "lib/scripts/java_ext_dirs" \
+ "lib/scripts/yxml" \
+ "lib/scripts/raw_dump" \
+ "lib/scripts/polyml-version" \
+ "lib/scripts/process"
+ do
+ exeinto $(dirname "${TARGETDIR}/${i}")
+ doexe ${i}
+ done
+
+ docompress -x /usr/share/doc/${PF}
+ dodoc -r doc
+ if use doc; then
+ dosym /usr/share/doc/${PF}/doc "${TARGETDIR}/doc"
+ fi
+
+ dodir /etc/isabelle
+ insinto /etc/isabelle
+ doins -r etc/*
+
+ dosym /etc/isabelle "${TARGETDIR}/etc"
+ dosym "${LIBDIR}/heaps" "${TARGETDIR}/heaps"
+
+ insinto ${LIBDIR}
+ doins -r heaps
+
+ bin/isabelle install -d ${TARGETDIR} -p "${ED}usr/bin" \
+ || die "isabelle install failed"
+ newicon lib/icons/isabelle.xpm "${PN}.xpm"
+ dodoc ANNOUNCE CONTRIBUTORS COPYRIGHT NEWS README
+
+ java-pkg_regjar \
+ "${ED}${TARGETDIR}/lib/browser/GraphBrowser.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/Pure.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-library.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-swing.jar" \
+ "${ED}${TARGETDIR}/lib/classes/java_ext_dirs.jar"
+}
+
+pkg_postinst() {
+ # If any of the directories in /etc/isabelle/components do not exist, then
+ # even isabelle getenv ISABELLE_HOME fails. Hence it is necessary to
+ # to delete any non-existing directories. If an old Isabelle version was
+ # installed with component ebuilds like sci-mathematics/e, then the
+ # Isabelle version is upgraded, then the contrib directories will not
+ # exist initially, it is necessary to delete them from /etc/isabelle/components.
+ # Then these components are rebuilt (creating these directories) using the
+ # EAPI=5 subslot depends.
+ for i in $(egrep '^[^#].*$' "${ROOT}etc/isabelle/components")
+ do
+ if [ ! -d /usr/share/Isabelle2012/${i} ]; then
+ sed -e "\@${i}@d" -i "${ROOT}etc/isabelle/components"
+ fi
+ done
+ if use ledit && use readline; then
+ elog "Both readline and ledit use flags specified. The default setting"
+ elog "if both are installed is to use readline (rlwrap), this can be"
+ elog "modfied by editing the ISABELLE_LINE_EDITOR setting in"
+ elog "${ROOT}/etc/isabelle/settings"
+ fi
+ elog "Please ensure you have a pdf viewer installed, for example:"
+ elog "As root: emerge app-text/zathura-pdf-poppler"
+ elog "Please configure your preferred pdf viewer, something like:"
+ elog "As normal user: xdg-mime default zathura.desktop application/pdf"
+ elog "Or alternatively by editing the PDF_VIEWER variable in the system"
+ elog "settings file ${ROOT}etc/isabelle/settings and/or the user"
+ elog "settings file \$HOME/.isabelle/${MY_P}/etc/settings"
+ elog "To improve sledgehammer performance, consider installing:"
+ elog "USE=isabelle emerge sci-mathematics/e sci-mathematics/spass"
+ elog "For nitpick it is necessary to install:"
+ elog "emerge sci-mathematics/kodkodi"
+}
diff --git a/sci-mathematics/isabelle/isabelle-2011.1.ebuild b/sci-mathematics/isabelle/isabelle-2011.1.ebuild
new file mode 100644
index 00000000000..f0e0c82faab
--- /dev/null
+++ b/sci-mathematics/isabelle/isabelle-2011.1.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+JAVA_PKG_OPT_USE="graphbrowsing"
+inherit eutils java-pkg-opt-2 multilib versionator
+
+MY_PN="Isabelle"
+MY_PV=$(replace_all_version_separators '-')
+MY_P="${MY_PN}${MY_PV}"
+
+DESCRIPTION="Isabelle is a generic proof assistant"
+HOMEPAGE="http://www.cl.cam.ac.uk/research/hvg/isabelle/index.html"
+SRC_URI="http://www.cl.cam.ac.uk/research/hvg/isabelle/dist/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+ALL_LOGICS="Pure FOL +HOL ZF CCL CTT Cube FOLP LCF Sequents"
+IUSE="${ALL_LOGICS} doc graphbrowsing +proofgeneral test"
+
+#upstream says
+#bash 2.x/3.x, Poly/ML 5.x, Perl 5.x,
+#for document preparation: complete LaTeX
+DEPEND=">=app-shells/bash-3.0
+ >=dev-lang/polyml-5.4.1[-portable]
+ >=dev-lang/perl-5.8.8-r2"
+
+RDEPEND="doc? (
+ virtual/latex-base
+ dev-tex/rail
+ )
+ proofgeneral? (
+ app-emacs/proofgeneral
+ )
+ ${DEPEND}"
+
+S="${WORKDIR}"/Isabelle${MY_PV}
+TARGETDIR="/usr/share/Isabelle"${MY_PV}
+LIBDIR="/usr/"$(get_libdir)"/Isabelle"${MY_PV}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ if ! use proofgeneral
+ then
+ ewarn "You have deselected the Proof General interface."
+ ewarn "Only a text terminal will be installed."
+ ewarn "Emerge Isabelle with the proofgeneral USE flag enabled"
+ ewarn "to get the common interface, that most people want."
+ fi
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+ if use proofgeneral; then
+ epatch "${FILESDIR}/${PN}-2011.1-proofgeneral-gentoo-path.patch"
+ polymlver=$(poly -v | cut -d' ' -f2)
+ polymlarch=$(poly -v | cut -d' ' -f9 | cut -d'-' -f1)
+ sed -e "s@5.4.0@${polymlver}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml version in etc/settings"
+ sed -e "s@x86_64@${polymlarch}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml arch in etc/settings"
+ fi
+ if use graphbrowsing; then
+ epatch "${FILESDIR}/${PN}-2011.1-graphbrowser.patch"
+ fi
+}
+
+src_compile() {
+ LOGICS=""
+ for l in "${ALL_LOGICS}"; do
+ if has "${l/+/}"; then
+ LOGICS="${LOGICS} ${l/+/}"
+ fi
+ done
+ einfo "Building Isabelle logics ${LOGICS}. This may take some time."
+ ./build -b -i "${LOGICS}" || die "building logics failed"
+ ./bin/isabelle makeall || die "isabelle makeall failed"
+ if use graphbrowsing
+ then
+ rm -f "${S}/lib/browser/GraphBrowser.jar" \
+ || die "failed cleaning graph browser directory"
+ pushd "${S}/lib/browser" \
+ || die "Could not change directory to lib/browser"
+ ./build || die "failed building the graph browser"
+ popd
+ fi
+}
+
+src_test() {
+ einfo "Running tests. A test run can take up to several hours!"
+ ./build -b -t || die "tests failed"
+}
+
+src_install() {
+ exeinto ${TARGETDIR}/bin
+ doexe bin/isabelle-process bin/isabelle
+
+ exeinto ${TARGETDIR}
+ doexe build
+
+ insinto ${TARGETDIR}
+ doins -r src
+ dodoc -r doc
+
+ dodir /etc/isabelle
+ insinto /etc/isabelle
+ doins -r etc/*
+
+ dosym /etc/isabelle "${TARGETDIR}/etc"
+ dosym "${LIBDIR}/heaps" "${TARGETDIR}/heaps"
+
+ insinto ${LIBDIR}
+ doins -r heaps
+
+ # use cp to keep file attributes
+ cp -R lib "${ED}${TARGETDIR}" || die "install lib failed"
+
+ bin/isabelle install -d ${TARGETDIR} -p "${ED}usr/bin" \
+ || die "isabelle install failed"
+ newicon lib/icons/isabelle.xpm "${PN}.xpm"
+ dodoc ANNOUNCE CONTRIBUTORS COPYRIGHT NEWS README
+
+ java-pkg_regjar \
+ "${ED}${TARGETDIR}/lib/browser/GraphBrowser.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/Pure.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-library.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-swing.jar" \
+ "${ED}${TARGETDIR}/lib/classes/java_ext_dirs.jar"
+}
+
+pkg_postinst() {
+ elog "You will need to re-emerge Isabelle after emerging polyml."
+ elog "Please configure your preferred pdf viewer by editing"
+ elog "the PDF_VIEWER variable in the system settings file"
+ elog "/etc/isabelle/settings and/or the user settings file"
+ elog "\$HOME/.isabelle/${MY_P}/etc/settings"
+}
diff --git a/sci-mathematics/isabelle/isabelle-2012-r1.ebuild b/sci-mathematics/isabelle/isabelle-2012-r1.ebuild
new file mode 100644
index 00000000000..e6afded3e5a
--- /dev/null
+++ b/sci-mathematics/isabelle/isabelle-2012-r1.ebuild
@@ -0,0 +1,320 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 multilib versionator
+
+MY_PN="Isabelle"
+MY_PV=$(replace_all_version_separators '-')
+MY_P="${MY_PN}${MY_PV}"
+
+JEDIT_PV="20120414"
+JEDIT_PN="jedit_build"
+JEDIT_P="${JEDIT_PN}-${JEDIT_PV}"
+
+DESCRIPTION="Isabelle is a generic proof assistant"
+HOMEPAGE="http://www.cl.cam.ac.uk/research/hvg/isabelle/index.html"
+SRC_URI="http://www.cl.cam.ac.uk/research/hvg/isabelle/dist/${MY_P}.tar.gz
+ doc? ( http://dev.gentoo.org/~gienah/snapshots/${MY_P}-doc-src.tar.gz )
+ pide? ( http://www4.in.tum.de/~wenzelm/test/${JEDIT_P}.tar.gz )"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+ALL_LOGICS="Pure FOL +HOL ZF CCL CTT Cube FOLP LCF Sequents"
+IUSE="${ALL_LOGICS} doc graphbrowsing ledit readline pide +proofgeneral test"
+
+#upstream says
+#bash 2.x/3.x, Poly/ML 5.x, Perl 5.x,
+#for document preparation: complete LaTeX
+DEPEND=">=app-shells/bash-3.0:*
+ >=dev-lang/polyml-5.4.1:=[-portable]
+ >=dev-lang/perl-5.8.8-r2"
+
+RDEPEND="dev-perl/libwww-perl
+ sci-mathematics/sha1-polyml
+ doc? (
+ virtual/latex-base
+ dev-tex/rail
+ )
+ proofgeneral? (
+ app-emacs/proofgeneral
+ )
+ pide? (
+ >=dev-lang/scala-2.8.2
+ )
+ ledit? (
+ app-misc/ledit
+ )
+ readline? (
+ app-misc/rlwrap
+ )
+ ${DEPEND}"
+
+S="${WORKDIR}"/Isabelle${MY_PV}
+JEDIT_S="${WORKDIR}/${JEDIT_P}"
+TARGETDIR="/usr/share/Isabelle"${MY_PV}
+LIBDIR="/usr/"$(get_libdir)"/Isabelle"${MY_PV}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ if ! use proofgeneral
+ then
+ ewarn "You have deselected the Proof General interface."
+ ewarn "Only a text terminal will be installed."
+ ewarn "Emerge Isabelle with the proofgeneral USE flag enabled"
+ ewarn "to get the common interface, that most people want."
+ fi
+}
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ epatch "${FILESDIR}/${PN}-2012-gentoo-settings.patch"
+ # http://article.gmane.org/gmane.science.mathematics.logic.isabelle.devel/2732
+ epatch "${FILESDIR}/${PN}-2012-signal-handling.patch"
+ # http://article.gmane.org/gmane.science.mathematics.logic.isabelle.devel/2780
+ epatch "${FILESDIR}/${PN}-2012-redundant-equations-in-function-definitions-error.patch"
+ polymlver=$(poly -v | cut -d' ' -f2)
+ polymlarch=$(poly -v | cut -d' ' -f9 | cut -d'-' -f1)
+ sed -e "s@5.4.0@${polymlver}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml version in etc/settings"
+ sed -e "s@ML_HOME=\"/@ML_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml ML_HOME in etc/settings"
+ sed -e "s@x86_64@${polymlarch}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml arch in etc/settings"
+ sed -e "s@PROOFGENERAL_HOME=\"/@PROOFGENERAL_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure PROOFGENERAL_HOME in etc/settings"
+ sed -e "s@/usr/lib64/Isabelle${MY_PV}@${LIBDIR}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure Isabelle lib directory in etc/settings"
+ epatch "${FILESDIR}/${PN}-2012-graphbrowser.patch"
+ epatch "${FILESDIR}/${PN}-2012-libsha1.patch"
+ cat <<- EOF >> "${S}/etc/settings"
+
+ ISABELLE_GHC="${ROOT}usr/bin/ghc"
+ ISABELLE_OCAML="${ROOT}usr/bin/ocaml"
+ ISABELLE_SWIPL="${ROOT}usr/bin/swipl"
+ ISABELLE_JDK_HOME="\$(java-config --jdk-home)"
+ SCALA_HOME="${ROOT}usr/share/scala"
+ SHA1_HOME="/usr/$(get_libdir)/sha1-polyml"
+ EOF
+ if use pide; then
+ cat <<- EOF >> "${S}/etc/settings"
+ ISABELLE_JEDIT_BUILD_HOME="\$ISABELLE_HOME/${JEDIT_P}"
+ init_component ${JEDIT_S}
+ EOF
+ fi
+ if use ledit && ! use readline; then
+ epatch "${FILESDIR}/${PN}-2012-reverse-line-editor-order.patch"
+ fi
+}
+
+src_compile() {
+ LOGICS=""
+ for l in "${ALL_LOGICS}"; do
+ if has "${l/+/}"; then
+ LOGICS="${LOGICS} ${l/+/}"
+ fi
+ done
+ einfo "Building Isabelle logics ${LOGICS}. This may take some time."
+ ./build -b -i "${LOGICS}" || die "building logics failed"
+ ./bin/isabelle makeall || die "isabelle makeall failed"
+ if use graphbrowsing
+ then
+ rm -f "${S}/lib/browser/GraphBrowser.jar" \
+ || die "failed cleaning graph browser directory"
+ pushd "${S}/lib/browser" \
+ || die "Could not change directory to lib/browser"
+ ./build || die "failed building the graph browser"
+ popd
+ fi
+ if use pide; then
+ pushd "${S}/src/Tools/jEdit" \
+ || die "Could not change directory to src/Tools/jEdit"
+ "${S}"/bin/isabelle jedit -b -f \
+ || die "pide build failed"
+ popd
+ # The jedit_build stuff is only required to build
+ # Isabelle/jEdit Prover IDE (PIDE). These 2 lines need to be deleted
+ # from etc/settings as the jedit_build source code is not installed
+ sed -e '/ISABELLE_JEDIT_BUILD_HOME/d' \
+ -e '/init_component/d' \
+ -i "${S}/etc/settings" \
+ || die "Could not delete jedit_build lines from etc/settings"
+ fi
+}
+
+src_test() {
+ einfo "Running tests. A test run can take up to several hours!"
+ ./build -b -t || die "tests failed"
+}
+
+src_install() {
+ exeinto ${TARGETDIR}/bin
+ doexe bin/isabelle-process bin/isabelle
+
+ insinto ${TARGETDIR}
+ doins -r src
+ doins -r lib
+
+ docompress -x /usr/share/doc/${PF}
+ dodoc -r doc
+ if use doc; then
+ dosym /usr/share/doc/${PF}/doc "${TARGETDIR}/doc"
+ # The build of sci-mathematics/haskabelle with use doc requires
+ # sci-mathematics/isabelle[doc?]. The haskabelle doc build requires
+ # the doc-src directory stuff in the isabelle package. Which is not
+ # provided in the Isabelle 2012 src tarball. So extract it from a
+ # snapshot of the isabelle repo taken soon after the Isabelle 2012
+ # release.
+ doins -r doc-src
+ for i in "./doc-src/IsarRef/showsymbols" \
+ "./doc-src/TutorialI/Overview/LNCS/makeDemo" \
+ "./doc-src/TutorialI/isa-index" \
+ "./doc-src/sedindex"
+ do
+ exeinto $(dirname "${TARGETDIR}/${i}")
+ doexe ${i}
+ done
+ fi
+
+ for i in "./build" \
+ "./src/Pure/mk" \
+ "./src/Pure/build-jars" \
+ "./src/Tools/JVM/build" \
+ "./src/Tools/JVM/java_ext_dirs" \
+ "./src/Tools/jEdit/lib/Tools/jedit" \
+ "./src/Tools/Metis/fix_metis_license" \
+ "./src/Tools/Metis/make_metis" \
+ "./src/Tools/Metis/scripts/mlpp" \
+ "./src/Tools/WWW_Find/lib/Tools/wwwfind" \
+ "./src/Tools/Code/lib/Tools/codegen" \
+ "./src/HOL/Mirabelle/lib/Tools/mirabelle" \
+ "./src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version" \
+ "./src/HOL/Tools/SMT/lib/scripts/remote_smt" \
+ "./src/HOL/Tools/ATP/scripts/remote_atp" \
+ "./src/HOL/Tools/ATP/scripts/spass" \
+ "./src/HOL/Mutabelle/lib/Tools/mutabelle" \
+ "./src/HOL/TPTP/TPTP_Parser/make_mlyacclib" \
+ "./src/HOL/TPTP/TPTP_Parser/make_tptp_parser" \
+ "./src/HOL/TPTP/lib/Tools/tptp_isabelle_demo" \
+ "./src/HOL/TPTP/lib/Tools/tptp_graph" \
+ "./src/HOL/TPTP/lib/Tools/tptp_isabelle_comp" \
+ "./src/HOL/TPTP/lib/Tools/tptp_refute" \
+ "./src/HOL/TPTP/lib/Tools/tptp_translate" \
+ "./src/HOL/TPTP/lib/Tools/tptp_sledgehammer" \
+ "./src/HOL/TPTP/lib/Tools/tptp_nitpick" \
+ "./src/HOL/Library/Sum_of_Squares/neos_csdp_client" \
+ "./src/HOL/IMP/export.sh" \
+ "./lib/browser/build" \
+ "./lib/Tools/tty" \
+ "./lib/Tools/mkproject" \
+ "./lib/Tools/keywords" \
+ "./lib/Tools/browser" \
+ "./lib/Tools/install" \
+ "./lib/Tools/mkdir" \
+ "./lib/Tools/unsymbolize" \
+ "./lib/Tools/getenv" \
+ "./lib/Tools/java" \
+ "./lib/Tools/make" \
+ "./lib/Tools/emacs" \
+ "./lib/Tools/scala" \
+ "./lib/Tools/print" \
+ "./lib/Tools/latex" \
+ "./lib/Tools/findlogics" \
+ "./lib/Tools/doc" \
+ "./lib/Tools/logo" \
+ "./lib/Tools/usedir" \
+ "./lib/Tools/yxml" \
+ "./lib/Tools/version" \
+ "./lib/Tools/makeall" \
+ "./lib/Tools/scalac" \
+ "./lib/Tools/document" \
+ "./lib/Tools/env" \
+ "./lib/Tools/display" \
+ "./lib/Tools/dimacs2hol" \
+ "./lib/scripts/keywords" \
+ "./lib/scripts/unsymbolize" \
+ "./lib/scripts/run-polyml" \
+ "./lib/scripts/run-smlnj" \
+ "./lib/scripts/feeder" \
+ "./lib/scripts/yxml" \
+ "./lib/scripts/polyml-version" \
+ "./lib/scripts/process"
+ do
+ exeinto $(dirname "${TARGETDIR}/${i}")
+ doexe ${i}
+ done
+
+ dodir /etc/isabelle
+ insinto /etc/isabelle
+ doins -r etc/*
+
+ dosym /etc/isabelle "${TARGETDIR}/etc"
+ dosym "${LIBDIR}/heaps" "${TARGETDIR}/heaps"
+
+ insinto ${LIBDIR}
+ doins -r heaps
+
+ bin/isabelle install -d ${TARGETDIR} -p "${ED}usr/bin" \
+ || die "isabelle install failed"
+ newicon lib/icons/isabelle.xpm "${PN}.xpm"
+ dodoc ANNOUNCE CONTRIBUTORS COPYRIGHT NEWS README
+
+ java-pkg_regjar \
+ "${ED}${TARGETDIR}/src/Tools/JVM/java_ext_dirs.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/QuickNotepad.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Console.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/ErrorList.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Hyperlinks.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/SideKick.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/cobra.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/js.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/scala-compiler.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jedit.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-swing.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/scala-library.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/Pure.jar" \
+ "${ED}${TARGETDIR}/lib/browser/GraphBrowser.jar"
+}
+
+pkg_postinst() {
+ # If any of the directories in /etc/isabelle/components do not exist, then
+ # even isabelle getenv ISABELLE_HOME fails. Hence it is necessary to
+ # to delete any non-existing directories. If an old Isabelle version was
+ # installed with component ebuilds like sci-mathematics/e, then the
+ # Isabelle version is upgraded, then the contrib directories will not
+ # exist initially, it is necessary to delete them from /etc/isabelle/components.
+ # Then these components are rebuilt (creating these directories) using the
+ # EAPI=5 subslot depends.
+ for i in $(egrep '^[^#].*$' "${ROOT}etc/isabelle/components")
+ do
+ if [ ! -d /usr/share/Isabelle2012/${i} ]; then
+ sed -e "\@${i}@d" -i "${ROOT}etc/isabelle/components"
+ fi
+ done
+ if use ledit && use readline; then
+ elog "Both readline and ledit use flags specified. The default setting"
+ elog "if both are installed is to use readline (rlwrap), this can be"
+ elog "modfied by editing the ISABELLE_LINE_EDITOR setting in"
+ elog "${ROOT}/etc/isabelle/settings"
+ fi
+ elog "Please ensure you have a pdf viewer installed, for example:"
+ elog "As root: emerge app-text/zathura-pdf-poppler"
+ elog "Please configure your preferred pdf viewer, something like:"
+ elog "As normal user: xdg-mime default zathura.desktop application/pdf"
+ elog "Or alternatively by editing the PDF_VIEWER variable in the system"
+ elog "settings file ${ROOT}etc/isabelle/settings and/or the user"
+ elog "settings file \$HOME/.isabelle/${MY_P}/etc/settings"
+ elog "To improve sledgehammer performance, consider installing:"
+ elog "USE=isabelle emerge sci-mathematics/e sci-mathematics/spass"
+ elog "For nitpick it is necessary to install:"
+ elog "emerge sci-mathematics/kodkodi"
+}
diff --git a/sci-mathematics/isabelle/isabelle-2013-r2.ebuild b/sci-mathematics/isabelle/isabelle-2013-r2.ebuild
new file mode 100644
index 00000000000..6b5c7f622f8
--- /dev/null
+++ b/sci-mathematics/isabelle/isabelle-2013-r2.ebuild
@@ -0,0 +1,353 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 multilib versionator
+
+MY_PN="Isabelle"
+MY_PV=$(replace_all_version_separators '-')
+MY_P="${MY_PN}${MY_PV}"
+
+JEDIT_PV="20130104"
+JEDIT_PN="jedit_build"
+JEDIT_P="${JEDIT_PN}-${JEDIT_PV}"
+JEDIT_IC_PN="${JEDIT_PN}-isabelle-component"
+JEDIT_IC_P="${JEDIT_IC_PN}-${JEDIT_PV}"
+
+JFREECHART_PV="1.0.14"
+JFREECHART_PN="jfreechart"
+JFREECHART_P="${JFREECHART_PN}-${JFREECHART_PV}"
+JFREECHART_IC_PN="${JFREECHART_PN}-isabelle-component"
+JFREECHART_IC_P="${JFREECHART_IC_PN}-${JFREECHART_PV}"
+
+SS="2.10"
+
+DESCRIPTION="Isabelle is a generic proof assistant"
+HOMEPAGE="http://www.cl.cam.ac.uk/research/hvg/Isabelle/index.html"
+SRC_URI="http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/${MY_P}.tar.gz
+ http://isabelle.in.tum.de/components/${JEDIT_P}.tar.gz -> ${JEDIT_IC_P}.tar.gz
+ http://isabelle.in.tum.de/components/${JFREECHART_P}.tar.gz -> ${JFREECHART_IC_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc graphbrowsing ledit readline proofgeneral"
+
+#upstream says
+#bash 2.x/3.x, Poly/ML 5.x, Perl 5.x,
+#for document preparation: complete LaTeX
+DEPEND=">=app-shells/bash-3.0:*
+ dev-java/ant-core:0
+ >=dev-java/jcommon-1.0.18:1.0
+ >=dev-java/jfreechart-1.0.14:1.0
+ >=dev-java/itext-2.1.5:0
+ dev-java/xml-xmlbeans:1
+ >=dev-lang/ghc-7.6.3
+ >=dev-lang/polyml-5.5.0:=[-portable]
+ >=dev-lang/perl-5.8.8-r2
+ dev-lang/swi-prolog
+ virtual/jdk:1.7
+ doc? (
+ virtual/latex-base
+ dev-tex/rail
+ )
+ >=dev-lang/scala-2.10.2:${SS}
+ ledit? (
+ app-misc/ledit
+ )
+ readline? (
+ app-misc/rlwrap
+ )"
+
+RDEPEND="dev-perl/libwww-perl
+ sci-mathematics/sha1-polyml
+ >=virtual/jre-1.7
+ proofgeneral? (
+ >=app-emacs/proofgeneral-4.1
+ )
+ ${DEPEND}"
+
+S="${WORKDIR}"/Isabelle${MY_PV}
+JEDIT_S="${WORKDIR}/${JEDIT_P}"
+JFREECHART_S="${WORKDIR}/${JFREECHART_P}"
+TARGETDIR="/usr/share/Isabelle"${MY_PV}
+LIBDIR="/usr/"$(get_libdir)"/Isabelle"${MY_PV}
+
+LIBRARY_PKGS="scala-${SS},itext,jcommon-1.0,jfreechart-1.0,xml-xmlbeans-1"
+
+src_unpack() {
+ unpack "${MY_P}.tar.gz"
+ pushd "${S}/contrib" || die
+ unpack ${JEDIT_IC_P}.tar.gz
+ unpack ${JFREECHART_IC_P}.tar.gz
+}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ java-pkg_getjars ${LIBRARY_PKGS}
+ epatch "${FILESDIR}/${PN}-2013-gentoo-settings.patch"
+ epatch "${FILESDIR}/${PN}-2013-classpath.patch"
+ polymlver=$(poly -v | cut -d' ' -f2)
+ polymlarch=$(poly -v | cut -d' ' -f9 | cut -d'-' -f1)
+ sed -e "s@5.5.0@${polymlver}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml version in etc/settings"
+ sed -e "s@ML_HOME=\"/@ML_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml ML_HOME in etc/settings"
+ sed -e "s@x86_64@${polymlarch}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml arch in etc/settings"
+ sed -e "s@PROOFGENERAL_HOME=\"/@PROOFGENERAL_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure PROOFGENERAL_HOME in etc/settings"
+ sed -e "s@/usr/lib64/Isabelle${MY_PV}@${LIBDIR}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure Isabelle lib directory in etc/settings"
+ epatch "${FILESDIR}/${PN}-2012-graphbrowser.patch"
+ epatch "${FILESDIR}/${PN}-2012-libsha1.patch"
+ # this example fails to compile with swi-prolog 6.5.2, so patch it so that
+ # Isabelle will build, then reverse the patch so that the user can see the
+ # original code.
+ epatch "${FILESDIR}/${PN}-2013-HOL-Predicate_Compile_Examples.patch"
+ cat <<- EOF >> "${S}/etc/settings"
+
+ ISABELLE_GHC="${ROOT}usr/bin/ghc"
+ ISABELLE_OCAML="${ROOT}usr/bin/ocaml"
+ ISABELLE_SWIPL="${ROOT}usr/bin/swipl"
+ ISABELLE_JDK_HOME="\$(java-config --jdk-home)"
+ SCALA_HOME="${ROOT}usr/share/scala-${SS}"
+ SHA1_HOME="/usr/$(get_libdir)/sha1-polyml"
+ EOF
+ cat <<- EOF >> "${S}/etc/components"
+ #bundled components
+ contrib/${JEDIT_P}
+ contrib/${JFREECHART_P}
+ EOF
+ if use ledit && ! use readline; then
+ epatch "${FILESDIR}/${PN}-2012-reverse-line-editor-order.patch"
+ fi
+ rm -f "${S}/contrib/jfreechart-1.0.14/lib/iText-2.1.5.jar" \
+ "${S}/contrib/jfreechart-1.0.14/lib/jfreechart-1.0.14.jar" \
+ "${S}/contrib/jfreechart-1.0.14/lib/jcommon-1.0.18.jar" \
+ "${S}/lib/classes/ext/scala-actors.jar" \
+ "${S}/lib/classes/ext/scala-compiler.jar" \
+ "${S}/lib/classes/ext/scala-library.jar" \
+ "${S}/lib/classes/ext/scala-reflect.jar" \
+ "${S}/lib/classes/ext/scala-swing.jar" \
+ || die "Could not rm bundled jar files supplied by Gentoo"
+}
+
+src_compile() {
+ einfo "Building Isabelle. This may take some time."
+ ./bin/isabelle build -a -b -s -v || die "isabelle build failed"
+ epatch --reverse "${FILESDIR}/${PN}-2013-HOL-Predicate_Compile_Examples.patch"
+ if use graphbrowsing
+ then
+ rm -f "${S}/lib/browser/GraphBrowser.jar" \
+ || die "failed cleaning graph browser directory"
+ pushd "${S}/lib/browser" \
+ || die "Could not change directory to lib/browser"
+ ./build || die "failed building the graph browser"
+ popd
+ fi
+ ./bin/isabelle jedit -b -f || die "pide build failed"
+}
+
+src_install() {
+ exeinto ${TARGETDIR}/bin
+ doexe bin/isabelle-process bin/isabelle
+
+ insinto ${TARGETDIR}
+ doins -r src
+ doins -r lib
+ doins -r contrib
+ doins ROOTS
+
+ docompress -x /usr/share/doc/${PF}
+ dodoc -r doc
+ if use doc; then
+ dosym /usr/share/doc/${PF}/doc "${TARGETDIR}/doc"
+ # The build of sci-mathematics/haskabelle with use doc requires
+ # sci-mathematics/isabelle[doc?]. The haskabelle doc build requires
+ # the src/Doc directory stuff in the isabelle package.
+ doins -r src/Doc
+ for i in "./src/Doc/Classes/document/build" \
+ "./src/Doc/Codegen/document/build" \
+ "./src/Doc/Functions/document/build" \
+ "./src/Doc/HOL/document/build" \
+ "./src/Doc/Intro/document/build" \
+ "./src/Doc/IsarImplementation/document/build" \
+ "./src/Doc/IsarRef/document/build" \
+ "./src/Doc/IsarRef/document/showsymbols" \
+ "./src/Doc/LaTeXsugar/document/build" \
+ "./src/Doc/Locales/document/build" \
+ "./src/Doc/Logics/document/build" \
+ "./src/Doc/Main/document/build" \
+ "./src/Doc/Nitpick/document/build" \
+ "./src/Doc/ProgProve/document/build" \
+ "./src/Doc/Ref/document/build" \
+ "./src/Doc/Sledgehammer/document/build" \
+ "./src/Doc/System/document/build" \
+ "./src/Doc/Tutorial/document/build" \
+ "./src/Doc/Tutorial/document/isa-index" \
+ "./src/Doc/ZF/document/build" \
+ "./src/Doc/fixbookmarks" \
+ "./src/Doc/prepare_document" \
+ "./src/Doc/sedindex"
+ do
+ exeinto $(dirname "${TARGETDIR}/${i}")
+ doexe ${i}
+ done
+ fi
+
+ for i in "./Isabelle " \
+ "./bin/isabelle" \
+ "./bin/isabelle-process" \
+ "./lib/Tools/browser" \
+ "./lib/Tools/build" \
+ "./lib/Tools/build_dialog" \
+ "./lib/Tools/components" \
+ "./lib/Tools/dimacs2hol" \
+ "./lib/Tools/display" \
+ "./lib/Tools/doc" \
+ "./lib/Tools/document" \
+ "./lib/Tools/emacs" \
+ "./lib/Tools/env" \
+ "./lib/Tools/findlogics" \
+ "./lib/Tools/getenv" \
+ "./lib/Tools/install" \
+ "./lib/Tools/java" \
+ "./lib/Tools/keywords" \
+ "./lib/Tools/latex" \
+ "./lib/Tools/logo" \
+ "./lib/Tools/make" \
+ "./lib/Tools/mkdir" \
+ "./lib/Tools/mkproject" \
+ "./lib/Tools/mkroot" \
+ "./lib/Tools/options" \
+ "./lib/Tools/print" \
+ "./lib/Tools/scala" \
+ "./lib/Tools/scalac" \
+ "./lib/Tools/tty" \
+ "./lib/Tools/unsymbolize" \
+ "./lib/Tools/usedir" \
+ "./lib/Tools/version" \
+ "./lib/Tools/yxml" \
+ "./lib/browser/build" \
+ "./lib/scripts/feeder" \
+ "./lib/scripts/getsettings" \
+ "./lib/scripts/keywords" \
+ "./lib/scripts/polyml-version" \
+ "./lib/scripts/process" \
+ "./lib/scripts/run-polyml" \
+ "./lib/scripts/run-smlnj" \
+ "./lib/scripts/unsymbolize" \
+ "./lib/scripts/yxml" \
+ "./src/HOL/IMP/export.sh" \
+ "./src/HOL/Library/Sum_of_Squares/neos_csdp_client" \
+ "./src/HOL/Mirabelle/lib/Tools/mirabelle" \
+ "./src/HOL/Mutabelle/lib/Tools/mutabelle" \
+ "./src/HOL/SPARK/Examples/README" \
+ "./src/HOL/TPTP/TPTP_Parser/make_mlyacclib" \
+ "./src/HOL/TPTP/TPTP_Parser/make_tptp_parser" \
+ "./src/HOL/TPTP/lib/Tools/tptp_graph" \
+ "./src/HOL/TPTP/lib/Tools/tptp_isabelle" \
+ "./src/HOL/TPTP/lib/Tools/tptp_isabelle_hot" \
+ "./src/HOL/TPTP/lib/Tools/tptp_nitpick" \
+ "./src/HOL/TPTP/lib/Tools/tptp_refute" \
+ "./src/HOL/TPTP/lib/Tools/tptp_sledgehammer" \
+ "./src/HOL/Tools/ATP/scripts/dummy_atp" \
+ "./src/HOL/Tools/ATP/scripts/remote_atp" \
+ "./src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version" \
+ "./src/HOL/Tools/SMT/lib/scripts/remote_smt" \
+ "./src/HOL/Tools/Sledgehammer/MaSh/src/compareStats.py" \
+ "./src/HOL/Tools/Sledgehammer/MaSh/src/mash.py" \
+ "./src/Pure/build" \
+ "./src/Pure/build-jars" \
+ "./src/Tools/Code/lib/Tools/codegen" \
+ "./src/Tools/Graphview/lib/Tools/graphview" \
+ "./src/Tools/Metis/fix_metis_license" \
+ "./src/Tools/Metis/make_metis" \
+ "./src/Tools/Metis/scripts/mlpp" \
+ "./src/Tools/WWW_Find/lib/Tools/wwwfind" \
+ "./src/Tools/jEdit/lib/Tools/jedit"
+ do
+ exeinto $(dirname "${TARGETDIR}/${i}")
+ doexe ${i}
+ done
+
+ insinto /etc/isabelle
+ doins -r etc/*
+ dosym /etc/isabelle "${TARGETDIR}/etc"
+
+ dosym "${LIBDIR}/heaps" "${TARGETDIR}/heaps"
+ insinto ${LIBDIR}
+ doins -r heaps
+
+ bin/isabelle install -d ${TARGETDIR} "${ED}usr/bin" \
+ || die "isabelle install failed"
+ newicon lib/icons/isabelle.xpm "${PN}.xpm"
+ dodoc ANNOUNCE CONTRIBUTORS COPYRIGHT NEWS README
+
+ java-pkg_regjar \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/Highlight.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/ErrorList.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/Console.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/cobra.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/js.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/jedit-5.0.0-patched/jedit.jar" \
+ "${ED}${TARGETDIR}/contrib/jedit_build-20130104/contrib/jedit-5.0.0-patched/jars/QuickNotepad.jar" \
+ "${ED}${TARGETDIR}/contrib/jfreechart-1.0.14/jfreechart-1.0.14-demo.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/Graphview.jar" \
+ "${ED}${TARGETDIR}/lib/classes/ext/Pure.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Console.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/ErrorList.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Highlight.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/QuickNotepad.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/SideKick.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/cobra.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jars/js.jar" \
+ "${ED}${TARGETDIR}/src/Tools/jEdit/dist/jedit.jar"
+}
+
+pkg_postinst() {
+ # If any of the directories in /etc/isabelle/components do not exist, then
+ # even isabelle getenv ISABELLE_HOME fails. Hence it is necessary to
+ # to delete any non-existing directories. If an old Isabelle version was
+ # installed with component ebuilds like sci-mathematics/e, then the
+ # Isabelle version is upgraded, then the contrib directories will not
+ # exist initially, it is necessary to delete them from /etc/isabelle/components.
+ # Then these components are rebuilt (creating these directories) using the
+ # EAPI=5 subslot depends.
+ for i in $(egrep '^[^#].*$' "${ROOT}etc/isabelle/components")
+ do
+ if [ ! -d /usr/share/${MY_P}/${i} ]; then
+ sed -e "\@${i}@d" -i "${ROOT}etc/isabelle/components"
+ fi
+ done
+ if use ledit && use readline; then
+ elog "Both readline and ledit use flags specified. The default setting"
+ elog "if both are installed is to use readline (rlwrap), this can be"
+ elog "modfied by editing the ISABELLE_LINE_EDITOR setting in"
+ elog "${ROOT}/etc/isabelle/settings"
+ fi
+ elog "Please ensure you have a pdf viewer installed, for example:"
+ elog "As root: emerge app-text/zathura-pdf-poppler"
+ elog "Please configure your preferred pdf viewer, something like:"
+ elog "As normal user: xdg-mime default zathura.desktop application/pdf"
+ elog "Or alternatively by editing the PDF_VIEWER variable in the system"
+ elog "settings file ${ROOT}etc/isabelle/settings and/or the user"
+ elog "settings file \$HOME/.isabelle/${MY_P}/etc/settings"
+ elog "To improve sledgehammer performance, consider installing:"
+ elog "USE=isabelle emerge sci-mathematics/e sci-mathematics/spass"
+ elog "For nitpick it is necessary to install:"
+ elog "emerge sci-mathematics/kodkodi"
+}
diff --git a/sci-mathematics/isabelle/isabelle-2013.2-r1.ebuild b/sci-mathematics/isabelle/isabelle-2013.2-r1.ebuild
new file mode 100644
index 00000000000..99fabbc9d23
--- /dev/null
+++ b/sci-mathematics/isabelle/isabelle-2013.2-r1.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 multilib versionator
+
+MY_PN="Isabelle"
+MY_PV=$(replace_all_version_separators '-')
+MY_P="${MY_PN}${MY_PV}"
+
+JEDIT_PV="20131106"
+JEDIT_PN="jedit_build"
+JEDIT_P="${JEDIT_PN}-${JEDIT_PV}"
+JEDIT_IC_PN="${JEDIT_PN}-isabelle-component"
+JEDIT_IC_P="${JEDIT_IC_PN}-${JEDIT_PV}"
+
+JFREECHART_PV="1.0.14-1"
+JFREECHART_PN="jfreechart"
+JFREECHART_P="${JFREECHART_PN}-${JFREECHART_PV}"
+JFREECHART_IC_PN="${JFREECHART_PN}-isabelle-component"
+JFREECHART_IC_P="${JFREECHART_IC_PN}-${JFREECHART_PV}"
+
+POLYML_PV="5.5.1-1"
+POLYML_PN="polyml"
+POLYML_P="${POLYML_PN}-${POLYML_PV}"
+POLYML_IC_PN="${POLYML_PN}-isabelle-component"
+POLYML_IC_P="${POLYML_IC_PN}-${POLYML_PV}"
+
+SS="2.11"
+
+DESCRIPTION="Isabelle is a generic proof assistant"
+HOMEPAGE="http://www.cl.cam.ac.uk/research/hvg/Isabelle/index.html"
+SRC_URI="http://www.cl.cam.ac.uk/users/lcp/archive/${MY_P}.tar.gz
+ http://isabelle.in.tum.de/components/${JEDIT_P}.tar.gz -> ${JEDIT_IC_P}.tar.gz
+ http://isabelle.in.tum.de/dist/contrib/${JFREECHART_P}.tar.gz -> ${JFREECHART_IC_P}.tar.gz
+ http://dev.gentoo.org/~gienah/snapshots/${POLYML_IC_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc graphbrowsing ledit readline proofgeneral"
+
+#upstream says
+#bash 2.x/3.x, Poly/ML 5.x, Perl 5.x,
+#for document preparation: complete LaTeX
+DEPEND=">=app-shells/bash-3.0:*
+ dev-java/ant-core:0
+ >=dev-java/jcommon-1.0.18:1.0
+ >=dev-java/jfreechart-1.0.14:1.0
+ >=dev-java/itext-2.1.5:0
+ dev-java/xml-xmlbeans:1
+ dev-java/xz-java:0
+ >=dev-lang/ghc-7.6.3
+ >=dev-lang/polyml-5.5.1:=[-portable]
+ >=dev-lang/perl-5.8.8-r2
+ dev-lang/swi-prolog
+ virtual/jdk:1.7
+ doc? (
+ virtual/latex-base
+ dev-tex/rail
+ )
+ >=dev-lang/scala-2.11.1:${SS}
+ ledit? (
+ app-misc/ledit
+ )
+ readline? (
+ app-misc/rlwrap
+ )"
+
+RDEPEND="dev-perl/libwww-perl
+ sci-mathematics/sha1-polyml
+ >=virtual/jre-1.7
+ proofgeneral? (
+ >=app-emacs/proofgeneral-4.1
+ )
+ ${DEPEND}"
+
+S="${WORKDIR}"/Isabelle${MY_PV}
+JEDIT_S="${WORKDIR}/${JEDIT_P}"
+JFREECHART_S="${WORKDIR}/${JFREECHART_P}"
+TARGETDIR="/usr/share/Isabelle"${MY_PV}
+LIBDIR="/usr/"$(get_libdir)"/Isabelle"${MY_PV}
+
+# Notes on QA warnings: * Class files not found via DEPEND in package.env
+# Stuff with $ in the name appear to be spurious:
+# isabelle/Markup_Tree$$anonfun$results$1$1.class
+# scala/tools/nsc/backend/jvm/GenJVM$BytecodeGenerator$$anonfun$computeLocalVarsIndex$1.class
+# It wants javafx, I am unsure how to fix this. I test isabelle with the Sun JDK:
+# javafx/application/Platform.class javafx
+# Presumably the user can provide the jEdit plugins if they are necessary:
+# marker/MarkerSetsPlugin.class http://plugins.jedit.org/plugins/?MarkerSets
+# projectviewer/gui/OptionPaneBase.class http://plugins.jedit.org/plugins/?ProjectViewer
+
+LIBRARY_PKGS="ant-core,itext,jcommon-1.0,jfreechart-1.0,scala-${SS},xml-xmlbeans-1,xz-java"
+
+src_unpack() {
+ unpack "${MY_P}.tar.gz"
+ pushd "${S}/contrib" || die
+ unpack ${JEDIT_IC_P}.tar.gz
+ unpack ${JFREECHART_IC_P}.tar.gz
+ unpack ${POLYML_IC_P}.tar.gz
+}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ java-pkg_getjars ${LIBRARY_PKGS}
+ epatch "${FILESDIR}/${PN}-2013-gentoo-settings.patch"
+ epatch "${FILESDIR}/${PN}-2013.2-classpath.patch"
+ polymlver=$(poly -v | cut -d' ' -f2)
+ polymlarch=$(poly -v | cut -d' ' -f9 | cut -d'-' -f1)
+ sed -e "s@5.5.0@${polymlver}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml version in etc/settings"
+ sed -e "s@ML_HOME=\"/@ML_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml ML_HOME in etc/settings"
+ sed -e "s@x86_64@${polymlarch}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure polyml arch in etc/settings"
+ sed -e "s@PROOFGENERAL_HOME=\"/@PROOFGENERAL_HOME=\"${ROOT}@" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure PROOFGENERAL_HOME in etc/settings"
+ sed -e "s@/usr/lib64/Isabelle${MY_PV}@${LIBDIR}@g" \
+ -i "${S}/etc/settings" \
+ || die "Could not configure Isabelle lib directory in etc/settings"
+ epatch "${FILESDIR}/${PN}-2012-graphbrowser.patch"
+ epatch "${FILESDIR}/${PN}-2012-libsha1.patch"
+ # this example fails to compile with swi-prolog 6.5.2, so patch it so that
+ # Isabelle will build, then reverse the patch so that the user can see the
+ # original code.
+ epatch "${FILESDIR}/${PN}-2013.2-HOL-Predicate_Compile_Examples.patch"
+ cat <<- EOF >> "${S}/etc/settings"
+
+ ISABELLE_GHC="${ROOT}usr/bin/ghc"
+ ISABELLE_OCAML="${ROOT}usr/bin/ocaml"
+ ISABELLE_SWIPL="${ROOT}usr/bin/swipl"
+ ISABELLE_JDK_HOME="\$(java-config --jdk-home)"
+ SCALA_HOME="${ROOT}usr/share/scala-${SS}"
+ SHA1_HOME="/usr/$(get_libdir)/sha1-polyml"
+ EOF
+ cat <<- EOF >> "${S}/etc/components"
+ #bundled components
+ contrib/${JEDIT_P}
+ contrib/${JFREECHART_P}
+ contrib/${POLYML_P}
+ EOF
+ if use ledit && ! use readline; then
+ epatch "${FILESDIR}/${PN}-2012-reverse-line-editor-order.patch"
+ fi
+ rm -f "${S}/contrib/jfreechart-1.0.14-1/lib/iText-2.1.5.jar" \
+ "${S}/contrib/jfreechart-1.0.14-1/lib/jfreechart-1.0.14.jar" \
+ "${S}/contrib/jfreechart-1.0.14-1/lib/jcommon-1.0.18.jar" \
+ "${S}/lib/classes/ext/scala-actors.jar" \
+ "${S}/lib/classes/ext/scala-compiler.jar" \
+ "${S}/lib/classes/ext/scala-library.jar" \
+ "${S}/lib/classes/ext/scala-reflect.jar" \
+ "${S}/lib/classes/ext/scala-swing.jar" \
+ || die "Could not rm bundled jar files supplied by Gentoo"
+}
+
+src_compile() {
+ einfo "Building Isabelle. This may take some time."
+ ./bin/isabelle build -a -b -s -v || die "isabelle build failed"
+ epatch --reverse "${FILESDIR}/${PN}-2013.2-HOL-Predicate_Compile_Examples.patch"
+ if use graphbrowsing
+ then
+ rm -f "${S}/lib/browser/GraphBrowser.jar" \
+ || die "failed cleaning graph browser directory"
+ pushd "${S}/lib/browser" \
+ || die "Could not change directory to lib/browser"
+ ./build || die "failed building the graph browser"
+ popd
+ fi
+ ./bin/isabelle jedit -b -f || die "pide build failed"
+}
+
+src_install() {
+ insinto ${TARGETDIR}
+ doins -r src
+ doins -r lib
+ doins -r contrib
+ doins ROOTS
+
+ docompress -x /usr/share/doc/${PF}
+ dodoc -r doc
+ if use doc; then
+ dosym /usr/share/doc/${PF}/doc "${TARGETDIR}/doc"
+ # The build of sci-mathematics/haskabelle with use doc requires
+ # sci-mathematics/isabelle[doc?]. The haskabelle doc build requires
+ # the src/Doc directory stuff in the isabelle package.
+ doins -r src/Doc
+ for i in "./src/Doc/Classes/document/build" \
+ "./src/Doc/Codegen/document/build" \
+ "./src/Doc/Datatypes/document/build" \
+ "./src/Doc/fixbookmarks" \
+ "./src/Doc/Func