source: trunk/dports/science/hdf5-18/Portfile @ 147962

Last change on this file since 147962 was 147962, checked in by takeshi@…, 4 years ago

hdf5-18: fix h5cc/h5pcc to respect env vars and quoted args

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.7 KB
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 147962 2016-04-21 14:05:57Z takeshi@macports.org $
3
4PortSystem          1.0
5PortGroup           conflicts_build 1.0
6PortGroup           muniversal 1.0
7PortGroup           mpi 1.0
8
9set realname        hdf5
10name                hdf5-18
11version             1.8.16
12revision            4
13categories          science
14maintainers         takeshi mmoll openmaintainer
15
16description         HDF5 general purpose library and file format for storing\
17                    scientific data
18long_description    HDF5 is a data model, library, and file format for storing\
19                    and managing data. It supports an unlimited variety of\
20                    datatypes, and is designed for flexible and efficient I/O\
21                    and for high volume and complex data. HDF5 is portable and\
22                    is extensible, allowing applications to evolve in their use\
23                    of HDF5. The HDF5 Technology suite includes tools and\
24                    applications for managing, manipulating, viewing, and\
25                    analyzing data in the HDF5 format.
26homepage            http://www.hdfgroup.org/HDF5/
27platforms           darwin
28master_sites \
29    http://www.hdfgroup.org/ftp/HDF5/current/src \
30    ftp://ftp.hdfgroup.org/HDF5/current/src/ \
31    ftp://ftp.hdfgroup.org/HDF5/prev-releases/hdf5-${version}/src/
32checksums           rmd160  f72c7029b08dfae4562b9aa23f03aa43bd02617e \
33                    sha256  13aaae5ba10b70749ee1718816a4b4bfead897c2fcb72c24176e759aec4598c6
34mpi.setup           -gcc44 -gcc45
35
36distname            ${realname}-${version}
37dist_subdir         ${realname}
38
39use_bzip2           yes
40depends_lib         port:zlib
41use_parallel_build  yes
42
43# nawk: bailing out at source line 273
44conflicts_build     nawk
45
46# Don't create dylibs with "-flat_namespace -undefined suppress" on
47# Yosemite and later (#44596).
48patchfiles          yosemite-libtool.patch \
49                    patch-tools-misc-h5cc.in.diff
50
51# llvm-gcc-4.2 produced code fails type conversion tests
52# Upstream suggestion is use -O0. Clang-produced code passes all tests.
53compiler.blacklist  llvm-gcc-4.2
54
55# Use lib/hdf5 rather than hdf5/lib plugin directory
56configure.args      --with-zlib=yes \
57                    --enable-production --disable-fortran \
58                    --disable-cxx --disable-hl --enable-shared --enable-static \
59                    --disable-parallel --disable-threadsafe \
60                    --with-default-plugindir=${prefix}/lib/${name} \
61                    --program-suffix=-18 \
62                    --includedir=${prefix}/include/${name} \
63                    --libdir=${prefix}/lib/${name}
64
65# http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/2010-March/002682.html
66license             NCSA
67
68default_variants    +cxx +hl
69
70post-configure {
71    if {[variant_isset universal]} {
72        set dirs {}
73        foreach arch ${universal_archs_to_use} {
74            lappend dirs ${worksrcpath}-${arch}
75        }
76    } else {
77        set dirs ${worksrcpath}
78    }
79    foreach dir ${dirs} {
80        reinplace -E {s|-arch [a-z0-9_]+||g} \
81            ${dir}/tools/misc/h5cc \
82            ${dir}/c++/src/h5c++ \
83            ${dir}/src/libhdf5.settings \
84            ${dir}/fortran/src/h5fc
85    }
86}
87
88post-destroot {
89    xinstall -d ${destroot}${prefix}/share/${name}/
90    xinstall -m 444 ${worksrcpath}/COPYING\
91      ${destroot}${prefix}/share/${name}/
92    file rename ${destroot}${prefix}/share/hdf5_examples ${destroot}${prefix}/share/${name}
93    if {[mpi_variant_isset]} {
94        file rename ${destroot}${prefix}/bin/h5pcc ${destroot}${prefix}/bin/h5pcc-18
95    } else {
96        file rename ${destroot}${prefix}/bin/h5cc ${destroot}${prefix}/bin/h5cc-18
97    }
98    if {[variant_isset fortran]} {
99        file rename ${destroot}${prefix}/bin/h5fc ${destroot}${prefix}/bin/h5fc-18
100    }
101}
102
103pre-activate {
104    if {![catch {set installed [lindex [registry_active hdf5-18] 0]}]} {
105        set _version [lindex $installed 1]
106        if {[vercmp $_version 1.8.15] < 0} {
107            registry_deactivate_composite hdf5-18 "" [list ports_nodepcheck 1]
108        }
109    }
110}
111
112test.run            yes
113test.target         check
114
115variant szip description {Enable szip support. (Noncommercial license)} {
116    depends_lib-append          port:szip
117    configure.args-append       --with-szlib=yes
118    license                     Noncommercial
119}
120
121variant hl description {
122    Enable High Level interface.
123  +hl is EXPERIMENTAL with +threadsafe
124} {
125    configure.args-delete       --disable-hl
126    configure.args-append       --enable-hl
127}
128
129variant cxx description {
130    Enable c++ interfance.
131  +cxx is EXPERIMENTAL with +threadsafe or any mpi variant
132} {
133    configure.args-delete       --disable-cxx
134    configure.args-append       --enable-cxx
135}
136
137variant fortran description {
138    Enable fortran bindings.
139  +fortran is EXPERIMENTAL with +threadsafe
140} {
141    configure.args-delete       --disable-fortran
142    configure.args-append       --enable-fortran --enable-fortran2003
143
144    if {![fortran_variant_isset]} {
145        default_variants +gfortran
146    }
147}
148
149if {[ variant_isset fortran ] && ![ fortran_variant_isset ] } {
150    ui_error "+fortran requires a fortran compiler to be selected"
151    return -code error
152}
153
154if {([ variant_isset gfortran ] || [ variant_isset g95 ]) && ![ variant_isset fortran ]} {
155    default_variants +fortran
156}
157
158variant threadsafe description {
159    Enable threadsafety.
160  +threadsafe is EXPERIMENTAL with +cxx, +fortran, or any mpi variant
161} {
162    configure.args-delete       --disable-threadsafe
163    configure.args-append       --enable-threadsafe --with-pthread
164}
165
166if {[ variant_isset threadsafe ] && ([ variant_isset cxx ] ||
167                                     [ variant_isset hl ] ||
168                                     [ variant_isset fortran ]) ||
169    ([ mpi_variant_isset ])  &&
170    ([ variant_isset cxx ]   || [ variant_isset threadsafe ])  } {
171
172    # Tell hdf5 to configure in this experimental configuration
173    configure.args-append       --enable-unsupported
174
175    notes {
176!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
177hdf5 has been installed in an unsupported "Experimental" mode due to\
178selected variants. See "port variants hdf5 | grep EXPERIMENTAL" for more\
179information.
180!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
181    }
182
183    pre-configure {
184        ui_warn {
185!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
186hdf5 will been configured in an unsupported "Experimental" mode due to\
187selected variants. See "port variants hdf5 | grep EXPERIMENTAL" for more\
188information.
189!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
190    }
191    }
192}
193
194if {[ mpi_variant_isset ]} {
195    configure.args-delete       --disable-parallel
196    configure.args-append       --enable-parallel
197}
198
199livecheck.type      regex
200livecheck.url       http://www.hdfgroup.org/HDF5/release/obtain5.html
201livecheck.regex     5-(\[0-9.\]+\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.