Ticket #49333: Portfile

File Portfile, 2.6 KB (added by dmopalmer (David Palmer), 9 years ago)

New portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 139414 2015-08-16 21:35:54Z robitaille@macports.org $
3
4PortSystem          1.0
5PortGroup           python 1.0
6
7name                py-astropy
8version             1.0.5
9maintainers         robitaille
10
11dist_subdir         ${name}/${version}
12
13categories-append   science
14description         A Community Python Library for Astronomy
15long_description    The Astropy project is a common effort to develop \
16                    a single core package for Astronomy.
17                   
18platforms           darwin
19license             BSD
20
21homepage            http://www.astropy.org
22master_sites        http://pypi.python.org/packages/source/a/astropy/
23distname            astropy-${version}
24checksums           md5     0d55d7c505bef39e40c7bfc59c0a0676 \
25                    sha1    83fac847f2cb5c58e9681d3fbc5b3293ea24de81 \
26                    rmd160  a6adec07c662730f1b4eb3fc22e6ab41ce935bc9
27
28python.versions     26 27 33 34 35
29
30build.args-append   --use-system-cfitsio \
31                    --use-system-expat \
32                    --use-system-wcslib \
33                    --use-system-erfa
34
35if {${name} ne ${subport}} {
36
37    depends_lib-append  port:cfitsio \
38                        port:expat \
39                        port:wcslib \
40                        port:erfa \
41                        port:py${python.version}-numpy
42
43    depends_build-append \
44                        port:pkgconfig \
45                        port:py${python.version}-setuptools
46
47    # By default, astropy downloads an astropy-helpers package for setup.py.
48    # The --offline and --no-git flags prevent this and use a bundled version.
49    build.cmd  ${python.bin} setup.py --no-user-cfg --offline --no-git
50    destroot.cmd  ${python.bin} setup.py --no-user-cfg --offline --no-git
51
52    # Don't let the python portgroup create symlinks to the binaries, because
53    # the python portgroup's post-destroot block will run before ours, so the
54    # files won't have the right names yet, and the symlinks will be broken.
55    python.link_binaries no
56
57    post-destroot {
58        # Don't conflict with files installed by py-pyfits.
59        set ap_suffix -ap
60        foreach bin {fitscheck fitsdiff fitsheader volint fits2bitmap samp_hub wcslint} {
61            move ${destroot}${python.prefix}/bin/${bin} ${destroot}${python.prefix}/bin/${bin}${ap_suffix}
62            ln -s ${python.prefix}/bin/${bin}${ap_suffix} ${destroot}${prefix}/bin/${bin}${ap_suffix}${python.link_binaries_suffix}
63        }
64    }
65
66}