summaryrefslogtreecommitdiff
path: root/sci-astronomy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-astronomy
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-astronomy')
-rw-r--r--sci-astronomy/aatm/Manifest5
-rw-r--r--sci-astronomy/aatm/aatm-0.6.ebuild39
-rw-r--r--sci-astronomy/aatm/metadata.xml18
-rw-r--r--sci-astronomy/astrometry/Manifest12
-rw-r--r--sci-astronomy/astrometry/astrometry-0.67-r2.ebuild108
-rw-r--r--sci-astronomy/astrometry/astrometry-0.70.ebuild108
-rw-r--r--sci-astronomy/astrometry/astrometry-0.72.ebuild115
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch78
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.67-qsortr.patch10
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.67-soname.patch25
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.72-dynlink.patch92
-rw-r--r--sci-astronomy/astrometry/metadata.xml18
-rw-r--r--sci-astronomy/casa-data/Manifest8
-rw-r--r--sci-astronomy/casa-data/casa-data-20160222.ebuild26
-rw-r--r--sci-astronomy/casa-data/casa-data-20170703.ebuild26
-rw-r--r--sci-astronomy/casa-data/casa-data-99999.ebuild28
-rw-r--r--sci-astronomy/casa-data/metadata.xml15
-rw-r--r--sci-astronomy/casacore/Manifest14
-rw-r--r--sci-astronomy/casacore/casacore-2.3.0-r1.ebuild112
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-disable-class-and-collaboration-graph-generation.patch43
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-disable-known-test-failures.patch158
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-disable-tests-that-require-data-tables.patch253
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-do-not-install-test-and-demonstration-executables.patch34
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch162
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch77
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-loose-some-tests-tFFTServer-tests.patch36
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch60
-rw-r--r--sci-astronomy/casacore/files/casacore-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch22
-rw-r--r--sci-astronomy/casacore/metadata.xml20
-rw-r--r--sci-astronomy/cdsclient/Manifest8
-rw-r--r--sci-astronomy/cdsclient/cdsclient-3.8.1.ebuild41
-rw-r--r--sci-astronomy/cdsclient/cdsclient-3.8.4.ebuild41
-rw-r--r--sci-astronomy/cdsclient/files/cdsclient-makefile.patch106
-rw-r--r--sci-astronomy/cdsclient/metadata.xml14
-rw-r--r--sci-astronomy/celestia/Manifest12
-rw-r--r--sci-astronomy/celestia/celestia-1.6.1-r1.ebuild120
-rw-r--r--sci-astronomy/celestia/files/celestia-1.5.0-desktop.patch55
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.0-cfg.patch11
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.1-gcc46.patch14
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.1-gcc47.patch22
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.1-libpng15.patch14
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.1-libpng16.patch25
-rw-r--r--sci-astronomy/celestia/files/celestia-1.6.1-linking.patch65
-rw-r--r--sci-astronomy/celestia/metadata.xml21
-rw-r--r--sci-astronomy/cpl/Manifest12
-rw-r--r--sci-astronomy/cpl/cpl-6.4.2.ebuild73
-rw-r--r--sci-astronomy/cpl/cpl-6.6.1.ebuild77
-rw-r--r--sci-astronomy/cpl/cpl-7.0.ebuild77
-rw-r--r--sci-astronomy/cpl/files/cpl-6.1.1-check-shared-libs.patch35
-rw-r--r--sci-astronomy/cpl/files/cpl-6.1.1-use-system-ltdl.patch46
-rw-r--r--sci-astronomy/cpl/files/cpl-6.6.1-use-system-ltdl.patch41
-rw-r--r--sci-astronomy/cpl/metadata.xml25
-rw-r--r--sci-astronomy/ds9-bin/Manifest10
-rw-r--r--sci-astronomy/ds9-bin/ds9-bin-7.2.ebuild41
-rw-r--r--sci-astronomy/ds9-bin/ds9-bin-7.4.ebuild41
-rw-r--r--sci-astronomy/ds9-bin/metadata.xml22
-rw-r--r--sci-astronomy/erfa/Manifest9
-rw-r--r--sci-astronomy/erfa/erfa-1.2.0.ebuild17
-rw-r--r--sci-astronomy/erfa/erfa-1.3.0.ebuild30
-rw-r--r--sci-astronomy/erfa/erfa-1.4.0.ebuild30
-rw-r--r--sci-astronomy/erfa/metadata.xml17
-rw-r--r--sci-astronomy/esomidas/Manifest8
-rw-r--r--sci-astronomy/esomidas/esomidas-17.02-r1.ebuild149
-rw-r--r--sci-astronomy/esomidas/esomidas-17.02.ebuild134
-rw-r--r--sci-astronomy/esomidas/files/esomidas-17.02-gentoo-setup.patch12
-rw-r--r--sci-astronomy/esomidas/files/esomidas-17.02-output_to_stdout.patch42
-rw-r--r--sci-astronomy/esomidas/files/esomidas-17.02-rpc.patch33
-rw-r--r--sci-astronomy/esomidas/metadata.xml19
-rw-r--r--sci-astronomy/esorex/Manifest14
-rw-r--r--sci-astronomy/esorex/esorex-3.10.2.ebuild38
-rw-r--r--sci-astronomy/esorex/esorex-3.12.3.ebuild39
-rw-r--r--sci-astronomy/esorex/esorex-3.12.ebuild39
-rw-r--r--sci-astronomy/esorex/files/esorex-3.10-generate-manpage.patch123
-rw-r--r--sci-astronomy/esorex/files/esorex-3.10-remove-empty-configdir.patch13
-rw-r--r--sci-astronomy/esorex/files/esorex-3.10-remove-private-ltdl.patch39
-rw-r--r--sci-astronomy/esorex/files/esorex-3.10-set-default-plugin-path.patch28
-rw-r--r--sci-astronomy/esorex/files/esorex-3.9.6-use-shared-libs.patch20
-rw-r--r--sci-astronomy/esorex/metadata.xml21
-rw-r--r--sci-astronomy/fitsh/Manifest3
-rw-r--r--sci-astronomy/fitsh/fitsh-0.9.2.ebuild17
-rw-r--r--sci-astronomy/fitsh/metadata.xml16
-rw-r--r--sci-astronomy/fitspng/Manifest4
-rw-r--r--sci-astronomy/fitspng/fitspng-0.3.5.ebuild23
-rw-r--r--sci-astronomy/fitspng/metadata.xml18
-rw-r--r--sci-astronomy/funtools/Manifest5
-rw-r--r--sci-astronomy/funtools/funtools-1.4.7.ebuild71
-rw-r--r--sci-astronomy/funtools/metadata.xml18
-rw-r--r--sci-astronomy/galaxy/Manifest5
-rw-r--r--sci-astronomy/galaxy/galaxy-2.2-r1.ebuild45
-rw-r--r--sci-astronomy/galaxy/metadata.xml13
-rw-r--r--sci-astronomy/gasgano/Manifest6
-rw-r--r--sci-astronomy/gasgano/gasgano-2.4.8.ebuild42
-rw-r--r--sci-astronomy/gasgano/metadata.xml17
-rw-r--r--sci-astronomy/gnuastro/Manifest3
-rw-r--r--sci-astronomy/gnuastro/gnuastro-0.3.ebuild49
-rw-r--r--sci-astronomy/gnuastro/metadata.xml20
-rw-r--r--sci-astronomy/healpix/Manifest6
-rw-r--r--sci-astronomy/healpix/healpix-3.30.ebuild140
-rw-r--r--sci-astronomy/healpix/healpix-3.31.ebuild140
-rw-r--r--sci-astronomy/healpix/metadata.xml20
-rw-r--r--sci-astronomy/idlastro/Manifest6
-rw-r--r--sci-astronomy/idlastro/idlastro-20161220.ebuild30
-rw-r--r--sci-astronomy/idlastro/idlastro-99999999.ebuild30
-rw-r--r--sci-astronomy/idlastro/metadata.xml17
-rw-r--r--sci-astronomy/kapteyn/Manifest6
-rw-r--r--sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch101
-rw-r--r--sci-astronomy/kapteyn/kapteyn-2.3.ebuild33
-rw-r--r--sci-astronomy/kapteyn/metadata.xml15
-rw-r--r--sci-astronomy/metadata.xml39
-rw-r--r--sci-astronomy/missfits/Manifest4
-rw-r--r--sci-astronomy/missfits/metadata.xml16
-rw-r--r--sci-astronomy/missfits/missfits-2.8.0.ebuild21
-rw-r--r--sci-astronomy/montage/Manifest11
-rw-r--r--sci-astronomy/montage/files/montage-4.1-fix_format_errors.patch23
-rw-r--r--sci-astronomy/montage/files/montage-4.1-fix_freetype_incude.patch13
-rw-r--r--sci-astronomy/montage/files/montage-4.1-initdistdata.patch19
-rw-r--r--sci-astronomy/montage/files/montage-4.1-use_system_libs.patch49
-rw-r--r--sci-astronomy/montage/files/montage-5.0-fix_freetype_incude.patch35
-rw-r--r--sci-astronomy/montage/metadata.xml22
-rw-r--r--sci-astronomy/montage/montage-4.1.ebuild65
-rw-r--r--sci-astronomy/montage/montage-5.0.ebuild67
-rw-r--r--sci-astronomy/pal/Manifest3
-rw-r--r--sci-astronomy/pal/metadata.xml17
-rw-r--r--sci-astronomy/pal/pal-0.9.7.ebuild32
-rw-r--r--sci-astronomy/predict/Manifest8
-rw-r--r--sci-astronomy/predict/files/predict-2.2.3-earthtrack.patch27
-rw-r--r--sci-astronomy/predict/files/predict-update92
-rw-r--r--sci-astronomy/predict/metadata.xml20
-rw-r--r--sci-astronomy/predict/predict-2.2.3-r2.ebuild207
-rw-r--r--sci-astronomy/psfex/Manifest7
-rw-r--r--sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch55
-rw-r--r--sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch221
-rw-r--r--sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch26
-rw-r--r--sci-astronomy/psfex/metadata.xml17
-rw-r--r--sci-astronomy/psfex/psfex-3.17.1.ebuild63
-rw-r--r--sci-astronomy/pyephem/Manifest7
-rw-r--r--sci-astronomy/pyephem/metadata.xml22
-rw-r--r--sci-astronomy/pyephem/pyephem-3.7.5.3.ebuild54
-rw-r--r--sci-astronomy/pyephem/pyephem-3.7.6.0.ebuild53
-rw-r--r--sci-astronomy/scamp/Manifest4
-rw-r--r--sci-astronomy/scamp/metadata.xml16
-rw-r--r--sci-astronomy/scamp/scamp-2.0.4.ebuild51
-rw-r--r--sci-astronomy/sextractor/Manifest9
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch65
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch32
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch55
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch26
-rw-r--r--sci-astronomy/sextractor/metadata.xml22
-rw-r--r--sci-astronomy/sextractor/sextractor-2.19.5-r1.ebuild73
-rw-r--r--sci-astronomy/sextractor/sextractor-2.19.5.ebuild72
-rw-r--r--sci-astronomy/skycat/Manifest13
-rw-r--r--sci-astronomy/skycat/files/skycat-3.0.2-systemlibs.patch107
-rw-r--r--sci-astronomy/skycat/files/skycat-3.0.2-tk8.5.patch21
-rw-r--r--sci-astronomy/skycat/files/skycat-3.1.2-m4.patch150
-rw-r--r--sci-astronomy/skycat/files/skycat-3.1.2-makefile-qa.patch132
-rw-r--r--sci-astronomy/skycat/files/skycat-3.1.3-remove-tclx-dep.patch315
-rw-r--r--sci-astronomy/skycat/files/skycat-3.1.3-string-issues.patch57
-rw-r--r--sci-astronomy/skycat/metadata.xml13
-rw-r--r--sci-astronomy/skycat/skycat-3.1.2-r2.ebuild62
-rw-r--r--sci-astronomy/skycat/skycat-3.1.3.ebuild68
-rw-r--r--sci-astronomy/skymaker/Manifest4
-rw-r--r--sci-astronomy/skymaker/metadata.xml15
-rw-r--r--sci-astronomy/skymaker/skymaker-3.10.5.ebuild20
-rw-r--r--sci-astronomy/sofa_c/Manifest10
-rw-r--r--sci-astronomy/sofa_c/files/sofa_c-makefile.patch105
-rw-r--r--sci-astronomy/sofa_c/metadata.xml26
-rw-r--r--sci-astronomy/sofa_c/sofa_c-20150209a.ebuild39
-rw-r--r--sci-astronomy/sofa_c/sofa_c-20160503c.ebuild39
-rw-r--r--sci-astronomy/sofa_c/sofa_c-20170420.ebuild40
-rw-r--r--sci-astronomy/stellarium/Manifest13
-rw-r--r--sci-astronomy/stellarium/metadata.xml25
-rw-r--r--sci-astronomy/stellarium/stellarium-0.14.3.ebuild106
-rw-r--r--sci-astronomy/stellarium/stellarium-0.16.0-r1.ebuild111
-rw-r--r--sci-astronomy/stellarium/stellarium-0.16.0.ebuild110
-rw-r--r--sci-astronomy/stiff/Manifest5
-rw-r--r--sci-astronomy/stiff/metadata.xml13
-rw-r--r--sci-astronomy/stiff/stiff-2.4.0.ebuild36
-rw-r--r--sci-astronomy/stuff/Manifest4
-rw-r--r--sci-astronomy/stuff/metadata.xml13
-rw-r--r--sci-astronomy/stuff/stuff-1.26.0.ebuild20
-rw-r--r--sci-astronomy/swarp/Manifest5
-rw-r--r--sci-astronomy/swarp/metadata.xml12
-rw-r--r--sci-astronomy/swarp/swarp-2.38.0.ebuild26
-rw-r--r--sci-astronomy/wcslib/Manifest7
-rw-r--r--sci-astronomy/wcslib/metadata.xml26
-rw-r--r--sci-astronomy/wcslib/wcslib-5.15.ebuild71
-rw-r--r--sci-astronomy/wcslib/wcslib-5.16.ebuild71
-rw-r--r--sci-astronomy/wcstools/Manifest13
-rw-r--r--sci-astronomy/wcstools/files/Makefile.am73
-rw-r--r--sci-astronomy/wcstools/files/Makefile.libwcs.am17
-rw-r--r--sci-astronomy/wcstools/files/configure.ac9
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.9.4-compiler-warning.patch34
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.9.4-fix-tests.patch34
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.9.4-haspm.patch22
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.9.4-spelling.patch242
-rw-r--r--sci-astronomy/wcstools/files/wcstools.pc.in13
-rw-r--r--sci-astronomy/wcstools/metadata.xml20
-rw-r--r--sci-astronomy/wcstools/wcstools-3.9.5.ebuild67
-rw-r--r--sci-astronomy/weightwatcher/Manifest4
-rw-r--r--sci-astronomy/weightwatcher/metadata.xml14
-rw-r--r--sci-astronomy/weightwatcher/weightwatcher-1.12.ebuild21
-rw-r--r--sci-astronomy/xephem/Manifest7
-rw-r--r--sci-astronomy/xephem/files/xephem-3.7.7-implicits.patch12
-rw-r--r--sci-astronomy/xephem/files/xephem-3.7.7-respect_env_vars.patch137
-rw-r--r--sci-astronomy/xephem/metadata.xml16
-rw-r--r--sci-astronomy/xephem/xephem-3.7.7.ebuild55
-rw-r--r--sci-astronomy/xfitsview/Manifest6
-rw-r--r--sci-astronomy/xfitsview/files/xfitsview-2.2-build_system.patch54
-rw-r--r--sci-astronomy/xfitsview/metadata.xml13
-rw-r--r--sci-astronomy/xfitsview/xfitsview-2.2-r2.ebuild34
210 files changed, 9151 insertions, 0 deletions
diff --git a/sci-astronomy/aatm/Manifest b/sci-astronomy/aatm/Manifest
new file mode 100644
index 000000000000..903f34eafc05
--- /dev/null
+++ b/sci-astronomy/aatm/Manifest
@@ -0,0 +1,5 @@
+DIST aatm-0.6.tar.gz 613800 SHA256 9fdfb7d0bba71ad32c091baf6242a5bd17041277016473959c5e90d6dcac1b68 SHA512 aef2d0fccc83a8a5817bd414b60c5167f7e378b434f9a3e9ce2bc2eeceec1cc1fb1b141cec07d78cb325dbfceac2804c07866291b2863f6839dfb6143ed9188a WHIRLPOOL 1d8fff78f72810b53f86452a930701d7910314dbd06d0060a7e677260bd29526de44e2b8658c584fd9692727af02a5ee918b319e8932be1cfe428fc579e520d0
+EBUILD aatm-0.6.ebuild 846 SHA256 70966a8917caf62c4063a3ff49ecbbafec80cafe53a5e5df8969ac5b0faddc32 SHA512 4e0440eccdbb80de3304b068f49156fad12b5b1445af4ceb39cde6b37572442475ac5e0ac591da826279308c361c9aa3e5b126c1afd0e4d82d5ec2418ef899c1 WHIRLPOOL 325fc9ab568bc85a98667aea5dd8f077b1806ecaaae1abb4eef43914666eb5b2bed242c1c15f277d77d18cee26e38dc84fd9b22848fb3f256624c57a1c6e6053
+MISC ChangeLog 2810 SHA256 bb7aaf530b006fc98d4e092dc7a3df3e32231365e65972d259d5833b29b59519 SHA512 663bbf7e07f3bd9d3e96e3b7d8490caca535b7fb36f38fce11251d3b38adcd02f76e76f9fb550545c31f7c40dc358c8af20762d6d711f7774bc6e258861d3546 WHIRLPOOL d4c90628ee6d0efef176409e5511dc528f508bcb7e5ee17c5b2480ea365918fe21e0d8b43ea7be6e21b15780ad76148fc5c1eda08264e051de0cb5e59c492394
+MISC ChangeLog-2015 455 SHA256 3c958a67838866f8ea7b985945478ef45a7c480180e1596209592726eda908ca SHA512 4a670eab4b3fb719c473fe69e49266ef4335132ed4913c22534dc6e5be00ccf92fe3fb5a191169165caf3a07e1e5c5bce134e32e0d8470935ea543be3e664a83 WHIRLPOOL 7177ab53cc7298b8710c217cb17a59aead00940ec2732bf3a5de8799ebf707d5c9afe4062a4695fbccb39cf5115767f6feb8200b8a71798430dddfddbfd88be9
+MISC metadata.xml 712 SHA256 3697e5298c72cf90ffdc4ef933efff7f176dbd7bae9eb6ac51680b2170245dfd SHA512 8c8a2c82a2355eb3c2370381a9964ddcf2e80ee367f4c02925f9ef96f6ca4e93bb0650c42d94ef28ddcf52f1a1d8a4902d688c1f183e0ac1d648fb99274a8735 WHIRLPOOL 4ef1deb4a041bc3317756ec48d6c9ba4a16e74eb8eaebd13e598b34603a64a6010e841ad5dab65bb5a9af82f806585f4b51c70562a08181ea024973d57fdca65
diff --git a/sci-astronomy/aatm/aatm-0.6.ebuild b/sci-astronomy/aatm/aatm-0.6.ebuild
new file mode 100644
index 000000000000..d1fddc1c7e8e
--- /dev/null
+++ b/sci-astronomy/aatm/aatm-0.6.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Atmospheric Modelling for ALMA Observatory"
+HOMEPAGE="https://svn.cv.nrao.edu/view/aatm/devel/casa/"
+# tar ball is made from the HOMEPAGE and running ./configure && make dist
+SRC_URI="https://dev.gentoo.org/~bicatali/distfiles/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/4"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ dev-libs/boost:=
+ doc? ( app-doc/doxygen[dot] )"
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake
+ use doc && doxygen doc/developer.doxy
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files --all
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r developer/html
+ fi
+}
diff --git a/sci-astronomy/aatm/metadata.xml b/sci-astronomy/aatm/metadata.xml
new file mode 100644
index 000000000000..658a3f257bb7
--- /dev/null
+++ b/sci-astronomy/aatm/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ ATmospheric Modeling for ALMA is a library of routines for modelling
+ transmission of cm/mm/sub-mm wavelength radiation through the Earths
+ atmosphere. It is designed to simulate both the absorption/emission
+ of radiation and the dispersion (i.e., the frequency dependent
+ refractive index of the atmosphere).
+</longdescription>
+ <upstream>
+ <remote-id type="launchpad">aatm</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/astrometry/Manifest b/sci-astronomy/astrometry/Manifest
new file mode 100644
index 000000000000..d9be0fc3ee61
--- /dev/null
+++ b/sci-astronomy/astrometry/Manifest
@@ -0,0 +1,12 @@
+AUX astrometry-0.67-dynlink.patch 2411 SHA256 2d973e3a7bd33d6bd80e70097ff0f64b92205f7e1ad2d2e29d7ee6e8bf48be27 SHA512 ac82c83efd419519c08eed4ff487fcc5daaab7c12bb4807d501229b5c75e327a422fbbc9fa0bcd5e41516ec26f74a17081bc985aac9b4bb77baf09712f6f85bc WHIRLPOOL 147cdadfe9ec3b7c6d5857647d3ac9e6772d86f5a2e1f4d280cb0d95b75012e33659d300f5eaa632d2c386f4f012d317d5ee873910ccfe3d87d392471f99882e
+AUX astrometry-0.67-qsortr.patch 248 SHA256 917facddfddc87c700459cfa9499b4bd721fd385f0912d96c80cead13391f25b SHA512 99ce5cf9d2d11946a012ff65d6cd4ee7f167ded5f04d5d0f1d68de621f427a0d7e88302c1ebe534296d9dbda3adf608497c40a1bbf82178e3824093dfa510a03 WHIRLPOOL 71f1efee0b7a63c5ab38e5210bd2ec2a5ec6cd5102467298fcc6c411b534b280da35f7010a21f74d382dce6f3e7c2e767e84f58b6466e36b4f85f6857c9b4ed7
+AUX astrometry-0.67-soname.patch 791 SHA256 79f128cfa15e60a53cd9d59f7e04ec286fc085964f47ef9e69d69032e91cd437 SHA512 5e0ecc865986e3a9b065cff57cabe8cc67eb8ae46794ee91215e128d9dfeecff40c7621952246d1bcdcc54514b5eb556c93b099ddefcdb82318b52def835f656 WHIRLPOOL a173b895dab5ab2ee4ea8fe47e47ec6c7a9a8f040e1f7693697cec6e1c2d2e318482c59d2fe8537a9dc7f52df4d6246393bc69dc7dd3b2a4552ff369b059b580
+AUX astrometry-0.72-dynlink.patch 3070 SHA256 96e793c15b2b788abb438585fc8ff88726a2164f0018df3de9f8a9deba6ca55d SHA512 a472dd33cb896ea51cb713e1fad8dedeac2cec546799bd5be606083ffa357963a972e9a32819af7a4373e9316a9ce82c0d70abd46b4c056f4a49f53bba13eb3d WHIRLPOOL af6bb269433e8ed3070743bdd93165d7c0eb1fc090351a5ce2e0a69dd9f9fb1be4103150422f0c07b0410a5ba4ca47693d0a65bc1087507f6239aba7ca018e28
+DIST astrometry.net-0.67.tar.gz 10941863 SHA256 e351c81f7787550d42d45855db394a1702fd17c249ba934bdf4b6abf56281446 SHA512 f087e5a73a9881b1d4b1e4c205d45dc8b8663c304d8d1c1369a8427884df49fc8331fafeb5dc63648c2670b41a2626745568f6f11943bac56972db2d2bb11ddb WHIRLPOOL f4f71a54dd2694d0e98168e98e31846c7423c7cf593c0a629fa825e67b596ce3fa191719ef8cf3f52c1d0d641307e720176a977f28ffb1cffb0c60071f729af6
+DIST astrometry.net-0.70.tar.gz 11195158 SHA256 e087b26b3f3821e63ba3c4d1f6a5cc342784c5ab938c05d59b75ba91b2866b6a SHA512 27e1dd27d69427bdff46613723423048959e447662126d25c8b2fbab571d09b834e4085e5a4a9a9f6e8122ff0868a1762a335086de8f674f49fdbc7374299409 WHIRLPOOL 8e8faf78913503ffa347bd2ce0bf0ca7931f3ee43c6191da098873853b970371be17c431d39edc9c95fd189b3058de7e81032c1f3440d4973b353dc5e4f1ca59
+DIST astrometry.net-0.72.tar.gz 11339766 SHA256 c9f3c2c70847d8ac835f4eb3cfccdcfe938ad8762acea7dd18acbf84c7e97cb6 SHA512 6fa63ea1075b267ebbe0a5aea4c66679b552350b206f098fb64f69f0e13fb9f8cf9c12e3fbc18942a444165cfd68251201dee9e18d6ebb01a2f16899675c70ff WHIRLPOOL 88c5095f8a345c5abaa85a37a353545f37e5d68238bb8f59ed9a764d876b1c158ede2be1840dace1709ff7c6b979e302418b0962a6e5d450c80861f973075866
+EBUILD astrometry-0.67-r2.ebuild 2907 SHA256 dcead57ce9be0e7ebfe93643622ae678851e706903d6b11f1ee563e378d848ce SHA512 90dde36fa8da59ce24c032db2e23a0d0494a274596a554eb248c110f9e5dce247b36c0e0fb0c8677ce292c61232e12a495629279e5e5e60078bbaf3da102b0eb WHIRLPOOL 70a57690ae00463aee6a6b5156964d46508d24e9618670390ebc0cbb16543eef8ad7132317d2f645c83efa50156afc484073a442916bc3a809995e591ef19e8d
+EBUILD astrometry-0.70.ebuild 2925 SHA256 47c9f4981a631cb08227085f2513411da8b3c63ae300f7bd5ba9e8372ae31446 SHA512 df93a84984178be565f07ee8b9d077259e2c40603492a00999e064e53f88ab6cd619f970f30825d49c4dfd8aa82778f6de5e3a6cfd3d599ee4e7d9a0e0e81390 WHIRLPOOL 39d7431dcba075bbbca02a1fc8d23c016ffa844bee9dcd8414cf3c96547b5b4cbbddd7bca4627e72f73a4670687db8951812547251129c52ba4e9f54fb1232ff
+EBUILD astrometry-0.72.ebuild 2872 SHA256 41a30d2cfd7ff4e2cf1c7a7bed0e047afaa171acb7a6736b51b0227d626d03a7 SHA512 5f37c8925caee01f9b01b6262383b26253a07103f10dc9546112a0d0fa2a650a294e9b073a77273bf56051c9f72e57b2999b9c3369ff74963f7e036518e35e93 WHIRLPOOL 47c284a7a7b013d639b257175a86b10d2a9f2eb7f70e5a31303c482b1880ed9a0f6676cf84d3624fb582f89ea95f6ddff5cd7909fd3909366649bec58007cb00
+MISC ChangeLog 1576 SHA256 b716db013d8591c507a85bb28d0ee5fbbcda5b45b1f50c3714682e0bc191d954 SHA512 6fa83bb1f069e229c712e2d4c0e2fc80c81f8f2d768f83f220e6a9fb8f648852f6bd5596352806b7991b28404b67978f03ae6892b92a7953c5f8c4f1a5661b25 WHIRLPOOL 5cb8dd1b53559fd2948218f7ea97dc9db122c9a859fc8c636518af60ce2a1c9781baba88cec238084fcbc8a81e19b4e9ff11d45e1f7c3333aacafb6cb61af965
+MISC metadata.xml 691 SHA256 4e677794379249917015331ec3de86be000785b07dda13181d4dabdb89cab5df SHA512 af5a3566d247a3f46bb641602822563a2f58d73e13c83dc3e1d4de32b28a7534979848931993c4b7d9c89c2e3f96c88ba488c3288bd4f9c42b3bc550c12f33f6 WHIRLPOOL 16cbc9b0cfd17a9207c2aa83a6e286f7867e5f17d806b7db20376bfc790c79d055f3b1785db37ad8003603f2238b7407ca8a3c062aaebda2a6cfa81ae9c8f4aa
diff --git a/sci-astronomy/astrometry/astrometry-0.67-r2.ebuild b/sci-astronomy/astrometry/astrometry-0.67-r2.ebuild
new file mode 100644
index 000000000000..79cf93d35da2
--- /dev/null
+++ b/sci-astronomy/astrometry/astrometry-0.67-r2.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils toolchain-funcs python-single-r1
+
+MYP=${PN}.net-${PV}
+
+DESCRIPTION="Automated astrometric calibration programs and service"
+HOMEPAGE="http://astrometry.net/"
+SRC_URI="https://github.com/dstndstn/astrometry.net/releases/download/${PV}/${MYP}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ dev-python/astropy[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ media-libs/libpng:0
+ media-libs/netpbm
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/gsl:0=
+ sys-libs/zlib:0=
+ virtual/jpeg:0
+ x11-libs/cairo
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ dev-lang/swig:0
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-soname.patch
+ "${FILESDIR}"/${P}-dynlink.patch
+ "${FILESDIR}"/${P}-qsortr.patch
+)
+
+src_prepare() {
+ default
+ # fix python scripts
+ python_fix_shebang "${S}"
+ sed -e "s|python setup-util.py|${EPYTHON} setup-util.py|" -i util/Makefile || die
+ sed -e "s|python setup.py|${EPYTHON} setup.py|" -i {libkd,sdss,blind}/Makefile || die
+ sed -e "s|python -c|${EPYTHON} -c|" -i blind/Makefile || die
+ sed -e "s|python <<EOF|${EPYTHON} <<EOF|" -i util/simplexy.c || die
+ sed -e "s|python -V|${EPYTHON} -V|" -i Makefile || die
+ # respect use compilation flags
+ sed -e '/-O3/d' -e '/-fomit-frame-pointer/d' -i util/makefile.common || die
+ # as-needed
+ sed -e "s|-lm|-lm $($(tc-getPKG_CONFIG) --libs wcslib gsl)|" -i util/Makefile || die
+ export SYSTEM_GSL=yes
+}
+
+src_compile() {
+ tc-export CC RANLIB AR
+ # fragile makefiles, build targets sequentially
+ emake
+ emake py
+ emake extra
+ emake report.txt
+}
+
+src_test() {
+ emake test
+ local d
+ for d in util blind libkd; do
+ pushd ${d} > /dev/null
+ ./test || die "failed tests in ${d}"
+ popd ${d} > /dev/null
+ done
+}
+
+ap_make() {
+ emake \
+ INSTALL_DIR="${ED%/}/usr" \
+ DATA_INSTALL_DIR="${ED%/}/usr/share/astrometry" \
+ LIB_INSTALL_DIR="${ED%/}/usr/$(get_libdir)" \
+ ETC_INSTALL_DIR="${ED%/}/etc" \
+ MAN1_INSTALL_DIR="${ED%/}/usr/share/man/man1" \
+ DOC_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}" \
+ EXAMPLE_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}/examples" \
+ PY_BASE_INSTALL_DIR="${ED%/}$(python_get_sitedir)/astrometry" \
+ PY_BASE_LINK_DIR="../$(python_get_sitedir | sed -e 's|/usr/||')/astrometry" \
+ FINAL_DIR="${EPREFIX%/}/usr" \
+ DATA_FINAL_DIR="${EPREFIX%/}/usr/share/astrometry" \
+ $@
+}
+
+src_install() {
+ ap_make install-core
+ ap_make -C util install
+ ap_make -C blind install-extra
+
+ # remove duplicates and non installable libraries
+ rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
+ rm "${ED}"/usr/$(get_libdir)/lib*.a || die
+ rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
+
+ use examples || rm -r "${ED}"/usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/astrometry/astrometry-0.70.ebuild b/sci-astronomy/astrometry/astrometry-0.70.ebuild
new file mode 100644
index 000000000000..99a28b7ec1d6
--- /dev/null
+++ b/sci-astronomy/astrometry/astrometry-0.70.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils toolchain-funcs python-single-r1
+
+MYP=${PN}.net-${PV}
+
+DESCRIPTION="Automated astrometric calibration programs and service"
+HOMEPAGE="http://astrometry.net/"
+SRC_URI="https://github.com/dstndstn/astrometry.net/releases/download/${PV}/${MYP}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ dev-python/astropy[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ media-libs/libpng:0
+ media-libs/netpbm
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/gsl:0=
+ sys-libs/zlib:0=
+ virtual/jpeg:0
+ x11-libs/cairo
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ dev-lang/swig:0
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.67-soname.patch
+ "${FILESDIR}"/${PN}-0.67-dynlink.patch
+ "${FILESDIR}"/${PN}-0.67-qsortr.patch
+)
+
+src_prepare() {
+ default
+ # fix python scripts
+ python_fix_shebang "${S}"
+ sed -e "s|python setup-util.py|${EPYTHON} setup-util.py|" -i util/Makefile || die
+ sed -e "s|python setup.py|${EPYTHON} setup.py|" -i {libkd,sdss,blind}/Makefile || die
+ sed -e "s|python -c|${EPYTHON} -c|" -i blind/Makefile || die
+ sed -e "s|python <<EOF|${EPYTHON} <<EOF|" -i util/simplexy.c || die
+ sed -e "s|python -V|${EPYTHON} -V|" -i Makefile || die
+ # respect use compilation flags
+ sed -e '/-O3/d' -e '/-fomit-frame-pointer/d' -i util/makefile.common || die
+ # as-needed
+ sed -e "s|-lm|-lm $($(tc-getPKG_CONFIG) --libs wcslib gsl)|" -i util/Makefile || die
+ export SYSTEM_GSL=yes
+}
+
+src_compile() {
+ tc-export CC RANLIB AR
+ # fragile makefiles, build targets sequentially
+ emake
+ emake py
+ emake extra
+ emake report.txt
+}
+
+src_test() {
+ emake test
+ local d
+ for d in util blind libkd; do
+ pushd ${d} > /dev/null
+ ./test || die "failed tests in ${d}"
+ popd ${d} > /dev/null
+ done
+}
+
+ap_make() {
+ emake \
+ INSTALL_DIR="${ED%/}/usr" \
+ DATA_INSTALL_DIR="${ED%/}/usr/share/astrometry" \
+ LIB_INSTALL_DIR="${ED%/}/usr/$(get_libdir)" \
+ ETC_INSTALL_DIR="${ED%/}/etc" \
+ MAN1_INSTALL_DIR="${ED%/}/usr/share/man/man1" \
+ DOC_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}" \
+ EXAMPLE_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}/examples" \
+ PY_BASE_INSTALL_DIR="${ED%/}$(python_get_sitedir)/astrometry" \
+ PY_BASE_LINK_DIR="../$(python_get_sitedir | sed -e 's|/usr/||')/astrometry" \
+ FINAL_DIR="${EPREFIX%/}/usr" \
+ DATA_FINAL_DIR="${EPREFIX%/}/usr/share/astrometry" \
+ $@
+}
+
+src_install() {
+ ap_make install-core
+ ap_make -C util install
+ ap_make -C blind install-extra
+
+ # remove duplicates and non installable libraries
+ rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
+ rm "${ED}"/usr/$(get_libdir)/lib*.a || die
+ rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
+
+ use examples || rm -r "${ED}"/usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/astrometry/astrometry-0.72.ebuild b/sci-astronomy/astrometry/astrometry-0.72.ebuild
new file mode 100644
index 000000000000..0a59e2174f17
--- /dev/null
+++ b/sci-astronomy/astrometry/astrometry-0.72.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# this could be a multiple python package
+# but the way it is packaged makes it very time consuming.
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils toolchain-funcs python-single-r1
+
+MYP=${PN}.net-${PV}
+
+DESCRIPTION="Automated astrometric calibration programs and service"
+HOMEPAGE="http://astrometry.net/"
+SRC_URI="https://github.com/dstndstn/astrometry.net/releases/download/${PV}/${MYP}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ dev-python/astropy[${PYTHON_USEDEP}]
+ dev-python/fitsio[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ media-libs/libpng:0
+ media-libs/netpbm
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/gsl:0=
+ sys-libs/zlib:0=
+ virtual/jpeg:0
+ x11-libs/cairo
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ dev-lang/swig:0
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.67-soname.patch
+ "${FILESDIR}"/${PN}-0.67-qsortr.patch
+)
+# "${FILESDIR}"/${PN}-0.72-dynlink.patch
+
+src_prepare() {
+ default
+ # respect user compilation flags
+ sed -e '/-O3/d' \
+ -e '/-fomit-frame-pointer/d' \
+ -i util/makefile.common || die
+ # fix underlinking
+ sed -e "s|-lm|-lm $($(tc-getPKG_CONFIG) --libs wcslib gsl)|" \
+ -i util/Makefile || die
+ export SYSTEM_GSL=yes
+}
+
+src_compile() {
+ tc-export CC RANLIB AR
+ # fragile makefiles, build targets sequentially
+ emake
+ emake py
+ emake extra
+ emake report.txt
+}
+
+src_test() {
+ emake test
+ local d
+ for d in util blind libkd; do
+ pushd ${d} > /dev/null
+ ./test || die "failed tests in ${d}"
+ popd ${d} > /dev/null
+ done
+}
+
+ap_make() {
+ emake \
+ INSTALL_DIR="${ED%/}/usr" \
+ DATA_INSTALL_DIR="${ED%/}/usr/share/astrometry" \
+ LIB_INSTALL_DIR="${ED%/}/usr/$(get_libdir)" \
+ ETC_INSTALL_DIR="${ED%/}/etc" \
+ MAN1_INSTALL_DIR="${ED%/}/usr/share/man/man1" \
+ DOC_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}" \
+ EXAMPLE_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}/examples" \
+ PY_BASE_INSTALL_DIR="${ED%/}$(python_get_sitedir)/astrometry" \
+ PY_BASE_LINK_DIR="../$(python_get_sitedir | sed -e 's|/usr/||')/astrometry" \
+ FINAL_DIR="${EPREFIX%/}/usr" \
+ DATA_FINAL_DIR="${EPREFIX%/}/usr/share/astrometry" \
+ $@
+}
+
+src_install() {
+ ap_make install-core
+ ap_make -C util install
+ ap_make -C blind install-extra
+
+ # remove duplicates and non installable libraries
+ # cfitsio
+ rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
+ # cfitsio utilities
+ rm "${ED}"/usr/bin/{fitsverify,imarith,imstat,liststruc,modhead,tablist,tabmerge} || die
+ rm "${ED}"/usr/$(get_libdir)/lib*.a || die
+ rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
+
+ if use examples; then
+ docompress -x /usr/share/doc/${PF}/examples
+ else
+ rm -r "${ED}"/usr/share/doc/${PF}/examples || die
+ fi
+}
diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
new file mode 100644
index 000000000000..64b87c033ca5
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
@@ -0,0 +1,78 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Dynamically link to libastrometry.so, when possible
+--- a/blind/Makefile
++++ b/blind/Makefile
+@@ -43,9 +43,7 @@
+ LDLIBS := $(LDLIBS_DEF)
+ LDLIBS += $(ANFILES_LIB)
+
+-SLIB := $(ENGINE_LIB)
+-SLIB += $(CATS_SLIB)
+-SLIB += $(ANFILES_SLIB)
++SLIB := $(ENGINE_SO)
+
+ CAIRO_SLIB := $(COMMON)/cairoutils.o
+ CAIRO_SLIB += $(SLIB)
+@@ -131,7 +129,7 @@
+ resort-xylist.o
+
+ BUILD_INDEX_OBJS := build-index.o uniformize-catalog.o startree2.o hpquads.o \
+- quad-builder.o quad-utils.o codefile.o codetree.o unpermute-stars.o \
++ quad-builder.o codefile.o codetree.o unpermute-stars.o \
+ unpermute-quads.o merge-index.o
+ ENGINE_OBJS += $(BUILD_INDEX_OBJS)
+
+@@ -147,8 +145,8 @@
+ $(AR) rc $@ $(ENGINE_OBJS)
+ $(RANLIB) $@
+
+-$(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
+- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
++$(ENGINE_SO): $(ENGINE_LIB) $(CATS_SLIB) $(ANFILES_SLIB)
++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDLIBS) -lpthread
+ ln -s $@.0 $@
+
+ # old and miscellaneous executables that aren't part of the pipeline.
+--- a/util/Makefile
++++ b/util/Makefile
+@@ -86,8 +86,7 @@
+
+ LDFLAGS += $(LDFLAGS_DEF)
+
+-LDLIBS := $(LDLIBS_DEF)
+-LDLIBS += $(ANFILES_LIB)
++LDLIBS := $(LDLIBS_DEF) -lm
+
+ SHAREDLIBFLAGS := $(SHAREDLIBFLAGS_DEF)
+
+@@ -122,8 +121,7 @@
+ ANUTILS_H_PATH := $(addprefix $(INCLUDE_DIR)/,$(ANUTILS_H))
+
+ ifndef NO_QFITS
+-ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o \
+- tic.o
++ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o
+ ANUTILS_DEPS += $(QFITS_LIB)
+ endif
+
+@@ -164,7 +162,7 @@
+ ALL_OBJ += wcs-pv2sip.o
+
+ _util$(PYTHON_SO_EXT): util.i lanczos.i $(ANFILES_SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" SLIB="$(ANFILES_SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(ANFILES_INC)" CFLAGS="$(CFLAGS)" \
+ python setup.py build_ext -v --inplace --build-temp .
+ util.py: util.i lanczos.i
+--- a/libkd/Makefile
++++ b/libkd/Makefile
+@@ -90,8 +90,7 @@
+ PYSPHEREMATCH_OBJ := pyspherematch.o
+
+ spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \
+- SLIB="$(SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(INC)" \
+ CFLAGS="$(CFLAGS)" \
+ python setup.py build_ext --inplace --force --build-temp .
diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-qsortr.patch b/sci-astronomy/astrometry/files/astrometry-0.67-qsortr.patch
new file mode 100644
index 000000000000..6a7868884eaa
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.67-qsortr.patch
@@ -0,0 +1,10 @@
+--- a/util/test_qsort_r.c 2016-11-17 00:21:29.211561563 +0000
++++ b/util/test_qsort_r.c 2016-11-17 00:21:43.281493095 +0000
+@@ -5,6 +5,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+
+ #include "cutest.h"
+
diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
new file mode 100644
index 000000000000..595dd79a2f46
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
@@ -0,0 +1,25 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Add SONAME to libastrometry.so
+--- a/blind/Makefile
++++ b/blind/Makefile
+@@ -148,7 +148,8 @@
+ $(RANLIB) $@
+
+ $(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
+- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -o $@ $^ $(LDLIBS)
++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
++ ln -s $@.0 $@
+
+ # old and miscellaneous executables that aren't part of the pipeline.
+ OLDEXECS := plotquads rawstartree checkquads
+@@ -233,8 +234,8 @@
+ done
+ mkdir -p '$(LIB_INSTALL_DIR)'
+ @for x in $(INSTALL_LIB); do \
+- echo cp $$x '$(LIB_INSTALL_DIR)'; \
+- cp $$x '$(LIB_INSTALL_DIR)'; \
++ echo cp -d $$x* '$(LIB_INSTALL_DIR)'; \
++ cp -d $$x* '$(LIB_INSTALL_DIR)'; \
+ done
+ mkdir -p '$(PY_INSTALL_DIR)'
+ @for x in $(PYTHON_INSTALL); do \
diff --git a/sci-astronomy/astrometry/files/astrometry-0.72-dynlink.patch b/sci-astronomy/astrometry/files/astrometry-0.72-dynlink.patch
new file mode 100644
index 000000000000..371a2129bd58
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.72-dynlink.patch
@@ -0,0 +1,92 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 1 Dec 2016 21:18:56 +0100
+Subject: Dynamically link to libastrometry.so, when possible
+
+---
+ blind/Makefile | 10 ++++------
+ libkd/Makefile | 3 +--
+ util/Makefile | 8 +++-----
+ 3 files changed, 8 insertions(+), 13 deletions(-)
+
+diff --git a/blind/Makefile b/blind/Makefile
+index 33895df..6e7c55c 100644
+--- a/blind/Makefile
++++ b/blind/Makefile
+@@ -43,9 +43,7 @@ LDFLAGS := $(LDFLAGS_DEF)
+ LDLIBS := $(LDLIBS_DEF)
+ LDLIBS += $(ANFILES_LIB)
+
+-SLIB := $(ENGINE_LIB)
+-SLIB += $(CATS_SLIB)
+-SLIB += $(ANFILES_SLIB)
++SLIB := $(ENGINE_SO)
+
+ CAIRO_SLIB := $(COMMON)/cairoutils.o
+ CAIRO_SLIB += $(SLIB)
+@@ -131,7 +129,7 @@ ENGINE_OBJS += new-wcs.o fits-guess-scale.o cut-table.o \
+ resort-xylist.o
+
+ BUILD_INDEX_OBJS := build-index.o uniformize-catalog.o startree2.o hpquads.o \
+- quad-builder.o quad-utils.o codefile.o codetree.o unpermute-stars.o \
++ quad-builder.o codefile.o codetree.o unpermute-stars.o \
+ unpermute-quads.o merge-index.o
+ ENGINE_OBJS += $(BUILD_INDEX_OBJS)
+
+@@ -147,8 +145,8 @@ $(ENGINE_LIB): $(ENGINE_OBJS)
+ $(AR) rc $@ $(ENGINE_OBJS)
+ $(RANLIB) $@
+
+-$(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
+- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
++$(ENGINE_SO): $(ENGINE_LIB) $(CATS_SLIB) $(ANFILES_SLIB)
++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDLIBS) -lpthread
+ ln -s $@.0 $@
+
+ # old and miscellaneous executables that aren't part of the pipeline.
+diff --git a/libkd/Makefile b/libkd/Makefile
+index f535986..0442518 100644
+--- a/libkd/Makefile
++++ b/libkd/Makefile
+@@ -90,8 +90,7 @@ py: pyspherematch
+ PYSPHEREMATCH_OBJ := pyspherematch.o
+
+ spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \
+- SLIB="$(SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(INC)" \
+ CFLAGS="$(CFLAGS)" \
+ $(PYTHON) setup.py build_ext --inplace --force --build-temp .
+diff --git a/util/Makefile b/util/Makefile
+index f88df1b..0ecf716 100644
+--- a/util/Makefile
++++ b/util/Makefile
+@@ -86,8 +86,7 @@ CFLAGS += -I.
+
+ LDFLAGS += $(LDFLAGS_DEF)
+
+-LDLIBS := $(LDLIBS_DEF)
+-LDLIBS += $(ANFILES_LIB)
++LDLIBS := $(LDLIBS_DEF) -lm
+
+ SHAREDLIBFLAGS := $(SHAREDLIBFLAGS_DEF)
+
+@@ -122,8 +121,7 @@ ANUTILS_H := an-bool.h an-endian.h an-opts.h an-thread-pthreads.h \
+ ANUTILS_H_PATH := $(addprefix $(INCLUDE_DIR)/,$(ANUTILS_H))
+
+ ifndef NO_QFITS
+-ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o \
+- tic.o
++ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o
+ ANUTILS_DEPS += $(QFITS_LIB)
+ endif
+
+@@ -164,7 +162,7 @@ wcs-pv2sip: wcs-pv2sip.o $(ANUTILS_SLIB)
+ ALL_OBJ += wcs-pv2sip.o
+
+ _util$(PYTHON_SO_EXT): util.i lanczos.i $(ANFILES_SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" SLIB="$(ANFILES_SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(ANFILES_INC)" CFLAGS="$(CFLAGS)" \
+ $(PYTHON) setup.py build_ext -v --inplace --build-temp .
+ util.py: util.i lanczos.i
diff --git a/sci-astronomy/astrometry/metadata.xml b/sci-astronomy/astrometry/metadata.xml
new file mode 100644
index 000000000000..2e748354d4f7
--- /dev/null
+++ b/sci-astronomy/astrometry/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ If you have astronomical imaging of the sky with celestial
+ coordinates you do not know—or do not trust—then Astrometry.net is
+ for you. Input an image and we'll give you back astrometric
+ calibration meta-data, plus lists of known objects falling inside
+ the field of view.
+</longdescription>
+<upstream>
+ <remote-id type="github">dstndstn/astrometry.net</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/casa-data/Manifest b/sci-astronomy/casa-data/Manifest
new file mode 100644
index 000000000000..a8bdb7acd2bb
--- /dev/null
+++ b/sci-astronomy/casa-data/Manifest
@@ -0,0 +1,8 @@
+DIST casa-data-20160222.tar.Z 12333481 SHA256 196ae7a212a71898ed22eab6dcf92f09cf4276ab160eaefdc041847af0c88b3e SHA512 4b246b163f9754587b2d917db050ab3fa5e661f27b4a5a879d60abee4132503ce700c2d1b1a88cd5cf96a3c093cb3b9489b2b31781f7084ed0d9bd5a4bcbdd6b WHIRLPOOL a7223281cbe91a75d96f52f020ee8e89c38e2ce1f32dac7776d406f82ec64a2d0c5c27ea08b57c9a1061915db70cc579c85ed9f5141f4b5cccf52bda601c5537
+DIST casa-data-20170703.tar.Z 12421015 SHA256 2766a008603054a03a4b78d97e4acd865cbdc99738585670f18598d623d9d450 SHA512 dc0de856da4146ed356fbfcb522b427bb6a66fb08affdf0bfe803b21305ac37eff9b1790ede58acc993df2f22d620982f10b42f631457258d1620702c10d87b1 WHIRLPOOL 9231e1502164775a55c3e20f24f8968906e19bf36e45f5cb3e4a10b03cd5e08d0270cce253f736d8c761b241852008b5e676e86e5bb88233ffc77756d9216d5c
+EBUILD casa-data-20160222.ebuild 516 SHA256 2e8c1c01634e705e4b5c87829164d890e35c5eb4197e85962040376d362be0cc SHA512 90334cdc08332a03e62f98cbf5bf0d5361afeb2c7366c0384acc87b190c37376c3b89bc0b8e7e504b4acc7f7f0637f5c8c17f8992d399de445863378de359299 WHIRLPOOL 374df5f66e51fb3c797624a9d7506fc7f7284c07a5ed24745fdaea7eb3263c32e17687ae0e28024d244cb4957439d6a5521ce42a76d3f34ad4df3fe433a22195
+EBUILD casa-data-20170703.ebuild 516 SHA256 49ce4cb5845096709597d0c1c093e956d714a86a6d9205251af1f71b50c1788d SHA512 ec78f3c5f1924ddac07979590dfc1f8855f3aba3e9f327a936f1d8d68d3b02c3839d00587c0a70379f00bb27ea8d2dea6c87e959e49531f0c527a97c1a148e76 WHIRLPOOL 50e211e404349eb1a19304d5da23ab3940008019072c2cc94fd5cdce15ca458a9746500c991e3d8b5be3041cf11fd890ea5b0c41672c9a957aad69ce5f963f40
+EBUILD casa-data-99999.ebuild 560 SHA256 ee2370a714272b3d44e931b18ebe11be387213c6fe38eecfbe899dd308687f1a SHA512 dd1083acc541517a280ecc7ce3cdf8d0beb3cea0e65ddd2bd53861b1af88adc1bf47a1c51c7c977fb4e795e90a6e4d0570051da218f5433c87a48d5b73aedd4c WHIRLPOOL 5d09ce745f29032a09a42b29b87b840e6df7d6843a9b518a13817b37f1da3c9f6738fccb362b0c461a4b4744f27582ac630af66f77bf7d26f1fdd6e1fbc8c484
+MISC ChangeLog 2923 SHA256 984a62002e60230d153b726c9de3a7f5b1a433c036b7ce5c94b095e97c796116 SHA512 113294424b69f43db0a6df8a6e67fd8bf58cb07bf4f48f5ea13bf100d3a0e94361c8bb096fbb2fb08c5db8974a90714007eefaed31846e75773da5ce7492d5dc WHIRLPOOL d63efb9caa46b8490547ad1f4217da4ea8400dd7eeec0c74c9dd1cf9cd9dddea1af7f94959d8dbfd82e6a71454cdef79c7533d3ea28a956e36af689e9595749a
+MISC ChangeLog-2015 1029 SHA256 2d7fe11ac30bd9ea3a83d3c05bdc50774637ce4faf71853a36dab5564832a138 SHA512 be48ab866a406374aae665f92ffe95d5f98daf8ca59ce50f64c605cba8003d39eec1a8ed84622536565a8c6db2f20d09ed40bfcaab7e6d8b29a9ac2d4fc339aa WHIRLPOOL f6f99ff56957a3fe4342928fdf18e331dea10ce872283def3ecdffb811e70998933c6623bed59d475524fe97726a1b377d3ba1af7db5887757162f9c04f8715a
+MISC metadata.xml 524 SHA256 eb17dc656c7fa23f6496ecdc8b6d944d8e00485375b7fa812c95b929f21073fc SHA512 7401fd9dd481e85bf9e95b83a063db607e251922a2f26f64b67c1bdc98d900bc5b5831b4058dc48dd0e751c30743a944cb4f3fb020445898bc009494d8869fcd WHIRLPOOL 3f249176dae6340b5ee903f89afa978f18f1ac000fc09ad0ba02ed9841284c09662958f8fba7d0f13658281ae8c4d1def8756da37a185bc40828f0e1173e5c95
diff --git a/sci-astronomy/casa-data/casa-data-20160222.ebuild b/sci-astronomy/casa-data/casa-data-20160222.ebuild
new file mode 100644
index 000000000000..a912d275c5eb
--- /dev/null
+++ b/sci-astronomy/casa-data/casa-data-20160222.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MYPN=WSRT_Measures
+
+DESCRIPTION="Data and tables for the CASA software"
+HOMEPAGE="https://github.com/casacore/casacore/"
+SRC_URI="ftp://ftp.astron.nl/outgoing/Measures/${MYPN}_${PV}-000001.ztar -> ${P}.tar.Z"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_install(){
+ insinto /usr/share/casa/data
+ doins -r *
+}
diff --git a/sci-astronomy/casa-data/casa-data-20170703.ebuild b/sci-astronomy/casa-data/casa-data-20170703.ebuild
new file mode 100644
index 000000000000..ac7ef1f7f4f3
--- /dev/null
+++ b/sci-astronomy/casa-data/casa-data-20170703.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MYPN=WSRT_Measures
+
+DESCRIPTION="Data and tables for the CASA software"
+HOMEPAGE="https://github.com/casacore/casacore/"
+SRC_URI="ftp://ftp.astron.nl/outgoing/Measures/${MYPN}_${PV}-000001.ztar -> ${P}.tar.Z"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+
+src_install(){
+ insinto /usr/share/casa/data
+ doins -r *
+}
diff --git a/sci-astronomy/casa-data/casa-data-99999.ebuild b/sci-astronomy/casa-data/casa-data-99999.ebuild
new file mode 100644
index 000000000000..d18eed7b8696
--- /dev/null
+++ b/sci-astronomy/casa-data/casa-data-99999.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit subversion
+
+ESVN_REPO_URI="https://svn.cv.nrao.edu/svn/casa-data/distro"
+ESVN_OPTIONS="--non-interactive --trust-server-cert "
+
+DESCRIPTION="Data and tables for the CASA software"
+HOMEPAGE="https://safe.nrao.edu/wiki/bin/view/Software/ObtainingCasaDataRepository"
+SRC_URI=""
+
+KEYWORDS=""
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/distro"
+
+src_install(){
+ insinto /usr/share/casa/data
+ doins -r *
+}
diff --git a/sci-astronomy/casa-data/metadata.xml b/sci-astronomy/casa-data/metadata.xml
new file mode 100644
index 000000000000..8d1cad886212
--- /dev/null
+++ b/sci-astronomy/casa-data/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Observatory tables, ephemerides and other software data related to
+ the Common Astronomy Software Applications (CASA) suite.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">casacore/casacore</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/casacore/Manifest b/sci-astronomy/casacore/Manifest
new file mode 100644
index 000000000000..07f93e63d2a7
--- /dev/null
+++ b/sci-astronomy/casacore/Manifest
@@ -0,0 +1,14 @@
+AUX casacore-2.3.0-disable-class-and-collaboration-graph-generation.patch 1586 SHA256 5fef62d562425b6f64f2ab486297ed14dc9dafa6cda34106c757e3e9db7840cc SHA512 b551689d2591d56a2b032a4c3bd8b5e1f2206d362017095291aa6cb00a6ee3dd8fbe2d9e2675b95bb994b5e4622067d1b1e5bddcff6bb6658f83400789e6dae6 WHIRLPOOL 32bbdfa7791e608a381b952f0fdbf5672aacb99d34b01edf6d2ce3fd014cf4e9bad2f65b6041dada451e9395f8641fbd2d5a4efd5d55fe927bdcf395523d75ee
+AUX casacore-2.3.0-disable-known-test-failures.patch 4983 SHA256 8b77432e8c2ebf8e1f6ea241ad82f7a76da3b8ec0bdea9f3e5f61350dfad9b21 SHA512 cd796961ef98facd5eb82f515b7ea001dddd758ca06c202b81d6de8dccdcefa1bbaf98d6635318cff45381feabd75fd13c10fa47338acfb96b582624f70d047c WHIRLPOOL 24683a982e61611163f8db41e5b26429652cb1f01d20bcc8ad38401a8b56311a2fb262230cd86bdba444ada69db65737a17bd120e2507f4ce08463faea0454a0
+AUX casacore-2.3.0-disable-tests-that-require-data-tables.patch 7001 SHA256 2ab4fd2c785a64b91d7bda65825ffdca024b4b138677b4b41e7befa17044b9f3 SHA512 322f6373fb3d46416141da2c631285dae8c32114b67dc2a466a31576353ddc39341363911f63c3116d0dfa35975bb370188519b8483ca3863040b05d4d1031dd WHIRLPOOL 0f3a5478083e9893d384527e0b0b45289d0e1763b8c21f1442bd259d25e8155865f30ec8b4040fb1718abca0f950a7714fe8b5aa119c202c98f9288ecdd30f19
+AUX casacore-2.3.0-do-not-install-test-and-demonstration-executables.patch 1417 SHA256 93bac83fcd1b4afdc4aa845676a5aa4d65d93fa6efca465c58287ab234b2cd25 SHA512 dc9c51afb107914cb5525dd2ba298716011e7e059893798235511637efada0ed23b5af1b35146a0841a18d4da2262ea933bb0e1745f07cd2d96cbc9566ae4e21 WHIRLPOOL 8f35fe87ac84d9f4e1c4d63c0327b1369f242e4e3fefc0392c89c694ca31ff42735d57ba792e22e78463515b0abebb6964b75413993b4079397261ba936f10fa
+AUX casacore-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch 10447 SHA256 219785c8b536a17422422439665d96db7abe6c73b5e15cdcfbedd89360b9d31e SHA512 57ee53e982ae4322e6fc9cb4c625190dd18abb5e0e728b72bba4a36be524dc80537c4d93e6fe6a51b6387d6df1a676bed2221d9d5ca87139c64c32f20d190af9 WHIRLPOOL b4f0241c7ab9b3ba06b04a6f0d7149174a1621d44643552b6cf5fcda4449b5828a31dc1f73b1716a7837dc8296b37bc800333be2cb86fedc008fbe38c608c99f
+AUX casacore-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch 3593 SHA256 29cabacfc8da902bacc765e24ec15a4bd6a65cd81a0109f634704c1ff076acd1 SHA512 d1db6bb4f92993fd09d948ba7f344adede3681ab9bc6c30aa743f454dd162900448dd7d5d710eb2f15fa421d95e5361d6c5c13fc8699b0994d7a5fdb7ba22f02 WHIRLPOOL d79d009c4b5c975ab248919aa8dc0480d9199200e6070425e5f240a37a28b9ea782d73352ec108a07d915d94491e157e1184d42f31d5d5bc34627f0cddd3c533
+AUX casacore-2.3.0-loose-some-tests-tFFTServer-tests.patch 1612 SHA256 cc95ad182a4fe1ad6209d8a8fb7717b8b065137e8fd7c6ab532436fe171f443f SHA512 266c26f6b7bbf8f7aa613c4b2fd97c3f8d8101a481218b1e6e3168e0341cfb9834766fa7d45d9f1d1504d86d483025da5f51346137147743060bdc3ee663a0f7 WHIRLPOOL 0cf16592086bc20943f3c455765361cd810a2ae75b23ed7990bbf9a20dcb6e0d31aaf7de4d0c783888278cc8a6724d32a4de3c6732e0441f44fa428bf1f410d9
+AUX casacore-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch 1693 SHA256 7c3fad197eea8a739f8e94c3be3bbdbf192517ce2f125ae6fbee4dc50ca73c6d SHA512 4124f2861800f4bd4e98bc88b08d6b62869dae1e646ca269a87d7d9631306aa25b64c2c6e263e71d7ae16f56c0a1e0a574a8e310984b67fee924fedefc4211f3 WHIRLPOOL 49c22b368979f99540f372861aff786834b03be98aa232c40afae906a14020c4ff41868be607ecec9550119b18c585eaf21daffb55fc9229f66b4d4adf875a16
+AUX casacore-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch 572 SHA256 045fde3f9fc845d1c1ea06125a2bf02ca3e07999eff63870867d6cadd247e6ec SHA512 f4f262c3ccc2b2ffd4d769faf0153861f9d4bca832a89d359bc9d9dbe7ee4ec2f4ef55970d5dc2ba821a7cf9a2d0246492f2e9e0bff5428684b282bc076f21ba WHIRLPOOL 4e5c590aab0c17455e27af034e042f00332f5c5b4f84d9f6e45f2fc21ddb8ba10d01ae4dc6742c93682c064c77c26e3b4319eaebe3952fe2533af80797916f68
+DIST casacore-2.3.0.tar.gz 10326408 SHA256 d8ed5373f5447885be6d3aac72f26cee24a662df5caf4a6cd23e846b79181700 SHA512 48d09e74b0c3885eb9f7bd048f0fd158397f7c6aa2bf9f713af9dbfcf3ce2c5ba0abb9500d3fe1d32977a35e0941b273fbfd8ee69c991a19df264f5f5a28cbb0 WHIRLPOOL c343a6d419e2e39b888141768abba2c7432e58a8751311e70edd856feb71e4ebcd854ea6e47d72505493bc368d022019178b7dd51c7544f725b332b06f521a00
+EBUILD casacore-2.3.0-r1.ebuild 3160 SHA256 e1829d58f167f909029ea3f7330a9669f235fba0e7da83a97a3337b243f9f71f SHA512 338c3ba076489e7c3b869c3444e9b246a9f8392d552362313cf95ea208fcc8479a9d930b1e43f03244b7d58d673620675a01eebec093c17dc39ecc3a93b59b14 WHIRLPOOL 0d59592901f28bc54b3624af6e666c51863c68daeaa25575a09bc8825a57132e03ed5b603c963f92b71a11b80a6dddcdf5597bea37c5d0a8b01017043a4dd48b
+MISC ChangeLog 4318 SHA256 eb8a9d442c3a033c68149ba6cbaf6fe3d91cae46a770fee8d1010cbe9f77c18c SHA512 17088b46231b52f04800f0ab8716fbfd41e40d532da26c571c3a662bea856252fb00711fbf6c209eb404f56e639c296b6767680608bdb680cc8a65bcf72e1be7 WHIRLPOOL bfda8b200d6cec7db55c7a7b3037d5a48fc0e58e492eca7000f7d81347977693e20c2e639e4ca860b415639861f26618d3d7a81968d0a56d84a210015f5fb4a2
+MISC ChangeLog-2015 2060 SHA256 1b8a825bd82a5aa47341123a4ab252b8b1b431506a67e583a6e9af9489dd8931 SHA512 96c5c14ce71fa6566c2723ed1861f77c272ef13cf1c88ea3a3de8d385fc845d9c3b5b88a09cd8fd91798133098f486c9a7b49d2507e4d29b90753d5167c286c4 WHIRLPOOL 31d83f9b285d247fbd51d1c37f8299ec83c860d0e6fed4fcc1d084352aebbd4bb9d1098f3c408dc6aa9ccdedf4e47a5db3807bbc9e818b03cd748fba84e0c29d
+MISC metadata.xml 780 SHA256 f930dbb54653c6149f81a805b9060e11b265e94f0dfdf6c0a71b9c239e880fd3 SHA512 f272b80dc21facc305d8b68320107c7ee837102c09c0e86dbb56de6a24ac6307172f8a2c5127c5b0af3843120e376652394f720cfa205e60c1e1f5c6f35889da WHIRLPOOL 7d65325b1505238abccbaa41c0907d1e2c15f417a9b3b3ca2b935923e773c0b017e92d9e27319dcf09a1690ae9e99e17497d451a7f2b677b07d566d5dcd580f8
diff --git a/sci-astronomy/casacore/casacore-2.3.0-r1.ebuild b/sci-astronomy/casacore/casacore-2.3.0-r1.ebuild
new file mode 100644
index 000000000000..5a34284e77c2
--- /dev/null
+++ b/sci-astronomy/casacore/casacore-2.3.0-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit cmake-utils eutils toolchain-funcs fortran-2 python-r1
+
+DESCRIPTION="Core libraries for the Common Astronomy Software Applications"
+HOMEPAGE="https://github.com/casacore/casacore"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+IUSE="+c++11 +data doc fftw hdf5 openmp python threads test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sys-libs/readline:0=
+ virtual/blas:=
+ virtual/lapack:=
+ data? ( sci-astronomy/casa-data )
+ fftw? ( sci-libs/fftw:3.0= )
+ hdf5? ( sci-libs/hdf5:0= )
+ python? (
+ ${PYTHON_DEPS}
+ dev-libs/boost:0=[python,${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ test? ( sci-astronomy/casa-data )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.3.0-disable-class-and-collaboration-graph-generation.patch
+ "${FILESDIR}"/${PN}-2.3.0-disable-known-test-failures.patch
+ "${FILESDIR}"/${PN}-2.3.0-disable-tests-that-require-data-tables.patch
+ "${FILESDIR}"/${PN}-2.3.0-do-not-install-test-and-demonstration-executables.patch
+ "${FILESDIR}"/${PN}-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch
+ "${FILESDIR}"/${PN}-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch
+ "${FILESDIR}"/${PN}-2.3.0-loose-some-tests-tFFTServer-tests.patch
+ "${FILESDIR}"/${PN}-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch
+ "${FILESDIR}"/${PN}-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch
+)
+
+pkg_pretend() {
+ if [[ $(tc-getCC)$ == *gcc* ]] && [[ ${MERGE_TYPE} != binary ]]; then
+ use c++11 && [[ $(gcc-major-version) -lt 4 ]] || \
+ ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) && \
+ die "You are using gcc but gcc-4.7 or higher is required for C++11"
+ fi
+ use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+ sed -e '/python-py/s/^.*$/find_package(Boost REQUIRED COMPONENTS python)/' \
+ -i python3/CMakeLists.txt || die
+}
+
+src_configure() {
+ has_version sci-libs/hdf5[mpi] && export CXX=mpicxx
+ local mycmakeargs=(
+ -DENABLE_SHARED=ON
+ -DBUILD_PYTHON=OFF
+ -DDATA_DIR="${EPREFIX}/usr/share/casa/data"
+ -DBUILD_TESTING="$(usex test)"
+ -DCXX11="$(usex c++11)"
+ -DUSE_FFTW3="$(usex fftw)"
+ -DUSE_HDF5="$(usex hdf5)"
+ -DUSE_OPENMP="$(usex openmp)"
+ -DUSE_THREADS="$(usex threads)"
+ )
+ python_set_options() {
+ if python_is_python3; then
+ mycmakeargs+=(
+ -DPYTHON3_EXECUTABLE="${PYTHON}"
+ -DBUILD_PYTHON3=ON
+ )
+ else
+ mycmakeargs+=(
+ -DPYTHON2_EXECUTABLE="${PYTHON}"
+ -DBUILD_PYTHON=ON
+ )
+ fi
+ }
+ use python && python_foreach_impl python_set_options
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ doxygen doxygen.cfg || die
+ fi
+}
+
+src_install(){
+ cmake-utils_src_install
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r doc/html
+ docompress -x /usr/share/doc/${PF}/html
+ fi
+}
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-disable-class-and-collaboration-graph-generation.patch b/sci-astronomy/casacore/files/casacore-2.3.0-disable-class-and-collaboration-graph-generation.patch
new file mode 100644
index 000000000000..d06af1e6e319
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-disable-class-and-collaboration-graph-generation.patch
@@ -0,0 +1,43 @@
+From: Benda Xu <heroxbd@gentoo.org>
+Date: Thu, 11 Sep 2014 18:20:44 +0900
+Subject: Disable class and collaboration graph generation
+
+The graphviz-generated class and collaboration graph
+occupies 1GB disk space. It is too big to deal with. We turn them
+off only to save space. Output image format is specified as svg to
+further save space (bug #751947).
+---
+ doxygen.cfg | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/doxygen.cfg b/doxygen.cfg
+index 9071e88..94b7ccb 100644
+--- a/doxygen.cfg
++++ b/doxygen.cfg
+@@ -2103,7 +2103,7 @@ DOT_FONTPATH =
+ # The default value is: YES.
+ # This tag requires that the tag HAVE_DOT is set to YES.
+
+-CLASS_GRAPH = YES
++CLASS_GRAPH = NO
+
+ # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+ # graph for each documented class showing the direct and indirect implementation
+@@ -2112,7 +2112,7 @@ CLASS_GRAPH = YES
+ # The default value is: YES.
+ # This tag requires that the tag HAVE_DOT is set to YES.
+
+-COLLABORATION_GRAPH = YES
++COLLABORATION_GRAPH = NO
+
+ # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+ # groups, showing the direct groups dependencies.
+@@ -2215,7 +2215,7 @@ DIRECTORY_GRAPH = NO
+ # The default value is: png.
+ # This tag requires that the tag HAVE_DOT is set to YES.
+
+-DOT_IMAGE_FORMAT = png
++DOT_IMAGE_FORMAT = svg
+
+ # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+ # enable generation of interactive SVG images that allow zooming and panning.
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-disable-known-test-failures.patch b/sci-astronomy/casacore/files/casacore-2.3.0-disable-known-test-failures.patch
new file mode 100644
index 000000000000..c26619f28c27
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-disable-known-test-failures.patch
@@ -0,0 +1,158 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Fri, 2 Dec 2016 11:11:28 +0100
+Subject: Disable known test failures
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Disable tPath test
+
+sbuild gets HOME variable leaked into the build environment. Debian
+uses sbuild as official build farm. Until the cause is pinned down,
+this test is disabled.
+
+ 98/425 Test #101: tPath ...............................***Failed 0.64 sec
+1,16d0
+< expanded: /home/heroxbd
+< expected: /«PKGBUILDDIR»
+< absolute: /home/heroxbd
+< expected: /«PKGBUILDDIR»
+< expanded: /home/heroxbd/test/test2
+< expected: /«PKGBUILDDIR»/test/test2
+< absolute: /home/heroxbd/test/test2
+< expected: /«PKGBUILDDIR»/test/test2
+< expanded: /home/heroxbd/test
+< expected: /«PKGBUILDDIR»/test
+< absolute: /home/heroxbd/test
+< expected: /«PKGBUILDDIR»/test
+< expanded: /home/heroxbd/test
+< expected: /«PKGBUILDDIR»/test
+< absolute: /home/heroxbd/test
+< expected: /«PKGBUILDDIR»/test
+33a18
+> OK
+FAIL (output not verified): ./tPath
+
+Disable tLSQaips and tLSQFit tests
+
+These tests fail, probably due to the test itself. From
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838424#15
+
+I'm not sure what to do about the other two tests that fail on arm64,
+"tLSQaips" and "tLSQFit", because those two generate a load of output
+text containing floating-point numbers and compare that text with an
+expected output. It might not be so easy to make that work on all
+architectures. Perhaps one could simply disable those two tests.
+Preferably one would still run them, so that we can see what happens
+in the logs, but not have the build fail if only those tests fail.
+---
+ casa/IO/test/CMakeLists.txt | 4 ++--
+ casa/OS/test/CMakeLists.txt | 9 ++++-----
+ images/Images/test/CMakeLists.txt | 2 +-
+ lattices/LatticeMath/test/CMakeLists.txt | 2 +-
+ scimath/Fitting/test/CMakeLists.txt | 4 ++--
+ tables/TaQL/test/CMakeLists.txt | 4 ++--
+ 6 files changed, 12 insertions(+), 13 deletions(-)
+
+diff --git a/casa/IO/test/CMakeLists.txt b/casa/IO/test/CMakeLists.txt
+index 188a6c4..3187b60 100644
+--- a/casa/IO/test/CMakeLists.txt
++++ b/casa/IO/test/CMakeLists.txt
+@@ -3,9 +3,9 @@ tAipsIOCarray
+ tAipsIO
+ tBucketBuffered
+ tBucketCache
+-tBucketFile
++# tBucketFile # https://github.com/casacore/casacore/issues/73
+ tBucketMapped
+-tByteIO
++# tByteIO # https://github.com/casacore/casacore/issues/73
+ tByteSink
+ tByteSinkSource
+ tFilebufIO
+diff --git a/casa/OS/test/CMakeLists.txt b/casa/OS/test/CMakeLists.txt
+index 520ceed..e5c9ee3 100644
+--- a/casa/OS/test/CMakeLists.txt
++++ b/casa/OS/test/CMakeLists.txt
+@@ -3,10 +3,10 @@ tCanonicalConversion
+ tConversion
+ tConversionPerf
+ tDataConversion
+-tDirectory
++# tDirectory # https://github.com/casacore/casacore/issues/73
+ tDirectoryIterator
+ tEnvVar
+-tFile
++# tFile # https://github.com/casacore/casacore/issues/73
+ tHostInfo
+ tIBMConversion
+ tLECanonicalConversion
+@@ -14,10 +14,9 @@ tMemory
+ tMemoryTrace
+ tModcompConversion
+ tMutex
+-tPath
+ tPrecTimer
+-tRegularFile
+-tSymLink
++# tRegularFile # https://github.com/casacore/casacore/issues/73
++# tSymLink # https://github.com/casacore/casacore/issues/73
+ tTime
+ tTimer
+ tVAXConversion
+diff --git a/images/Images/test/CMakeLists.txt b/images/Images/test/CMakeLists.txt
+index 4115c29..6865919 100644
+--- a/images/Images/test/CMakeLists.txt
++++ b/images/Images/test/CMakeLists.txt
+@@ -69,7 +69,7 @@ tMIRIADImage
+ # tPagedImage2 # requires geodetic/Observatories
+ # tRebinImage # requires geodetic/Observatories
+ tSubImage
+-tTempImage
++# tTempImage # https://github.com/casacore/casacore/issues/543
+ )
+
+ foreach (test ${tests})
+diff --git a/lattices/LatticeMath/test/CMakeLists.txt b/lattices/LatticeMath/test/CMakeLists.txt
+index 47e5c76..23f254f 100644
+--- a/lattices/LatticeMath/test/CMakeLists.txt
++++ b/lattices/LatticeMath/test/CMakeLists.txt
+@@ -11,7 +11,7 @@ tLatticeHistograms
+ tLatticeMathUtil
+ tLatticeSlice1D
+ tLatticeStatistics
+-tLatticeStatsDataProvider
++# tLatticeStatsDataProvider # tries to allocate a 1024*1024*1024 array, which is at least 4GiB
+ tLatticeTwoPtCorr
+ # tLattStatsSpecialize
+ )
+diff --git a/scimath/Fitting/test/CMakeLists.txt b/scimath/Fitting/test/CMakeLists.txt
+index 35d258f..de69738 100644
+--- a/scimath/Fitting/test/CMakeLists.txt
++++ b/scimath/Fitting/test/CMakeLists.txt
+@@ -3,8 +3,8 @@ dConstraints
+ dLSQFit
+ tFitGaussian
+ tLinearFitSVD
+-tLSQaips
+-tLSQFit
++#tLSQaips
++#tLSQFit
+ tNonLinearFitLM
+ )
+
+diff --git a/tables/TaQL/test/CMakeLists.txt b/tables/TaQL/test/CMakeLists.txt
+index 9cf5223..1fcd338 100644
+--- a/tables/TaQL/test/CMakeLists.txt
++++ b/tables/TaQL/test/CMakeLists.txt
+@@ -35,8 +35,8 @@ tTaQLNode
+ # Only test scripts, no test programs.
+ set (testscripts
+ ttaql
+-tTableGramCretab
+-tTableGramAlttab
++# tTableGramCretab # https://github.com/casacore/casacore/issues/541
++# tTableGramAlttab # https://github.com/casacore/casacore/issues/541
+ tTableGramUpdate
+ tTableGramMasked
+ tTableGramNull
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-disable-tests-that-require-data-tables.patch b/sci-astronomy/casacore/files/casacore-2.3.0-disable-tests-that-require-data-tables.patch
new file mode 100644
index 000000000000..b7e39f2528a9
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-disable-tests-that-require-data-tables.patch
@@ -0,0 +1,253 @@
+From: Benda Xu <heroxbd@gentoo.org>
+Date: Wed, 10 Sep 2014 10:00:43 +0900
+Subject: Disable tests that require data tables
+
+The data tables are not available during the build of casacore (yet).
+---
+ coordinates/Coordinates/test/CMakeLists.txt | 12 ++++-----
+ images/Images/test/CMakeLists.txt | 40 ++++++++++++++---------------
+ images/Regions/test/CMakeLists.txt | 8 +++---
+ lattices/LatticeMath/test/CMakeLists.txt | 2 +-
+ meas/MeasUDF/test/CMakeLists.txt | 2 +-
+ measures/Measures/test/CMakeLists.txt | 37 ++++++++++++--------------
+ measures/TableMeasures/test/CMakeLists.txt | 2 +-
+ ms/MSOper/test/CMakeLists.txt | 6 ++---
+ ms/MeasurementSets/test/CMakeLists.txt | 2 +-
+ 9 files changed, 53 insertions(+), 58 deletions(-)
+
+diff --git a/coordinates/Coordinates/test/CMakeLists.txt b/coordinates/Coordinates/test/CMakeLists.txt
+index bd1c996..248b395 100644
+--- a/coordinates/Coordinates/test/CMakeLists.txt
++++ b/coordinates/Coordinates/test/CMakeLists.txt
+@@ -1,18 +1,18 @@
+ set (tests
+-dCoordinates
++#dCoordinates # requires geodetic/Observatories
+ dRemoveAxes
+ dWorldMap
+ tCoordinate
+-tCoordinateSystem
+-tCoordinateUtil
++# tCoordinateSystem # requires geodetic/Observatories
++# tCoordinateUtil # requires geodetic/Observatories
+ tDirectionCoordinate
+-tFrequencyAligner
++# tFrequencyAligner # requires geodetic/Observatories
+ tGaussianConvert
+ tLinearCoordinate
+ tLinearXform
+-tObsInfo
++# tObsInfo # requires geodetic/Observatories
+ tProjection
+-tSpectralCoordinate
++# tSpectralCoordinate # requires geodetic/Observatories
+ tStokesCoordinate
+ tQualityCoordinate
+ tTabularCoordinate
+diff --git a/images/Images/test/CMakeLists.txt b/images/Images/test/CMakeLists.txt
+index 302d798..4115c29 100644
+--- a/images/Images/test/CMakeLists.txt
++++ b/images/Images/test/CMakeLists.txt
+@@ -35,39 +35,39 @@ endforeach (file)
+
+ set (tests
+ dImageInterface
+-dImageStatistics
+-dImageSummary
++# dImageStatistics # requires geodetic/Observatories
++# dImageSummary # requires geodetic/Observatories
+ dPagedImage
+ tExtendImage
+-tFITSErrorImage
++# tFITSErrorImage #
+ tFITSExtImage
+ tFITSExtImageII
+ tFITSImage
+ tFITSImgParser
+-tFITSQualityImage
++# tFITSQualityImage #
+ tHDF5Image
+-tImageAttrHandler
+-tImageBeamSet
+-tImageConcat
+-tImageEmpty
+-tImageExpr
+-tImageExpr2
+-tImageExpr2Gram
+-tImageExpr3Gram
++# tImageAttrHandler # requires geodetic/Observatories
++# tImageBeamSet #
++# tImageConcat # needs casacore-data
++# tImageEmpty # requires geodetic/Observatories
++# tImageExpr
++# tImageExpr2
++# tImageExpr2Gram # requires geodetic/Observatories
++# tImageExpr3Gram # requires geodetic/Observatories
+ tImageExprGram
+ tImageExprParse
+ tImageExprParse_addDir
+ tImageInfo
+-tImageProxy
+-tImageRegrid
++# tImageProxy
++# tImageRegrid # requires geodetic/Observatories
+ tImageStatistics
+-tImageStatistics2
+-tImageUtilities
+-tLELSpectralIndex
++# tImageStatistics2 # requires geodetic/Observatories
++# tImageUtilities # requires geodetic/Observatories
++# tLELSpectralIndex # requires geodetic/Observatories
+ tMIRIADImage
+-tPagedImage
+-tPagedImage2
+-tRebinImage
++# tPagedImage # requires geodetic/Observatories
++# tPagedImage2 # requires geodetic/Observatories
++# tRebinImage # requires geodetic/Observatories
+ tSubImage
+ tTempImage
+ )
+diff --git a/images/Regions/test/CMakeLists.txt b/images/Regions/test/CMakeLists.txt
+index b94c391..1201346 100644
+--- a/images/Regions/test/CMakeLists.txt
++++ b/images/Regions/test/CMakeLists.txt
+@@ -9,12 +9,12 @@ foreach (file ${datafiles})
+ endforeach (file)
+
+ set (tests
+-tImageRegion
++# tImageRegion
+ tRegionHandler
+-tWCBox
+-tWCEllipsoid
++# tWCBox # requires geodetic/Observatories
++# tWCEllipsoid
+ tWCExtension
+-tWCLELMask
++# tWCLELMask # requires geodetic/Observatories
+ tWCUnion
+ )
+
+diff --git a/lattices/LatticeMath/test/CMakeLists.txt b/lattices/LatticeMath/test/CMakeLists.txt
+index 0d869d5..47e5c76 100644
+--- a/lattices/LatticeMath/test/CMakeLists.txt
++++ b/lattices/LatticeMath/test/CMakeLists.txt
+@@ -13,7 +13,7 @@ tLatticeSlice1D
+ tLatticeStatistics
+ tLatticeStatsDataProvider
+ tLatticeTwoPtCorr
+-tLattStatsSpecialize
++# tLattStatsSpecialize
+ )
+
+ foreach (test ${tests})
+diff --git a/meas/MeasUDF/test/CMakeLists.txt b/meas/MeasUDF/test/CMakeLists.txt
+index a2ecd9a..b06ee99 100644
+--- a/meas/MeasUDF/test/CMakeLists.txt
++++ b/meas/MeasUDF/test/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ set (tests
+- tmeas
++# tmeas # requires casacore-data
+ )
+
+ foreach (test ${tests})
+diff --git a/measures/Measures/test/CMakeLists.txt b/measures/Measures/test/CMakeLists.txt
+index c10a670..261adb1 100644
+--- a/measures/Measures/test/CMakeLists.txt
++++ b/measures/Measures/test/CMakeLists.txt
+@@ -1,25 +1,25 @@
+ set (tests
+ dM1950_2000
+-dMeasure
+-tEarthField
+-tEarthMagneticMachine
+-tMBaseline
+-tMDirection
+-tMEarthMagnetic
+-tMFrequency
+-tMeasComet
+-tMeasIERS
+-tMeasJPL
++# dMeasure # geodetic/TAI_UTC
++# tEarthField # geodetic/IGRF
++# tEarthMagneticMachine # geodetic/IGRF
++# tMBaseline # geodetic/IGRF
++# tMDirection
++# tMEarthMagnetic # geodetic/IGRF
++# tMFrequency
++# tMeasComet # ephemerides/VGEO
++# tMeasIERS # geodetic/IERS*
++# tMeasJPL # ephemerides/DE200
+ tMeasMath
+-tMeasure
++# tMeasure # geodetic/TAI_UTC
+ tMeasureHolder
+-tMuvw
+-tParAngleMachine
+-tQuality
++# tMuvw # geodetic/TAI_UTC
++# tParAngleMachine # geodetic/TAI_UTC
++# tQuality
+ tRecordTransformable
+ tStokes
+ tUVWMachine
+-tVelocityMachine
++# tVelocityMachine # geodetic/TAI_UTC
+ )
+
+ foreach (test ${tests})
+@@ -29,9 +29,4 @@ foreach (test ${tests})
+ add_dependencies(check ${test})
+ endforeach (test)
+
+-if (SOFA_FOUND)
+- add_executable (tIAU2000 SofaTest.cc tIAU2000.cc)
+- target_link_libraries (tIAU2000 casa_measures ${SOFA_LIBRARY})
+- add_test (tIAU2000 ${CMAKE_SOURCE_DIR}/cmake/cmake_assay ./tIAU2000)
+- add_dependencies(check tIAU2000)
+-endif (SOFA_FOUND)
++# tIAU2000 disabled for missing geodetic/TAI_UTC
+diff --git a/measures/TableMeasures/test/CMakeLists.txt b/measures/TableMeasures/test/CMakeLists.txt
+index e7c4af1..84e7d6d 100644
+--- a/measures/TableMeasures/test/CMakeLists.txt
++++ b/measures/TableMeasures/test/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ set (tests
+ tTableQuantum
+-tTableMeasures
++# tTableMeasures # geodetic/{IERSeop{2000,97},IERSpredict{,2000},TAI_UTC}
+ dVarRefMdirCol
+ )
+
+diff --git a/ms/MSOper/test/CMakeLists.txt b/ms/MSOper/test/CMakeLists.txt
+index e53aec3..81912cd 100644
+--- a/ms/MSOper/test/CMakeLists.txt
++++ b/ms/MSOper/test/CMakeLists.txt
+@@ -1,9 +1,9 @@
+ set (tests
+-tMSDerivedValues
+-tMSKeys
++# tMSDerivedValues # geodetic/IERSpredict
++# tMSKeys
+ tMSMetaData
+ tMSReader
+-tMSSummary
++# tMSSummary
+ )
+
+ foreach (test ${tests})
+diff --git a/ms/MeasurementSets/test/CMakeLists.txt b/ms/MeasurementSets/test/CMakeLists.txt
+index 6e66aad..8150ad4 100644
+--- a/ms/MeasurementSets/test/CMakeLists.txt
++++ b/ms/MeasurementSets/test/CMakeLists.txt
+@@ -15,7 +15,7 @@ tMeasurementSet
+ tMSColumns
+ tMSDataDescBuffer
+ tMSFieldBuffer
+-tMSFieldEphem
++#tMSFieldEphem requires casacore-data
+ tMSIter
+ tMSMainBuffer
+ tMSPolBuffer
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-do-not-install-test-and-demonstration-executables.patch b/sci-astronomy/casacore/files/casacore-2.3.0-do-not-install-test-and-demonstration-executables.patch
new file mode 100644
index 000000000000..ab9004dc3ecf
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-do-not-install-test-and-demonstration-executables.patch
@@ -0,0 +1,34 @@
+From: Benda Xu <heroxbd@gentoo.org>
+Date: Fri, 24 Oct 2014 18:26:54 +0900
+Subject: Do not install test and demonstration executables
+
+casacore_{assay,floatcheck} are removed and only used with scons.
+measuresdata.csh and ms2uvfits should be included in casacore-doc as examples.
+change measuresdata.csh shebang to /usr/bin/tcsh as in Debian.
+---
+ measures/apps/CMakeLists.txt | 2 +-
+ msfits/apps/CMakeLists.txt | 5 -----
+ 2 files changed, 1 insertion(+), 6 deletions(-)
+ delete mode 100644 msfits/apps/CMakeLists.txt
+
+diff --git a/measures/apps/CMakeLists.txt b/measures/apps/CMakeLists.txt
+index fcf2184..1bbf19f 100644
+--- a/measures/apps/CMakeLists.txt
++++ b/measures/apps/CMakeLists.txt
+@@ -7,4 +7,4 @@ endforeach(prog findmeastable)
+ add_executable (measuresdata measuresdata/measuresdata.cc)
+ target_link_libraries (measuresdata casa_measures ${CASACORE_ARCH_LIBS})
+ install(TARGETS measuresdata DESTINATION bin)
+-install(PROGRAMS measuresdata/measuresdata-update DESTINATION bin)
++install(PROGRAMS DESTINATION bin)
+diff --git a/msfits/apps/CMakeLists.txt b/msfits/apps/CMakeLists.txt
+deleted file mode 100644
+index d2775c8..0000000
+--- a/msfits/apps/CMakeLists.txt
++++ /dev/null
+@@ -1,5 +0,0 @@
+-foreach(prog ms2uvfits)
+- add_executable (${prog} ${prog}.cc)
+- target_link_libraries (${prog} casa_msfits ${CASACORE_ARCH_LIBS})
+- install(TARGETS ${prog} DESTINATION bin)
+-endforeach(prog ms2uvfits)
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch b/sci-astronomy/casacore/files/casacore-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch
new file mode 100644
index 000000000000..2f07fe3bcf85
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch
@@ -0,0 +1,162 @@
+From: Edmund Grimley Evans <edmund.grimley.evans@gmail.com>
+Date: Thu, 1 Jun 2017 22:34:46 +0100
+Subject: Fix FTBFS tStatisticsUtilities,
+ tLatticeStatistics and tLCEllipsoid on arm64
+
+The tests "tStatisticsUtilities" and "tLatticeStatistics" can be made
+to pass on arm64 with these adjustments to the expected accuracy.
+
+The test "tLCEllipsoid" seems to be converting ellipses into bitmaps.
+I'm guessing it gives different output on amd64 and arm64 because the
+real curve passes through a critical point and numerical inaccuracy
+puts it on different sides of the point on the two architectures. One
+way to fix that might be to use non-round numbers in the parameters so
+that the curve does not pass through a critical point. That's what I
+tried to do, and with the following changes to the program and the
+expected output the test passes on both amd64 and arm64.
+---
+ lattices/LRegions/test/tLCEllipsoid.cc | 4 ++--
+ lattices/LRegions/test/tLCEllipsoid.out | 24 ++++++++++++------------
+ lattices/LatticeMath/test/tLatticeStatistics.cc | 4 ++--
+ scimath/Mathematics/test/tStatisticsUtilities.cc | 2 +-
+ 4 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/lattices/LRegions/test/tLCEllipsoid.cc b/lattices/LRegions/test/tLCEllipsoid.cc
+index 9e9ee03..2ff65fa 100644
+--- a/lattices/LRegions/test/tLCEllipsoid.cc
++++ b/lattices/LRegions/test/tLCEllipsoid.cc
+@@ -212,8 +212,8 @@ int main() {
+ show(ellipse3);
+
+ Float theta = C::pi/4;
+- major = 36;
+- minor = 16;
++ major = 36.01;
++ minor = 16.01;
+ xcenter = -1;
+ ycenter = -1;
+ LCEllipsoid ellipse4(
+diff --git a/lattices/LRegions/test/tLCEllipsoid.out b/lattices/LRegions/test/tLCEllipsoid.out
+index 3709155..17d8e87 100644
+--- a/lattices/LRegions/test/tLCEllipsoid.out
++++ b/lattices/LRegions/test/tLCEllipsoid.out
+@@ -163,7 +163,7 @@
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 29]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 28]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 27]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 26]
++0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 26]
+ 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 [35, 25]
+ 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 [35, 24]
+ 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 [35, 23]
+@@ -177,7 +177,7 @@
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 [35, 15]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 [35, 14]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 [35, 13]
+-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 [35, 12]
++1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 [35, 12]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 [35, 11]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 [35, 10]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 [35, 9]
+@@ -207,10 +207,10 @@
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 22]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 21]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 20]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 19]
++0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 [35, 19]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 [35, 18]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 [35, 17]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 [35, 16]
++0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 [35, 16]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 [35, 15]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 [35, 14]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 [35, 13]
+@@ -222,11 +222,11 @@
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 7]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 6]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 5]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 4]
++0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 4]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 3]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 2]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 1]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 0]
++0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 0]
+
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 35]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 34]
+@@ -240,7 +240,7 @@
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 26]
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 25]
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 24]
+-0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 23]
++0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 23]
+ 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 22]
+ 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 21]
+ 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [35, 20]
+@@ -254,7 +254,7 @@
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 [35, 12]
+ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 [35, 11]
+ 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 [35, 10]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 9]
++0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 [35, 9]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 8]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 7]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 6]
+@@ -265,11 +265,11 @@
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 1]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 0]
+
+-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 35]
++1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 35]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 34]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 33]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 32]
+-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 31]
++1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 31]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 30]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 29]
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 28]
+@@ -281,10 +281,10 @@
+ 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 22]
+ 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 21]
+ 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 20]
+-1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 19]
++1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 19]
+ 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 18]
+ 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 17]
+-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 16]
++1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 16]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 15]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 14]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [35, 13]
+diff --git a/lattices/LatticeMath/test/tLatticeStatistics.cc b/lattices/LatticeMath/test/tLatticeStatistics.cc
+index 833af91..43e0ae7 100644
+--- a/lattices/LatticeMath/test/tLatticeStatistics.cc
++++ b/lattices/LatticeMath/test/tLatticeStatistics.cc
+@@ -416,10 +416,10 @@ int main()
+ AlwaysAssert(sum(pos) == expSum, AipsError);
+ AlwaysAssert(npts(pos) == expNpts, AipsError);
+ AlwaysAssert(mean(pos) == expMean, AipsError);
+- AlwaysAssert(near(sumsq(pos), expSumSq), AipsError);
++ AlwaysAssert(near(sumsq(pos), expSumSq, 1e-9), AipsError);
+ AlwaysAssert(near(var(pos), expVar, 1e-10), AipsError);
+ AlwaysAssert(near(sigma(pos), expSigma, 1e-11), AipsError);
+- AlwaysAssert(near(rms(pos), expRMS), AipsError);
++ AlwaysAssert(near(rms(pos), expRMS, 1e-10), AipsError);
+ AlwaysAssert(mymin(pos) == DComplex(0, 0), AipsError);
+ AlwaysAssert(mymax(pos) == DComplex(size-1, size-1), AipsError);
+
+diff --git a/scimath/Mathematics/test/tStatisticsUtilities.cc b/scimath/Mathematics/test/tStatisticsUtilities.cc
+index 46491c8..c6c443f 100644
+--- a/scimath/Mathematics/test/tStatisticsUtilities.cc
++++ b/scimath/Mathematics/test/tStatisticsUtilities.cc
+@@ -265,7 +265,7 @@ int main() {
+ AlwaysAssert(got.rms == expec.rms, AipsError);
+ AlwaysAssert(near(got.stddev, expec.stddev), AipsError);
+ AlwaysAssert(near(got.sum, expec.sum), AipsError);
+- AlwaysAssert(got.sumsq == expec.sumsq, AipsError);
++ AlwaysAssert(near(got.sumsq, expec.sumsq), AipsError);
+ AlwaysAssert(near(got.variance, expec.variance), AipsError);
+ AlwaysAssert(*got.max == *expec.max, AipsError);
+ AlwaysAssert(*got.min == *expec.min, AipsError);
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch b/sci-astronomy/casacore/files/casacore-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch
new file mode 100644
index 000000000000..33723375e4dd
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch
@@ -0,0 +1,77 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Fri, 2 Dec 2016 13:16:42 +0100
+Subject: Fix too small int type for memory on 32-bit machines
+
+See https://github.com/casacore/casacore/issues/542#issuecomment-264440161
+---
+ casa/OS/HostInfoLinux.h | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/casa/OS/HostInfoLinux.h b/casa/OS/HostInfoLinux.h
+index f792b71..4edf61d 100644
+--- a/casa/OS/HostInfoLinux.h
++++ b/casa/OS/HostInfoLinux.h
+@@ -132,13 +132,13 @@ skip_token(const char *p)
+ // get integer value from v1 cgroup hierarchy of current processes, if
+ // sub_value is set it returns the entry of a collection identified by value,
+ // e.g. total_rss from memory.stat
+-// returns std::numeric_limits<size_t>::max() on error
++// returns std::numeric_limits<uInt64>::max() on error
+ // note unset cgroup limits usually have intptr_t.max()
+ // does not support v2 cgroups
+-static inline size_t
++static inline uInt64
+ get_cgroup_limit(std::string group, std::string value, std::string sub_value="")
+ {
+- size_t result = std::numeric_limits<size_t>::max();
++ uInt64 result = std::numeric_limits<uInt64>::max();
+ // assume common location, technically one needs to search for mounts
+ const std::string cgroup = std::string("/sys/fs/cgroup/") + group + "/";
+
+@@ -280,12 +280,12 @@ void HostMachineInfo::update_info( )
+ }
+
+ /* can't use more memory than allowed by cgroups, enforced */
+- size_t proc_mem_max = get_cgroup_limit("memory", "memory.limit_in_bytes") / 1024;
++ uInt64 proc_mem_max = get_cgroup_limit("memory", "memory.limit_in_bytes") / 1024;
+ /* usage_in_bytes also includes cache so use memory.stat */
+- size_t proc_mem_used = get_cgroup_limit("memory", "memory.stat", "total_rss") / 1024;
++ uInt64 proc_mem_used = get_cgroup_limit("memory", "memory.stat", "total_rss") / 1024;
+
+ /* set HostInfo memoryTotal() */
+- memory_total = std::min((size_t)sys_mem_total, proc_mem_max);
++ memory_total = std::min((uInt64)sys_mem_total, proc_mem_max);
+
+ /* if we have a valid cgroup limit we can determine memoryFree() exactly */
+ if (proc_mem_max <= sys_mem_total && proc_mem_used <= proc_mem_max) {
+@@ -293,7 +293,7 @@ void HostMachineInfo::update_info( )
+ }
+ else {
+ /* no cgroups so we have to assume all memory of host is available */
+- memory_free = std::min((size_t)sys_mem_avail, (size_t)memory_total);
++ memory_free = std::min((uInt64)sys_mem_avail, (uInt64)memory_total);
+ }
+ memory_used = memory_total - memory_free;
+
+@@ -303,17 +303,17 @@ void HostMachineInfo::update_info( )
+ cerr << "Error parsing SwapTotal and SwapFree in /proc/meminfo\n";
+
+ /* can't use more swap than allowed by cgroups */
+- size_t proc_swap_max = get_cgroup_limit("memory", "memory.memsw.limit_in_bytes") / 1024;
+- size_t proc_swap_used = get_cgroup_limit("memory", "memory.stat", "total_swap") / 1024;
++ uInt64 proc_swap_max = get_cgroup_limit("memory", "memory.memsw.limit_in_bytes") / 1024;
++ uInt64 proc_swap_used = get_cgroup_limit("memory", "memory.stat", "total_swap") / 1024;
+ /* limit is mem + swap */
+ if (proc_mem_max <= sys_mem_total && proc_mem_max <= proc_swap_max) {
+ proc_swap_max = proc_swap_max - proc_mem_max;
+ }
+
+ /* set swapTotal() */
+- swap_total = std::min((size_t)sys_swap_total, proc_swap_max);
++ swap_total = std::min((uInt64)sys_swap_total, proc_swap_max);
+
+- if (proc_swap_max <= (size_t)swap_total && proc_swap_used <= proc_swap_max) {
++ if (proc_swap_max <= (uInt64)swap_total && proc_swap_used <= proc_swap_max) {
+ swap_free = proc_swap_max - proc_swap_used;
+ }
+ else {
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-loose-some-tests-tFFTServer-tests.patch b/sci-astronomy/casacore/files/casacore-2.3.0-loose-some-tests-tFFTServer-tests.patch
new file mode 100644
index 000000000000..bccffcd4b522
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-loose-some-tests-tFFTServer-tests.patch
@@ -0,0 +1,36 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 24 Nov 2016 14:31:06 +0100
+Subject: Loose some tests tFFTServer tests
+
+This shall help to compile for mips64el and hppa.
+---
+ scimath/Mathematics/test/tFFTServer.cc | 2 +-
+ scimath/Mathematics/test/tFFTServer2.cc | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scimath/Mathematics/test/tFFTServer.cc b/scimath/Mathematics/test/tFFTServer.cc
+index c211f36..711e5a7 100644
+--- a/scimath/Mathematics/test/tFFTServer.cc
++++ b/scimath/Mathematics/test/tFFTServer.cc
+@@ -1347,7 +1347,7 @@ public:
+ }
+ AlwaysTrue(result.shape().isEqual(expectedResult.shape()),
+ AipsError);
+- AlwaysTrue(allNearAbs(result, expectedResult, epsilon),
++ AlwaysTrue(allNearAbs(result, expectedResult, 2*epsilon),
+ AipsError);
+
+ int out_size = expectedResult.nelements();
+diff --git a/scimath/Mathematics/test/tFFTServer2.cc b/scimath/Mathematics/test/tFFTServer2.cc
+index a663d50..880bce3 100644
+--- a/scimath/Mathematics/test/tFFTServer2.cc
++++ b/scimath/Mathematics/test/tFFTServer2.cc
+@@ -1096,7 +1096,7 @@ int main() {
+ expectedResult(0) = Complex(5,0);
+ server.fft(result, input, True);
+ AlwaysAssert(near(result(0), Complex(5,0), FLT_EPSILON), AipsError);
+- AlwaysAssert(!near(result(4).imag(), 0.0f, FLT_EPSILON), AipsError);
++ AlwaysAssert(!near(result(4).imag(), 0.0f, 2*FLT_EPSILON), AipsError);
+ server.fft(reverseTransform, result);
+ AlwaysAssert(allNearAbs(input, reverseTransform, FLT_EPSILON),
+ AipsError);
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch b/sci-astronomy/casacore/files/casacore-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch
new file mode 100644
index 000000000000..2952f39c3623
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch
@@ -0,0 +1,60 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 24 Nov 2016 14:31:06 +0100
+Subject: Make the check for NFS a bit more portable (BSD)
+
+And provide a fallback (f.e. for HURD).However, there is probably no
+real use case for that, since also other file systems may be slow or
+lack certain features.
+---
+ casa/OS/Directory.cc | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/casa/OS/Directory.cc b/casa/OS/Directory.cc
+index 82e6efc..b79ce0f 100644
+--- a/casa/OS/Directory.cc
++++ b/casa/OS/Directory.cc
+@@ -488,29 +488,38 @@ Vector<String> Directory::shellExpand (const Vector<String>& files, Bool stripPa
+ return expInNames;
+ }
+
+-#ifndef __APPLE__
++#if defined(__linux__)
+ #include <sys/vfs.h>
+-#include <linux//nfs_fs.h>
+-#else
++#include <linux/nfs_fs.h>
++#elif defined( __APPLE__)
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #include <sys/vnode.h>
++#elif defined(__FreeBSD_kernel__)
++#include <sys/mount.h>
++#include <sys/param.h>
++#include <stdlib.h>
+ #endif
+
+ Bool Directory::isNFSMounted() const
+ {
++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+ struct statfs buf;
+ if (statfs (itsFile.path().expandedName().chars(), &buf) < 0) {
+ throw (AipsError ("Directory::isNFSMounted error on " +
+ itsFile.path().expandedName() +
+ ": " + strerror(errno)));
+ }
+-#ifndef __APPLE__
++#endif
++#if defined(__linux__)
+ return buf.f_type == NFS_SUPER_MAGIC;
+-#else
++#elif defined(__APPLE__)
+ return buf.f_type == VT_NFS;
++#elif defined(__FreeBSD_kernel__)
++ return strcmp (buf.f_fstypename, "nfs") == 0;
++#else
++ return False;
+ #endif
+-
+ }
+
+ } //# NAMESPACE CASACORE - END
diff --git a/sci-astronomy/casacore/files/casacore-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch b/sci-astronomy/casacore/files/casacore-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch
new file mode 100644
index 000000000000..86d501365ffb
--- /dev/null
+++ b/sci-astronomy/casacore/files/casacore-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch
@@ -0,0 +1,22 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 24 Nov 2016 14:31:06 +0100
+Subject: Use the correct symbol to detect Linux OS
+
+Otherwise the compilation fails on powerpc archs
+---
+ casa/aipsenv.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/casa/aipsenv.h b/casa/aipsenv.h
+index 7e272f0..25912b8 100644
+--- a/casa/aipsenv.h
++++ b/casa/aipsenv.h
+@@ -130,7 +130,7 @@ namespace casacore { //# NAMESPACE CASACORE - BEGIN
+ #if defined(AIPS_LINUX)
+ #undef AIPS_LINUX
+ #endif
+-#if defined(__linux)
++#if defined(__linux__)
+ #define AIPS_LINUX
+ #endif
+
diff --git a/sci-astronomy/casacore/metadata.xml b/sci-astronomy/casacore/metadata.xml
new file mode 100644
index 000000000000..67227b679918
--- /dev/null
+++ b/sci-astronomy/casacore/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ A set of libraries for the the Common Astronomy Software
+ Applications for radioastronomy. This project contains C++ libraries
+ which were the code of the discontinued AIPS++ package.
+</longdescription>
+ <upstream>
+ <remote-id type="github">casacore/casacore</remote-id>
+ </upstream>
+ <use>
+ <flag name="data">Installs measures and data (pulls <pkg>sci-astronomy/casa-data</pkg>)</flag>
+ <flag name="c++11">Build casacore using the C++11 standard</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-astronomy/cdsclient/Manifest b/sci-astronomy/cdsclient/Manifest
new file mode 100644
index 000000000000..3bf973562456
--- /dev/null
+++ b/sci-astronomy/cdsclient/Manifest
@@ -0,0 +1,8 @@
+AUX cdsclient-makefile.patch 3036 SHA256 92ef17cdeda7f7107acde5b16bb5bf6c09dbd7ab3f6e91ce5e529088ed5ca39d SHA512 410538e4afc03fdb6f0f3e3bc929620a3ec15ea7694b95c1fffbba8a0c289393d1c6a33dde919c6831ddc8ebbb335a74d447e781efac80c507c050ad07fe86cd WHIRLPOOL 5cc660323c730951c8445db0990c6413badea6a5dffaf76a0d2b76f457107f635d73e5fb1a19afe0563c63a870bd4332efa0b373c22fa66f6e761a2683008825
+DIST cdsclient-3.81.tar.gz 122719 SHA256 d74dca1d450e2c8f187e3d7c4952ac480a8913da799f5522a42ea7d5075e339d SHA512 3fcf7a902dfddb3583ff34eedbcddd6a5641bf9c87d234159090378436ac370313ea311d3fee6e202ee84b3fe4065ef45a46a15b5d996e05afd1418e617c20ea WHIRLPOOL 350a5d3bff06fbe15105b9f60c4d8266dda15974b32f01b19ec8aca05fb1e830298dc9f885088f58d4ddf6685da84579db908a68f15fe7bb64165684a2d8cd58
+DIST cdsclient-3.84.tar.gz 119585 SHA256 09eb633011461b9261b923e1d0db69d3591d376b447f316eb1994aaea8919700 SHA512 2d7abf0079189b9dd19cb8919061445fd19ea9f7dfd54e8ceee26b743218cf62ab00eba0147abe82d9294223927f04b4cc3328620dfc9184a7049f8d515b29e4 WHIRLPOOL 9c0526e9549b750cf54b94d37e905cc54d24ce4a5fe6415e87d23c9489d6f47d91c6673d3fd31869b956f073133f9216a8ee07442c1ec5d5ec96ded94ef9eeeb
+EBUILD cdsclient-3.8.1.ebuild 948 SHA256 ff37fd6f7598bfcb9b218e7cbb35ba1a38f6e11450b5367a04595f3df8cf952a SHA512 07f12a9a124c3431a90d5e3400f144176ed2c4664ebfd58c8686904006892e95680f618609cb91b06776efc92ae99fd48e98eea87b816348c598bf8f1367d880 WHIRLPOOL 05b148bd7bd6ead94b55d3985d5e6d17c6527808ac517db64c79cb0fd702b19a7a9ef82414d6ee4a33f813de0e16a74355843535866089202ee2c5f67ffa45ab
+EBUILD cdsclient-3.8.4.ebuild 948 SHA256 c9f49424c4dd1be8cb50bb1cff4ba48b2bf36bc407c1c4025a2470aa0f1d9b96 SHA512 2b75245e0f73317684e96463f95d0a0cafaff982eb2043264768cad9946a81cf95ada9c8502d0becca8d6f2ff0993b8d774b03dfa5f5b2453e886dd1cb0254d9 WHIRLPOOL 0d5244fa5313b047310c991b8e8652f7a710adf003f187a34149e92464ddeba8c6626cca6921cff09720207003fffa9fffdb219d2183060e0e83bb3817d2db13
+MISC ChangeLog 2705 SHA256 c111caf075f0af3bb0b2685ad8f180487b3bbefb1dd1d34e10d400d271a3f24f SHA512 d7284678afc4110c302373f094c0341cb120448281241fefebc50a0cb57a1e7d9648c4e5a53750cc8d84e966973bf97d4a4bf43a264530f6559202b6479fe29e WHIRLPOOL 4e4b11e84a7b72cad11856f04d5c49076c11a86d5b166695f9e3ef8724e474259f2987965f7548a41dee9d19df7064b3730cacd595e125523cc9411375772a59
+MISC ChangeLog-2015 3162 SHA256 303c1ee6b798d614a3bcf9ce15b88b911548e5a58493da82ad9811b8a009e96d SHA512 e654456cd07e607466fef70cc57842d4c1209aec8bcfb5b91003b6f696486dc23e1472bffbc7eee2fc097671010b7002860c64713bf23854ebfc1e9ad07f7939 WHIRLPOOL df411d8dbc796f151413dfc1d15ac46a9febe7df42afe27734994f977e6457bbb725006ba2b2d255572249a8b382981f3526ec212f522c68bf96802dbd86a2f0
+MISC metadata.xml 572 SHA256 2653d8f876aa06de245a6ef460888e38f31ec1e1e37e907fd728eb6f366ab49c SHA512 b742174d0d6df7326c204a9eacf27ab6a4ba5ce5ac8926502c129b8f746b7b8f4665c1e88f1a3c7871a57cd2215f5c3b10a5b31e515537d3c2ce14b743319186 WHIRLPOOL bfe35c079d670924218ce85ea8949828a80c815895b2dad17b2043a0f034e1c8066ed70a97385c8ec3fafb8ff15b400cde72eaa11082809e1017fd73e78ee835
diff --git a/sci-astronomy/cdsclient/cdsclient-3.8.1.ebuild b/sci-astronomy/cdsclient/cdsclient-3.8.1.ebuild
new file mode 100644
index 000000000000..4ca690324256
--- /dev/null
+++ b/sci-astronomy/cdsclient/cdsclient-3.8.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils versionator
+
+# upstream versioning wrong: 3.71 is really 3.7.1
+MYP="${PN}-$(delete_version_separator 2)"
+
+DESCRIPTION="Collection of scripts to access the CDS databases"
+HOMEPAGE="http://cdsweb.u-strasbg.fr/doc/cdsclient.html"
+SRC_URI="ftp://cdsarc.u-strasbg.fr/pub/sw/${MYP}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RESTRICT="mirror bindist"
+DEPEND=""
+RDEPEND="app-shells/tcsh"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}/${PN}-makefile.patch" )
+src_prepare() {
+ default
+ # remove non standard "mantex" page
+ sed -e 's/aclient.tex//' -i configure || die
+}
+
+src_install() {
+ local bindir="${EPREFIX}/usr/bin/${PN}"
+ emake DESTDIR="${D}" SHSDIR="${D}${bindir}" install
+ cat <<-EOF > 99${PN}
+ PATH=${bindir}
+ ROOTPATH=${bindir}
+ EOF
+ doenvd 99${PN}
+}
diff --git a/sci-astronomy/cdsclient/cdsclient-3.8.4.ebuild b/sci-astronomy/cdsclient/cdsclient-3.8.4.ebuild
new file mode 100644
index 000000000000..868a8b7c0c88
--- /dev/null
+++ b/sci-astronomy/cdsclient/cdsclient-3.8.4.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils versionator
+
+# upstream versioning wrong: 3.71 is really 3.7.1
+MYP="${PN}-$(delete_version_separator 2)"
+
+DESCRIPTION="Collection of scripts to access the CDS databases"
+HOMEPAGE="http://cdsweb.u-strasbg.fr/doc/cdsclient.html"
+SRC_URI="ftp://cdsarc.u-strasbg.fr/pub/sw/${MYP}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RESTRICT="mirror bindist"
+DEPEND=""
+RDEPEND="app-shells/tcsh"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=( "${FILESDIR}/${PN}-makefile.patch" )
+src_prepare() {
+ default
+ # remove non standard "mantex" page
+ sed -e 's/aclient.tex//' -i configure || die
+}
+
+src_install() {
+ local bindir="${EPREFIX}/usr/bin/${PN}"
+ emake DESTDIR="${D}" SHSDIR="${D}${bindir}" install
+ cat <<-EOF > 99${PN}
+ PATH=${bindir}
+ ROOTPATH=${bindir}
+ EOF
+ doenvd 99${PN}
+}
diff --git a/sci-astronomy/cdsclient/files/cdsclient-makefile.patch b/sci-astronomy/cdsclient/files/cdsclient-makefile.patch
new file mode 100644
index 000000000000..6d135a622056
--- /dev/null
+++ b/sci-astronomy/cdsclient/files/cdsclient-makefile.patch
@@ -0,0 +1,106 @@
+--- cdsclient-3.81/Makefile.in.orig 2016-02-26 17:33:14.217750589 +0000
++++ cdsclient-3.81/Makefile.in 2016-02-26 17:38:22.463875411 +0000
+@@ -31,17 +31,17 @@
+ #################################################################
+ #PREFIX = /usr/local
+ #PREFIX = $(HOME)
+-PREFIX = @prefix@
++PREFIX = $(DESTDIR)@prefix@
+ PACKAGE = cdsclient
+ VERSION = @version@
+ DISTRIB = $(PACKAGE)-$(VERSION)
+ #################################################################
+
+ INCDIR = $(PREFIX)/include
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = $(DESTDIR)/@libdir@
+ BINDIR = $(PREFIX)/bin
+ SHSDIR = $(PREFIX)/bin
+-MANDIR = $(PREFIX)/man
++MANDIR = $(PREFIX)/share/man
+ ###########
+ # NOTE: The definition below is required only on SOLARIS
+ # Comment the following line if required
+@@ -57,12 +57,13 @@
+ COPY = cp -p
+ RM = rm
+ AWK = @AWK@
++MKDIR = mkdir -p
+
+ # C options --------------------------------
+ DEBUG =
+ C_OPT = -O
+ SYS =
+-CFLAGS = $(C_OPT) $(DEBUG) $(SYS) -I.
++
+
+ # FILES --------------------------------
+ VERFILE = $(PREFIX)/versions
+@@ -102,7 +103,7 @@
+ # RULES --------------------------------
+ .SUFFIXES: .o .c
+ .c.o:
+- $(CC) $(CFLAGS) -c $<
++ $(CC) $(CFLAGS) -I. -c $<
+
+ # DEPENDENCIES --------------------------------
+
+@@ -121,41 +122,39 @@
+ # rm -f $$f; ln finducac2 $$f; done
+
+ aclient: aclient.o $(OBJ)
+- $(CC) $@.o $(OBJ) $(LIBSYS) -o $@
+- $(STRIP) $@
++ $(CC) $(LDFLAGS) $@.o $(OBJ) $(LIBSYS) -o $@
+
+ wwwget: wwwget.c
+- $(CC) wwwget.c $(LIBSYS) -o $@
+- $(STRIP) $@
++ $(CC) $(CFLAGS) $(LDFLAGS) wwwget.c $(LIBSYS) -o $@
+
+ doc: sk.tex man.tex aclient.tex
+ latex man.tex
+
+-install: $(EXPORT_INSTALL) install_shs install_info
++install: $(EXPORT_INSTALL) install_shs
+ rm -rf *.cache
+
+ export_install: install_bin install_man
+
+ install_man: $(MAN)
+ if [ -d $(MANDIR) ]; then echo $(MANDIR) exists; \
+- else mkdir $(MANDIR); fi
++ else $(MKDIR) $(MANDIR); fi
+ for f in $(MAN); do \
+ e=`echo $$f | cut -d. -f2`; \
+ if [ -d $(MANDIR)/man$$e ] ; then echo $(MANDIR)/man$$e exists ; \
+- else mkdir $(MANDIR)/man$$e ; fi ; \
++ else $(MKDIR) $(MANDIR)/man$$e ; fi ; \
+ $(COPY) $$f $(MANDIR)/man$$e ; \
+ done
+
+ install_h: $(INC)
+- test -d $(INCDIR) || mkdir $(INCDIR)
++ test -d $(INCDIR) || $(MKDIR) $(INCDIR)
+ $(COPY) $(INC) $(INCDIR)
+
+ install_bin: $(BIN)
+- test -d $(BINDIR) || mkdir $(BINDIR)
++ test -d $(BINDIR) || $(MKDIR) $(BINDIR)
+ $(COPY) $(BIN) $(BINDIR)
+
+ install_shs: Makefile
+- test -d $(SHSDIR) || mkdir $(SHSDIR)
++ test -d $(SHSDIR) || $(MKDIR) $(SHSDIR)
+ ractools=""; test -r $(RACatCDS) && ractools=$(RACatCDS)/*; \
+ test -z "$$ractools" || ls -l $$ractools; \
+ cdsutil="$(SHSatCDS)"; test -z "$(atCDS)" && cdsutil=""; \
+@@ -195,7 +194,7 @@
+ $(MAKE) clean
+ -test -d /tmp/$(DISTRIB) && rm -rf /tmp/$(DISTRIB)
+ autoconf
+- mkdir /tmp/$(DISTRIB)
++ $(MKDIR) /tmp/$(DISTRIB)
+ cp -p COPYRIGHT /ftp/pub/sw/COPYING /tmp/$(DISTRIB)
+ for f in $(SHS) Makefile.in configure; do cp -p $$f /tmp/$(DISTRIB); \
+ add_license $$f > /tmp/$(DISTRIB)/$$f; done
diff --git a/sci-astronomy/cdsclient/metadata.xml b/sci-astronomy/cdsclient/metadata.xml
new file mode 100644
index 000000000000..557836e3fc90
--- /dev/null
+++ b/sci-astronomy/cdsclient/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ The cdsclient package is a set of C and csh routines which can be
+ built on Unix stations or PCs running Linux, which once compiled allow
+ to query some databases located at Centre de Donnees astronomiques
+ de Strasbourg (CDS) or on mirrors over the network.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/celestia/Manifest b/sci-astronomy/celestia/Manifest
new file mode 100644
index 000000000000..4bc5bfc38eb8
--- /dev/null
+++ b/sci-astronomy/celestia/Manifest
@@ -0,0 +1,12 @@
+AUX celestia-1.5.0-desktop.patch 1594 SHA256 2f989391f775e3435f0e0e570f747e0d8f38b310ea8ad92ba75099c59203171d SHA512 a6f5e296ec66a00182b77311a696ea787876e113260df7d7ad1ee4e27bf6e97264808efd3b760d226f85e9bdbf2832087afb69342d043e4c0059ccecde0384c4 WHIRLPOOL c28a1dcd4c7fa688bf2d4960734c3895b70a6fc4d55878c4615d0f7d0453dd4fb7b9419f9c8f8ae3928769c71676ffdf874f2cec46f1c640fe71d2db6b6860cf
+AUX celestia-1.6.0-cfg.patch 461 SHA256 868bbbcd761ec9b2ce3e45e3688b0a6d8d2c0d4ea39b520e13271b0063c78dac SHA512 6780affb6838661aefe7929c4e56594b33f8793b3f9aa1d774605c035b0791e4a94579feccbde76379ec29735368a161bc60fb0b1ae4d0fc953bd75efc946d64 WHIRLPOOL eded154d8cfa9fcb641e16a038e7b8489e850417981915b271995b16b151be1287e0111ed17a5b999ce02923af2581c1d63ea60a5c1710cf2be1de120b4d81e1
+AUX celestia-1.6.1-gcc46.patch 358 SHA256 747b5bb4f77a45d0f83b21ffe5d0f51b1e8dff466b7e1a3058235a2c6cf0c8ab SHA512 dd22249c73bb4fcc76b25726c795a5a2ff62cd069ede151f61b52547383d6ee91744e7cabb4195b3122b2d34f44ec8486090e06eef2fca79ac4e69628e8c3d52 WHIRLPOOL 8fb780951833cacea4d599394840d8b61e6de306b09ce0fed3ed5428cf3a19fa33f2e8b69933eb73dcbf5b14f8648b4622c6b9516172d350125807cff5850206
+AUX celestia-1.6.1-gcc47.patch 846 SHA256 5dd843abe57c542e08416051d6d92ac9ba8d230ca68d8da49c3997343919e028 SHA512 365d9c7a29d9593804b0278b7296f12df56585612b13f7f380f62aa84c36b863f560b5a2c50f53c30ecb9622590f156eac8cbd64d283f0accf0cd79f83647f56 WHIRLPOOL 1804e062a94a5404a80aac44d92aaec264bb2f8c5a07ab5556cd283eb0c57875fccf2b5dac979bbe5d1805c88f6fab2ffd7b834b1fd3da1f08746edd7b50e8d1
+AUX celestia-1.6.1-libpng15.patch 387 SHA256 ba3269842103ab68a1abd0fceb388878932d042620902796986625bd2b5f35cb SHA512 85b1e329c3bd88242a1320dbcfb8b0e0c35d10c2cec610e19f94894225fd236eea1511a7f3df121dd5842fc24c86d4dd468e91acd8a6295eebeb776ab4cb8003 WHIRLPOOL c245dd698d3f020f2c1da064c5ad68e901120ca8f5b8fc802c849d541e6c024fd876e74dcdfba0510ddf9d0b446d5961e430a9c2d194801a6d4d1e8f26eba567
+AUX celestia-1.6.1-libpng16.patch 606 SHA256 0eb14921cd0649f0086dc5fd884de21dbe9b429581a3982928cd444678be05e1 SHA512 7175b26fac03dec6ce3cdde46063ca4f1befb6f2f6f6ee7048f895b6c426d98bd85e76041c053d0471b29df37e1c09ea394de584c6abc144570388e465bb3085 WHIRLPOOL 066a0d8d16338e2a788d4df23236d6de72755fe7e142d4e13bc9e4ba0b6e0bcff60e59c8714028e1e653b2e619ecd0fdf0d3c238a34693adabd7ea50d7915613
+AUX celestia-1.6.1-linking.patch 1526 SHA256 8365533dd3401dc43d4d1f3543acde326f12ef0b862cadb7cf40428e92b715cc SHA512 31ef6c716486ddada988c2ac34e553cd5f928735454e3b74f4a2b0fa15a9b6594c87e40bf1345acc52cdc20d27bb35714fc633c9952a403146cb09966babe26b WHIRLPOOL a3d7013cb50f4ba889fdfd73d7133375884a9b3e6db565305c5ed22bbf50dea427ab8360ac01952dff918a297f42d40a660fa0654f8018ff74b9bfb64b305a99
+DIST celestia-1.6.1.tar.gz 52600436 SHA256 d35570ccb9440fc0bd3e73eb9b4c3e8a4c25f3ae444a13d1175053fa16dc34c4 SHA512 5b1221e97ee03f7def317e5e29c5100ebe714a4a3aeb8b9818dc9445e4282b6f87026ab35c7b3d5eb02fa6dbb33693977999d14d9648fc4e6d1947abe32a413f WHIRLPOOL b3a242261ca7e2006b3e08d4c11808669c939bae9237bd366012c3ca90756c5486ed544f2b18024d722ea78af257076b291fff7c3ab7eef1c9b9e2133435cc0c
+EBUILD celestia-1.6.1-r1.ebuild 3062 SHA256 5cac403b0505166a70d3ec77887c30cede9fdaca5db559fa4add66dbb1291e6d SHA512 84f0c7f6dc6ec27cf1659178a71b1a936d4d2155530dc51fc457aa08cfe02c89a967f8e169d56d9aa2179265153fe0c998f18e0240255c3dadc5b386f915e6f6 WHIRLPOOL e50aaf993b826f08e61f39adbcbdff7b7e701a0c9b83ff37178e2e7cd61b411579e347319f4c1a70755843d42432956679d941f9f463cba5ab3f8810ac77395b
+MISC ChangeLog 2835 SHA256 5cac15c8fc5c7cce504dc115b2b50522d12e658cb82c1cee340d5671fc215c63 SHA512 84b1472055d62772fc67e57fc3501b5c16f3a9fdc05785199c0027f90133b6c1218058b29789c077790ad1d6ab17ee2d064c00c906bb9e98b2c07c614bf6809b WHIRLPOOL 5518271481b15b14bef774989d1204ae9ca95b63d0f6f31d22f60da6d498b492fd0f03054bd11fa26e44259d5644914748da8f1c235b80af13cbd512d8e654f0
+MISC ChangeLog-2015 20154 SHA256 d99b6159261ffb46b139bb1a2db74bcc5efd46b76ef626db5c4c60226e5fcc67 SHA512 6af780a5cf49ea582620208f9449e7456ceeaaf96b6c929af0d3fdce42244db703ca25866dc548ceca4f69cbc33bcc3c9cbfd9f9000ed13d41e8bdeec902b724 WHIRLPOOL a147abe3043b86e83a7c8faf58f0bb5af1300a23cb5520230392201615aeaa2585f02e91e4b14b998ad570e7e466df00c0ffc7bdeb306843afa1849ed2003598
+MISC metadata.xml 892 SHA256 67f4e00abe0a090a202628a5145902a6809f934c342867e22c2575d4c03029f7 SHA512 f222c4e816f2684d8d8de5d456e81b6f6a9b92f3d3996137ddd371a9934793beeda6d1611e8f510f35eafdbe83837007fbae897efcebd47a6bf00e8b3ae159f9 WHIRLPOOL c8e842ab4d9f76f049f63e656caeec159713fd17d875cc6eaae4257ce3876285efcef1c8c21d84a1d87cef211b892160ae75e9b374b73476db3cefe6eff3ed52
diff --git a/sci-astronomy/celestia/celestia-1.6.1-r1.ebuild b/sci-astronomy/celestia/celestia-1.6.1-r1.ebuild
new file mode 100644
index 000000000000..99276ceb7056
--- /dev/null
+++ b/sci-astronomy/celestia/celestia-1.6.1-r1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+WANT_AUTOMAKE="1.11"
+
+inherit eutils flag-o-matic gnome2 autotools
+
+DESCRIPTION="OpenGL 3D space simulator"
+HOMEPAGE="http://www.shatters.net/celestia/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="cairo gnome gtk nls pch theora threads"
+
+RDEPEND="
+ virtual/opengl
+ virtual/jpeg:0
+ media-libs/libpng:0=
+ <dev-lang/lua-5.2:*
+ gtk? ( !gnome? ( x11-libs/gtk+:2 >=x11-libs/gtkglext-1.0 ) )
+ gnome? (
+ x11-libs/gtk+:2
+ >=x11-libs/gtkglext-1.0
+ >=gnome-base/libgnomeui-2.0
+ )
+ !gtk? ( !gnome? ( media-libs/freeglut ) )
+ cairo? ( x11-libs/cairo )
+ theora? ( media-libs/libtheora )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_setup() {
+ # Check for one for the following use flags to be set.
+ if use gnome; then
+ einfo "USE=\"gnome\" detected."
+ USE_DESTDIR="1"
+ CELESTIA_GUI="gnome"
+ elif use gtk; then
+ einfo "USE=\"gtk\" detected."
+ CELESTIA_GUI="gtk"
+ else
+ ewarn "If you want to use the full gui, set USE=\"{gnome|gtk}\""
+ ewarn "Defaulting to glut support (no GUI)."
+ CELESTIA_GUI="glut"
+ fi
+}
+
+src_prepare() {
+ # make better desktop files
+ epatch "${FILESDIR}"/${PN}-1.5.0-desktop.patch
+ # add a ~/.celestia for extra directories
+ epatch "${FILESDIR}"/${PN}-1.6.0-cfg.patch
+ # fix missing includes for gcc-4.6
+ epatch "${FILESDIR}"/${P}-gcc46.patch
+ # missing zlib.h include with libpng15
+ epatch "${FILESDIR}"/${P}-libpng15.patch \
+ "${FILESDIR}"/${P}-linking.patch
+
+ # gcc-47, #414015
+ epatch "${FILESDIR}"/${P}-gcc47.patch
+
+ # libpng16 #464764
+ epatch "${FILESDIR}"/${P}-libpng16.patch
+
+ # remove flags to let the user decide
+ local
+ for cf in -O2 -ffast-math \
+ -fexpensive-optimizations \
+ -fomit-frame-pointer; do
+ sed -i \
+ -e "s/${cf}//g" \
+ configure.in admin/* || die "sed failed"
+ done
+ # remove an unused gconf macro killing autoconf when no gnome
+ # (not needed without eautoreconf)
+ if ! use gnome; then
+ sed -i \
+ -e '/AM_GCONF_SOURCE_2/d' \
+ configure.in || die "sed failed"
+ fi
+ eautoreconf
+ filter-flags "-funroll-loops -frerun-loop-opt"
+
+ ### This version of Celestia has a bug in the font rendering and
+ ### requires -fsigned-char. We should be able to force this flag
+ ### on all architectures. See bug #316573.
+ append-flags "-fsigned-char"
+}
+
+src_configure() {
+ # force lua in 1.6.1. seems to be inevitable
+ econf \
+ --disable-rpath \
+ --with-${CELESTIA_GUI} \
+ --with-lua \
+ $(use_enable cairo) \
+ $(use_enable threads threading) \
+ $(use_enable nls) \
+ $(use_enable pch) \
+ $(use_enable theora)
+}
+
+src_install() {
+ if [[ ${CELESTIA_GUI} == gnome ]]; then
+ gnome2_src_install
+ else
+ emake DESTDIR="${D}" install
+ local size
+ for size in 16 22 32 48 ; do
+ insinto /usr/share/icons/hicolor/${size}x${size}/apps
+ newins "${S}"/src/celestia/kde/data/hi${size}-app-${PN}.png ${PN}.png
+ done
+ fi
+ [[ ${CELESTIA_GUI} == glut ]] && domenu celestia.desktop
+ dodoc AUTHORS README TRANSLATORS *.txt
+}
diff --git a/sci-astronomy/celestia/files/celestia-1.5.0-desktop.patch b/sci-astronomy/celestia/files/celestia-1.5.0-desktop.patch
new file mode 100644
index 000000000000..3e87692cc768
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.5.0-desktop.patch
@@ -0,0 +1,55 @@
+--- src/celestia/kde/data/celestia.desktop.orig 2008-02-27 15:19:41.000000000 +0000
++++ src/celestia/kde/data/celestia.desktop 2008-02-27 15:43:20.000000000 +0000
+@@ -1,8 +1,12 @@
+ [Desktop Entry]
++Encoding=UTF-8
++Version=1.0
+ Name=Celestia
+-Comment=Celestia
++Comment=3D space simulator to explore the universe
+ Exec=celestia %f
+ Terminal=false
+ Icon=celestia.png
+ MimeType=application/x-celestia-script
+ Type=Application
++Categories=Education;Science;Astronomy;Qt
++GenericName=Space Simulator
+--- src/celestia/gtk/data/celestia.desktop.orig 2008-02-27 15:19:58.000000000 +0000
++++ src/celestia/gtk/data/celestia.desktop 2008-02-27 15:44:26.000000000 +0000
+@@ -1,12 +1,12 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+-Version=1.4.0
+-Type=Application
+-Exec=celestia
+-Icon=celestia
+-X-GNOME-DocPath=
+-Terminal=false
++Version=1.0
+ Name=Celestia
+-Comment=Space Simulator
+-StartupNotify=true
+-Categories=Astronomy;Science;Application;
++Comment=3D space simulator to explore the universe
++Exec=celestia %f
++Terminal=false
++Icon=celestia.png
++MimeType=application/x-celestia-script
++Type=Application
++Categories=Education;Science;Astronomy;GTK
++GenericName=Space Simulator
+--- celestia.desktop 1970-01-01 01:00:00.000000000 +0100
++++ celestia.desktop 2008-02-27 15:22:31.000000000 +0000
+@@ -0,0 +1,12 @@
++[Desktop Entry]
++Encoding=UTF-8
++Version=1.0
++Name=Celestia
++GenericName=Space Simulator
++Comment=Explore the Universe in this detailed space simulation
++Type=Application
++Categories=Education;Science;Astronomy
++Exec=celestia %f
++Terminal=false
++Icon=celestia.png
++MimeType=application/x-celestia-script
diff --git a/sci-astronomy/celestia/files/celestia-1.6.0-cfg.patch b/sci-astronomy/celestia/files/celestia-1.6.0-cfg.patch
new file mode 100644
index 000000000000..8a4c18143a95
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.0-cfg.patch
@@ -0,0 +1,11 @@
+--- celestia.cfg.orig 2009-07-20 12:52:17.000000000 +0200
++++ celestia.cfg 2009-07-20 12:52:43.000000000 +0200
+@@ -195,7 +195,7 @@
+ # or
+ # ExtrasDirectories [ "D:\\celestia-extras" ]
+ #------------------------------------------------------------------------
+- ExtrasDirectories [ "extras-standard" "extras" ]
++ ExtrasDirectories [ "extras-standard" "extras" "~/.celestia" ]
+
+
+ #------------------------------------------------------------------------
diff --git a/sci-astronomy/celestia/files/celestia-1.6.1-gcc46.patch b/sci-astronomy/celestia/files/celestia-1.6.1-gcc46.patch
new file mode 100644
index 000000000000..96967e36f9dc
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.1-gcc46.patch
@@ -0,0 +1,14 @@
+http://bugs.gentoo.org/show_bug.cgi?id=366073
+http://celestia.svn.sourceforge.net/viewvc/celestia?view=revision&revision=5178
+
+Patch written by Nils Larsson <ni1s@nerdshack.com>
+--- src/celengine/frametree.h
++++ src/celengine/frametree.h
+@@ -14,6 +14,7 @@
+ #define _CELENGINE_FRAMETREE_H_
+
+ #include <vector>
++#include <cstddef>
+
+ class Star;
+ class Body;
diff --git a/sci-astronomy/celestia/files/celestia-1.6.1-gcc47.patch b/sci-astronomy/celestia/files/celestia-1.6.1-gcc47.patch
new file mode 100644
index 000000000000..385f39a20511
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.1-gcc47.patch
@@ -0,0 +1,22 @@
+diff -up celestia-1.6.1/src/celengine/frametree.h.gcc47 celestia-1.6.1/src/celengine/frametree.h
+--- celestia-1.6.1/src/celengine/frametree.h.gcc47 2012-03-22 12:56:56.096087430 -0400
++++ celestia-1.6.1/src/celengine/frametree.h 2012-03-22 12:57:04.333022427 -0400
+@@ -13,6 +13,7 @@
+ #ifndef _CELENGINE_FRAMETREE_H_
+ #define _CELENGINE_FRAMETREE_H_
+
++#include <unistd.h>
+ #include <vector>
+
+ class Star;
+diff -up celestia-1.6.1/src/celengine/planetgrid.cpp.gcc47 celestia-1.6.1/src/celengine/planetgrid.cpp
+--- celestia-1.6.1/src/celengine/planetgrid.cpp.gcc47 2012-03-22 12:53:01.496950513 -0400
++++ celestia-1.6.1/src/celengine/planetgrid.cpp 2012-03-22 12:53:08.812891865 -0400
+@@ -12,6 +12,7 @@
+
+ #include <cstdio>
+ #include <cmath>
++#include <celmath/mathlib.h>
+ #include <celmath/intersect.h>
+ #include "planetgrid.h"
+ #include "body.h"
diff --git a/sci-astronomy/celestia/files/celestia-1.6.1-libpng15.patch b/sci-astronomy/celestia/files/celestia-1.6.1-libpng15.patch
new file mode 100644
index 000000000000..5dffbab246ef
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.1-libpng15.patch
@@ -0,0 +1,14 @@
+imagecapture.cpp:184:40: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope
+
+--- src/celestia/imagecapture.cpp
++++ src/celestia/imagecapture.cpp
+@@ -31,6 +31,9 @@
+ #include "png.h"
+ #endif
+
++// Z_BEST_COMPRESSION
++#include <zlib.h>
++
+ // Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng
+ #ifndef png_jmpbuf
+ #define png_jmpbuf(png_ptr) png_ptr->jmpbuf
diff --git a/sci-astronomy/celestia/files/celestia-1.6.1-libpng16.patch b/sci-astronomy/celestia/files/celestia-1.6.1-libpng16.patch
new file mode 100644
index 000000000000..78911cb55755
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.1-libpng16.patch
@@ -0,0 +1,25 @@
+image.cpp:530:61: error: ‘memcpy’ was not declared in this scope
+
+https://bugs.gentoo.org/show_bug.cgi?id=464764
+
+Patch written by Lars Wendler <polynomial-c@gentoo.org>
+--- a/celestia/src/celengine/image.cpp
++++ b/celestia/src/celengine/image.cpp
+@@ -42,6 +42,7 @@ extern "C" {
+ #include "jpeglib.h"
+ #else
+ #include <cstdio>
++#include <string.h>
+ #include <jpeglib.h>
+ #endif
+ }
+--- a/celestia/src/celengine/texture.cpp
++++ b/celestia/src/celengine/texture.cpp
+@@ -28,6 +28,7 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <cassert>
++#include <string.h>
+
+ #ifndef _WIN32
+ #ifndef TARGET_OS_MAC
diff --git a/sci-astronomy/celestia/files/celestia-1.6.1-linking.patch b/sci-astronomy/celestia/files/celestia-1.6.1-linking.patch
new file mode 100644
index 000000000000..dd5f93e609a6
--- /dev/null
+++ b/sci-astronomy/celestia/files/celestia-1.6.1-linking.patch
@@ -0,0 +1,65 @@
+Fix linking issues:
+ * underlinking GLUT (bug #372123, #387609)
+ * as-needed (bug #281258)
+ * theora with glut (bug #399237)
+
+--- a/src/celestia/Makefile.am
++++ b/src/celestia/Makefile.am
+@@ -7,14 +7,15 @@
+
+ if ENABLE_KDE
+ SUBDIRS += kde
+-celestiaKDELIBS = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) \
+- $(LIBSOCKET) -lDCOP kde/libkdegui.a
++celestiaKDELIBS = kde/libkdegui.a
+ celestia_LDFLAGS = $(all_libraries) $(KDE_RPATH)
++LIBS += $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIBSOCKET) -lDCOP
+ endif
+
+ if ENABLE_GTK
+ SUBDIRS += gtk
+-celestiaGTKLIBS = $(GTK_LIBS) gtk/libgtkgui.a
++celestiaGTKLIBS = gtk/libgtkgui.a
++LIBS += $(GTK_LIBS)
+ endif
+
+ COMMONSOURCES = \
+@@ -62,6 +63,7 @@
+
+ if ENABLE_GLUT
+ GLUTSOURCES = glutmain.cpp
++GLUTLIBS = -lGL
+ endif
+
+ if ENABLE_THEORA
+@@ -80,15 +82,16 @@
+ celestia_LDADD = \
+ $(celestiaKDELIBS) \
+ $(celestiaGTKLIBS) \
+- $(DL_LIBS) \
+- $(LUA_LIBS) \
+- $(THEORA_LIBS) \
+ ../celengine/libcelengine.a \
+ ../celtxf/libceltxf.a \
+ ../cel3ds/libcel3ds.a \
+ ../celmath/libcelmath.a \
+ ../celutil/libcelutil.a \
+- $(SPICE_LIBS)
++ $(LUA_LIBS) \
++ $(THEORA_LIBS) \
++ $(GLUTLIBS) \
++ $(SPICE_LIBS) \
++ $(DL_LIBS)
+
+ noinst_HEADERS = $(wildcard *.h)
+ noinst_DATA = ../../celestia
+--- a/configure.in
++++ b/configure.in
+@@ -252,6 +252,7 @@
+ dnl Check for GLUT.
+ AC_CHECK_LIB(glut, glutKeyboardUpFunc, ,
+ [AC_MSG_ERROR([GLUT library version >= 3.7 not found])])
++ check_theora="yes"
+ fi
+ AM_CONDITIONAL(ENABLE_GLUT, test "$ui_glut" = "yes")
+
diff --git a/sci-astronomy/celestia/metadata.xml b/sci-astronomy/celestia/metadata.xml
new file mode 100644
index 000000000000..d9b06cd8c2cc
--- /dev/null
+++ b/sci-astronomy/celestia/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Celestia is a real-time space simulation that lets you experience
+ our universe in three dimensions. You can travel throughout the solar
+ system, to any of over 100,000 stars, or beyond the galaxy. All
+ travel in Celestia is seamless; the exponential zoom feature lets you
+ explore space across a range of scales, from galaxy clusters down
+ to spacecraft a few meters across. A 'point-and-goto' interface
+ is used to navigate through the universe to the object you
+ want to visit.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">celestia</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/cpl/Manifest b/sci-astronomy/cpl/Manifest
new file mode 100644
index 000000000000..3141cb06a787
--- /dev/null
+++ b/sci-astronomy/cpl/Manifest
@@ -0,0 +1,12 @@
+AUX cpl-6.1.1-check-shared-libs.patch 1010 SHA256 99d448ed80ad6139bb989ffc718942570dc8c2646e3936939c9fb6797deb92a5 SHA512 40d060e441222328e92508eef25fa50eea37600d4bfb9f422d47e5cafac115a9e82994ff74e3ca17124b5b83d8cec19b2f681709dbfc1ec975841a74fd273903 WHIRLPOOL 23fc6e83b59e6c10e512d93bde8ff2d62c5bc4a1b3390dea163e6c94f03bc2eb21fe3db12a61d3d869d71f59493f77ff6fdcab416ff564542d436b7850e9a7ad
+AUX cpl-6.1.1-use-system-ltdl.patch 1296 SHA256 55bd2aa8072e621d6a7e4e939f8e6831c598c7000f739756520ff174e1d6ecaf SHA512 bfa2d0f6cadcf7e817314a6a3d587f99b298ea7f1fd919f5c7ef6a4a133a631da7a039f77f572918029ee8284d025a808ff3851112e5836ab824afa5e519ac1e WHIRLPOOL a1ee4c34fde903f14f6805cb312951ead0fa3b1bfaf9b78abbad4e4063d2f15def568b24401695ceeb0613fce933f5fba7cb239d6933b4d5cfeb262fd0a5b1a0
+AUX cpl-6.6.1-use-system-ltdl.patch 1005 SHA256 d63c740458b845a5d580f2503626cb85f772885f971cf6deafa3b538e786d61b SHA512 bd3c517245f8d2fb29cc68bcc1f4bad3d0fd5d8c2b3673b0ddbcec5b12b171527109ba3ad2bb2961d37c921ddb11876d49e698199c7360ad907c0ed28245404a WHIRLPOOL 105859ba956394e3eed4ca797e322b06ad2fe46fba575d75623ef295257b1bb1fa99469ceef0f865fd2a37d5e385599f8071c7237d6a42e4e0ae869525dc52e2
+DIST cpl-6.4.2.tar.gz 3165143 SHA256 848dbbc581670b32eeb3d87a7c3c10c9d3969f0fcbe7daf8ba18ef0081cbc793 SHA512 636ce549f23862a111fd88e97878eff8b86c88e8e2e800533b2f34f219f6b6ea3f03bd9de6ce9606c3787d0a61fb66a6bd92087d24c57c47e5a26e31eb362a11 WHIRLPOOL 7368e323c4f00af8fc684ba1448eec20f229df310b9cd66f0fe046dd6900a195c04fbc1c78dd31600651c8e7911f49517a37ddb4ba89df235fadb5c0e1a0cb81
+DIST cpl-6.6.1.tar.gz 3082051 SHA256 16cd1c5a165526423d5dd7999f9080e1fa143fc38778329744cf59fd24e1bb84 SHA512 261cd092b3d0f1865f2e1aca0760232497cfe85b92f61601b22d81619147cad17c427791adad5a863acb3febcfe78590c8f8d10de1d626f4b90302326f936064 WHIRLPOOL ea7c5f7792da54a46eec9f3a8e040c2598b8ec95a9aeccc8451e77aa9773c2ccdf3113e91f2f6f2c21782ab31293922a6195e0df7da30a369a1396328ace5251
+DIST cpl-7.0.tar.gz 3090767 SHA256 8b0351225ebe845fa496154c4a87564323bad8bf6223e25e90290b4a608127aa SHA512 d79eb37a5f29740edc1736815bde6ec31bc4e1f648552cad48ab70626170ff6195d226de0c198e0287dee3bfe815ee7302b6882395d710c534fabe0c5353aaa6 WHIRLPOOL 791d56d4b10bdd226798392cb82a6361893d673d5853f6a03ec50608a12823d4f3e5f219bebf3be5147db6b1b90c24860c6f947de3d339e3626d9f5627b8fa37
+EBUILD cpl-6.4.2.ebuild 1732 SHA256 22607e1beb59c924f82391aa3dd11d6c2fe18fc3f5bac803a39b7d855dd88f2c SHA512 66fd2ae2cc074834f7fe15d084171bdaab8974467f2638eaf1a3fbf503218d340a91da44a249c12a83e6e052ac15d33dde63801ad44ca4faf7d126d287e7abe8 WHIRLPOOL 8bb3a2f458648134c4bc6aef86dbeff1f013088c1862f144fb14ec5fd8a7aa44b0f52839940d8abd4b4aa552490d36e3abf1b697080dd7a30d6285b94966869a
+EBUILD cpl-6.6.1.ebuild 1674 SHA256 0dc3fa47ed2359e58b3cac066bb19f4a23b5e4612e99da162bba024f361a543c SHA512 f75d9ee0616a3d48f555bdf4017e9c97822b1c1c93cae42df4393dd81f45a085940b0e3a9574adde10e809df36c2e94f340716472cefb3dd54cf9b289b762b0b WHIRLPOOL 4290074116f6fba905240598cc38876cbc84704061f34f9b1a078aeff2938cf7d3a5569ab41bfd958f19de053cb28ed0f73c8d2a60619041b8ffdaf7fdc1af0c
+EBUILD cpl-7.0.ebuild 1674 SHA256 cfdc306fd442252a36d7c1725703de9cbbb8f0d452a202479f8b40b47b919b27 SHA512 ae171d69f8736eb88e3330dbc99e08224af10d522d8ad33c2bc9d8194c3573ded00d86dc596bf4c7e2ce6b34a27097ec001cb52ab51b3f7dea44fd60476b70eb WHIRLPOOL 0412ac1b8d2bd030ac3e9c0aacc6e8af99de3470e2727942b17772ccbfbf0834deb21e7857605ddd7e831831dc151cf8932b8d20c026f512c5b10bcce21ef29b
+MISC ChangeLog 3424 SHA256 77fe7b31e409f3bf628aa834cc4fe82889990cfb6d400f48e3c587e2f12fd987 SHA512 3a9f3a0b5faaaee27e3f9b6579da514e942994ce6f6b3fa94a4312278faf1080306f84d6d34d95877d470f563f906495a75c8ba4be501850cf3c4f5caf78ab67 WHIRLPOOL 975e7768510987151ca95c46bbf02d9275d932287b9a936e73f24746efb51f965bfd5603fb50916ff6bcf457eb88f1ee20834f6abf527166ca5a7b1f53f8054f
+MISC ChangeLog-2015 3354 SHA256 fcad692c6f4354363571f49caebeab7ce53b800c6f5933eb7ebec60c023d89c4 SHA512 3a1a48787bb3933b1cc53166bb56dc7f0fdf5e4090d48acec64ff68dc785d653bec8ac82b52476a4109a0eaa77da116d108709684d8b2904a9762da4d65b0f9c WHIRLPOOL 0e2558df10c5bf982cd1df2dde3a7be94cee439879f680c9be53372c3ad83cdaa01c39e5beed28b8741615e65324c3ef2088072fe5920078eaa3ab82db23cb86
+MISC metadata.xml 1076 SHA256 fd21398dc2616f886f7af49d3e6811938a46c717dbff1d989e7e93ba03bec3c8 SHA512 5c4f45f0c1ee32b01b5f04ec5cd7ae1721f9dc21e9b9027a5001f0f034a04efed71dbf4a3f30a1b6070f45c9b0f08f71926f63aaf3ce4c38c9b2a53fb50b9278 WHIRLPOOL 3506df619f59fd33d6df5451254b50eb133e652353bb2f06cff3a70a153759e4af3c4eb624cff4628e20cfff98ce1fb1e0e1c47f102dc313bc9e382115ee44fc
diff --git a/sci-astronomy/cpl/cpl-6.4.2.ebuild b/sci-astronomy/cpl/cpl-6.4.2.ebuild
new file mode 100644
index 000000000000..aba6a36645b2
--- /dev/null
+++ b/sci-astronomy/cpl/cpl-6.4.2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+JAVA_PKG_OPT_USE=gasgano
+AUTOTOOLS_AUTORECONF=1
+
+inherit eutils java-pkg-opt-2 autotools-utils
+
+DESCRIPTION="ESO common pipeline library for astronomical data reduction"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/20"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc gasgano static-libs threads"
+
+RDEPEND="
+ sci-astronomy/wcslib:0=
+ >=sci-libs/cfitsio-3.310:0=
+ sci-libs/fftw:3.0=
+ gasgano? ( sci-astronomy/gasgano )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-6.1.1-check-shared-libs.patch
+ "${FILESDIR}"/${PN}-6.1.1-use-system-ltdl.patch
+)
+
+src_prepare() {
+ # bug 422455 and remove cpu chcking
+ sed -i \
+ -e '/AM_C_PROTOTYPES/d' \
+ -e '/CPL_CHECK_CPU/d' \
+ configure.ac libcext/configure.ac || die
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ --disable-ltdl-install
+ --without-included-ltdl
+ --with-cfitsio="${EPREFIX}/usr"
+ --with-wcs="${EPREFIX}/usr"
+ --with-fftw="${EPREFIX}/usr"
+ $(use_enable doc maintainer-mode)
+ $(use_enable threads)
+ )
+ if use gasgano; then
+ myeconfargs+=(
+ --enable-gasgano
+ --with-gasgano="${EPREFIX}/usr"
+ --with-gasgano-classpath="${EPREFIX}/usr/share/gasgano/lib"
+ --with-java="$(java-config -O)"
+ )
+ else
+ myeconfargs+=( --disable-gasgano )
+ fi
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile all $(use doc && echo html)
+}
+
+src_install() {
+ autotools-utils_src_install all $(use doc && echo install-html)
+}
diff --git a/sci-astronomy/cpl/cpl-6.6.1.ebuild b/sci-astronomy/cpl/cpl-6.6.1.ebuild
new file mode 100644
index 000000000000..a2d5fdfc6e72
--- /dev/null
+++ b/sci-astronomy/cpl/cpl-6.6.1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+JAVA_PKG_OPT_USE=gasgano
+
+inherit autotools java-pkg-opt-2
+
+DESCRIPTION="ESO common pipeline library for astronomical data reduction"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/20"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc gasgano static-libs threads"
+
+RDEPEND="
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/fftw:3.0=
+ gasgano? ( sci-astronomy/gasgano )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-6.6.1-use-system-ltdl.patch
+)
+
+src_prepare() {
+ default
+ # remove cpu chcking
+ sed -e '/CPL_CHECK_CPU/d' \
+ -i configure.ac libcext/configure.ac || die
+ # search for shared libs, not static
+ sed -e 's/\.a/\.so/g' \
+ -i m4/cpl.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ --disable-ltdl-install
+ --without-included-ltdl
+ --with-cfitsio="${EPREFIX}/usr"
+ --with-wcs="${EPREFIX}/usr"
+ --with-fftw="${EPREFIX}/usr"
+ $(use_enable doc maintainer-mode)
+ $(use_enable static-libs static)
+ $(use_enable threads)
+ )
+ if use gasgano; then
+ myeconfargs+=(
+ --enable-gasgano
+ --with-gasgano="${EPREFIX}/usr"
+ --with-gasgano-classpath="${EPREFIX}/usr/share/gasgano/lib"
+ --with-java="$(java-config -O)"
+ )
+ else
+ myeconfargs+=( --disable-gasgano )
+ fi
+ econf ${myeconfargs[@]}
+}
+
+src_compile() {
+ default
+ use doc && emake html
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+ use doc && emake install-html
+}
diff --git a/sci-astronomy/cpl/cpl-7.0.ebuild b/sci-astronomy/cpl/cpl-7.0.ebuild
new file mode 100644
index 000000000000..6a7182c47d26
--- /dev/null
+++ b/sci-astronomy/cpl/cpl-7.0.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+JAVA_PKG_OPT_USE=gasgano
+
+inherit autotools java-pkg-opt-2
+
+DESCRIPTION="ESO common pipeline library for astronomical data reduction"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/26"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc gasgano static-libs threads"
+
+RDEPEND="
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/fftw:3.0=
+ gasgano? ( sci-astronomy/gasgano )"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-6.6.1-use-system-ltdl.patch
+)
+
+src_prepare() {
+ default
+ # remove cpu chcking
+ sed -e '/CPL_CHECK_CPU/d' \
+ -i configure.ac libcext/configure.ac || die
+ # search for shared libs, not static
+ sed -e 's/\.a/\.so/g' \
+ -i m4/cpl.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ --disable-ltdl-install
+ --without-included-ltdl
+ --with-cfitsio="${EPREFIX}/usr"
+ --with-wcs="${EPREFIX}/usr"
+ --with-fftw="${EPREFIX}/usr"
+ $(use_enable doc maintainer-mode)
+ $(use_enable static-libs static)
+ $(use_enable threads)
+ )
+ if use gasgano; then
+ myeconfargs+=(
+ --enable-gasgano
+ --with-gasgano="${EPREFIX}/usr"
+ --with-gasgano-classpath="${EPREFIX}/usr/share/gasgano/lib"
+ --with-java="$(java-config -O)"
+ )
+ else
+ myeconfargs+=( --disable-gasgano )
+ fi
+ econf ${myeconfargs[@]}
+}
+
+src_compile() {
+ default
+ use doc && emake html
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+ use doc && emake install-html
+}
diff --git a/sci-astronomy/cpl/files/cpl-6.1.1-check-shared-libs.patch b/sci-astronomy/cpl/files/cpl-6.1.1-check-shared-libs.patch
new file mode 100644
index 000000000000..658f2eaefb9e
--- /dev/null
+++ b/sci-astronomy/cpl/files/cpl-6.1.1-check-shared-libs.patch
@@ -0,0 +1,35 @@
+Check shared library instead of static ones.
+bicatali@gentoo.org
+
+diff -Nur cpl-6.1.1.orig/m4/cpl.m4 cpl-6.1.1/m4/cpl.m4
+--- cpl-6.1.1.orig/m4/cpl.m4 2012-06-04 18:38:01.000000000 +0100
++++ cpl-6.1.1/m4/cpl.m4 2012-06-04 18:46:37.000000000 +0100
+@@ -8,7 +8,7 @@
+
+ cpl_cfitsio_check_version="$1"
+ cpl_cfitsio_check_header="fitsio.h"
+- cpl_cfitsio_check_lib="libcfitsio.a"
++ cpl_cfitsio_check_lib="libcfitsio.so"
+
+ cpl_cfitsio_incdirs=""
+ cpl_cfitsio_libdirs=""
+@@ -668,7 +668,7 @@
+
+ cpl_wcs_check_version="$1"
+ cpl_wcs_check_header="wcslib/wcslib.h"
+- cpl_wcs_check_lib="libwcs.a"
++ cpl_wcs_check_lib="libwcs.so"
+
+ cpl_wcs_includes=""
+ cpl_wcs_libraries=""
+@@ -900,8 +900,8 @@
+
+ cpl_fftw_check_version="$1"
+ cpl_fftw_check_header="fftw3.h"
+- cpl_fftw_check_lib="libfftw3.a"
+- cpl_fftwf_check_lib="libfftw3f.a"
++ cpl_fftw_check_lib="libfftw3.so"
++ cpl_fftwf_check_lib="libfftw3f.so"
+
+ cpl_fftw_includes=""
+ cpl_fftw_libraries=""
diff --git a/sci-astronomy/cpl/files/cpl-6.1.1-use-system-ltdl.patch b/sci-astronomy/cpl/files/cpl-6.1.1-use-system-ltdl.patch
new file mode 100644
index 000000000000..a0c23a75d38c
--- /dev/null
+++ b/sci-astronomy/cpl/files/cpl-6.1.1-use-system-ltdl.patch
@@ -0,0 +1,46 @@
+use system libtdl from libtool instead of bundled one
+see http://www.flameeyes.eu/autotools-mythbuster/libtool/plugins.html
+bicatali@gentoo.org
+
+diff -Nur cpl-6.1.1.orig/configure.ac cpl-6.1.1/configure.ac
+--- cpl-6.1.1.orig/configure.ac 2012-06-04 18:38:01.000000000 +0100
++++ cpl-6.1.1/configure.ac 2012-06-04 22:14:23.000000000 +0100
+@@ -60,8 +60,12 @@
+ AC_ENABLE_STATIC(yes)
+ AC_ENABLE_SHARED(yes)
+
+-AC_LIBLTDL_CONVENIENCE
+-AC_PROG_LIBTOOL
++LT_INIT([dlopen])
++AC_CHECK_HEADER([ltdl.h],
++ [AC_CHECK_LIB([ltdl], [lt_dladvise_init],
++ [LIBLTDL=-lltdl], [LIBLTDL=])],
++ [LIBLTDL=])
++
+ AC_SUBST(INCLTDL)
+ AC_SUBST(LIBLTDL)
+ AC_SUBST(LIBTOOL_DEPS)
+@@ -131,7 +135,6 @@
+ CPL_CONFIG_FUNC
+
+ # Configure subpackages
+-AC_CONFIG_SUBDIRS(libltdl)
+
+ if test ! x$"cpl_cv_with_system_cext" = xyes; then
+ AC_CONFIG_SUBDIRS([libcext])
+diff -Nur cpl-6.1.1.orig/Makefile.am cpl-6.1.1/Makefile.am
+--- cpl-6.1.1.orig/Makefile.am 2012-06-04 18:38:01.000000000 +0100
++++ cpl-6.1.1/Makefile.am 2012-06-04 19:07:41.000000000 +0100
+@@ -25,11 +25,10 @@
+ DISTCLEANFILES = *~
+
+ if GASGANO_SUPPORT
+-libltdl = libltdl
+ cpljava = cpljava
+ endif
+
+-SUBDIRS = $(libltdl) $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
++SUBDIRS = $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
+
+ HTML_SUBDIRS =
+
diff --git a/sci-astronomy/cpl/files/cpl-6.6.1-use-system-ltdl.patch b/sci-astronomy/cpl/files/cpl-6.6.1-use-system-ltdl.patch
new file mode 100644
index 000000000000..37ef2b550eda
--- /dev/null
+++ b/sci-astronomy/cpl/files/cpl-6.6.1-use-system-ltdl.patch
@@ -0,0 +1,41 @@
+use system libtdl from libtool instead of bundled one
+see http://www.flameeyes.eu/autotools-mythbuster/libtool/plugins.html
+bicatali@gentoo.org
+
+--- cpl-7.0.orig/configure.ac 2012-06-04 18:38:01.000000000 +0100
++++ cpl-7.0/configure.ac 2012-06-04 22:14:23.000000000 +0100
+@@ -60,8 +60,9 @@
+ AC_ENABLE_STATIC(yes)
+ AC_ENABLE_SHARED(yes)
+
+-AC_LIBLTDL_CONVENIENCE
+-AC_PROG_LIBTOOL
++LT_INIT([dlopen])
++LT_CONFIG_LTDL_DIR([libltdl])
++AC_LIB_LTDL
+ AC_SUBST(INCLTDL)
+ AC_SUBST(LIBLTDL)
+ AC_SUBST(LIBTOOL_DEPS)
+@@ -131,7 +135,6 @@
+ CPL_CONFIG_FUNC
+
+ # Configure subpackages
+-AC_CONFIG_SUBDIRS(libltdl)
+
+ if test ! x$"cpl_cv_with_system_cext" = xyes; then
+ AC_CONFIG_SUBDIRS([libcext])
+--- cpl-7.0.orig/Makefile.am
++++ cpl-7.0/Makefile.am
+@@ -25,11 +25,10 @@
+ DISTCLEANFILES = *~
+
+ if GASGANO_SUPPORT
+-libltdl = libltdl
+ cpljava = cpljava
+ endif
+
+-SUBDIRS = $(libltdl) $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
++SUBDIRS = $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
+
+ HTML_SUBDIRS =
+
diff --git a/sci-astronomy/cpl/metadata.xml b/sci-astronomy/cpl/metadata.xml
new file mode 100644
index 000000000000..c10d9ce830fc
--- /dev/null
+++ b/sci-astronomy/cpl/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ The Common Pipeline Library (CPL) comprises a set of ISO-C libraries
+ that provide a comprehensive, efficient and robust software
+ toolkit. It forms a basis for the creation of automated astronomical
+ data-reduction tasks (known as "pipelines"). CPL Title Graphic The CPL
+ was developed to standardise the way VLT instrument pipelines are
+ built, to shorten their development cycle and to ease their
+ maintenance. However, it may be more generally applied to any similar
+ application, and the details of the CPL code have been engineered in a
+ way to make the library portable and flexible, as well as minimising
+ external dependencies.
+</longdescription>
+<use>
+ <flag name="gasgano">
+ Enable support for <pkg>sci-astronomy/gasgano</pkg> file organizer
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/ds9-bin/Manifest b/sci-astronomy/ds9-bin/Manifest
new file mode 100644
index 000000000000..f64aae78aa16
--- /dev/null
+++ b/sci-astronomy/ds9-bin/Manifest
@@ -0,0 +1,10 @@
+DIST ds9.linux.7.2.tar.gz 11947450 SHA256 a8adbc5cca40700210ed86b53d8aa9eae2fbb29f7a8bd2a2a04b086a091724d8 SHA512 e85029625d981b2a3152dc61fab0ac11ac1bafd64705efc9788a4c3cffb14ddfe1e24635e6e38d0ba26643aa8e5e2f0290f2ecef8949f9eb4065e53af802de85 WHIRLPOOL 0d34d3d8fc17ce9310cbe18830f21cb99ea9a2d8c11fc7b9f94c4fc83e7cd7ada638794e8f632f831498242fe3917981450f653e236ca3c3c7fe8b9186ec05f9
+DIST ds9.linux.7.4.tar.gz 12066575 SHA256 04c454eb6a3bf3cfcfef5ea078d2c99fac1833c0e391ce4a9b0eb76fe88cb6f7 SHA512 f56b6ca4ff67cd7163bba300500e1fa55a58185a09c0e41a33fd8f33f8aa393e07e58cb1bd48c39f558f0038180ee38129f3ad421743cdadddc3115f00c0cf64 WHIRLPOOL 35cc5269e2c793fb2eb56a6449603976597ab5164fd356ce5540501f201b3844a8dc845444db62eb8bf36a761ebc54a5e9cb065041ec79ca5d82cc3dc34c6155
+DIST ds9.linux64.7.2.tar.gz 12683459 SHA256 34b01e1b25673d15e8ec01c05ce629cc2699fe4b9ec071c7ef95e82f5f5594e4 SHA512 af9368d05e94ab43dff9dcc0c791333ccd7865e7666238c46cb216176caeb12188363b45380c97af0cef0d1802ea26acdda7f1562dc168536dd9ddac6d7ebb97 WHIRLPOOL 42a58b7a764946b35e4133bf2b83e091fe20bb13a968efb0d18ef5d3b09f0c39a6fd80266e3f9623317536309736fcd9857edfd43b0f2509486963ea47b9262a
+DIST ds9.linux64.7.4.tar.gz 12555299 SHA256 55b0c6a3d1e8957b2abd007ef90378ce426a715aa033b47b576e907748924500 SHA512 dee66842b088881cee7dfcacb3cb220a71ef70ca3258afbe7ce7911a930c274fe5fc09487c4e54d2855179c80d940bf2e57a9b8a59ea0909ccc3213c92d81a65 WHIRLPOOL c7cc55f7f9ca1b54f81e38cf59f2fb674fb78d7110e165fbed13bc011623fcf22866a9082015e1e33c09ce9c6f513e608a7001b719a8d26977db92d5046c0a82
+DIST ds9.png.tar 10240 SHA256 a1a7c64b3de0374e04e06e7d7154d110bb518a6f5f95fd46e0a5a85ed5e1aa71 SHA512 c7d52733c63adcac00de652ac4be7a19e7a6497cf24cc6f7f78f0a9583cc94ce9c81e567af3c34f9124e15ee089abbd735c49b6cf8f2dcf6ea3cce6ed2c7302f WHIRLPOOL 055f4acf36c9e7994d7d17e3b151d65da1790a53a5d12d20714a942c7718a02e0aff138040c3566581a82023a4fd51870744ff82edf4eeeaefdc062927a099f6
+EBUILD ds9-bin-7.2.ebuild 940 SHA256 c66135114363a830c2995078f98c8f719a81b692f42bc43828b54691387138dc SHA512 e6129c90ebd179e5c1c50028e3fc13bda8c1914a33087ed337d77352874224dabd17fea78341b2ac37672c324bb89a1a956cfe7a79ade7c55470ab7a15854681 WHIRLPOOL 057b5f296f6543500d75319a635f253e045c46c751805c4099ba7b0f754177bec4f6cc873f703a72c4bd7a8020493f363bf932eb3a1a5b4bdcaafdf6b010e03c
+EBUILD ds9-bin-7.4.ebuild 907 SHA256 f99f07674036ca91c8d2f20aada9beb2cd5b9e738e97e2ee2e941c0e0d5cead8 SHA512 67a2ca954d1ada8d534bd0b0b2085e0e2aa8a56d95cdc258cb1d99f3926d3f95c0c8b697427eaf7cdce5117d6270f487be03673919565f1006c8fef9cc021bee WHIRLPOOL 64e1db19f464357dbfa07dad016d84cc686ec52224b5bd2e3b44ee5f32c06ba590fb5e2bd6567408967ea5c57f54cc58460361f38fc902b110664e50b8766350
+MISC ChangeLog 2696 SHA256 292b31129bf9f18685bec8464eee79e07c6c92f941da22ef6f18a90f29edd4cc SHA512 1b098d764d3eaa8dd31a8ed381739d4641e934623a00ff189244f985b4a3376e1de2352e16ce1a7cccda914e1cfb98132787fb03a2cbddcb823d7084619e7388 WHIRLPOOL 88cf3c063d84bed9194f060487fe3b07db6867d91cc85d755a00230bf8dffcf1ce3c1f1e9debdb14cdf5ff54a1ead41aa84dd68406817383c734c524086a7cf4
+MISC ChangeLog-2015 1022 SHA256 5ce5f1e22498ef870b0d09c26504ba0b35809b3a2f181e9a9948c9bdf8c7b9b5 SHA512 e64594fb576bcd631f8d436fed5a67dbebd5c524dc725ad52da784aaee50a50a9f4e216fd7b960ccb4dbff5e65c02779b63b2f8b6d88a62f72310bafa054e767 WHIRLPOOL ab072725abd5bcab75b4501caecd58884bbb754eac87755598b12e88c1e97849c97b42e3d266cf93257c0ed5235d795a120fd5de471ebd79596d5705c8c76ff3
+MISC metadata.xml 1038 SHA256 4534f34692e3222da3f234a66b1e4e0f91e5cf482feebb9962f9555bde05efe5 SHA512 fbb11c21fccdc5550a7815c463d192307e808d2ff7c1775e236bd398c508cfeb321b9dea6bd15720dcae75cb88bbcc6fd78789bbc5b985eccb35789488c79fd0 WHIRLPOOL 179068dbb7fa134f5db44bcd71ac17537886cb95ff10525f9c0c315d5db3912fa11fdbd1f0564ac79a53ba0e2608f42dd51811957b0910641608271514de9bd4
diff --git a/sci-astronomy/ds9-bin/ds9-bin-7.2.ebuild b/sci-astronomy/ds9-bin/ds9-bin-7.2.ebuild
new file mode 100644
index 000000000000..c472c726c45a
--- /dev/null
+++ b/sci-astronomy/ds9-bin/ds9-bin-7.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Data visualization application for astronomical FITS images"
+HOMEPAGE="http://hea-www.harvard.edu/RD/ds9"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/ds9.png.tar
+ amd64? ( http://hea-www.harvard.edu/RD/ds9/download/linux64/ds9.linux64.${PV}.tar.gz )
+ x86? ( http://hea-www.harvard.edu/RD/ds9/download/linux/ds9.linux.${PV}.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ dev-libs/libxml2
+ media-libs/fontconfig
+ media-libs/freetype
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXft
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/xpa"
+
+DEPEND=""
+S="${WORKDIR}"
+
+QA_PRESTRIPPED="usr/bin/ds9"
+QA_PREBUILT="usr/bin/ds9"
+
+src_install () {
+ dobin ds9
+ doicon ds9.png
+ make_desktop_entry ds9 "SAOImage DS9" ds9
+}
diff --git a/sci-astronomy/ds9-bin/ds9-bin-7.4.ebuild b/sci-astronomy/ds9-bin/ds9-bin-7.4.ebuild
new file mode 100644
index 000000000000..95bff1721725
--- /dev/null
+++ b/sci-astronomy/ds9-bin/ds9-bin-7.4.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Data visualization application for astronomical FITS images"
+HOMEPAGE="http://ds9.si.edu/site/Home.html"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/ds9.png.tar
+ amd64? ( http://ds9.si.edu/download/linux64/ds9.linux64.${PV}.tar.gz )
+ x86? ( http://hea-www.harvard.edu/RD/ds9/download/linux/ds9.linux.${PV}.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux"
+IUSE=""
+
+RDEPEND="
+ dev-libs/libxml2
+ media-libs/fontconfig
+ media-libs/freetype
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXft
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/xpa"
+
+DEPEND=""
+S="${WORKDIR}"
+
+QA_PRESTRIPPED="usr/bin/ds9"
+QA_PREBUILT="usr/bin/ds9"
+
+src_install () {
+ dobin ds9
+ doicon ds9.png
+ make_desktop_entry ds9 "SAOImage DS9" ds9
+}
diff --git a/sci-astronomy/ds9-bin/metadata.xml b/sci-astronomy/ds9-bin/metadata.xml
new file mode 100644
index 000000000000..2566f1d1abf8
--- /dev/null
+++ b/sci-astronomy/ds9-bin/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ The Smithsonian Astrophysical Observatory Image Deep Space 9 is an
+ astronomical imaging and data visualization application. It is the
+ new generation of the SAOImage software. DS9 supports FITS images
+ and binary tables, multiple frame buffers, region manipulation, many
+ scale algorithms and colormaps. It provides communication with
+ external analysis tasks and is configurable and extensible. DS9
+ supports multiple frame buffers, mosaic images, tiling, blinking,
+ geometric markers, colormap manipulation, scaling, arbitrary zoom,
+ rotation, pan, and a variety of coordinate systems. DS9 also
+ supports FTP and HTTP data access.
+ This is the binary version (source version has a lot of source
+ bundling issues).
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/erfa/Manifest b/sci-astronomy/erfa/Manifest
new file mode 100644
index 000000000000..cc384a93dfa1
--- /dev/null
+++ b/sci-astronomy/erfa/Manifest
@@ -0,0 +1,9 @@
+DIST erfa-1.2.0.tar.gz 305668 SHA256 efa60520bdad4c9df246d0bc4df8bf6bd9d01be1c5742540940996cf98ff783f SHA512 ead7a44b69048242cba34b0ab419eb97a1bcce6930d5834f5f00c8cae4cb331ee068cece08e51f918f7bd8eaaeada054006377876db01f7b7b4e86c26f17d311 WHIRLPOOL d360ec5d8f7d5db9c2706e82a04f62bba4fb120e0addb0b1522db30772572ebe3109ae62d12b869e323808ffeb176accab79c81fd27c94b3ec227cf2aa1b759d
+DIST erfa-1.3.0.tar.gz 640176 SHA256 b3e709206fbd65aa32de06fd690c5a886b97274eecc84ba9711a5a50efba7c92 SHA512 c8dc110e2d581d7de79d0406fb5873201a795e1d7ce8dcf642125082d78d1cb00dd3fe44b76e1b7249014314abd840ad24615ad9d13cd447505af2271c1f31bd WHIRLPOOL 7bd98cfb7ee9de832976b4571c50f40354198899a95546034f494a1cc510e4893239cc47bc968e6c7248a3ee353c2c7698d41614c0432df0c6e2ffe9af7f9f7d
+DIST erfa-1.4.0.tar.gz 641051 SHA256 035b7f0ad05c1191b8588191ba4b19ba0f31afa57ad561d33bd5417d9f23e460 SHA512 2befe5a45486dbbd2ee88229cce7a6101462254bd346d3a2859e294f31119eb5cf5e4113e4061fa3e371216ed793a79ea1ba98fc6fd8aa53d2ba4170e1e135e2 WHIRLPOOL 48bf7f252c6d4b8697d4676b1581edf8aac40d0ae799302df3502971c9d2567bddd177a0a25d1cbf346b52345d16f4938511298f971ac90f178692c0d89c0f7f
+EBUILD erfa-1.2.0.ebuild 439 SHA256 ff82f1aa2bb805f2114508bdb7f656dd29b344496aa970be88dc73dd6658dc17 SHA512 55ded11281e74b6e25bfd7ca17ced9f523500e1aa5134ea9559bf1200554800c3514428c92b3f9ee6af2cf4fb1307d3559f09c91efbe41909aeac9d7f6d474bf WHIRLPOOL faa2a3fc2c7b3292b982ff67298ca72df9f862e23c1841278222aaa01ccdc88a4610742ce9c463203cdaeac5fb9e49571f928e3824a856706dc386a612b00f34
+EBUILD erfa-1.3.0.ebuild 573 SHA256 d665813f763426978b048079a3affaaa5a5162328003aea1018a497b16487931 SHA512 c8da27b5018c65bd1faa626de3bb94beab1cd0d5438fa89059f35a05a6102f516a345674e9b5e058484d8c3e1d2b2f719ff6b06a54a05a8551a6df7a0386896a WHIRLPOOL 67eb0568a61acee77c93d5cfa965695948d83c99fb3476d387018664d8234ec1353af66819edff3c6b34149d07147e235374e4762040c4310ffa621d586446d4
+EBUILD erfa-1.4.0.ebuild 573 SHA256 7932d2ed686ddc8c958ca9c414d096b0f77ae24528e89fd8dcba392121b610b4 SHA512 a4b1c656afd2d456d52eae0334c812ce03741beab8379dcd490991911bf178682c03cc5751b90f000f2d65c1853f1ea1243a90d9709d762b966f5df281df7a9a WHIRLPOOL 1ed986f607a314e685ea0964731c67769ad57c661c9812e2307a564f56ea55eef2201c08242d1fb74ba6328e8e4dc575c4a81cd11c386de0d6d0a0518708e64a
+MISC ChangeLog 2665 SHA256 5605b1eb0a5b2a165dfe57bc6df972be223586b53b33f178ee4793925d97f82c SHA512 826258fd4714ecb84eeac98ec35cf20a5e12d897cab46e09f634906a6e809dc78c54878ca6076a7b9f628f97021858df50022d7adea16b0c18be3d69fd302200 WHIRLPOOL a1503bf05152f033e62b8445234be53a49c2eb6cf0080fceb1105c907f16bf23b9c212a9a1b99f1979dc3adc4800b7307e658a4a104cde1b6ee7659a5ce4bf52
+MISC ChangeLog-2015 465 SHA256 fa42a1c8c9c2177a5716203fda3a562ab8c6b4eb2069390f6160589294df7d35 SHA512 50b44d8dc99d2caf3f8a295bbc8b17c90b92830598fee57094a55692f40adf9bcda01551ac8e27c20268cad4b9c99f23524ecc9660f8bff81cb454647656abd6 WHIRLPOOL 83131a7431e2c0c8866fe347e9820bfbf66c538f549b3ab7cf26dc722babb7a42b9581744088da74a4bf3b2665a2a14bffaf3ab21d32fcbe74d4183ff6d38679
+MISC metadata.xml 600 SHA256 60f797007bc6d77ff7661d7c60b61f637f2ef3181eb098dd4a205a4f2cd6cfd3 SHA512 f217013885b91c2827c44a0e138ac23e44b6ff39ee2b420ccfde859d34ea16f8d94c97bd125b0151efb41990011d623727ae9c7c3963d443c16a9af15eba1c29 WHIRLPOOL 66f1922e75a1778a0ba7603ab7a1b25651773bc2ac7c96aa977e55c957328d450ccc9695be7206a9fd66ba649703b2a294a0a770041ff920e94ea2ef02cb0f65
diff --git a/sci-astronomy/erfa/erfa-1.2.0.ebuild b/sci-astronomy/erfa/erfa-1.2.0.ebuild
new file mode 100644
index 000000000000..038873c3848b
--- /dev/null
+++ b/sci-astronomy/erfa/erfa-1.2.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils
+
+DESCRIPTION="Essential Routines for Fundamental Astronomy"
+HOMEPAGE="https://github.com/liberfa/erfa"
+SRC_URI="https://github.com/liberfa/erfa/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/1"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
diff --git a/sci-astronomy/erfa/erfa-1.3.0.ebuild b/sci-astronomy/erfa/erfa-1.3.0.ebuild
new file mode 100644
index 000000000000..ca155e99c48a
--- /dev/null
+++ b/sci-astronomy/erfa/erfa-1.3.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="Essential Routines for Fundamental Astronomy"
+HOMEPAGE="https://github.com/liberfa/erfa"
+SRC_URI="https://github.com/liberfa/erfa/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/1"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="static-libs"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/sci-astronomy/erfa/erfa-1.4.0.ebuild b/sci-astronomy/erfa/erfa-1.4.0.ebuild
new file mode 100644
index 000000000000..6a721cbc58f4
--- /dev/null
+++ b/sci-astronomy/erfa/erfa-1.4.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="Essential Routines for Fundamental Astronomy"
+HOMEPAGE="https://github.com/liberfa/erfa"
+SRC_URI="https://github.com/liberfa/erfa/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/1"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="static-libs"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/sci-astronomy/erfa/metadata.xml b/sci-astronomy/erfa/metadata.xml
new file mode 100644
index 000000000000..0cab3847c4ed
--- /dev/null
+++ b/sci-astronomy/erfa/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Essential Routines for Fundamental Astronomy is a C
+ library containing key algorithms for astronomy, and is based on
+ the SOFA library published by the International Astronomical Union
+ (IAU).
+</longdescription>
+ <upstream>
+ <remote-id type="github">liberfa/erfa</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/esomidas/Manifest b/sci-astronomy/esomidas/Manifest
new file mode 100644
index 000000000000..20af240b600f
--- /dev/null
+++ b/sci-astronomy/esomidas/Manifest
@@ -0,0 +1,8 @@
+AUX esomidas-17.02-gentoo-setup.patch 369 SHA256 d6d646c812fc9e7c8a8418cbdfccce89c47355d9fa1e7ea8a6b03647749d652a SHA512 e55aac27cfa0034d9fdeb7f91e010a70f058fff00ed39858badd7b4561fefbb366c5ff0aba6a6265f2af4ab23ebca75e37c7067278688874c3294d583bfa2dfc WHIRLPOOL 00cca5f14f6c832d9f992854aecd195d5946535613ac4947bd9c977a89ecf1d07b0be14fd8b1ddf8a1e0c64779e4261451b8ed6b3f9ded042e79a92ac17d2a30
+AUX esomidas-17.02-output_to_stdout.patch 1276 SHA256 c3478db49a6aa2ad83fd9d98c7c5464b1435717a0b7aa9b882c1598661a98bde SHA512 b97402212ba45e45220ecf0bb4e8374c24c02dae554a686716b3de6fd3b40825df7150d0da7a389100176cadca2f29f1419a01efc763042d8b1f81f679ded057 WHIRLPOOL 4065e50a854208f47727344ef91f2cf42f572812932df31056ee7a8091b42c5f7c1f50c7607578b0727ed26fe3f4b235a20fc722ebeb4585ac6b13273f58ecf2
+AUX esomidas-17.02-rpc.patch 1300 SHA256 489583f4c642e79ba178bc57925f6fcd86441e8924046c78adff245ed3d5985e SHA512 5ecc989ef8f1ed6c1aa586088f1d1e880020f2ff134d21162563c66c3cc631ebf6deb3b3dfc7ebe0901385e548981df907264ad1b49a7638dd4e5917d40e2c7f WHIRLPOOL d686979ab18d92e46ce1826ba45af3c49d764347953dcf01e007526a7a8944575c53f37ac79c4d568e41c5c2c089181121e98123482adcc1e28742f7081a2ecf
+DIST esomidas-17.02.tar.gz 60771186 SHA256 27254dca5cd07562408d8fefb9c907a42c733c95c3010cc1a28cb9919ab48c68 SHA512 7e4c6a8d8349a9e1647e48571bf5e04abd239c24020ffdf5984a0598b837061ca7765e31209869a4e302e1f85c3494852a22541149c10cc916376048e40b6324 WHIRLPOOL 80334f8c2afb34e6d203c49386a9e4b7449ba16abebf75885a29bcdd03012b81cafba675beebc549a6c07f4787b9efd678c7a18ffac56046e8424648d9629104
+EBUILD esomidas-17.02-r1.ebuild 4385 SHA256 9e8c5978ef14a8c3d6ce3d4239e1de71227e079dd23644e3c8cbb96b0adbae48 SHA512 02f37170fb111d44d27df9cb17d959394246ebefae8640874696cfad947ec0abb56e92a8cbe0a4e4f6b60e0e2cd8ab7a6a892ec0515ec37e1de01d53c35e8464 WHIRLPOOL 6d02c58080342c82e201a90c5c61e18824ba0a67e9d37754427c7a505ab03b555fd09cffb63953ef4a63c77c7296d56624f7e1c504d8391a28b5f1046cb48242
+EBUILD esomidas-17.02.ebuild 4079 SHA256 37572614717c8df663a4ca1831646cfea9ccae321f2c27b707c607670ae5e64c SHA512 e46706c68b972a350c7da7e3dfb54d5345537d73bc52d0d198fb1fb335560e26c37242763c82e1f0f8d1aab8a316dbcb985a729e6e8dd685446ddee144f7d12e WHIRLPOOL 891678f91120c84d2cef75deb634284410a86402a95b24528d76eb888644b5e8e02632d551abf99212b57818e7450eccf315b1b8a4d748d7d2de10aa106beb02
+MISC ChangeLog 1314 SHA256 3c1f0dcfa8374ddfa8d536fee8345abc29447e36260cddd362e472a5377d76be SHA512 ad181475ea3e01d2508810ac7f5ea488b609c17d6e743b0dc43457716d59eb1194512bfb739700899733cf64916a78660b48062af464eab3e4ca5a9088580865 WHIRLPOOL 47d7b98e5923d362b4a3e9057288b0036358d4a915911c697b9a8cba2a8623409ff5e4e0d4ba36ca5d06a13eb530013167858503b2aeab73ec2c142945376ee4
+MISC metadata.xml 804 SHA256 d0dd5a4d8711a3d03f2b6ac34ae7c24a13de464edb1ffcb4dea9b34c3bd5f9f3 SHA512 4fc8d19a3890666740112c29c01a63e0b766bff7fe73fa677b3066228e23e0eec1fa94cb02c0327a60aa17b163bf6c58cdee123b189d6bfa1bb51565aa4821a4 WHIRLPOOL d57833619d6c7692b08414a1058dc74d208f973c51a5a2c1b2043bbe94a6acc9b7ef38711338794991058d3b461c1e9e39fe0ea3d4d025fb5ce7481bae6f12b0
diff --git a/sci-astronomy/esomidas/esomidas-17.02-r1.ebuild b/sci-astronomy/esomidas/esomidas-17.02-r1.ebuild
new file mode 100644
index 000000000000..70312bb39753
--- /dev/null
+++ b/sci-astronomy/esomidas/esomidas-17.02-r1.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils fortran-2 toolchain-funcs flag-o-matic
+
+# MIDVERS is actually used by MIDAS configuration scripts
+export MIDVERS="17FEBpl1.2"
+
+DESCRIPTION="European Southern Observatory Munich Image Data Analysis System"
+HOMEPAGE="http://www.eso.org/projects/esomidas/"
+SRC_URI="ftp://ftp.eso.org/pub/midaspub/17FEB/sources/${MIDVERS}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/8"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="+libtirpc"
+
+RDEPEND="
+ sys-libs/readline:0=
+ x11-libs/motif:0=
+ x11-libs/libX11:=
+ x11-libs/libXt:=
+ !libtirpc? ( sys-libs/glibc[rpc(-)] )
+ libtirpc? ( net-libs/libtirpc )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MIDVERS}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-output_to_stdout.patch"
+ "${FILESDIR}/${P}-gentoo-setup.patch"
+ "${FILESDIR}/${P}-rpc.patch"
+)
+
+src_prepare() {
+ default
+ # variables for all phases and midas internal build system
+ export MIDASHOME="${WORKDIR}"
+ export MID_HOME="${S}"
+ export MID_HOME0="/usr/$(get_libdir)/esomidas/${MIDVERS}"
+ export MID_INSTALL="${MID_HOME}/install/unix"
+ export MID_SYS="${MID_HOME}/system/unix/"
+ export MID_WORK="${MIDASHOME}/midwork"
+
+ # sadly this enforces static linking
+ if use libtirpc ; then
+ RPC_OPT="-I/usr/include/tirpc"
+ RPC_LIB="-ltirpc"
+ else
+ RPC_OPT=""
+ RPC_LIB=""
+ fi
+
+ # create a gentoo option file
+ mkdir ${MID_INSTALL}/systems/Gentoo || die
+ cat >> ${MID_INSTALL}/systems/Gentoo/make_options <<-EOF
+ CC=$(tc-getCC)
+ LDCC=$(tc-getCC)
+ F77=$(tc-getFC)
+ FC=$(tc-getFC)
+ LD77_CMD=$(tc-getFC)
+ AR=$(tc-getAR)
+ RANLIB=$(tc-getRANLIB)
+ F_OPT=
+ C_OPT=
+ E_OPT=$(use amd64 && echo -Z)
+ SYS=
+ SH_OPT=-fPIC
+ SH_CMD=${MIDASHOME}/${MIDVERS}/local/make_shared
+ GUI_OPT=-DPATH_MAX=1024
+ STRIP=echo
+ EDITFLAGS=-DVOID_SIGHANDLER -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_GETPW_DECLS -DHAVE_DIRENT_H -DHAVE_STRING_H -DLinux -DHAVE_UNISTD_H -DHAVE_STDLIB_H
+ EDITLIBS=-lreadline
+ UIMX=uimxR5
+ INSTALL_FLAG=auto
+ RPC_OPT=${RPC_OPT}
+ RPC_LIB=${RPC_LIB}
+ EOF
+ sed -e "s|gcc|$(tc-getCC) \${LDFLAGS}|" \
+ ${MID_INSTALL}/systems/Linux/make_shared \
+ > ${MID_INSTALL}/systems/Gentoo/make_shared || die
+ sed -e 's|PC/Linux|Gentoo|' \
+ ${MID_INSTALL}/systems/Linux/setup \
+ > ${MID_INSTALL}/systems/Gentoo/setup || die
+
+ # gentoo readline avoids exporting the xmalloc,xrealloc and xfree
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+}
+
+src_configure() {
+ ${MID_INSTALL}/select all || die "packages selection failed"
+ ${MID_INSTALL}/preinstall -a || die "preinstallation failed"
+ ${MID_INSTALL}/install2 || die "configuration failed"
+ chmod 755 ${MID_HOME}/local/make_shared
+}
+
+src_compile() {
+ CMND_YES=2 ${MID_INSTALL}/install3 -a || die "compilation failed"
+ [[ -x ${MID_HOME}/monit/midasgo.exe ]] || die "somewhere compilation failed"
+ emake -C monit syskeys.unix
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ compile.all"
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ ascii_bin no ; bye"
+}
+
+src_test() {
+ local test_dir="${WORKDIR}/test_tmp"
+ mkdir ${test_dir} && cd ${test_dir}
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ vericopy ; @@ veriall -nodisplay ; bye" || die
+ test -f ${MID_WORK}/veriall_* || die "tests failed somewhere"
+ rm -rf ${test_dir}
+}
+
+src_install() {
+ yes | ${MID_SYS}/cleanmidas
+ find ${MID_HOME} \( \
+ -name "*.a" -o \
+ -name "makefile" -o \
+ -name "default.mk" -o \
+ -name "*.h" -o \
+ -name "*.inc" -o \
+ -name COPYING -o \
+ -name "*~" -o \
+ -name "*.mod" \) -delete
+ rm -rf ${MID_HOME}/libsrc/ftoc*
+ find ${MID_HOME} -type d -empty -delete
+
+ sed -e "s:^MIDVERS0=.*:MIDVERS0=${MIDVERS}:" \
+ -e "s:^MIDASHOME0=.*:MIDASHOME0=/usr/$(get_libdir)/esomidas:" \
+ -i ${MID_HOME}/system/unix/{inmidas,helpmidas,drs}
+
+ cd "${WORKDIR}"
+ dodir /usr/$(get_libdir)/esomidas
+ mv "${S}" "${ED}"${MID_HOME0}
+ chmod 0644 "${ED}"${MID_HOME0}/contrib/baches/*/*.fit \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.fmt \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.datorg \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.prg \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.README
+ find "${ED}"${MID_HOME0} -name \*.sh | xargs chmod 0755
+ chmod 0755 "${ED}"${MID_HOME0}/util/bench/brun
+
+ dosym ${MID_HOME0}/system/unix/inmidas /usr/bin/inmidas
+ dosym ${MID_HOME0}/system/unix/gomidas /usr/bin/gomidas
+ dosym ${MID_HOME0}/system/ftoc-new ${MID_HOME0}/system/good-ftoc
+}
diff --git a/sci-astronomy/esomidas/esomidas-17.02.ebuild b/sci-astronomy/esomidas/esomidas-17.02.ebuild
new file mode 100644
index 000000000000..acaa2eb1c23a
--- /dev/null
+++ b/sci-astronomy/esomidas/esomidas-17.02.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils fortran-2 toolchain-funcs flag-o-matic
+
+# MIDVERS is actually used by MIDAS configuration scripts
+export MIDVERS="17FEBpl1.2"
+
+DESCRIPTION="European Southern Observatory Munich Image Data Analysis System"
+HOMEPAGE="http://www.eso.org/projects/esomidas/"
+SRC_URI="ftp://ftp.eso.org/pub/midaspub/17FEB/sources/${MIDVERS}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/8"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+RDEPEND="
+ sys-libs/readline:0=
+ x11-libs/motif:0=
+ x11-libs/libX11:=
+ x11-libs/libXt:="
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MIDVERS}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-output_to_stdout.patch"
+ "${FILESDIR}/${P}-gentoo-setup.patch"
+)
+
+src_prepare() {
+ default
+ # variables for all phases and midas internal build system
+ export MIDASHOME="${WORKDIR}"
+ export MID_HOME="${S}"
+ export MID_HOME0="/usr/$(get_libdir)/esomidas/${MIDVERS}"
+ export MID_INSTALL="${MID_HOME}/install/unix"
+ export MID_SYS="${MID_HOME}/system/unix/"
+ export MID_WORK="${MIDASHOME}/midwork"
+
+ # create a gentoo option file
+ mkdir ${MID_INSTALL}/systems/Gentoo || die
+ cat >> ${MID_INSTALL}/systems/Gentoo/make_options <<-EOF
+ CC=$(tc-getCC)
+ LDCC=$(tc-getCC)
+ F77=$(tc-getFC)
+ FC=$(tc-getFC)
+ LD77_CMD=$(tc-getFC)
+ AR=$(tc-getAR)
+ RANLIB=$(tc-getRANLIB)
+ F_OPT=
+ C_OPT=
+ E_OPT=$(use amd64 && echo -Z)
+ SYS=
+ SH_OPT=-fPIC
+ SH_CMD=${MIDASHOME}/${MIDVERS}/local/make_shared
+ GUI_OPT=-DPATH_MAX=1024
+ STRIP=echo
+ EDITFLAGS=-DVOID_SIGHANDLER -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_GETPW_DECLS -DHAVE_DIRENT_H -DHAVE_STRING_H -DLinux -DHAVE_UNISTD_H -DHAVE_STDLIB_H
+ EDITLIBS=-lreadline
+ UIMX=uimxR5
+ INSTALL_FLAG=auto
+ EOF
+ sed -e "s|gcc|$(tc-getCC) \${LDFLAGS}|" \
+ ${MID_INSTALL}/systems/Linux/make_shared \
+ > ${MID_INSTALL}/systems/Gentoo/make_shared || die
+ sed -e 's|PC/Linux|Gentoo|' \
+ ${MID_INSTALL}/systems/Linux/setup \
+ > ${MID_INSTALL}/systems/Gentoo/setup || die
+
+ # gentoo readline avoids exporting the xmalloc,xrealloc and xfree
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+}
+
+src_configure() {
+ ${MID_INSTALL}/select all || die "packages selection failed"
+ ${MID_INSTALL}/preinstall -a || die "preinstallation failed"
+ ${MID_INSTALL}/install2 || die "configuration failed"
+ chmod 755 ${MID_HOME}/local/make_shared
+}
+
+src_compile() {
+ CMND_YES=2 ${MID_INSTALL}/install3 -a || die "compilation failed"
+ [[ -x ${MID_HOME}/monit/midasgo.exe ]] || die "somewhere compilation failed"
+ emake -C monit syskeys.unix
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ compile.all"
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ ascii_bin no ; bye"
+}
+
+src_test() {
+ local test_dir="${WORKDIR}/test_tmp"
+ mkdir ${test_dir} && cd ${test_dir}
+ ${MID_SYS}/inmidas -m ${MID_WORK} -j "@ vericopy ; @@ veriall -nodisplay ; bye" || die
+ test -f ${MID_WORK}/veriall_* || die "tests failed somewhere"
+ rm -rf ${test_dir}
+}
+
+src_install() {
+ yes | ${MID_SYS}/cleanmidas
+ find ${MID_HOME} \( \
+ -name "*.a" -o \
+ -name "makefile" -o \
+ -name "default.mk" -o \
+ -name "*.h" -o \
+ -name "*.inc" -o \
+ -name COPYING -o \
+ -name "*~" -o \
+ -name "*.mod" \) -delete
+ rm -rf ${MID_HOME}/libsrc/ftoc*
+ find ${MID_HOME} -type d -empty -delete
+
+ sed -e "s:^MIDVERS0=.*:MIDVERS0=${MIDVERS}:" \
+ -e "s:^MIDASHOME0=.*:MIDASHOME0=/usr/$(get_libdir)/esomidas:" \
+ -i ${MID_HOME}/system/unix/{inmidas,helpmidas,drs}
+
+ cd "${WORKDIR}"
+ dodir /usr/$(get_libdir)/esomidas
+ mv "${S}" "${ED}"${MID_HOME0}
+ chmod 0644 "${ED}"${MID_HOME0}/contrib/baches/*/*.fit \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.fmt \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.datorg \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.prg \
+ "${ED}"${MID_HOME0}/contrib/baches/*/*.README
+ find "${ED}"${MID_HOME0} -name \*.sh | xargs chmod 0755
+ chmod 0755 "${ED}"${MID_HOME0}/util/bench/brun
+
+ dosym ${MID_HOME0}/system/unix/inmidas /usr/bin/inmidas
+ dosym ${MID_HOME0}/system/unix/gomidas /usr/bin/gomidas
+ dosym ${MID_HOME0}/system/ftoc-new ${MID_HOME0}/system/good-ftoc
+}
diff --git a/sci-astronomy/esomidas/files/esomidas-17.02-gentoo-setup.patch b/sci-astronomy/esomidas/files/esomidas-17.02-gentoo-setup.patch
new file mode 100644
index 000000000000..f6fb0515ee74
--- /dev/null
+++ b/sci-astronomy/esomidas/files/esomidas-17.02-gentoo-setup.patch
@@ -0,0 +1,12 @@
+--- a/install/unix/preinstall 2017-06-29 23:49:01.295996178 +0000
++++ b/install/unix/preinstall 2017-06-29 23:50:21.835445329 +0000
+@@ -124,6 +124,9 @@
+ if [ -d "Debian" -a -f "/etc/debian_version" ]; then
+ system="Debian"
+
++elif [ -d "Gentoo" -a -f "/etc/gentoo-release" ]; then
++ system="Gentoo"
++
+ elif [ "$uname" = "Darwin" ]; then
+ system="Darwin"
+
diff --git a/sci-astronomy/esomidas/files/esomidas-17.02-output_to_stdout.patch b/sci-astronomy/esomidas/files/esomidas-17.02-output_to_stdout.patch
new file mode 100644
index 000000000000..bd24c3801d99
--- /dev/null
+++ b/sci-astronomy/esomidas/files/esomidas-17.02-output_to_stdout.patch
@@ -0,0 +1,42 @@
+From: Ole Streicher <debian@liska.ath.cx>
+Date: Wed, 1 Mar 2017 09:31:31 +0100
+Subject: Run compilation in foreground and write log to stdout instead of a
+ file.
+
+---
+ install/unix/install3 | 14 ++------------
+ 1 file changed, 2 insertions(+), 12 deletions(-)
+
+diff --git a/install/unix/install3 b/install/unix/install3
+index ef2a415..1cc0b4e 100755
+--- a/install/unix/install3
++++ b/install/unix/install3
+@@ -112,8 +112,6 @@ fi
+
+ echo ""
+ echo "WARNING: MIDAS installation will delete all dependent files."
+-echo " It will run in background and the output will be sent to"
+-echo " the file <$MID_HOME/tmp/install.$$>"
+ echo ""
+ echo "Do you want to continue [yn]? (y): " $SV_NONL
+ unset answ
+@@ -138,17 +136,9 @@ fi
+
+ # do we have the 'time' command?
+ if [ $CMND_YES = 2 ] ; then
+- /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
++ /bin/bash $MID_INSTALL/install -i
+ else
+- time /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
++ time /bin/bash $MID_INSTALL/install -i
+ fi
+
+-echo "Running install in background"
+-echo "Results are coming in $MID_HOME/tmp/install.$$"
+-if [ "$1" = "-a" ]; then
+- echo "Waiting for MIDAS installation to finish..." $SV_NONL
+- wait
+- echo "Finished."
+- echo ""
+-fi
+ exit 0
diff --git a/sci-astronomy/esomidas/files/esomidas-17.02-rpc.patch b/sci-astronomy/esomidas/files/esomidas-17.02-rpc.patch
new file mode 100644
index 000000000000..d56ec03346c9
--- /dev/null
+++ b/sci-astronomy/esomidas/files/esomidas-17.02-rpc.patch
@@ -0,0 +1,33 @@
+diff -ruN 17FEBpl1.2.orig/lib/makefile 17FEBpl1.2/lib/makefile
+--- 17FEBpl1.2.orig/lib/makefile 2017-04-26 11:44:02.000000000 +0200
++++ 17FEBpl1.2/lib/makefile 2017-09-25 21:08:51.359595847 +0200
+@@ -58,7 +58,7 @@
+ ## Ubuntu version 13.10 on
+ ##
+ ## $(SH_CMD) -o $(LIBMIDAS_SH) *.o $(DEV_NULL)
+- $(SH_CMD) -o $(LIBMIDAS_SH) *.o -lm $(F2C_LIBS) $(DEV_NULL)
++ $(SH_CMD) -o $(LIBMIDAS_SH) *.o -lm $(F2C_LIBS) $(RPC_LIB) $(DEV_NULL)
+
+ # for the AltLinux distro we had to change the line above to:
+ # $(SH_CMD) -o $(LIBMIDAS_SH) *.o -lm $(DEV_NULL)
+diff -ruN 17FEBpl1.2.orig/libsrc/os/unix/makefile 17FEBpl1.2/libsrc/os/unix/makefile
+--- 17FEBpl1.2.orig/libsrc/os/unix/makefile 2017-04-26 11:44:32.000000000 +0200
++++ 17FEBpl1.2/libsrc/os/unix/makefile 2017-09-25 21:08:48.747583816 +0200
+@@ -19,7 +19,7 @@
+
+ include ../../../local/default.mk
+
+-CFLAGS += $(C_OPT) $(DEBUG) $(MEM_OPT) $(SH_OPT) $(OSSYS) $(SYS) -I$(INC)
++CFLAGS += $(C_OPT) $(DEBUG) $(MEM_OPT) $(SH_OPT) $(OSSYS) $(SYS) -I$(INC) $(RPC_OPT)
+
+ LIB = $(LIBDIR)/libos.a
+
+@@ -43,7 +43,7 @@
+ # testos.exe only for checking the linking process, in cannot be executed...
+
+ testos.exe: testos.o $(LIB)
+- $(LDCC) testos.o $(LIB) $(MLIB) $(SLIB) -o $@
++ $(LDCC) testos.o $(LIB) $(MLIB) $(SLIB) $(RPC_LIB) -o $@
+ $(STRIP) $@
+
+ $(LIB): $(OBJ)
diff --git a/sci-astronomy/esomidas/metadata.xml b/sci-astronomy/esomidas/metadata.xml
new file mode 100644
index 000000000000..8e581953fd75
--- /dev/null
+++ b/sci-astronomy/esomidas/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ The ESO-MIDAS system provides general tools for image processing and data
+ reduction with emphasis on astronomical applications including imaging and
+ special reduction packages for ESO instrumentation at La Silla and the VLT at
+ Paranal. In addition it contains applications packages for stellar and
+ surface photometry, image sharpening and decomposition, statistics and
+ various others.
+</longdescription>
+<use>
+ <flag name="libtirpc">Build against <pkg>net-libs/libtirpc</pkg> for RPC support</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/esorex/Manifest b/sci-astronomy/esorex/Manifest
new file mode 100644
index 000000000000..9c38d1703a93
--- /dev/null
+++ b/sci-astronomy/esorex/Manifest
@@ -0,0 +1,14 @@
+AUX esorex-3.10-generate-manpage.patch 4865 SHA256 ca69cc20e5291dce3fe2bec20ee7ef4929f98c7a635208ff0e2d1a8645eb755c SHA512 5a2aeb18e08f36969d439f999f76933030b6a462b8e10041f20d3ffccefdf04f68daeecaaab7ee1694a0127bfe570cd0db8fbf9ced17a484eac2023929aff2b8 WHIRLPOOL 2314b9a10406d9c7ff695e9626dceade5670597dd7cfabf3a53f9016ae875c6e5263dd9040ce157a2cca88c2c3da5632175a3bdb97b59d36c27ddb5cc75dc9c9
+AUX esorex-3.10-remove-empty-configdir.patch 400 SHA256 03a89a4072b52c85866f5cb601d7f71a51fbe4cda9e5fba07a8e3c76bae37a3f SHA512 24c2893f47c779368f72a01b00088e1dccb830797a7c3c094b48dda833770b37b9d98f8a7068d1d12e0a88182b0649e0418cb24c5f597cfb2467caee9e1d0f14 WHIRLPOOL bc3d5001dfb179d3b494d90620942656b4d6ecf5aaed3dbdb37001286a4852540e882d45aeb6f4d06a0fbace40482a7855de3640c65a233f3660e7a03fd8ea61
+AUX esorex-3.10-remove-private-ltdl.patch 1053 SHA256 d7dd4f889409e28c510b0f11d6d6d1efd75fd5e7fcad96b22700c6be60bd6b4e SHA512 039e6147d6ccb08cbde344ca21628e03bc039bd16ea9edc2cc5d5cea60f5478166f5f82b60b63fcfc71a6bf003510071d11b4882ef0c3cd3ba01c4a7d914d520 WHIRLPOOL 5d3ac2162d067af71e6c9231bd4a07b2eafaf8d96cb7be347b666ed1e12b760844cde4ca3fdbd0272c5fc33248e6a52ec18cc156411710d0d949565b38beb4fd
+AUX esorex-3.10-set-default-plugin-path.patch 951 SHA256 d39d57620e1c38d5167f0003c9ea4b5ce8c870f82a764b2e7d90ed5a69989a2a SHA512 004ebad285f4bc8eac0917ccdd1ab22563f73926b276e5ce2c469e144a6f7d6f2310c098904aeab73e88d57886147dcfae7704ec54a3b5ef86005a58f6f41829 WHIRLPOOL 3255a3a63d315895c0afa07011cc6c4f1d0191a4c39afc8b1c244cf1f868104cd4af9a5f49bb1cd3bba513ebb66f99b34721398bbcce8d0759bec8e53a0030c4
+AUX esorex-3.9.6-use-shared-libs.patch 562 SHA256 1a8922317e93d5840144b79d84e93b7ca329da9aa0e1872ad3493913e6975e90 SHA512 224ddaa94e1d7f105634f53b4238176ff84b2df0ebbfbfe8470fcb30182b4b3aa874ce002d98275488cf38128586e7dc7da0e26729db748e843ce661fa20930c WHIRLPOOL da69698daaf93607e8a4542dc35c2aaeb6b1327139927276bebca72e4788110c53e3b1aa88e7495b23ec4a1ba75fca1ce2efa34f82a4469a1366d7a393b96884
+DIST esorex-3.10.2.tar.gz 817875 SHA256 9a295754452b3e84fe2bc3674aaaf2e93354d2ad16781cb3f4c3f37ca0214e1e SHA512 6f6f663bd74d61f3612a13fb39e17c984f8ed88d9dd175951b385d9797433b19a6e276841b23b61881cec8702eb8d74061549a922acf939a9a5e98c8016d1ecb WHIRLPOOL cb900ecad2067498c9865cfbd3db4d80f0f2907ea18e8eb3ab5d07aaea2a184520a480ad62cf591a30abbe51023f8f8384139ca67fdd05d3a35cde837f730967
+DIST esorex-3.12.3.tar.gz 693894 SHA256 ac7bc9cec70a5bfa55f4ca29bac5bf30c853596503ab3238444c610e32b9233b SHA512 28d62b2cbb66e21fe96435fedf94a727c598b33f2d0aa9ff8d811cfc87edf8d215a76837f525d2964c24bb6e0a3b50aa4dcf2a8dcfae8ac1b933303f8fb08122 WHIRLPOOL eec3fa02ac776ffb333a0be8b6bdfa3ae4188516074112e54b6d8bf6d8527002243171e293f22245fb6c90fc1bf3f29aef5eff8eafcb48508bd24948475f4f1d
+DIST esorex-3.12.tar.gz 649290 SHA256 b99a11a93942543fd6c4e96975fa9f45e0e2c36412093c1be6ac37e545f1fd50 SHA512 02547d44cf93c570b2be6f429215efee95a2ef91a26b45fd0a5bfea3ec00837e04972f801c3c00a892eb8bb24b2e3aa8a854b4093844cfae0aed3bf0f396eac6 WHIRLPOOL 8c22a6afb7bd8ccabc5e6bc2b42bb414a4a0a0dada41c15686949e20d2bbdc5f473107221ecb5222b4b5d06db42af786d812a861076c93743612bca05ee5833f
+EBUILD esorex-3.10.2.ebuild 960 SHA256 2e7ed5ed2403f54282e5c7f8fd56f369703af55c674040583412867d10af2f69 SHA512 7cf51b8dcfe8148ff0e67afaa1a82d3d44d1746a603a0896d2c5878e6a8098f956f5d1d72a854907c7f51cf30e2db873776419472b0a5128a4c307316f9f97d9 WHIRLPOOL 578249c9ae4c35a7d4c8c2baec22db19a17904a99eeb89bfe636b26c980358c1b6e7ae9ca8f17821e45b5fc7e2051fb7cc216c3f42b1f268c23c80ae5d391ddc
+EBUILD esorex-3.12.3.ebuild 922 SHA256 60285b2524247339b6eb5655a545551f7c6cf4c12a961a6f46ec723edf6f9efb SHA512 42f2ea5dcaf421167f8d6cee13f2fa7559335cf74148ec6e1a410098330b455d451765273eee547c7d93624b35966ee61838ab5c83727eacbe7acbd6aa811d38 WHIRLPOOL cbc867931c6869831c2a6b37b292ca532046e5e985195d99c69ff4ff0adfd4b39d0a46e062f4655babb7cc8915ce9d71abdd5a070f41c2dd6da1c06b20194ea4
+EBUILD esorex-3.12.ebuild 922 SHA256 60285b2524247339b6eb5655a545551f7c6cf4c12a961a6f46ec723edf6f9efb SHA512 42f2ea5dcaf421167f8d6cee13f2fa7559335cf74148ec6e1a410098330b455d451765273eee547c7d93624b35966ee61838ab5c83727eacbe7acbd6aa811d38 WHIRLPOOL cbc867931c6869831c2a6b37b292ca532046e5e985195d99c69ff4ff0adfd4b39d0a46e062f4655babb7cc8915ce9d71abdd5a070f41c2dd6da1c06b20194ea4
+MISC ChangeLog 3194 SHA256 bcfd4f38cc29345b80f6e357ce4ee666bbd73ba2b7fb9cf92c4d1d928af3eaeb SHA512 27d76210236263ed93c40adbe67a637cb246ae07e2f58f0c1a40397fb3630fd0d50371ebf3eb339877fe152a58b95df5b029d9e02f07e863d1d62a90298ec137 WHIRLPOOL c6c06bc50372abca55c73324e93aaa23b53f97986d570b48376f88ad69ecbe647872c51338ede87ef2c9736a23a24b87390928e43e07aed9d2e331e3cbd701e5
+MISC ChangeLog-2015 3607 SHA256 bf7bc9265ff4521f5b544e64f2ca2cea114c7f927f2cbbcd90d9fb79f3277267 SHA512 c855e5f4656da51f2415634af6226fd459bc41093667d1532f6746cebeb1a99ebf9c481f398f08aaaa3d7683e4bb64c97c13318e15dcbcbf5f7ecbaae6092b92 WHIRLPOOL 09a5f08714a15a633ed7bda351c6309c94c89d3c742282c01d3c2f85def1701f22a78dfed9eacd4ed789220678f7e28aab519f6c5d0b3c40e2ed92f34476382d
+MISC metadata.xml 1020 SHA256 c95da969ce16ecb61d6c764c16470a0ef6fce68ce75212133f27484242a5e1b4 SHA512 6a8f1a8f0f098520103818d351ef6dd0c10ff6cb38c3ee9bf937a7c67e3bc10e0fc2648b8949735b4c65116b83676d354383e73b550d1828ca1cd276ae3d7c75 WHIRLPOOL b33b81113aafd78a86a90e0a2889bdbab28000cc03509875615bc13638a05828af00bfaf9dbeecf144fa919501a29a5dac21fc10fbe8ba1d0be5d4cd871bffe7
diff --git a/sci-astronomy/esorex/esorex-3.10.2.ebuild b/sci-astronomy/esorex/esorex-3.10.2.ebuild
new file mode 100644
index 000000000000..741a0b4ff28f
--- /dev/null
+++ b/sci-astronomy/esorex/esorex-3.10.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+AT_NO_RECURSIVE=1
+
+inherit autotools-utils
+
+DESCRIPTION="ESO Recipe Execution Tool to exec cpl scripts"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/esorex.html"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND=">=sci-astronomy/cpl-6.3:0="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.9.6-use-shared-libs.patch
+ "${FILESDIR}"/${PN}-3.10-remove-private-ltdl.patch
+ "${FILESDIR}"/${PN}-3.10-generate-manpage.patch
+ "${FILESDIR}"/${PN}-3.10-remove-empty-configdir.patch
+ "${FILESDIR}"/${PN}-3.10-set-default-plugin-path.patch
+)
+
+export CPLDIR="${EPREFIX}/usr"
+
+src_install() {
+ autotools-utils_src_install
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/esorex/esorex-3.12.3.ebuild b/sci-astronomy/esorex/esorex-3.12.3.ebuild
new file mode 100644
index 000000000000..270226cd7bb0
--- /dev/null
+++ b/sci-astronomy/esorex/esorex-3.12.3.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="ESO Recipe Execution Tool to exec cpl scripts"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/esorex.html"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND=">=sci-astronomy/cpl-6.3:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.9.6-use-shared-libs.patch
+ "${FILESDIR}"/${PN}-3.10-remove-private-ltdl.patch
+ "${FILESDIR}"/${PN}-3.10-generate-manpage.patch
+ "${FILESDIR}"/${PN}-3.10-remove-empty-configdir.patch
+ "${FILESDIR}"/${PN}-3.10-set-default-plugin-path.patch
+)
+
+export CPLDIR="${EPREFIX}/usr"
+
+src_prepare() {
+ default
+ AT_NO_RECURSIVE=1 eautoreconf
+}
+
+src_install() {
+ default
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/esorex/esorex-3.12.ebuild b/sci-astronomy/esorex/esorex-3.12.ebuild
new file mode 100644
index 000000000000..270226cd7bb0
--- /dev/null
+++ b/sci-astronomy/esorex/esorex-3.12.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="ESO Recipe Execution Tool to exec cpl scripts"
+HOMEPAGE="http://www.eso.org/sci/software/cpl/esorex.html"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND=">=sci-astronomy/cpl-6.3:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.9.6-use-shared-libs.patch
+ "${FILESDIR}"/${PN}-3.10-remove-private-ltdl.patch
+ "${FILESDIR}"/${PN}-3.10-generate-manpage.patch
+ "${FILESDIR}"/${PN}-3.10-remove-empty-configdir.patch
+ "${FILESDIR}"/${PN}-3.10-set-default-plugin-path.patch
+)
+
+export CPLDIR="${EPREFIX}/usr"
+
+src_prepare() {
+ default
+ AT_NO_RECURSIVE=1 eautoreconf
+}
+
+src_install() {
+ default
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/esorex/files/esorex-3.10-generate-manpage.patch b/sci-astronomy/esorex/files/esorex-3.10-generate-manpage.patch
new file mode 100644
index 000000000000..017eb2c8f776
--- /dev/null
+++ b/sci-astronomy/esorex/files/esorex-3.10-generate-manpage.patch
@@ -0,0 +1,123 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Subject: Generate a manpage for esorex.
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -62,3 +62,7 @@
+ include $(top_builddir)/Makefile.purify
+ endif
+
++esorex.man: esorex
++ sh esorex_create_man.sh
++
++man1_MANS = esorex.man
+--- /dev/null
++++ b/src/esorex_create_man.sh
+@@ -0,0 +1,108 @@
++#!/bin/sh
++
++help2man -N -i $0 ./esorex | sed s/^:\ // | fgrep -v "***" > esorex.man
++<< instrument.
++
++[NAME]
++esorex \- ESO Recipe Execution Tool
++
++[DESCRIPTION]
++EsoRex is the ESO Recipe Execution Tool. It can list, configure and execute
++CPL-based recipes from the command line.
++
++One of the features provided by the CPL is the ability to create
++data-reduction algorithms that run as plugins (dynamic libraries). These are
++called recipes and are one of the main aspects of the CPL data-reduction
++development environment.
++
++As these recipes are dynamic libraries, it is not possible to run them
++directly from the command line. However, ESO provides several tools to do
++this, thus saving recipe developers the need to write such an application
++themselves. One of these is GASGANO (a GUI-based tool) and the other is
++ EsoRex (which runs from the command line) and is described here.
++
++[ENVIRONMENT]
++All options can be set as environment parameters as well. See the previous
++paragraph for details.
++
++[HINTS]
++.TP
++.SH File permissions
++When a recipe is used with the \fB\-\-suppress\-prefix\fR option, and the
++\fB\-\-output\-dir\fR is set to the current working directory, then the first
++execution of a recipe will work correctly, but subsequent executions may
++fail. This is due to output products being given \`read-only\' permission
++(to avoid the potential inadvertant loss of products). The recipe itself
++is unable to modify the permissions, and thus it fails when attempting to
++create the file. The solution (other than using a different output directory
++or prefixes) is to change the permission of these output files or delete
++them prior to any subsequent execution of that recipe.
++
++This problem is less likely to occur in EsoRex v2+, due to the replacement of
++the \fB\-\-output\-overwrite\fR option with the \fB\-\-output\-readonly\fR
++(which is disabled by default). However, a determined user can still reach
++this situation, in which case the non-readable products must have their
++permissions changed, as described above.
++
++.TP
++.SH Configuration files
++When creating configuration files, if the the recipe is provided on the
++command line, then EsoRex will generate the configuration file for this
++recipe. If no recipe name is given, then EsoRex will generate a configuration
++file for EsoRex itself. All configuration files are written in the
++$HOME/.esorex/ directory.
++
++.TP
++.SH Memory checking
++It is possible to get EsoRex to check for memory leaks in the recipe
++that it is running, by enabling the \fB\-\-mem\-check\fR option. Then, at the
++conclusion of the recipe execution, and after memory deallocation, a list of
++all remaining allocated memory will be printed to screen. If there are no
++memory leaks, then no addition output is displayed.
++
++[FILES]
++.TP
++.SH /etc/esorex.rc $HOME/.esorex/esorex.rc
++Default configuration files
++
++The configuration file contains the EsoRex options, less the \`\-\-\'
++switch, but prefixed with \`esorex.caller.\'. Blank lines are ignored and
++lines beginning with \`#\' are treated as comments.
++
++Here is an example configuration file.
++
++ # Example EsoRex configuration file
++ #
++ esorex.caller.recipe-dir=/home/username/EsoRex/Plugins
++ esorex.caller.log-dir=.
++ esorex.caller.log-file=esorex.log
++ esorex.caller.log-file=esorex.log
++ esorex.caller.output-dir=.
++ esorex.caller.output-prefix=out_
++
++.TP
++.SH filename.sof
++A sof file contains a list of the input data. This data is specified in an sof
++file (which is just a text file), where each input file is specified with its
++associated classification and category. The format of each line in the sof
++file is as follows:
++
++ full-path-to-file classification
++
++Optionally, a third column may be provided. Permitted values are either RAW or
++CALIB. This is for when a recipe does not identify the type of input file, but
++as all ESO recipes are required to do so, this column is typically not needed.
++
++An example sof file, for the mythological "ZIMOS" instrument, might look like this:
++
++ /data/mos/ZIMOS.03-12-26T01:05:06.fits MOS_SCIENCE
++ /data/mos/ZIMOS.03-12-26T01:26:00.fits MOS_SCIENCE
++ /data/mos/ZIMOS.03-12-26T01:47:04.fits MOS_SCIENCE
++ /data/cal/master_bias4.fits MASTER_BIAS
++ /data/cal/grs_LR_red.3.tfits GRISM_TABLE
++ /data/gasgano/extract_table2.fits EXTRACT_TABLE
++ /data/cal/badpixel.3.tfits CCD_TABLE
++
++For an concrete example for a specific instrument, check the documentation for that
++instrument.
++
diff --git a/sci-astronomy/esorex/files/esorex-3.10-remove-empty-configdir.patch b/sci-astronomy/esorex/files/esorex-3.10-remove-empty-configdir.patch
new file mode 100644
index 000000000000..d492173da8eb
--- /dev/null
+++ b/sci-astronomy/esorex/files/esorex-3.10-remove-empty-configdir.patch
@@ -0,0 +1,13 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Description: Avoid creation of an empty directory "/usr/share/esorex/config"
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -51,8 +51,6 @@
+
+ bin_PROGRAMS = esorex
+
+-config_DATA =
+-
+ esorex_LDFLAGS = $(CPL_LDFLAGS) $(LIBLTDL)
+ esorex_LDADD = @GETOPT@ $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBLTDL)
+ esorex_DEPENDENCIES = @GETOPT@ $(LIBLTDL)
diff --git a/sci-astronomy/esorex/files/esorex-3.10-remove-private-ltdl.patch b/sci-astronomy/esorex/files/esorex-3.10-remove-private-ltdl.patch
new file mode 100644
index 000000000000..e675cdbb8f73
--- /dev/null
+++ b/sci-astronomy/esorex/files/esorex-3.10-remove-private-ltdl.patch
@@ -0,0 +1,39 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Subject: Remove private library libltdl and use the installed one.
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -37,10 +37,7 @@
+ if MAINTAINER_MODE
+
+ MAINTAINERCLEANFILES = $(top_srcdir)/Makefile.in $(top_srcdir)/aclocal.m4 \
+- $(top_srcdir)/config.h.in $(top_srcdir)/configure config.status config.log \
+- $(top_srcdir)/libltdl/Makefile.in $(top_srcdir)/libltdl/aclocal.m4 \
+- $(top_srcdir)/libltdl/config-h.in $(top_srcdir)/libltdl/configure \
+- libltdl/config.status libltdl/config.log
++ $(top_srcdir)/config.h.in $(top_srcdir)/configure config.status config.log
+
+ clean-local: clean-doxygen
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,7 +30,9 @@
+
+ ESO_CHECK_DOCTOOLS
+
+-AC_LIBLTDL_CONVENIENCE
++LT_INIT
++LT_CONFIG_LTDL_DIR([libltdl])
++AC_LIB_LTDL
+ AC_SUBST(INCLTDL)
+ AC_SUBST(LIBLTDL)
+
+@@ -76,9 +78,6 @@
+ # Determine the shared library suffix on this platform
+ AC_LTDL_SHLIBEXT
+
+-
+-AC_CONFIG_SUBDIRS(libltdl)
+-
+ AC_CONFIG_FILES(Makefile
+ Makefile.purify
+ doxygen/Doxyfile
diff --git a/sci-astronomy/esorex/files/esorex-3.10-set-default-plugin-path.patch b/sci-astronomy/esorex/files/esorex-3.10-set-default-plugin-path.patch
new file mode 100644
index 000000000000..1289bed5ab0d
--- /dev/null
+++ b/sci-astronomy/esorex/files/esorex-3.10-set-default-plugin-path.patch
@@ -0,0 +1,28 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Description: Set the default plugin path to the one where recipes are
+ installed in Debian.
+--- a/etc/esorex.rc.in
++++ b/etc/esorex.rc.in
+@@ -130,7 +130,7 @@
+ # as well. Multiple directory heads may be specified, by separating the
+ # starting paths with colons (:). This option may also be set using the
+ # environment variable ESOREX_PLUGIN_DIR.
+-esorex.caller.recipe-dir=@recipedir@/esopipes-plugins
++esorex.caller.recipe-dir=@recipedir@
+
+ # --suppress-link
+ # When TRUE, no symbolic link is created to the output product. However, if
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -35,7 +35,10 @@
+ AC_SUBST(configdir)
+
+ if test -z "$recipedir"; then
+- recipedir="`eval echo $libdir`"
++ recipedir="`eval echo $libdir`/cpl/plugins"
++ if test $libdir != "/usr/lib"; then
++ recipedir="$recipedir:/usr/lib/cpl/plugins"
++ fi
+ fi
+ AC_SUBST(recipedir)
+
diff --git a/sci-astronomy/esorex/files/esorex-3.9.6-use-shared-libs.patch b/sci-astronomy/esorex/files/esorex-3.9.6-use-shared-libs.patch
new file mode 100644
index 000000000000..0cd348eaa446
--- /dev/null
+++ b/sci-astronomy/esorex/files/esorex-3.9.6-use-shared-libs.patch
@@ -0,0 +1,20 @@
+--- esorex-3.9.6/m4/cpl.m4.orig 2012-06-04 23:47:50.000000000 +0100
++++ esorex-3.9.6/m4/cpl.m4 2012-06-04 23:48:45.000000000 +0100
+@@ -455,7 +455,7 @@
+ AC_MSG_CHECKING([for libcext])
+
+ cpl_cext_check_header="cxtypes.h"
+- cpl_cext_check_lib="libcext.a"
++ cpl_cext_check_lib="libcext.so"
+
+ cpl_cext_incdirs=""
+ cpl_cext_libdirs=""
+@@ -1314,7 +1314,7 @@
+ AC_MSG_CHECKING([for CPL])
+
+ cpl_check_cpl_header="cpl.h"
+- cpl_check_cpl_lib="libcplcore.a"
++ cpl_check_cpl_lib="libcplcore.so"
+
+ cpl_incdirs=""
+ cpl_libdirs=""
diff --git a/sci-astronomy/esorex/metadata.xml b/sci-astronomy/esorex/metadata.xml
new file mode 100644
index 000000000000..dec7e069f528
--- /dev/null
+++ b/sci-astronomy/esorex/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ EsoRex is the ESO Recipe Execution Tool. It can list, configure and
+ execute CPL-based recipes from the command line. One of the features
+ provided by the CPL is the ability to create data-reduction algorithms
+ that run as plugins (dynamic libraries). These are called recipes and
+ are one of the main aspects of the CPL data-reduction development
+ environment. As these recipes are dynamic libraries, it is not
+ possible to run them directly from the command line. However, ESO
+ provides several tools to do this, thus saving recipe developers the
+ need to write such an application themselves. One of these is GASGANO
+ (a GUI-based tool) and the other is EsoRex (which runs from the
+ command line.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/fitsh/Manifest b/sci-astronomy/fitsh/Manifest
new file mode 100644
index 000000000000..5a1dc9f203a9
--- /dev/null
+++ b/sci-astronomy/fitsh/Manifest
@@ -0,0 +1,3 @@
+DIST fitsh-0.9.2.tar.gz 596395 SHA256 3ce3ff89a0ad2b0c77d6fe22456e3b09972fcbce9370ce2d9664040e701c7539 SHA512 2a6e48b7dc684bf533b541d94dc5ead86166992763b7d0b78ec63916454a5aa515281babfab73c94bbc73b19c3de82e0f387548a4f01974f3593bbc8ddb15c61 WHIRLPOOL b77f411c6e0725b8714ad1b1fa4ea523a1420d936c174e61b81cb0cf759e5803649a3075c0389ee3ae17f3a0a09a166173d43dd9f728a261f1fb546bedf6cdeb
+EBUILD fitsh-0.9.2.ebuild 380 SHA256 919952f2947a5e02c0de4d1914b940c03d9120836a4620109e8eba1d5ae3ed1b SHA512 caee694f28f052e7ca95a210fb7233a8b7d5bd7d6e8f155d86e6e7b7422df511c4b1f516ecde557719833d8ccf91cd8b5f1f02e96868ec9556fd18de50ec91b1 WHIRLPOOL 07f7188244023b8a2adc8d793d6e66f301bdd1b9f086af29b96eeb1c4a4e3b1ae28688aa5233b5ade2c5dad702281ef911d7d5748115a70cc428e8a4f208ad81
+MISC metadata.xml 701 SHA256 84f3f0812e8fee4809140ccbb034a052ad67ddb7397b12652a519befe5f076ba SHA512 9b1dd5aa1da2bb55080f61c97d2ed445a89c15f8233be6388c0273e886393874548d16eab72619ae89f5fd6c8f22158af9d143c76a24f0b67fa3de9634477079 WHIRLPOOL a772021618a19ba892ef1b39b9ca65cb1783fab48daf65189841f4ca899062bf9d9e8c1064b01bb7e380b08507b5d52e980b7b722fa7cb9dea027899b8a4f3d9
diff --git a/sci-astronomy/fitsh/fitsh-0.9.2.ebuild b/sci-astronomy/fitsh/fitsh-0.9.2.ebuild
new file mode 100644
index 000000000000..86640da85703
--- /dev/null
+++ b/sci-astronomy/fitsh/fitsh-0.9.2.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Software package for astronomical image processing"
+HOMEPAGE="https://fitsh.net/"
+SRC_URI="https://fitsh.net/download/fitsh/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/sci-astronomy/fitsh/metadata.xml b/sci-astronomy/fitsh/metadata.xml
new file mode 100644
index 000000000000..2ededf5318bd
--- /dev/null
+++ b/sci-astronomy/fitsh/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The FITSH software package provides a set of independent binary
+ programs (called Tasks) that are designed for execution from a
+ UNIX command line shell or shell script. Each of these tasks
+ performs a specific operation, following the UNIX philosophy of
+ modular tools that performs a single step related to astronomical
+ data reduction and image processing.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/fitspng/Manifest b/sci-astronomy/fitspng/Manifest
new file mode 100644
index 000000000000..a3d7fb75d8f7
--- /dev/null
+++ b/sci-astronomy/fitspng/Manifest
@@ -0,0 +1,4 @@
+DIST fitspng-0.3.5.tar.gz 1124441 SHA256 0ee2bf9c79e0ef22b19a18d3d713fdeafcbcd2a0b70ef81cca146d2eba8592cb SHA512 268c93e88f1cee3aaddd7a0d157e221439b376ab4dae753ca6750ff7d02a4af7fe78a47d712965721e71fc80ebac8b2cb0e7f24097e7bb4f292655bdf7f6b60c WHIRLPOOL c2ccb97ad2397f5a7dfa2a9af20c877d42e6c89a7a94d2371b090e6b1d69c81b5c32ab0e78dafa6e763f5a5be3ed66913b285772b4134f6dd8cef1edbbdf7c1b
+EBUILD fitspng-0.3.5.ebuild 505 SHA256 8b7d3cc9f875c053cb1e7db9f9989d6be864142076aaec9cd6dedb61b85a10f6 SHA512 ff433c2f54c7e14243e71bf1299b51f47110b989f204410a31d45bde71be2a7f9ba5ece8dfe3d206e79de71ef65db75bc3f5fffd482a945f1ebbace651c84fd8 WHIRLPOOL 52c7e1d1539630fef941a5be1324b69adcdc6f26f8c7dbe8660b0823338d596d72778cfca7f41701b720b31c34859d80afaae285ab1fd22bf542bf5a776178d9
+MISC ChangeLog 322 SHA256 b8991b88759aad9cea7d739c2eecd702d5ae02cf181bf0d29fcb8ea2feae9d3e SHA512 83970b5154ab94eaa55e4447e296095746d99f17bcdb6ae1404d12fc543931b89e1fe4207f574617c5ad304f540d4534132af8daaa8617350db13bf68922684c WHIRLPOOL 742167a638f644d6f797ee83b70ff279d2f6fb823373e470b747b767bd561e0f9f2a214683fbb15fca2501d44c45732691ec1e2c3ceca0676813352a73b55715
+MISC metadata.xml 795 SHA256 9aaa4d0c198193f5ed31459c77614088f5a2cc292ff7fb75ce1bdce1d0f6a756 SHA512 e02b309c53da075dc34c087d8f32cc394591001d8935c79fda8fef58d6dd4210aa71b1a2befe90818874c9bb90fccc0fac1f8d1fa157e39033eb29446a71696e WHIRLPOOL 172d6269b81431b8cd95565a4d291bcb065fbba0fb2b26d64d7912bbf27d48147635aa14adb6c61324be9fa1e43834a3b4f65a7d46c815b4eb2429ebd380fe01
diff --git a/sci-astronomy/fitspng/fitspng-0.3.5.ebuild b/sci-astronomy/fitspng/fitspng-0.3.5.ebuild
new file mode 100644
index 000000000000..a99c1f1828a2
--- /dev/null
+++ b/sci-astronomy/fitspng/fitspng-0.3.5.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="FITS to PNG converter"
+HOMEPAGE="http://integral.physics.muni.cz/fitspng/"
+SRC_URI="ftp://integral.physics.muni.cz/pub/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND="
+ sci-libs/cfitsio:0=
+ media-libs/libpng:0="
+DEPEND="${RDEPEND}"
+
+src_install() {
+ default
+ use doc || rm -rf "${ED}"usr/share/doc/${PF}/html
+}
diff --git a/sci-astronomy/fitspng/metadata.xml b/sci-astronomy/fitspng/metadata.xml
new file mode 100644
index 000000000000..d276a40d6f69
--- /dev/null
+++ b/sci-astronomy/fitspng/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Fitspng is an utility intended to convert of the natural high
+ dynamic range of FITS images, directly representing measured data,
+ to the limited numerical range of PNG format widely used
+ in computer graphics. Fitspng implements a global tone mapping
+ technique by a set of tone functions using parameters provided
+ by user or by machine estimate on base of a robust count statistics.
+ Moreover, the conversion keeps an important FITS meta-information
+ as a text part of PNG header.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/funtools/Manifest b/sci-astronomy/funtools/Manifest
new file mode 100644
index 000000000000..5d4d04eb1a5c
--- /dev/null
+++ b/sci-astronomy/funtools/Manifest
@@ -0,0 +1,5 @@
+DIST funtools-1.4.7.tar.gz 3270079 SHA256 5388a7475e8c1fa92ff2429bf5de64212e79701dda6d24663bdab60293b63132 SHA512 d53bdb00a2eb9cd70bf60e34a10e5e16435a10b96f89cd55f0ffb686fac30438e2dfc1d823578286be51bee5caf0dcd1c0f257cd8e725cf8e5aa798a6f3c245a WHIRLPOOL e2928f6b193fea9509b7aaebff27ae1b5e48cf1005c4ddf1044d00dc62905ee3f8c5beacb8823ec0cc2c0c48becfff25fdbd2d2e8c1f7e99c95cc1e836a67a22
+EBUILD funtools-1.4.7.ebuild 1849 SHA256 f0d39e567b84184883e0e44d686e3780b098d55c674ebfc42de0a8eae60a1e56 SHA512 0b9f0dd6f35bad3e6e7dbd4ea9e386b26f65f5773785f594a965d5cf79a0871b66f10b640ecd15bae250410f78f64fb71cfb950011981a6f9d7a80b2e251cdb0 WHIRLPOOL 3ed125d336222b93fe2741497e16bd9c0efad1858f2aec7f82ae2d75eb1e22a2449f2652224440313b5caa48029f99683f32befe3094058ab041115d432c5732
+MISC ChangeLog 3253 SHA256 bb9fc00b1ac3d834973c6fb948f30c0309d680a44473bac12c4d5734c03e981b SHA512 a3b1017e734047ec4d8108c159df78f0504ec348ac8838374c1760c876defcce0abacf1230771765bddcf64a226bcd6f9f6546cf6cc9c3f1d726553a8384375f WHIRLPOOL d5c45ea1eeef8eb9d0f6263eb8848a0f976775c7f9c77dafb6d87b4bbf9ab3f5f8ed30ddd8cc78fda1fab949b5d2ed6273c102febeaa3abf825d2ff2fd9895d2
+MISC ChangeLog-2015 2490 SHA256 e92bc17ebe44a285f3cb5c8a75359cdaf021ae152fd9a30b2bf7ee5d76dd7bc6 SHA512 16a0735c3e521b27ebe0457042d1bef2bc9543955dd52403d225a9c80244a56041a384bb549e53febfecccf3aec5b2e9c208cc7f9d3f8d630d3ca1a3a665d6bd WHIRLPOOL 56e5877c50fb9ed82707cb115e89bbeca33f50e12d6a28dba18aae6e26634e78562e813731fb96b811fa4f57e98c53128c8326a38e2ea59db6bcf6ab5ca65d66
+MISC metadata.xml 729 SHA256 e20147ae5c75751d71a5241f4631885240c14e0210c91a38a95676174490edd7 SHA512 fd8156acb3dbfdd6c3d2120f70eba4c5d06d09d8dd4cafcb26ff6c1ea520ae51e9e1ee5fdefc4a7a03aee62b8bb521f37cabb781159121f3197cb44c4755fb35 WHIRLPOOL 87c7f9a7bc6dc2b9b0931bd03f3b48f4562173d8fdd4ddc331a9fa4394c7718b7175216f7368fdf18661257920f391e5ab8eecb8d230742cee0c2887f1ebff86
diff --git a/sci-astronomy/funtools/funtools-1.4.7.ebuild b/sci-astronomy/funtools/funtools-1.4.7.ebuild
new file mode 100644
index 000000000000..a9b6e77aa319
--- /dev/null
+++ b/sci-astronomy/funtools/funtools-1.4.7.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs autotools
+
+DESCRIPTION="FITS library and utlities for astronomical images"
+HOMEPAGE="https://github.com/ericmandel/funtools"
+SRC_URI="https://github.com/ericmandel/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc static-libs"
+
+RDEPEND="
+ dev-lang/tcl:0=
+ sci-astronomy/wcstools:0=
+ sci-visualization/gnuplot
+ sys-libs/zlib:0="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ default
+ # respect libdir, dont build wcs, respect toolchain
+ sed -e "/INSTALL/s|/lib|/$(get_libdir)|g" \
+ -e 's|${OBJS}|$(OBJS)|g' \
+ -e '/^SUBLIBS/s|wcs||g' \
+ -e 's/mkdir/mkdir -p/g' \
+ -e '/mklib/s|-o $(PACKAGE)|-o $(PACKAGE) $(LIBS)|g' \
+ -e "s| ar| $(tc-getAR)|g" \
+ -e "s|ar cruv|$(tc-getAR) cruv|g" \
+ -e "s|WCS_INC.*=.*|WCS_INC = $($(tc-getPKG_CONFIG) --cflags wcstools)|g" \
+ -i Makefile.in */Makefile.in || die
+ # fix race condition (when ccache is on)
+ sed -e 's|$(LIB):|$(LIB): FORCE|g' \
+ -e '$aFORCE:' \
+ -i */Makefile.in || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --exec-prefix="${EPREFIX}/usr" \
+ --enable-shared \
+ --enable-dl \
+ --with-wcslib="$($(tc-getPKG_CONFIG) --libs wcstools)" \
+ --with-zlib="$($(tc-getPKG_CONFIG) --libs zlib)" \
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+}
+
+src_compile() {
+ emake
+ emake shtclfun
+}
+
+src_install () {
+ default
+ # install missing includes
+ insinto /usr/include/funtools/fitsy
+ doins fitsy/*.h
+ # fix bug #536630
+ mv "${ED}"/usr/share/man/man3/funopen.3 \
+ "${ED}"/usr/share/man/man7/funopen.7 \
+ || die
+ use doc && dodoc doc/*.pdf doc/*html doc/*c \
+ && docompress -x /usr/share/doc/${PF}/*.c
+ use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
+}
diff --git a/sci-astronomy/funtools/metadata.xml b/sci-astronomy/funtools/metadata.xml
new file mode 100644
index 000000000000..2d6b93e428d3
--- /dev/null
+++ b/sci-astronomy/funtools/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Funtools, is a minimal buy-in FITS library and utility package from
+ the SAO/HEAD. The Funtools library provides simplified
+ access to FITS images and binary tables, as well as to raw array and binary
+ event lists. The Funtools utilities provide high-level support for
+ processing astronomical data.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">ericmandel/funtools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/galaxy/Manifest b/sci-astronomy/galaxy/Manifest
new file mode 100644
index 000000000000..9b163f135fa9
--- /dev/null
+++ b/sci-astronomy/galaxy/Manifest
@@ -0,0 +1,5 @@
+DIST galaxy-2.2.tar.gz 146675 SHA256 88d7bcfe7c25ad260f2f7b5abce2e3bb69c9e3e0661772a9016b2356160f1c00 SHA512 b3843f4ef7bdd60d761db019ded8af99b4c520ecc1c852a210bc6282751474254d9b9172e738015c7b01df57502655749051baac11448797fb9b71ecd4edd8d6 WHIRLPOOL 4d2bf2df59a89eb4cb459f2e90dbdc9992796c22d539fde9c0c918473eafdccb80ee4cad77c8da7c79b9d9c372431332cf0562ae5326ac718072d7c0f1128b53
+EBUILD galaxy-2.2-r1.ebuild 875 SHA256 cea4ac9069a88bd12c4f2360753104b3a106427d7823db4edf0fdca31b5bc4a1 SHA512 95d3b81d7c47ab879570bc674d163f1da62c616bcd6e1a68df371125cdca72cb269ad83fa6957e516f3cc3c49e5766e183034d4bb0d4e1e1e361a0b9ccdd81a1 WHIRLPOOL 9ee3b6afefd8a6d377609c9f8922dc479db91a0f3dbe4427f07da32156b8a407421f1bf875fd3aa08a9a650fcc4796fb986d520f61daa11b8bc0fba90ae5390d
+MISC ChangeLog 2931 SHA256 3a0ce3fc22b2d49018b572b89b5be481ef5a086c5d2c8db7b95f66f715ae3754 SHA512 cedbad07a7166b36bd2814890fc573dbc141393b72e1fac48e888c624fb47d01f0ff89196c4b45d77bd5d82213ed4d6e70abc26f54e551a58c4fbd28c9156335 WHIRLPOOL 563827ce97d9e07113cd0afd4aa2b9ba565683e1c0d20bce6cf815979346bdbfcbcc9e7960d88da26a45f70ad71cdd84317bae9823fe1e629ab14d189d89a838
+MISC ChangeLog-2015 1806 SHA256 adae1ef7ec0eb3438c2f6fdf51634a21f9d586eddbca4d323d534f4aa6b99fe7 SHA512 54e5997ec361096666af2f643d661ec493a2c0a302d04630fd22710ee9eb39cea8f1ff37857ebff2a7b2158ec84783b3a5063c15eb20964b0b4a6b0f609d395a WHIRLPOOL d186ae04820337c67f0655b15354393664b163aae1c41d050c00ced8ec75a8bbb5c71dc211f7891a20121061036517e2259a02bc62231dc2b010ca697a165510
+MISC metadata.xml 491 SHA256 1766cb5db07e96aa3373730a5dd8110fa1b7d8836d836eb36c8b31d08e083920 SHA512 49d155fb1afa29408d5dca3b1ad7e50c7a84d23bafc932c1f087e40a956a7286e6348f1e6da01a40be5b4e21fe7740adb45492b97f83198cc8c1901b77e83eb6 WHIRLPOOL 7284ec022f6daa80d47d27e2b2672894008ef1ab0e7fdd5c8aeb14768865fd513aec0f49c4480abfc7a2b47f3818e0e3307fb327e8d20f2a4a3f15a742250549
diff --git a/sci-astronomy/galaxy/galaxy-2.2-r1.ebuild b/sci-astronomy/galaxy/galaxy-2.2-r1.ebuild
new file mode 100644
index 000000000000..bce80f743988
--- /dev/null
+++ b/sci-astronomy/galaxy/galaxy-2.2-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit fdo-mime flag-o-matic toolchain-funcs
+
+# probably change every release
+PID="1/3/0/3/13035936"
+
+DESCRIPTION="Stellar simulation program"
+HOMEPAGE="http://www.kornelix.com/galaxy.html"
+SRC_URI="http://www.kornelix.com/uploads/${PID}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="x11-libs/gtk+:3"
+RDEPEND="${DEPEND}
+ x11-misc/xdg-utils"
+
+src_prepare() {
+ default
+ sed -e '/DOCDIR/ s/PROGRAM)/&-\$(VERSION)/g' \
+ -e '/xdg-desktop-menu/d' \
+ -i Makefile || die
+}
+
+src_configure() {
+ tc-export CXX
+ append-cxxflags -pthread
+ append-ldflags -pthread
+ export PREFIX="${EPREFIX}/usr"
+ default
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sci-astronomy/galaxy/metadata.xml b/sci-astronomy/galaxy/metadata.xml
new file mode 100644
index 000000000000..275904197454
--- /dev/null
+++ b/sci-astronomy/galaxy/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Stellar simulation program. Watch a few stars move around each-other,
+ accelerated by their mutual attractions, or watch thousands of random
+ stars evolve into a spiral galaxy.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/gasgano/Manifest b/sci-astronomy/gasgano/Manifest
new file mode 100644
index 000000000000..cfcf7716277c
--- /dev/null
+++ b/sci-astronomy/gasgano/Manifest
@@ -0,0 +1,6 @@
+DIST VLT-PRO-ESO-19000-1932-V4.pdf 818369 SHA256 d370d6a57bed3cb7e47bb322e4cde5e314d37c6110e5370ea3099d241355ed68 SHA512 272da18caee1bb1b5228df76a7f09411120be39a4b421b79d48e0bfc09972f250322a718bf380d7a83c3a528151260139efdcd8d2482c6a36ad45d727d93cce1 WHIRLPOOL f13320ab0beaf5302eab56882ba7a8185543254e05cd1dada10a2fbc1652f45f74a20f326e703d9837d9abdee7499dbdfb7bdf1bd963f84937c6c24c3823b3f3
+DIST gasgano-2.4.8.tar.gz 9211627 SHA256 437a5d276123c8b5441d295004f89455f11cff8d62774c70e377dabf75dec13f SHA512 94fbc9721077b15d2ec06e296d1503a0e33cb845c831a4102740b84d600bc900324ec5293b9a977df0956bd02cd5adf9cc62989be860417e8014e97ead41967c WHIRLPOOL fbbd776a8adc5fa4079369c75bef4b90d04320685e5ae5495581f775895bb50ff0e5f0d11075e8605c7bcf732053b87c882ef0d2ca092f0dbdb6d1c771084d0a
+EBUILD gasgano-2.4.8.ebuild 934 SHA256 7c2a1cf6cc227a26fb1e94e714c2609f5800761825320555d5ffda7b8177b5ab SHA512 a5c4bf5c1b6991b9a88640f31367bf43ecbcb785396ebbb500c3cd781e68e3d2641bd51c79a13c1527d85414396e5b270a9f713cfc8c191c02cb7d71f6a28de2 WHIRLPOOL 93a192a7d56028db21e8aca1939da084d82d9ddeba8f8d72667729ce3760b808eb6598a99e7ca43bbdcd7a7cf9ade47126f60649351ad7cf5e6d8b651baea777
+MISC ChangeLog 2808 SHA256 fbc468ae495bd3377d623f398b210433e65f6ad3b052379e0d0a34a218e5d89f SHA512 3f332ea78a8e33f25c21f10340c43833464319241a9c413855a61da49e6d8ad81fe40543673de43312f9c84f965b6e1438b49c2d3505da4b1fed7914ec07820b WHIRLPOOL 22b58e1e3e4f6f85809ad9dde1825535b419b5cfbb32073793f874cd22c7a5e54395d7065090c7234b3cfc272868813b60554c97bbfc3b6e8af997ad4d63fcf5
+MISC ChangeLog-2015 1786 SHA256 f34e05158f4f8158f9e871a526b2b8621cc577caaf17626a09771375870011ac SHA512 9c987bd8372d16a66ff6b31e9207860f8289765f123b40a2862ca7ac4e49fadb0b74606b2b4356529dc9f8495bf88c1f445b815653c9a9af29cfdeaaadf4ed7d WHIRLPOOL d39d835ff9b0d7015712f79fdce7e3e60885f3c8b2ca38d625f911dece3e890e593d45797bf36a7997638685f10f2d5a0af1b62cfa0fae8542e8387ac4d39c0a
+MISC metadata.xml 730 SHA256 165d9b88316a4fc518fcecab362754cecfbebe0cc50dd1b74619ee6255baf942 SHA512 ab3f6da109440773987e1f366f3cfc67791abba6ec0cbe694149818634a4e150a842480c290e4ce83279ec890cbad51c613caf253fe6c2d2119029404b312959 WHIRLPOOL 4aba3fafb0daef15d2ce04dfb2ddd4907720c04d2239bc19716bab65d69dee988bd01c57260818594b014f21cf11282ce4d8ae47712ff286b8887c2b48478cd7
diff --git a/sci-astronomy/gasgano/gasgano-2.4.8.ebuild b/sci-astronomy/gasgano/gasgano-2.4.8.ebuild
new file mode 100644
index 000000000000..3c0029d16c7c
--- /dev/null
+++ b/sci-astronomy/gasgano/gasgano-2.4.8.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils java-pkg-2
+
+PDOC=VLT-PRO-ESO-19000-1932-V4
+
+DESCRIPTION="ESO astronomical data file organizer"
+HOMEPAGE="http://www.eso.org/sci/software/gasgano/"
+SRC_URI="ftp://ftp.eso.org/pub/dfs/${PN}/${P}.tar.gz
+ doc? ( ${HOMEPAGE}/${PDOC}.pdf )"
+
+LICENSE="Apache-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+DEPEND=">=virtual/jdk-1.7"
+RDEPEND="
+ >=virtual/jre-1.7
+ dev-java/gnu-regexp
+ dev-java/junit
+ dev-java/jal"
+
+src_prepare() {
+ default
+ sed -i \
+ -e "s:^BASE=\`pwd\`:BASE=${EPREFIX}/usr/share/${PN}:" \
+ -e 's:$BASE/share/:$BASE/lib/:g' \
+ bin/gasgano || die
+}
+
+src_install() {
+ dobin bin/*
+ java-pkg_dojar share/*.jar
+ insinto /usr/share/${PN}
+ doins -r config
+ make_desktop_entry gasgano "Gasgano FITS Organizer"
+ use doc && newdoc "${DISTDIR}"/${PDOC}.pdf user-manual.pdf
+}
diff --git a/sci-astronomy/gasgano/metadata.xml b/sci-astronomy/gasgano/metadata.xml
new file mode 100644
index 000000000000..a2e22f3fb87f
--- /dev/null
+++ b/sci-astronomy/gasgano/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Gasgano is a Data File Organiser developed and maintained by ESO to
+ help its user community to manage and organise in a systematic way the
+ astronomical data observed and produced by all VLT compliant
+ telescopes, i.e. by telescopes which are being operated through
+ Observation Blocks. The tool also supports FITS files which are not
+ generated by those telescopes but with a limited number of
+ functionalities.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/gnuastro/Manifest b/sci-astronomy/gnuastro/Manifest
new file mode 100644
index 000000000000..1154f1b7ea2b
--- /dev/null
+++ b/sci-astronomy/gnuastro/Manifest
@@ -0,0 +1,3 @@
+DIST gnuastro-0.3.tar.gz 4525361 SHA256 8a5bc2f977d4839f820d7423d10a6b94391a9571df97a64b9feb99a117973d81 SHA512 08556fd0de196c331cfd68e4b385fbef5c130fa9c914889367f4e3637b8dc6270a2424ef92c6641ec803c355d0577cebf3ace5ad76a7024f0414bb516338beac WHIRLPOOL 1fea9c239f896be1b931a2c7ab64041e9cdaeba95b24c76058169a7337d3c4a360b86e1d11747fe74b3af8122ed8eea719ee4db2f5601d72b67c3421ed4f1e7a
+EBUILD gnuastro-0.3.ebuild 929 SHA256 5b1ee66b8e74332f6f5f06f72ba62712be57af7df1a9dccabb183a976629cd6b SHA512 4d3e3f27c4c11e55002236a5fa708b63638bad3b47e553b49e5f140eacf443ff71e0b455276a5f413fab463aa4d4a263e860e040276f52aee6dac24a81cbabff WHIRLPOOL 0eabd00f9a06cbf10c4cd676b9cf7a5946ef0bef24595a6300fe9da379d79ec28dd4fa5243c10faac9f7fff02ff7dfa6959e90c012f0f0b70353c2aeb3f59878
+MISC metadata.xml 988 SHA256 4ffb2c1a3f5cd3327f2f08faa015e79b96534e91c682d2661c8eba93ead91ef5 SHA512 208e0ea993adb14966523de6b012b6c2a97c6373e9a7bf03039dd50d32b03cd07a1a5da5196081a18b39b93d7d7d5d078b283a949b8b258f3f966cc2df00d00f WHIRLPOOL 1677ebc48324fde1b96eae76a46cc29a798c9ed848b40f231fd48cf053be6c19daca08b8e4c12da3650e8d99a3eae182f0c38c8b25b526ffb759bb8559469eb0
diff --git a/sci-astronomy/gnuastro/gnuastro-0.3.ebuild b/sci-astronomy/gnuastro/gnuastro-0.3.ebuild
new file mode 100644
index 000000000000..54ffe177332a
--- /dev/null
+++ b/sci-astronomy/gnuastro/gnuastro-0.3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils autotools
+
+DESCRIPTION="GNU Astronomy Utilities"
+HOMEPAGE="https://www.gnu.org/software/gnuastro"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0/1"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="static-libs threads"
+
+# jpeg, pdf, and libgit2 are forced deps
+# because they are automagically detected.
+
+RDEPEND="
+ app-text/ghostscript-gpl
+ dev-libs/libgit2:=
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/gsl:0=
+ virtual/jpeg:0=
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ sed -i -e 's/-O3//' configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --enable-bin-op-alltypes
+ $(use_enable static-libs static)
+ $(use_enable threads)
+ )
+ econf ${myeconfargs[@]}
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files --all
+}
diff --git a/sci-astronomy/gnuastro/metadata.xml b/sci-astronomy/gnuastro/metadata.xml
new file mode 100644
index 000000000000..c91cdd639148
--- /dev/null
+++ b/sci-astronomy/gnuastro/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The GNU Astronomy Utilities (Gnuastro) is an official GNU package
+ consisting of various programs and library functions for the
+ manipulation and analysis of astronomical data. All the programs
+ share the same basic command-line user interface for the comfort
+ of both the users and developers. Gnuastro is written to comply
+ fully with the GNU coding standards so it integrates finely with
+ the GNU/Linux operating system. This also enables astronomers to
+ expect a fully familiar experience in the source code, building,
+ installing and command-line user interaction that they have seen
+ in all the other GNU software that they use.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/healpix/Manifest b/sci-astronomy/healpix/Manifest
new file mode 100644
index 000000000000..018165435e51
--- /dev/null
+++ b/sci-astronomy/healpix/Manifest
@@ -0,0 +1,6 @@
+DIST Healpix_3.30_2015Oct08.tar.gz 23465221 SHA256 efcc8ff9775f393bd3e7e9d36202126e34e5c762ee568495a728329fa6650bfb SHA512 a7be82687a2188f5dff99c6826355e3290ccc91cc440e67267c58fa13af9fa5d301eca9b37676ef6f0af262b2ff1c06e722d0dcd3aca00a4c9d2794bc666c0c7 WHIRLPOOL 56584726daa1efd8809440cb7608c82a6b2ee6f1f35ddff701e98d3ddc3c77c0a3c339003c0b08e150747db5c6b0eb18da9ef153f89e1f33bc897e4135692152
+DIST Healpix_3.31_2016Aug26.tar.gz 23834899 SHA256 ddf437442b6d5ae7d75c9afaafc4ec43921f903c976e25db3c5ed5185a181542 SHA512 fd80e9ed80d19e438134f63c3d13802f63c4cd1b9f3596807e67d4ba5ff814e652a130d038449269d6ead271085eb0ab74884b2d768d8531066727377c457f9c WHIRLPOOL 3ae297b5fc0235162870af6ab8161ad87bd0f33a2e20c807da0d3faa2a7c2b0ac7b194e5c535ec74fa1d36d9571c1eff8d54606360b47d61253fdadd24261d0f
+EBUILD healpix-3.30.ebuild 3133 SHA256 793944f646b889e072423e086dfff90699e5d41446dc049fee82eac432a90016 SHA512 cd0a0ef795cbd11f84f126411c7fd72798d035306f25e76d5659fa5c084e38337492148c953bd013e22998c2107e7e5f1bcd46a0b94a95ed4ff7dd186b4c59ef WHIRLPOOL 7289b82cc45f3577856d865c69f5ecf42d239d3b4eff0f109c6d3f094b32faad02174804e0f99ce112ddd30b590133ce9e4b4f3b3dfb794a20b7ce9990e7a1d1
+EBUILD healpix-3.31.ebuild 3133 SHA256 ea835eafc8e52c9d9f776adb35e346650281b52d55db372442779b2906602999 SHA512 51d64602f658c9ab2ab81ca4529415fe19c1cbd2e00d48ca352257a11c60d666464da7b7e6b09224152cad8af7b90d3d41f7ede5cb84911aaec2724797002714 WHIRLPOOL 2b6b37a1c5fb18c426c3b914986d3a5f5500eecaae31b7fe6323c50b79fce58bb73e8cf1e261707364d3aacb6ad27e5caf0f6391cad6d1553b4347cb35341066
+MISC ChangeLog 473 SHA256 1620bd2dc6414cde4464abdff7c9154a6a4caa305cb2d2e159609331a54489f6 SHA512 6605b490131636baeb862f5ac971e10dc116fa50274cb9fa4da36de7a9ac25258891fdd7ddd8ada8aa1f59a4e3d44f8f326859a42d47e226e93904967f248074 WHIRLPOOL d51fd9958cb87fb46dfe5f0d8773639f9888e9770667d2fba6ad3af71c96b5dbc805d53f9e5687c36c2843e66eac70079f7e17966ffe05ef277605c39ef9bb9d
+MISC metadata.xml 736 SHA256 6b4f51727f5233cc57315204cf5582f83e236f3b5fa30f372029a0139044853b SHA512 1c1b23603bf390ebf8258f75a0867f2a0eb640099c2fbba9db5377449945aff71df8eac9c4c83391e838f1785fca1ce64b7acacd112f7a3b1ddde61a8923f1d5 WHIRLPOOL 9e3f437fa6dff4108bac2a1ff654683b1ac907f9e666be73d1baa0bf8c0a110e83030ec8db27bf4668ac3d31e6d3584bd5ae0decf8079ba3003b44cf08cc4dc1
diff --git a/sci-astronomy/healpix/healpix-3.30.ebuild b/sci-astronomy/healpix/healpix-3.30.ebuild
new file mode 100644
index 000000000000..e446fc060467
--- /dev/null
+++ b/sci-astronomy/healpix/healpix-3.30.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools toolchain-funcs eutils java-pkg-opt-2 java-ant-2
+
+MYP="Healpix_${PV}"
+MYPF=${MYP}_2015Oct08
+
+DESCRIPTION="Hierarchical Equal Area isoLatitude Pixelization of a sphere"
+HOMEPAGE="http://healpix.sourceforge.net/"
+SRC_URI="mirror://sourceforge/healpix/${MYP}/${MYPF}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+# might add fortran in the future if requested
+IUSE="cxx doc idl java openmp static-libs test"
+
+RDEPEND="
+ >=sci-libs/cfitsio-3
+ idl? (
+ dev-lang/gdl
+ sci-astronomy/idlastro )
+ java? ( >=virtual/jre-1.6:* )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ java? ( >=virtual/jdk-1.6:* test? ( dev-java/ant-junit4:0 ) )"
+
+S="${WORKDIR}/${MYP}"
+
+pkg_pretend() {
+ if use cxx && use openmp && [[ $(tc-getCXX)$ == *g++* ]] && [[ ${MERGE_TYPE} != binary ]]; then
+ tc-has-openmp || \
+ die "You are using gcc but without OpenMP capabilities that you requested"
+ fi
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ pushd src/C/autotools > /dev/null
+ eautoreconf
+ popd > /dev/null
+ # why was static-libtool-libs forced?
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ sed -i -e '/-static-libtool-libs/d' Makefile.am || die
+ eautoreconf
+ popd > /dev/null
+ fi
+ # duplicate of idlastro (in rdeps)
+ rm -r src/idl/zzz_external/astron || die
+ mv src/idl/zzz_external/README src/idl/README.external || die
+ java-pkg-opt-2_src_prepare
+ default
+}
+
+src_configure() {
+ pushd src/C/autotools > /dev/null
+ econf $(use_enable static-libs static)
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ econf \
+ --disable-native-optimizations \
+ $(use_enable openmp) \
+ $(use_enable static-libs static)
+ popd > /dev/null
+ fi
+}
+
+src_compile() {
+ pushd src/C/autotools > /dev/null
+ emake
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ eant dist-notest
+ popd > /dev/null
+ fi
+}
+
+src_test() {
+ pushd src/C/autotools > /dev/null
+ emake check
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake check
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ EANT_GENTOO_CLASSPATH="ant-junit4" ANT_TASKS="ant-junit4" eant test
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ dodoc READ_Copyrights_Licenses.txt
+ pushd src/C/autotools > /dev/null
+ emake install DESTDIR="${D}"
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake install DESTDIR="${D}"
+ docinto cxx
+ dodoc ../CHANGES
+ popd > /dev/null
+ fi
+ use static-libs || prune_libtool_files --all
+ if use idl; then
+ pushd src/idl > /dev/null
+ insinto /usr/share/gnudatalanguage/healpix
+ doins -r examples fits interfaces misc toolkit visu zzz_external
+ doins HEALPix_startup
+ docinto idl
+ dodoc README.*
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ java-pkg_dojar dist/*.jar
+ docinto java
+ dodoc README CHANGES
+ popd > /dev/null
+ fi
+ use doc && dodoc -r doc/html
+}
diff --git a/sci-astronomy/healpix/healpix-3.31.ebuild b/sci-astronomy/healpix/healpix-3.31.ebuild
new file mode 100644
index 000000000000..489986685793
--- /dev/null
+++ b/sci-astronomy/healpix/healpix-3.31.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools toolchain-funcs eutils java-pkg-opt-2 java-ant-2
+
+MYP="Healpix_${PV}"
+MYPF=${MYP}_2016Aug26
+
+DESCRIPTION="Hierarchical Equal Area isoLatitude Pixelization of a sphere"
+HOMEPAGE="http://healpix.sourceforge.net/"
+SRC_URI="mirror://sourceforge/healpix/${MYP}/${MYPF}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+# might add fortran in the future if requested
+IUSE="cxx doc idl java openmp static-libs test"
+
+RDEPEND="
+ >=sci-libs/cfitsio-3
+ idl? (
+ dev-lang/gdl
+ sci-astronomy/idlastro )
+ java? ( >=virtual/jre-1.6:* )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ java? ( >=virtual/jdk-1.6:* test? ( dev-java/ant-junit4:0 ) )"
+
+S="${WORKDIR}/${MYP}"
+
+pkg_pretend() {
+ if use cxx && use openmp && [[ $(tc-getCXX)$ == *g++* ]] && [[ ${MERGE_TYPE} != binary ]]; then
+ tc-has-openmp || \
+ die "You are using gcc but without OpenMP capabilities that you requested"
+ fi
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ pushd src/C/autotools > /dev/null
+ eautoreconf
+ popd > /dev/null
+ # why was static-libtool-libs forced?
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ sed -i -e '/-static-libtool-libs/d' Makefile.am || die
+ eautoreconf
+ popd > /dev/null
+ fi
+ # duplicate of idlastro (in rdeps)
+ rm -r src/idl/zzz_external/astron || die
+ mv src/idl/zzz_external/README src/idl/README.external || die
+ java-pkg-opt-2_src_prepare
+ default
+}
+
+src_configure() {
+ pushd src/C/autotools > /dev/null
+ econf $(use_enable static-libs static)
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ econf \
+ --disable-native-optimizations \
+ $(use_enable openmp) \
+ $(use_enable static-libs static)
+ popd > /dev/null
+ fi
+}
+
+src_compile() {
+ pushd src/C/autotools > /dev/null
+ emake
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ eant dist-notest
+ popd > /dev/null
+ fi
+}
+
+src_test() {
+ pushd src/C/autotools > /dev/null
+ emake check
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake check
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ EANT_GENTOO_CLASSPATH="ant-junit4" ANT_TASKS="ant-junit4" eant test
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ dodoc READ_Copyrights_Licenses.txt
+ pushd src/C/autotools > /dev/null
+ emake install DESTDIR="${D}"
+ popd > /dev/null
+ if use cxx; then
+ pushd src/cxx/autotools > /dev/null
+ emake install DESTDIR="${D}"
+ docinto cxx
+ dodoc ../CHANGES
+ popd > /dev/null
+ fi
+ use static-libs || prune_libtool_files --all
+ if use idl; then
+ pushd src/idl > /dev/null
+ insinto /usr/share/gnudatalanguage/healpix
+ doins -r examples fits interfaces misc toolkit visu zzz_external
+ doins HEALPix_startup
+ docinto idl
+ dodoc README.*
+ popd > /dev/null
+ fi
+ if use java; then
+ pushd src/java > /dev/null
+ java-pkg_dojar dist/*.jar
+ docinto java
+ dodoc README CHANGES
+ popd > /dev/null
+ fi
+ use doc && dodoc -r doc/html
+}
diff --git a/sci-astronomy/healpix/metadata.xml b/sci-astronomy/healpix/metadata.xml
new file mode 100644
index 000000000000..d83a73a67095
--- /dev/null
+++ b/sci-astronomy/healpix/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ HEALPix is an acronym for Hierarchical Equal Area isoLatitude
+ Pixelization of a sphere. As suggested in the name, this pixelization produces a
+ subdivision of a spherical surface in which each pixel covers the same
+ surface area as every other pixel.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">healpix</remote-id>
+ </upstream>
+ <use>
+ <flag name="idl">Install healpix IDL/GDL routines</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-astronomy/idlastro/Manifest b/sci-astronomy/idlastro/Manifest
new file mode 100644
index 000000000000..0c7ebfb87102
--- /dev/null
+++ b/sci-astronomy/idlastro/Manifest
@@ -0,0 +1,6 @@
+DIST idlastro-20161220.tar.gz 1154282 SHA256 daa256200f9d34c1abc73dc823718cf7ed5791d23cb09e04dc3e8c8795fc0f88 SHA512 d61a2c3c27e9cb676639c76741063e97802ea149043f563d00b682e92a710ffd3005bce838c29ff4f1f734a5d64298999e5890cf858ffee083c3085dec3a5636 WHIRLPOOL 22da1be6fff60aba73a8cbcee8508fa8ecbad9aa0fb7e977339d3da41d1887d5542bcfe4ab2336c4e6ceb288fa6ed324521241d74bd6d73e91c61c17a9a42460
+EBUILD idlastro-20161220.ebuild 665 SHA256 50b1f20a53238e1bd9001ecf3f029d656bf0471b02b6a85f0f1edb9973589134 SHA512 20432900e46266cf93af52d3f470d6236bd7a3b25134daa85edff09e64abd3ff205b691504341e47ae722b1a50c1264f9ce22365de5991511d9cfc68b52b4109 WHIRLPOOL f9fa966ed882733ecbb34a38fa3d92a550a10f2d9560864a4730172210d952eef7118a87ef1f8fc6ed873cd1fefd6d53119df5af87ae6d8aa0a1cb9aed4e8f3e
+EBUILD idlastro-99999999.ebuild 665 SHA256 50b1f20a53238e1bd9001ecf3f029d656bf0471b02b6a85f0f1edb9973589134 SHA512 20432900e46266cf93af52d3f470d6236bd7a3b25134daa85edff09e64abd3ff205b691504341e47ae722b1a50c1264f9ce22365de5991511d9cfc68b52b4109 WHIRLPOOL f9fa966ed882733ecbb34a38fa3d92a550a10f2d9560864a4730172210d952eef7118a87ef1f8fc6ed873cd1fefd6d53119df5af87ae6d8aa0a1cb9aed4e8f3e
+MISC ChangeLog 2738 SHA256 a6ad243ff024e01e56390e2074fc77c2fcbc0bd6198bc1ff85f3f636e5120ab3 SHA512 b7b433b606485cd36065559741a78f1228b39cf65121f5064cff40a1747bcd61971778c2aac9fecdc689bcdd41ddc40013a6a11c7bb252d2a4a56fd1afd1e2ea WHIRLPOOL 3d37ffeb7abfbd2a4c3a97d3251cd8f81ee882678014f21c1cb55d4226da5f28327a1be424f5eee6780fb5fda47a4528c29746662c00e7e8454ad7e346366574
+MISC ChangeLog-2015 1537 SHA256 e1a5822648dc2cafe5392a1f754d7c92b520aa9e11ac9dd42d9b33148032c7d2 SHA512 794f0005fc94833bfa358828d41b7a03b7af11ce47fc6ec75e8b75fafac0124644b096572f27766ac8861d764e0243d5c2f3fa1032d9c46c59fce045c845ff3e WHIRLPOOL d7650abf0a06b582cbc67ba4d083ddb6cc912cfc3ebfb1af404a0dcf72d16a9ea422a2adc904bb3995695ede64a7291ad1ec6c494283a6680438659b3a220845
+MISC metadata.xml 784 SHA256 e3822b64a7f15e80e794dca465e5ce0363bd6b45263bc4083a4d708a72a0e6f8 SHA512 44876a7fb1a9e52065f29f756e3a11f58aceedbfe8b0dc94bc9a23afd36102349850bfb04354024c0b9941e60d48f6ada41bda4188366765688e32cbe2af22bf WHIRLPOOL e186e8ff83f802f0cd83f89e859667447b003d7fb72c58744ed55601e8bb98b4cbb4fff0ad7e878b2e37f7039b4eadaaf4bab2630300877c20b8ec3702d1fa7c
diff --git a/sci-astronomy/idlastro/idlastro-20161220.ebuild b/sci-astronomy/idlastro/idlastro-20161220.ebuild
new file mode 100644
index 000000000000..b126275565a3
--- /dev/null
+++ b/sci-astronomy/idlastro/idlastro-20161220.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} != 99999999 ]]; then
+ SRC_URI="https://idlastro.gsfc.nasa.gov/ftp/astron.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}"
+else
+ inherit git-r3
+ GIT_ECLASS="git-r3"
+ EGIT_REPO_URI="https://github.com/wlandsman/IDLAstro.git"
+ KEYWORDS=""
+fi
+
+DESCRIPTION="Astronomical user routines for IDL"
+HOMEPAGE="https://idlastro.gsfc.nasa.gov/"
+
+LICENSE="BSD-2 BSD"
+SLOT="0"
+IUSE=""
+DEPEND=""
+RDEPEND="dev-lang/gdl"
+
+src_install() {
+ insinto /usr/share/gnudatalanguage/${PN}
+ doins -r pro/*
+ dodoc *txt text/*
+}
diff --git a/sci-astronomy/idlastro/idlastro-99999999.ebuild b/sci-astronomy/idlastro/idlastro-99999999.ebuild
new file mode 100644
index 000000000000..b126275565a3
--- /dev/null
+++ b/sci-astronomy/idlastro/idlastro-99999999.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} != 99999999 ]]; then
+ SRC_URI="https://idlastro.gsfc.nasa.gov/ftp/astron.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}"
+else
+ inherit git-r3
+ GIT_ECLASS="git-r3"
+ EGIT_REPO_URI="https://github.com/wlandsman/IDLAstro.git"
+ KEYWORDS=""
+fi
+
+DESCRIPTION="Astronomical user routines for IDL"
+HOMEPAGE="https://idlastro.gsfc.nasa.gov/"
+
+LICENSE="BSD-2 BSD"
+SLOT="0"
+IUSE=""
+DEPEND=""
+RDEPEND="dev-lang/gdl"
+
+src_install() {
+ insinto /usr/share/gnudatalanguage/${PN}
+ doins -r pro/*
+ dodoc *txt text/*
+}
diff --git a/sci-astronomy/idlastro/metadata.xml b/sci-astronomy/idlastro/metadata.xml
new file mode 100644
index 000000000000..128ff66d9ecb
--- /dev/null
+++ b/sci-astronomy/idlastro/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The IDL Astronomy Users Library is a central repository for
+ low-level astronomy software written in the commercial language
+ IDL or GNU version of it (GDL). The Library is not meant to be an
+ integrated package, but rather is a collection of procedures from
+ which users can pick and choose (and possibly modify) for their own
+ use. Submitted procedures are given a cursory testing, but are
+ basically stored in the Library as submitted.
+ </longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/kapteyn/Manifest b/sci-astronomy/kapteyn/Manifest
new file mode 100644
index 000000000000..3ddacbf81de6
--- /dev/null
+++ b/sci-astronomy/kapteyn/Manifest
@@ -0,0 +1,6 @@
+AUX kapteyn-2.2-debundle_wcs.patch 2441 SHA256 6a2fd3eb10fc989a572c3446307dd7d5942e4d1651fd2b7b73c7b9caa23f730a SHA512 530d50ba8179939110eac6d4cb5b3611c67208994765f1ab1e50fc9a8cd30d56fe8f1aebc2b44e39f6ae3af534ca7ccb6bc58a4f1df555b49277d358d706e25f WHIRLPOOL cb8412732d26dedc914d526fd6bf4b9bb759e8f828d1a92a6e6dfdf7a9efea983dd84c14215f5f71d9d1539d3aa384d167e9eb08228c3e4c8c6291d1e96be9ab
+DIST kapteyn-2.3.tar.gz 14496700 SHA256 ba328d4fa202c1b1c7641857cbf23d3f05c78d7eac33d34b97b1c4ee22efa876 SHA512 7095d9f1faed1937817af48416027391e19bf416187b8cc7f0cc5fb1227efe715c0c6ff945e0e021d1a5e82353e9c3ad2c3a1236d3453b4904d6ca2f2a47747b WHIRLPOOL c31d78402b337569c2b0f733bb44b547ca5c0aed503e7fcfc22433bc63a443458122fb1713b199c65fc58fb8828ca84c47ce24d21a06b3dbac5fe9c7f94db211
+EBUILD kapteyn-2.3.ebuild 775 SHA256 8f44d80f336b197c9d65dc6abece2e9137de41af88e84ccbd022ff338717385f SHA512 d9a8e52851b4a3696568b348a9f6dc6d14e124f2de2fec88d127e23fd46118d057b4ca651f70ce8a822c6b10610230f58a0e935d912d7061b0d277e83b38a536 WHIRLPOOL 882c90fa1d972b9fbb3f4f18186e1ba5afd1b1c34e7d1330fc27044c3bf66a794241a286dfb46099e29d1f55773fd92ba84b2d4f7c27796de158f5471d1df1ba
+MISC ChangeLog 2724 SHA256 76f8c1de5713b0c59c6843da0f5879a2226c2a1c15dc07ed0c573b42c3810c97 SHA512 52cadba8f3a4ec778d686008e67dcdf78f87b374cf54ca0416587d4f72fe86edd495816adbd45df607e12b3bed9734f5e8e3e1c38b8114ef9243a10195dde2e1 WHIRLPOOL 755c8c6fcf954656db0ec190e1982e523cfc09bee2523fed667e092a359421b670ec637cc671ae4c6de4fa84a7cb5fcef79f609236fb3077e549e2f272104b87
+MISC ChangeLog-2015 2120 SHA256 9b0d6fe7c9e3961cc01b6766978e2dba7c075fac68cce7ca889f68c06bf94a33 SHA512 2731238c09fe2623cab903bd99a6146d36adb37dc6e20fa8142a63cde3de38ae63c1d54fd5e43ec9f262a87b178335182402c460ec9b9975d86d020ecc876b2d WHIRLPOOL 9fbc3b28b7407126d4b939bba2fa9084e3a6f568aebf000876b7991b75d6fb0c5495b0f63f96134dc60b0f3b5549404b26ff9f7c5f83edbc353a9e6f7ff9bfde
+MISC metadata.xml 618 SHA256 cc593721fb985a05f83d60948486b772a1d1c1858964afc01e3f30a758837060 SHA512 f0c7ebe71e55db31e91ebc2f3abbb700a2869cb305e5ea06cabc229dce6b73e8418c1943b3926a3a8fec9e8cc2ea117ffa675dcc80b46ec381a4094daf646fb1 WHIRLPOOL 5053e93acdb7c7ac58441996c1cd1e50ba13bc2e95cb2a20271d008796852e6f508084d143b8c53b550d2c9915da3bb8d6aa4345dd19c98bbba5716119e46c39
diff --git a/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch b/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch
new file mode 100644
index 000000000000..035979b80bc7
--- /dev/null
+++ b/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch
@@ -0,0 +1,101 @@
+Use system wcslib
+
+Patch written by Kacper Kowalik <xarthisius@gentoo.org>
+
+--- a/setup.py
++++ b/setup.py
+@@ -3,7 +3,8 @@
+ from kapteyn import __version__ as version
+ from glob import glob
+ import sys, os
+-
++from subprocess import Popen, PIPE
++from re import match
+ try:
+ import numpy
+ except:
+@@ -14,21 +15,27 @@
+ '''
+ sys.exit(1)
+
+-try:
+- wcslib_dir = glob('src/wcslib*/C/')[0]
+-except:
+- print '''
+--- Error.
+-Unable to find WCSLIB source distribution.
+-'''
+- sys.exit(1)
++def pkgconfig(*packages, **kw):
++ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
++ arg = "--libs --cflags --modversion %s" % ' '.join(packages)
++ for tok in Popen(["pkg-config "+ arg],stdout=PIPE, shell=True).communicate()[0].split():
++ token = tok.decode("utf-8")
++ if(match("[0-9]",token)):
++ kw.setdefault("version",[]).append(token)
++ else:
++ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
++ return kw
+
+ include_dirs = []
+ numdir = os.path.dirname(numpy.__file__)
+ ipath = os.path.join(numdir, numpy.get_include())
+ include_dirs.append(ipath)
+ include_dirs.append('src')
+-include_dirs.append(wcslib_dir)
++
++WCSLIB = pkgconfig('wcslib')
++WCSVERSION = Popen(["pkg-config --modversion"],stdout=PIPE, shell=True).communicate()[0].split()
++
++include_dirs += WCSLIB['include_dirs']
+
+ short_descr = "Kapteyn Package: Python modules for astronomical applications"
+
+@@ -94,27 +101,6 @@
+ "xyz.c"
+ ]
+
+-wcslib_src = [
+- "cel.c",
+- "lin.c",
+- "log.c",
+- "prj.c",
+- "spc.c",
+- "sph.c",
+- "spx.c",
+- "tab.c",
+- "wcs.c",
+- "wcsfix.c",
+- "wcshdr.c",
+- "wcsprintf.c",
+- "wcstrig.c",
+- "wcsunits.c",
+- "wcsutil.c",
+- "wcserr.c",
+- "flexed/wcsulex.c",
+- "flexed/wcsutrn.c"
+-]
+-
+ ndimg_src = [
+ "nd_image.c",
+ "ni_filters.c",
+@@ -125,8 +111,7 @@
+ "ni_support.c",
+ ]
+
+-wcs_src = ( ['src/' + source for source in wcsmod_src]
+- + [wcslib_dir + source for source in wcslib_src] )
++wcs_src = ( ['src/' + source for source in wcsmod_src] )
+
+ _nd_image_src = ['src/ndimg/' + source for source in ndimg_src]
+
+@@ -168,7 +153,8 @@
+ Extension(
+ "wcs", wcs_src,
+ include_dirs=include_dirs,
+- define_macros=define_macros
++ define_macros=define_macros,
++ libraries=WCSLIB['libraries']
+ ),
+ Extension(
+ "ascarray",
diff --git a/sci-astronomy/kapteyn/kapteyn-2.3.ebuild b/sci-astronomy/kapteyn/kapteyn-2.3.ebuild
new file mode 100644
index 000000000000..853ec1ed2cf1
--- /dev/null
+++ b/sci-astronomy/kapteyn/kapteyn-2.3.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Collection of python tools for astronomy"
+HOMEPAGE="http://www.astro.rug.nl/software/kapteyn"
+SRC_URI="http://www.astro.rug.nl/software/kapteyn/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ sci-astronomy/wcslib
+ dev-python/numpy[${PYTHON_USEDEP}]"
+RDEPEND="${DEPEND}
+ dev-python/astropy[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]"
+
+DOCS=( CHANGES.txt README.txt doc/${PN}.pdf )
+
+PATCHES=( "${FILESDIR}"/${PN}-2.2-debundle_wcs.patch )
+
+python_prepare_all() {
+ rm -r src/wcslib-4.* || die
+ distutils-r1_python_prepare_all
+}
diff --git a/sci-astronomy/kapteyn/metadata.xml b/sci-astronomy/kapteyn/metadata.xml
new file mode 100644
index 000000000000..57bfac11edbd
--- /dev/null
+++ b/sci-astronomy/kapteyn/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The Kapteyn Package is a collection of Python modules and applications
+ made by the computer group of the Kapteyn Astronomical Institute,
+ University of Groningen, The Netherlands. The purpose of the package
+ is to provide tools for the development of astronomical applications
+ with Python.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/metadata.xml b/sci-astronomy/metadata.xml
new file mode 100644
index 000000000000..49245f7d22e6
--- /dev/null
+++ b/sci-astronomy/metadata.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sci-astronomy category contains software that can be used
+ in astronomical and related scientific environments.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sci-astronomy enthält Software, die in astronomischen
+ und verwandten wissenschaftlichen Umfeldern genutzt wird.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sci-astronomy contiene programas que pueden ser utilizados
+ en entornos relacionados con la astronomía.
+ </longdescription>
+ <longdescription lang="ja">
+ sci-astronomyカテゴリーには天文学の科学的な分野に利用される
+ ソフトウェアが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De sci-astronomy categorie bevat software, die in astronomische
+ en gerelateerde wetenschappelijke omgevingen wordt gebruikt.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sci-astronomy chứa các phần mềm dùng trong thiên văn
+ và liên quan đến khoa học.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sci-astronomy contiene programmi per l'astronomia.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sci-astronomy contém programas que podem ser usados
+ em ambientes relacionados a astronomia.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sci-astronomy zawiera programy naukowe związane z astronomią.
+ </longdescription>
+</catmetadata>
+
diff --git a/sci-astronomy/missfits/Manifest b/sci-astronomy/missfits/Manifest
new file mode 100644
index 000000000000..b732f7d0cd1e
--- /dev/null
+++ b/sci-astronomy/missfits/Manifest
@@ -0,0 +1,4 @@
+DIST missfits-2.8.0.tar.gz 428404 SHA256 65772902ec29c33768bd579aefa577acbd93b671423e5edb2621ffaddd695912 SHA512 32727f5eb30573a1cedacb8900e2536867e4815059eee32e64e3db65be9291b8a91b9f45b2c9f3cf6fc2a8cc448012ea3d502bdd9dee516008e17d5086aee795 WHIRLPOOL d3b7a429b3fb97ebf7df2fa7c64fc20579cad9f6ba2ebeec9b58943d2b05a794eea4846b6cfa7fc9e33fc4e4bf3f7e09e4fcb2d7a5c63cd446f55107be280a7e
+EBUILD missfits-2.8.0.ebuild 479 SHA256 f3e85572eca11fe91eba0e3067aabef57f5e79ec3401e9bcfcac924b9ddde430 SHA512 30f62f0439820e848050ae74f1a661ead3401ce4ad3046672c1ea058936020b27edcf1996d630a8b98aed37f492b89ec3c576f2fcdcd7af9ae4124cf47e73f32 WHIRLPOOL 9b8359cbfa1ff60f4d9cde0067d5a46873001345a6c2d86493ff2d3ddaf4240ae2bc6df1317bee53382a08e47f667a0964d790aaa6112cb7f28160af0ba196bb
+MISC ChangeLog 322 SHA256 1e2eea200c2974aeab4e69e6ee819773a41327b1048f582919e9447ba35c1e26 SHA512 2ba407e85a96bd783665973711a689c08b8b55d99d149764d345d157e4fb4a233e2cc89bd4411dead445da3bc4adcc9faa5ea7ec8deb1cad82804ce43a2ffaa4 WHIRLPOOL 9b0dbba4e5f3017e263b7fc48041091c7a3cedc9caa50900867dd64a4b821ba3e8beef54dde3ab9e5bb27e884eda189aea38c4ba5f86f97b4dd9653d4d6eaac3
+MISC metadata.xml 646 SHA256 8adb9f3672c5a1b8216a6f7d4db637115dd807eb6c71d9c89b599af7290b382a SHA512 9585430922e0cfbecfb67333817e8ef9756aa99920489f6f1f7995e5b63dba8f7999b1eb119d829fd827bb386faf138c65abcab3de871c643b74503a66ac9150 WHIRLPOOL 20492d75df2cc2e0cb373523b94e7e04e7805082d920fc4856d6479e45a966b39b954d61c806c275f98c9203cd3e8e39b3e08510a1aad3f876bc81f26b011450
diff --git a/sci-astronomy/missfits/metadata.xml b/sci-astronomy/missfits/metadata.xml
new file mode 100644
index 000000000000..3a1cc249871a
--- /dev/null
+++ b/sci-astronomy/missfits/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ MissFITS is a program that performs basic maintenance and packaging
+ tasks on FITS files using an optimised FITS library. MissFITS can:
+ * add/edit/remove FITS header keywords
+ * split/join Multi-Extension-FITS (MEF) files
+ * unpile/pile FITS data-cubes
+ * create/check/update FITS checksums, using R. Seaman’s protocol.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/missfits/missfits-2.8.0.ebuild b/sci-astronomy/missfits/missfits-2.8.0.ebuild
new file mode 100644
index 000000000000..0d8b4cee3006
--- /dev/null
+++ b/sci-astronomy/missfits/missfits-2.8.0.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Performs basic maintenance and packaging tasks on FITS files"
+HOMEPAGE="http://www.astromatic.net/software/missfits/"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+src_install () {
+ default
+ use doc && dodoc doc/*
+}
diff --git a/sci-astronomy/montage/Manifest b/sci-astronomy/montage/Manifest
new file mode 100644
index 000000000000..df12d1820d1e
--- /dev/null
+++ b/sci-astronomy/montage/Manifest
@@ -0,0 +1,11 @@
+AUX montage-4.1-fix_format_errors.patch 705 SHA256 ec2a3d543cefe0096933ede2d070f9dab7f4bd98bde7b9b53318d99fcc04e104 SHA512 16019fcc1c5e352296c2835052ca9f2c6e755a15eb435b74da6d01b1c70bf514f87d5af4c1c85ba0e8b0c28f7fdeca70e8c9f80862cafbfd68ab5bd527708f16 WHIRLPOOL f6733dd9f00d890e0bcdc8f61d37a63fd6ff29cab12b965efcba8332f9392d3594e9c4e35dbaa35c9a20059f8c6c7017e1e6dfb12fa212ec9644c112739252f4
+AUX montage-4.1-fix_freetype_incude.patch 407 SHA256 e3eda784195344df5d44ac5c22b5c04da2cb3092433f934193ae708ba7ef0224 SHA512 8e6eaaf6266a3ea5210a403659333f766fcf40846fc774078d61e45f9d3eea3e98010b1741645790c7d33c0e22e2812f03925cb7421807712c0a3a41ac94126e WHIRLPOOL 9ad2b4207316cf90461adb9e360104acdd24437e7d43865c71c4f085c75cddff359103aa72d69e53524f6af31755f3b8ed11a65e2a5a4fd921fbfd82c9b3718e
+AUX montage-4.1-initdistdata.patch 619 SHA256 ab8ff543ed4e9eb659e040d1795f957632c981b52e4a8b851d6d19e08efe56be SHA512 6b4b195f804fb16dd3acdfb53288800ac07af9b05749ad8e8305fe415488e921a65ffb6ce19632da420dea6235eb3ed28826a437a8b7ad22869065a916422ea5 WHIRLPOOL b53b7a974c9e6e69aa6f8bac831012a7de1c3b7f8de9f2d271795658ab0fa3fd77f58cb0dd75b3a0e008791d6d13a099c3e6f5273185aa9ba7f20837867ecc0c
+AUX montage-4.1-use_system_libs.patch 2025 SHA256 db13025138ccdd958b2d08582a7903351ad1ce3fc8ee63e38d14a1883564ecbc SHA512 15221debf0f36bbc3f5e91d6429ef8d14934cb7256915aa4d86973b164d408bedceb02d33cbb7e5a61e99b72db0b320088b6eaa6f9bd648f6f3879549cfd6c8e WHIRLPOOL 7286280fb059565cdd796fb161ed74f99ba618fde988d0f307aa28d762a8a08ea28d9b107f82ddb71377a7aa85eb7aa92441f0d1fcb73663e34e50c866c241c4
+AUX montage-5.0-fix_freetype_incude.patch 1164 SHA256 f61f7deb4b8776cad7438215db31429da15269ccff639d707852f6ad34c56deb SHA512 1ca955f06765fc90164190a090ec177a06c9cb359fe93b43b8553af06b8eb4a06c8d2685d76fbee0fc70dad525a184b9a4dfde8acef4f4d9703610fb69b73ad5 WHIRLPOOL a5f192d7adcc6d8dae1cc6fcb946a54e5bfead1d4f366112de1644f2b4e87ebe08e43103f1ec0dc2b3c2575f76815ac3157a0099c7785ac37dfb8ced2f517a72
+DIST Montage_v5.0.tar.gz 14663443 SHA256 72e034adb77c8a05ac40daf9d1923c66e94faa0b08d3d441256d9058fbc2aa34 SHA512 1396c7f846db4844d2e861622d152f2115ad4c684da02bb14116dfe3d01b559feaf29572663d0dfd234aa50843afaca3bb072d9127fbb2b539a14327c48499ae WHIRLPOOL f5fc9d93d88c95ff079932d9e5f0ed61a0f30bec6bd2df5e50abfce6b171cee1b2b3e6dbed2ad1e65a7c69531b4475d62840b14f299ceffa6e65788cd9812579
+DIST montage-4.1.tar.gz 38542751 SHA256 12e463c30de190d6e8e215ef19ee787010194190e3df5ea579b6f3647804a5b4 SHA512 a4e6572c0ce04ca950cb425e2589d85609d037e57c575d4efa67b277cecf5e54a2e6d307914ee99997baaba7c5bdd43c72b1e1893111eacc065785689bfc17fb WHIRLPOOL bfd136b52a9c7b0bdceaaa0110b0476e8cb991c64ab4b646b60250e57f282fbe40c9795cef804b15caf29e0628dcb16157af11a1aa4f7e4f7c66c91f969f6484
+EBUILD montage-4.1.ebuild 1561 SHA256 cbc5287462e074be9815774df3914b8c55ac921d5a80c83a9a2124e03cbec67e SHA512 d7d36bece0e94ad1d07d383b9277529c71ad9303dbd069a34d2e489b052a6d6317bb3f45170d273a25255836e6c5c7a70b570979ce4f9cd53303125d30f35274 WHIRLPOOL 73f99eeb2a162921f43f3b5fba4e885bfc14322020b279769dbc09b6d2b73d5beca3016fd9fc74f52ae937a1a695dbcf55e2aea7331a2358b038f75c713e6fea
+EBUILD montage-5.0.ebuild 1583 SHA256 592982dad940c7f5e738baaf1c34cc0b94fbab74a8a4f61af2660942b06825c4 SHA512 d90cc853c3198c2625ff57c46ca12ccff9e75a283fde9e49b23f6b66440ff1643ecd0033c20a8c7d7e600adc85db4b1984b3ae913b0b9d0047398c45c51b83ed WHIRLPOOL e056d5b871c4714493be2b3d94fecaa4afb5f225dc818b1dc7f7da997cd6dc07ec9ef73806d76c604a0f4d22e3c752e73c412d7ef45d5e00119a230d88c113ee
+MISC ChangeLog 882 SHA256 8862b05e5381a9ff3caf7cda11e783d2d49dd4701063697077f82e789b16e909 SHA512 86196a1e74f3dd9efeed0c4b96b0150ae5d92e6e44cd24f4e4fd9b1483186a7e32a3d39f0001f4200e353e33f5374e9172231656df527bb7c2744d326ea93a88 WHIRLPOOL 7f4a2087c5d07955659d3406c848160779c1f1757490e095b109ffb51f5ad89fbe7973af0d40f6fb38030ab98dcc0d0dafe3b8ccb9e586904480ae641629020e
+MISC metadata.xml 1031 SHA256 fe008fffcd2507de188fba7741a85059807195770fa8448d00078f9a8acaef87 SHA512 b14dfef57d629cce61fda07b98a6dd375f2827d93da714bbd4eb359650d44b726c1cf3d6af181e280b913a8a80ee4a24c6e4e6b83a3219a59400a1257e517b53 WHIRLPOOL ee58a300ae6b56c0d1c2840d1d5e4c7bf77de743061ac68eb62779f9d6b8ff4f8e12e76a38ffa26fc0f836de158e9ba42a75cebbe8ea4ec678a54cb6f6633da0
diff --git a/sci-astronomy/montage/files/montage-4.1-fix_format_errors.patch b/sci-astronomy/montage/files/montage-4.1-fix_format_errors.patch
new file mode 100644
index 000000000000..d29429ccfaad
--- /dev/null
+++ b/sci-astronomy/montage/files/montage-4.1-fix_format_errors.patch
@@ -0,0 +1,23 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Fix format security error for (s|f)printf
+--- a/grid/Pegasus/hashtable.c
++++ b/grid/Pegasus/hashtable.c
+@@ -4,8 +4,6 @@
+
+ #include <hashtable.h>
+
+-char *strdup(const char *s1);
+-
+ int HT_debug = 0;
+
+ /********************************************************/
+--- a/lib/src/coord/ccalc.c
++++ b/lib/src/coord/ccalc.c
+@@ -25,7 +25,6 @@
+ static int ConvertfromDD(char *fmt, char *clongprec, char *clatprec,
+ char *clon, char *clat, double *lon, double *lat);
+ static char *downcase(char *s);
+-char *strdup(const char *s1);
+ int ParseUnits(char *cunit, int *chflag, CoordUnit *unit);
+ int ParsePrec(CoordUnit units, char *cprec, int longflag);
+
diff --git a/sci-astronomy/montage/files/montage-4.1-fix_freetype_incude.patch b/sci-astronomy/montage/files/montage-4.1-fix_freetype_incude.patch
new file mode 100644
index 000000000000..0b27c83784db
--- /dev/null
+++ b/sci-astronomy/montage/files/montage-4.1-fix_freetype_incude.patch
@@ -0,0 +1,13 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Fix freetype include path
+--- a/util/Viewer/graphics.c
++++ b/util/Viewer/graphics.c
+@@ -1,7 +1,7 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <freetype2/ft2build.h>
+-#include <freetype.h>
++#include FT_FREETYPE_H
+
+ void labeled_curve (char *face_path, int fontsize, int showLine,
+ double *xcurve, double *ycurve, int npt,
diff --git a/sci-astronomy/montage/files/montage-4.1-initdistdata.patch b/sci-astronomy/montage/files/montage-4.1-initdistdata.patch
new file mode 100644
index 000000000000..7344bbebb122
--- /dev/null
+++ b/sci-astronomy/montage/files/montage-4.1-initdistdata.patch
@@ -0,0 +1,19 @@
+Author: Christoph Deil <Deil.Christoph@gmail.com>
+Description: non-void function 'closefitsfile' should return a value
+ This is copied from macports.
+Bug: https://trac.macports.org/ticket/41076
+Url: https://trac.macports.org/attachment/ticket/41076/patch-lib-src-two_plane_v1.1-initdistdata.c.diff
+--- a/lib/src/two_plane_v1.1/initdistdata.c
++++ b/lib/src/two_plane_v1.1/initdistdata.c
+@@ -33,9 +33,9 @@
+ if (I_fits_return_status != 0)
+ {
+ fprintf(stderr, "Error closing file\n");
+- return;
++ return -1;
+ }
+- return;
++ return 0;
+ }
+
+ int initdata_byheader(char *fitsheader, DistCoeff *coeff)
diff --git a/sci-astronomy/montage/files/montage-4.1-use_system_libs.patch b/sci-astronomy/montage/files/montage-4.1-use_system_libs.patch
new file mode 100644
index 000000000000..4f4ff8d2d748
--- /dev/null
+++ b/sci-astronomy/montage/files/montage-4.1-use_system_libs.patch
@@ -0,0 +1,49 @@
+From: Sebastien Fabbro <bicatali@gentoo.org>
+Date: Tue, 7 Jun 2016 18:25:12 +0000
+Subject: Use system libraries
+
+--- a/lib/src/Makefile
++++ b/lib/src/Makefile
+@@ -1,5 +1,5 @@
+ l:
+- (cd cfitsio-3.25; ./configure; make; cp libcfitsio.a ../..; cp *.h ../../include)
++# (cd cfitsio-3.25; ./configure; make; cp libcfitsio.a ../..; cp *.h ../../include)
+ (cd cmd; make; make install)
+ (cd coord; make; make install)
+ (cd mtbl; make; make install)
+@@ -7,25 +7,25 @@ l:
+ (cd boundaries; make; make install)
+ (cd pixbounds; make; make install)
+ (cd www; make; make install)
+- (cd wcstools-3.8.7/libwcs; make; cp libwcs.a ../../..; cp *.h ../../../include)
++# (cd wcstools-3.8.7/libwcs; make; cp libwcs.a ../../..; cp *.h ../../../include)
+ (cd two_plane_v1.1; make; make install)
+ (cd lodepng_20140823; make; make install)
+- (cd jpeg-8b; ./configure; make; cp .libs/libjpeg.a ../..; cp jpeglib.h jconfig.h jmorecfg.h ../../include)
+- (cd freetype-2.5.4; ./configure --prefix=`pwd`/../../freetype --without-png; make; make install)
++# (cd jpeg-8b; ./configure; make; cp .libs/libjpeg.a ../..; cp jpeglib.h jconfig.h jmorecfg.h ../../include)
++# (cd freetype-2.5.4; ./configure --prefix=`pwd`/../../freetype --without-png; make; make install)
+ (cd ..; ranlib *.a)
+ chmod 644 ../include/*
+
+ clean:
+ rm -rf ../include/* ../freetype ../*.a
+- (cd cfitsio-3.25; make clean; rm -rf config.log config.cache config.status lib)
++# (cd cfitsio-3.25; make clean; rm -rf config.log config.cache config.status lib)
+ (cd cmd; make clean)
+ (cd coord; make clean)
+ (cd mtbl; make clean)
+ (cd svc; make clean)
+ (cd boundaries; make clean)
+ (cd pixbounds; make clean)
+- (cd wcstools-3.8.7/libwcs; make clean)
++# (cd wcstools-3.8.7/libwcs; make clean)
+ (cd two_plane_v1.1; make clean)
+ (cd lodepng_20140823; make clean)
+- (cd jpeg-8b; make clean)
+- (cd freetype-2.5.4; make clean; rm -rf objs/libfreetype.la objs/.libs)
++# (cd jpeg-8b; make clean)
++# (cd freetype-2.5.4; make clean; rm -rf objs/libfreetype.la objs/.libs)
+--
+2.8.3
+
diff --git a/sci-astronomy/montage/files/montage-5.0-fix_freetype_incude.patch b/sci-astronomy/montage/files/montage-5.0-fix_freetype_incude.patch
new file mode 100644
index 000000000000..42fd94950b84
--- /dev/null
+++ b/sci-astronomy/montage/files/montage-5.0-fix_freetype_incude.patch
@@ -0,0 +1,35 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 22 Dec 2016 14:24:44 +0100
+Subject: Fix freetype include path
+
+---
+ MontageLib/Viewer/mViewer_graphics.c | 2 +-
+ util/Viewer/graphics.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/MontageLib/Viewer/mViewer_graphics.c b/MontageLib/Viewer/mViewer_graphics.c
+index 932ca5f..a50281d 100644
+--- a/MontageLib/Viewer/mViewer_graphics.c
++++ b/MontageLib/Viewer/mViewer_graphics.c
+@@ -1,7 +1,7 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <freetype2/ft2build.h>
+-#include <freetype.h>
++#include FT_FREETYPE_H
+
+ void mViewer_labeledCurve (char *face_path, int fontsize, int showLine,
+ double *xcurve, double *ycurve, int npt,
+diff --git a/util/Viewer/graphics.c b/util/Viewer/graphics.c
+index 6bb7d8d..f7a5215 100644
+--- a/util/Viewer/graphics.c
++++ b/util/Viewer/graphics.c
+@@ -1,7 +1,7 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <freetype2/ft2build.h>
+-#include <freetype.h>
++#include FT_FREETYPE_H
+
+ void labeled_curve (char *face_path, int fontsize, int showLine,
+ double *xcurve, double *ycurve, int npt,
diff --git a/sci-astronomy/montage/metadata.xml b/sci-astronomy/montage/metadata.xml
new file mode 100644
index 000000000000..54df42e3123b
--- /dev/null
+++ b/sci-astronomy/montage/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Montage is a toolkit for assembling astronomical images into custom mosaics.
+ It uses algorithms that preserve the calibration and positional (astrometric)
+ fidelity of the input images to deliver mosaics that meet user-specified
+ parameters of projection, coordinates, and spatial scale. It supports all
+ projections and coordinate systems in use in astronomy.
+ It contains independent modules for analyzing the geometry of images on the
+ sky, and for creating and managing mosaics; these modules are powerful tools
+ in their own right and have applicability outside mosaic production, in areas
+ such as data validation.
+</longdescription>
+ <upstream>
+ <remote-id type="github">Caltech-IPAC/Montage</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/montage/montage-4.1.ebuild b/sci-astronomy/montage/montage-4.1.ebuild
new file mode 100644
index 000000000000..41261e6c583c
--- /dev/null
+++ b/sci-astronomy/montage/montage-4.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+MYPN=Montage
+
+DESCRIPTION="Toolkit for assembling FITS images into mosaics"
+HOMEPAGE="http://montage.ipac.caltech.edu/"
+SRC_URI="https://github.com/Caltech-IPAC/${MYPN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+
+IUSE="doc mpi"
+
+RDEPEND="
+ media-libs/freetype:2=
+ sci-astronomy/wcstools:0=
+ sci-libs/cfitsio:0=
+ virtual/jpeg:0
+ mpi? ( virtual/mpi )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix_format_errors.patch"
+ "${FILESDIR}/${P}-initdistdata.patch"
+ "${FILESDIR}/${P}-fix_freetype_incude.patch"
+ "${FILESDIR}/${P}-use_system_libs.patch"
+)
+
+S="${WORKDIR}/${MYPN}-${PV}"
+
+src_prepare() {
+ default
+ tc-export CC AR
+
+ find . -name Makefile\* | xargs sed -i \
+ -e "/^CC.*=/s:\(gcc\|cc\):$(tc-getCC):g" \
+ -e "/^CFLAGS.*=/s:-g:${CFLAGS} $($(tc-getPKG_CONFIG) --cflags wcstools):g" \
+ -e "s:-I../../lib/freetype/include :$($(tc-getPKG_CONFIG) --cflags freetype2):g" \
+ -e 's:$(CC) -o:$(CC) $(LDFLAGS) -o:g' \
+ -e "s:-lwcs:$($(tc-getPKG_CONFIG) --libs wcstools):g" \
+ -e "s:-lcfitsio:$($(tc-getPKG_CONFIG) --libs cfitsio):g" \
+ -e 's:-lnsl::g' \
+ -e "s:ar q:$(tc-getAR) q:g" || die
+
+ if use mpi; then
+ sed -e 's:# MPICC:MPICC:' \
+ -e 's:# BINS:BINS:' \
+ -i Montage/Makefile.* || die
+ fi
+}
+
+src_install () {
+ dobin bin/*
+ dodoc README* ChangeHistory
+ if use doc; then
+ insinto /usr/share/doc/${PF}
+ doins -r man/*
+ fi
+}
diff --git a/sci-astronomy/montage/montage-5.0.ebuild b/sci-astronomy/montage/montage-5.0.ebuild
new file mode 100644
index 000000000000..91e67534e2fc
--- /dev/null
+++ b/sci-astronomy/montage/montage-5.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+MYPN=Montage
+
+DESCRIPTION="Toolkit for assembling FITS images into mosaics"
+HOMEPAGE="http://montage.ipac.caltech.edu/"
+SRC_URI="http://montage.ipac.caltech.edu/download/${MYPN}_v${PV}.tar.gz"
+
+LICENSE="BSD GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+SLOT="0"
+
+IUSE="doc mpi"
+
+RDEPEND="
+ media-libs/freetype:2=
+ sci-astronomy/wcstools:0=
+ sci-libs/cfitsio:0=
+ virtual/jpeg:0
+ mpi? ( virtual/mpi )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.1-fix_format_errors.patch
+ "${FILESDIR}"/${PN}-4.1-initdistdata.patch
+ "${FILESDIR}"/${PN}-5.0-fix_freetype_incude.patch
+)
+
+S="${WORKDIR}/${MYPN}"
+
+src_prepare() {
+ default
+ sed -e '/cfitsio/d' \
+ -e '/wcssubs/d' \
+ -e '/jpeg/d' \
+ -e '/freetype/d' \
+ -i lib/src/Makefile || die
+
+ tc-export CC AR
+
+ find . -name Makefile\* | xargs sed -i \
+ -e "/^CC.*=/s:\(gcc\|cc\):$(tc-getCC):g" \
+ -e "/^CFLAGS.*=/s:-g:${CFLAGS} $($(tc-getPKG_CONFIG) --cflags wcstools):g" \
+ -e "s:-I../../lib/freetype/include :$($(tc-getPKG_CONFIG) --cflags freetype2):g" \
+ -e 's:$(CC) -o:$(CC) $(LDFLAGS) -o:g' \
+ -e "s:-lwcs:$($(tc-getPKG_CONFIG) --libs wcstools):g" \
+ -e "s:-lcfitsio:$($(tc-getPKG_CONFIG) --libs cfitsio):g" \
+ -e 's:-lnsl::g' \
+ -e "s:ar q:$(tc-getAR) q:g" || die
+
+ if use mpi; then
+ sed -e 's:# MPICC:MPICC:' \
+ -e 's:# BINS:BINS:' \
+ -i Montage/Makefile.* || die
+ fi
+}
+
+src_install () {
+ dobin bin/*
+ dodoc README* ChangeHistory
+ use doc && dodoc -r man/*
+}
diff --git a/sci-astronomy/pal/Manifest b/sci-astronomy/pal/Manifest
new file mode 100644
index 000000000000..15287674ba7d
--- /dev/null
+++ b/sci-astronomy/pal/Manifest
@@ -0,0 +1,3 @@
+DIST pal-0.9.7.tar.gz 1220443 SHA256 7151aa05c2e2456394cae2043feb96e64d779286fb31a27ff11ec3dd66021286 SHA512 d3f13e7ff321500acc71198240392fe9a3304c4142cf5b1f1c3950ddb1351dddac8565ef27b1c724d608cc1053d15647c777c4d0dc466a99a1b08b64e62ec37b WHIRLPOOL e6d9986e43e91f35ee47e6586d3595c62f12d4dabb54f3e9adb6d524fcf075e54e92c6e985005bd3c892a55fbcf469a7a49f0e7672e0923ae2b6f1a321b65c15
+EBUILD pal-0.9.7.ebuild 770 SHA256 4164b86edd9ea78da2972c83706ae50a2aba36f245c5d40b4052bc8f4cf52cae SHA512 71ef9e791db7a8c5bd137b3e363d17f243fc8d09f72cfe4da97d0fa21f4d87dce9a2518a27b43b28ada57593cb817e8ad3d4881b0c73f07ce1723ee028d03bca WHIRLPOOL d3a3da6dd27b73e28018360a5f8bab7d1e7f50e4122143da434af6428e36bdfe1219921279c31d452f78d7203b76190c3b5e1452fe8f004c8b91488dad3f8335
+MISC metadata.xml 641 SHA256 d3b80250ffa360a07327cccdcd452a30962003b6649fa7c509b762fc57075660 SHA512 30901b566b997f270d805e251b2beae284261ff30e8d0725abe6233ce082dc8723d59aa72157073636837573621db4823c9504c0caf8e8ae6084a03b0c3d9561 WHIRLPOOL 26b30473de92f977ef90a45ff602ce55a8747095f890aa49f8e4df9cb36891847d47c9309707c78d2efa36f8ffbafd9d70b9217e3f8e1ab9131c5b246e90bbf0
diff --git a/sci-astronomy/pal/metadata.xml b/sci-astronomy/pal/metadata.xml
new file mode 100644
index 000000000000..9f20e974544a
--- /dev/null
+++ b/sci-astronomy/pal/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The Positional Astronomy Library is a collection of code designed
+ to aid in replacing the SLA library with code from NOVAS and
+ ERFA. Where possible the API is similar to the C SLA API except
+ for the use of a "pal" prefix.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">Starlink/pal</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/pal/pal-0.9.7.ebuild b/sci-astronomy/pal/pal-0.9.7.ebuild
new file mode 100644
index 000000000000..c165f47d600a
--- /dev/null
+++ b/sci-astronomy/pal/pal-0.9.7.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Positional Astronomy Library"
+HOMEPAGE="https://github.com/Starlink/pal"
+SRC_URI="https://github.com/Starlink/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc static-libs"
+RDEPEND="sci-astronomy/erfa:="
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf --without-starlink \
+ --without-stardocs \
+ --with-erfa \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ # remove cruft from non-fhs complient
+ rm -r "${ED}"usr/share/pal || die
+ rm -r "${ED}"usr/{docs,manifests,news} || die
+ use static-libs || prune_libtool_files --all
+}
diff --git a/sci-astronomy/predict/Manifest b/sci-astronomy/predict/Manifest
new file mode 100644
index 000000000000..4a1ecedb89ba
--- /dev/null
+++ b/sci-astronomy/predict/Manifest
@@ -0,0 +1,8 @@
+AUX predict-2.2.3-earthtrack.patch 1175 SHA256 d43fe03b11b472fe6818cba1e0b27329c99b3c4eadba585c75434aa122109aab SHA512 908d5b323606d2655787fb50f456fba894b87398bc55298d9ce99d065b6a7625a3c564a0a047011d83a31af640f3b0f8a1b38e467ec7017159601bb9bc237fd3 WHIRLPOOL 72f39cbf3c9018f8089548a720e87b4937b31862a27949ceea0ef21e8edb01200621e7b59c494b96a788cb4aac9936dff8c1dd9fd80b5997bed842629d5391ea
+AUX predict-update 4039 SHA256 83dbf5f5e08f7d017391f7cfa7a30730f8930dec195dfa60bcd075188275d892 SHA512 8bcc89babe25f44ca985776b994265a12be8e3d6390e4301594f7a8d1402d7d42aa66f6ae1ab6f51c2d8d910d9f012920382928c0238fce4e1707cb8843a739a WHIRLPOOL f3244a54311356f5ff53e7a5510268380c720e58fcc7dcb0af3001d0f619c3f13072694363e32321d0c3ef9727779cdabd5a8b4fd8b733eaea4a3dfe85721578
+DIST predict_2.2.3-3.1.diff.gz 78624 SHA256 60c00a542c399e69dba154cc0827ea15f33dae61547f3604b8c232e9d26d06df SHA512 9fe2e3ffd931be7ab85f10db4cd35a2091a459c3fd0c48e9ecf8a4482c20400c267b38d31f72d28270d50b7305bc49418fefe35ff013ac9be1627d853205bd5f WHIRLPOOL 9e2ed3fd43d556bb8c5ad92c9502574650cdf13116b222bdcbb7ee18d9e431cbfe8de6262f034dd9ab7abcebc940864c61911e4a0e26de2c6e14c24b9d17bc9d
+DIST predict_2.2.3.orig.tar.gz 1444530 SHA256 47b7c185f1cf4d318b6b31a22a533c03c4a3f57394839df036367c7cdf2dd7ff SHA512 260f7f4dbc72cca4b0b5f7bc9dcf612b8a7e3ef12ab6f34afa3c06b1ac24427435af1c4bae9d39e7cbcdff6cccad72e3235dd191605464642f014207651d8c11 WHIRLPOOL 69ee83befef0ce413c826e6034b6b7ea2ab12749b9dc7071badc865208fd89141451c1f887cbefae6c7f1ec5d8adbd0d112a62fb89e805ddbef984e42ab05a63
+EBUILD predict-2.2.3-r2.ebuild 5685 SHA256 35a651a018ff8487a72b82d3410c1e337699dc1325409d0c313c4d35c59a3928 SHA512 ef04cba114fb677519cf60bce037085535e0fbbfca0b9f22b10274534112cee862d7a86f2cd5220f21eeb5a4c4c70b23c00e163e8f15b0ea4b2806531283ec2d WHIRLPOOL d2b1bed2337554434215a8bef2cf302da79a156ac24c24c36207ca09df5b1dd618aa34662ad6cdd4ea227fc9c4537a676ce0d45b70950bf2be543d953e396a58
+MISC ChangeLog 3400 SHA256 ed9ad542c205d0d10f480972687e4e98a2fe280b62c916bac35e79ea4abfe566 SHA512 346b141fec3ff3246ac7bde9bc04158a1d96661f2da16e0a2b8a379834df4e5bb64347a0c0914bf57b9093f5be7a283455a281e2efbf3e4f5dd76ad094cd3d93 WHIRLPOOL 090694de37a2f46d840c67d99cec7e47fb02369b9051edeb86844e4fc54298eeb209eb598205f875990fd03b44a24a5515545587ad6aad8711b76565a7b4eec0
+MISC ChangeLog-2015 4600 SHA256 7647e8a9f3605a171fc75917649f8e6fb7d35a8540650219ab7181590feac546 SHA512 4db3c65a3069083bceca5d2d22afc60f61dbc87e2b3a69357b807b61d6eb16506e6bf5c5369c2c9af52c6bb745cc9e380bd7c3ba6c23a8bb4d70285b8def455b WHIRLPOOL 06c3ab5a5f56d251982d6927484855dc065e8a0f38d7bd0c53b59b2e4781061349d310f4c780a3c0b8a5cd0e93ea2d3a0857be841ae329720fce15721ebdc206
+MISC metadata.xml 836 SHA256 c536f704b5eb00528fe4373b6074b42e6aaf6067ede2719bc713350d50863ed9 SHA512 7e67a924a0b385cb051848bd1dd73d6a93ae60d13a10db785e96ead08df289137f06c67f17d519055b85aa228c1eca79db6da97494a532759c7c06c95e9c51d8 WHIRLPOOL 9564968d7c823e90cdcaa088152256a5c596430fadc689cbdf54c070679948bdd7f7aad35853ad9397ec73311ffd607d303245b73a971f5628e6c4b5f7bba9fb
diff --git a/sci-astronomy/predict/files/predict-2.2.3-earthtrack.patch b/sci-astronomy/predict/files/predict-2.2.3-earthtrack.patch
new file mode 100644
index 000000000000..65f18bf9512d
--- /dev/null
+++ b/sci-astronomy/predict/files/predict-2.2.3-earthtrack.patch
@@ -0,0 +1,27 @@
+diff -Nur a/clients/earthtrack/earthtrack.c b/clients/earthtrack/earthtrack.c
+--- a/clients/earthtrack/earthtrack.c 2013-06-08 20:03:55.629967192 +0200
++++ b/clients/earthtrack/earthtrack.c 2013-06-08 20:05:15.559966743 +0200
+@@ -495,11 +495,11 @@
+
+ fprintf(fd,"marker_file=%s\n",markerfile);
+ fprintf(fd,"arc_file=%s\n",greatarcfile);
+- fprintf(fd,"marker_font=/usr/local/share/xplanet/fonts/FreeMonoBold.ttf\n");
+- fprintf(fd,"\n## Your \"/usr/local/share/xplanet/config/default\" configuration file follows:\n\n");
++ fprintf(fd,"marker_font=/usr/share/xplanet/fonts/FreeMonoBold.ttf\n");
++ fprintf(fd,"\n## Your \"/usr/share/xplanet/config/default\" configuration file follows:\n\n");
+ fclose(fd);
+
+- x=AppendFile("/usr/local/share/xplanet/config/default",configfile);
++ x=AppendFile("/usr/share/xplanet/config/default",configfile);
+
+ if (x==1)
+ {
+@@ -509,7 +509,7 @@
+
+ if (x==2)
+ {
+- fprintf(stderr,"%c*** Error: Could not read \"/usr/local/share/xplanet/config/default\"\nIs xplanet installed?\n\n",7);
++ fprintf(stderr,"%c*** Error: Could not read \"/usr/share/xplanet/config/default\"\nIs xplanet installed?\n\n",7);
+ exit(-1);
+ }
+ }
diff --git a/sci-astronomy/predict/files/predict-update b/sci-astronomy/predict/files/predict-update
new file mode 100644
index 000000000000..b0634e148e46
--- /dev/null
+++ b/sci-astronomy/predict/files/predict-update
@@ -0,0 +1,92 @@
+#!/bin/sh
+oldpwd=$PWD
+
+if [ ! -f ~/.predict/predict.tle ]; then
+ mkdir -p ~/.predict
+ cd ~/.predict
+ cat > predict.tle << EOF
+OSCAR-10
+1 14129U 02217.21791401 .00000442 00000-0 00000-0 0 7
+2 14129 25.6686 197.8739 6086930 273.5039 23.0795 2.05866525116000
+OSCAR-11
+1 14781U 02217.20425383 .00001813 00000-0 00000-0 0 6
+2 14781 98.0880 185.1059 0010359 119.2373 240.9876 14.76997913987094
+OSCAR-14
+1 20437U 02217.20572416 .00000181 00000-0 00000-0 0 8
+2 20437 98.3009 264.9286 0011799 68.5863 291.6580 14.31121869654267
+PACSAT
+1 20439U 02217.25154490 .00000231 00000-0 00000-0 0 9
+2 20439 98.3472 275.4922 0012032 74.6777 285.5743 14.31332429654304
+LUSAT
+1 20442U 02216.75520291 .00000242 00000-0 00000-0 0 5
+2 20442 98.3779 280.4632 0012985 73.9191 286.3409 14.31575156654338
+OSCAR-20
+1 20480U 02217.54003808 -.00000027 00000-0 00000-0 0 7
+2 20480 99.0206 212.5786 0540948 90.2870 276.0202 12.83318863585245
+OSCAR-22
+1 21575U 02216.97001758 .00000422 00000-0 00000-0 0 9
+2 21575 98.1264 214.2386 0008207 17.4055 342.7413 14.38915947579867
+OSCAR-23
+1 22077U 02216.94266766 -.00000037 00000-0 00000-0 0 9
+2 22077 66.0844 179.5905 0009538 319.0308 40.9993 12.86398497468888
+OSCAR-25
+1 22828U 02217.51170770 .00000176 00000-0 00000-0 0 9
+2 22828 98.2949 253.2889 0010744 97.6953 262.5454 14.29395258429974
+ITAMSAT
+1 22826U 02216.71294910 .00000212 00000-0 00000-0 0 2
+2 22826 98.2981 252.2691 0009565 119.2021 241.0116 14.29035332461667
+OSCAR-27
+1 22825U 02217.14273416 .00000182 00000-0 00000-0 0 3
+2 22825 98.2952 251.6595 0009305 119.9116 240.3013 14.28824165461683
+OSCAR-29
+1 24278U 02216.92953700 -.00000035 00000-0 00000-0 0 1
+2 24278 98.5168 30.2010 0351470 9.0561 351.6706 13.52846361294584
+OSCAR-36
+1 25693U 02217.47022698 .00000460 00000-0 00000-0 0 8
+2 25693 64.5605 253.8004 0008708 253.5019 106.5150 14.74585281177168
+OSCAR-40
+1 26609U 02217.05030362 -.00000251 00000-0 00000-0 0 6
+2 26609 7.5635 101.4360 7924755 75.7827 352.4675 1.25596086 8104
+RS-12/13
+1 21089U 02216.81449027 .00000082 00000-0 00000-0 0 9
+2 21089 82.9235 328.1138 0030158 114.6154 245.8150 13.74373061576622
+RS-15
+1 23439U 02216.86493965 -.00000037 00000-0 00000-0 0 6
+2 23439 64.8185 1.1847 0152424 152.9684 207.9281 11.27546726313309
+NOAA-12
+1 21263U 02216.96410173 .00000410 00000-0 00000-0 0 4
+2 21263 98.6066 205.1774 0011736 236.4413 123.5645 14.24842312583078
+NOAA-14
+1 23455U 02216.94655308 .00000224 00000-0 00000-0 0 1
+2 23455 99.1906 225.2382 0010223 66.1025 294.1215 14.13170722391563
+NOAA-15
+1 25338U 02216.96832533 .00000312 00000-0 00000-0 0 0
+2 25338 98.5657 239.3255 0010503 167.6220 192.5219 14.24094451219673
+UARS
+1 21701U 02217.09598012 .00001106 00000-0 00000-0 0 8
+2 21701 56.9808 110.9304 0004474 115.3921 244.7510 15.02171395596038
+HUBBLE
+1 20580U 02217.09786941 .00002710 00000-0 00000-0 0 4
+2 20580 28.4663 239.6798 0003524 339.3283 57.0940 14.96472945473016
+ISS
+1 25544U 02217.52476852 .00025143 00000-0 00000-0 0 9
+2 25544 51.6355 165.2615 0018093 106.6267 56.5198 15.57209040211722
+PCSAT
+1 26931U 02217.22743486 .00000269 00000-0 00000-0 0 9
+2 26931 67.0531 43.5764 0007786 258.8522 101.1704 14.28921812 44150
+STARSHINE 3
+1 26929U 02216.67548843 .00042169 00000-0 00000-0 0 9
+2 26929 67.0426 246.5544 0011326 237.9129 122.0981 15.57367567 47636
+EOF
+fi
+
+mkdir /tmp/predict-$$ || exit 1
+cd /tmp/predict-$$
+
+wget -qc www.celestrak.com/NORAD/elements/amateur.txt -O ./amateur.txt
+wget -qc www.celestrak.com/NORAD/elements/visual.txt -O ./visual.txt
+wget -qc www.celestrak.com/NORAD/elements/weather.txt -O ./weather.txt
+predict -u ./amateur.txt ./visual.txt ./weather.txt
+
+cd ${oldpwd}
+rm -fr /tmp/predict-$$
diff --git a/sci-astronomy/predict/metadata.xml b/sci-astronomy/predict/metadata.xml
new file mode 100644
index 000000000000..f5e4e6e1fe77
--- /dev/null
+++ b/sci-astronomy/predict/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Predict is a satellite tracking program. It is probably mostly of interest
+ to users of amateur satellites, but includes support for optionally
+ announcing azimuth and elevation to help in manual antenna pointing,
+ or optical observation of satellites.
+</longdescription>
+<use>
+ <flag name="xforms">Add a "map" client which uses the
+ <pkg>x11-libs/xforms</pkg> library for its GUI</flag>
+ <flag name="xplanet">Project predict data onto world maps generated by
+ <pkg>x11-misc/xplanet</pkg> / <pkg>x11-misc/xearth</pkg></flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/predict/predict-2.2.3-r2.ebuild b/sci-astronomy/predict/predict-2.2.3-r2.ebuild
new file mode 100644
index 000000000000..bca4d52f5976
--- /dev/null
+++ b/sci-astronomy/predict/predict-2.2.3-r2.ebuild
@@ -0,0 +1,207 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools toolchain-funcs
+
+DEB_P=${PN}_${PV}
+DEB_PR=3.1
+
+DESCRIPTION="Satellite tracking and orbital prediction"
+HOMEPAGE="http://www.qsl.net/kd2bd/predict.html"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${DEB_P}.orig.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${DEB_P}-${DEB_PR}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="doc gtk nls xforms xplanet"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="sys-libs/ncurses:0=
+ gtk? ( x11-libs/gtk+:2 )
+ xforms? ( x11-libs/xforms )
+ xplanet? ( x11-misc/xplanet[truetype] )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/"${P}"-earthtrack.patch
+ "${WORKDIR}"/${DEB_P}-${DEB_PR}.diff
+)
+
+src_prepare() {
+ default
+ sed -i -e 's:predict\(.*\)/:predict-2.2.3\1/:g' \
+ debian/patches/140*.diff || die
+ sed -i -e 's:\(a\|b\)/:predict-2.2.3/:g' \
+ debian/patches/180*.diff || die
+ eapply debian/patches/.
+ # fix some further array out of bounds errors
+ sed -i -e "s/satname\[ 26/satname\[ 25/g" \
+ clients/gsat-1.1.0/src/db.c || die
+ sed -i -e "s/satname\[ 26/satname\[ 25/g" \
+ clients/gsat-1.1.0/src/comms.c || die
+ sed -i -e "s/output\[20\];/output[21];/" \
+ utils/moontracker/moontracker.c || die
+ # fix underlinking
+ sed -i -e '/AC_OUTPUT/i \
+AC_SEARCH_LIBS([cos], [m]) \
+AC_SEARCH_LIBS([dlclose], [dl])' \
+ -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' \
+ -e 's/configure.in/configure.ac/' \
+ clients/gsat-1.1.0/configure.in || die
+
+ mv clients/gsat-1.1.0/configure.{in,ac} || die
+
+ sed -i \
+ -e 's/gcc/$(CC) $(CFLAGS) $(LDFLAGS)/g' \
+ -e 's/-o/-lm -o/g' \
+ clients/gsat-1.1.0/plugins/Makefile || die
+
+ # fix the hardcoded /usr/lib
+ PRED_DIR=/usr/$(get_libdir)/${PN}
+ sed -i -e "s:/usr/lib/${PN}:${EPREFIX}/${PRED_DIR}:g" \
+ predict.h vocalizer/vocalizer.c || die
+
+ sed -i -e "s:/usr/lib:${EPREFIX}/usr/$(get_libdir):g" \
+ clients/gsat-1.1.0/src/globals.h || die
+
+ if use gtk; then
+ cd "${S}"/clients/gsat-* || die
+ rm config.sub missing || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ if use gtk; then
+ cd "${S}"/clients/gsat-* || die
+ econf $(use_enable nls)
+ fi
+}
+
+src_compile() {
+ # predict uses a ncurses based configure script
+ # this is what it does if it was bash based ;)
+
+ local COMPILER="$(tc-getCC) ${CFLAGS} ${LDFLAGS}"
+ einfo "Compiling predict"
+ ${COMPILER} predict.c -lm $($(tc-getPKG_CONFIG) --libs ncurses) -lpthread \
+ -o predict || die "failed predict"
+ einfo "Compiling predict-g1yyh"
+ ${COMPILER} predict-g1yyh.c -lm $($(tc-getPKG_CONFIG) --libs ncurses) -lpthread -lmenu \
+ -o predict-g1yyh || die "failed predict-g1yyh"
+ einfo "Compiling vocalizer"
+ ${COMPILER} vocalizer/vocalizer.c \
+ -o vocalizer/vocalizer || die "failed vocalizer"
+ local c
+ for c in fodtrack geosat moontracker; do
+ einfo "Compiling ${c}"
+ cd "${S}"/utils/${c}* || die
+ ${COMPILER} ${c}.c -lm -o ${c} || die "failed ${c}"
+ done
+ einfo "Compiling kep_reload"
+ cd "${S}"/clients/kep_reload
+ ${COMPILER} kep_reload.c \
+ -o kep_reload || die "failed kep_reload"
+
+ if use xplanet; then
+ einfo "Compiling earthtrack"
+ cd "${S}"/clients/earthtrack || die
+ ${COMPILER} earthtrack.c \
+ -lm -o earthtrack || die "failed earthtrack"
+ fi
+
+ if use xforms; then
+ einfo "Compiling map"
+ cd "${S}"/clients/map || die
+ ${COMPILER} map.c map_cb.c map_main.c -lforms -lX11 -lm \
+ -o map || die "Failed compiling map"
+ fi
+
+ if use gtk; then
+ einfo "Compiling gsat"
+ cd "${S}"/clients/gsat-* || die
+ emake
+ emake -C plugins
+ fi
+}
+
+src_install() {
+ dobin predict predict-g1yyh "${FILESDIR}"/predict-update
+ dodoc CHANGES CREDITS HISTORY README NEWS debian/README.Debian
+ doman docs/man/predict.1
+ newman debian/predict-g1yyh.man predict-g1yyh.1
+ insinto ${PRED_DIR}/default
+ doins default/predict.*
+ use doc && dodoc docs/pdf/predict.pdf
+
+ cd "${S}"/vocalizer || die
+ dobin vocalizer
+ dosym ../../../bin/vocalizer ${PRED_DIR}/vocalizer/vocalizer
+ insinto ${PRED_DIR}/vocalizer
+ doins *.wav
+
+ cd "${S}"/clients/kep_reload || die
+ dobin kep_reload
+ newdoc README README.kep_reload
+ doman "${S}"/debian/kep_reload.1
+
+ cd "${S}"/utils/fodtrack-0.1 || die
+ insinto /etc
+ doins fodtrack.conf
+ doman fodtrack.conf.5 fodtrack.8
+ dobin fodtrack
+ newdoc README README.fodtrack
+
+ cd "${S}"/utils/geosat || die
+ dobin geosat
+ newdoc README README.geosa
+ newman "${S}"/debian/geosat.man geosat.1
+
+ cd "${S}"/utils/moontracker || die
+ dobin moontracker
+ newdoc README README.moontracker
+ doman "${S}"/debian/moontracker.1
+
+ if use xplanet; then
+ cd "${S}"/clients/earthtrack || die
+ ln -s earthtrack earthtrack2 || die
+ dobin earthtrack earthtrack2
+ newdoc README README.earthtrack
+ doman "${S}"/debian/earthtrack.1
+ fi
+
+ if use xforms; then
+ cd "${S}"/clients/map || die
+ newbin map predict-map
+ newdoc CHANGES CHANGES.map
+ newdoc README README.map
+ doman "${S}"/debian/predict-map.1
+ fi
+
+ if use gtk; then
+ cd "${S}"/clients/gsat-* || die
+ exeinto /usr/$(get_libdir)/gsat/plugins
+ doexe plugins/radio_{FT736,FT847,ICR10,print,test} plugins/rotor_{print,pictrack}
+ dobin src/gsat
+ doman "${S}"/debian/gsat.1
+ local i
+ for i in AUTHORS ChangeLog NEWS README Plugin_API; do
+ newdoc ${i} ${i}.gsat
+ done
+ fi
+}
+
+pkg_postinst() {
+ einfo "To use the clients the following line will"
+ einfo "have to be inserted into /etc/services"
+ einfo "predict 1210/udp"
+ einfo "The port can be changed to anything"
+ einfo "the name predict is what is needed to work"
+ einfo "after that is set run 'predict -s'"
+ einfo ""
+ einfo "To get list of satellites run 'predict-update'"
+ einfo "before running predict this script will also update"
+ einfo "the list of satellites so they are up to date."
+}
diff --git a/sci-astronomy/psfex/Manifest b/sci-astronomy/psfex/Manifest
new file mode 100644
index 000000000000..4e1d4a485554
--- /dev/null
+++ b/sci-astronomy/psfex/Manifest
@@ -0,0 +1,7 @@
+AUX psfex-3.17.1-have-mmap.patch 1406 SHA256 5fbd289f5659f1ebe0856832dfcfee5ef6032bad83b6f7df36efc1a8720ad3b5 SHA512 b944a9c75b379932faa0af70d6e215ccbe113b2b063939d8a21810a1c03deecdb0c5a2947b4ebdf4c1396426bd2382e3014e906ac68ef17962670e3705d95a45 WHIRLPOOL 74d47decc00b6e1e12d4a2973b3baaa98378795c3e56ffc5c408d320658ac591ff82d099ee34b78c83ec1ff1f2b348cff9f1822edc10fb68a6b13d2f0579db4c
+AUX psfex-3.17.1-plplot510.patch 5697 SHA256 44cb242e1d3cb24e6d8ac44b7f54e375dfc68588be1d869407f4bb249674e808 SHA512 269457b0592c6458f36c459ca3721df529d8f9ff06e0ed651d4151224bba537e4663a0eb2afb3c55e6e921c56c643fa77f9cb0b39528ae3c09894cc944446328 WHIRLPOOL e12ace2080cb740f81a9e590955182a7a64ab5b62c4d99048d0ed7e6579bc30e691f91d54fd2016f88cb4ca61e8dce9e8e49c1f94a593e25a5bf166c456c11af
+AUX psfex-3.17.1-sigbus.patch 736 SHA256 6dbece30c6d805cebc9211648c08b5b5013f8c2dfc3c5d91ddb6e80c337a5d28 SHA512 bca9ad7a758294812761b9f860cc40cd931a5753f248a4682858e9fd1b917a485d5e0b891e17b90c96b54d0e7f05d1aa2e2e7e6143fdc52ec57d4a609c9f4df6 WHIRLPOOL 7cf8f0a365dca534b94557c2897d2f848f44def25e18549060646f4b8e3e5fcc5460c65bc424286037c8d5caafc86ca23fc2aed6fbb2e34addcc8d6ba47fc9a4
+DIST psfex-3.17.1.tar.gz 2366370 SHA256 53f1b449ab7da7e6e0a989c41b82885f52c8f08270ceb4378bb1ec7ef754af89 SHA512 eb562372dd75593a111c23698b0c00ce050547051803a741ac771ca346d13a0de1e478b055581619a9fa2bf6fa374915ca685cfcf1c4162271b6aa44303e6e58 WHIRLPOOL 3245b2b8c5a85e5f0a88b0c11aff07ce10ced0682890b786d0b092285d46fedf72bf15e87dd3ef6f6296527bc632e12c5162fa0b3b660b5b8bff0b30f38510c9
+EBUILD psfex-3.17.1.ebuild 1616 SHA256 03da6514fa4eb91601f8d04422475e5b10f6f9cb4b1852db5bdb9841714c56f9 SHA512 1517b4777174f2ad3274e3a67e496d180fa0b0fb72cedee3db4bb9e36ed109d21a621f23fe49051afb4cce3a91a2bcb7cbae4997c35d5d430f884977ba5a18b4 WHIRLPOOL 73b4ab23588f6c70acf975765008cacf566ab89157da3e97d46106cb3c9efc08747f72ae5055a485d95869fb04c6c1d5376dec0d89bbc572986d0ce7489d9d89
+MISC ChangeLog 563 SHA256 9a077db8e2853d6717d385b82ac5d08b2538a6e44e65ed0e63717f24b6a4a21d SHA512 f7b88cbd22aa2d96bfbc166b1ea3df1d021d7cf127af83627784307b2e122bc8e6d3615261bf708cad020f7ca6982e8c667c4430221ea1415fbaad036d554a63 WHIRLPOOL 257770ff14ba31f6b135b18a053c8227edfed05b0033bf56d7b402dde9ed88413db866dcaf57ca14c0326339414dab5617a407ec17a9cbdc4073e5bbaa9ce9c2
+MISC metadata.xml 720 SHA256 1bce61bb7b3074a7732fe29d9ad86235f2397f7be90c746a844b97216656524c SHA512 7cc57534487d05bed6729a0c2462fb9ff14402145de76071af155b9451ead40cd276cb5b682fa542085066b35eed6dfefa0e73f9a20a788a5f636f38581efa9b WHIRLPOOL 2725cc2aa00cf8ce7f75cfc63615a8d2e9753ae39f1638c939d42ade3392136631c8d4b93a4491efb04a76565ac733dc111a33cce2e304b6a6bdc11b54a62a56
diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch b/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch
new file mode 100644
index 000000000000..1b6565089849
--- /dev/null
+++ b/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch
@@ -0,0 +1,55 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Use mmap only if it exists.
+--- a/src/fits/fitsbody.c
++++ b/src/fits/fitsbody.c
+@@ -64,9 +64,12 @@
+ ***/
+ PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
+ {
++#ifdef HAVE_MMAP
+ FILE *file;
+ PIXTYPE *buffer;
+- size_t npix, size, sizeleft, spoonful;
++ size_t sizeleft, spoonful;
++#endif
++ size_t npix, size;
+
+ if (!body_ramflag)
+ {
+@@ -87,7 +90,9 @@
+ /* Decide if the data will go in physical memory or on swap-space */
+ npix = tab->tabsize/tab->bytepix;
+ size = npix*sizeof(PIXTYPE);
++#if !HAVE_MMAP
+ if (size < body_ramleft)
++#endif
+ {
+ /*-- There should be enough RAM left: try to do a malloc() */
+ if ((tab->bodybuf = malloc(size)))
+@@ -105,6 +110,7 @@
+ tab->bodybuf = NULL;
+ }
+
++#if HAVE_MMAP
+ if (size < body_vramleft)
+ {
+ /*-- Convert and copy the data to a swap file, and mmap() it */
+@@ -144,6 +150,7 @@
+ return NULL;
+ return (PIXTYPE *)tab->bodybuf;
+ }
++#endif
+
+ /* If no memory left at all: forget it! */
+ return NULL;
+@@ -270,8 +277,10 @@
+ size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
+ if (tab->swapflag)
+ {
++#if HAVE_MMAP
+ if (munmap(tab->bodybuf, size))
+ warning("Can't unmap ", tab->cat->filename);
++#endif
+ tab->swapflag = 0;
+ tab->bodybuf = NULL;
+ body_vramleft += size;
diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch
new file mode 100644
index 000000000000..4dd5805a9367
--- /dev/null
+++ b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch
@@ -0,0 +1,221 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Replace deprecated plwid() calls by plwidth().
+--- a/src/cplot.c
++++ b/src/cplot.c
+@@ -527,7 +527,7 @@
+
+ /* Draw meridians */
+ plschr(0.0, 0.33);
+- plwid(0);
++ plwidth(0.0);
+ pllsty(2);
+ xmd = xmu = xdo = -0.5;
+ ymd = ymu = ydo = -0.5;
+@@ -709,14 +709,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: FWHM map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -830,7 +830,7 @@
+ plFree2dGrid(fwhm, nsnap2, nsnap2);
+ }
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -941,14 +941,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: ellipticity map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1062,7 +1062,7 @@
+ plFree2dGrid(ellip, nsnap2, nsnap2);
+ }
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -1159,14 +1159,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: map of Moffat fit residuals", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1278,7 +1278,7 @@
+ plFree2dGrid(resi, nsnap2, nsnap2);
+ }
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -1378,14 +1378,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: PSF asymmetry map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1497,7 +1497,7 @@
+ plFree2dGrid(resi, nsnap2, nsnap2);
+ }
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -1592,14 +1592,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: source count map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1666,7 +1666,7 @@
+ clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
+ plFree2dGrid(count, nsnap2, nsnap2);
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -1751,14 +1751,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: source count fraction map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1826,7 +1826,7 @@
+ clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
+ plFree2dGrid(count, nsnap2, nsnap2);
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -1911,14 +1911,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: #gx#u2#d/d.o.f. map", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -1985,7 +1985,7 @@
+ clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
+ plFree2dGrid(count, nsnap2, nsnap2);
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
+@@ -2070,14 +2070,14 @@
+ ymin = 0.5;
+ ymax = 100.5;
+ lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
+- plwid(lwid);
++ plwidth((double)lwid);
+ plfont(2);
+ plcol0(15);
+ plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
+ sprintf(str, "#uField %.24s: map of residuals", field->rtcatname);
+ plschr(0.0, 1.0);
+ pllab("","", str);
+- plwid(0);
++ plwidth(0.0);
+ plcol0(7);
+ cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
+
+@@ -2144,7 +2144,7 @@
+ clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
+ plFree2dGrid(count, nsnap2, nsnap2);
+ plcol0(7);
+- plwid(lwid);
++ plwidth((double)lwid);
+ cplot_drawbounds(wcs, wcsout);
+ }
+
diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch b/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch
new file mode 100644
index 000000000000..2796f63884e3
--- /dev/null
+++ b/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch
@@ -0,0 +1,26 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Handle the "sigbus" case only if it exists
+--- a/src/fits/fitscleanup.c
++++ b/src/fits/fitscleanup.c
+@@ -164,7 +164,9 @@
+ /* Catch CTRL-Cs */
+ signal(SIGINT, signal_function);
+ /* Catch bus errors */
++#ifdef SIGBUS // TODO: what if it is an enum?
+ signal(SIGBUS, signal_function);
++#endif
+ /* Catch segmentation faults */
+ signal(SIGSEGV, signal_function);
+ /* Catch floating exceptions */
+@@ -195,9 +197,11 @@
+ case SIGINT:
+ fprintf(stderr, "^C\n");
+ exit(-1);
++#ifdef SIGBUS
+ case SIGBUS:
+ fprintf(stderr, "bus error\n");
+ exit(-1);
++#endif
+ case SIGSEGV:
+ fprintf(stderr, "segmentation fault\n");
+ exit(-1);
diff --git a/sci-astronomy/psfex/metadata.xml b/sci-astronomy/psfex/metadata.xml
new file mode 100644
index 000000000000..81a909fb6d5a
--- /dev/null
+++ b/sci-astronomy/psfex/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ PSFEx (“PSF Extractor”) extracts models of the Point Spread
+ Function (PSF) from FITS images processed with <pkg>sci-astronomy/sextractor</pkg>, and
+ measures the quality of images. The generated PSF models can be used
+ for model-fitting photometry or morphological analyses.
+</longdescription>
+<use>
+ <flag name="plplot">Build with <pkg>sci-libs/plplot</pkg> to allow diagnostic plots during processing</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/psfex/psfex-3.17.1.ebuild b/sci-astronomy/psfex/psfex-3.17.1.ebuild
new file mode 100644
index 000000000000..904072cc38fe
--- /dev/null
+++ b/sci-astronomy/psfex/psfex-3.17.1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Extracts models of the Point Spread Function from FITS images"
+HOMEPAGE="http://www.astromatic.net/software/psfex"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="doc threads plplot"
+
+RDEPEND="
+ sci-libs/atlas:0[lapack,threads=]
+ sci-libs/fftw:3.0
+ plplot? ( sci-libs/plplot:= )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/${P}-have-mmap.patch"
+ "${FILESDIR}/${P}-plplot510.patch"
+ "${FILESDIR}/${P}-sigbus.patch"
+)
+
+src_prepare() {
+ default
+ local mycblas=atlcblas myclapack=atlclapack
+ if use threads; then
+ [[ -e ${EPREFIX}/usr/$(get_libdir)/libptcblas.so ]] && \
+ mycblas=ptcblas
+ [[ -e ${EPREFIX}/usr/$(get_libdir)/libptclapack.so ]] &&
+ myclapack=ptclapack
+ fi
+ # fix the configure and not the acx_atlas.m4. the eautoreconf will
+ # produce a configure giving a wrong install Makefile target (to fix)
+ sed -e "s/-lcblas/-l${mycblas}/g" \
+ -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
+ -e "s/-llapack/-l${myclapack}/g" \
+ -e "s/\(lapack_lib=\).*/\1${myclapack}/g" \
+ -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
+ -i acx_atlas.m4 || die
+
+ # fix for newer plplot
+ sed -e 's/plplotd/plplot/g' -i acx_plplot.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
+ $(use_enable plplot) \
+ $(use_enable threads)
+}
+
+src_install () {
+ default
+ use doc && dodoc doc/*
+}
diff --git a/sci-astronomy/pyephem/Manifest b/sci-astronomy/pyephem/Manifest
new file mode 100644
index 000000000000..6ec7daaf4039
--- /dev/null
+++ b/sci-astronomy/pyephem/Manifest
@@ -0,0 +1,7 @@
+DIST pyephem-3.7.5.3.tar.gz 735112 SHA256 cb0d7950d108aa5cbb1eb6e558086e98230de03ee1ede017a71701257b67eceb SHA512 a61b6a19c35c10ee9d4eba72cb0e6b9446076a3943be58dfd5e084bc9ab09dc70f2ee335ba5f0ef9d9d4d34a461bf4b9ddd57dae50d2e8a8f565d411e47f2908 WHIRLPOOL be28698df6214e769d03e74a67b353679a753723420e6a289b347b42c466c11253df9764f9e4e0fdda0424f4b62363b54fa58b520f45d480aae3a5883a84deae
+DIST pyephem-3.7.6.0.tar.gz 739561 SHA256 143146da32a07a4cf9725b5656ba095d24978c22a0363414203e72c39bae52bd SHA512 c3013ef943c0e1e2c30bba6f72912efb100b4c8c45904b7d6d7ba73d8b741564793a6e538117eb88abb824c93c874e2c955de734418ebd2370888718a149c9a8 WHIRLPOOL de8b8a4c86004adb2400a52f22514e5a25752d8e31fe7adbdffd08efa598d8d8c72726398f0ea49dfe3dcc6372c83d2586043ed987be3492c697c2818a2616e8
+EBUILD pyephem-3.7.5.3.ebuild 1145 SHA256 ad1cb10172a6e2b7079be198ff34b99383339f213d859354e4d93575d6ed39d9 SHA512 1bb3dd5dd13736c2ae8660fc6874a5580b11df4c8ec7fbcda07eca4e38768af5b13a585d86efa111eed85c38369241f5a6ee0ce8e8b8116a7b893e2b43894085 WHIRLPOOL 716dd45cd8d04946e2d81a0422b2c4f232e4349b2ae640220edf547ad40a48785a9a3e22c51639c17f2a7cfcaacd323a8efea6e1dc3e6dcbf643ae057a29327b
+EBUILD pyephem-3.7.6.0.ebuild 1155 SHA256 c64a38dba3d65d6e6d555759d9e628dec107d8ad6045a8f217c594dcfd42caea SHA512 e0850c6a9ba29e862038685c8774e08a1f9c517dea08372237fad153269988452f44ab242037a7cd73eb1bcc3404d2c2b81228023a98bdab21bf116ba4cf2532 WHIRLPOOL e61d8675c1144e037bcb57c8e8e69a6d40c030ac83415e59df43b014e8a67b7e9faf0a23d3d06c38d7e0d9a0ea2ad291e8e4c633334654decfc8283b523c7089
+MISC ChangeLog 2893 SHA256 b9bd6fd2238b8d4f305f9e3c1ca78e06b9adac8e2b2bd1f1d4bcd562ec75c164 SHA512 e527927d8c7464c16ac30917bbc9489baa35f2f4f0bb1d34ad2a6243d559db192493291c6809b2fbab099643de2efccfc265a255d2505cc54031d4a8c469ad42 WHIRLPOOL b428f08a2da44103c3e010d73d67818168fb29180f645f5620026f98d2ed56deda638fc7eacc686918c1358aa1bbd0247ab3f3a41b7746b950bd4499ae481f1b
+MISC ChangeLog-2015 4483 SHA256 450e891e00f3efd69b10f3206a38f77f841aa6c877f966a1b85e4e19ac48cf7a SHA512 5fdefd1adddddf353a3f266cfd01e2a06ac846a33aea65c1185929652bd636fddb115f5d3285adfcd92a328675e82922bde8e460b0d3cae8ad94ea76a8b11fad WHIRLPOOL b9a34e2972738e1417be1b3b2db9d7786ac82388b50cef45697d175898fdb21602e3d30ffe691a34186d24b38b332b2e311892219cfb8f14771e33e5f81b2d56
+MISC metadata.xml 947 SHA256 05411981e1270d0ccc7012639f657f3fcfac0e5e309ffe522550b03f3c603ff3 SHA512 f41c27b07f211b09dd72e316d02c46206dea0ff368e2ad1a8d116df49a2ce2a74137b2647572e295bcde34792d4ee15fb2d3f9e1a883c6cb306f6ef2a43d5c53 WHIRLPOOL 97f25339e31b652ce0879ac5147d8c9e7923905f27835ea07fe33626e3fb3c5207a48c72894e775c03f30d7bad13a11a36287eea74d68c24f015559996cd2de5
diff --git a/sci-astronomy/pyephem/metadata.xml b/sci-astronomy/pyephem/metadata.xml
new file mode 100644
index 000000000000..62f6a69d465d
--- /dev/null
+++ b/sci-astronomy/pyephem/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ PyEphem provides astronomical computations for the Python programming
+ language. Given a date and location on the Earth's surface, it can
+ compute the positions of the Sun and Moon, of the planets and their
+ moons, and of any asteroids, comets, or earth satellites whose orbital
+ elements the user can provide. Additional functions are provided to
+ compute the angular separation between two objects in the sky, to
+ determine the constellation in which an object lies, and to find the
+ times at which an object rises, transits, and sets on a particular
+ day.
+</longdescription>
+<upstream>
+ <remote-id type="pypi">pyephem</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/pyephem/pyephem-3.7.5.3.ebuild b/sci-astronomy/pyephem/pyephem-3.7.5.3.ebuild
new file mode 100644
index 000000000000..10c8bdb996b0
--- /dev/null
+++ b/sci-astronomy/pyephem/pyephem-3.7.5.3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_4} )
+
+inherit distutils-r1
+
+DESCRIPTION="Astronomical routines for the python programming language"
+HOMEPAGE="http://rhodesmill.org/pyephem/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="doc test"
+
+DEPEND="
+ doc? ( dev-python/sphinx )"
+RDEPEND=""
+
+src_prepare() {
+ # don't install rst files
+ sed -i -e "s:'doc/\*\.rst',::" setup.py || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ if use doc; then
+ PYTHONPATH=. emake -C ephem/doc html
+ fi
+}
+
+python_test() {
+ if [[ ${PYTHON_ABI} == "2.7" ]]; then
+ PYTHONPATH="$(ls -d ${BUILD_DIR}/lib*)" \
+ ${EPYTHON} -m unittest discover -s src/ephem
+ else
+ PYTHONPATH="$(ls -d ${BUILD_DIR}/lib*)" \
+ unit2 discover -s src/ephem
+ fi
+}
+
+src_install() {
+ distutils-r1_src_install
+ use doc && dohtml -r ephem/doc/_build/html/*
+
+ delete_tests() {
+ rm -r "${D}$(python_get_sitedir)/ephem/tests" || die
+ }
+ python_foreach_impl delete_tests
+}
diff --git a/sci-astronomy/pyephem/pyephem-3.7.6.0.ebuild b/sci-astronomy/pyephem/pyephem-3.7.6.0.ebuild
new file mode 100644
index 000000000000..f7b4607c62f7
--- /dev/null
+++ b/sci-astronomy/pyephem/pyephem-3.7.6.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit distutils-r1
+
+DESCRIPTION="Astronomical routines for the python programming language"
+HOMEPAGE="http://rhodesmill.org/pyephem/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="doc test"
+
+DEPEND="doc? ( dev-python/sphinx )"
+RDEPEND=""
+
+src_prepare() {
+ # don't install rst files by dfefault
+ sed -i -e "s:'doc/\*\.rst',::" setup.py || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ if use doc; then
+ PYTHONPATH=. emake -C ephem/doc html
+ fi
+}
+
+python_test() {
+ if [[ ${PYTHON_ABI} == "2.7" ]]; then
+ PYTHONPATH="$(ls -d ${BUILD_DIR}/lib*)" \
+ ${EPYTHON} -m unittest discover -s ephem
+ else
+ PYTHONPATH="$(ls -d ${BUILD_DIR}/lib*)" \
+ unit2 discover -s ephem
+ fi
+}
+
+src_install() {
+ use doc && HTML_DOCS=( ephem/doc/_build/html/. )
+ distutils-r1_src_install
+
+ delete_tests() {
+ rm -r "${D}$(python_get_sitedir)/ephem/tests" || die
+ }
+ python_foreach_impl delete_tests
+}
diff --git a/sci-astronomy/scamp/Manifest b/sci-astronomy/scamp/Manifest
new file mode 100644
index 000000000000..7902058e6e0d
--- /dev/null
+++ b/sci-astronomy/scamp/Manifest
@@ -0,0 +1,4 @@
+DIST scamp-2.0.4.tar.gz 4876618 SHA256 cbcd57f5042feefa081dc0c5ff07f7f50114a7ef41e79c060ed163caae119d41 SHA512 ed0a824ddcc3f9c791121323bb59969e89f509a2c429c0abb45655e6852bc452bd46c539dbebfd23097af1c7dbef9d3d905030083828974f75233ea4af4484d5 WHIRLPOOL bc87946ebacd2d723693898aac5a4702eecc138093cab987f76dfc8fb91c963bfaf13d25bd9042ee1fa23002816c4dde1d439da92839236f170adc119afee7d5
+EBUILD scamp-2.0.4.ebuild 1259 SHA256 95f8bbf29c88ea15f7cb6ffcb2e7ab32a8326d0dbe17f74554a0338cc53918df SHA512 b4ecceb3160ecb4582d49b97ceedddd479e121e7293bcfeb0156ed68ab33255c646dc4fd2d82d52d7ef5ab7d7c37cab6cb0ffc611df46b11f58d4f7a86ce6dfe WHIRLPOOL 2076ba16ed4c129eb1392c843e8f4b2c3e496282f8d2667493f60d55f43ca020c6379d1d822d1c1ced4ef2f75ee5581be6286954db04877b590bb19735c84706
+MISC ChangeLog 313 SHA256 6261fa0f2b66715604e3e122eed5932d3b6984649ed72520f1c60a4b555ec938 SHA512 b8e588db5c227f93833172daefb3198460bcfdf2ce83516da89df127abce85dec81e2cfc76023a57682f076669154182ba7ff7ae7cdd0a34490dd6f93bbb01d6 WHIRLPOOL 2e9d2b44bf9cf7a8bc2f31d597a93d5d5726fe84bdcfc8c95c4ec07f95cb9657cffb90ae233d00347ba70cdbcb55702c26b0731b40e181d705fe5372e0f3b2b4
+MISC metadata.xml 609 SHA256 95fa7ae186c457604d8b219e72264badf52f03e616ef37b65bdc781b1fc9b8ff SHA512 d4165ef6ac71ad229e8deaa2b968398def27cd80528d845de16b17739c26a92f869199f78d469a224fbe76cab0f735177b8938a76bb723b772a56023c86556c2 WHIRLPOOL a3a5e79a4aabdc24b401b0569bb49edccbfb94fd250a17b9e0f3f15cb84b7e879b64ff5592466e71185152ff84fd500e83ac19bb8444adfc2d86dacc55ca639b
diff --git a/sci-astronomy/scamp/metadata.xml b/sci-astronomy/scamp/metadata.xml
new file mode 100644
index 000000000000..d337960dbee2
--- /dev/null
+++ b/sci-astronomy/scamp/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ SCAMP computes astrometric and photometric solutions from SExtractor catalogs
+ and stores them in header files. These headers files can be read by SWarp to
+ coadd images.
+</longdescription>
+<use>
+ <flag name="plplot">Build with <pkg>sci-libs/plplot</pkg> to allow diagnostic plots during processing</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/scamp/scamp-2.0.4.ebuild b/sci-astronomy/scamp/scamp-2.0.4.ebuild
new file mode 100644
index 000000000000..ac8a2435dd18
--- /dev/null
+++ b/sci-astronomy/scamp/scamp-2.0.4.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Astrometric and photometric solutions for astronomical images"
+HOMEPAGE="http://www.astromatic.net/software/scamp"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="doc plplot threads"
+
+RDEPEND="
+ sci-astronomy/cdsclient
+ sci-libs/atlas[lapack,threads=]
+ sci-libs/fftw:3.0
+ plplot? ( sci-libs/plplot:= )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ local mycblas=atlcblas myclapack=atlclapack
+ if use threads; then
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \
+ mycblas=ptcblas
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \
+ myclapack=ptclapack
+ fi
+ sed -e "s/-lcblas/-l${mycblas}/g" \
+ -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
+ -e "s|lapack_lib=\"lapack\"|lapack_lib=${myclapack}|" \
+ -i acx_atlas.m4 || die
+ sed -e 's|plplotd|plplot|g' -i acx_plplot.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
+ $(use_enable plplot) \
+ $(use_enable threads)
+}
+
+src_install () {
+ default
+ use doc && dodoc doc/*
+}
diff --git a/sci-astronomy/sextractor/Manifest b/sci-astronomy/sextractor/Manifest
new file mode 100644
index 000000000000..6274a1762017
--- /dev/null
+++ b/sci-astronomy/sextractor/Manifest
@@ -0,0 +1,9 @@
+AUX sextractor-2.19.5-fix-format-errors.patch 2189 SHA256 250dbeb63d9dbfb05b69c3ce2f22a284de88b6070f4dc5445e07fa741d1f31da SHA512 7f7252fbd662bfc14f7bd141a74430d4dbb876c6ea5f1634a4e77379ca1916459db6929becc1e3510e71079c8ec718e93551b63ca0374b574d432f0ea49d2be5 WHIRLPOOL ab4cc3e16a5cc458a6f4c41528689f6ce5b912c9f0a75bb216230d399d6c5f18e2f825ec20a2f669282b3197b65c6839fdd7d5026bf7ca8dcf1ef42bf6c78b17
+AUX sextractor-2.19.5-have-malloc.patch 543 SHA256 0d624e57bc3dbf0038505bc5b4c2762d7d6cadadcbeccfae256f028451627157 SHA512 98bcfbe9a010f58976782113e3ad7f4eb1008f3f39a62a4a7a17ed74a03d05957198806da9972337052472d0c628875085fef1f85aefe573a7fe66347dd52090 WHIRLPOOL 1181181953fadd2fc240ab8e890f75cf397de7899575fa665179320199b13ab325bdf5a3bce5706b607b12e5aa764d8369d419270e2d268032d7abd8388a1263
+AUX sextractor-2.19.5-have-mmap.patch 1406 SHA256 5fbd289f5659f1ebe0856832dfcfee5ef6032bad83b6f7df36efc1a8720ad3b5 SHA512 b944a9c75b379932faa0af70d6e215ccbe113b2b063939d8a21810a1c03deecdb0c5a2947b4ebdf4c1396426bd2382e3014e906ac68ef17962670e3705d95a45 WHIRLPOOL 74d47decc00b6e1e12d4a2973b3baaa98378795c3e56ffc5c408d320658ac591ff82d099ee34b78c83ec1ff1f2b348cff9f1822edc10fb68a6b13d2f0579db4c
+AUX sextractor-2.19.5-sigbus.patch 736 SHA256 6dbece30c6d805cebc9211648c08b5b5013f8c2dfc3c5d91ddb6e80c337a5d28 SHA512 bca9ad7a758294812761b9f860cc40cd931a5753f248a4682858e9fd1b917a485d5e0b891e17b90c96b54d0e7f05d1aa2e2e7e6143fdc52ec57d4a609c9f4df6 WHIRLPOOL 7cf8f0a365dca534b94557c2897d2f848f44def25e18549060646f4b8e3e5fcc5460c65bc424286037c8d5caafc86ca23fc2aed6fbb2e34addcc8d6ba47fc9a4
+DIST sextractor-2.19.5.tar.gz 4317039 SHA256 2a880e018585f905300d5919ab454b18640a5bef13deb5c4f03111ac4710b2c5 SHA512 aadd007facad983ea35bd7496a53520f987aa8e492259e428170354d262212e3c1a17c60bf6ea97b6056136b0bd02793e92e14b21cb40a0f8886245eeeac6f4d WHIRLPOOL cf499f4763ebf07d94ccb630030baa1b1e3e03972a9f214ee965c1f742548ee46fa4ce22203d1a6ee7c0817c2915d36483d1a7d7fcc04348beb559f5b5dd4464
+EBUILD sextractor-2.19.5-r1.ebuild 1753 SHA256 b27b42e05c3d0d6fdfbbbd2bf60293fb8e49008a369a6c62a55de38050ab1043 SHA512 632af0c3956430c889f4116c9e94b9ace09db33d32e73b32ea698d73c5a14eca132725952dd97e72ec2bd49bda57e5c827529b4fa3676b1c62801786c02ba62f WHIRLPOOL faea1b5698e9865eff883a996e847156380e742cdc3fcd0811dadc8c959e7558a0febaac94a9f678b030ca816ac377b67627dada867de9b3c1fc495eacbfe2f7
+EBUILD sextractor-2.19.5.ebuild 1736 SHA256 a3feea0bea272daebe919b71cdf5d3b8e2abffb7f9a0e473e3f5ad7de339146f SHA512 a2b499ae626f800c8a90cfd6660e8a9572ad32ef6901419e908262ea9a77e9736322094502a18e50b194b8ede567a25f45d1353976d7cef4d37760965b260ee1 WHIRLPOOL 0a914419f6862a4641165834164f33d3a48e5de063e3bd1ea5dbc20186e5a1ec707536aca3077269b9ea11690006f1c0bb48681c20d0a9bb6deaf3b44fea1efa
+MISC ChangeLog 772 SHA256 3e8d8373ec75c964744c9ad21c8b1654d524dfc7418aee5873f3b4e17890a9f9 SHA512 06f7aedc895ceec746fb4be5d3e25c5a2caf23a100c4d440bedbba903bb46acc1191686cb2af5935714dc7653caa9cd02836b9e4282a814fc609d7cb1e4189b4 WHIRLPOOL 161e87c7b64b468c78570c875a2c8e8a696757f91b31288e732681edd15dba9da4aa6828e97822ae0d37cea9144b8da03ceaa7b1096f23575468f9c024249ef1
+MISC metadata.xml 797 SHA256 31cc4755cfc875af4eb0b182853c17ad2d343a4823338cdd0c69fbb2576cb787 SHA512 83f4baddd93a51960fb6adf2d55b7c5cda033f92ad5dc92eb7e6f15392432f49f40b1fe07dcfc475a464a6d3502696a3639c0e33d5c45848fbda686a1777189c WHIRLPOOL 3604f71360dd354d872af000e6d3f9a92a2b607df27d87589fa3d428c5d34530c91040de4e070111d640e1006bf0cc021573e3d764d5c0755253f42b7b004b88
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch
new file mode 100644
index 000000000000..c20ce31ee30e
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch
@@ -0,0 +1,65 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Description: Fix format security errors
+--- a/src/catout.c
++++ b/src/catout.c
+@@ -999,7 +999,7 @@
+ break;
+
+ case ASCII_SKYCAT:
+- fprintf(ascfile, skycattail);
++ fprintf(ascfile, "%s", skycattail);
+ if (!prefs.pipe_flag)
+ fclose(ascfile);
+ break;
+--- a/src/xml.c
++++ b/src/xml.c
+@@ -696,7 +696,7 @@
+ name, ucd);
+ break;
+ case P_STRING:
+- sprintf(value, (char *)key[i].ptr);
++ sprintf(value, "%s", (char *)key[i].ptr);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
+ " ucd=\"%s\" value=\"%s\"/>\n",
+ name, ucd, *value? value: " ");
+@@ -705,13 +705,13 @@
+ n = *(key[i].nlistptr);
+ if (n)
+ {
+- sprintf(value, ((char **)key[i].ptr)[0]);
++ sprintf(value, "%s", ((char **)key[i].ptr)[0]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\""
+ " arraysize=\"*\" ucd=\"%s\" value=\"%s",
+ name, ucd, *value? value: " ");
+ for (j=1; j<n; j++)
+ {
+- sprintf(value, ((char **)key[i].ptr)[j]);
++ sprintf(value, "%s", ((char **)key[i].ptr)[j]);
+ fprintf(file, ",%s", *value? value: " ");
+ }
+ fprintf(file, "\"/>\n");
+@@ -722,7 +722,7 @@
+ name, ucd);
+ break;
+ case P_KEY:
+- sprintf(value, key[i].keylist[*((int *)key[i].ptr)]);
++ sprintf(value, "%s", key[i].keylist[*((int *)key[i].ptr)]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
+ " ucd=\"%s\" value=\"%s\"/>\n",
+ name, ucd, value);
+@@ -731,13 +731,13 @@
+ n = *(key[i].nlistptr);
+ if (n)
+ {
+- sprintf(value, key[i].keylist[((int *)key[i].ptr)[0]]);
++ sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[0]]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\""
+ " arraysize=\"*\" ucd=\"%s\" value=\"%s",
+ name, ucd, value);
+ for (j=1; j<n; j++)
+ {
+- sprintf(value, key[i].keylist[((int *)key[i].ptr)[j]]);
++ sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[j]]);
+ fprintf(file, ",%s", value);
+ }
+ fprintf(file, "\"/>\n");
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch
new file mode 100644
index 000000000000..dd10d4a2c3cd
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch
@@ -0,0 +1,32 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Define rpl_malloc if not there.
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -34,6 +34,8 @@
+ #include <time.h>
+ #include <sys/time.h>
+
++#include <sys/types.h>
++
+ #include "define.h"
+ #include "globals.h"
+
+@@ -153,3 +155,18 @@
+ }
+
+
++#if !HAVE_MALLOC
++#undef malloc
++
++// Allocate an N-byte block of memory from the heap. If N is zero,
++// allocate a 1-byte block.
++void *rpl_malloc(size_t n)
++{
++ void *malloc();
++ if (0==n) {
++ n = 1;
++ }
++
++ return malloc(n);
++}
++#endif
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch
new file mode 100644
index 000000000000..1b6565089849
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch
@@ -0,0 +1,55 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Use mmap only if it exists.
+--- a/src/fits/fitsbody.c
++++ b/src/fits/fitsbody.c
+@@ -64,9 +64,12 @@
+ ***/
+ PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
+ {
++#ifdef HAVE_MMAP
+ FILE *file;
+ PIXTYPE *buffer;
+- size_t npix, size, sizeleft, spoonful;
++ size_t sizeleft, spoonful;
++#endif
++ size_t npix, size;
+
+ if (!body_ramflag)
+ {
+@@ -87,7 +90,9 @@
+ /* Decide if the data will go in physical memory or on swap-space */
+ npix = tab->tabsize/tab->bytepix;
+ size = npix*sizeof(PIXTYPE);
++#if !HAVE_MMAP
+ if (size < body_ramleft)
++#endif
+ {
+ /*-- There should be enough RAM left: try to do a malloc() */
+ if ((tab->bodybuf = malloc(size)))
+@@ -105,6 +110,7 @@
+ tab->bodybuf = NULL;
+ }
+
++#if HAVE_MMAP
+ if (size < body_vramleft)
+ {
+ /*-- Convert and copy the data to a swap file, and mmap() it */
+@@ -144,6 +150,7 @@
+ return NULL;
+ return (PIXTYPE *)tab->bodybuf;
+ }
++#endif
+
+ /* If no memory left at all: forget it! */
+ return NULL;
+@@ -270,8 +277,10 @@
+ size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
+ if (tab->swapflag)
+ {
++#if HAVE_MMAP
+ if (munmap(tab->bodybuf, size))
+ warning("Can't unmap ", tab->cat->filename);
++#endif
+ tab->swapflag = 0;
+ tab->bodybuf = NULL;
+ body_vramleft += size;
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch
new file mode 100644
index 000000000000..2796f63884e3
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch
@@ -0,0 +1,26 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Handle the "sigbus" case only if it exists
+--- a/src/fits/fitscleanup.c
++++ b/src/fits/fitscleanup.c
+@@ -164,7 +164,9 @@
+ /* Catch CTRL-Cs */
+ signal(SIGINT, signal_function);
+ /* Catch bus errors */
++#ifdef SIGBUS // TODO: what if it is an enum?
+ signal(SIGBUS, signal_function);
++#endif
+ /* Catch segmentation faults */
+ signal(SIGSEGV, signal_function);
+ /* Catch floating exceptions */
+@@ -195,9 +197,11 @@
+ case SIGINT:
+ fprintf(stderr, "^C\n");
+ exit(-1);
++#ifdef SIGBUS
+ case SIGBUS:
+ fprintf(stderr, "bus error\n");
+ exit(-1);
++#endif
+ case SIGSEGV:
+ fprintf(stderr, "segmentation fault\n");
+ exit(-1);
diff --git a/sci-astronomy/sextractor/metadata.xml b/sci-astronomy/sextractor/metadata.xml
new file mode 100644
index 000000000000..87b74a0a93cb
--- /dev/null
+++ b/sci-astronomy/sextractor/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+<email>sci-astronomy@gentoo.org</email>
+<name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ SExtractor (Source Extractor) is a program that builds a catalogue of
+ objects from an astronomical image. Although it is particularly
+ oriented towards reduction of large scale galaxy-survey data, it
+ performs rather well on moderately crowded star fields. It has the
+ ability to automatically separate stars and galaxy using neural
+ networks.
+</longdescription>
+<use>
+<flag name="modelfit">
+ Enable profile model fitting, needs <pkg>sci-libs/atlas</pkg>
+ and <pkg>sci-libs/fftw</pkg>
+</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-astronomy/sextractor/sextractor-2.19.5-r1.ebuild b/sci-astronomy/sextractor/sextractor-2.19.5-r1.ebuild
new file mode 100644
index 000000000000..a3aae82d8cdf
--- /dev/null
+++ b/sci-astronomy/sextractor/sextractor-2.19.5-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+AUTOTOOLS_AUTO_DEPEND=no
+
+inherit autotools
+
+DESCRIPTION="Extract catalogs of sources from astronomical FITS images"
+HOMEPAGE="http://www.astromatic.net/software/sextractor"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+
+IUSE="doc modelfit test threads"
+
+RDEPEND="
+ !games-misc/sex
+ modelfit? ( sci-libs/atlas[lapack,threads=] sci-libs/fftw:3.0 )"
+DEPEND="${RDEPEND}
+ modelfit? ( ${AUTOTOOLS_DEPEND} )"
+
+REQUIRED_USE="test? ( modelfit )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-format-errors.patch"
+ "${FILESDIR}/${P}-have-malloc.patch"
+ "${FILESDIR}/${P}-have-mmap.patch"
+ "${FILESDIR}/${P}-sigbus.patch"
+)
+
+src_prepare() {
+ default
+ if use modelfit; then
+ local mycblas=atlcblas myclapack=atlclapack
+ if use threads; then
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \
+ mycblas=ptcblas
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \
+ myclapack=ptclapack
+ fi
+ sed -i \
+ -e "s/-lcblas/-l${mycblas}/g" \
+ -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
+ -e "s/-llapack/-l${myclapack}/g" \
+ -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
+ acx_atlas.m4 || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
+ $(use_enable modelfit model-fitting) \
+ $(use_enable threads)
+}
+
+src_install () {
+ default
+ CONFDIR=/usr/share/sextractor
+ insinto ${CONFDIR}
+ doins config/*
+ use doc && dodoc doc/*
+}
+
+pkg_postinst() {
+ elog "SExtractor examples configuration files are located in"
+ elog "${EROOT%/}/${CONFDIR} and are not loaded anymore by default."
+}
diff --git a/sci-astronomy/sextractor/sextractor-2.19.5.ebuild b/sci-astronomy/sextractor/sextractor-2.19.5.ebuild
new file mode 100644
index 000000000000..3aeded5ecbc8
--- /dev/null
+++ b/sci-astronomy/sextractor/sextractor-2.19.5.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+AUTOTOOLS_AUTO_DEPEND=no
+
+inherit autotools
+
+DESCRIPTION="Extract catalogs of sources from astronomical FITS images"
+HOMEPAGE="http://www.astromatic.net/software/sextractor"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+
+IUSE="doc modelfit test threads"
+
+RDEPEND="
+ modelfit? ( sci-libs/atlas[lapack,threads=] sci-libs/fftw:3.0 )"
+DEPEND="${RDEPEND}
+ modelfit? ( ${AUTOTOOLS_DEPEND} )"
+
+REQUIRED_USE="test? ( modelfit )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-format-errors.patch"
+ "${FILESDIR}/${P}-have-malloc.patch"
+ "${FILESDIR}/${P}-have-mmap.patch"
+ "${FILESDIR}/${P}-sigbus.patch"
+)
+
+src_prepare() {
+ default
+ if use modelfit; then
+ local mycblas=atlcblas myclapack=atlclapack
+ if use threads; then
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \
+ mycblas=ptcblas
+ [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \
+ myclapack=ptclapack
+ fi
+ sed -i \
+ -e "s/-lcblas/-l${mycblas}/g" \
+ -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
+ -e "s/-llapack/-l${myclapack}/g" \
+ -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
+ acx_atlas.m4 || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
+ $(use_enable modelfit model-fitting) \
+ $(use_enable threads)
+}
+
+src_install () {
+ default
+ CONFDIR=/usr/share/sextractor
+ insinto ${CONFDIR}
+ doins config/*
+ use doc && dodoc doc/*
+}
+
+pkg_postinst() {
+ elog "SExtractor examples configuration files are located in"
+ elog "${EROOT%/}/${CONFDIR} and are not loaded anymore by default."
+}
diff --git a/sci-astronomy/skycat/Manifest b/sci-astronomy/skycat/Manifest
new file mode 100644
index 000000000000..b6a28784a07b
--- /dev/null
+++ b/sci-astronomy/skycat/Manifest
@@ -0,0 +1,13 @@
+AUX skycat-3.0.2-systemlibs.patch 5290 SHA256 b510c3b97029b5619a81f4130c01df80ec18a34a2825e809811deef946afe4e2 SHA512 d84569892d4e563e3cee143c24b92e8e9de92133a6df640713a83de6f8aa96b9d7c17f1a0c44f4cd5eccd7ddfb3ec2cdd2aefdd4c8ec3ab4c8afcfa06542441b WHIRLPOOL d9375a2e6126bc2db5259ea6c664a0f1cb78058bb765fa78a96c84e5d925a501fcee9d8afea0d759053de2e0bc1d0e9807b1d8d8722d83a44348c3f6276e6181
+AUX skycat-3.0.2-tk8.5.patch 877 SHA256 6a9048f16a88fca2db57efd2599220508bb283274766f0cb6b85e1c0c445a889 SHA512 d1ea2809a8afa2f5c2868dc53e0fdb7dbc393449ba87c633662dd018c409c464516487824cee4b6dd2cf49a95d05e51747522e068bbad6494d345f31566f7108 WHIRLPOOL 69290b78b555917768d3269c541229e347efb7dc2dd72d2903ac186b348118abbc3a4c88e33454d6a949cde189c1d20296f1414ab1df205df8d60d6bde967c91
+AUX skycat-3.1.2-m4.patch 5106 SHA256 1938684fb0bf581b620797ac49932d457fc4fbd055c99ec86b866b6b20db4efd SHA512 57b2179a31dbed0fb89962933cf280938035fa8f5ddc1015e1c9dd548f54b8579ab84f485330e678173240b75753dea8f86f16958fb56d874316e80558727428 WHIRLPOOL 6e077fdcb4e75511d83bcf764ba3cfb7bd1abdb6ac4fbb48fe90ce24550155a51892d4055066ea1c694168601ed4cdc1cae4bcc07aa256aa7c91e32c7736ce7f
+AUX skycat-3.1.2-makefile-qa.patch 4443 SHA256 59800dcd3c1cf091fbf97f31342c769e93d26a92f7a8892d0d4af06ceae94da5 SHA512 c10193aa675148d7150dbbab888a56c15926054613870b82bd387d6a853e9fb6a44935ead68e194aa1dcab02f9fab498863cc63288864c9571f0de5b6cbb4903 WHIRLPOOL d563fe4ca089bf43085c6a600d0c38635cc55f19f8523945341271e2d5504efe7412a2200833d323707ef617418667f2c5e125d6f266c33401b1016968229d5b
+AUX skycat-3.1.3-remove-tclx-dep.patch 12120 SHA256 3225ae01e7a5a8f1f3dc9eb046abbd98c61eac1245dfbba5636fc069c1656f36 SHA512 075819025373f5125f92543f30d9b45b88a0f0fcb2d826c4127cc36a4164ad38322b01be7a05e16f016e4aed8e6e3d867cb37427d978d8e78f6cb27d6c7edd4e WHIRLPOOL 8fae4a98cc6ee682bbbda7620fd76bf2579a43f82d15adc76737b11a977c74bda214a5a72a0d9a3b6f682054cb7352b4e4e2eaccd53f455d3eca39fbf6a9fc05
+AUX skycat-3.1.3-string-issues.patch 2902 SHA256 0f31f7dd4082ae5fe2979f5c3b6613d1dcfcb5cbbae6db61d9ee5d115dd94c6e SHA512 6f4b3eecd75515e79738b2354747d97927c5fbcb37dae460c9adc9e412b337ccfd04d0285f4bb3e9c2189d9c050ee365a262837daf3aafabcc5ff459fdeb5954 WHIRLPOOL c489c68c23de0500edef1b5b2e0a0faac26a39f6e802755d4bd5a8ffff9633fdbd96ebd2803d33ca23cfa711725f4651871c7910bcdad94e91f4709ac76fafac
+DIST skycat-3.1.2.tar.gz 3091874 SHA256 559ae26f044601517f8787eadcb93ebda85ebea971f8f961cedefbafb3b9d0ac SHA512 70f7f366c13f0d9914db5be0ed75952a5e97ca2aef18ce5a4aa3e330aeceaaa1ab06c5ada69056659d038b2e558648e1f4033668d4935c6a6c50bce8b766f100 WHIRLPOOL 29408a52256be3cffe06c86d8bc5f1551585f58c27c1c9e77b3f7f0393fd797295028e52410ea4bee4afbd37d2f5a277f3ae56c1c9354ae390a48de508eacded
+DIST skycat-3.1.3.tar.gz 3057187 SHA256 833655c5ed5591e2f12db681e3aed36af0af906a4ffca1c524a3681f9fee097c SHA512 55ec0c2b367e028c23e5e8f8d74106aa51aec5173c2ab1772f5fa8a5a5b65f3d85e7b991597a89f11f6ca14d57aaa6b774f474b41e78747ee486df66ab22e9ff WHIRLPOOL 6ac13f5b447a255dc63673aa7b8422e52e1c0174993d2ba7569a4690730243ae0dff3fcee483b2451599cedd9e83de47222384580004e82cefbddeeb17b7b887
+EBUILD skycat-3.1.2-r2.ebuild 1457 SHA256 54ad3d79adb71f7b2c4f4bd27a2f5f87f23bb33d420ccf9d9c36234b6ce3e5e9 SHA512 42fdc0ce79ceb591147ac9f19b90490c2bdfbab83322272ab7f5cda194458a44fce7c82420d85b58660d9f3c45386eabb7686c7f6c2b4cc483730c929f1b6086 WHIRLPOOL 045f83ad58583300e16e6434996b383720e9c4b2e76bce0ddbccbfafa7224f9ca48d4cbb6c248609181cac5f9691e465da529e59817ec482c0df00d0ae872fcc
+EBUILD skycat-3.1.3.ebuild 1563 SHA256 deec7484a5e270918b1b8b3d453b6156998385743a8137135a604e431c9ab2c6 SHA512 3d2e5de46e8c1fe2b81fd867fbe667785a466de2ea447f4da84de6d7426cb53359d295ce04ccfd32b7d02e307e382a86e7872635aa37b5d637f043de1c1a9474 WHIRLPOOL c73433d6345f40809580606a8216743e881691a12048c14f7d38ba0926db6334c528e68d0333c30f9c4627081b514d35cc394bfb9c8ca3b82ae56ab0ced2dad9
+MISC ChangeLog 3081 SHA256 672edf49660b24166870dc160d9279c2344eaa85a700fbfc551101ebbdcd5e13 SHA512 00862a0d819da19b52af47a3e2c0bd042f6a1087f3fd97a1999b2f9c5c00ca193d7e23f85d96f324902017b5948217617462b79c4413ea7e13b9767d7c927fbb WHIRLPOOL 82726cfcb71cb194589199fcf37d1ee0c9d1a41cada540240b0ca7a0493046c5c826d59e7ce881297b0f0beea652f6569c37da09b08f7a568f6bc4907dfd8f86
+MISC ChangeLog-2015 3143 SHA256 784e2cad1d9e5ff479bff3c5cb001645074e93bcd75fb4965670dee1d13d5fc5 SHA512 f38ed3f83774df8f4b2ecf7f449419b262f009a518cc5572af98f947fc3c14dc6f65471f73b1464e27ba3a5e3ff4ed6e67ce123afa3b7de65a1876d26e5420aa WHIRLPOOL 514fcc46258df62c4bec5c292ef38aec25d17fc1d932e9eb5a4db53eaa4bf72b1e5a6ea015e007f638b82fde74229daaae48b7d41042cf7877df58df99676c98
+MISC metadata.xml 479 SHA256 25af377a2dc050ec73b77305523e5e166e8e6c9e444e9e091c67a1896e80bdb3 SHA512 fc5efbe1a182a1430f1a7072af6752486c1c7f6ec147b5a669ea2c6836d48e452a60a15b2f442739f04578c8d482a362099db18d14d93ba70d7c80bcf424112e WHIRLPOOL 6c64ca5afb7edd36c8bf5b9a1b3b12e46b59b9191d6fb14fcc1f4a2c7cb5e635b32053af51085c187266adacfc19bc291b56a5b4a0b4bfd64d68d7d06d5d31cd
diff --git a/sci-astronomy/skycat/files/skycat-3.0.2-systemlibs.patch b/sci-astronomy/skycat/files/skycat-3.0.2-systemlibs.patch
new file mode 100644
index 000000000000..669d54a68ed0
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.0.2-systemlibs.patch
@@ -0,0 +1,107 @@
+diff -Naur skycat-3.0.2/astrotcl/configure.in skycat-3.0.2.new/astrotcl/configure.in
+--- skycat-3.0.2/astrotcl/configure.in 2006-01-25 17:21:38.000000000 -0500
++++ skycat-3.0.2.new/astrotcl/configure.in 2009-09-24 20:48:27.000000000 -0400
+@@ -83,10 +83,10 @@
+ #-----------------------------------------------------------------------
+
+ changequote(<<, >>)
+-csources=`cd $srcdir; echo {generic,press,libwcs,cfitsio}/*.[Cc]`
++csources=`cd $srcdir; echo {generic,press}/*.[Cc]`
+ changequote([, ])
+-cheaders=`cd $srcdir; echo {generic,press,libwcs,cfitsio}/*.h`
+-cincludes="-I$srcdir/../tclutil/generic -I$srcdir/generic -I$srcdir/press -I$srcdir/libwcs -I$srcdir/cfitsio"
++cheaders=`cd $srcdir; echo {generic,press}/*.h`
++cincludes="-I$srcdir/../tclutil/generic -I$srcdir/generic -I$srcdir/press -I/usr/include/wcs -I/usr/include/"
+ tclsources=`cd $srcdir; echo library/*.tcl`
+
+ TEA_ADD_SOURCES([${csources}])
+diff -Naur skycat-3.0.2/cat/aclocal.m4 skycat-3.0.2.new/cat/aclocal.m4
+--- skycat-3.0.2/cat/aclocal.m4 2006-01-23 12:24:46.000000000 -0500
++++ skycat-3.0.2.new/cat/aclocal.m4 2009-09-24 20:31:00.000000000 -0400
+@@ -47,11 +47,11 @@
+ changequote([, ])
+
+ cat_headers=`cd $srcdir; echo generic/*.h`
+-astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h`
++astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press}/*.h`
+ tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h`
+
+ cat_includes="-I$srcdir/generic -I$srcdir/bitmaps"
+-astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs"
++astrotcl_includes="-I$srcdir/../astrotcl/generic -I/usr/include -I/usr/include/wcs"
+ tclutil_includes="-I$srcdir/../tclutil/generic"
+ cincludes="${cat_includes} ${astrotcl_includes} ${tclutil_includes}"
+
+diff -Naur skycat-3.0.2/cat/configure.in skycat-3.0.2.new/cat/configure.in
+--- skycat-3.0.2/cat/configure.in 2006-02-03 05:29:48.000000000 -0500
++++ skycat-3.0.2.new/cat/configure.in 2009-09-24 20:51:56.000000000 -0400
+@@ -181,6 +181,9 @@
+ # and TEA_LOAD_TCLCONFIG macros above.
+ #--------------------------------------------------------------------
+
++# we need wcstools and cfitsio
++PKG_LIBS="${PKG_LIBS} -lwcstools -lcfitsio"
++
+ TEA_MAKE_LIB
+
+ #--------------------------------------------------------------------
+diff -Naur skycat-3.0.2/rtd/aclocal.m4 skycat-3.0.2.new/rtd/aclocal.m4
+--- skycat-3.0.2/rtd/aclocal.m4 2006-02-01 17:10:36.000000000 -0500
++++ skycat-3.0.2.new/rtd/aclocal.m4 2009-09-24 20:27:46.000000000 -0400
+@@ -50,11 +50,11 @@
+ changequote([, ])
+
+ rtd_headers=`cd $srcdir; echo generic/*.h rtdevt/rtdImageEvent.h rtdevt/rtdSem.h`
+-astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h`
++astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press}/*.h`
+ tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h`
+
+ rtd_includes="-I$srcdir/generic -I$srcdir/rtdevt -I$srcdir/bitmaps"
+-astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs"
++astrotcl_includes="-I$srcdir/../astrotcl/generic -I/usr/include -I/usr/include/wcs"
+ tclutil_includes="-I$srcdir/../tclutil/generic"
+ cincludes="${rtd_includes} ${astrotcl_includes} ${tclutil_includes}"
+
+diff -Naur skycat-3.0.2/rtd/configure.in skycat-3.0.2.new/rtd/configure.in
+--- skycat-3.0.2/rtd/configure.in 2006-02-01 17:10:36.000000000 -0500
++++ skycat-3.0.2.new/rtd/configure.in 2009-09-24 20:49:11.000000000 -0400
+@@ -192,7 +192,7 @@
+ #--------------------------------------------------------------------
+
+ # rtd needs -lXext
+-PKG_LIBS="${PKG_LIBS} -lXext"
++PKG_LIBS="${PKG_LIBS} -lXext -lwcstools -lcfitsio"
+
+ TEA_MAKE_LIB
+
+diff -Naur skycat-3.0.2/skycat/aclocal.m4 skycat-3.0.2.new/skycat/aclocal.m4
+--- skycat-3.0.2/skycat/aclocal.m4 2006-01-26 17:47:20.000000000 -0500
++++ skycat-3.0.2.new/skycat/aclocal.m4 2009-09-24 20:33:31.000000000 -0400
+@@ -79,13 +79,13 @@
+ skycat_headers=`cd $srcdir; echo generic/*.h`
+ cat_headers=`cd $srcdir; echo ../cat/generic/*.h`
+ rtd_headers=`cd $srcdir; echo ../rtd/generic/*.h ../rtd/rtdevt/rtdImageEvent.h ../rtd/rtdevt/rtdSem.h`
+-astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h`
++astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press}/*.h`
+ tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h`
+
+ skycat_includes="-I$srcdir/generic -I$srcdir/bitmaps"
+ cat_includes="-I$srcdir/../cat/generic"
+ rtd_includes="-I$srcdir/../rtd/generic -I$srcdir/../rtd/rtdevt"
+-astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs"
++astrotcl_includes="-I$srcdir/../astrotcl/generic -I/usr/include -I/usr/include/wcs"
+ tclutil_includes="-I$srcdir/../tclutil/generic"
+ cincludes="${skycat_includes} ${cat_includes} ${rtd_includes} ${astrotcl_includes} ${tclutil_includes}"
+
+diff -Naur skycat-3.0.2/skycat/configure.in skycat-3.0.2.new/skycat/configure.in
+--- skycat-3.0.2/skycat/configure.in 2008-06-11 11:04:25.000000000 -0400
++++ skycat-3.0.2.new/skycat/configure.in 2009-09-24 20:52:26.000000000 -0400
+@@ -182,7 +182,7 @@
+ #--------------------------------------------------------------------
+
+ # skycat needs -lXext
+-PKG_LIBS="${PKG_LIBS} -lXext"
++PKG_LIBS="${PKG_LIBS} -lXext -lwcstools -lcfitsio"
+
+ TEA_MAKE_LIB
+
diff --git a/sci-astronomy/skycat/files/skycat-3.0.2-tk8.5.patch b/sci-astronomy/skycat/files/skycat-3.0.2-tk8.5.patch
new file mode 100644
index 000000000000..2cb325da853d
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.0.2-tk8.5.patch
@@ -0,0 +1,21 @@
+--- skycat-3.0.2.orig/rtd/generic/RtdImage.C 2006-02-02 18:36:47.000000000 +0100
++++ skycat-3.0.2/rtd/generic/RtdImage.C 2009-09-15 09:23:44.505239756 +0200
+@@ -913,6 +913,9 @@
+ updateIdleTasks();
+ }
+
++#ifndef MODULE_SCOPE
++#define MODULE_SCOPE extern
++#endif
+
+ // Fix for Tk clipping coordinates to short range: See CanvasWindowCoordsNoClip() below.
+ #ifdef HAVE_TKCANVAS_H
+--- skycat-3.0.2.orig/skycat/skycat.in 2006-02-04 14:27:30.000000000 +0100
++++ skycat-3.0.2/skycat/skycat.in 2009-09-15 09:20:45.910857133 +0200
+@@ -54,5 +54,5 @@
+
+ test -d $HOME/.skycat || mkdir $HOME/.skycat
+ echo "`date`: Starting skycat with: $0 ${1+"$@"}" > $HOME/.skycat/log
+-exec wish8.4 $SKYCAT_BASE/lib/skycat@PACKAGE_VERSION@/main.tcl ${1+"$@"} | tee -a $HOME/.skycat/log 2>&1
++exec wish8.5 $SKYCAT_BASE/lib/skycat@PACKAGE_VERSION@/main.tcl ${1+"$@"} | tee -a $HOME/.skycat/log 2>&1
+
diff --git a/sci-astronomy/skycat/files/skycat-3.1.2-m4.patch b/sci-astronomy/skycat/files/skycat-3.1.2-m4.patch
new file mode 100644
index 000000000000..ff61c99f05ca
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.1.2-m4.patch
@@ -0,0 +1,150 @@
+--- a/tclconfig/tcl.m4
++++ b/tclconfig/tcl.m4
+@@ -731,6 +731,50 @@
+ ])
+
+ #--------------------------------------------------------------------
++# TEA_CONFIG_SYSTEM
++#
++# Determine what the system is (some things cannot be easily checked
++# on a feature-driven basis, alas). This can usually be done via the
++# "uname" command, but there are a few systems, like Next, where
++# this doesn't work.
++#
++# Arguments:
++# none
++#
++# Results:
++# Defines the following var:
++#
++# system - System/platform/version identification code.
++#
++#--------------------------------------------------------------------
++
++AC_DEFUN(TEA_CONFIG_SYSTEM, [
++ AC_MSG_CHECKING([system version])
++ AC_CACHE_VAL(tcl_cv_sys_version,[
++ if test -f /usr/lib/NextStep/software_version; then
++ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
++ else
++ tcl_cv_sys_version=`uname -s`-`uname -r`
++ if test "$?" -ne 0 ; then
++ AC_MSG_WARN([can't find uname command])
++ tcl_cv_sys_version=unknown
++ else
++ # Special check for weird MP-RAS system (uname returns weird
++ # results, and the version is kept in special file).
++
++ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
++ tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
++ fi
++ if test "`uname -s`" = "AIX" ; then
++ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
++ fi
++ fi
++ fi])
++ AC_MSG_RESULT($tcl_cv_sys_version)
++ system=$tcl_cv_sys_version
++])
++
++#--------------------------------------------------------------------
+ # TEA_CONFIG_CFLAGS
+ #
+ # Try to determine the proper flags to pass to the compiler
+@@ -849,30 +893,7 @@
+ # for the system. This can usually be done via the "uname" command, but
+ # there are a few systems, like Next, where this doesn't work.
+
+- AC_MSG_CHECKING([system version (for dynamic loading)])
+- if test -f /usr/lib/NextStep/software_version; then
+- system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+- else
+- system=`uname -s`-`uname -r`
+- if test "$?" -ne 0 ; then
+- AC_MSG_RESULT([unknown (can't find uname command)])
+- system=unknown
+- else
+- # Special check for weird MP-RAS system (uname returns weird
+- # 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'`
+- fi
+- if test "`uname -s`" = "AIX" ; then
+- system=AIX-`uname -v`.`uname -r`
+- fi
+- if test "${TEA_PLATFORM}" = "windows" ; then
+- system=windows
+- fi
+- AC_MSG_RESULT([$system])
+- fi
+- fi
++ TEA_CONFIG_SYSTEM
+
+ # Step 2: check for existence of -ldl library. This is needed because
+ # Linux can use either -ldl or -ldld for dynamic loading.
+@@ -2318,25 +2339,8 @@
+ AC_DEFUN(TEA_BLOCKING_STYLE, [
+ AC_CHECK_HEADERS(sys/ioctl.h)
+ AC_CHECK_HEADERS(sys/filio.h)
++ TEA_CONFIG_SYSTEM
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
+- if test -f /usr/lib/NextStep/software_version; then
+- system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+- else
+- system=`uname -s`-`uname -r`
+- if test "$?" -ne 0 ; then
+- system=unknown
+- else
+- # Special check for weird MP-RAS system (uname returns weird
+- # 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'`
+- fi
+- if test "`uname -s`" = "AIX" ; then
+- system=AIX-`uname -v`.`uname -r`
+- fi
+- fi
+- fi
+ case $system in
+ # There used to be code here to use FIONBIO under AIX. However, it
+ # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
+@@ -3031,13 +3035,13 @@
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+- #if test x"${TCL_EXEC_PREFIX}" != x; then
+- #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
+- #exec_prefix=${TCL_EXEC_PREFIX}
+- #else
++ if test x"${TCL_EXEC_PREFIX}" != x; then
++ AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
++ exec_prefix=${TCL_EXEC_PREFIX}
++ else
+ AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
+ exec_prefix=$prefix
+- #fi
++ fi
+ fi
+ ])
+
+@@ -3169,7 +3173,7 @@
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
+- MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
++ MAKE_SHARED_LIB="\${SHLIB_LD} -Wl,-soname=\[$]@ -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+@@ -3817,7 +3821,8 @@
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_$1config}" = x ; then
+- for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
++ for i in `ls -d ${libdir} 2>/dev/null` \
++ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
diff --git a/sci-astronomy/skycat/files/skycat-3.1.2-makefile-qa.patch b/sci-astronomy/skycat/files/skycat-3.1.2-makefile-qa.patch
new file mode 100644
index 000000000000..e36e1ece665f
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.1.2-makefile-qa.patch
@@ -0,0 +1,132 @@
+--- a/astrotcl/Makefile.in
++++ b/astrotcl/Makefile.in
+@@ -114,7 +114,7 @@
+ RANLIB = @RANLIB@
+ RANLIB_STUB = @RANLIB_STUB@
+ SHLIB_CFLAGS = @SHLIB_CFLAGS@
+-SHLIB_LD = @SHLIB_LD@
++SHLIB_LD = @SHLIB_LD@ $(LDFLAGS_DEFAULT)
+ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
+ STLIB_LD = @STLIB_LD@
+ #TCL_DEFS = @TCL_DEFS@
+--- a/rtd/Makefile.in
++++ b/rtd/Makefile.in
+@@ -123,7 +123,7 @@
+ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.o tests/*.o
+ EXEEXT = @EXEEXT@
+ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
+-MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS)
++MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS) $(SHLIB_LD_LIBS)
+ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
+ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
+ MAKE_STUB_LIB = @MAKE_STUB_LIB@
+@@ -131,7 +131,7 @@
+ RANLIB = @RANLIB@
+ RANLIB_STUB = @RANLIB_STUB@
+ SHLIB_CFLAGS = @SHLIB_CFLAGS@
+-SHLIB_LD = @SHLIB_LD@
++SHLIB_LD = @SHLIB_LD@ $(LDFLAGS_DEFAULT)
+ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
+ STLIB_LD = @STLIB_LD@
+ #TCL_DEFS = @TCL_DEFS@
+@@ -442,14 +442,14 @@
+ $(AR) r $@ $(RTDEVT_OBJ)
+ $(RANLIB) $@
+
+-$(RTD_SERVER): $(RTD_SERVER_OBJS)
+- $(CXXCOMPILE) -o $@ $(RTD_SERVER_OBJS) $(RTDEVT_LIB) @LIBS@
++$(RTD_SERVER): $(RTD_SERVER_OBJS) $(RTDEVT_LIB)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $(RTD_SERVER_OBJS) $(RTDEVT_LIB) @LIBS@
+
+-rtdClient: rtdClient.o
+- $(CXXCOMPILE) -o $@ $? $(RTDEVT_LIB) @LIBS@
++rtdClient: rtdClient.o $(RTDEVT_LIB)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $? $(RTDEVT_LIB) @LIBS@
+
+-rtdCubeDisplay: rtdCubeDisplay.o
+- $(CXXCOMPILE) -o $@ $? $(RTDEVT_LIB) @LIBS@
++rtdCubeDisplay: rtdCubeDisplay.o $(RTDEVT_LIB)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $? $(RTDEVT_LIB) @LIBS@
+
+ #========================================================================
+ # RTD Remote access C library
+@@ -464,14 +464,14 @@
+ #========================================================================
+ test: binaries libraries $(TEST_APPS)
+
+-tImageEvent: tImageEvent.o
+- $(CXXCOMPILE) -o $@ $@.o $(RTDEVT_LIB) @LIBS@
++tImageEvent: tImageEvent.o $(RTDEVT_LIB)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $@.o $(RTDEVT_LIB) @LIBS@
+
+ trtdRemote: trtdRemote.o
+- $(COMPILE) -o $@ $@.o $(RTD_REMOTE_LIB) @LIBS@
++ $(COMPILE) $(LDFLAGS_DEFAULT) -o $@ $@.o $(RTD_REMOTE_LIB) @LIBS@
+
+-tRtd: tRtd.o tRtdEvt.o tRtdEvtData.o
+- $(CXXCOMPILE) -o $@ $@.o tRtdEvt.o tRtdEvtData.o \
++tRtd: tRtd.o tRtdEvt.o tRtdEvtData.o $(PKG_LIB_FILE)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $@.o tRtdEvt.o tRtdEvtData.o \
+ @rtd_BUILD_LIB_SPEC@ @TK_LIB_SPEC@ @TCL_LIB_SPEC@ ${LIBS}
+
+ #========================================================================
+--- a/tclutil/Makefile.in
++++ b/tclutil/Makefile.in
+@@ -116,7 +116,7 @@
+ RANLIB = @RANLIB@
+ RANLIB_STUB = @RANLIB_STUB@
+ SHLIB_CFLAGS = @SHLIB_CFLAGS@
+-SHLIB_LD = @SHLIB_LD@
++SHLIB_LD = @SHLIB_LD@ $(LDFLAGS_DEFAULT)
+ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
+ STLIB_LD = @STLIB_LD@
+ #TCL_DEFS = @TCL_DEFS@
+--- a/skycat/Makefile.in
++++ b/skycat/Makefile.in
+@@ -112,7 +112,7 @@
+ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.o tests/*.o
+ EXEEXT = @EXEEXT@
+ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
+-MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS)
++MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS) $(SHLIB_LD_LIBS)
+ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
+ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
+ MAKE_STUB_LIB = @MAKE_STUB_LIB@
+@@ -120,7 +120,7 @@
+ RANLIB = @RANLIB@
+ RANLIB_STUB = @RANLIB_STUB@
+ SHLIB_CFLAGS = @SHLIB_CFLAGS@
+-SHLIB_LD = @SHLIB_LD@
++SHLIB_LD = @SHLIB_LD@ $(LDFLAGS_DEFAULT)
+ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
+ STLIB_LD = @STLIB_LD@
+ #TCL_DEFS = @TCL_DEFS@
+--- a/cat/Makefile.in
++++ b/cat/Makefile.in
+@@ -116,7 +116,7 @@
+ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.result *.tmp *.o tests/*.o
+ EXEEXT = @EXEEXT@
+ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
+-MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS)
++MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS) $(SHLIB_LD_LIBS)
+ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
+ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
+ MAKE_STUB_LIB = @MAKE_STUB_LIB@
+@@ -124,7 +124,7 @@
+ RANLIB = @RANLIB@
+ RANLIB_STUB = @RANLIB_STUB@
+ SHLIB_CFLAGS = @SHLIB_CFLAGS@
+-SHLIB_LD = @SHLIB_LD@
++SHLIB_LD = @SHLIB_LD@ $(LDFLAGS_DEFAULT)
+ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
+ STLIB_LD = @STLIB_LD@
+ #TCL_DEFS = @TCL_DEFS@
+@@ -436,7 +436,7 @@
+ cxxtests: $(CXX_TEST_APPS)
+
+ $(CXX_TEST_APPS): FORCE
+- $(CXXCOMPILE) -o $@ $(srcdir)/tests/$@.C $(TEST_LIBS) $(LIBS)
++ $(CXXCOMPILE) $(LDFLAGS_DEFAULT) -o $@ $(srcdir)/tests/$@.C $(TEST_LIBS) $(LIBS)
+ cp $(srcdir)/tests/test.table .
+ -@@LD_LIBRARY_PATH_VAR@=@exec_prefix@/lib; export @LD_LIBRARY_PATH_VAR@ ;\
+ $@ > $@.result 2>&1 ;\
diff --git a/sci-astronomy/skycat/files/skycat-3.1.3-remove-tclx-dep.patch b/sci-astronomy/skycat/files/skycat-3.1.3-remove-tclx-dep.patch
new file mode 100644
index 000000000000..73061798d370
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.1.3-remove-tclx-dep.patch
@@ -0,0 +1,315 @@
+diff -Nur skycat-3.1.3.orig/astrotcl/library/AstrotclInit.tcl skycat-3.1.3/astrotcl/library/AstrotclInit.tcl
+--- skycat-3.1.3.orig/astrotcl/library/AstrotclInit.tcl 2017-08-10 16:18:22.100000000 +0000
++++ skycat-3.1.3/astrotcl/library/AstrotclInit.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -11,7 +11,7 @@
+ # pbiereic 24/08/99 created
+ # abrighto 21/12/05 updated for new version
+
+-if {![lcontain $auto_path $astrotcl_library]} {
++if { $auto_path ni $astrotcl_library } {
+ lappend auto_path $astrotcl_library
+ }
+
+diff -Nur skycat-3.1.3.orig/cat/library/AstroCat.tcl skycat-3.1.3/cat/library/AstroCat.tcl
+--- skycat-3.1.3.orig/cat/library/AstroCat.tcl 2017-08-10 16:18:22.110000000 +0000
++++ skycat-3.1.3/cat/library/AstroCat.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -145,7 +145,7 @@
+ return
+ }
+ if {"$onoff" == "on"} {
+- lassign [pipe] rfd_ wfd_
++ lassign [chan pipe] rfd_ wfd_
+ fileevent $rfd_ readable [code $this feedback]
+ $w_.cat feedback $wfd_
+ } elseif {[info exists rfd_]} {
+diff -Nur skycat-3.1.3.orig/cat/library/AstroImage.tcl skycat-3.1.3/cat/library/AstroImage.tcl
+--- skycat-3.1.3.orig/cat/library/AstroImage.tcl 2017-08-10 16:18:22.110000000 +0000
++++ skycat-3.1.3/cat/library/AstroImage.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -401,7 +401,7 @@
+ return
+ }
+ if {"$onoff" == "on"} {
+- lassign [pipe] rfd_ wfd_
++ lassign [chan pipe] rfd_ wfd_
+ fileevent $rfd_ readable [code $this feedback]
+ $w_.im feedback $wfd_
+ } elseif {[info exists rfd_]} {
+diff -Nur skycat-3.1.3.orig/cat/library/CatInit.tcl skycat-3.1.3/cat/library/CatInit.tcl
+--- skycat-3.1.3.orig/cat/library/CatInit.tcl 2017-08-10 16:18:22.110000000 +0000
++++ skycat-3.1.3/cat/library/CatInit.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -12,7 +12,7 @@
+
+ package require img::xpm
+
+-if {![lcontain $auto_path $cat_library]} {
++if { $auto_path ni $cat_library } {
+ lappend auto_path $cat_library
+ }
+
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdImageBias.tcl skycat-3.1.3/rtd/library/RtdImageBias.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdImageBias.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdImageBias.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -10,6 +10,12 @@
+
+ itk::usual RtdImageBias {}
+
++# see http://wiki.tcl.tk/2028
++proc lvarpush {var val {ndx end}} {
++ upvar $var args
++ set args [linsert $args $ndx $val]
++}
++
+ # RtdImageBias is a class for controlling the subtraction of
+ # a bias frame.
+
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdImageFitsHeader.tcl skycat-3.1.3/rtd/library/RtdImageFitsHeader.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdImageFitsHeader.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdImageFitsHeader.tcl 2017-08-10 17:41:35.500000000 +0000
+@@ -11,6 +11,8 @@
+ # pbiereic 17/02/03 fixed problems with tabnotebook, packing order
+ # and labels of tabsets
+
++package require Tclutil
++
+ itk::usual RtdImageFitsHeader {}
+
+ # RtdImageFitsHeader is an itcl widget for displaying the FITS header of all
+@@ -156,7 +158,7 @@
+ set tconfig_(sort_cols) $sort_cols
+ set tconfig_(sort_order) $sort_order
+
+- loop i 0 $num_hdus_ {
++ for {set i 0} {$i < $num_hdus_} {incr i} {
+ $tabnotebook_(table$i) config -sort_cols $sort_cols \
+ -sort_order $sort_order
+ $tabnotebook_(table$i) new_info
+@@ -169,7 +171,7 @@
+ global $var
+ set val [set $var]
+ set tconfig_($label) $val
+- loop i 0 $num_hdus_ {
++ for {set i 0} {$i < $num_hdus_} {incr i} {
+ $tabnotebook_(table$i) set_option $label Show $val
+ $tabnotebook_(table$i) new_info
+ }
+@@ -216,7 +218,7 @@
+
+ set length [string length [$listbox get 0]]
+
+- loop n $start_idx $end_idx {
++ for {set n $start_idx} {$n < $end_idx} {incr n} {
+ set row [string tolower [$listbox get $n]]
+ if {[catch {regexp -indices $string $row indices} idx] } { continue }
+ if { $idx > 0 } {
+@@ -274,7 +276,7 @@
+ set hlist [$image_ hdu list]
+
+ set ExtName "HDU 1"
+- loop i 0 $hdu_count {
++ for {set i 0} {$i < $hdu_count} {incr i} {
+ set hdu [expr {$i + 1}]
+ set list [lindex $hlist $i]
+
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdImageHduChooser.tcl skycat-3.1.3/rtd/library/RtdImageHduChooser.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdImageHduChooser.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdImageHduChooser.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -16,6 +16,7 @@
+ # pbiereic 11/10/08 Break image display loop after failure.
+ # pbiereic 26/11/08 Using 'view update' for HDU images display.
+ # Using a toplevel window for the HDU images display.
++package require Tclutil
+
+ itk::usual RtdImageHduChooser {}
+
+@@ -426,7 +427,7 @@
+
+ private method svinfo {} {
+ set list [array get ext_ *NAXIS*]
+- loop i 0 [llength $list] 2 {
++ for {set i 0} {$i < [llength $list]} {incr i 2} {
+ lappend newlist "[lindex $list $i] [lindex $list [expr {$i+1}]]"
+ }
+ set newlist [lsort -increasing -index 0 $newlist]
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdImagePerf.tcl skycat-3.1.3/rtd/library/RtdImagePerf.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdImagePerf.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdImagePerf.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -9,6 +9,7 @@
+ # D. Hopkinson 31 Jan 97 Created
+ # P.Biereichel 21/07/97 % display is the default + some bug fixes
+ # P.Biereichel 01/03/01 Only % display suported + code revised
++package require Tclutil
+
+ itk::usual RtdImagePerf {}
+
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdImagePick2.tcl skycat-3.1.3/rtd/library/RtdImagePick2.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdImagePick2.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdImagePick2.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -62,6 +62,7 @@
+ # NOTES
+ # - In contrast to RtdImagePick, RtdImagePick2 does not use tkwait which may
+ # cause problem for an inheriting class due to nested calls to tkwait.
++package require Tclutil
+
+ itk::usual RtdImagePick2 { }
+
+@@ -127,7 +128,7 @@
+ {Set the magnification factor of the zoom} \
+ -menu [menu $magMenu_]
+
+- loop i 2 31 {
++ for {set i 2} {$i < 31} {incr i} {
+ $m.mag add radiobutton -label " ${i}x" \
+ -command [code $this scaleZoom $i] \
+ -variable $magMenu_
+diff -Nur skycat-3.1.3.orig/rtd/library/RtdInit.tcl skycat-3.1.3/rtd/library/RtdInit.tcl
+--- skycat-3.1.3.orig/rtd/library/RtdInit.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/RtdInit.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -10,7 +10,7 @@
+ # -------- --------- ----------------------------------------------
+ # pbiereic 24/08/99 created
+
+-if {![lcontain $auto_path $rtd_library]} {
++if { $auto_path ni $rtd_library} {
+ lappend auto_path $rtd_library
+ }
+
+diff -Nur skycat-3.1.3.orig/rtd/library/Rtd.tcl skycat-3.1.3/rtd/library/Rtd.tcl
+--- skycat-3.1.3.orig/rtd/library/Rtd.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/Rtd.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -650,7 +650,7 @@
+ set t6 "Tcl version:\t[info patchlevel]"
+ set t7 "Tcl package path:\t$tcl_pkgPath"
+ set t8 "Package versions:\t"
+- foreach el "Tclx Itcl Itk Tkx BLT" {
++ foreach el "Itcl Itk BLT" {
+ set t8 "$t8$el[package versions $el] "
+ }
+ DialogWidget $w_.rtd_about \
+diff -Nur skycat-3.1.3.orig/rtd/library/tRtd.tcl skycat-3.1.3/rtd/library/tRtd.tcl
+--- skycat-3.1.3.orig/rtd/library/tRtd.tcl 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/library/tRtd.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -10,6 +10,7 @@
+ # who when what
+ # -------------- --------- ----------------------------------------
+ # pbiereic 01/03/01 Created
++package require Tclutil
+
+ itk::usual tRtd {}
+
+diff -Nur skycat-3.1.3.orig/rtd/util/rmipc.tcl skycat-3.1.3/rtd/util/rmipc.tcl
+--- skycat-3.1.3.orig/rtd/util/rmipc.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/rtd/util/rmipc.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -20,7 +20,7 @@
+ }
+ set f [open "|ipcs $opt"]
+ while {[gets $f line] != -1} {
+- if { ![lcontain $line $env(USER)]} { continue }
++ if { $line ni $env(USER) } { continue }
+ set num [lindex $line 1]
+ if {![catch {expr $num}]} {
+ if {[catch {exec ipcrm $opt $num} msg]} {
+diff -Nur skycat-3.1.3.orig/skycat/library/SkycatInit.tcl skycat-3.1.3/skycat/library/SkycatInit.tcl
+--- skycat-3.1.3.orig/skycat/library/SkycatInit.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/skycat/library/SkycatInit.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -12,9 +12,11 @@
+
+ package require img::xpm
+
+-if {![lcontain $auto_path $skycat_library]} {
++if { $auto_path ni $skycat_library } {
+ lappend auto_path $skycat_library
+ }
+
+ namespace eval skycat {namespace export *}
+ namespace import -force skycat::*
++namespace import ::tcl::mathfunc::max
++namespace import ::tcl::mathfunc::min
+diff -Nur skycat-3.1.3.orig/tclutil/library/Batch.tcl skycat-3.1.3/tclutil/library/Batch.tcl
+--- skycat-3.1.3.orig/tclutil/library/Batch.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/tclutil/library/Batch.tcl 2017-08-10 17:40:54.160000000 +0000
+@@ -15,6 +15,8 @@
+ # -------- --------- ----------------------------------------------
+ # A.Brighton 20 Dec 95 created
+
++package require Expect
++
+ itk::usual Batch {}
+
+ # This class is used to evaluate a set of Tcl commands in a separate
+@@ -55,7 +57,7 @@
+ }
+ flush stdout
+ flush stderr
+- pipe rfd wfd
++ lassign [chan pipe] rfd wfd
+ set pid [fork]
+ if {$pid == 0} {
+ # child
+@@ -65,7 +67,7 @@
+ close $fd
+ puts $wfd $status
+ close $wfd
+- kill [pid]
++ kill [pid] 9
+ } else {
+ set bg_pid_ $pid
+ fileevent $rfd readable [code $this read_pipe $rfd $wfd]
+diff -Nur skycat-3.1.3.orig/tclutil/library/canvastext.tcl skycat-3.1.3/tclutil/library/canvastext.tcl
+--- skycat-3.1.3.orig/tclutil/library/canvastext.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/tclutil/library/canvastext.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -21,7 +21,7 @@
+ proc ct_search_forward_char {canvas item char} {
+ if {![lempty $item]} {
+ set text [lindex [$canvas itemconfigure $item -text] 4]
+- loop i [$canvas index $item insert] [$canvas index $item end] {
++ for {set i [$canvas index $item insert]} {$i < [$canvas index $item end]} {incr i} {
+ if {$char == [string index $text $i]} {
+ return $i
+ }
+@@ -37,7 +37,7 @@
+ proc ct_search_backward_char {canvas item char} {
+ if {![lempty $item]} {
+ set text [lindex [$canvas itemconfigure $item -text] 4]
+- loop i [expr {[$canvas index $item insert] - 1}] 0 -1 {
++ for {set i [expr {[$canvas index $item insert] - 1}]} {$i > 0} {decr i} {
+ if {$char == [string index $text $i]} {
+ return $i
+ }
+diff -Nur skycat-3.1.3.orig/tclutil/library/itcldoc.tcl skycat-3.1.3/tclutil/library/itcldoc.tcl
+--- skycat-3.1.3.orig/tclutil/library/itcldoc.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/tclutil/library/itcldoc.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -36,7 +36,6 @@
+ # A.Brighton 07 Jan 98 created
+
+ package require Itcl
+-package require Tclx
+
+ itcl::class ItclDoc {
+
+diff -Nur skycat-3.1.3.orig/tclutil/library/list.tcl skycat-3.1.3/tclutil/library/list.tcl
+--- skycat-3.1.3.orig/tclutil/library/list.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/tclutil/library/list.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -50,3 +50,9 @@
+ }
+ return $l
+ }
++
++proc lempty {list} {
++ if {[catch {llength $list} len]} { return 0 }
++ return [expr {$len == 0}]
++}
++
+diff -Nur skycat-3.1.3.orig/tclutil/library/TclutilInit.tcl skycat-3.1.3/tclutil/library/TclutilInit.tcl
+--- skycat-3.1.3.orig/tclutil/library/TclutilInit.tcl 2017-08-10 16:18:22.130000000 +0000
++++ skycat-3.1.3/tclutil/library/TclutilInit.tcl 2017-08-10 17:38:25.850000000 +0000
+@@ -16,9 +16,8 @@
+
+ package require Itcl
+ package require Itk
+-package require Tclx
+
+-if {![lcontain $auto_path $tclutil_library]} {
++if {$auto_path ni $tclutil_library} {
+ lappend auto_path $tclutil_library
+ }
+
diff --git a/sci-astronomy/skycat/files/skycat-3.1.3-string-issues.patch b/sci-astronomy/skycat/files/skycat-3.1.3-string-issues.patch
new file mode 100644
index 000000000000..f3e62572a133
--- /dev/null
+++ b/sci-astronomy/skycat/files/skycat-3.1.3-string-issues.patch
@@ -0,0 +1,57 @@
+diff -Nur skycat-3.1.3.orig/cat/generic/TclAstroCat.C skycat-3.1.3/cat/generic/TclAstroCat.C
+--- skycat-3.1.3.orig/cat/generic/TclAstroCat.C 2017-08-10 16:18:22.110000000 +0000
++++ skycat-3.1.3/cat/generic/TclAstroCat.C 2017-08-10 18:06:22.660000000 +0000
+@@ -75,7 +75,7 @@
+ */
+ static class TclAstroCatSubCmds {
+ public:
+- char* name; // method name
++ const char* name; // method name
+ int (TclAstroCat::*fptr)(int argc, char* argv[]);
+ int min_args; // minimum number of args
+ int max_args; // maximum number of args
+diff -Nur skycat-3.1.3.orig/rtd/generic/BiasData.C skycat-3.1.3/rtd/generic/BiasData.C
+--- skycat-3.1.3.orig/rtd/generic/BiasData.C 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/generic/BiasData.C 2017-08-10 18:05:35.520000000 +0000
+@@ -76,7 +76,7 @@
+ char* BiasData::file(int nr)
+ {
+ if (nr < 0 || nr >=MAXBIAS)
+- return '\0';
++ return "";
+ return &files_[nr][0];
+ }
+
+diff -Nur skycat-3.1.3.orig/rtd/generic/RtdPerf.C skycat-3.1.3/rtd/generic/RtdPerf.C
+--- skycat-3.1.3.orig/rtd/generic/RtdPerf.C 2017-08-10 16:18:22.120000000 +0000
++++ skycat-3.1.3/rtd/generic/RtdPerf.C 2017-08-10 18:05:35.520000000 +0000
+@@ -226,18 +226,18 @@
+ accGENtime_ = accTCLtime_ = accXtime_ = accFREQtime_ = 0.0;
+
+ // Clear the Tcl variables.
+- Tcl_SetVar2(interp_, var, "PERF_COUNT", '\0', TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_COUNT", "", TCL_GLOBAL_ONLY);
+
+- Tcl_SetVar2(interp_, var, "PERF_FREQ", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_GEN", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_XFUNC", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_TCL", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_TOTAL", '\0', TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_FREQ", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_GEN", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_XFUNC", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_TCL", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_TOTAL", "", TCL_GLOBAL_ONLY);
+
+- Tcl_SetVar2(interp_, var, "PERF_FREQ_AVE", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_GEN_AVE", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_XFUNC_AVE", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_TCL_AVE", '\0', TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp_, var, "PERF_TOTAL_AVE", '\0', TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_FREQ_AVE", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_GEN_AVE", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_XFUNC_AVE", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_TCL_AVE", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp_, var, "PERF_TOTAL_AVE", "", TCL_GLOBAL_ONLY);
+ }
+
diff --git a/sci-astronomy/skycat/metadata.xml b/sci-astronomy/skycat/metadata.xml
new file mode 100644
index 000000000000..6f23b504ba45
--- /dev/null
+++ b/sci-astronomy/skycat/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ SkyCat is a tool that combines visualization of images and access
+ to catalogs and archive data for astronomy. It was developed at
+ the European Southern Observatory.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/skycat/skycat-3.1.2-r2.ebuild b/sci-astronomy/skycat/skycat-3.1.2-r2.ebuild
new file mode 100644
index 000000000000..6d1350d0d559
--- /dev/null
+++ b/sci-astronomy/skycat/skycat-3.1.2-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools flag-o-matic
+
+DESCRIPTION="ESO astronomical image visualizer with catalog access"
+HOMEPAGE="http://archive.eso.org/skycat"
+SRC_URI="http://archive.eso.org/cms/tools-documentation/skycat-download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="threads"
+
+DEPEND="x11-libs/libXext
+ >=dev-tcltk/tclx-2.4
+ >=dev-tcltk/blt-2.4
+ >=dev-tcltk/itcl-3.3
+ >=dev-tcltk/iwidgets-4.0.1
+ >=dev-tcltk/tkimg-1.3
+ sci-libs/cfitsio
+ sci-astronomy/wcstools"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-m4.patch # fix buggy tcl.m4 for bash3 and add soname
+ "${FILESDIR}"/${P}-makefile-qa.patch
+ "${FILESDIR}"/${PN}-3.0.2-systemlibs.patch # use system libs
+ "${FILESDIR}"/${PN}-3.0.2-tk8.5.patch # need fix for tk-8.5
+)
+
+src_prepare() {
+ default
+ rm -fr astrotcl/{cfitsio,libwcs} \
+ || die "Failed to remove included libs"
+ # prefix it
+ sed -i \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ */configure.in */aclocal.m4 || die
+ local f
+ for f in configure.in */configure.in ; do
+ mv "$f" "${f/.in/.ac}" || die
+ done
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags -DUSE_INTERP_RESULT # 514604
+ econf $(use_enable threads) --enable-merge
+}
+
+src_install() {
+ default
+ local d f
+ for d in tclutil astrotcl rtd cat skycat; do
+ for f in README CHANGES VERSION; do
+ newdoc ${f} ${f}.${d}
+ done
+ done
+}
diff --git a/sci-astronomy/skycat/skycat-3.1.3.ebuild b/sci-astronomy/skycat/skycat-3.1.3.ebuild
new file mode 100644
index 000000000000..4ade8b0c438b
--- /dev/null
+++ b/sci-astronomy/skycat/skycat-3.1.3.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="ESO astronomical image visualizer with catalog access"
+HOMEPAGE="http://archive.eso.org/skycat"
+SRC_URI="http://archive.eso.org/cms/tools-documentation/skycat-download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="threads"
+
+DEPEND="
+ dev-tcltk/blt:=
+ dev-tcltk/expect:=
+ dev-tcltk/itcl:=
+ dev-tcltk/iwidgets:=
+ dev-tcltk/tkimg:=
+ sci-astronomy/wcstools:=
+ sci-libs/cfitsio:=
+ x11-libs/libXext:=
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.3-string-issues.patch
+ "${FILESDIR}"/${PN}-3.1.3-remove-tclx-dep.patch
+ "${FILESDIR}"/${PN}-3.1.2-m4.patch
+ "${FILESDIR}"/${PN}-3.1.2-makefile-qa.patch
+ "${FILESDIR}"/${PN}-3.0.2-systemlibs.patch
+ "${FILESDIR}"/${PN}-3.0.2-tk8.5.patch
+)
+
+src_prepare() {
+ default
+ rm -r astrotcl/{cfitsio,libwcs} || die
+ # prefix it
+ sed -e "s:/usr:${EPREFIX}/usr:g" \
+ -i */configure.in */aclocal.m4 || die
+ local f
+ for f in configure.in */configure.in ; do
+ mv "$f" "${f/.in/.ac}" || die
+ done
+ # bug #626162 . lazy sed to avoid a big patch
+ sed -i -e 's/static char/static unsigned char/g' $(find . -name \*.xbm) || die
+ eautoreconf
+}
+
+src_configure() {
+ # bug #514604
+ append-cppflags -DUSE_INTERP_RESULT
+ econf $(use_enable threads) --enable-merge
+}
+
+src_install() {
+ default
+ local d f
+ for d in tclutil astrotcl rtd cat skycat; do
+ for f in README CHANGES VERSION; do
+ newdoc ${f} ${f}.${d}
+ done
+ done
+}
diff --git a/sci-astronomy/skymaker/Manifest b/sci-astronomy/skymaker/Manifest
new file mode 100644
index 000000000000..1fbe463c47f1
--- /dev/null
+++ b/sci-astronomy/skymaker/Manifest
@@ -0,0 +1,4 @@
+DIST skymaker-3.10.5.tar.gz 508938 SHA256 a16f9c2bd653763b5e1629e538d49f63882c46291b479b4a4997de84d8e9fb0f SHA512 98bb5a75c21475c6ecf16cb7de333db7faae95fd32c4ac311b44ddf637ffec2c80061b056b070b8d21b1a5a46c0a5a82855e417d25a9d8de02aad2167cb45b43 WHIRLPOOL 485cf8ad6b38b3ec3c5b9544b5c98ffcd24f485630c1228a8a95ef62b3c2b1618aea16cd6ee222cd89ae2080d313dc55eb88aebd2eaadc61b7e378d12bf66fe8
+EBUILD skymaker-3.10.5.ebuild 478 SHA256 d9442858bc1317b490ed24e1775d70b86ff46782971de89ae74868179e94cde5 SHA512 8b5718b7f30c6ee93cd100085db033c9f3f348b71596cc768d7002cf4e46f7a872ac280472b10d788cfe2bfde8e55b7205f974c753060136bdcfc2ed76de75c4 WHIRLPOOL 1e9e0543b908677eae87fb3d1cd93beea0daf6508191a8a9ea7d9cb17e63603262562a4a0278326041d3c8c3340f9480caa18b59f22fd808be9e0dfa1561588c
+MISC ChangeLog 324 SHA256 88e4c6c06e02824e6abcf9bc1e24f7a7016a9e3a6479c069353bc31b8e777162 SHA512 b33f4f60c172f49423e22bc9c883254c474381daea38c78eb8c1d2a52ec6da12b07f420830010240ff3dde897b0fc378a01afac70ed8f44fcaeb5eb4dd61cd9b WHIRLPOOL 11c42af325d37e85ef94e1384b28b3f9afdc466d0ea9f22efb40e47e25844b514cea61d1dc6c8ecae153d497908f9d9fe4f20a394d953e2515d265c56d74bcce
+MISC metadata.xml 637 SHA256 21b806df0aa7d6837980f697ea1f0a0aca490f42ccd13b56bc4c3a6d7a92e0c1 SHA512 e51f32c21e60a358885cf7255be65b124388a4c753738578237d1d4b2d527e3d3d4e7fb2310e13d65f219293b7329281a343e021551dd4648162476b37c126fa WHIRLPOOL 52c65b82b0f722c94a05852b16aab74513f4cc3bab6977d1601db8d7e32662a06e2a0eff8a08a2ecb52eb416a2dee5160dc38db6358f47e47297368538bf1a97
diff --git a/sci-astronomy/skymaker/metadata.xml b/sci-astronomy/skymaker/metadata.xml
new file mode 100644
index 000000000000..a5fb716028ef
--- /dev/null
+++ b/sci-astronomy/skymaker/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ SkyMaker is a program that simulates astronomical images. It accepts
+ object lists in ASCII generated by the Stuff program to produce
+ realistic astronomical fields. There are various options for the user:
+ build a realistic Point Spread Function, generate a list of stars and
+ galaxies. Galaxies are modeled analytically.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/skymaker/skymaker-3.10.5.ebuild b/sci-astronomy/skymaker/skymaker-3.10.5.ebuild
new file mode 100644
index 000000000000..da9788d145b4
--- /dev/null
+++ b/sci-astronomy/skymaker/skymaker-3.10.5.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Program that simulates astronomical images"
+HOMEPAGE="http://www.astromatic.net/software/skymaker"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="threads"
+
+RDEPEND="sci-libs/fftw:3.0"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf $(use_enable threads)
+}
diff --git a/sci-astronomy/sofa_c/Manifest b/sci-astronomy/sofa_c/Manifest
new file mode 100644
index 000000000000..0d519240be37
--- /dev/null
+++ b/sci-astronomy/sofa_c/Manifest
@@ -0,0 +1,10 @@
+AUX sofa_c-makefile.patch 3345 SHA256 2b605d5829419b49ee79acc9e583eecbde5b7eea429499ddf98fc18a8d4bb726 SHA512 a38248d3912ef68aecbc2ed1b28181378b2c92a470b1447865f1cf9d9475f7fbc584ff1bcf7184e563f298b72b0284c81e4b905757208459cebb9b7cb4dbc26b WHIRLPOOL b9d4509037d514ef67e3230aabbeded48cc86897798d0fc560bea7353afb3bc9c90d5b56c5af445a9d40267721da6c3a9457f17ce0890a557e02e7ac4359229d
+DIST sofa_c-20150209_a.tar.gz 1685051 SHA256 b542c5e4ca42d91ada3c66e8d5b86eb9dec085bf1a07d058c01920c6c0b1174a SHA512 45524228db30c388315ce76c1d85db422fac09da3c3ed1442e362a6a2b4a10d27c19ea4a2d51c854280102a99706663622e0375b4afbf096b79877e7602fec4c WHIRLPOOL f4b084145cb3b9c2d722885ed89d2b8298d8fa4a21da25778852d76d20342331c3e7e2c6e28b3d0df04bc9bdf6fc921fe0e60f545ca91dcf69fe86316252006f
+DIST sofa_c-20160503_c.tar.gz 1720164 SHA256 202608f75ae51b03fad5599d6efd7226f0c5073f9b409a82fddc7e841f165e16 SHA512 d21f02d0669a8707e8b2d34be4f30b4acc222b4155e7b4e4f9fc54bbabf1edc99b49e66619581bc3427eff8ed1d26668aae86af73f63a5fd21eb73f3339e0f26 WHIRLPOOL b4b276cbed394f423eb945fd95a3de27643e445ed58c90f3dd6d8512a469f775b2c0804a2a2bf9c4807d301bcb2714b5eaa961298787d5d3a6aadf1e43809b1b
+DIST sofa_c-20170420.tar.gz 1780577 SHA256 2ca0cc584f9420c72aef5a6c2f8551537e5dd5c1b77d7b189e86e6033120e668 SHA512 f2dd806243e3aec51ea03a54e10e533d4c3c1a69d032d5f3ddd7cd823a75aeed8033491c91366813b8d8e5c0b66e0fd582e6ede03aa7b136311fdd7a4ebf20d3 WHIRLPOOL 32cca3f6342a32cfa2e943b79c168bf55504f8a73614a3f1182e4ed8c295ae10a6ea4ed0f283b20854fcf665468b5794fd86c76c014989674ba781dbe29160df
+EBUILD sofa_c-20150209a.ebuild 789 SHA256 333ad7d559b93a865d257fde48f61e1db5757177e5442e96d4b812bfbcff1c78 SHA512 8cad3a409c66b7b49391e231eaba775ca1450a7c0edfe28c5f1eed92fa3d0476d324216be7d4770756a2281024137314ed757f09e777783e4b30bd07567dcf59 WHIRLPOOL 6aff8b0c4d4ce653d327b13d65bd54522b1e138f29bc630dec032f7a4e797a68b9294fd2e0f833e88469a8fb200bbe0538fa92a55af88f672427d7a736e622ed
+EBUILD sofa_c-20160503c.ebuild 789 SHA256 151ca8312fbbad747bb619bb6cffaaebbaf617855a82ce28eb03b6d65d6308f3 SHA512 9c05d2c19e0d9a7f47652c4a163f1e91a39252516d3c3f27ef5fc72e4a10f120cce14368ac26f2cd85ff62eeb5dd42c965e721e0e6f7db8ce69243b5462e861a WHIRLPOOL 56c6645dc49b11d07d2e7cd9df1fd2bd2138c673667af02037b261f859e89f95a9396925fcbd8b2f6b38c7bcdae6c5b647fc640ce398fec79128df7032c1d936
+EBUILD sofa_c-20170420.ebuild 793 SHA256 c2baab94934c42636a3255fbd6060b3a968cba83067e7037858f85f7572b7076 SHA512 250743503aee1951afa017502c801f6dcd9b901c8db82abe61c70ebe170e26f553dc48d885455906d8e40b47203fc2d7778555ea80b725375ff1507b90126065 WHIRLPOOL 8f773995740af6fe4f0e328bc32fe60803ae8878a2188fc6594f17714736494b0b11932d307b67d161f4380ebd05d137761fb12f8c325be8408636fd39849262
+MISC ChangeLog 2703 SHA256 77f13d7b645c682b30679c22a0939743d8880697a048cc5c4bb973a0a19b5297 SHA512 741094180a78a307472c0950af2245ed641733c137008d8e11906a3abe9a75ae262b55d75973290f0497b95f8b3ab2056fb3b00df809069dc917a47be4d2e90b WHIRLPOOL 4f7e819bdb3a56dd42f48865b7bf58a59cbbfd1a591659ad59bcfabef5fddf357dcf3b988f6ae219e2f0138c449bf37ce37d40a8bbe59ce8a8fbe8115fa91fab
+MISC ChangeLog-2015 668 SHA256 972603bb9cc8dbfee84c82e87d091dfdea818889bda160d725872baddacf1cac SHA512 cf738733d900c15b787cc696b6c78c7f13ebc4c146a852605b1f942230641b23dc68ed069b8e881b0f71e1243c58295e9c573f4eda684c92b65140ba8d39df72 WHIRLPOOL 62eb6816b47d42a62c7e4013e3399e714a918b3e2623a10e7e3e508df827c1148b4566aa80091b4b56b289f8a9430bb2c51c9240f0e969fb4a13e9d22b2a210b
+MISC metadata.xml 962 SHA256 90743c1461bd8d94d3184f78bd0af2a6a82a2dc09cc11ff60daf707bed021b5e SHA512 6b390092f6c9b2f1ee65e6152f86ca6bc88cd487994ea4d4a6d73bae70eacb4c3f05c203e679ec58e3b63738da313329834ddbda91f94e54f3feb65091dfc119 WHIRLPOOL 81d7e498d9dcd0fc5b08be9f03889e01ef88f809b7c68c3d04afa099795476837e1308c74a11f65f63ff46bfeae9fd0441c35264dae2b2d22373dd5bcfccaf40
diff --git a/sci-astronomy/sofa_c/files/sofa_c-makefile.patch b/sci-astronomy/sofa_c/files/sofa_c-makefile.patch
new file mode 100644
index 000000000000..00c1a6ae735d
--- /dev/null
+++ b/sci-astronomy/sofa_c/files/sofa_c-makefile.patch
@@ -0,0 +1,105 @@
+--- src/makefile.orig
++++ src/makefile
+@@ -49,7 +49,7 @@
+
+ # Specify the installation home directory.
+
+-INSTALL_DIR = $(HOME)
++INSTALL_DIR = $(DESTDIR)/usr
+
+ # Specify the installation directory for the library.
+
+@@ -63,9 +63,9 @@
+ # of your preferred C compiler (CCOMPC) and compilation flags (CFLAGF
+ # for functions, CFLAGX for executables) here.
+
+-CCOMPC = gcc
+-CFLAGF = -c -pedantic -Wall -W -O
+-CFLAGX = -pedantic -Wall -W -O
++CCOMPC = $(CC)
++CFLAGF = $(CPPFLAGS) -I. -c -fPIC $(CFLAGS)
++CFLAGX = $(CPPFLAGS) -I. $(CFLAGS)
+
+ #----YOU SHOULDN'T HAVE TO MODIFY ANYTHING BELOW THIS LINE---------
+
+@@ -80,6 +80,11 @@
+ SOFA_LIB_NAME = libsofa_c.a
+ SOFA_LIB = $(SOFA_LIB_DIR)$(SOFA_LIB_NAME)
+
++# Name the SOFA/C library in its source and target locations.
++
++SOFA_SHLIB_NAME = libsofa_c.so
++SOFA_SHLIB = $(SOFA_LIB_DIR)$(SOFA_SHLIB_NAME)
++
+ # Name the SOFA/C testbed in its source and target locations.
+
+ SOFA_TEST_NAME = t_sofa_c.c
+@@ -88,7 +93,7 @@
+ # Name the SOFA/C includes in their source and target locations.
+
+ SOFA_INC_NAMES = sofa.h sofam.h
+-SOFA_INC = $(SOFA_INC_DIR)sofa.h $(SOFA_INC_DIR)sofam.h
++SOFA_INC = $(SOFA_INC_NAMES:%=$(SOFA_INC_DIR)%)
+
+ # The list of SOFA/C library object files.
+
+@@ -321,28 +326,31 @@
+ #-----------------------------------------------------------------------
+
+ # Build (but do not install) the library.
+-all : $(SOFA_LIB_NAME)
++all : $(SOFA_SHLIB_NAME)
+ -@ echo ""
+ -@ echo "*** Now type 'make test'" \
+ " to install the library and run tests ***"
+ -@ echo ""
+
+ # Install the library and header files.
+-install $(SOFA_LIB) : $(INSTALL_DIRS) $(SOFA_LIB_NAME) $(SOFA_INC)
+- cp $(SOFA_LIB_NAME) $(SOFA_LIB_DIR)
++install: $(INSTALL_DIRS) $(SOFA_SHLIB_NAME) $(SOFA_INC)
++ cp $(SOFA_SHLIB_NAME).0.0 $(SOFA_LIB_DIR)
++ ln -s $(SOFA_SHLIB_NAME).0.0 $(SOFA_SHLIB).0
++ ln -s $(SOFA_SHLIB_NAME).0 $(SOFA_SHLIB)
++
+
+ # Deinstall the library and header files.
+ uninstall:
+- - $(RM) $(SOFA_LIB) $(SOFA_INC)
++ - $(RM) $(SOFA_LIB) $(SOFA_SHLIB)* $(SOFA_INC)
+
+ # Test the build.
+-check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME)
+- $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) $(SOFA_LIB_NAME) \
++check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_SHLIB_NAME)
++ $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) $(SOFA_SHLIB_NAME).0.0 \
+ -lm -o $(SOFA_TEST)
+- ./$(SOFA_TEST)
++ LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}:." ./$(SOFA_TEST)
+
+ # Test the installed library.
+-installcheck test: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
++installcheck: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
+ $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) -I$(SOFA_INC_DIR) \
+ -L$(SOFA_LIB_DIR) -lsofa_c -lm -o $(SOFA_TEST)
+ ./$(SOFA_TEST)
+@@ -353,7 +361,7 @@
+
+ # Delete all generated binaries in the current directory.
+ realclean distclean : clean
+- - $(RM) $(SOFA_LIB_NAME) $(SOFA_TEST)
++ - $(RM) $(SOFA_LIB_NAME) $(SOFA_SHLIB_NAME)* $(SOFA_TEST)
+
+ # Create the installation directories if not already present.
+ $(INSTALL_DIRS):
+@@ -363,6 +371,10 @@
+ $(SOFA_LIB_NAME): $(SOFA_OBS)
+ ar ru $(SOFA_LIB_NAME) $?
+
++$(SOFA_SHLIB_NAME): $(SOFA_OBS)
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(SOFA_SHLIB_NAME).0 $? -lm -o $(SOFA_SHLIB_NAME).0.0
++ ln -sfn $(SOFA_SHLIB_NAME).0.0 $(SOFA_SHLIB_NAME).0
++
+ # Install the header files.
+ $(SOFA_INC) : $(INSTALL_DIRS) $(SOFA_INC_NAMES)
+ cp $(SOFA_INC_NAMES) $(SOFA_INC_DIR)
diff --git a/sci-astronomy/sofa_c/metadata.xml b/sci-astronomy/sofa_c/metadata.xml
new file mode 100644
index 000000000000..d8484b69c201
--- /dev/null
+++ b/sci-astronomy/sofa_c/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ This is a suite of vector/matrix routines and various utilities that
+ underpin the astronomy algorithms, which include routines for the
+ following:
+ * Calendars
+ * Time Scales
+ * Earth rotation and sidereal time
+ * Ephemerides (medium precision)
+ * Geocentric/geodetic transformations
+ * Precession, nutation, polar motion
+ * Star space motion
+ * Star catalogue conversion
+ This is the ANSI C version of the library.
+ The International Astronomical Union's SOFA service has the task of
+ establishing and maintaining an accessible and authoritative set of
+ algorithms and procedures that implement standard models used in
+ fundamental astronomy.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/sofa_c/sofa_c-20150209a.ebuild b/sci-astronomy/sofa_c/sofa_c-20150209a.ebuild
new file mode 100644
index 000000000000..e145edaa645c
--- /dev/null
+++ b/sci-astronomy/sofa_c/sofa_c-20150209a.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+YYYY=${PV:0:4}
+MMDD=${PV:4:4}
+MYPV=${YYYY}${MMDD}_${PV:8:1}
+
+DESCRIPTION="Library for algorithms for models in fundamental astronomy"
+HOMEPAGE=" http://www.iausofa.org/current_C.html"
+SRC_URI="http://www.iausofa.org/${YYYY}_${MMDD}_C/${PN}-${MYPV}.tar.gz"
+
+LICENSE="SOFA"
+SLOT=0
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND=""
+
+PATCHES=( "${FILESDIR}/${PN}-makefile.patch" )
+
+S="${WORKDIR}/sofa/${MYPV}/c/src"
+
+src_prepare() {
+ default
+ sed -i -e "s:/lib:/$(get_libdir):" makefile || die
+ tc-export CC
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ cd ..
+ dodoc 00READ.ME
+ use doc && dodoc doc/*.lis doc/*.pdf
+}
diff --git a/sci-astronomy/sofa_c/sofa_c-20160503c.ebuild b/sci-astronomy/sofa_c/sofa_c-20160503c.ebuild
new file mode 100644
index 000000000000..00b50264fd84
--- /dev/null
+++ b/sci-astronomy/sofa_c/sofa_c-20160503c.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+YYYY=${PV:0:4}
+MMDD=${PV:4:4}
+MYPV=${YYYY}${MMDD}_${PV:8:1}
+
+DESCRIPTION="Library for algorithms for models in fundamental astronomy"
+HOMEPAGE=" http://www.iausofa.org/current_C.html"
+SRC_URI="http://www.iausofa.org/${YYYY}_${MMDD}_C/${PN}-${MYPV}.tar.gz"
+
+LICENSE="SOFA"
+SLOT=0
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND=""
+
+PATCHES=( "${FILESDIR}"/${PN}-makefile.patch )
+
+S="${WORKDIR}/sofa/${MYPV}/c/src"
+
+src_prepare() {
+ default
+ sed -i -e "s:/lib:/$(get_libdir):" makefile || die
+ tc-export CC
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ cd ..
+ dodoc 00READ.ME
+ use doc && dodoc doc/*.lis doc/*.pdf
+}
diff --git a/sci-astronomy/sofa_c/sofa_c-20170420.ebuild b/sci-astronomy/sofa_c/sofa_c-20170420.ebuild
new file mode 100644
index 000000000000..d8382b0d7524
--- /dev/null
+++ b/sci-astronomy/sofa_c/sofa_c-20170420.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+YYYY=${PV:0:4}
+MMDD=${PV:4:4}
+#PP=${PV:8:1}
+MYPV=${YYYY}${MMDD}
+
+DESCRIPTION="Library for algorithms for models in fundamental astronomy"
+HOMEPAGE=" http://www.iausofa.org/current_C.html"
+SRC_URI="http://www.iausofa.org/${YYYY}_${MMDD}_C/${PN}-${MYPV}.tar.gz"
+
+LICENSE="SOFA"
+SLOT=0
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND=""
+
+PATCHES=( "${FILESDIR}"/${PN}-makefile.patch )
+
+S="${WORKDIR}/sofa/${MYPV}/c/src"
+
+src_prepare() {
+ default
+ sed -i -e "s:/lib:/$(get_libdir):" makefile || die
+ tc-export CC
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ cd ..
+ dodoc 00READ.ME
+ use doc && dodoc doc/*.lis doc/*.pdf
+}
diff --git a/sci-astronomy/stellarium/Manifest b/sci-astronomy/stellarium/Manifest
new file mode 100644
index 000000000000..32f36f821ea6
--- /dev/null
+++ b/sci-astronomy/stellarium/Manifest
@@ -0,0 +1,13 @@
+DIST stars_4_1v0_1.cat 17040932 SHA256 7a2084e5e45610bbffae9448d9552d8a8dd191e5b1a07b0e47d27622fab4a979 SHA512 adf2241d0a8b58eb6b8ad5f885dd8a3a66610a63ae949f17f26e81f1ac8d1094d77879e361a0de3929e0d447b0de77142e0c7de0f1f123bd145e130fbfbe0f9a WHIRLPOOL 36267ddb117ed5100bb491760ec5589f8752bf0c655f45e78f7aad500f00d6dae1fdadd1af5d7663b81b8c2df4afed7cd07c652e056391beb531639739bd866c
+DIST stars_5_2v0_1.cat 42580300 SHA256 c4ebd18d05a805308cfac85fe224e3f0a75db6579cae65c935a0954da13f4164 SHA512 6fc0f7352d1165a0744cc932b6d379741e4614d5a95edd136522c789eaa8d1bcf05d7445f7dfd6896e8183aa64bf37b3610d87902b54542f62f2418b285892e0 WHIRLPOOL 946a7b57367ae21eae3c2ba59238b8502064d93511f43bc70b26f1383d75e403ba21e6ca0ee60f859521630a213f179ceab51f0380cbbacf92b255812cf69166
+DIST stars_6_2v0_1.cat 148352404 SHA256 5794c7cd035f52d25608e9a2bd40c35f1d65f0327ef80c87fde93ef4047fc555 SHA512 794279407595f44bbc1e492086063d98068bf332202a5448cd83dd7afbdcf7c6c3ff2878f3016369ebb5a98552874eb4eddb38e2c40e9a163c6231b640e02977 WHIRLPOOL 1c4c12ce12dd3cd1d7a2e0e11cd34b378ae4c5f2a61f2b6a8e4889b61e78944e4caacae6a0ee78fc00ad022c90944fa7a6e3021f0f2c57c605f377c199a77486
+DIST stars_7_2v0_1.cat 305710678 SHA256 4d812c078f03d01c9b24bacedf6e688a4382d92468bab2aba2b96a9a0358a406 SHA512 43b866eb793e8812c9d5502101a6c985d2055fb88bdbda274726bcd51e1527ecf342b22acd673318c9c8e88cac68eace18de8f27d29ffe64933fd32a5b84c5e3 WHIRLPOOL 6647e41ae573b0c2a2eb3c22ea0a34a50f077ef8c89fab35f101c08dcf1657b0a7d7d2812b73dc53c6992d25ccb3915ebdfbe7b7faafbda3bb69f81a2c82c2d9
+DIST stars_8_2v0_1.cat 559068934 SHA256 f1c0b3f25737f405ed4a2a045091d348885ffceb47258c3e32a2f4a800cac482 SHA512 06d4fa298b9dff8452f550377df99fcaa5e7107cfc7b75c9a4769b3cb6d97a822a54213c706102c1d7ef2dabc16df32a85f46b2f6d6c6f76a4e919353b739de4 WHIRLPOOL a467e7aef3851ad219103a401e20896a89efe01615e5df753c63a74876442dcf22c78d838b269dca50af58e9484f1d1abfd56f2ecdfdb57fdb3e1087e2e7136e
+DIST stellarium-0.14.3.tar.gz 137661611 SHA256 de41c5b14fdf0c5f6e73bab2975f380554487b1817f2c5a2ebad3bb8e9e729a4 SHA512 83d9a1c53f118c143e81d31e7f87dbf73368bfa981311c8bc41a51307fe6108c9169b43ad1fdde1cec84b9b1e8a4ef51d4de3b91d7aa676be38302b2223a6675 WHIRLPOOL 441302d93778185c9743451bd04148bd4a8a599eaff4f5a7b90025df9eb9873e1a203f0a82f687b7d2fb53fcf811e16903000d7179c6508738935518a2bbe966
+DIST stellarium-0.16.0.tar.gz 204675673 SHA256 2835c4aa22c1b64edbd17b174a23e4ed23654cd09e12f3573709f44843913dcf SHA512 0f75441435ff1d0fa149264116e9ae6ec3b3553f7c66e78832bdb0ffd55cbef656b820680134d95f89c73e80ef283372660ea7545db7fff205da66cf4cf8e9d6 WHIRLPOOL 45b338788313a6e4effc3e1129cbbb1396de303d233e4cc5aeab5ddaebae700f444ed3152c9d7995c59dcf6ac9f375cdee068ad78a0ee40a086d7c22f39833fe
+EBUILD stellarium-0.14.3.ebuild 2774 SHA256 da83cc0141d9ba3368ec0699bb52e76112dbb684371bb88ee50d0467ffe784a5 SHA512 475cd7646e592982450186d94c2720721ca5d049823bc341151710b43903b6a5ca9d7456cbe6fe6eaaa1388e87c2cb2cf01fb39fcd15472960ee0027b76f2557 WHIRLPOOL 906b2c5bafb4ad2ad0f0d190bd545cbcf3be8b72ee99fbeb3395214748803a2391ab9982f413eda93efca90a5ff780bc2318f6db62ea9845ff35f27a182a46b0
+EBUILD stellarium-0.16.0-r1.ebuild 2724 SHA256 ce5ff1551c5cc6ec733f526d2afcfa74f927acd176e3bac2b194ba69ac4b7f2b SHA512 dd2ad3788d808ab3d27cea5667423d6c9f2061a0dc8b2baafa2c68ca2f2d4ad8b2d48339b5676f889d3b760b430bb26881a3b9f6a78ceb7e319116c2bdd2a2a6 WHIRLPOOL 350b961d0b89434cadd9fb7584f9b92996d9171f61be3376e43c9d6d295f446c7d103749ffeb4d316777695b9dee0c26353c2076ff3eba878a75b7218a6e7bfb
+EBUILD stellarium-0.16.0.ebuild 2733 SHA256 2fce8864b6b0e05f25410dac8a6f732e46929f1799fcd0297f5e05d2fd261bfa SHA512 dd69d6110a21f007cfa04f6c5dff81e282b5985e8507395ac95536b15f86f80bffcb4ff012d4509e22c9233f75157bf8c7690396501f1ddc6cccd437a226a4e2 WHIRLPOOL 90fde6bcde02452d405548c81d62ca06c9151b349f4c39ce5a6d0ef17fb14c3c0c12a52c04322d144cd27973d437b12c5961d35dc36ff8abcfbc2f8603d4c65b
+MISC ChangeLog 6534 SHA256 e448a0b78da89be60d5489eb58db29444df2ce3774ea35d9aa89e20d9fbc3879 SHA512 e68edf376e8444f925626808b8061a96bf584f6c4009212d1ae74141f5a230b6813bea0e57b358b76606e4f9a9a2453b30bb317563a78368c5d4f25d8d3ba836 WHIRLPOOL d1fa1222a919ef7838b7a26be8a4e18a78e94c4173f0022594b7cd91b41b334eb9ed6f405221f89dd039ea7c3a2064d0c0511dbc8edf684d1a9d23f53e2265f5
+MISC ChangeLog-2015 19060 SHA256 e21a3f6c766dc0e70995598fb9efb8c65c423815fc9421c4a78f1dd06136e5d8 SHA512 eaff80eed27e4d784d7cae37b0127bfcb1f7d7a3f48709cbd9b57e72f68e20d3d8458390f3f587f3881c17da176cc29045b8cef77ae94ee744ef754363ccc964 WHIRLPOOL 94d297bd0e770272aad1cc4c3d3f5d775627c870d19892207ee78dc4292d084825e355564a6488af110586d52fa8788e809d7b656bb80ba98cb6df56a73681f9
+MISC metadata.xml 894 SHA256 139dc9b4ae8bb8fe8934f88a3952c5151ca77268d867d4d53d03cd6a0c6bd1cd SHA512 45213563f8582d0dcf921f8541732d96b8a8ac1d8ba885290c7d455408bc7d0f21444ce058fc4c0dd69cca716006bdcda51cbd95b8b933f264bec42b05609cd8 WHIRLPOOL 6ec942aa47cef37eded2e19fc507c66f53970a59b3d4bc73870559fadc5e5d19b56de5e709e76b0439c86bcf346c18f56e48f48a939e12b3b7181ad29f6c86c0
diff --git a/sci-astronomy/stellarium/metadata.xml b/sci-astronomy/stellarium/metadata.xml
new file mode 100644
index 000000000000..747986196368
--- /dev/null
+++ b/sci-astronomy/stellarium/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mr_bones_@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Stellarium is a free open source planetarium for your computer. It
+ shows a realistic sky in 3D, just like what you see with the naked
+ eye, binoculars or a telescope. It is being used in planetarium
+ projectors.
+</longdescription>
+ <use>
+ <flag name="media">Enable sound and video support</flag>
+ <flag name="stars">Install extra star catalogs</flag>
+ <flag name="sound">Enable sound support</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">stellarium</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-astronomy/stellarium/stellarium-0.14.3.ebuild b/sci-astronomy/stellarium/stellarium-0.14.3.ebuild
new file mode 100644
index 000000000000..99024e906021
--- /dev/null
+++ b/sci-astronomy/stellarium/stellarium-0.14.3.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-utils eutils flag-o-matic gnome2-utils
+
+DESCRIPTION="3D photo-realistic skies in real time"
+HOMEPAGE="http://www.stellarium.org/"
+SRC_URI="
+ mirror://sourceforge/stellarium/${P}.tar.gz
+ stars? (
+ mirror://sourceforge/stellarium/stars_4_1v0_1.cat
+ mirror://sourceforge/stellarium/stars_5_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_6_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_7_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_8_2v0_1.cat
+ )"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="debug nls sound stars"
+
+RESTRICT="test"
+
+RDEPEND="
+ media-fonts/dejavu
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtscript:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtwidgets:5
+ virtual/opengl
+ sys-libs/zlib
+ sound? ( dev-qt/qtmultimedia:5[widgets] )"
+DEPEND="${RDEPEND}
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ nls? ( dev-qt/linguist-tools:5 )"
+
+LANGS=(
+ af ak am ar as ast az be bg bn bo br bs ca cs
+ cy da de el en en_CA en_GB en_US eo es et eu fa fi fil fr
+ ga gd gl gu he hi hr hu hy ia id is it ja ka kk kn ko ky
+ la lb lo lt lv mk ml mn mr ms mt nan nb nl nn oc pa pl pt pt_BR ro
+ ru se si sk sl sq sr sv sw ta te tg th tl tr tt uk uz vi
+ zh_CN zh_HK zh_TW zu
+ )
+
+for X in "${LANGS[@]}" ; do
+ IUSE+=" linguas_${X}"
+done
+
+src_prepare() {
+ if [[ -n ${LINGUAS} ]] ; then
+ sed -i \
+ -e '/aa ab ae/d' \
+ -e "/GETTEXT_CREATE_TRANSLATIONS/a \ ${LINGUAS}" \
+ po/stellarium{,-skycultures}/CMakeLists.txt || die #403647
+ fi
+ # Turn off TelescopeControl since dev-qt/qtserialport isn't
+ # marked stable and is missing keywords besides.
+ sed -i \
+ -e '/SimpleDrawLine/ s:0:1:g' \
+ -e '/TelescopeControl/s:1:0:g' \
+ CMakeLists.txt || die
+ sed -i -e '/stellarium Core/s/SerialPort//' src/CMakeLists.txt || die
+ use debug || append-cppflags -DQT_NO_DEBUG #415769
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable nls)
+ $(cmake-utils_use_enable sound)
+ )
+ CMAKE_IN_SOURCE_BUILD=1 cmake-utils_src_configure
+}
+
+src_install() {
+ DOCS="AUTHORS ChangeLog README" \
+ cmake-utils_src_install
+
+ # use the more up-to-date system fonts
+ rm "${ED}"/usr/share/stellarium/data/DejaVuSans{Mono,}.ttf || die
+ dosym ../../fonts/dejavu/DejaVuSans.ttf /usr/share/stellarium/data/DejaVuSans.ttf
+ dosym ../../fonts/dejavu/DejaVuSansMono.ttf /usr/share/stellarium/data/DejaVuSansMono.ttf
+
+ if use stars ; then
+ insinto /usr/share/${PN}/stars/default
+ doins "${DISTDIR}"/stars_{4_1,{5,6,7,8}_2}v0_1.cat
+ fi
+ newicon doc/images/stellarium-logo.png ${PN}.png
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sci-astronomy/stellarium/stellarium-0.16.0-r1.ebuild b/sci-astronomy/stellarium/stellarium-0.16.0-r1.ebuild
new file mode 100644
index 000000000000..82634b69b2e6
--- /dev/null
+++ b/sci-astronomy/stellarium/stellarium-0.16.0-r1.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-utils eutils flag-o-matic gnome2-utils l10n
+
+DESCRIPTION="3D photo-realistic skies in real time"
+HOMEPAGE="http://www.stellarium.org/"
+SRC_URI="
+ mirror://sourceforge/stellarium/${P}.tar.gz
+ stars? (
+ mirror://sourceforge/stellarium/stars_4_1v0_1.cat
+ mirror://sourceforge/stellarium/stars_5_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_6_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_7_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_8_2v0_1.cat
+ )"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="debug gps media nls stars"
+
+RESTRICT="test" # There are no tests
+
+RDEPEND="
+ media-fonts/dejavu
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtscript:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtprintsupport:5
+ dev-qt/qtserialport:5
+ dev-qt/qtwidgets:5
+ virtual/opengl
+ sys-libs/zlib
+ media? ( dev-qt/qtmultimedia:5[widgets] )
+ gps? ( dev-qt/qtpositioning:5 )
+"
+DEPEND="${RDEPEND}
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ nls? ( dev-qt/linguist-tools:5 )"
+
+LANGS=(
+ af am ar as ast az be bg bn bo br bs ca cs
+ cy da de el en en-GB en-US eo es et eu fa fi fil fr
+ ga gd gl gu he hi hr hu hy ia id is it ja ka kk kn ko ky
+ la lb lo lt lv mk ml mn mr ms nb nl nn oc pa pl pt pt-BR ro
+ ru se si sk sl sq sr sv sw ta te tg th tl tr tt uk uz vi
+ zh-CN zh-HK zh-TW zu
+ )
+
+for X in "${LANGS[@]}" ; do
+ IUSE+=" l10n_${X}"
+done
+unset X
+
+src_prepare() {
+ cmake-utils_src_prepare
+ if [[ -n ${L10N} ]] ; then
+ local d
+ for d in po/* ; do
+ [[ -e ${d}/CMakeLists.txt ]] || continue
+ local l loc=""
+ for l in ${L10N//-/_}; do
+ [[ -e ${d}/${l}.po ]] && loc="${loc} ${l}"
+ done
+ sed -e 's/STRING(REGEX REPLACE ".po" "" \([a-z]*\).*$/SET(\1 '"${loc})/" \
+ -i ${d}/CMakeLists.txt || die
+ done
+ fi
+ use debug || append-cppflags -DQT_NO_DEBUG #415769
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_GPS="$(usex gps)"
+ -DENABLE_NLS="$(usex nls)"
+ -DENABLE_MEDIA="$(usex media)"
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # use the more up-to-date system fonts
+ rm "${ED%/}"/usr/share/stellarium/data/DejaVuSans{Mono,}.ttf || die
+ dosym ../../fonts/dejavu/DejaVuSans.ttf /usr/share/stellarium/data/DejaVuSans.ttf
+ dosym ../../fonts/dejavu/DejaVuSansMono.ttf /usr/share/stellarium/data/DejaVuSansMono.ttf
+
+ if use stars ; then
+ insinto /usr/share/${PN}/stars/default
+ doins "${DISTDIR}"/stars_{4_1,{5,6,7,8}_2}v0_1.cat
+ fi
+ newicon doc/images/stellarium-logo.png ${PN}.png
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sci-astronomy/stellarium/stellarium-0.16.0.ebuild b/sci-astronomy/stellarium/stellarium-0.16.0.ebuild
new file mode 100644
index 000000000000..55c9473a146b
--- /dev/null
+++ b/sci-astronomy/stellarium/stellarium-0.16.0.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-utils eutils flag-o-matic gnome2-utils l10n
+
+DESCRIPTION="3D photo-realistic skies in real time"
+HOMEPAGE="http://www.stellarium.org/"
+SRC_URI="
+ mirror://sourceforge/stellarium/${P}.tar.gz
+ stars? (
+ mirror://sourceforge/stellarium/stars_4_1v0_1.cat
+ mirror://sourceforge/stellarium/stars_5_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_6_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_7_2v0_1.cat
+ mirror://sourceforge/stellarium/stars_8_2v0_1.cat
+ )"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="debug media nls stars"
+
+RESTRICT="test" # There are no tests
+
+RDEPEND="
+ media-fonts/dejavu
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtscript:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtprintsupport:5
+ dev-qt/qtwidgets:5
+ virtual/opengl
+ sys-libs/zlib
+ media? ( dev-qt/qtmultimedia:5[widgets] )
+"
+DEPEND="${RDEPEND}
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ nls? ( dev-qt/linguist-tools:5 )"
+
+LANGS=(
+ af am ar as ast az be bg bn bo br bs ca cs
+ cy da de el en en-GB en-US eo es et eu fa fi fil fr
+ ga gd gl gu he hi hr hu hy ia id is it ja ka kk kn ko ky
+ la lb lo lt lv mk ml mn mr ms nb nl nn oc pa pl pt pt-BR ro
+ ru se si sk sl sq sr sv sw ta te tg th tl tr tt uk uz vi
+ zh-CN zh-HK zh-TW zu
+ )
+
+for X in "${LANGS[@]}" ; do
+ IUSE+=" l10n_${X}"
+done
+unset X
+
+src_prepare() {
+ cmake-utils_src_prepare
+ if [[ -n ${L10N} ]] ; then
+ local d
+ for d in po/* ; do
+ [[ -e ${d}/CMakeLists.txt ]] || continue
+ local l loc=""
+ for l in ${L10N//-/_}; do
+ [[ -e ${d}/${l}.po ]] && loc="${loc} ${l}"
+ done
+ sed -e 's/STRING(REGEX REPLACE ".po" "" \([a-z]*\).*$/SET(\1 '"${loc})/" \
+ -i ${d}/CMakeLists.txt || die
+ done
+ fi
+ sed -i -e '/ADD_PLUGIN(TelescopeControl 1)/s/1/0/' CMakeLists.txt || die
+ use debug || append-cppflags -DQT_NO_DEBUG #415769
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_GPS=OFF
+ -DENABLE_NLS="$(usex nls)"
+ -DENABLE_MEDIA="$(usex media)"
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # use the more up-to-date system fonts
+ rm "${ED%/}"/usr/share/stellarium/data/DejaVuSans{Mono,}.ttf || die
+ dosym ../../fonts/dejavu/DejaVuSans.ttf /usr/share/stellarium/data/DejaVuSans.ttf
+ dosym ../../fonts/dejavu/DejaVuSansMono.ttf /usr/share/stellarium/data/DejaVuSansMono.ttf
+
+ if use stars ; then
+ insinto /usr/share/${PN}/stars/default
+ doins "${DISTDIR}"/stars_{4_1,{5,6,7,8}_2}v0_1.cat
+ fi
+ newicon doc/images/stellarium-logo.png ${PN}.png
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sci-astronomy/stiff/Manifest b/sci-astronomy/stiff/Manifest
new file mode 100644
index 000000000000..0aa5f494ee93
--- /dev/null
+++ b/sci-astronomy/stiff/Manifest
@@ -0,0 +1,5 @@
+DIST stiff-2.4.0.tar.gz 1074161 SHA256 f4e85146c17fe8dcf160d12dc6df08bbd9212bb8444162b2e6ebf03f7513a992 SHA512 c8a293a2d1771b21d8af1194f9a2f582eca1a363964e76b78319c9cc2407332ef5e31dc74c0d10b9d5c7b6ae18ebd35ee59c53ad31c5f3966fabcd03948cadf6 WHIRLPOOL aa3b0d4ee6e2fc7d1fd90d19c815985ddb520c3fe37da6ec7c631675f5277b1d75b72a776a64631beedc57b934899c86eebbdc0b7c54925eb153cff65146e805
+EBUILD stiff-2.4.0.ebuild 765 SHA256 3da42b68674454018c39d8fc3f7524beaf2ca1d75a754a836f3df9d9e6dc4a6f SHA512 69e01e360638f8e3dc47d71c97e6147ea05b66354308779fa7a53685b15dce5b5dae92a602c48b4c172a2af0a903a8e715b596543b7fa8e4568aa9f84dd06ff6 WHIRLPOOL b2d543c630e7b267e33a73986a333f88ba8d2c6db1b7f5e9ae6c135199092a41871e674f53763090b11f923c4b78c8c9667b87a373cd09564fe59bc469ed6611
+MISC ChangeLog 2664 SHA256 d68e856ce61a6c94d29779d10ec32aab64791818578057d334c67deb618ed789 SHA512 43f142b3d5ff7b34f2df37280070e054f1eb19176ebc5bfea5cac9c567866abd8491ec39b2e808222f87ad7223ecbeda925fce9d4e28f7831b2772adcdf51e62 WHIRLPOOL 5e1084056c8627c7cc2c0b90281c9ebf72866dc1bb76340aa95ad21d00efd2082276ddf0180a7d72f49da149b56adca0372b7535376bcfdcb9f40980629486f3
+MISC ChangeLog-2015 1562 SHA256 e421cf62bdd254eccac2c3bc66f96c002fc494c2dc670fad1c4651eee14c87e5 SHA512 cb18d0222b78dd927bbc958e8822ffeea94c1ffb1bd33e0cfd92c313aa7e47e85fd0ab011b287c605c79cfa6b3d01054390125aee8850fa49ae5a5051bab60d5 WHIRLPOOL dcb61a06a3d8e83efda80a52888f82a46c88bf1239d0d84605a62f8dda1b5ba8065bb83e8ff0105a833371ea821c3fa4ae5e336a44221cff246c405b6933faaf
+MISC metadata.xml 459 SHA256 d2c2da261aff834703ab93a0c51a1190d8cabbe20ad39c0e54eab952de4c6343 SHA512 8094ed0486f4c7916268a2410e14aabc1e5d97f834449bfc61a058ab1b3d42a67bccc205348286420f7025e1bb16cc376024f07fe38ac95ac9e59bd56cdc5360 WHIRLPOOL 6060bb1cedb3a593df272870629776088ed3921b017250accb35fe1caf797736be9661ec3e24fd7e8cdb12450464d274634efca9850ee2c4825575cfd6a5e9e2
diff --git a/sci-astronomy/stiff/metadata.xml b/sci-astronomy/stiff/metadata.xml
new file mode 100644
index 000000000000..e2ab38e6c5c9
--- /dev/null
+++ b/sci-astronomy/stiff/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ STIFF is a program that convert scientific FITS images to the
+ more popular TIFF, in 8 (grayscale) or 24 (true colour: 3 times 8) bits per
+ pixel.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/stiff/stiff-2.4.0.ebuild b/sci-astronomy/stiff/stiff-2.4.0.ebuild
new file mode 100644
index 000000000000..f812d640d0df
--- /dev/null
+++ b/sci-astronomy/stiff/stiff-2.4.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit subversion
+ ESVN_REPO_URI="https://astromatic.net/pubsvn/software/${PN}/trunk"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Converts astronomical FITS images to the TIFF format"
+HOMEPAGE="http://www.astronomatic.net/software/stiff"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="doc threads"
+
+RDEPEND="
+ media-libs/tiff:0=
+ virtual/jpeg:0
+ sys-libs/zlib:0="
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ ECONF_SOURCE="${S}" econf $(use_enable threads)
+}
+
+src_install () {
+ default
+ use doc && dodoc doc/stiff.pdf
+}
diff --git a/sci-astronomy/stuff/Manifest b/sci-astronomy/stuff/Manifest
new file mode 100644
index 000000000000..8a105c4f24ad
--- /dev/null
+++ b/sci-astronomy/stuff/Manifest
@@ -0,0 +1,4 @@
+DIST stuff-1.26.0.tar.gz 4110495 SHA256 55b2e646f80653c09f023c3627c69126a4da5f9d73b30867bce91bb4465cd1eb SHA512 6b71112e29d06807c8fc880bd33032a08810554afa563f27d5af19a45293b780ab0b7827ad84ad7942bed28fe3b03bb6c1fa3983667d1fbcbb467b32653203f2 WHIRLPOOL daf35d1fc1d26cf248d3ebc010a907df860ade582195f3267d8224e362545fa7b96fd9bacd081f06bb9655b0a4a459e36a1263466b504bae6ce32957b6a7f462
+EBUILD stuff-1.26.0.ebuild 471 SHA256 7529736e609ac99a8a101a9c11317c6a95e84d119f1fcdf19b14e3558776d66a SHA512 264e61b267adca3c75b344a81687e5ddf2ea34a4002ec136e45c15d104ea1c781d1d59f24b756c4ff74e55e35e9567c8b577e71921b58e0ecfaf083e7efd150a WHIRLPOOL 382e5e703e675f63a37fc6badcea24146e3ffb73a393b9a69a0bf773fcc4300b40247b4907bd6cf60deb8161c236d0700cde3bb103c1c1bdb1db50cdd0f08de2
+MISC ChangeLog 315 SHA256 d9789c6920e0c8be84e25ac11fe9f526255fef647990252ccb4ab9baa9932db3 SHA512 12a57507c81619f1a20d5255f575d649344fb0701aa7c75c6e6cc3b451e4e8c3155a7794e528415ce4170c0d8d48697d13e1ea8ba8925ab4db55e5b49749fbdf WHIRLPOOL 67ff9868e36b02d6bba832a38751a164193f8810e75d4b99d995e51dc60280c5340041cbee5dd43c7e262a38960419a095cf7f5defd7cea99e5b37bbdba83f22
+MISC metadata.xml 502 SHA256 369d9f296800a795575b41515fec83775ce87de0e021623fe3db2635e4a8c4cc SHA512 8740ddb8ab5a0b859c833d5c5ae39c7f47e1239aeb64b9c306719076974bfed6ae92d28fdbbb59c5ada4343ecebd44c21007bc1d722b038485b10c0a8bd2e786 WHIRLPOOL 733c459c1f55a880bb5ba5dd58a348532dd53aa78ed1473957a13a51feafdd85c9796f92827b2fc3eb7d52db073827895041c89621d0a5d32e7bcb62e0219cbf
diff --git a/sci-astronomy/stuff/metadata.xml b/sci-astronomy/stuff/metadata.xml
new file mode 100644
index 000000000000..c3150e8cddb3
--- /dev/null
+++ b/sci-astronomy/stuff/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Stuff is a program that simulates “perfect” astronomical
+ catalogues. It generate object lists in ASCII which can read by the
+ SkyMaker program to produce realistic astronomical fields.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/stuff/stuff-1.26.0.ebuild b/sci-astronomy/stuff/stuff-1.26.0.ebuild
new file mode 100644
index 000000000000..cc672651f264
--- /dev/null
+++ b/sci-astronomy/stuff/stuff-1.26.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Tool for automatic generation of astronomical catalogs"
+HOMEPAGE="http://www.astromatic.net/software/stuff/"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="threads"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf $(use_enable threads)
+}
diff --git a/sci-astronomy/swarp/Manifest b/sci-astronomy/swarp/Manifest
new file mode 100644
index 000000000000..fa54ae759c9a
--- /dev/null
+++ b/sci-astronomy/swarp/Manifest
@@ -0,0 +1,5 @@
+DIST swarp-2.38.0.tar.gz 2063462 SHA256 f54a637f6c17ef2d94f767da641afea9bec726c31501cb828d9b948b1507c7c4 SHA512 80f4ade59738df3d4c9b47bda04148b53c6ba995d523fa8d1e02fb5d952b6078a53cc7d273849a033505de127a4f318b95adf2bf5a2dc38e8cc9bdaf5658487a WHIRLPOOL e328be5011ac0a89858ce7420d57715f2a178012b81f649953f63bbac6ae5a75c86905c01f58c4bc0a2149b41291e3092e40dbfd302667a1fcb7b2aa9688ac40
+EBUILD swarp-2.38.0.ebuild 517 SHA256 2ec776ece03fc7ee7b6b772b80672c9e5e4df7c26906a79cee9fba71a3d3b53b SHA512 dd3ba10ab520b797815457c3c745287716cb2361ad46774e008a770d76279a94520d9f0b413a0ff848f309cee274e34f037cefc7a3e4ae6b277dab966483f192 WHIRLPOOL 85cb2e53a75f221ea5049bd643465f1f2569db9fdb354fab75d43403274edd80aed723108282843269e5ce1b12292f6bf7db556c794b0565111ba2b7cb098ce7
+MISC ChangeLog 2673 SHA256 61fa5850677302e35e43e84cd131dbb00995befe380127574cdaa603f8307156 SHA512 fc93bf0a0b6872d2575074f32457f30fa7d9b0911d2824c8ca1081b00bb9393a5c5cb42a856808bdd9a3ebe3ee797c348776f9d57cd25b913a4b625041601dcf WHIRLPOOL 6e4d1c149d468b97530fc8f436c440de07749467354d3c635113e5e1a4725832c2155f12e54f8c1630c4d45f329dee1d638a4e5da1dade2ad71682a06d81a876
+MISC ChangeLog-2015 1982 SHA256 292729fa91ea647638d5a87451fa532d35b194a5fa6e626692ef02a546543bf8 SHA512 23bed6f7b17a6a45333aee6979d9ffb4e422f7945ba8b2119ff23917657b70b1fbac152f88e0847a660462f35ee989aa5b061bedec727f1aa942c3885f088ca5 WHIRLPOOL b7aaa65f24985cab6f1fc177e1ff6775832092d5e8d1cb4cba622dcb85b19c6e0444de06abe6377662c8f092499154c4a31c3e479813a0c83539bf72375a1b81
+MISC metadata.xml 406 SHA256 605e336039eb0fc73c357e79697644a44115f1b50111520aac2d87e0b6265376 SHA512 86551a8f0b0395339611995107cb9de4ebabe2fb4638539c3f77c08e7874dbb529cc3de610570eaf3b49be725f03389200d8e010c0c36d3b8af03900c9e6b9de WHIRLPOOL 0607afb86bb7adb84a882961f71fb8d33abc3984e7b550905af52d58f90879def484471b1b6d6e999a536f8dba8dbc957a9b8ac5b18e8853ed7a735ca3f73d64
diff --git a/sci-astronomy/swarp/metadata.xml b/sci-astronomy/swarp/metadata.xml
new file mode 100644
index 000000000000..988b2feef665
--- /dev/null
+++ b/sci-astronomy/swarp/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ SWarp takes astronomical FITS images with a WCS-like projection,
+ resample and stack them all.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/swarp/swarp-2.38.0.ebuild b/sci-astronomy/swarp/swarp-2.38.0.ebuild
new file mode 100644
index 000000000000..3e8d9fc54134
--- /dev/null
+++ b/sci-astronomy/swarp/swarp-2.38.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Resample and coadd astronomical FITS images"
+HOMEPAGE="http://www.astromatic.net/software/swarp"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+
+IUSE="doc threads"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf $(use_enable threads)
+}
+
+src_install () {
+ default
+ use doc && dodoc doc/*
+}
diff --git a/sci-astronomy/wcslib/Manifest b/sci-astronomy/wcslib/Manifest
new file mode 100644
index 000000000000..4c00c52a6f10
--- /dev/null
+++ b/sci-astronomy/wcslib/Manifest
@@ -0,0 +1,7 @@
+DIST wcslib-5.15.tar.bz2 2222193 SHA256 8bbe40a7b055578d1a6b77e92a733d2a01ce439814ea9e5a8d8bbc23c68b56e8 SHA512 b98111d7ca4b14dd479b56a368fd89a4d6f5d3741a61edeecc4a738def35bf448b68daf6a553fe88d4c84f91f5fcab3bc8d3ead1dccbd4e7c4190f31de2242ef WHIRLPOOL ea91609f0e0493e6df9d7eccd3391168ee4c5fdaa1153a62b574e8fd39fec4980ba141aa223b9d900af26df1042a0b11a0da47c7a95c9803bc841b7161015094
+DIST wcslib-5.16.tar.bz2 2222111 SHA256 ed031e0cf1cec0e9cabfc650423efa526fec341441865001c1e2c56bfffc99ef SHA512 bf7ab586995bdade8b96c77dee891c7d7ab6de82a7e2f94a09d89643e93658063f832efdb66e0bba11ad114b6e0ca555cba9308a84f0f22fb833e3a6303cefe6 WHIRLPOOL 6a8224360cf314863e0252aa96256f159a5ca7eff8d4ef9509085185dd3bb5c94ec4351f0272d0431f69bc4769494b496aa507d0c34ad308c1adae579fd6fce4
+EBUILD wcslib-5.15.ebuild 1675 SHA256 03de3e7cc1041672c667c3f576ef71a4c704b674ac1887fd1c739533ddf6664e SHA512 d2648e929258ceaa92d9651c456b8f71493143035a8950d21189cadf31921d2a92d7d1fd7cde7a07d8fdf7a105b3097da8a57eaf9f1484b08ae69e050f532f42 WHIRLPOOL 272b2abcb227c60402a50df7d9d210272cf9a7dd14fa7943d40df06ea21408986271f21f2a3700ad95620b3c4226739438e471a9054f64e33ca6fb1ff7f24aa2
+EBUILD wcslib-5.16.ebuild 1677 SHA256 cd0398030710a32dbdb3a0b9a4b843497c62dd58147129067c32dd187e2b9211 SHA512 5c9a572e8cf41b650da3a7f98cc8abe331386c896193366b7ed6d73052208c5ab89ce8b68434268f2420da8a770a2368c2e5f90fb3c43d4c7257cbdcd0dea244 WHIRLPOOL 686450b9f33f141a5943944de63de1585ad62e3c2c95438d8a71983be9efae255e0af27e89e6ed8e9acf182def8484acab08460005587ab9dd0d679c6772ba5e
+MISC ChangeLog 3639 SHA256 9f190a32735bbc2e3121d06a19ee3c041e22f4d78024d3668249ea967e07d9cf SHA512 31808cc37112a0fbdfb6b3636134f2cf5d72eaef7ff7411286a5c76b4f969882d14514879716478dca29a590c27c99191047a469d8414c23b44f0abed41f97f4 WHIRLPOOL 504c6bb0c81feaaabdc69a5f95e6639bc8164d062d2c5a634467c16eb4e6934d44ad0de6ddd7a9f60e58632e1239a48e8e694f8b53824bde11a2cc0ad7cc2e5a
+MISC ChangeLog-2015 7248 SHA256 eaf8c8b07a1fdbc22992e175ae52f7de3e552e13b0cb8ce68b5a50d6befafb45 SHA512 63f7294fc2e50000fd6eabf560ce3d4516b8cbf4d8cbddddc3c65a5329b1823c424a7c8977c0eddd63f434e5efc256e313bbc03e7e71ef0ff22322543d1fe1c5 WHIRLPOOL f986a9289a47896b9dbd670a1de79aa2d2394d5cf61f7aa2fc72fe3ebda6a63da1b3cb8169f40c43da7a2ef83f49167f554fbe3ad96a6f458f62acc5a910a946
+MISC metadata.xml 976 SHA256 f040ad8248dc33be5fd52f95a974de1a777b665b147a2948cbb59305f466d5c1 SHA512 cd4bc1614ea120e04ced965a92fdd343db9e4d1a6046b57efd503674547cfa45ce6a03bb3a2d34a472dccd885d598cbf3cd3d9d9fe182a2fc067a801e8eb9577 WHIRLPOOL 1b8f512c4da0b4163a51158e6b2aa2923d5f9f774f6dd6c348190898a85078e142afe5d7efd1f8a5c8e2ae73f06b52a03e39542d1b15594d96a98ef79f23c8c6
diff --git a/sci-astronomy/wcslib/metadata.xml b/sci-astronomy/wcslib/metadata.xml
new file mode 100644
index 000000000000..f74e78465e2d
--- /dev/null
+++ b/sci-astronomy/wcslib/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ WCSLIB is a C library, supplied with a full set of Fortran wrappers,
+ that implements the "World Coordinate System" (WCS) convention in FITS
+ (Flexible Image Transport System). It also includes a PGPLOT-based routine,
+ PGSBOX, for drawing general curvilinear coordinate graticules and a number of
+ utility programs.
+</longdescription>
+ <use>
+ <flag name="fits">
+ Enable support for the FITS format through <pkg>sci-libs/cfitsio</pkg>
+ </flag>
+ <flag name="pgplot">
+ Builds PGBSOX routines, needs <pkg>sci-libs/pgplot</pkg> library
+ </flag>
+ <flag name="tools">
+ Builds and installs extra command line utilities for WCS checking
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-astronomy/wcslib/wcslib-5.15.ebuild b/sci-astronomy/wcslib/wcslib-5.15.ebuild
new file mode 100644
index 000000000000..035f15d89123
--- /dev/null
+++ b/sci-astronomy/wcslib/wcslib-5.15.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_NEEDED=fortran
+
+inherit fortran-2
+
+DESCRIPTION="Astronomical World Coordinate System transformations library"
+HOMEPAGE="http://www.atnf.csiro.au/people/mcalabre/WCS/"
+SRC_URI="ftp://ftp.atnf.csiro.au/pub/software/${PN}/${P}.tar.bz2"
+
+SLOT="0/5"
+LICENSE="LGPL-3"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc fortran fits pgplot static-libs +tools"
+
+RDEPEND="
+ fits? ( sci-libs/cfitsio:0= )
+ pgplot? ( sci-libs/pgplot:0= )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/pkgconfig"
+
+src_configure() {
+ local myconf=(
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable fortran)
+ $(use_enable tools utils)
+ )
+ # hacks because cfitsio and pgplot directories are hard-coded
+ if use fits; then
+ myconf+=(
+ --with-cfitsioinc="${EPREFIX}/usr/include"
+ --with-cfitsiolib="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=( --without-cfitsio )
+ fi
+ if use pgplot; then
+ myconf+=(
+ --with-pgplotinc="${EPREFIX}/usr/include"
+ --with-pgplotlib="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=( --without-pgplot )
+ fi
+ econf ${myconf[@]}
+ sed -i -e 's/COPYING\*//' GNUmakefile || die
+}
+
+src_compile() {
+ # nasty makefile, debugging means probably full rewrite
+ emake -j1
+}
+
+src_test() {
+ emake -j1 check
+}
+
+src_install () {
+ default
+ # static libs share the same symbols as shared (i.e. compiled with PIC)
+ # so they are not compiled twice
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/lib*.a
+ use doc || rm -r \
+ "${ED}"/usr/share/doc/${PF}/html \
+ "${ED}"/usr/share/doc/${PF}/*.pdf
+}
diff --git a/sci-astronomy/wcslib/wcslib-5.16.ebuild b/sci-astronomy/wcslib/wcslib-5.16.ebuild
new file mode 100644
index 000000000000..7b3cdbfbdf79
--- /dev/null
+++ b/sci-astronomy/wcslib/wcslib-5.16.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_NEEDED=fortran
+
+inherit fortran-2
+
+DESCRIPTION="Astronomical World Coordinate System transformations library"
+HOMEPAGE="http://www.atnf.csiro.au/people/mcalabre/WCS/"
+SRC_URI="ftp://ftp.atnf.csiro.au/pub/software/${PN}/${P}.tar.bz2"
+
+SLOT="0/5"
+LICENSE="LGPL-3"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc fortran fits pgplot static-libs +tools"
+
+RDEPEND="
+ fits? ( sci-libs/cfitsio:0= )
+ pgplot? ( sci-libs/pgplot:0= )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/pkgconfig"
+
+src_configure() {
+ local myconf=(
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable fortran)
+ $(use_enable tools utils)
+ )
+ # hacks because cfitsio and pgplot directories are hard-coded
+ if use fits; then
+ myconf+=(
+ --with-cfitsioinc="${EPREFIX}/usr/include"
+ --with-cfitsiolib="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=( --without-cfitsio )
+ fi
+ if use pgplot; then
+ myconf+=(
+ --with-pgplotinc="${EPREFIX}/usr/include"
+ --with-pgplotlib="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=( --without-pgplot )
+ fi
+ econf ${myconf[@]}
+ sed -i -e 's/COPYING\*//' GNUmakefile || die
+}
+
+src_compile() {
+ # nasty makefile, debugging means probably full rewrite
+ emake -j1
+}
+
+src_test() {
+ emake -j1 check
+}
+
+src_install () {
+ default
+ # static libs share the same symbols as shared (i.e. compiled with PIC)
+ # so they are not compiled twice
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/lib*.a
+ use doc || rm -r \
+ "${ED}"/usr/share/doc/${PF}/html \
+ "${ED}"/usr/share/doc/${PF}/*.pdf
+}
diff --git a/sci-astronomy/wcstools/Manifest b/sci-astronomy/wcstools/Manifest
new file mode 100644
index 000000000000..115405cbbaf4
--- /dev/null
+++ b/sci-astronomy/wcstools/Manifest
@@ -0,0 +1,13 @@
+AUX Makefile.am 2016 SHA256 529ff2dade6922561c0be9ca8b57167e9aad95a10eaa4df14bddb4831d18007e SHA512 13f516405481b358c8a9e4a9e83fee28b6f846a000c0143c2e1dca61cf2afacea9aade3ccf3fa5cd9b7f1a4d6b965c4ec1ce002c614e9b5e52137cbf1abcd60b WHIRLPOOL 4b846faf6a6b2cd5ebd9d6aa4ade18c4dd02bab97a0872385ee27cc4b773ae72535ec027e83f2b6fd93e1c82ac554f8d3a39984cb7e3d1ae014a1228b0b07094
+AUX Makefile.libwcs.am 709 SHA256 77cfe0d3ce8293354d3133e20c29839fef702d7c7634bdce6f448d58be1f03a3 SHA512 7fc901ec0daa55e11028c457a9d8f1735ba559bcf5dcc1fb18cd6ffca121b01c17be6c938f89c599298c45be166ef8917b6ddd0bc5ce86f461c0668deb8d8918 WHIRLPOOL 460bd1d34da9db9aa96bd897c91baefb8320b5c7eb5967a2dc4ce934120013daf7ca72ff311174f21bd5501269629cdea249314810906a332fb62a93dbcce21d
+AUX configure.ac 257 SHA256 c5a87aae4699b5f3eff1451e52403386e15925d9841806ad7a15c3699b07d50d SHA512 7f8bb86cb9fa1cb57b8a53b150021e0c49929497f6a75d4d5638e4fd9592d07f9fe32ffdf204c72aae60b0ea980552b16b3940bd208982476cebb72ebf5267b4 WHIRLPOOL 2ea127bf9a881657ce72f43c798ead1b8f48e48bcead1981756fb603f2ff96707b421f4394c08da7ef0b836f7eaf732be62ee48994175b1d963114b5adcbb4cf
+AUX wcstools-3.9.4-compiler-warning.patch 947 SHA256 70e442c2a3a22629fbb6fd210437b593139f20abf126f3dd8a0151d165dc381f SHA512 28a190fa0df08d4950577ca821bd98a1633d93ba25e8ca81733dc453de24d32ad7a892e1deb1951796a5bf4398ab65e70aabbcde14c4d2b9ea7b604a53aed339 WHIRLPOOL cfcd6a687f27d7f8d956e2232dfd7da60ff57d49f0360277840f78e5e64e7a4255aaca0a6efa66a095512ddaf57c3ca713d2362c208cbd8800fc59b9611c0c76
+AUX wcstools-3.9.4-fix-tests.patch 879 SHA256 3408788b52807b1566aa8a8ea8bff93f08b62cfc4241593b1a2a792671d05724 SHA512 16d34c8c968ad4da3eee50be2202625ccc0a930aa88fcaec7e5c54d68f247557199e914e8b93b8143486cf33d7b2b1ade7157428ba723b03194055a0423febf6 WHIRLPOOL 53146f3832f255d89943e71b9423c1ad1753bf287722225ef586b53e894eac57da421eec2fff12fec1a50669d2ef1cc023351e54682fc0d958d516ec8fb31db2
+AUX wcstools-3.9.4-haspm.patch 603 SHA256 fb295db1562ab9074d97525f94d2ed9ae479cce52e3c07f4732f69a7e9eca8f1 SHA512 d06834b250ae8ee0fe630ec614c6252af9e5ad8e029745d394fb5dfc2edacb08ff5e8927d0e58bb477d36fa382937504321bf7df32cbe9b7daf4036882b3d843 WHIRLPOOL 30a723c0d59810c07898301d3ddd6480c5bfe5a65259545bfc30559b1d651f74cc9c70d3d6ea275692af514a89d1dcfa2a22432860a24e28faca031b5b63f4d9
+AUX wcstools-3.9.4-spelling.patch 8559 SHA256 968115c55f72fc0b05b0714b0c5c453315d0a2267a2f048928519900603716ea SHA512 d8065c8619ceddc879a0fe0fa55e0ddd6eff504eead917a2a7009f83151a7618c0e74cda8a58e4ef5206318806afd35792cb605dbea74e8f4a77b2a67bdcf9a0 WHIRLPOOL 5336998f92ea84a4888a7585f843001b8eec99c8e9c77c34b38450b171afc0ece5194a41978b480b14f65cf892a0c1a7c1e4fb8ef94d6183bba28e77b66013d1
+AUX wcstools.pc.in 304 SHA256 eca3c0de4606aea4f2809bee8191fe4b5009ce8e8d89079f3472656eee15fcbe SHA512 bfa61066f0a6993f0848925b40ba35fe02e444c37b5cd9b02c99c5d331566fa21165858c53ffb9a9cdc2461ad096b87c8bd53e8eb9c13bab8f4404a5fe6f2d90 WHIRLPOOL 74a17b1467d9db9b5111580395d1206a168db371140e9f8db4ec68410bf2f5a583a0ef034f358702411bcee0f51604c714bd60726052accc3c5d50532ccf4546
+DIST wcstools-3.9.5.tar.gz 8538612 SHA256 b2f9be55fdec29f0c640028a9986771bfd6ab3d2f633953e4c7cc3b410e5fe9c SHA512 aa48081b6f5dc12ed8d64eae5275c27aaa279856f588a3eb429ec0a4943dc482788cb7f84820233f0e2ee4fefeda7ab9bb85c4513a9942c48f5d97a0bde1581d WHIRLPOOL 9df23431c0a5364e736aa24bed93cb3ff76a76f3849d663460db248cad031eefeb8362877b464495c0188129d7236a67261128a2ad3a6e3fc5e9452ef549c052
+EBUILD wcstools-3.9.5.ebuild 1714 SHA256 e9f1f5e0b6588feeda54a82d953d9d069d8a6069aa66f8550ff7e2fa832f7909 SHA512 2770b2a10393d265bf30963db92730f6cbd394db39126e0613d31d5cabfcd57eb374875886b65e65f8d7edbe9c652c13fbfa6dd6e200fce7ef4cab90b9847bb8 WHIRLPOOL 270edc1aabf57bf43d3e3e0da0030b2aaad2548b1babe9052ef873bd9db9abb5821c97cf6e73299552ffed80a51ef46d33823fadf42efdb2c65cef567fbdd329
+MISC ChangeLog 4023 SHA256 8fda30fbde31a45489f06232a16a4423b82f477747d30bc703566260285ce8be SHA512 52757533f196e1a0e75a6f4593b7f26fd7852c443fad5abc71888c0d8cc9f0960f0bc5dcc7a66daa35ba543753498226820157b140f7452c113a2208398ac611 WHIRLPOOL 978e1da67e995bae4b4c2eb97664a9e5bc49f8798a767a2a7ad87f2852cb14a5b1ed92f82d6d04860dd44a68c023602bb31e234d5f34f3ef9cb006e49b0f84f0
+MISC ChangeLog-2015 6586 SHA256 7b468614ff6192e7251cac01c3606a0ec9bd05c723bf1d6fadd47a5b390a4c8c SHA512 3c17a931f5007df43bff606cab9c464cd0e166a180e7d9a6dec759ab2152f18382d73c0bb5865f0e5458e4ca1e13c029f6cd039fd2c0dbb0493aadcb9df222d1 WHIRLPOOL 51f587384f56ab3a288150ad79afed0d0c47f0477182b63e693ca569fb24cd2cc6e2986592cef7a863db394388b20866b36f763695fb79d0d517ff98950d3b46
+MISC metadata.xml 939 SHA256 05200c076ad726e34e3f4d1e5d1d62766b16b1b90feda0b7fe62bc204bae118d SHA512 64fd473a4907fda99216104b83feba7242a06a59e80c2a6ed2bd38dd2687aec74c6a5c5e64038321ccffd0755f7a0a9c9aad26ed0e8051632139a3ffad7ac954 WHIRLPOOL cd7a738f1c368fa8215d6b44a1f5b113a4919755354cb16e3a34238fc9c531806c374bd2f1a11fe5d5ac9017b2e49a81a7a365cecb65a04c1d69c0785a1d4404
diff --git a/sci-astronomy/wcstools/files/Makefile.am b/sci-astronomy/wcstools/files/Makefile.am
new file mode 100644
index 000000000000..46abf6d39ae0
--- /dev/null
+++ b/sci-astronomy/wcstools/files/Makefile.am
@@ -0,0 +1,73 @@
+SUBDIRS = libwcs
+INCLUDES = -I$(top_srcdir)/libwcs
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = wcstools.pc
+
+bin_SCRIPTS = wcstools
+
+EXTRA_DIST = wcstools COPYING Readme NEWS Programs
+
+bin_PROGRAMS = \
+ cphead delwcs delhead edhead fixpix gethead i2f imcat imhead immatch \
+ imrot imsize imstar imwcs scat sethead addpix getpix setpix sky2xy \
+ keyhead skycoor subpix xy2sky wcshead conpix gettab newfits getfits \
+ imstack imextract sumpix wcsremap getcol wcsgetdate imfill imsmooth imresize \
+ fileroot filename filext char2sp sp2char wcscrlf isnum isrange isfits \
+ isfile simpos bincat
+
+# these ones don't need libwcs
+wcscrlf_SOURCES = crlf.c
+filename_SOURCES = filename.c
+filedir_SOURCES = filedir.c
+fileroot_SOURCES = fileroot.c
+filext_SOURCES = filext.c
+isrange_SOURCES = isrange.c
+
+LDADD = $(top_builddir)/libwcs/libwcstools.la
+
+bincat_SOURCES = bincat.c
+getcol_SOURCES = getcol.c
+wcsgetdate_SOURCES = getdate.c
+gethead_SOURCES = gethead.c
+getfits_SOURCES = getfits.c
+getpix_SOURCES = getpix.c
+gettab_SOURCES = gettab.c
+imcat_SOURCES = imcat.c
+imsize_SOURCES = imsize.c
+imstar_SOURCES = imstar.c
+imwcs_SOURCES = imwcs.c
+immatch_SOURCES = immatch.c
+scat_SOURCES = scat.c
+setpix_SOURCES = setpix.c
+skycoor_SOURCES = skycoor.c
+sumpix_SOURCES = sumpix.c
+xy2sky_SOURCES = xy2sky.c
+simpos_SOURCES = simpos.c
+
+addpix_SOURCES = addpix.c
+char2sp_SOURCES = char2sp.c
+conpix_SOURCES = conpix.c
+cphead_SOURCES = cphead.c
+delwcs_SOURCES = delwcs.c
+delhead_SOURCES = delhead.c
+edhead_SOURCES = edhead.c
+fixpix_SOURCES = fixpix.c
+i2f_SOURCES = i2f.c
+imfill_SOURCES = imfill.c
+imresize_SOURCES = imresize.c
+imsmooth_SOURCES = imsmooth.c
+imhead_SOURCES = imhead.c
+imrot_SOURCES = imrot.c
+imstack_SOURCES = imstack.c
+imextract_SOURCES = imextract.c
+isfile_SOURCES = isfile.c
+isnum_SOURCES = isnum.c
+keyhead_SOURCES = keyhead.c
+newfits_SOURCES = newfits.c
+wcsremap_SOURCES = remap.c
+sethead_SOURCES = sethead.c
+sky2xy_SOURCES = sky2xy.c
+sp2char_SOURCES = sp2char.c
+subpix_SOURCES = subpix.c
+wcshead_SOURCES = wcshead.c
diff --git a/sci-astronomy/wcstools/files/Makefile.libwcs.am b/sci-astronomy/wcstools/files/Makefile.libwcs.am
new file mode 100644
index 000000000000..5905aa3d7955
--- /dev/null
+++ b/sci-astronomy/wcstools/files/Makefile.libwcs.am
@@ -0,0 +1,17 @@
+lib_LTLIBRARIES = libwcstools.la
+libwcstools_la_SOURCES = \
+ imsetwcs.c imgetwcs.c matchstar.c findstar.c daoread.c wcscon.c \
+ fitswcs.c wcsinit.c wcs.c ty2read.c webread.c tmcread.c \
+ gscread.c gsc2read.c ujcread.c uacread.c ubcread.c ucacread.c \
+ sdssread.c tabread.c binread.c ctgread.c actread.c catutil.c \
+ skybotread.c imrotate.c fitsfile.c imhfile.c \
+ hget.c hput.c imio.c dateutil.c imutil.c \
+ worldpos.c tnxpos.c zpxpos.c dsspos.c platepos.c \
+ sortstar.c platefit.c iget.c fileutil.c \
+ wcslib.c lin.c cel.c proj.c sph.c wcstrig.c distort.c poly.c
+
+wcsdir = $(includedir)/wcs
+wcs_HEADERS = \
+ wcscat.h wcslib.h wcs.h lwcs.h fitshead.h fitsfile.h imio.h
+
+noinst_HEADERS = fitsfile1.h wcscat1.h
diff --git a/sci-astronomy/wcstools/files/configure.ac b/sci-astronomy/wcstools/files/configure.ac
new file mode 100644
index 000000000000..3a46108cd304
--- /dev/null
+++ b/sci-astronomy/wcstools/files/configure.ac
@@ -0,0 +1,9 @@
+AC_INIT([wcstools], [3.9.x] , [http://tdc-www.harvard.edu/wcstools/])
+AM_INIT_AUTOMAKE([foreign])
+AC_CONFIG_HEADERS([config.h])
+
+AC_PROG_CC
+LT_INIT([disable-static])
+AC_CHECK_LIB([m], [sin])
+AC_CONFIG_FILES([libwcs/Makefile Makefile wcstools.pc])
+AC_OUTPUT
diff --git a/sci-astronomy/wcstools/files/wcstools-3.9.4-compiler-warning.patch b/sci-astronomy/wcstools/files/wcstools-3.9.4-compiler-warning.patch
new file mode 100644
index 000000000000..ff81820d404a
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.9.4-compiler-warning.patch
@@ -0,0 +1,34 @@
+From: Ole Streicher <debian@liska.ath.cx>
+Date: Fri, 5 Aug 2016 16:17:42 +0200
+Subject: Fix some compiler warnings.
+
+---
+ libwcs/imhfile.c | 2 +-
+ libwcs/webread.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libwcs/imhfile.c b/libwcs/imhfile.c
+index b618686..4279d3c 100644
+--- a/libwcs/imhfile.c
++++ b/libwcs/imhfile.c
+@@ -1075,7 +1075,7 @@ char *hdrname; /* IRAF image header file pathname */
+
+ /* add name */
+ newpixname[len] = '\0';
+- (void)strncat (newpixname, pixname, SZ_IM2PIXFILE);
++ (void)strncat (newpixname, pixname, SZ_IM2PIXFILE - len);
+ }
+
+ /* Pixel file has same name as header file, but with .pix extension */
+diff --git a/libwcs/webread.c b/libwcs/webread.c
+index 1f5c518..cd9cba9 100644
+--- a/libwcs/webread.c
++++ b/libwcs/webread.c
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
++#include <ctype.h>
+ #include <math.h>
+ #include "wcs.h"
+ #include "fitsfile.h"
diff --git a/sci-astronomy/wcstools/files/wcstools-3.9.4-fix-tests.patch b/sci-astronomy/wcstools/files/wcstools-3.9.4-fix-tests.patch
new file mode 100644
index 000000000000..d8679578f408
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.9.4-fix-tests.patch
@@ -0,0 +1,34 @@
+From: Ole Streicher <debian@liska.ath.cx>
+Date: Fri, 5 Aug 2016 16:17:42 +0200
+Subject: Fix several bugs that appear in during the mayhem tests.
+
+---
+ cphead.c | 2 +-
+ getpix.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/cphead.c b/cphead.c
+index 0c025dd..2b34f12 100644
+--- a/cphead.c
++++ b/cphead.c
+@@ -148,7 +148,7 @@ char **av;
+ free (kwd);
+ kwd = kwdnew;
+ }
+- for (ikwd = nkwd; i < nkwd+nkwd1+32; i++) {
++ for (ikwd = nkwd; ikwd < nkwd+nkwd1+32; ikwd++) {
+ kwd[ikwd] = (char *) calloc (32, 1);
+ }
+ strcpy (kwd[nkwd], "RA");
+diff --git a/getpix.c b/getpix.c
+index ccb38f0..64cc571 100644
+--- a/getpix.c
++++ b/getpix.c
+@@ -83,6 +83,7 @@ char **av;
+ char *crange; /* Column range string */
+ char *rstr;
+ char *dstr = NULL;
++ char rastr[32], decstr[32];
+ char *cstr;
+ int systemp;
+ int i;
diff --git a/sci-astronomy/wcstools/files/wcstools-3.9.4-haspm.patch b/sci-astronomy/wcstools/files/wcstools-3.9.4-haspm.patch
new file mode 100644
index 000000000000..427c476edb95
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.9.4-haspm.patch
@@ -0,0 +1,22 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Fri, 5 Aug 2016 16:17:42 +0200
+Subject: Fix uninitialized value for haspm in RASortStars()
+
+This fixes a crash with 'imstar -s'.
+---
+ libwcs/sortstar.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libwcs/sortstar.c b/libwcs/sortstar.c
+index 0123c64..f77555f 100644
+--- a/libwcs/sortstar.c
++++ b/libwcs/sortstar.c
+@@ -856,6 +856,8 @@ int log; /* If >0, log progress every time mod number written */
+ hasnum = 1;
+ if (spra != NULL && spdec != NULL)
+ haspm = 1;
++ else
++ haspm = 0;
+ if (sx != NULL && sy != NULL)
+ hasxy = 1;
+ else
diff --git a/sci-astronomy/wcstools/files/wcstools-3.9.4-spelling.patch b/sci-astronomy/wcstools/files/wcstools-3.9.4-spelling.patch
new file mode 100644
index 000000000000..d655c345c257
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.9.4-spelling.patch
@@ -0,0 +1,242 @@
+From: Ole Streicher <debian@liska.ath.cx>
+Date: Fri, 5 Aug 2016 16:17:42 +0200
+Subject: Spellfixes and manpage fixes
+
+---
+ edhead.c | 2 +-
+ immatch.c | 2 +-
+ imwcs.c | 4 ++--
+ libwcs/fitsfile.c | 10 +++++-----
+ libwcs/imhfile.c | 4 ++--
+ man/man1/edhead.1 | 2 +-
+ man/man1/imcat.1 | 2 +-
+ man/man1/imgsc.1 | 4 ++--
+ man/man1/imua2.1 | 2 +-
+ man/man1/keyhead.1 | 2 +-
+ man/man1/skycoor.1 | 2 +-
+ man/man1/sua2.1 | 2 +-
+ man/man1/susa2.1 | 2 +-
+ 13 files changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/edhead.c b/edhead.c
+index 1fe33e2..494cb4d 100644
+--- a/edhead.c
++++ b/edhead.c
+@@ -109,7 +109,7 @@ usage ()
+ exit (-1);
+ fprintf (stderr,"Edit header of FITS or IRAF image file\n");
+ fprintf(stderr,"usage: edhead [-nv] [-e editor] file.fits file.imh...\n");
+- fprintf(stderr," -e: Set editor, overiding environment EDITOR \n");
++ fprintf(stderr," -e: Set editor, overriding environment EDITOR \n");
+ fprintf(stderr," -n: write new file, else overwrite \n");
+ fprintf(stderr," -v: verbose\n");
+ exit (1);
+diff --git a/immatch.c b/immatch.c
+index 02af222..59b4826 100644
+--- a/immatch.c
++++ b/immatch.c
+@@ -383,7 +383,7 @@ char **av;
+
+ /* If reference catalog is not set, exit with an error message */
+ if (refcatname == NULL) {
+- PrintUsage ("* Must specifiy a reference catalog using -c or alias.");
++ PrintUsage ("* Must specify a reference catalog using -c or alias.");
+ }
+
+ /* Process image files from list file */
+diff --git a/imwcs.c b/imwcs.c
+index c32cffd..6639198 100644
+--- a/imwcs.c
++++ b/imwcs.c
+@@ -285,7 +285,7 @@ char **av;
+ ac--;
+ break;
+
+- case 'o': /* Specifiy output image filename */
++ case 'o': /* Specify output image filename */
+ if (ac < 2)
+ PrintUsage (str);
+ if (*(av+1)[0] == '-' || *(str+1) != (char)0)
+@@ -476,7 +476,7 @@ char **av;
+
+ /* If reference catalog is not set, exit with an error message */
+ if (refcatname == NULL && matchfile == NULL) {
+- PrintUsage ("* Must specifiy a reference catalog using -c or alias.");
++ PrintUsage ("* Must specify a reference catalog using -c or alias.");
+ }
+
+ if (!writeheader && !verbose) {
+diff --git a/libwcs/fitsfile.c b/libwcs/fitsfile.c
+index 2c3e709..a2f0d0f 100644
+--- a/libwcs/fitsfile.c
++++ b/libwcs/fitsfile.c
+@@ -1583,7 +1583,7 @@ char *image; /* FITS image pixels */
+ if (!access (filename, 0)) {
+ fd = open (filename, O_WRONLY);
+ if (fd < 3) {
+- snprintf (fitserrmsg,79, "FITSWIMAGE: file %s not writeable\n", filename);
++ snprintf (fitserrmsg,79, "FITSWIMAGE: file %s not writable\n", filename);
+ return (0);
+ }
+ }
+@@ -1622,7 +1622,7 @@ char *image; /* FITS image pixels */
+ if (!access (filename, 0)) {
+ fd = open (filename, O_WRONLY);
+ if (fd < 3) {
+- snprintf (fitserrmsg,79, "FITSWEXT: file %s not writeable\n",
++ snprintf (fitserrmsg,79, "FITSWEXT: file %s not writable\n",
+ filename);
+ return (0);
+ }
+@@ -1884,7 +1884,7 @@ char *filename0; /* Name of input FITS image file */
+ if (!access (filename, 0)) {
+ fdout = open (filename, O_WRONLY);
+ if (fdout < 3) {
+- snprintf (fitserrmsg,79, "FITSCIMAGE: file %s not writeable\n", filename);
++ snprintf (fitserrmsg,79, "FITSCIMAGE: file %s not writable\n", filename);
+ return (0);
+ }
+ }
+@@ -1970,7 +1970,7 @@ char *header; /* FITS image header */
+ if (!access (filename, 0)) {
+ fd = open (filename, O_WRONLY);
+ if (fd < 3) {
+- snprintf (fitserrmsg, 79, "FITSWHEAD: file %s not writeable\n", filename);
++ snprintf (fitserrmsg, 79, "FITSWHEAD: file %s not writable\n", filename);
+ return (0);
+ }
+ }
+@@ -2072,7 +2072,7 @@ char *header; /* FITS image header */
+ if (ext != NULL)
+ *ext = cext;
+ if (fd < 3) {
+- snprintf (fitserrmsg, 79, "FITSWEXHEAD: file %s not writeable\n", filename);
++ snprintf (fitserrmsg, 79, "FITSWEXHEAD: file %s not writable\n", filename);
+ return (-1);
+ }
+
+diff --git a/libwcs/imhfile.c b/libwcs/imhfile.c
+index 4279d3c..25f82ac 100644
+--- a/libwcs/imhfile.c
++++ b/libwcs/imhfile.c
+@@ -896,7 +896,7 @@ char *fitsheader; /* FITS image header */
+ if (!access (hdrname, 0)) {
+ fd = open (hdrname, O_WRONLY);
+ if (fd < 3) {
+- fprintf (stderr, "IRAFWIMAGE: file %s not writeable\n", hdrname);
++ fprintf (stderr, "IRAFWIMAGE: file %s not writable\n", hdrname);
+ return (0);
+ }
+ }
+@@ -993,7 +993,7 @@ char *image; /* IRAF image */
+ if (!access (pixname, 0)) {
+ fd = open (pixname, O_WRONLY);
+ if (fd < 3) {
+- fprintf (stderr, "IRAFWIMAGE: file %s not writeable\n", pixname);
++ fprintf (stderr, "IRAFWIMAGE: file %s not writable\n", pixname);
+ return (0);
+ }
+ }
+diff --git a/man/man1/edhead.1 b/man/man1/edhead.1
+index 543487c..74dbedf 100644
+--- a/man/man1/edhead.1
++++ b/man/man1/edhead.1
+@@ -11,7 +11,7 @@ takes care of trailing spaces so they can be ignored while using the editor.
+ .SH Options
+ .TP
+ .B \-e <editor path>
+-Set editor, overiding environment EDITOR
++Set editor, overriding environment EDITOR
+ .TP
+ .B \-n
+ Write a new file with .e before the file type extension. The default is
+diff --git a/man/man1/imcat.1 b/man/man1/imcat.1
+index a1cac13..e975af6 100644
+--- a/man/man1/imcat.1
++++ b/man/man1/imcat.1
+@@ -4,7 +4,7 @@ imcat \- List catalog stars in FITS and IRAF image files
+ .SH Synopsis
+ imcat [options] FITS or IRAF file(s)
+ .SH Description
+-Search given catalog withing area described by the world coordinate
++Search given catalog within area described by the world coordinate
+ system in an image header. May be called as imuac to search the USNO A 1.0
+ catalog, imusac to search the USNO SA 1.0 catalog, or imgsc to search
+ the HST Guide Star Catalog.
+diff --git a/man/man1/imgsc.1 b/man/man1/imgsc.1
+index 604b072..aa64b2c 100644
+--- a/man/man1/imgsc.1
++++ b/man/man1/imgsc.1
+@@ -1,10 +1,10 @@
+-.TH imgsc(1) WCS "14 April 1998"
++.TH imgsc 1 WCSTools "14 April 1998"
+ .SH Name
+ imgsc \- Find HST GSC stars in FITS or IRAF image files
+ .SH Synopsis
+ imgsc [options] FITS or IRAF file(s)
+ .SH Description
+-Search the HST Guide Star Catalog withing the area described by the world
++Search the HST Guide Star Catalog within the area described by the world
+ coordinate system in an image header. This is a link to imcat rather than
+ a separate executable.
+ .SH Options
+diff --git a/man/man1/imua2.1 b/man/man1/imua2.1
+index 4acbc8b..22b896f 100644
+--- a/man/man1/imua2.1
++++ b/man/man1/imua2.1
+@@ -78,7 +78,7 @@ Sort by RA instead of flux
+ Tab table to standard output as well as file
+ .TP
+ .B \-u <plate>
+-Accept only stars from thsi plate (default all)
++Accept only stars from this plate (default all)
+ .TP
+ .B \-v
+ Verbose listing of processing intermediate results
+diff --git a/man/man1/keyhead.1 b/man/man1/keyhead.1
+index 4d1dfb1..fea7652 100644
+--- a/man/man1/keyhead.1
++++ b/man/man1/keyhead.1
+@@ -7,7 +7,7 @@ sethead [\-hknv] <FITS or IRAF file> kw1=kw1a kw2=kwd2a ... kwn=kwdna
+ Change the names of keywords in FITS or IRAF image headers. Each current
+ image keyword whose entry is to be modified should be followed by an
+ equal sign and a second keyword, with no intervening spaces.
+-If the \-r option is used, the value of the second keyword is transfered
++If the \-r option is used, the value of the second keyword is transferred
+ to that of the first. Otherwise, the name of the first keyword is changed
+ to the second keyword.
+ To change keywords in a list of files, substitute @<listfile> for the file
+diff --git a/man/man1/skycoor.1 b/man/man1/skycoor.1
+index c3b3d2b..2126c29 100644
+--- a/man/man1/skycoor.1
++++ b/man/man1/skycoor.1
+@@ -1,4 +1,4 @@
+-.TH skycoor(1) WCSTools "9 November 2001"
++.TH skycoor 1 WCSTools "9 November 2001"
+ .SH Name
+ skycoor \- Convert coordinates
+ .SH Synopsis
+diff --git a/man/man1/sua2.1 b/man/man1/sua2.1
+index b28c89a..d29d126 100644
+--- a/man/man1/sua2.1
++++ b/man/man1/sua2.1
+@@ -1,6 +1,6 @@
+ .TH sua2 1 WCS "19 November 1999"
+ .SH Name
+-Find USNO-A2.0 Catalog stars in a square on the sky
++sua2 \- Find USNO-A2.0 Catalog stars in a square on the sky
+ .SH Synopsis
+ sua2 [options] ra dec system
+ .SH Description
+diff --git a/man/man1/susa2.1 b/man/man1/susa2.1
+index 06409e2..8d03886 100644
+--- a/man/man1/susa2.1
++++ b/man/man1/susa2.1
+@@ -1,6 +1,6 @@
+ .TH susa2 1 WCS "9 June 2000"
+ .SH Name
+-Find USNO-SA2.0 Catalog stars in a square on the sky
++susa2 \- Find USNO-SA2.0 Catalog stars in a square on the sky
+ .SH Synopsis
+ susac [options] [\-b or \-j] ra dec
+ .SH Description
diff --git a/sci-astronomy/wcstools/files/wcstools.pc.in b/sci-astronomy/wcstools/files/wcstools.pc.in
new file mode 100644
index 000000000000..c8eb8b094a0a
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: World Coordinate System Library and Tools
+Version: @PACKAGE_VERSION@
+URL: http://tdc-www.harvard.edu/wcstools/
+Libs: -L${libdir} -lwcstools
+Libs.private: -lm
+Cflags: -I${includedir}/wcs
+
diff --git a/sci-astronomy/wcstools/metadata.xml b/sci-astronomy/wcstools/metadata.xml
new file mode 100644
index 000000000000..94f4f60be350
--- /dev/null
+++ b/sci-astronomy/wcstools/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Astronomers often need to relate positions on an image of the sky to
+ positions on the real sky to identify catalogued objects in images,
+ tell other people where to look to find an identified object, or to
+ compute motions of planets, satellites, asteroids, or comets. WCSTools
+ is a package of programs and a library of utility subroutines for
+ setting and using the world coordinate systems (WCS) in the headers of
+ the most common astronomical image formats, FITS and IRAF .imh, to
+ relate image pixels to sky coordinates.
+ The Gentoo package is using GNU autotools to produce portable shared
+ and static libraried.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/wcstools/wcstools-3.9.5.ebuild b/sci-astronomy/wcstools/wcstools-3.9.5.ebuild
new file mode 100644
index 000000000000..641bebc84fb2
--- /dev/null
+++ b/sci-astronomy/wcstools/wcstools-3.9.5.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils autotools
+
+DESCRIPTION="World Coordinate System library for astronomical FITS images"
+HOMEPAGE="http://tdc-www.harvard.edu/software/wcstools"
+SRC_URI="${HOMEPAGE}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DOCS=( Readme Programs NEWS )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.9.4-spelling.patch
+ "${FILESDIR}"/${PN}-3.9.4-haspm.patch
+ "${FILESDIR}"/${PN}-3.9.4-fix-tests.patch
+ "${FILESDIR}"/${PN}-3.9.4-compiler-warning.patch
+)
+
+src_prepare() {
+ default
+ einfo "Copying gentoo autotools files"
+ local f
+ for f in "${FILESDIR}"/{configure.ac,wcstools.pc.in,Makefile.am}; do
+ cp ${f} "${S}"/ || die
+ done
+ cp "${FILESDIR}"/Makefile.libwcs.am "${S}"/libwcs/Makefile.am || die
+ # avoid colliding with fixdos, getdate and remap from other packages
+ sed -i \
+ -e 's/getdate/wcsgetdate/' \
+ -e 's/crlf/wcscrlf/' \
+ -e 's/remap/wcsremap/' \
+ -e "s/3.... Programs/${PV} Programs/" \
+ wcstools || die
+ eautoreconf
+}
+
+src_test() {
+ einfo "Testing various wcstools programs"
+ ./newfits -a 10 -j 248 41 -p 0.15 test.fits || die "test newfits failed"
+ ./sethead test.fits A=1 B=1 || die "test sethead failed"
+ [[ "$(./gethead test.fits RA)" == "16:32:00.0000" ]] \
+ || die "test gethead failed"
+ rm test.fits
+}
+
+src_install() {
+ default
+ doman man/man1/*
+ newdoc libwcs/NEWS NEWS.libwcs
+ newdoc libwcs/Readme Readme.libwcs
+
+}
+
+pkg_postinst() {
+ elog "The following execs have been renamed to avoid colliding"
+ elog "with other packages:"
+ elog " getdate -> wcsgetdate"
+ elog " crlf -> wcscrlf"
+ elog " remap -> wcsremap"
+}
diff --git a/sci-astronomy/weightwatcher/Manifest b/sci-astronomy/weightwatcher/Manifest
new file mode 100644
index 000000000000..8dc89b653571
--- /dev/null
+++ b/sci-astronomy/weightwatcher/Manifest
@@ -0,0 +1,4 @@
+DIST weightwatcher-1.12.tar.gz 460583 SHA256 5730a923d7a4544fc66f21ad7b1f105108a5dca4038b74b5e4ecdd9c1a6a58fd SHA512 392ca6442de96e6c35447b7b34c67b22e7793831337aaf0f06e45d40e63f8c5e9605649fe39a67a5baf9eadcb79fa9f5d998fcb9504f85606f75071d672b0ada WHIRLPOOL fc5bbdfb3caf487941b173bb6e8725c922592a8cff5af2a482839df0d334fc34470536deb71c50deaee85b06521ef6df07b24dbee2456779813d75937fe7fd44
+EBUILD weightwatcher-1.12.ebuild 489 SHA256 9a4c3ae69705f9b96935650fd04f70f90251554ca1a6903c5059e65da325b23c SHA512 f633777b098a41e0fc62a3f62c19ae96801b8506e1eef87c05a7619a03bdefddb8c2755f5e5fbe9599fe570ef53f677411697e286c4a7b0f4991b3f99d82e866 WHIRLPOOL 9d2e7d6e8174bea4bd876349985515beb5e668726f59dbe28e352c7c47c2fe7ba0a8ceae98bbe92ee49b416bd6edca3aa295bf59fc41140793fe764e6f28894c
+MISC ChangeLog 335 SHA256 4e58212c3425c9a320588b36085765b0f034ed8103b9f4d9db7c4c68a278dfbe SHA512 87a76a5ca9c0ec01993a9a119ce74d13f97baffae5ab3dd51e691193d369ee74ed56f040d0ced0bef5ba2e98effcca40abe596f1e7b6be6499bbc3ada2b4ace2 WHIRLPOOL 620cef2d95f610e48b2e37a61ec109acd300c99770858b0406a05eb42f464fffc3e1af2ab34dde97f6187d01458cfc9184bf26dd4bbc5200f2d832cd312c95e2
+MISC metadata.xml 586 SHA256 5572ec5ae6e088ed56f6de7cf4484cca7f20293415e06623d88fd949138b10fc SHA512 68079ef915af3e2a28aeedac587ec907a2bc73568c16ecb914553ad82bd0f54466c6989296686799cf06017d1c1d9b8567e5bfede275339ee663913d7aa8688a WHIRLPOOL 0ec9ea40b48ffe18b716570bbf9d9f9d1e49e041697fd9a3b72fcf6951f92f26da9f478a3bc921410854014750a741ca18ef6f5dc005770c3d8e469c059392f9
diff --git a/sci-astronomy/weightwatcher/metadata.xml b/sci-astronomy/weightwatcher/metadata.xml
new file mode 100644
index 000000000000..86c4c7dc6113
--- /dev/null
+++ b/sci-astronomy/weightwatcher/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ WeightWatcher is a program that combines weight-maps, flag-maps and
+ polygon data in order to produce control maps which can directly be
+ used in astronomical image-processing packages like Drizzle,
+ <pkg>sci-astronomy/sextractor</pkg> or <pkg>sci-astronomy/swarp</pkg>.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/weightwatcher/weightwatcher-1.12.ebuild b/sci-astronomy/weightwatcher/weightwatcher-1.12.ebuild
new file mode 100644
index 000000000000..8df45c762e4f
--- /dev/null
+++ b/sci-astronomy/weightwatcher/weightwatcher-1.12.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Combine weight maps and polygon for astronomical images weighting"
+HOMEPAGE="http://www.astromatic.net/software/weightwatcher/"
+SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+src_install () {
+ default
+ use doc && dodoc doc/*
+}
diff --git a/sci-astronomy/xephem/Manifest b/sci-astronomy/xephem/Manifest
new file mode 100644
index 000000000000..82173f0ae2f5
--- /dev/null
+++ b/sci-astronomy/xephem/Manifest
@@ -0,0 +1,7 @@
+AUX xephem-3.7.7-implicits.patch 305 SHA256 c512083980a72c03ca37cfc1db4d23bf7a6a4fa343cae41ec50bf790d9f50846 SHA512 220186bb7f72fe0de6ca75a67df7b1a4d4cc57cc4768d565dc8225e20df93738c7bdd62bde6297941d1ec6638800950ef56e355de8ca1e3e8192b903b021adba WHIRLPOOL ce6bf19fdcced1059b62f7b73f4eb79dc6028aabea85e33733220c4cb431b6a91306f9d12aaabe5d0b9a8bd54c6384237ccb6deea48c119b0a0583e37dcc66b5
+AUX xephem-3.7.7-respect_env_vars.patch 3781 SHA256 13c7f579f76300d8efd28e721094d826bdfda173ff1795be380b2a2d368bc7cb SHA512 84a9697c3b05ed28bcc59f4b30807aad76c3228e1aec3db898995d36cae3ef58557ff984a57f60b99e15dd04670a65061451dc00437498c14ed081c0cf06830d WHIRLPOOL 2b409bc14acc527d4597aac0a6ebb0b0f6594a29994d03cce0729fa1535e86a9cd8acb0de9284cf47f795b2abba8579a6773a29b088abc9485a3a88ecd242cbb
+DIST xephem-3.7.7.tar.gz 18128523 SHA256 d1f8e17cfc5d2e3af5fd5a8bcf34bbf99a79d40f66326c098a819f82af62b4b7 SHA512 d9cfecf0ce8aa495f66fcf6772ca7df0638cef8b9f18d9d6cbf013846a7575786ae9b5c515abc2058783baa7610320c893ddbc6f68bae28c65661a1c73b88634 WHIRLPOOL 1986700ee6207b4a68ea8e5acb3c37f45286b48c5ed392934eb0b9beb2f9e733c2e995fc367da1f4079b7b48d9d92e2e5400658b9ed36cbf3961969f26e6013c
+EBUILD xephem-3.7.7.ebuild 1273 SHA256 02578a7f1afc3526a87d18cb40174c68d52d2ccfee7a54517c339dd655ce44a0 SHA512 3acac86ea6ec890cf925fea02f9593e0e5c3fac084c0d5319569b6b7242a02f8dbe045098afbf5d354240373b30f0625e626b368fc0bb62cc059b1ad9d6be3fd WHIRLPOOL be794e2503b66ee6f13f1f994dcdf6f26745336e2475e7f3e1e9c164c77807598c59b666f133d8fb3b181d28ab318a8c7e93eaa96cd1693b10090caafe401eb6
+MISC ChangeLog 3147 SHA256 68391384388e5c06ec5ab309a1bbca40e410851b0815927f5dfa24139011f7db SHA512 0edc3ab689839cd8169fbc83bf2aa7a160dffa0bc5e0f75ac20fd0bcd048441ebbbbbe1002bef242fef18841bb61600f764c47867ef3a512f4676d1d73ae49b8 WHIRLPOOL 40728af8460c0ba8632d83fa784d002451cc7bbfd55436f547f1b6056cc3802e3bb5fb0c7ddc88686743cc7fd6bc50cd0a9616fab342e2ebf4a81d32bfba4054
+MISC ChangeLog-2015 9523 SHA256 1991fd54ab5c192f351fca327943ee998f5028d21d12eb18084b469f2bcb73f6 SHA512 5ff4afb15f3c6c5dae19ed301ad5b7ec18705190b5edcaeb76fe718394891123b77a88677f268b74e2cfdcd886599c1932dadd8198f812f5fcc124b8623b3314 WHIRLPOOL 2c405ec9c93b1b085cc7e5de1e11bf655c909ad8e8b73f57e299d763dabda86142d413b4a3a8e36aa828bcd9e1a6840dc7077e9c2530973e6b9992072c04cfca
+MISC metadata.xml 724 SHA256 ef40ef574b34dd6dae8dc4e1b23e1c6c5c8a8de57efa353214bd9c79959ae512 SHA512 284438dd41ad8c88f68bec7519778e0b22f5c30f31225e8d10953ac070a81f368e92b4294d7ceb3e216af5d0f2d7a88ef25be164fa8f98ec2e26a4206317abb2 WHIRLPOOL bd6b43cc78b6ece7d7550a887f12b1050eba37bba61853cf09b2cbea44f74bbba911987909cabe1e48d4c13b1458b8be024745d1502515ee8246117922439295
diff --git a/sci-astronomy/xephem/files/xephem-3.7.7-implicits.patch b/sci-astronomy/xephem/files/xephem-3.7.7-implicits.patch
new file mode 100644
index 000000000000..4c340711e0e8
--- /dev/null
+++ b/sci-astronomy/xephem/files/xephem-3.7.7-implicits.patch
@@ -0,0 +1,12 @@
+sunmenu.c:920:3: warning: implicit declaration of function ‘strptime’
+
+--- a/GUI/xephem/sunmenu.c
++++ b/GUI/xephem/sunmenu.c
+@@ -1,6 +1,7 @@
+ /* code to manage the sun display
+ */
+
++#define _XOPEN_SOURCE /* See feature_test_macros(7) */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
diff --git a/sci-astronomy/xephem/files/xephem-3.7.7-respect_env_vars.patch b/sci-astronomy/xephem/files/xephem-3.7.7-respect_env_vars.patch
new file mode 100644
index 000000000000..e916bd339782
--- /dev/null
+++ b/sci-astronomy/xephem/files/xephem-3.7.7-respect_env_vars.patch
@@ -0,0 +1,137 @@
+diff -ruN a/GUI/xephem/Makefile b/GUI/xephem/Makefile
+--- a/GUI/xephem/Makefile 2015-08-09 22:36:50.000000000 +0100
++++ b/GUI/xephem/Makefile 2016-01-24 09:34:24.378578717 +0000
+@@ -10,9 +10,9 @@
+ # one executable, xephem.
+
+ # These -I and -L flags point to the supporting XEphem libraries
+-LIBINC = -I../../libastro -I../../libip -I../../liblilxml -I../../libjpegd -I../../libpng -I../../libz
+-LIBLNK = -L../../libastro -L../../libip -L../../liblilxml -L../../libjpegd -L../../libpng -L../../libz
+-LIBLIB = -lastro -lip -llilxml -ljpegd -lpng -lz
++LIBINC = -I../../libastro -I../../libip -I../../liblilxml
++LIBLNK = -L../../libastro -L../../libip -L../../liblilxml
++LIBLIB = -lastro -lip -llilxml -ljpeg -lpng -lz
+
+ # MOTIFI is the directory containing the Xm directory of include files.
+ # MOTIFL is the directory containing the libXm.a library.
+@@ -30,12 +30,9 @@
+ endif
+
+ # for linux and Apple OS X
+-CC = gcc
+-CLDFLAGS = -g
+-CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) -I/opt/X11/include
+-LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) -L/opt/X11/lib
+ XLIBS = -lXm -lXp -lXt -lXext -lXmu -lX11
+-LIBS = $(XLIBS) $(LIBLIB) -lm
++CFLAGS := $(LIBINC) $(CFLAGS)
++LIBS = $(LIBLNK) $(XLIBS) $(LIBLIB) -lm
+
+ # static linking on Apple using X11 libs from ports
+ # CC = gcc
+@@ -68,9 +65,9 @@
+ # MOTIFI = -I/usr/include
+ # MOTIFL = -L/usr/lib
+ # CC = cc
+-# CLDFLAGS =
++# CLDFLAGS =
+ # CFLAGS = $(LIBINC) $(CLDFLAGS) -O -I$(MOTIFI)
+-# LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL)
++# LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL)
+ # XLIBS = -lXm -lXt -lX11
+ # LIBS = $(XLIBS) $(LIBLIB) -lsocket -lnsl -lc -lm /usr/ucblib/libucb.a
+ # Note: if you get regex undefined, add -lgen to the end of LIBS.
+@@ -195,12 +192,9 @@
+ nroff -man $? > $@
+
+ libs:
+- cd ../../libastro; make
+- cd ../../libip; make
+- cd ../../libjpegd; make
+- cd ../../liblilxml; make
+- cd ../../libpng; make
+- cd ../../libz; make
++ $(MAKE) -C ../../libastro
++ $(MAKE) -C ../../libip
++ $(MAKE) -C ../../liblilxml
+
+ clean:
+ rm -fr *.o ../../lib*/*.[ao]
+diff -ruN a/libastro/Makefile b/libastro/Makefile
+--- a/libastro/Makefile 2006-02-24 03:37:31.000000000 +0000
++++ b/libastro/Makefile 2016-01-24 09:30:28.745982455 +0000
+@@ -4,8 +4,6 @@
+ # compiler and flags
+
+ # gcc
+-CC = gcc
+-CFLAGS= -O2 -Wall
+
+ # macosx universal binary
+ # CFLAGS= -O2 -Wall -arch i386 -arch ppc
+@@ -83,11 +81,11 @@
+ vsop87_data.o
+
+ libastro.a: $(HS) $(OBJS)
+- ar rv $@ $(OBJS)
+- ranlib $@
++ $(AR) rv $@ $(OBJS)
++ $(RANLIB) $@
+
+ libastro.so: $(HS) $(OBJS)
+- $(CC) -shared -o $@ $(OBJS)
++ $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
+
+ clobber:
+ rm -f *.o libastro.a
+diff -ruN a/libip/Makefile b/libip/Makefile
+--- a/libip/Makefile 2009-01-05 20:53:46.000000000 +0000
++++ b/libip/Makefile 2016-01-24 09:30:28.745982455 +0000
+@@ -2,8 +2,7 @@
+ # (C) 2001 Elwood Charles Downey
+
+ # gcc
+-CC = gcc
+-CFLAGS= -I../libastro -O2 -Wall
++CFLAGS += -I../libastro
+
+ # macosx universal binary
+ # CFLAGS= -I../libastro -O2 -Wall -arch i386 -arch ppc
+@@ -36,11 +35,11 @@
+ HS = ip.h fsmatch.h
+
+ libip.a: $(HS) $(OBJS)
+- ar rv $@ $(OBJS)
+- ranlib $@
++ $(AR) rv $@ $(OBJS)
++ $(RANLIB) $@
+
+ libip.so: $(OBJS)
+- gcc -shared -o $@ $(OBJS)
++ $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
+
+ clobber:
+ rm -f *.o libip.a
+diff -ruN a/liblilxml/Makefile b/liblilxml/Makefile
+--- a/liblilxml/Makefile 2006-02-24 03:37:32.000000000 +0000
++++ b/liblilxml/Makefile 2016-01-24 09:30:28.745982455 +0000
+@@ -4,8 +4,6 @@
+ # compiler and flags
+
+ # gcc
+-CC = gcc
+-CFLAGS= -O2 -Wall
+
+ # macosx universal binary
+ # CFLAGS= -O2 -Wall -arch i386 -arch ppc
+@@ -27,8 +25,8 @@
+ OBJS = lilxml.o base64.o
+
+ liblilxml.a: $(HS) $(OBJS)
+- ar r $@ $(OBJS)
+- ranlib $@
++ $(AR) r $@ $(OBJS)
++ $(RANLIB) $@
+
+ liltest: liltest.o liblilxml.a
+ $(CC) $(LDFLAGS) -o liltest liltest.o liblilxml.a
diff --git a/sci-astronomy/xephem/metadata.xml b/sci-astronomy/xephem/metadata.xml
new file mode 100644
index 000000000000..f75d933bc7ec
--- /dev/null
+++ b/sci-astronomy/xephem/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ Xephem is an interactive astronomical ephemeris program for X Windows
+ systems. It computes heliocentric, geocentric and topocentric
+ information for fixed celestial objects and objects in heliocentric
+ and geocentric orbits; has built-in support for all planet positions;
+ the moons of Jupiter, Saturn and Earth; Mars' and Jupiter's central
+ meridian longitude; Saturn's rings; and Jupiter's Great Red Spot.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/xephem/xephem-3.7.7.ebuild b/sci-astronomy/xephem/xephem-3.7.7.ebuild
new file mode 100644
index 000000000000..ad77acbd7215
--- /dev/null
+++ b/sci-astronomy/xephem/xephem-3.7.7.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Interactive tool for astronomical ephemeris and sky simulation"
+HOMEPAGE="http://www.clearskyinstitute.com/xephem"
+SRC_URI="http://97.74.56.125/free/${P}.tar.gz"
+
+LICENSE="XEphem"
+SLOT=0
+KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-libs/motif-2.3:0
+ virtual/jpeg:0=
+ media-libs/libpng:0="
+DEPEND="${RDEPEND}
+ sys-apps/groff"
+
+PATCHES=(
+ "${FILESDIR}/${P}-respect_env_vars.patch"
+ "${FILESDIR}/${P}-implicits.patch"
+)
+
+src_prepare() {
+ default
+ echo > "${T}"/XEphem "XEphem.ShareDir: /usr/share/${PN}"
+ echo > "${T}"/99xephem "XEHELPURL=/usr/share/doc/${PF}/html/xephem.html"
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+ emake -C GUI/xephem
+}
+
+src_install() {
+ insinto /usr/share/X11/app-defaults
+ has_version '<x11-base/xorg-x11-7.0' && insinto /etc/X11/app-defaults
+ doins "${T}"/XEphem
+ doenvd "${T}"/99xephem
+ dodoc README
+
+ cd GUI/xephem
+ dobin xephem
+ doman xephem.1
+ newicon XEphem.png ${PN}.png
+ insinto /usr/share/${PN}
+ doins -r auxil catalogs fifos fits gallery lo
+ insinto /usr/share/doc/${PF}/html
+ doins -r help/*
+ make_desktop_entry xephem XEphem ${PN}
+}
diff --git a/sci-astronomy/xfitsview/Manifest b/sci-astronomy/xfitsview/Manifest
new file mode 100644
index 000000000000..ec51c60e0f80
--- /dev/null
+++ b/sci-astronomy/xfitsview/Manifest
@@ -0,0 +1,6 @@
+AUX xfitsview-2.2-build_system.patch 1316 SHA256 00a7235b5d85d94cf1309be4eecb42321eaab5716a0b94ffd349bf9663c5feb5 SHA512 a8d40252424f7c49fbe7fd3b6d2d6f5fbbdb0b09c01d1aff0854cf55576106dfba29ec63557ac7e3b06971a502413e901e3ccc7bc8443d36937b17495e87cdaf WHIRLPOOL 363b62323c807a70b7068cf38b930f1f97139bcfa9920561da4737a0ff8b93e4c95fe05c042cd25919c459e259b8d4e7d19b7dd578ec4e85a33caa56d9ba179c
+DIST xfitsview2.2.tgz 290959 SHA256 f47649ad0091fa555aae13a0c539cd378591df28613b8572195baf77eea74fbb SHA512 01e57f0dd9c7320b86683a2235e7a779828f19c34b9380d5127bad85941e8861fd86f17a276f7ec60038d9e3bc4c8df54cc6291b70f8c7ecce4ef17cfb92b1b9 WHIRLPOOL 2a933d5fd2dcc06b4af949060bcc7094735c8440b3eb24c7b1a8275e3673132e1b1c6733af3eadb944e7f3b4edb38126953246a08d7a2236ba8a5a5fb8220f4c
+EBUILD xfitsview-2.2-r2.ebuild 704 SHA256 aff837d8c2ab27995d9e07894efa32b0447a738caf1162742e1d0238b89b8a5f SHA512 b82c13d884fff8ae6b84901075b4de982145d288deec1b95c1e83e62e111d0ef99d435ab8917d8acd653de9dfd40e71d9c3dee2c3a187fd009a6177838aea16e WHIRLPOOL 269f3eb9209d2c263acadc7e510d248a66f8d4bb21e4b4d1eaed6fe3ae3a10bc8713ccef4452f9892d7a3196f060a633699ea5a6f0df06ac1e49289d8e555903
+MISC ChangeLog 3054 SHA256 670006ba8a9f66c6e55ec74f991e9bfa31414629057ebc1e2ff24ecc971733c7 SHA512 98051f16a5fc6bb5911619aa0cfbd5cc6c16e9f05e1a7877b4da2bdf067061df6deee6257b296d6e2488eebf87fc92e1a27cca4a0028eb031f7cbdcc9d787819 WHIRLPOOL 014f87677db07f18794c9a8bff083b588bfe4c73432dcdad4481a9c2cd6a3de3b8e321eb1f1291c3a5feff6ad55ea073ed1211b1f1c38f7976d408219944952e
+MISC ChangeLog-2015 1701 SHA256 19a4a159f5a415a5299192b57425ee11086f9a42fb77d57e1146ebd782fb14ed SHA512 902c938245a8e327b8aa2c97349e6754d74f4773333a9459e327be996fd6861f2329b95ba6ad27ed7816463fd31aa207ed9ace01787553d6f630acca103b0111 WHIRLPOOL 3f69bc4bdf8ae2e78444ecde4053b595e5a148ee033cbe88b8e7b313e265cc0fd0f13b4f76e96555858c04998dcbec6fb49ca0306512d0f36787bc31c4a28680
+MISC metadata.xml 499 SHA256 211a1b70396c03c7e9f95af84116ccb02578ab5da7f1f5d14472efac68be8b4c SHA512 581c014fc4159848e631b0bd8b61e5a7f1ddea2660b81e4f004bfe698a4a94e6eb8cec5ad61a850bb60c509b561e75fa5a03d9e14d03d3f62d00ce8908f21d26 WHIRLPOOL 89543d341fd9b8a70fb3e584886041c0382594fb725836599f4a9634e6217ad2b6a78d1d44c13ba4f8b00d1346f8b3906e0e3d001d8d68c6031c5d2dd0d33abe
diff --git a/sci-astronomy/xfitsview/files/xfitsview-2.2-build_system.patch b/sci-astronomy/xfitsview/files/xfitsview-2.2-build_system.patch
new file mode 100644
index 000000000000..12eaacf4e244
--- /dev/null
+++ b/sci-astronomy/xfitsview/files/xfitsview-2.2-build_system.patch
@@ -0,0 +1,54 @@
+* Fix parallel build
+* Respect LDFLAGS
+* Fix build with gmake 3.82
+
+http://bugs.gentoo.org/show_bug.cgi?id=337479
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -61,26 +61,26 @@
+ LIBDIR = lib/$(ARCH)/
+ CFLAGS = -Iinclude -Ifitssubs @MOTIF_CPPFLAGS@ @X_CFLAGS@ \
+ $(DEBUG) $(OSFLAGS) @CFLAGS@
+-LIBS = @MOTIF_LIBS@ -lfitsLib
+-LDFLAGS = @MOTIF_LDFLAGS@ @X_LIBS@ -L$(LIBDIR)
++LIBS = @MOTIF_LIBS@ @X_LIBS@ -L$(LIBDIR) -lfitsLib
++LDFLAGS = @LDFLAGS@ @MOTIF_LDFLAGS@
+
+ all: $(TARGETS)
+
+ # update source/object directory
+ srcupdate:
+- cd src; $(MAKE)
++ $(MAKE) -C src
+
+ # update fitssubs source/object directory
+ fitsupdate:
+- cd fitssubs; $(MAKE)
++ $(MAKE) -C fitssubs
+
+ # update fitssubs library directory
+-libupdate:
+- cd lib; $(MAKE) RANLIB="$(RANLIB)"
++libupdate: fitsupdate srcupdate
++ $(MAKE) RANLIB="$(RANLIB)" -C lib
+
+ # Link Obitview
+-XFITSview: lib/$(ARCH)/libfitsLib.a src/*.c XFITSview.c
+- $(CC) XFITSview.c -o XFITSview $(CFLAGS) src/*.o $(LDFLAGS) $(LIBS)
++XFITSview: XFITSview.c libupdate
++ $(CC) $(LDFLAGS) XFITSview.c -o XFITSview $(CFLAGS) src/*.o $(LIBS)
+
+ # make gzipped tar backup of directory
+ backup:
+--- a/fitssubs/Makefile.in
++++ b/fitssubs/Makefile.in
+@@ -69,7 +69,7 @@
+
+
+ # create library directory if needed
+-../lib/$(ARCH): ../lib
++$(LIBDIR): ../lib
+ mkdir ../lib/$(ARCH)
+
+ clean:
diff --git a/sci-astronomy/xfitsview/metadata.xml b/sci-astronomy/xfitsview/metadata.xml
new file mode 100644
index 000000000000..72e2a3d58ec3
--- /dev/null
+++ b/sci-astronomy/xfitsview/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 type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+</maintainer>
+<longdescription lang="en">
+ XFITSview is a Graphical User Interface based on the Motif library to
+ visualize astronomical images in the FITS format. It's a fairly simple
+ program useful for doing simple astrometry.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-astronomy/xfitsview/xfitsview-2.2-r2.ebuild b/sci-astronomy/xfitsview/xfitsview-2.2-r2.ebuild
new file mode 100644
index 000000000000..ff1ebd1455cc
--- /dev/null
+++ b/sci-astronomy/xfitsview/xfitsview-2.2-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PN=XFITSview
+MY_P=${MY_PN}${PV}
+
+DESCRIPTION="Viewer for astronomical images in FITS format"
+HOMEPAGE="http://www.nrao.edu/software/fitsview/"
+SRC_URI="ftp://ftp.cv.nrao.edu/fits/os-support/unix/xfitsview/${PN}${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND=">=x11-libs/motif-2.3:0"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_PN}
+
+DOCS=( README changes notes.text )
+PATCHES=( "${FILESDIR}"/${P}-build_system.patch )
+
+src_prepare() {
+ default
+ find "${S}" -name '*old.c' -delete || die
+}
+
+src_install() {
+ dobin XFITSview
+ einstalldocs
+}