Ticket #16263: Portfile

File Portfile, 3.3 KB (added by mamoll (Mark Moll), 16 years ago)

Current version of my Portfile

Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 39007 2008-08-06 06:11:53Z jochen@macports.org $
3
4PortSystem          1.0
5
6name                hdf5
7version             1.8.1
8categories          science
9maintainers         openmaintainer jochen
10
11description         HDF5 general purpose library and file format for storing scientific data
12long_description    ${description}
13homepage            http://www.hdfgroup.org/HDF5/
14platforms           darwin
15master_sites        ftp://ftp.hdfgroup.org/HDF5/current/src/
16checksums           md5 193a4ea1a2b1c6d34bcb357db7d112a6 \
17                    sha1 8289b26ef5387de2a9f27b0540ca24768dcb2207 \
18                    rmd160 14a1569304a860cdaa2d3e16712c9ca5f04fc39b
19
20depends_lib         port:zlib
21
22use_parallel_build  yes
23
24configure.args      --enable-cxx --with-zlib=yes --with-szlib=no \
25                    --enable-filters=all --disable-shared
26configure.ldflags   -L${worksrcpath}/src/.libs -L${prefix}/lib
27
28destroot.destdir    prefix=${destroot}${prefix}
29
30test.run            yes
31test.target         check
32
33
34# variant descriptions
35
36variant fortran description {Include the Fortran interface} {
37    if { [variant_isset gcc43] || [variant_isset gcc42] || [variant_isset g95] } {
38        configure.args-delete   --disable-fortran
39        configure.args-append   --enable-fortran
40    } else {
41        error "You must specify a compiler variant in order to build the Fortran interface"
42    }
43}
44
45variant szip description {Enable szip compression support} {
46    configure.args-delete       --with-szlib=no
47    configure.args-append       --with-szlib=yes
48    depends_lib-append          port:szip
49}
50
51variant threadsafe description {Enable threadsafety (experimental, fails unit-tests)} {
52    configure.args-delete       --disable-threadsafe
53    configure.args-append       --enable-threadsafe
54}
55
56
57variant gcc42 conflicts g95 gcc43 description {Compile using GCC 4.2} {
58    depends_lib-append          port:gcc42
59    configure.compiler          macports-gcc-4.2
60}
61
62variant gcc43 conflicts g95 gcc42 description {Compile using GCC 4.3} {
63    depends_lib-append          port:gcc43
64    configure.compiler          macports-gcc-4.3
65    configure.env-append        LD=${prefix}/bin/g++-mp-4.3
66}
67
68variant g95 requires fortran conflicts gcc42 gcc43 description {Use g95 Fortran compiler (unsupported)} {
69    depends_lib-append          port:g95
70    patchfiles-append           patch-powerpc-apple.diff
71    configure.fc                ${prefix}/bin/g95
72}
73
74variant optimized description {Higher compiler optimization for host machine (esp. for gcc43)} {
75    if { [variant_isset gcc43] } {
76        configure.cflags-delete     -O2
77        configure.cxxflags-delete   -O2
78        configure.fflags-delete     -O2
79        configure.cflags-append     -ftree-vectorize -march=native -O3
80        configure.cxxflags-append   -ftree-vectorize -march=native -O3
81        configure.fflags-append     -ftree-vectorize -march=native -O3
82    } else {
83        configure.cflags-delete     -O2
84        configure.cxxflags-delete   -O2
85        configure.fflags-delete     -O2
86        configure.cflags-append     -ftree-vectorize -O3
87        configure.cxxflags-append   -ftree-vectorize -O3
88        configure.fflags-append     -ftree-vectorize -O3
89    }
90}