source: trunk/dports/math/eigen3/Portfile

Last change on this file was 153081, checked in by eborisch@…, 10 months ago

eigen3-devel: Update to 3.3-rc1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.9 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 153081 2016-09-23 21:09:30Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compilers 1.0
6PortGroup           cmake 1.0
7PortGroup           bitbucket 1.0
8
9name                eigen3
10license             MPL-2 LGPL-3+
11categories          math science
12maintainers         eborisch \
13                    openmaintainer
14description         A C++ template library for linear algebra: vectors, \
15                    matrices, and related algorithms.
16long_description    ${description}
17platforms           darwin
18
19livecheck.url       http://eigen.tuxfamily.org
20use_bzip2           yes
21
22depends_build-append    port:pkgconfig
23
24subport eigen3-devel {}
25
26if {${subport} eq ${name}} {
27    bitbucket.setup     eigen eigen 3.2.9
28    revision            0
29    name                eigen3
30    conflicts           eigen3-devel
31
32    patchfiles          unsupported.patch
33
34    livecheck.regex     {Eigen (\d+(\.\d+)+) released}
35
36    checksums \
37        rmd160  0cbbc6c41414f0170d50ba40dc7b959f92587cef \
38        sha256  4d1e036ec1ed4f4805d5c6752b76072d67538889f4003fadf2f6e00a825845ff
39
40} else {
41    # No current development version (other than rolling snapshot)
42    bitbucket.setup     eigen eigen 3.3-rc1
43    revision            0
44    name                eigen3-devel
45    conflicts           eigen3
46
47    livecheck.regex     {development release.*>(\d+((-[a-z]+|\.)\d+)+)<}
48   
49    # rc version seen as older than beta
50    epoch               1 
51    checksums \
52        rmd160  15d771891b1f01304817fe6cb7335bea0d192397 \
53        sha256  ec5109cb4cfa2c7b728172d859f7ffef86ee35de78d3d40bbcc2ff78d8dcc854
54}
55
56homepage            http://eigen.tuxfamily.org/
57
58variant doc description \
59    {Place local documentation into <prefix>/share/doc/eigen3/html} {
60        depends_build-append    port:doxygen \
61                                port:texlive-latex \
62                                path:bin/dot:graphviz
63        build.target-append     doc
64}
65
66variant blas description \
67    {Build eigen's blas (libeigen_blas*) : needs +gccNN, +g95, or +gfortran} {
68        PortGroup               muniversal 1.0
69        build.target-append     blas
70        universal_variant       yes
71        configure.universal_args ""
72}
73
74configure.env-append    PKG_CONFIG_LIBDIR=${prefix}/lib/pkgconfig
75cmake.out_of_source     yes
76
77test.run            yes
78test.target         check
79test.env-append     EIGEN_MAKE_ARGS=-j{build.jobs} \
80                    EIGEN_CTEST_ARGS=-j{build.jobs}
81
82# Enable parallel builds
83build.env-append    EIGEN_MAKE_ARGS=-j{build.jobs}
84
85### END CMAKE SUPPORT
86
87# Setup compilers support / requirements
88
89if {[variant_isset blas]} {
90    compilers.choose    cc cxx cpp fc f77 f90
91    compilers.setup     require_fortran
92} elseif {[variant_isset doc]} {
93    compilers.choose    cc cxx cpp
94    compilers.setup     
95} else { 
96    # No architecture-dependent files installed; set noarch
97    supported_archs     noarch
98    compilers.setup
99}
100
101### Extra phases
102
103pre-extract {
104    file mkdir ${worksrcpath}
105}
106
107# Avoid issues when archive changes the top-level directory name
108extract.post_args-append -C ${worksrcpath} --strip-components 1
109
110# Install licenses and (if +doc) documentation
111pre-destroot {
112    set build_suffix {}
113    if {![info exists universal_archs_to_use]} {
114        lappend build_suffix ""
115    } else {
116        set dash "-"
117        foreach arch ${universal_archs_to_use} {
118            lappend build_suffix ${dash}${arch}
119        }
120    }
121
122    foreach sfx ${build_suffix} {
123        set docdir ${destroot}${sfx}${prefix}/share/doc/eigen3
124        xinstall -d ${docdir}
125        xinstall -m 644 -W ${worksrcpath} \
126            COPYING.GPL COPYING.LGPL ${docdir}
127
128        # Install documentation if requested
129        if {[variant_isset doc]} {
130            if {[string equal ${sfx} [lindex ${build_suffix} 0]]} {
131                # The documentation created is slightly different for each arch
132                # which makes muniversal hiccup. Just copy one set of docs
133                # into destroot directories.
134                file copy ${cmake.build_dir}${sfx}/doc/html ${docdir}
135            }
136        }
137
138        if {[variant_isset blas]} {
139            set libdir ${destroot}${sfx}${prefix}/lib
140            xinstall -d ${libdir}
141            eval file copy \
142                [glob ${cmake.build_dir}${sfx}/blas/libeigen_blas*] ${libdir}
143        }
144    }
145}
146
147post-destroot {
148    # Grab extra items install doesn't out of unsupported
149    foreach n {README.txt bench} {
150        file copy ${worksrcpath}/unsupported/${n} \
151            ${destroot}${prefix}/include/eigen3/unsupported
152    }
153
154    # Install FindEigen3.cmake file
155    xinstall -d ${destroot}${cmake_share_module_dir}
156    xinstall -m 444 ${worksrcpath}/cmake/FindEigen3.cmake \
157        ${destroot}${cmake_share_module_dir}
158}
159
160notes "
161This product includes software developed by the University of Chicago, as\
162Operator of Argonne National Laboratory.
163"
Note: See TracBrowser for help on using the repository browser.