@@ -0,0 +1,32 @@
1+{ stdenv, buildPythonPackage, fetchPypi, isPy3k
2+, glibcLocales, pytest }:
3+
4+buildPythonPackage rec {
5+ pname = "ephem";
6+ name = "${pname}-${version}";
7+ version = "3.7.6.0";
8+
9+ src = fetchPypi {
10+ inherit pname version;
11+ sha256 = "7a4c82b1def2893e02aec0394f108d24adb17bd7b0ca6f4bc78eb7120c0212ac";
12+ };
13+
14+ patchFlags = "-p0";
15+ checkInputs = [ pytest glibcLocales ];
16+ # JPLTest uses assets not distributed in package
17+ checkPhase = ''
18+ LC_ALL="en_US.UTF-8" py.test --pyargs ephem.tests -k "not JPLTest"
19+ '';
20+
21+ # Unfortunately, the tests are broken for Python 3 in 3.7.6.0. They have been
22+ # fixed in https://github.com/brandon-rhodes/pyephem/commit/c8633854e2d251a198b0f701d0528b508baa2411
23+ # but there has not been a new release since then.
24+ doCheck = !isPy3k;
25+
26+ meta = with stdenv.lib; {
27+ description = "Compute positions of the planets and stars";
28+ homepage = https://pypi.python.org/pypi/ephem/;
29+ license = licenses.lgpl3;
30+ maintainers = with maintainers; [ chrisrosset ];
31+ };
32+}