From 17f97dd01cc7585723b151b492deb9ee21e04d91 Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Fri, 20 Dec 2019 10:07:27 +0000 Subject: MFH: r520162 [NEW] astro/py-ephem: Compute positions of the planets and stars PyEphem provides an ephem Python package for performing high-precision astronomy computations. The underlying numeric routines are coded in C and are the same ones that drive the popular XEphem astronomy application, whose author, Elwood Charles Downey, generously gave permission for their use in PyEphem. The name ephem is short for the word ephemeris, which is the traditional term for a table giving the position of a planet, asteroid, or comet for a series of dates. WWW: https://rhodesmill.org/pyephem/ WWW: https://pypi.org/project/ephem/ [1] Based on astro/pyephem PR: 240736 Submitted by: Rainer Hurling Approved by: ports-secteam (joneum) --- astro/Makefile | 1 + astro/py-ephem/Makefile | 25 +++++++++++++++++++++++++ astro/py-ephem/distinfo | 3 +++ astro/py-ephem/files/patch-setup.py | 31 +++++++++++++++++++++++++++++++ astro/py-ephem/pkg-descr | 10 ++++++++++ 5 files changed, 70 insertions(+) create mode 100644 astro/py-ephem/Makefile create mode 100644 astro/py-ephem/distinfo create mode 100644 astro/py-ephem/files/patch-setup.py create mode 100644 astro/py-ephem/pkg-descr diff --git a/astro/Makefile b/astro/Makefile index b3a927e49a10..6f844a2c0dc4 100644 --- a/astro/Makefile +++ b/astro/Makefile @@ -85,6 +85,7 @@ SUBDIR += py-aipy SUBDIR += py-astLib SUBDIR += py-astropy + SUBDIR += py-ephem SUBDIR += py-horoscopegenerator SUBDIR += py-metar SUBDIR += py-metpy diff --git a/astro/py-ephem/Makefile b/astro/py-ephem/Makefile new file mode 100644 index 000000000000..141af03c1681 --- /dev/null +++ b/astro/py-ephem/Makefile @@ -0,0 +1,25 @@ +# Created by: db +# $FreeBSD$ + +PORTNAME= ephem +PORTVERSION= 3.7.7.0 +CATEGORIES= astro math python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= rhurlin@gwdg.de +COMMENT= Compute positions of the planets and stars + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/COPYING + +USES= python +USE_PYTHON= autoplist distutils + +post-install: + @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ephem/_libastro.so + +do-test: + @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test + +.include diff --git a/astro/py-ephem/distinfo b/astro/py-ephem/distinfo new file mode 100644 index 000000000000..c1da849db648 --- /dev/null +++ b/astro/py-ephem/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1576382931 +SHA256 (ephem-3.7.7.0.tar.gz) = 607148429f85412915e32265779c0cf6d09f73aa97cf1ff0d101ac22c69c4436 +SIZE (ephem-3.7.7.0.tar.gz) = 745041 diff --git a/astro/py-ephem/files/patch-setup.py b/astro/py-ephem/files/patch-setup.py new file mode 100644 index 000000000000..184acbc7f0f0 --- /dev/null +++ b/astro/py-ephem/files/patch-setup.py @@ -0,0 +1,31 @@ +--- setup.py.orig 2019-08-17 17:39:14 UTC ++++ setup.py +@@ -1,4 +1,13 @@ ++# Currently ephem fails if the text files contain unicode characters. ++# To fix this we need to open the files as utf-8 explicitly. ++# Since open() in Python 2 doesn't support an encoding parameter, ++# TODO: Upstream ++# ++# Add setup.py test command support to run tests ++# TODO: Upstream ++ + import os ++import io + import sys + from distutils.core import setup, Extension + from glob import glob +@@ -24,7 +33,7 @@ libastro_files = glob('libastro-%s/*.c' % libastro_ver + libastro_data = glob('extensions/data/*.c') + + def read(*filenames): +- return open(os.path.join(os.path.dirname(__file__), *filenames)).read() ++ return io.open(os.path.join(os.path.dirname(__file__), *filenames), encoding="utf-8").read() + + extensions = [ + Extension('ephem._libastro', +@@ -62,4 +71,5 @@ setup(name = 'ephem', + 'tests/usno/*.txt', + ],}, + ext_modules = extensions, ++ test_suite='ephem.tests', + ) diff --git a/astro/py-ephem/pkg-descr b/astro/py-ephem/pkg-descr new file mode 100644 index 000000000000..e1e13750f7d5 --- /dev/null +++ b/astro/py-ephem/pkg-descr @@ -0,0 +1,10 @@ +PyEphem provides an ephem Python package for performing high-precision +astronomy computations. The underlying numeric routines are coded in C +and are the same ones that drive the popular XEphem astronomy application, +whose author, Elwood Charles Downey, generously gave permission for their +use in PyEphem. The name ephem is short for the word ephemeris, which is +the traditional term for a table giving the position of a planet, asteroid, +or comet for a series of dates. + +WWW: https://rhodesmill.org/pyephem/ +WWW: https://pypi.org/project/ephem/ -- cgit v1.2.3